Class Node
- java.lang.Object
-
- javax.swing.tree.DefaultMutableTreeNode
-
- adams.gui.core.BaseTreeNode
-
- adams.gui.visualization.debug.objecttree.Node
-
- All Implemented Interfaces:
Transferable
,Serializable
,Cloneable
,MutableTreeNode
,TreeNode
public class Node extends BaseTreeNode
Node for displaying a single property of an object.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static Map<Class,List<AbstractPropertyExtractor>>
m_ExtractorCache
caching the class / extractors relation.protected boolean
m_Initialized
whether the node has been initialized.protected static Map<Class,List<AbstractInspectionHandler>>
m_InspectionHandlerCache
caching the class / inspection handler relation.protected NodeType
m_NodeType
the node type.protected Tree
m_Owner
the tree this node belongs to.protected String
m_Property
the name of the property.-
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addArray(Object obj)
Adds the array below the parent.protected void
doExpand()
Adds the properties of this object as children.void
expand()
Expands the node (forced).void
expandIfNecessary()
Expands the node if necessary.NodeType
getNodeType()
Returns the node type.Tree
getOwner()
Returns the tree this node belongs to.Node
getParent()
Returns the parent of this node.String
getProperty()
Returns the property.String[]
getPropertyPath()
Returns the property path from the root to this node.boolean
isArray()
Returns whether the stored object is an array.String
toPlainText()
Returns the property name of the user object.String
toRepresentation()
Returns a string representation of the stored object.String
toString()
Returns the property name of the user object.-
Methods inherited from class adams.gui.core.BaseTreeNode
getChildren, getTransferData, getTransferDataFlavors, isDataFlavorSupported, toTransferable
-
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, 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
-
-
-
-
Field Detail
-
m_Owner
protected Tree m_Owner
the tree this node belongs to.
-
m_Property
protected String m_Property
the name of the property.
-
m_NodeType
protected NodeType m_NodeType
the node type.
-
m_Initialized
protected boolean m_Initialized
whether the node has been initialized.
-
m_ExtractorCache
protected static Map<Class,List<AbstractPropertyExtractor>> m_ExtractorCache
caching the class / extractors relation.
-
m_InspectionHandlerCache
protected static Map<Class,List<AbstractInspectionHandler>> m_InspectionHandlerCache
caching the class / inspection handler relation.
-
-
Constructor Detail
-
Node
public Node(Tree owner, Node parent, String property, Object obj)
Initializes the node.- Parameters:
owner
- the tree this node belongs toparent
- the parent of this node, null for rootproperty
- the name of the property the object belongs toobj
- the obj to display
-
Node
public Node(Tree owner, Node parent, String property, Object obj, NodeType type)
Initializes the node.- Parameters:
owner
- the tree this node belongs toparent
- the parent of this node, null for rootproperty
- the name of the property the object belongs toobj
- the obj to displaytype
- the type of node
-
-
Method Detail
-
getOwner
public Tree getOwner()
Returns the tree this node belongs to.- Returns:
- the tree
-
getParent
public Node getParent()
Returns the parent of this node.- Specified by:
getParent
in interfaceTreeNode
- Overrides:
getParent
in classDefaultMutableTreeNode
- Returns:
- the parent, null for root
-
addArray
protected void addArray(Object obj)
Adds the array below the parent.- Parameters:
obj
- the array to add
-
doExpand
protected void doExpand()
Adds the properties of this object as children.
-
expand
public void expand()
Expands the node (forced).
-
expandIfNecessary
public void expandIfNecessary()
Expands the node if necessary.
-
getProperty
public String getProperty()
Returns the property.- Returns:
- the property
-
getNodeType
public NodeType getNodeType()
Returns the node type.- Returns:
- the node type
-
isArray
public boolean isArray()
Returns whether the stored object is an array.- Returns:
- true if the stored object is an array
-
toRepresentation
public String toRepresentation()
Returns a string representation of the stored object.- Returns:
- the string representation
-
toString
public String toString()
Returns the property name of the user object.- Overrides:
toString
in classDefaultMutableTreeNode
- Returns:
- the property name
-
toPlainText
public String toPlainText()
Returns the property name of the user object.- Overrides:
toPlainText
in classBaseTreeNode
- Returns:
- the property name
-
getPropertyPath
public String[] getPropertyPath()
Returns the property path from the root to this node.- Returns:
- the individual property names
-
-