com.dlsc.flexgantt.model.treetable

## Class DefaultMutableTreeTableNode<T>

- java.lang.Object
- - javax.swing.tree.DefaultMutableTreeNode
  - - com.dlsc.flexgantt.model.treetable.DefaultMutableTreeTableNode<T>

- Type Parameters:
    `T` - the object type of the user object
  All Implemented Interfaces:
    IMutableTreeTableNode, ITreeTableNode, Serializable, Cloneable, Comparator, MutableTreeNode, TreeNode
  Direct Known Subclasses:
    DefaultGanttChartNode

      public class DefaultMutableTreeTableNode<T>
      extends DefaultMutableTreeNode
      implements IMutableTreeTableNode, Comparator

  A default implementation for the `ITreeTableNode` interface.

  A tree table node may have at most one parent and 0 or more children. `DefaultMutableTreeTableNode` provides operations for examining and modifying a node's parent and children and also operations for examining the tree that the node is a part of. A node's tree is the set of all nodes that can be reached by starting at the node and following all the possible links to parents and children. A node with no parent is the root of its tree; a node with no children is a leaf. A tree may consist of many subtrees, each node acting as the root for its own subtree.

  This class provides enumerations for efficiently traversing a tree or subtree in various orders or for following the path between two nodes. A `DefaultMutableTreeTableNode` may also hold a reference to a user object, the use of which is left to the user. Asking a `DefaultMutableTreeTableNode` for its string representation with `DefaultMutableTreeNode.toString()` returns the string representation of its user object.

  Since:
    1.0
  Author:
    Dirk Lemmermann
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class javax.swing.tree.DefaultMutableTreeNode

      `allowsChildren, children, EMPTY_ENUMERATION, parent, userObject`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultMutableTreeTableNode()` Creates a tree node that has no parent and no children, but which allows children.
    `DefaultMutableTreeTableNode(boolean allowsChildren)` Creates a tree table node with no parent, no children, no user object, which allows children only if specified.
    `DefaultMutableTreeTableNode(T userObject)` Creates a tree node with no parent, no children, but which allows children, and initializes it with the specified user object.
    `DefaultMutableTreeTableNode(T userObject, boolean allowsChildren)` Creates a tree table node with no parent, no children, initialized with the specified user object, and that allows children only if specified.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(MutableTreeNode newChild)`
    `protected int` | `compare(int modelIndex, Object value1, Object value2, boolean ascending)` Compares two values with each other via this algorithm: `if value1 is NULL then return -1` `if value2 is NULL then return +1` `if getComparator(modelIndex) !`
    `int` | `compare(Object o1, Object o2)`
    `Object` | `getColumnValue(int modelIndex)` Returns the value for the given model index.
    `Comparator` | `getComparator(int modelIndex)` Returns a comparator for comparing values stored under the given model index.
    `int` | `getDragActions()` Returns the drag actions that can be performed on the tree table node.
    `int` | `getDropActions(ITreeTableNode dropCandidate)` Returns the drop actions that can be performed on the node related to another node.
    `Object` | `getKey()` Returns the node's key object.
    `Comparator` | `getKeyComparator()` Returns the comparator that will be used for comparing key values of tree table nodes.
    `Object` | `getPopupObject(boolean extended)` Returns the object for the popup window.
    `Object` | `getPopupTitleObject()` Returns the object for the popup window title.
    `Object` | `getRowHeaderValue()` Returns a value that can be used by the row header and the row header renderer to control the rendering of the row header.
    `int` | `getRowHeight()` Returns the current row height of the node.
    `int` | `getRowHeightMaximum()` Returns the node's maximum row height.
    `int` | `getRowHeightMinimum()` Returns the node's minimum row height.
    `String` | `getToolTipText(TreeTableColumn modelIndex)` Returns the appropriate tooltip text for the given column.
    `T` | `getTypedUserObject()` Returns the user object.
    `Object` | `getUserObject()` Deprecated. use `getTypedUserObject()` instead
    `void` | `insert(MutableTreeNode newChild, int childIndex)`
    `boolean` | `isDeletable()` Returns TRUE if the whole node can be deleted.
    `boolean` | `isKeyEditable()` Specifies whether or not the key value of the node can be edited / replaced.
    `boolean` | `isReassignable(Object parent)` Checks whether the node "could be" reassigned to the given potential parent node.
    `boolean` | `isResizable()` Returns TRUE if the tree node can be resized.
    `boolean` | `isRowLineVisible(boolean expanded)` Returns TRUE if the horizontal grid line of the row in which the node is displayed shall be drawn or not (the answer to this question of depends on the state of the node, whether it is expanded or closed).
    `boolean` | `isSelectable()` Returns TRUE if the tree node can be selected.
    `boolean` | `isSorting()` Returns TRUE if the node sorts its children.
    `boolean` | `isValueEditable(int modelIndex)` Returns TRUE if the column value at the given model index can be edited.
    `void` | `setColumnValue(Object value, int modelIndex)` Sets the value for the given model index.
    `void` | `setComparator(int modelIndex, Comparator comp)` Sets a comparator that will be used for comparing values stored under the given model index.
    `static void` | `setDefaultRowHeight(int height)` Sets the default row height for any new node.
    `void` | `setDeletable(boolean b)` Specifies whether or not the entire node can be deleted from the tree table model.
    `void` | `setDragActions(int actions)` Sets the drag actions that can be performed on the tree table node.
    `void` | `setKey(Object key)` Sets the node's key object.
    `void` | `setKeyComparator(Comparator comparator)` Sets the comparator that will be used for comparing key values of tree table nodes.
    `void` | `setKeyEditable(boolean b)` Specifies whether or not the key value of the node can be edited / replaced.
    `void` | `setPopupObject(Object object, boolean extended)` Sets an object on the tree node that will be used as input for the popup renderer.
    `void` | `setPopupTitleObject(Object object)` Sets the title object used for popup information windows.
    `void` | `setResizable(boolean resizable)` Specifies whether the row height of the node is resizable.
    `void` | `setRowHeaderValue(Object value)` Sets a row header value that can be used by the row ehader and the row header renderer to control the rendering of the row header.
    `void` | `setRowHeight(int rowHeight)` Specifies a new row height for the tree table node.
    `void` | `setRowHeightMaximum(int max)` Sets the maximum height that the row showing this node may have.
    `void` | `setRowHeightMinimum(int min)` Sets the minimum height that the row showing this node may have.
    `void` | `setRowLineVisible(boolean visibleExpanded, boolean visibleCollapsed)` Specifies whether the horizontal grid line of the row in which the node gets displayed will be drawn or not.
    `void` | `setSelectable(boolean b)` Specifies whether the node is selectable or not.
    `void` | `setToolTipText(String ttt)` Sets a tooltip text on the node.
    `void` | `setTypedUserObject(T userObject)` Sets a new user object on the node.
    `void` | `setUserObject(Object userObject)` Deprecated. use `setTypedUserObject(Object)` instead
    `void` | `setValueEditable(int modelIndex, boolean b)` Specifies which column values can be edited or not.
    `void` | `sort(int[] modelIndices, boolean[] sortDirections)` Invokes multi-column sorting on the tree table node.

    - ### 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, getUserObjectPath, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, toString`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface javax.swing.tree.MutableTreeNode

      `remove, remove, removeFromParent, setParent`

    - ### Methods inherited from interface javax.swing.tree.TreeNode

      `children, getAllowsChildren, getChildAt, getChildCount, getIndex, getParent, isLeaf`

    - ### Methods inherited from interface java.util.Comparator

      `comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong`

- - ### Constructor Detail

    - #### DefaultMutableTreeTableNode

          public DefaultMutableTreeTableNode(T userObject,
                                             boolean allowsChildren)

      Creates a tree table node with no parent, no children, initialized with the specified user object, and that allows children only if specified.
      Parameters:
        `userObject` - an object provided by the user that constitutes the node's data
        `allowsChildren` - if TRUE, the node is allowed to have child nodes -- otherwise, it is always a leaf node
      Since:
        1.0

    - #### DefaultMutableTreeTableNode

          public DefaultMutableTreeTableNode(T userObject)

      Creates a tree node with no parent, no children, but which allows children, and initializes it with the specified user object.
      Parameters:
        `userObject` - an object provided by the user that constitutes the node's data
      Since:
        1.0

    - #### DefaultMutableTreeTableNode

          public DefaultMutableTreeTableNode(boolean allowsChildren)

      Creates a tree table node with no parent, no children, no user object, which allows children only if specified.
      Parameters:
        `allowsChildren` - if TRUE, the node is allowed to have child nodes -- otherwise, it is always a leaf node
      Since:
        1.0

    - #### DefaultMutableTreeTableNode

          public DefaultMutableTreeTableNode()

      Creates a tree node that has no parent and no children, but which allows children.
      Since:
        1.0

  - ### Method Detail

    - #### getRowHeight

          public int getRowHeight()

      Description copied from interface: `ITreeTableNode`
      Returns the current row height of the node.
      Specified by:
        `getRowHeight` in interface `ITreeTableNode`
      Returns:
        the node's row height
      See Also:
        `ITreeTableNode.getRowHeightMaximum()`, `ITreeTableNode.getRowHeightMinimum()`, `IRowPolicy.getRowHeight(Object, ITreeTableModel)`, `IRowPolicy.getRowResizeCommand(Object, ITreeTableModel, int)`, `DefaultRowResizeCommand`

    - #### setRowHeight

          public void setRowHeight(int rowHeight)

      Description copied from interface: `ITreeTableNode`
      Specifies a new row height for the tree table node.
      Specified by:
        `setRowHeight` in interface `ITreeTableNode`
      Parameters:
        `rowHeight` - the new row height
      See Also:
        `IRowPolicy.isRowResizable(Object, ITreeTableModel)`, `IRowPolicy.getRowResizeCommand(Object, ITreeTableModel, int)`, `DefaultRowPolicy`, `DefaultRowResizeCommand`

    - #### getRowHeightMaximum

          public int getRowHeightMaximum()

      Description copied from interface: `ITreeTableNode`
      Returns the node's maximum row height.
      Specified by:
        `getRowHeightMaximum` in interface `ITreeTableNode`
      Returns:
        the node's maximum row height
      See Also:
        `ITreeTableNode.getRowHeight()`, `ITreeTableNode.getRowHeightMinimum()`, `IRowPolicy.getRowHeightMaximum(Object, ITreeTableModel)`, `IRowPolicy.getRowResizeCommand(Object, ITreeTableModel, int)`, `DefaultRowResizeCommand`

    - #### setRowHeightMaximum

          public void setRowHeightMaximum(int max)

      Sets the maximum height that the row showing this node may have.
      Parameters:
        `max` - the maximum row height
      See Also:
        `setRowHeight(int)`, `setRowHeightMinimum(int)`

    - #### getRowHeightMinimum

          public int getRowHeightMinimum()

      Description copied from interface: `ITreeTableNode`
      Returns the node's minimum row height.
      Specified by:
        `getRowHeightMinimum` in interface `ITreeTableNode`
      Returns:
        the node's minimum row height
      See Also:
        `ITreeTableNode.getRowHeight()`, `ITreeTableNode.getRowHeightMaximum()`, `IRowPolicy.getRowHeightMinimum(Object, ITreeTableModel)`, `IRowPolicy.getRowResizeCommand(Object, ITreeTableModel, int)`, `DefaultRowResizeCommand`

    - #### setRowHeightMinimum

          public void setRowHeightMinimum(int min)

      Sets the minimum height that the row showing this node may have.
      Parameters:
        `min` - the minimum row height
      Since:
        1.0
      See Also:
        `setRowHeight(int)`, `setRowHeightMaximum(int)`

    - #### getColumnValue

          public Object getColumnValue(int modelIndex)

      Description copied from interface: `ITreeTableNode`
      Returns the value for the given model index.
      Specified by:
        `getColumnValue` in interface `ITreeTableNode`
      Parameters:
        `modelIndex` - the model index provided by the column
      Returns:
        the value for the given model index
      See Also:
        `TreeTableColumn.getModelIndex()`

    - #### setColumnValue

          public void setColumnValue(Object value,
                                     int modelIndex)

      Description copied from interface: `ITreeTableNode`
      Sets the value for the given model index.
      Specified by:
        `setColumnValue` in interface `ITreeTableNode`
      Parameters:
        `value` - the new value
        `modelIndex` - the model index provided by the column
      See Also:
        `TreeTableColumn.getModelIndex()`, `DefaultChangeValueCommand`, `INodeEditPolicy.getChangeValueCommand(Object, ITreeTableModel, Object, int)`

    - #### isSelectable

          public boolean isSelectable()

      Description copied from interface: `ITreeTableNode`
      Returns TRUE if the tree node can be selected.
      Specified by:
        `isSelectable` in interface `ITreeTableNode`
      Returns:
        TRUE if the node is selectable
      See Also:
        `INodeEditPolicy.isSelectable(Object, ITreeTableModel)`

    - #### setSelectable

          public void setSelectable(boolean b)

      Specifies whether the node is selectable or not.
      Parameters:
        `b` - if TRUE the user will be able to add the node to the tree table's current selection
      Since:
        1.0
      See Also:
        `isSelectable()`

    - #### isResizable

          public boolean isResizable()

      Description copied from interface: `ITreeTableNode`
      Returns TRUE if the tree node can be resized.
      Specified by:
        `isResizable` in interface `ITreeTableNode`
      Returns:
        TRUE if the node is resizable
      See Also:
        `IRowPolicy.isRowResizable(Object, ITreeTableModel)`, `IRowPolicy.getRowResizeCommand(Object, ITreeTableModel, int)`, `DefaultRowResizeCommand`, `ITreeTableNode.getRowHeight()`, `ITreeTableNode.getRowHeightMaximum()`, `ITreeTableNode.getRowHeightMinimum()`

    - #### setResizable

          public void setResizable(boolean resizable)

      Specifies whether the row height of the node is resizable.
      Parameters:
        `resizable` - if TRUE the user will be able to change the row height
      Since:
        1.0
      See Also:
        `isResizable()`

    - #### isRowLineVisible

          public boolean isRowLineVisible(boolean expanded)

      Description copied from interface: `ITreeTableNode`
      Returns TRUE if the horizontal grid line of the row in which the node is displayed shall be drawn or not (the answer to this question of depends on the state of the node, whether it is expanded or closed).
      Specified by:
        `isRowLineVisible` in interface `ITreeTableNode`
      Parameters:
        `expanded` - if TRUE the tree table node is currently expanded
      Returns:
        TRUE if the row line is visible
      See Also:
        `IRowPolicy.isRowLineVisible(Object, boolean, ITreeTableModel)`

    - #### setRowLineVisible

          public void setRowLineVisible(boolean visibleExpanded,
                                        boolean visibleCollapsed)

      Specifies whether the horizontal grid line of the row in which the node gets displayed will be drawn or not.
      Parameters:
        `visibleExpanded` - if TRUE the horizontal grid line of the row will be visible when the node is expanded
        `visibleCollapsed` - if TRUE the horizontal grid line of the row will be visible when the node is collapsed
      Since:
        1.0
      See Also:
        `IRowPolicy.isRowLineVisible(Object, boolean, ITreeTableModel)`

    - #### isValueEditable

          public boolean isValueEditable(int modelIndex)

      Description copied from interface: `ITreeTableNode`
      Returns TRUE if the column value at the given model index can be edited.
      Specified by:
        `isValueEditable` in interface `ITreeTableNode`
      Parameters:
        `modelIndex` - the model index
      Returns:
        TRUE if the value at the given index can be edited
      See Also:
        `INodeEditPolicy.isValueEditable(Object, ITreeTableModel, int)`, `INodeEditPolicy.getChangeValueCommand(Object, ITreeTableModel, Object, int)`, `DefaultChangeValueCommand`

    - #### setValueEditable

          public void setValueEditable(int modelIndex,
                                       boolean b)

      Specifies which column values can be edited or not.
      Parameters:
        `modelIndex` - the model index for which editing will be enabled / disabled
        `b` - if TRUE turns on value editing for the given model index
      Since:
        1.0
      See Also:
        `isValueEditable(int)`

    - #### isKeyEditable

          public boolean isKeyEditable()

      Specifies whether or not the key value of the node can be edited / replaced.
      Specified by:
        `isKeyEditable` in interface `ITreeTableNode`
      Returns:
        TRUE if the key can be edited
      Since:
        1.0
      See Also:
        `setKeyEditable(boolean)`

    - #### setKeyEditable

          public void setKeyEditable(boolean b)

      Specifies whether or not the key value of the node can be edited / replaced.
      Parameters:
        `b` - if TRUE the key can be edited
      Since:
        1.0
      See Also:
        `isKeyEditable()`

    - #### setToolTipText

          public void setToolTipText(String ttt)

      Sets a tooltip text on the node.
      Parameters:
        `ttt` - the tooltip text to use
      Since:
        1.0
      See Also:
        `getToolTipText(TreeTableColumn)`

    - #### getToolTipText

          public String getToolTipText(TreeTableColumn modelIndex)

      Description copied from interface: `ITreeTableNode`
      Returns the appropriate tooltip text for the given column.
      Specified by:
        `getToolTipText` in interface `ITreeTableNode`
      Parameters:
        `modelIndex` - the column for which to return a tooltip text
      Returns:
        a tooltip text for the given column
      See Also:
        `IRowPolicy.getRowToolTip(Object, ITreeTableModel, TreeTableColumn)`, `DefaultRowPolicy`

    - #### setKey

          public void setKey(Object key)

      Description copied from interface: `ITreeTableNode`
      Sets the node's key object. The key object gets displayed in the key column of the tree table. The key column displays the tree nodes and visualizes the hierarchical structure of the tree.
      Specified by:
        `setKey` in interface `ITreeTableNode`
      Parameters:
        `key` - the node's key object
      See Also:
        `ITreeTableNode.getKey()`, `DefaultChangeKeyCommand`, `INodeEditPolicy.getChangeKeyCommand(Object, ITreeTableModel, Object)`

    - #### getKey

          public Object getKey()

      Description copied from interface: `ITreeTableNode`
      Returns the node's key object. The key object gets displayed in the key column of the tree table. The key column displays the tree nodes and visualizes the hierarchical structure of the tree.
      Specified by:
        `getKey` in interface `ITreeTableNode`
      Returns:
        the node's key object which gets displayed inside the key column
      See Also:
        `ITreeTableNode.setKey(Object)`, `ITreeTableModel.getKey(Object)`, `DefaultTreeTableModel.getKey(ITreeTableNode)`, `setKey(Object)`, `getKey()`

    - #### isDeletable

          public boolean isDeletable()

      Description copied from interface: `ITreeTableNode`
      Returns TRUE if the whole node can be deleted.
      Specified by:
        `isDeletable` in interface `ITreeTableNode`
      Returns:
        TRUE if the node is deletable
      See Also:
        `INodeEditPolicy.isDeletable(Object, ITreeTableModel)`, `INodeEditPolicy.getDeleteNodesCommand(java.util.List, ITreeTableModel)`, `DefaultDeleteNodeCommand`

    - #### setDeletable

          public void setDeletable(boolean b)

      Specifies whether or not the entire node can be deleted from the tree table model.
      Parameters:
        `b` - if TRUE the node can be deleted
      Since:
        1.0
      See Also:
        `isDeletable()`

    - #### getRowHeaderValue

          public Object getRowHeaderValue()

      Description copied from interface: `ITreeTableNode`
      Returns a value that can be used by the row header and the row header renderer to control the rendering of the row header.
      Specified by:
        `getRowHeaderValue` in interface `ITreeTableNode`
      Returns:
        a row header value
      See Also:
        `IRowHeaderRenderer`, `ITreeTableModel.getRowHeaderValue(Object)`

    - #### setRowHeaderValue

          public void setRowHeaderValue(Object value)

      Description copied from interface: `ITreeTableNode`
      Sets a row header value that can be used by the row ehader and the row header renderer to control the rendering of the row header.
      Specified by:
        `setRowHeaderValue` in interface `ITreeTableNode`
      Parameters:
        `value` - the row header value
      See Also:
        `IRowHeaderRenderer`, `ITreeTableModel.getRowHeaderValue(Object)`

    - #### setUserObject

          @Deprecated
          public final void setUserObject(Object userObject)

      Deprecated. use `setTypedUserObject(Object)` instead
      Overrides the default implementation and marks it as deprecated. The method tries to cast the given user object to the object type that was declared in the class definition.
      Specified by:
        `setUserObject` in interface `MutableTreeNode`
      Overrides:
        `setUserObject` in class `DefaultMutableTreeNode`
      Since:
        1.0

    - #### getUserObject

          @Deprecated
          public final Object getUserObject()

      Deprecated. use `getTypedUserObject()` instead
      Overrides the default implementation and marks it as deprecated.
      Overrides:
        `getUserObject` in class `DefaultMutableTreeNode`
      Since:
        1.0

    - #### setTypedUserObject

          public void setTypedUserObject(T userObject)

      Sets a new user object on the node. This method replaces `setUserObject(Object)` in order to support generics for user objects.
      Parameters:
        `userObject` - the user object to set on the node
      Since:
        1.0

    - #### getTypedUserObject

          public T getTypedUserObject()

      Returns the user object. This method replaces the `getUserObject()` method in order to support generics for user object.
      Returns:
        the node's user object
      Since:
        1.0

    - #### sort

          public void sort(int[] modelIndices,
                           boolean[] sortDirections)

      Description copied from interface: `ITreeTableNode`
      Invokes multi-column sorting on the tree table node. Each column can be sorted in ascending or descending order. The lengths of the two parameters arrays need to be equal.
      Specified by:
        `sort` in interface `ITreeTableNode`
      Parameters:
        `modelIndices` - the model indices that are used to determine which column values to compare for sorting (use `KeyColumn.MODEL_INDEX` to specify a sort based on the key column
        `sortDirections` - if TRUE the sort direction will be ascending
      See Also:
        `ITreeTableModel.sort(Object, int[], boolean[])`

    - #### isSorting

          public boolean isSorting()

      Returns TRUE if the node sorts its children.
      Returns:
        TRUE if the tree node sorts its children
      Since:
        1.0
      See Also:
        `sort(int[], boolean[])`

    - #### add

          public void add(MutableTreeNode newChild)

      Overrides:
        `add` in class `DefaultMutableTreeNode`

    - #### insert

          public void insert(MutableTreeNode newChild,
                             int childIndex)

      Specified by:
        `insert` in interface `MutableTreeNode`
      Overrides:
        `insert` in class `DefaultMutableTreeNode`

    - #### setKeyComparator

          public void setKeyComparator(Comparator comparator)

      Sets the comparator that will be used for comparing key values of tree table nodes. By default this comparator is NULL and the sorting algorithm will try to sort the key values based on their `Comparable` interface implementation.
      Parameters:
        `comparator` - the comparator that will be used when sorting key values
      Since:
        1.0
      See Also:
        `getKeyComparator()`

    - #### getKeyComparator

          public Comparator getKeyComparator()

      Returns the comparator that will be used for comparing key values of tree table nodes. By default this comparator is NULL and the sorting algorithm will try to sort the key values based on their `Comparable` interface implementation.
      Returns:
        a comparator for sorting key values
      Since:
        1.0

    - #### setComparator

          public void setComparator(int modelIndex,
                                    Comparator comp)

      Sets a comparator that will be used for comparing values stored under the given model index.
      Parameters:
        `modelIndex` - the model index for which to specify a comparator
        `comp` - the comparator that will be used for comparing values stored under the given model index
      Since:
        1.0
      See Also:
        `getComparator(int)`, `compare(Object, Object)`

    - #### getComparator

          public Comparator getComparator(int modelIndex)

      Returns a comparator for comparing values stored under the given model index. By default no comparators are registered and the sorting algorithm will use the tree node's `Comparable` interface implemenation.
      Parameters:
        `modelIndex` - the model index for which to return a comparator
      Returns:
        a comparator for values stored under the given model index
      Since:
        1.0
      See Also:
        `setComparator(int, Comparator)`, `compare(int, Object, Object, boolean)`, `compare(Object, Object)`

    - #### compare

          public int compare(Object o1,
                             Object o2)

      Specified by:
        `compare` in interface `Comparator`

    - #### compare

          protected int compare(int modelIndex,
                                Object value1,
                                Object value2,
                                boolean ascending)

      Compares two values with each other via this algorithm:
      - `if value1 is NULL then return -1`
      - `if value2 is NULL then return +1`
      - `if getComparator(modelIndex) != null then return result of Comparator#compare(Object, Object)`
      - `if values implement `Comparable` then return Comparable#compareTo(Object)`
      - `throw IllegalArgumentException -> unable to sort`
      Parameters:
        `modelIndex` - the model index under which the values were stored (the index is important for looking up the correct comparator)
        `value1` - the first value for the comparison
        `value2` - the second value for the commparison
        `ascending` - the sort order (ascending or descending)
      Returns:
        a value expressing the order relationship of the two values (negative if value1 is smaller, positive if value 1 is larger, 0 if values are equal)
      Since:
        1.0
      See Also:
        `getComparator(int)`, `sort(int[], boolean[])`

    - #### getDragActions

          public int getDragActions()

      Description copied from interface: `ITreeTableNode`
      Returns the drag actions that can be performed on the tree table node. Nodes can either be moved or copied or both. The desired behaviour can be specified by using the constants defined in `DnDConstants`. Possible values are:
      - `DnDConstants.ACTION_COPY`
      - `DnDConstants.ACTION_MOVE`
      - `DnDConstants.ACTION_COPY_OR_MOVE`
      Declaring the drag actions is only half of the work needed for correct drag and drop behaviour. A node might be draggable but it also needs a place where it can be dropped. The drop places are defined by `ITreeTableNode.getDropActions(ITreeTableNode)`.
      Specified by:
        `getDragActions` in interface `ITreeTableNode`
      Returns:
        the supported drag actions (move, copy, or both)
      See Also:
        `DefaultNodeDragAndDropCommand`, `INodeDragAndDropPolicy.getDragActions(Object, ITreeTableModel)`

    - #### setDragActions

          public void setDragActions(int actions)

      Sets the drag actions that can be performed on the tree table node. Nodes can either be moved or copied or both. The desired behaviour can be specified by using the constants defined in `DnDConstants`. Possible values are:
      - `DnDConstants.ACTION_COPY`
      - `DnDConstants.ACTION_MOVE`
      - `DnDConstants.ACTION_COPY_OR_MOVE`
      Declaring the drag actions is only half of the work needed for correct drag and drop behaviour. A node might be draggable but it also needs a place where it can be dropped. The drop places are defined by `ITreeTableNode.getDropActions(ITreeTableNode)`.
      Parameters:
        `actions` - the supported drag actions (move, copy, or both)
      Since:
        1.0
      See Also:
        `DefaultNodeDragAndDropCommand`, `INodeDragAndDropPolicy.getDragActions(Object, ITreeTableModel)`

    - #### getDropActions

          public int getDropActions(ITreeTableNode dropCandidate)

      Description copied from interface: `ITreeTableNode`
      Returns the drop actions that can be performed on the node related to another node. Tree nodes can be allowed to be moved onto the node or copied to the node or both. The supported drop actions can be specified by using the constants defined in `DnDConstants`. Possible values are:
      - `DnDConstants.ACTION_COPY`
      - `DnDConstants.ACTION_MOVE`
      - `DnDConstants.ACTION_COPY_OR_MOVE`
      Declaring the drop actions is only half of the work needed for correct drag and drop behaviour. A node might be droppable onto another node but it also needs to be draggable.This behaviour is defined by calling `ITreeTableNode.getDragActions()`.
      Specified by:
        `getDropActions` in interface `ITreeTableNode`
      Parameters:
        `dropCandidate` - the node that might get dropped onto this node
      Returns:
        the supported drop actions (move, copy, or both)
      See Also:
        `DefaultNodeDragAndDropCommand`, `INodeDragAndDropPolicy.getDropActions(Object, Object, ITreeTableModel, Object, ITreeTableModel)`

    - #### isReassignable

          public boolean isReassignable(Object parent)

      Checks whether the node "could be" reassigned to the given potential parent node. This method returns TRUE if the new parent is not NULL and if the new parent implements the `MutableTreeNode` interface and if the new parent returns TRUE when calling `TreeNode.getAllowsChildren()`.
      Specified by:
        `isReassignable` in interface `ITreeTableNode`
      Parameters:
        `parent` - the potential new parent
      Returns:
        TRUE if the node can be indented by the user

    - #### getPopupObject

          public Object getPopupObject(boolean extended)

      Description copied from interface: `ITreeTableNode`
      Returns the object for the popup window.
      Specified by:
        `getPopupObject` in interface `ITreeTableNode`
      Parameters:
        `extended` - a flag that signals whether the user wants to see the standard popup information or the extended version
      Returns:
        an input object for the poup
      See Also:
        `PopupLayer`, `IPopupRenderer`, `DefaultPopupRenderer`, `IPopupPolicy.getPopupValue(javax.swing.tree.TreePath, IGanttChartModel, boolean)`

    - #### setPopupObject

          public void setPopupObject(Object object,
                                     boolean extended)

      Sets an object on the tree node that will be used as input for the popup renderer.
      Parameters:
        `extended` - a flag used to determine if the given object will be used as for the standard or the extended popup
        `object` - the popup object that will be visualized by the popup layer and renderer
      Since:
        1.1
      See Also:
        `IPopupRenderer`, `PopupLayer`, `IPopupPolicy`

    - #### getPopupTitleObject

          public Object getPopupTitleObject()

      Description copied from interface: `ITreeTableNode`
      Returns the object for the popup window title.
      Specified by:
        `getPopupTitleObject` in interface `ITreeTableNode`
      Returns:
        an input object for the poup title
      See Also:
        `PopupLayer`, `IPopupRenderer`, `DefaultPopupRenderer`, `IPopupPolicy.getPopupTitleValue(javax.swing.tree.TreePath, IGanttChartModel)`

    - #### setPopupTitleObject

          public void setPopupTitleObject(Object object)

      Sets the title object used for popup information windows.
      Parameters:
        `object` -
      Since:
        1.1
      See Also:
        `IPopupPolicy.getPopupTitleValue(javax.swing.tree.TreePath, IGanttChartModel)`, `DefaultPopupRenderer`

    - #### setDefaultRowHeight

          public static void setDefaultRowHeight(int height)

      Sets the default row height for any new node. This method must be called before any nodes are being created. Otherwise the default value of 20 will be applied.
      Parameters:
        `height` - the row height that any new node will initially have
      Since:
        2.1

Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.