| |
|
| java.lang.Object javax.media.j3d.SceneGraphObject javax.media.j3d.Node javax.media.j3d.Leaf javax.media.j3d.AlternateAppearance
AlternateAppearance | public class AlternateAppearance extends Leaf (Code) | | The AlternateAppearance leaf node is used for overriding the
Appearance component of selected nodes. It defines an Appearance
component object and a region of influence in which this
AlternateAppearance node is active. An AlternateAppearance node
also contains a list of Group nodes that specifies the hierarchical
scope of this AlternateAppearance. If the scope list is empty,
then the AlternateAppearance node has universe scope: all nodes
within the region of influence are affected by this
AlternateAppearance node. If the scope list is non-empty, then
only those Leaf nodes under the Group nodes in the scope list are
affected by this AlternateAppearance node (subject to the
influencing bounds).
An AlternateAppearance node affects Shape3D and Morph nodes by
overriding their appearance component with the appearance
component in this AlternateAppearance node. Only those Shape3D and
Morph nodes that explicitly allow their appearance to be
overridden are affected. The AlternateAppearance node has no
effect on Shape3D and Morph nodes that do not allow their
appearance to be overridden.
If the regions of influence of multiple AlternateAppearance nodes
overlap, the Java 3D system will choose a single alternate
appearance for those objects that lie in the intersection. This is
done in an implementation-dependent manner, but in general, the
AlternateAppearance node that is "closest" to the object is chosen.
since: Java 3D 1.2 |
Field Summary | |
final public static int | ALLOW_APPEARANCE_READ Specifies that this AlternateAppearance node allows read access to
its appearance information. | final public static int | ALLOW_APPEARANCE_WRITE Specifies that this AlternateAppearance node allows write access to
its appearance information. | final public static int | ALLOW_INFLUENCING_BOUNDS_READ Specifies that this AlternateAppearance node allows read access to its
influencing bounds and bounds leaf information. | final public static int | ALLOW_INFLUENCING_BOUNDS_WRITE Specifies that this AlternateAppearance node allows write access to its
influencing bounds and bounds leaf information. | final public static int | ALLOW_SCOPE_READ Specifies that this AlternateAppearance node allows read access
to its scope information at runtime. | final public static int | ALLOW_SCOPE_WRITE Specifies that this AlternateAppearance node allows write access
to its scope information at runtime. |
Method Summary | |
public void | addScope(Group scope) Appends the specified Group node to this AlternateAppearance node's
list of scopes.
By default, AlternateAppearance nodes are scoped only by their
influencing
bounds. | public Node | cloneNode(boolean forceDuplicate) Used to create a new instance of the node. | void | createRetained() Creates the retained mode AlternateAppearanceRetained object that this
Alternate Appearance component object will point to. | void | duplicateAttributes(Node originalNode, boolean forceDuplicate) Copies all AlternateAppearance information from
originalNode into
the current node. | public Enumeration | getAllScopes() Returns an enumeration of this AlternateAppearance node's list
of scopes. | public Appearance | getAppearance() Retrieves the appearance from this AlternateAppearance node. | public BoundingLeaf | getInfluencingBoundingLeaf() Retrieves the AlternateAppearance node's influencing bounding leaf. | public Bounds | getInfluencingBounds() Retrieves the AlternateAppearance node's influencing bounds. | public Group | getScope(int index) Retrieves the Group node at the specified index from
this AlternateAppearance node's list of scopes.
Parameters: index - the index of the Group node to be returned. | public int | indexOfScope(Group scope) Retrieves the index of the specified Group node in this
AlternateAppearance node's list of scopes.
Parameters: scope - the Group node to be looked up. | public void | insertScope(Group scope, int index) Inserts the specified Group node into this AlternateAppearance node's
list of scopes at the specified index.
By default, AlternateAppearance nodes are scoped only by their
influencing
bounds. | public int | numScopes() Returns the number of nodes in this AlternateAppearance node's list
of scopes. | public void | removeAllScopes() Removes all Group nodes from this AlternateAppearance node's
list of scopes. | public void | removeScope(int index) Removes the node at the specified index from this AlternateAppearance
node's
list of scopes. | public void | removeScope(Group scope) Removes the specified Group node from this AlternateAppearance
node's list of scopes. | public void | setAppearance(Appearance appearance) Sets the appearance of this AlternateAppearance node. | public void | setInfluencingBoundingLeaf(BoundingLeaf region) Sets the AlternateAppearance's influencing region to the specified
bounding leaf. | public void | setInfluencingBounds(Bounds region) Sets the AlternateAppearance's influencing region to the specified
bounds. | public void | setScope(Group scope, int index) Replaces the node at the specified index in this
AlternateAppearance node's
list of scopes with the specified Group node.
By default, AlternateAppearance nodes are scoped only by their
influencing
bounds. | public void | updateNodeReferences(NodeReferenceTable referenceTable) Callback used to allow a node to check if any nodes referenced
by that node have been duplicated via a call to cloneTree .
This method is called by cloneTree after all nodes in
the sub-graph have been duplicated. |
ALLOW_APPEARANCE_READ | final public static int ALLOW_APPEARANCE_READ(Code) | | Specifies that this AlternateAppearance node allows read access to
its appearance information.
|
ALLOW_APPEARANCE_WRITE | final public static int ALLOW_APPEARANCE_WRITE(Code) | | Specifies that this AlternateAppearance node allows write access to
its appearance information.
information.
|
ALLOW_INFLUENCING_BOUNDS_READ | final public static int ALLOW_INFLUENCING_BOUNDS_READ(Code) | | Specifies that this AlternateAppearance node allows read access to its
influencing bounds and bounds leaf information.
|
ALLOW_INFLUENCING_BOUNDS_WRITE | final public static int ALLOW_INFLUENCING_BOUNDS_WRITE(Code) | | Specifies that this AlternateAppearance node allows write access to its
influencing bounds and bounds leaf information.
|
ALLOW_SCOPE_READ | final public static int ALLOW_SCOPE_READ(Code) | | Specifies that this AlternateAppearance node allows read access
to its scope information at runtime.
|
ALLOW_SCOPE_WRITE | final public static int ALLOW_SCOPE_WRITE(Code) | | Specifies that this AlternateAppearance node allows write access
to its scope information at runtime.
|
AlternateAppearance | public AlternateAppearance()(Code) | | Constructs an AlternateAppearance node with default
parameters. The default values are as follows:
appearance : null
scope : empty (universe scope)
influencing bounds : null
influencing bounding leaf : null
|
AlternateAppearance | public AlternateAppearance(Appearance appearance)(Code) | | Constructs an AlternateAppearance node with the specified appearance.
Parameters: appearance - the appearance that is used for those nodes affectedby this AlternateAppearance node. |
addScope | public void addScope(Group scope)(Code) | | Appends the specified Group node to this AlternateAppearance node's
list of scopes.
By default, AlternateAppearance nodes are scoped only by their
influencing
bounds. This allows them to be further scoped by a list of
nodes in the hierarchy.
Parameters: scope - the Group node to be appended. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph exception: RestrictedAccessException - if the specified group nodeis part of a compiled scene graph |
cloneNode | public Node cloneNode(boolean forceDuplicate)(Code) | | Used to create a new instance of the node. This routine is called
by cloneTree to duplicate the current node.
Parameters: forceDuplicate - when set to true , causes theduplicateOnCloneTree flag to be ignored. Whenfalse , the value of each node'sduplicateOnCloneTree variable determines whetherNodeComponent data is duplicated or copied. See Also: Node.cloneTree See Also: Node.cloneNode See Also: Node.duplicateNode See Also: NodeComponent.setDuplicateOnCloneTree |
createRetained | void createRetained()(Code) | | Creates the retained mode AlternateAppearanceRetained object that this
Alternate Appearance component object will point to.
|
duplicateAttributes | void duplicateAttributes(Node originalNode, boolean forceDuplicate)(Code) | | Copies all AlternateAppearance information from
originalNode into
the current node. This method is called from the
cloneNode method which is, in turn, called by the
cloneTree method.
Parameters: originalNode - the original node to duplicate. Parameters: forceDuplicate - when set to true , causes theduplicateOnCloneTree flag to be ignored. Whenfalse , the value of each node'sduplicateOnCloneTree variable determines whetherNodeComponent data is duplicated or copied. exception: RestrictedAccessException - if this object is part of a liveor compiled scenegraph. See Also: Node.duplicateNode See Also: Node.cloneTree See Also: NodeComponent.setDuplicateOnCloneTree |
getAllScopes | public Enumeration getAllScopes()(Code) | | Returns an enumeration of this AlternateAppearance node's list
of scopes.
an Enumeration object containing all nodes in thisAlternateAppearance node's list of scopes. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
getAppearance | public Appearance getAppearance()(Code) | | Retrieves the appearance from this AlternateAppearance node.
the current appearance. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
getInfluencingBoundingLeaf | public BoundingLeaf getInfluencingBoundingLeaf()(Code) | | Retrieves the AlternateAppearance node's influencing bounding leaf.
this AlternateAppearance's influencing bounding leaf information exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
getInfluencingBounds | public Bounds getInfluencingBounds()(Code) | | Retrieves the AlternateAppearance node's influencing bounds.
this AlternateAppearance's influencing bounds information exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
getScope | public Group getScope(int index)(Code) | | Retrieves the Group node at the specified index from
this AlternateAppearance node's list of scopes.
Parameters: index - the index of the Group node to be returned. the Group node at the specified index. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
indexOfScope | public int indexOfScope(Group scope)(Code) | | Retrieves the index of the specified Group node in this
AlternateAppearance node's list of scopes.
Parameters: scope - the Group node to be looked up. the index of the specified Group node;returns -1 if the object is not in the list. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph since: Java 3D 1.3 |
insertScope | public void insertScope(Group scope, int index)(Code) | | Inserts the specified Group node into this AlternateAppearance node's
list of scopes at the specified index.
By default, AlternateAppearance nodes are scoped only by their
influencing
bounds. This allows them to be further scoped by a list of
nodes in the hierarchy.
Parameters: scope - the Group node to be inserted at the specified index. Parameters: index - the index at which the Group node is inserted. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph exception: RestrictedAccessException - if the specified group nodeis part of a compiled scene graph |
numScopes | public int numScopes()(Code) | | Returns the number of nodes in this AlternateAppearance node's list
of scopes.
If this number is 0, then the list of scopes is empty and this
AlternateAppearance node has universe scope: all nodes within the
region of
influence are affected by this AlternateAppearance node.
the number of nodes in this AlternateAppearance node's listof scopes. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
removeAllScopes | public void removeAllScopes()(Code) | | Removes all Group nodes from this AlternateAppearance node's
list of scopes. The AlternateAppearance node will then have
universe scope: all nodes within the region of influence will
be affected by this AlternateAppearance node.
exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph exception: RestrictedAccessException - if any group node in thisnode's list of scopes is part of a compiled scene graph since: Java 3D 1.3 |
removeScope | public void removeScope(int index)(Code) | | Removes the node at the specified index from this AlternateAppearance
node's
list of scopes. If this operation causes the list of scopes to
become empty, then this AlternateAppearance will have universe scope:
all nodes
within the region of influence will be affected by this
AlternateAppearance node.
Parameters: index - the index of the Group node to be removed. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph exception: RestrictedAccessException - if the group node at thespecified index is part of a compiled scene graph |
removeScope | public void removeScope(Group scope)(Code) | | Removes the specified Group node from this AlternateAppearance
node's list of scopes. If the specified object is not in the
list, the list is not modified. If this operation causes the
list of scopes to become empty, then this AlternateAppearance
will have universe scope: all nodes within the region of
influence will be affected by this AlternateAppearance node.
Parameters: scope - the Group node to be removed. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph exception: RestrictedAccessException - if the specified group nodeis part of a compiled scene graph since: Java 3D 1.3 |
setAppearance | public void setAppearance(Appearance appearance)(Code) | | Sets the appearance of this AlternateAppearance node.
This appearance overrides the appearance in those Shape3D and
Morph nodes affected by this AlternateAppearance node.
Parameters: appearance - the new appearance. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
setInfluencingBoundingLeaf | public void setInfluencingBoundingLeaf(BoundingLeaf region)(Code) | | Sets the AlternateAppearance's influencing region to the specified
bounding leaf.
When set to a value other than null, this overrides the influencing
bounds object.
Parameters: region - the bounding leaf node used to specify theAlternateAppearance node's new influencing region. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
setInfluencingBounds | public void setInfluencingBounds(Bounds region)(Code) | | Sets the AlternateAppearance's influencing region to the specified
bounds.
This is used when the influencing bounding leaf is set to null.
Parameters: region - the bounds that contains the AlternateAppearance'snew influencing region. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
setScope | public void setScope(Group scope, int index)(Code) | | Replaces the node at the specified index in this
AlternateAppearance node's
list of scopes with the specified Group node.
By default, AlternateAppearance nodes are scoped only by their
influencing
bounds. This allows them to be further scoped by a list of
nodes in the hierarchy.
Parameters: scope - the Group node to be stored at the specified index. Parameters: index - the index of the Group node to be replaced. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph exception: RestrictedAccessException - if the specified group nodeis part of a compiled scene graph |
updateNodeReferences | public void updateNodeReferences(NodeReferenceTable referenceTable)(Code) | | Callback used to allow a node to check if any nodes referenced
by that node have been duplicated via a call to cloneTree .
This method is called by cloneTree after all nodes in
the sub-graph have been duplicated. The cloned Leaf node's method
will be called and the Leaf node can then look up any node references
by using the getNewObjectReference method found in the
NodeReferenceTable object. If a match is found, a
reference to the corresponding Node in the newly cloned sub-graph
is returned. If no corresponding reference is found, either a
DanglingReferenceException is thrown or a reference to the original
node is returned depending on the value of the
allowDanglingReferences parameter passed in the
cloneTree call.
NOTE: Applications should not call this method directly.
It should only be called by the cloneTree method.
Parameters: referenceTable - a NodeReferenceTableObject that contains thegetNewObjectReference method needed to search fornew object instances. See Also: NodeReferenceTable See Also: Node.cloneTree See Also: DanglingReferenceException |
|
|
|