Class 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.
      • Fields inherited from class javax.swing.tree.DefaultMutableTreeNode

        allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
    • 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
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • key

        protected java.lang.String key
        The node id.
      • name

        protected java.lang.String name
        The node name.
      • 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 class javax.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 interface javax.swing.tree.MutableTreeNode
        Overrides:
        insert in class javax.swing.tree.DefaultMutableTreeNode
        Parameters:
        child - The child.
      • remove

        public void remove​(int idx)
        Remove a child.
        Specified by:
        remove in interface javax.swing.tree.MutableTreeNode
        Overrides:
        remove in class javax.swing.tree.DefaultMutableTreeNode
        Parameters:
        idx - The index.
      • remove

        public void remove​(javax.swing.tree.MutableTreeNode child)
        Remove a child.
        Specified by:
        remove in interface javax.swing.tree.MutableTreeNode
        Overrides:
        remove in class javax.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 interface javax.swing.tree.TreeNode
        Overrides:
        isLeaf in class javax.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 class javax.swing.tree.DefaultMutableTreeNode
        Returns:
        The string representation.