Package adams.gui.core.dotnotationtree
Class DotNotationNode
- java.lang.Object
-
- javax.swing.tree.DefaultMutableTreeNode
-
- adams.gui.core.BaseTreeNode
-
- adams.gui.core.dotnotationtree.DotNotationNode
-
- All Implemented Interfaces:
Transferable,Serializable,Cloneable,MutableTreeNode,TreeNode
- Direct Known Subclasses:
ActorPathNode,ClassNode,StringTree.HierarchicalStringNode
public class DotNotationNode extends BaseTreeNode
Specialized tree node.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringm_Annotationan optional annotation.protected Stringm_Itemthe item.static StringMULTIPLE_ROOTthe label for the root node in case of multiple hierarchies.-
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
-
-
Constructor Summary
Constructors Constructor Description DotNotationNode(String label)Initializes the node with the specified label.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAnnotation()Returns the currently set annotation, if any.StringgetItem()Returns the full label.StringgetLabel()Returns the (partial) label for this node.StringgetSeparator()Returns the separator in use.booleanhasAnnotation()Checks whether an annotation is present.booleanisItemLeaf()Returns whether this node represents a leaf node in the sense of the end-point of the dot notation of the full label.booleanisLabelMatch(String s)Returns whether the label matches the specified string.voidsetAnnotation(String value)Sets the annotation to use, null to remove.StringtoString()Returns the plain text string/html string to display.TransferabletoTransferable()Turns the full label into a transferable string.-
Methods inherited from class adams.gui.core.BaseTreeNode
getChildren, getTransferData, getTransferDataFlavors, isDataFlavorSupported, toPlainText
-
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, 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
-
-
-
-
Field Detail
-
MULTIPLE_ROOT
public static final String MULTIPLE_ROOT
the label for the root node in case of multiple hierarchies.- See Also:
- Constant Field Values
-
m_Item
protected String m_Item
the item.
-
m_Annotation
protected String m_Annotation
an optional annotation.
-
-
Constructor Detail
-
DotNotationNode
public DotNotationNode(String label)
Initializes the node with the specified label.- Parameters:
label- the label for this node
-
-
Method Detail
-
getLabel
public String getLabel()
Returns the (partial) label for this node.- Returns:
- the partial label
-
isLabelMatch
public boolean isLabelMatch(String s)
Returns whether the label matches the specified string.- Parameters:
s- the string to match against the label- Returns:
- true if a match
-
isItemLeaf
public boolean isItemLeaf()
Returns whether this node represents a leaf node in the sense of the end-point of the dot notation of the full label. Custom trees might have additional information below this actual leaf node.
Default implementation just returns isLeaf() value.- Returns:
- true if leaf
-
getSeparator
public String getSeparator()
Returns the separator in use.- Returns:
- the separator
-
getItem
public String getItem()
Returns the full label.- Returns:
- the full label, null if not a leaf
-
setAnnotation
public void setAnnotation(String value)
Sets the annotation to use, null to remove.- Parameters:
value- the annotation to use
-
getAnnotation
public String getAnnotation()
Returns the currently set annotation, if any.- Returns:
- the annotation in use, null if none set
-
hasAnnotation
public boolean hasAnnotation()
Checks whether an annotation is present.- Returns:
- true if present
-
toTransferable
public Transferable toTransferable()
Turns the full label into a transferable string.- Overrides:
toTransferablein classBaseTreeNode- Returns:
- the generated string
- See Also:
getItem()
-
toString
public String toString()
Returns the plain text string/html string to display.- Overrides:
toStringin classDefaultMutableTreeNode- Returns:
- the display string
-
-