Package com.ribsapp.shapes
Class RBDocument.MenuTreeNode
java.lang.Object
javax.swing.tree.DefaultMutableTreeNode
com.ribsapp.shapes.RBDocument.MenuTreeNode
- All Implemented Interfaces:
Serializable,Cloneable,MutableTreeNode,TreeNode
- Enclosing class:
- RBDocument
This inner class models MenuBars, Menus and MenuItems as TreeNodes.
- See Also:
-
Field Summary
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject -
Constructor Summary
ConstructorsConstructorDescriptionMenuTreeNode(Object aSource) MenuTreeNode(Object aSource, DefaultMutableTreeNode aParent) -
Method Summary
Modifier and TypeMethodDescriptionvoidchildren()booleanbooleanstatic ObjectgetChildAt(int index) intstatic intgetChildCount(Object parent) intgetName()booleanisLeaf()booleanmoveChild(RBDocument.MenuTreeNode aMenuElement, boolean moveEarlier) Rearrange a child menu item in children or grandchildrenvoidremove(RBDocument.MenuTreeNode aMenuElement) remove a child menu elementvoidvoidtoString()Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, clone, depthFirstEnumeration, getChildAfter, getChildBefore, getDepth, getFirstChild, getFirstLeaf, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject
-
Constructor Details
-
MenuTreeNode
-
MenuTreeNode
-
-
Method Details
-
children
- Specified by:
childrenin interfaceTreeNode- Overrides:
childrenin classDefaultMutableTreeNode
-
getAllowsChildren
public boolean getAllowsChildren()- Specified by:
getAllowsChildrenin interfaceTreeNode- Overrides:
getAllowsChildrenin classDefaultMutableTreeNode
-
getChildAt
- Specified by:
getChildAtin interfaceTreeNode- Overrides:
getChildAtin classDefaultMutableTreeNode
-
getChildCount
public int getChildCount()- Specified by:
getChildCountin interfaceTreeNode- Overrides:
getChildCountin classDefaultMutableTreeNode
-
getIndex
- Specified by:
getIndexin interfaceTreeNode- Overrides:
getIndexin classDefaultMutableTreeNode
-
isLeaf
public boolean isLeaf()- Specified by:
isLeafin interfaceTreeNode- Overrides:
isLeafin classDefaultMutableTreeNode
-
toString
- Overrides:
toStringin classDefaultMutableTreeNode
-
equals
-
getSource
-
getName
-
setName
-
setText
-
getChildren
-
getChild
-
getChildCount
-
add
-
remove
remove a child menu element -
moveChild
Rearrange a child menu item in children or grandchildren- Parameters:
aMenuElement- the item to movemoveEarlier- true if the new index is lower than the old, false if the new index is higher than the old- Returns:
- whether the item was found
-