Class SoNodeKitListPart
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.misc.SoBase
-
- com.openinventor.inventor.fields.SoFieldContainer
-
- com.openinventor.inventor.nodes.SoNode
-
- com.openinventor.inventor.nodekits.SoNodeKitListPart
-
- All Implemented Interfaces:
SafeDisposable
public class SoNodeKitListPart extends SoNode
Group node with restricted children. This node class is very similar toSoGroup
with the exception that it specifies restrictions on the type of children that it allows. It is used by nodekits to restrict child types within list parts (see the reference page forSoBaseKit
).By default, any kind of child may be added. Methods of this class allow you to restrict the type of allowable children, and to lock down the types so that this type list may no longer be altered.
Inside the
SoNodeKitListPart
is a container node, which in turn contains the children . The container node is a hidden child, and the type of node used may be set withsetContainerType()
. In this way, you can make the nodekitlist behave like a group, a separator, or any other subclass of group. The container is not accessible so that the nodekitlist may retain control over what kinds of children are added.File format/default:
NodeKitListPart {
containerTypeName "Group" childTypeNames "" containerNode NULL
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.openinventor.inventor.nodes.SoNode
SoNode.RenderModes
-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Constructor Summary
Constructors Constructor Description SoNodeKitListPart()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChild(SoNode child)
Adds child as last one in nodekit.void
addChildClass(java.lang.Class<? extends Inventor> typeToAdd)
Permits the node type typeToAdd as a child.void
containerSet(java.lang.String fieldDataString)
Sends a string to theset()
method on the container node.int
findChild(SoNode child)
Finds index of given child within nodekit.SoNode
getChild(int index)
Returns the child node with the given index.java.lang.Class<? extends Inventor>
getContainerClass()
Gets the type of node used as the container .int
getNumChildren()
Returns the number of children in the nodekit.void
insertChild(SoNode child, int childIndex)
Adds a child so that it becomes the one with the given index.boolean
isChildPermitted(SoNode child)
Returns whether the node child may be added to this list.boolean
isTypeLocked()
Returns whether the permitted child types and the container type are locked (i.e.boolean
isTypePermitted(java.lang.Class<? extends Inventor> typeToCheck)
Returns whether a node of type typeToCheck may be added as a child.void
lockTypes()
This function permanently locks the permitted child types and the container type permanently.void
removeChild(int index)
Removes child with given index from the nodekit.void
removeChild(SoNode child)
Removes first instance of given child from nodekit.void
replaceChild(int index, SoNode newChild)
Replaces child with given index with new child.void
replaceChild(SoNode oldChild, SoNode newChild)
Replaces first instance of given child with new child.void
setContainerClass(java.lang.Class<? extends Inventor> newContainerType)
Sets the type of node used as the container .-
Methods inherited from class com.openinventor.inventor.nodes.SoNode
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderEngineMode, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, write
-
Methods inherited from class com.openinventor.inventor.fields.SoFieldContainer
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
-
Methods inherited from class com.openinventor.inventor.misc.SoBase
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable
-
Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
-
-
-
Method Detail
-
getNumChildren
public int getNumChildren()
-
getContainerClass
public java.lang.Class<? extends Inventor> getContainerClass()
Gets the type of node used as the container .
-
removeChild
public void removeChild(SoNode child)
-
addChild
public void addChild(SoNode child)
-
replaceChild
public void replaceChild(int index, SoNode newChild)
-
insertChild
public void insertChild(SoNode child, int childIndex)
-
findChild
public int findChild(SoNode child)
-
getChild
public SoNode getChild(int index)
-
removeChild
public void removeChild(int index)
-
isTypeLocked
public boolean isTypeLocked()
Returns whether the permitted child types and the container type are locked (i.e. cannot be changed). SeelockTypes()
-
isTypePermitted
public boolean isTypePermitted(java.lang.Class<? extends Inventor> typeToCheck)
Returns whether a node of type typeToCheck may be added as a child.
-
addChildClass
public void addChildClass(java.lang.Class<? extends Inventor> typeToAdd)
Permits the node type typeToAdd as a child. The first time theaddChildType()
method is called, the default ofSoNode
is overridden and only the new typeToAdd is permitted. In subsequent calls toaddChildType()
, the typeToAdd is added to the existing types.
-
setContainerClass
public void setContainerClass(java.lang.Class<? extends Inventor> newContainerType)
Sets the type of node used as the container .
-
isChildPermitted
public boolean isChildPermitted(SoNode child)
Returns whether the node child may be added to this list. This will return true if the type of child is one of the permissible child types.
-
lockTypes
public void lockTypes()
This function permanently locks the permitted child types and the container type permanently. Calls tosetContainerType()
andaddChildType()
will have no effect after this function is called.
-
containerSet
public void containerSet(java.lang.String fieldDataString)
-
-