Package jmri
Class CatalogTreeNode
java.lang.Object
javax.swing.tree.DefaultMutableTreeNode
jmri.util.swing.DefaultMutableTreeNode
jmri.CatalogTreeNode
- All Implemented Interfaces:
Serializable,Cloneable,MutableTreeNode,TreeNode
Node of a CatalogTree.
Name for the node Path is info needed for leafs.
- See Also:
-
Field Summary
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidInsert leaf according to height.voidaddLeaf(CatalogTreeLeaf leaf) Append leaf to the end of the leafs list.children()voiddeleteLeaf(String name, String path) voiddeleteLeaves(String name) Leafs can be used for many-to-many relations.Leafs can be used for many-to-many relations.intvoidsetLeaves(ArrayList<CatalogTreeLeaf> leafs) Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toString
-
Constructor Details
-
CatalogTreeNode
-
-
Method Details
-
addLeaf
Append leaf to the end of the leafs list.- Parameters:
leaf- the leaf to add
-
addLeaf
Insert leaf according to height. Dan Boudreau 10/15/2018 eliminated the check for valid icon and the sorting of the icons by height. Improves load time at initialization by an order of magnitude.- Parameters:
name- name of the new leafpath- path to the new leaf
-
deleteLeaves
Leafs can be used for many-to-many relations.- Parameters:
name- the leafs to remove
-
deleteLeaf
-
getLeaf
-
getLeaves
Leafs can be used for many-to-many relations.- Parameters:
name- name of the leafs to get- Returns:
- a list of matching leafs; an empty list if there are no matching leafs
-
children
- Specified by:
childrenin interfaceTreeNode- Overrides:
childrenin classDefaultMutableTreeNode
-
getLeaves
-
getNumLeaves
-
setLeaves
-