Class SoNodekitCatalog

java.lang.Object
com.openinventor.inventor.Inventor
com.openinventor.inventor.nodekits.SoNodekitCatalog

public class SoNodekitCatalog extends Inventor
Nodekit catalog class. This class describes the parts and structure of a nodekit. Each class of nodekit has one SoNodekitCatalog (a static variable for the class). Internally, the catalog contains one entry for each "part" in the nodekit's structure. Users can query the catalog for information about each entry in the catalog. This information can be obtained either by part name (a string unique for the part within the catalog) or by part number (an index into an array of parts).

Note that, although the catalog for a nodekit class may contain many entries, each instance of that class is not initially created with all of these parts intact. Rather, each instance of the class has its own parts list which keeps track of which parts the user has created. The nodekit uses the catalog as a guide in creating new nodes as its descendants; the standard addChild(), removeChild() and other SoGroup methods are protected, so that users must create descendants indirectly by asking the nodekit to get and/or set the different "parts" in the catalog.

The first entry in any SoNodekitCatalog corresponds to the nodekit itself. Its partName is "this" and its partNumber is 0. All other parts in the catalog are described relative to "this."

See Also:
  • Method Details

    • getDefaultClass

      public Class<? extends Inventor> getDefaultClass(int thePartNumber)
      Returns the default type of the specified part.
    • isPublic

      public boolean isPublic(String theName)
      Returns true if the specified part is public.
    • getClass

      public Class<? extends Inventor> getClass(int thePartNumber)
      Returns the type of the specified part.
    • getName

      public String getName(int thePartNumber)
      Given the part number of a part, returns its name in the catalog.
    • getPartNumber

      public int getPartNumber(String theName)
      Given the name of a part, returns its part number in the catalog.
    • getNumEntries

      public int getNumEntries()
      Returns the number of entries in the catalog.
    • getRightSiblingName

      public String getRightSiblingName(String theName)
      Returns the name of the right sibling of the specified part.
    • getClass

      public Class<? extends Inventor> getClass(String theName)
      Returns the type of the specified part.
    • getParentName

      public String getParentName(String theName)
      Returns the parent of the specified part.
    • isList

      public boolean isList(int thePartNumber)
      Returns true if the specified part is a parts list.
    • getParentName

      public String getParentName(int thePartNumber)
      Returns the parent of the specified part.
    • isList

      public boolean isList(String theName)
      Returns true if the specified part is a parts list.
    • getParentPartNumber

      public int getParentPartNumber(int thePartNumber)
      Returns the part number of the parent of the specified part.
    • getRightSiblingPartNumber

      public int getRightSiblingPartNumber(int thePartNumber)
      Returns the part number of the right sibling of the specified part.
    • getRightSiblingName

      public String getRightSiblingName(int thePartNumber)
      Returns the name of the right sibling of the specified part.
    • getRightSiblingPartNumber

      public int getRightSiblingPartNumber(String theName)
      Returns the part number of the right sibling of the specified part.
    • getParentPartNumber

      public int getParentPartNumber(String theName)
      Returns the part number of the parent of the specified part.
    • getListContainerClass

      public Class<? extends Inventor> getListContainerClass(int thePartNumber)
      Returns the list container type of the specified part.
    • isNullByDefault

      public boolean isNullByDefault(int thePartNumber)
      Returns true if the specified part is null by default.
    • getDefaultClass

      public Class<? extends Inventor> getDefaultClass(String theName)
      Returns the default type of the specified part.
    • isPublic

      public boolean isPublic(int thePartNumber)
      Returns true if the specified part is public.
    • isNullByDefault

      public boolean isNullByDefault(String theName)
      Returns true if the specified part is null by default.
    • getListContainerClass

      public Class<? extends Inventor> getListContainerClass(String theName)
      Returns the list container type of the specified part.
    • isLeaf

      public boolean isLeaf(String theName)
      Returns true if the specified part is a leaf node.
    • isLeaf

      public boolean isLeaf(int thePartNumber)
      Returns true if the specified part is a leaf node.