< Zurück | Inhalt | Weiter >

5.5 Switch










The Switch Node provides the facility to define a Group Node that can conditionally display or hide its child Nodes (see table 5.4).

Table 5.4 Switch Node modes


Usage example

All child Nodes

new Switch( Switch.CHILD_ALL )

No child Nodes

new Switch( Switch.CHILD_NONE )

A single child Node

switchNode.setWhichChild( nIndex )

Specifiable child Nodes

new Switch( Switch.CHILD_MASK ), switchNode.setChildMask( java.util.BitSet childMask )

For example, to create a Switch Node that displays child Nodes at index 3, 6, and 7 use the following:


From SwitchTest.java