All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.media.j3d.Switch

java.lang.Object
   |
   +----java.media.j3d.SceneGraphObject
           |
           +----java.media.j3d.Node
                   |
                   +----java.media.j3d.Group
                           |
                           +----java.media.j3d.Switch

public class Switch
extends Group
The switch node controls which one of its children will be rendered.


Variable Index

 o ALLOW_SWITCH_READ
For Switch nodes, specifies that the node allows reading its switch value.
 o ALLOW_SWITCH_WRITE
For Switch nodes, specifies that the node allows writing its switch value.
 o CHILD_ALL
 o CHILD_MASK
 o CHILD_NONE
These values are used to determine which children are selected for rendering.

Constructor Index

 o Switch()
Constructs and initializes a switch node with a default choice of the first child.
 o Switch(int)
Constructs and initializes a switch node.
 o Switch(int, BitSet)
Constructs and initializes a switch node.

Method Index

 o currentChild()
Returns this node's current child.
 o getChildMask()
Returns the current childMask.
 o getWhichChild()
Returns the index of the current child.
 o setChildMask(BitSet)
Sets current childMask.
 o setWhichChild(int)
Sets which child should be drawn.

Variables

 o ALLOW_SWITCH_READ
 public static final int ALLOW_SWITCH_READ
For Switch nodes, specifies that the node allows reading its switch value.

 o ALLOW_SWITCH_WRITE
 public static final int ALLOW_SWITCH_WRITE
For Switch nodes, specifies that the node allows writing its switch value.

 o CHILD_NONE
 public static final int CHILD_NONE
These values are used to determine which children are selected for rendering. A value of CHILD_NONE indicates no child is selected, a value of CHILD_ALL indicates all children are rendered, making switch node as an ordinary group node and a value of CHILD_MASK indicates that the childMask BitSet is used to select children for rendering.

 o CHILD_ALL
 public static final int CHILD_ALL
 o CHILD_MASK
 public static final int CHILD_MASK

Constructors

 o Switch
 public Switch(int whichChild)
Constructs and initializes a switch node.

Parameters:
whichChild - the default child to choose
 o Switch
 public Switch()
Constructs and initializes a switch node with a default choice of the first child.

 o Switch
 public Switch(int whichChild,
               BitSet childMask)
Constructs and initializes a switch node.

Parameters:
whichChild - the child to be chosen
childMask - the childMask BitSet for child selection

Methods

 o setWhichChild
 public final void setWhichChild(int child)
Sets which child should be drawn.

Parameters:
child - an integer specifying which child to render
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o getWhichChild
 public final int getWhichChild()
Returns the index of the current child.

Returns:
the index of the current child to render
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o setChildMask
 public final void setChildMask(BitSet childMask)
Sets current childMask.

Parameters:
childMask - a BitSet to select the children for rendering
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o getChildMask
 public final BitSet getChildMask()
Returns the current childMask.

Returns:
the current childMask
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o currentChild
 public final Node currentChild()
Returns this node's current child.

Returns:
a reference to the current child chosen for rendering
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph

All Packages  Class Hierarchy  This Package  Previous  Next  Index