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 TypeMethodDescriptionvoid
children()
boolean
boolean
static Object
getChildAt
(int index) int
static int
getChildCount
(Object parent) int
getName()
boolean
isLeaf()
boolean
moveChild
(RBDocument.MenuTreeNode aMenuElement, boolean moveEarlier) Rearrange a child menu item in children or grandchildrenvoid
remove
(RBDocument.MenuTreeNode aMenuElement) remove a child menu elementvoid
void
toString()
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:
children
in interfaceTreeNode
- Overrides:
children
in classDefaultMutableTreeNode
-
getAllowsChildren
public boolean getAllowsChildren()- Specified by:
getAllowsChildren
in interfaceTreeNode
- Overrides:
getAllowsChildren
in classDefaultMutableTreeNode
-
getChildAt
- Specified by:
getChildAt
in interfaceTreeNode
- Overrides:
getChildAt
in classDefaultMutableTreeNode
-
getChildCount
public int getChildCount()- Specified by:
getChildCount
in interfaceTreeNode
- Overrides:
getChildCount
in classDefaultMutableTreeNode
-
getIndex
- Specified by:
getIndex
in interfaceTreeNode
- Overrides:
getIndex
in classDefaultMutableTreeNode
-
isLeaf
public boolean isLeaf()- Specified by:
isLeaf
in interfaceTreeNode
- Overrides:
isLeaf
in classDefaultMutableTreeNode
-
toString
- Overrides:
toString
in 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
-