Package jadex.base.gui.idtree
Class IdTreeNode<T>
- java.lang.Object
-
- javax.swing.tree.DefaultMutableTreeNode
-
- jadex.base.gui.idtree.IdTreeNode<T>
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,javax.swing.tree.MutableTreeNode
,javax.swing.tree.TreeNode
public class IdTreeNode<T> extends javax.swing.tree.DefaultMutableTreeNode
Id tree node.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.swing.Icon
icon
The icon.protected java.lang.String
key
The node id.protected java.lang.Boolean
leaf
Flag if is leaf.protected java.lang.String
name
The node name.protected T
object
The artifact info.protected IdTreeModel<T>
tm
The tree model.protected java.lang.String
tooltip
The tooltip text.
-
Constructor Summary
Constructors Constructor Description IdTreeNode(java.lang.String key, java.lang.String name, IdTreeModel<T> tm, java.lang.Boolean leaf, javax.swing.Icon icon, java.lang.String tooltip, T object)
Create a new node.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(javax.swing.tree.MutableTreeNode child)
Add a new child.IdTreeNode<T>[]
getChildren()
Get all children.javax.swing.Icon
getIcon()
Get the icon.java.lang.String
getId()
Get the id.java.lang.String
getName()
Get the name.T
getObject()
Get the artifact info.java.lang.String
getTooltipText()
Get the tooltip.void
insert(javax.swing.tree.MutableTreeNode child, int index)
Insert a new child.boolean
isLeaf()
Test if node is leaf.void
remove(int idx)
Remove a child.void
remove(javax.swing.tree.MutableTreeNode child)
Remove a child.void
setName(java.lang.String name)
Set the name.java.lang.String
toString()
Get the string representation.-
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
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, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject
-
-
-
-
Field Detail
-
key
protected java.lang.String key
The node id.
-
name
protected java.lang.String name
The node name.
-
tm
protected IdTreeModel<T> tm
The tree model.
-
leaf
protected java.lang.Boolean leaf
Flag if is leaf.
-
icon
protected javax.swing.Icon icon
The icon.
-
tooltip
protected java.lang.String tooltip
The tooltip text.
-
object
protected T object
The artifact info.
-
-
Constructor Detail
-
IdTreeNode
public IdTreeNode(java.lang.String key, java.lang.String name, IdTreeModel<T> tm, java.lang.Boolean leaf, javax.swing.Icon icon, java.lang.String tooltip, T object)
Create a new node.
-
-
Method Detail
-
add
public void add(javax.swing.tree.MutableTreeNode child)
Add a new child.- Overrides:
add
in classjavax.swing.tree.DefaultMutableTreeNode
- Parameters:
child
- The child.
-
insert
public void insert(javax.swing.tree.MutableTreeNode child, int index)
Insert a new child.- Specified by:
insert
in interfacejavax.swing.tree.MutableTreeNode
- Overrides:
insert
in classjavax.swing.tree.DefaultMutableTreeNode
- Parameters:
child
- The child.
-
remove
public void remove(int idx)
Remove a child.- Specified by:
remove
in interfacejavax.swing.tree.MutableTreeNode
- Overrides:
remove
in classjavax.swing.tree.DefaultMutableTreeNode
- Parameters:
idx
- The index.
-
remove
public void remove(javax.swing.tree.MutableTreeNode child)
Remove a child.- Specified by:
remove
in interfacejavax.swing.tree.MutableTreeNode
- Overrides:
remove
in classjavax.swing.tree.DefaultMutableTreeNode
- Parameters:
idx
- The index.
-
getChildren
public IdTreeNode<T>[] getChildren()
Get all children.- Returns:
- An array of children.s
-
getId
public java.lang.String getId()
Get the id.- Returns:
- The id.
-
getName
public java.lang.String getName()
Get the name.- Returns:
- The name.
-
setName
public void setName(java.lang.String name)
Set the name.- Parameters:
name
- The name to set.
-
isLeaf
public boolean isLeaf()
Test if node is leaf.- Specified by:
isLeaf
in interfacejavax.swing.tree.TreeNode
- Overrides:
isLeaf
in classjavax.swing.tree.DefaultMutableTreeNode
- Returns:
- True, if is leaf.
-
getIcon
public javax.swing.Icon getIcon()
Get the icon.
-
getTooltipText
public java.lang.String getTooltipText()
Get the tooltip.
-
getObject
public T getObject()
Get the artifact info.- Returns:
- The artifact info.
-
toString
public java.lang.String toString()
Get the string representation.- Overrides:
toString
in classjavax.swing.tree.DefaultMutableTreeNode
- Returns:
- The string representation.
-
-