| java.lang.Object javax.media.j3d.SceneGraphObject javax.media.j3d.Node javax.media.j3d.Group javax.media.j3d.Switch
Switch | public class Switch extends Group (Code) | | The Switch node controls which of its children will be rendered.
It defines a child selection value (a switch value) that can either
select a single child, or it can select 0 or more children using a
mask to indicate which children are selected for rendering.
The Switch node contains an ordered list of children, but the
index order of the children in the list is only used for selecting
the appropriate child or children and does not specify rendering
order.
|
Field Summary | |
final public static int | ALLOW_SWITCH_READ Specifies that this node allows reading its child selection
and mask values and its current child. | final public static int | ALLOW_SWITCH_WRITE Specifies that this node allows writing its child selection
and mask values. | final public static int | CHILD_ALL Specifies that all children are rendered. | final public static int | CHILD_MASK Specifies that the childMask BitSet is
used to select which children are rendered. | final public static int | CHILD_NONE Specifies that no children are rendered. |
Constructor Summary | |
public | Switch() Constructs a Switch node with default parameters. | public | Switch(int whichChild) Constructs and initializes a Switch node using the specified
child selection index. | public | Switch(int whichChild, BitSet childMask) Constructs and initializes a Switch node using the specified
child selection index and mask. |
Method Summary | |
public Node | cloneNode(boolean forceDuplicate) Used to create a new instance of the node. | void | createRetained() Creates the retained mode SwitchRetained object that this
Switch object will point to. | public Node | currentChild() Retrieves the currently selected child. | void | duplicateAttributes(Node originalNode, boolean forceDuplicate) Copies all Switch information from
originalNode into
the current node. | public BitSet | getChildMask() Retrieves the current child selection mask. | public int | getWhichChild() Retrieves the current child selection index that specifies which
child is rendered. | public void | setChildMask(BitSet childMask) Sets the child selection mask. | public void | setWhichChild(int child) Sets the child selection index that specifies which child is rendered. |
ALLOW_SWITCH_READ | final public static int ALLOW_SWITCH_READ(Code) | | Specifies that this node allows reading its child selection
and mask values and its current child.
|
ALLOW_SWITCH_WRITE | final public static int ALLOW_SWITCH_WRITE(Code) | | Specifies that this node allows writing its child selection
and mask values.
|
CHILD_ALL | final public static int CHILD_ALL(Code) | | Specifies that all children are rendered. This setting causes
the switch node to function as an ordinary group node.
This value may be used in place of a non-negative child
selection index.
|
CHILD_MASK | final public static int CHILD_MASK(Code) | | Specifies that the childMask BitSet is
used to select which children are rendered.
This value may be used in place of a non-negative child
selection index.
|
CHILD_NONE | final public static int CHILD_NONE(Code) | | Specifies that no children are rendered.
This value may be used in place of a non-negative child
selection index.
|
Switch | public Switch()(Code) | | Constructs a Switch node with default parameters.
The default values are as follows:
child selection index : CHILD_NONE
child selection mask : false (for all children)
|
Switch | public Switch(int whichChild)(Code) | | Constructs and initializes a Switch node using the specified
child selection index.
Parameters: whichChild - the initial child selection index |
Switch | public Switch(int whichChild, BitSet childMask)(Code) | | Constructs and initializes a Switch node using the specified
child selection index and mask.
Parameters: whichChild - the initial child selection index Parameters: childMask - the initial child selection mask |
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 SwitchRetained object that this
Switch object will point to.
|
currentChild | public Node currentChild()(Code) | | Retrieves the currently selected child. If the child selection index
is out of range or is set to CHILD_NONE, CHILD_ALL, or CHILD_MASK,
then this method returns null.
a reference to the current child chosen for rendering exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
duplicateAttributes | void duplicateAttributes(Node originalNode, boolean forceDuplicate)(Code) | | Copies all Switch 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: Group.cloneNode See Also: Node.duplicateNode See Also: Node.cloneTree See Also: NodeComponent.setDuplicateOnCloneTree |
getChildMask | public BitSet getChildMask()(Code) | | Retrieves the current child selection mask. This mask is used when
the child selection index is set to CHILD_MASK.
the child selection mask exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
getWhichChild | public int getWhichChild()(Code) | | Retrieves the current child selection index that specifies which
child is rendered.
a non-negative integer index value, indicating aspecific child, or one of the following constants: CHILD_NONE,CHILD_ALL, or CHILD_MASK exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph See Also: Switch.CHILD_NONE See Also: Switch.CHILD_ALL See Also: Switch.CHILD_MASK |
setChildMask | public void setChildMask(BitSet childMask)(Code) | | Sets the child selection mask. This mask is used when
the child selection index is set to CHILD_MASK.
Parameters: childMask - a BitSet that specifies which children are rendered exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
setWhichChild | public void setWhichChild(int child)(Code) | | Sets the child selection index that specifies which child is rendered.
If the value is out of range, then no children are drawn.
Parameters: child - a non-negative integer index value, indicating aspecific child, or one of the following constants: CHILD_NONE,CHILD_ALL, or CHILD_MASK. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph See Also: Switch.CHILD_NONE See Also: Switch.CHILD_ALL See Also: Switch.CHILD_MASK |
|
|