Package adams.gui.core.dotnotationtree
Class AbstractInfoNode
- java.lang.Object
-
- javax.swing.tree.DefaultMutableTreeNode
-
- adams.gui.core.BaseTreeNode
-
- adams.gui.core.dotnotationtree.AbstractInfoNode
-
- All Implemented Interfaces:
Transferable
,Serializable
,Cloneable
,MutableTreeNode
,TreeNode
- Direct Known Subclasses:
GlobalInfoNode
public abstract class AbstractInfoNode extends BaseTreeNode
Abstract class for nodes that display some kind of information.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Icon
m_Icon
the icon to use in the tree.protected String
m_Label
the label this info node is for.-
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
-
-
Constructor Summary
Constructors Constructor Description AbstractInfoNode(String label)
Initializes the node.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Icon
getIcon()
Returns the icon to use in the tree.protected abstract String
getIconName()
Returns the name of the icon to use for display in the tree.String
getItem()
Returns the item that this info node is for.protected String
toHtml(String s, int width)
Breaks up the string into lines and generates valid HTML.-
Methods inherited from class adams.gui.core.BaseTreeNode
getChildren, getTransferData, getTransferDataFlavors, isDataFlavorSupported, toPlainText, 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, 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 Detail
-
AbstractInfoNode
public AbstractInfoNode(String label)
Initializes the node.- Parameters:
label
- the label
-
-
Method Detail
-
getItem
public String getItem()
Returns the item that this info node is for.- Returns:
- the item
-
toHtml
protected String toHtml(String s, int width)
Breaks up the string into lines and generates valid HTML.- Parameters:
s
- the string to processwidth
- the width in characters when breaking up into lines- Returns:
- the generated HTML
-
getIconName
protected abstract String getIconName()
Returns the name of the icon to use for display in the tree.- Returns:
- the name (no path)
-
getIcon
public Icon getIcon()
Returns the icon to use in the tree.- Returns:
- the icon
-
-