com.dlsc.flexgantt.model.treetable
Interface ITreeTableNode

All Superinterfaces:
javax.swing.tree.TreeNode
All Known Subinterfaces:
IGanttChartNode<T>, IMutableTreeTableNode, IResourceNode<T>
All Known Implementing Classes:
DefaultGanttChartNode, DefaultMutableTreeTableNode, DefaultResourceNode

public interface ITreeTableNode
extends javax.swing.tree.TreeNode

An extension of the TreeNode interface, which provides additional information used to populate the table columns of the tree table. Just like other classes and interfaces in this package, the ITreeTableNode does differentiate between a key colum and value columns. The key column is the table's column that is responsible for displaying the key object and for visualizing the hierarchical tree structure (by indenting nodes).

This node interface and its implementation DefaultMutableTreeTableNode get heavily used by the various tree table policies. Most of these policies simply delegate the actual work to the node. Example: the node editing policy INodeEditPolicy.isValueEditable(Object, ITreeTableModel, int) calls isValueEditable(int).

Author:
Dirk Lemmermann

Method Summary
 java.lang.Object getColumnValue(int modelIndex)
          Returns the value for 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.
 java.lang.Object getKey()
          Returns the node's key object.
 java.lang.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.
 java.lang.String getToolTipText(TreeTableColumn column)
          Returns the appropriate tooltip text for the given column / model index.
 boolean isDeletable()
          Returns TRUE if the whole node can be deleted.
 boolean isKeyEditable()
          Returns TRUE if the key value can be edited.
 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 isValueEditable(int modelIndex)
          Returns TRUE if the column value at the given model index can be edited.
 void setColumnValue(java.lang.Object value, int modelIndex)
          Sets the value for the given model index.
 void setKey(java.lang.Object key)
          Sets the node's key object.
 void setRowHeaderValue(java.lang.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 height)
          Specifies a new row height for the tree table node.
 void sort(int[] modelIndices, boolean[] sortDirections)
          Invokes multi-column sorting on the tree table node.
 
Methods inherited from interface javax.swing.tree.TreeNode
children, getAllowsChildren, getChildAt, getChildCount, getIndex, getParent, isLeaf
 

Method Detail

getKey

java.lang.Object getKey()
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.

Returns:
the node's key object which gets displayed inside the key column
Since:
1.0
See Also:
setKey(Object), ITreeTableModel.getKey(Object), ITreeTableModel.getKey(Object), DefaultMutableTreeTableNode.setKey(Object), DefaultMutableTreeTableNode.getKey()

setKey

void setKey(java.lang.Object key)
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.

Parameters:
key - the node's key object
Since:
1.0
See Also:
getKey(), DefaultChangeKeyCommand, INodeEditPolicy.getChangeKeyCommand(Object, ITreeTableModel, Object)

getColumnValue

java.lang.Object getColumnValue(int modelIndex)
Returns the value for the given model index.

Parameters:
modelIndex - the model index provided by the column
Returns:
the value for the given model index
Since:
1.0
See Also:
TreeTableColumn.getModelIndex()

setColumnValue

void setColumnValue(java.lang.Object value,
                    int modelIndex)
Sets the value for the given model index.

Parameters:
value - the new value
modelIndex - the model index provided by the column
Since:
1.0
See Also:
TreeTableColumn.getModelIndex(), DefaultChangeValueCommand, INodeEditPolicy.getChangeValueCommand(Object, ITreeTableModel, Object, int)

isSelectable

boolean isSelectable()
Returns TRUE if the tree node can be selected.

Returns:
TRUE if the node is selectable
Since:
1.0
See Also:
IRowPolicy.isRowSelectable(Object, ITreeTableModel)

isResizable

boolean isResizable()
Returns TRUE if the tree node can be resized.

Returns:
TRUE if the node is resizable
Since:
1.0
See Also:
IRowPolicy.isRowResizable(Object, ITreeTableModel), IRowPolicy.getRowResizeCommand(Object, ITreeTableModel, int), DefaultRowResizeCommand, getRowHeight(), getRowHeightMaximum(), getRowHeightMinimum()

isRowLineVisible

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).

Parameters:
expanded - if TRUE the tree table node is currently expanded
Returns:
TRUE if the row line is visible
Since:
1.0
See Also:
IRowPolicy.isRowLineVisible(Object, boolean, ITreeTableModel)

isKeyEditable

boolean isKeyEditable()
Returns TRUE if the key value can be edited.

Returns:
TRUE if the value at the given index can be edited
Since:
1.0
See Also:
INodeEditPolicy.isKeyEditable(Object, ITreeTableModel), INodeEditPolicy.getChangeKeyCommand(Object, ITreeTableModel, Object), DefaultChangeKeyCommand

isValueEditable

boolean isValueEditable(int modelIndex)
Returns TRUE if the column value at the given model index can be edited.

Parameters:
modelIndex - the model index
Returns:
TRUE if the value at the given index can be edited
Since:
1.0
See Also:
INodeEditPolicy.isValueEditable(Object, ITreeTableModel, int), INodeEditPolicy.getChangeValueCommand(Object, ITreeTableModel, Object, int), DefaultChangeValueCommand

isDeletable

boolean isDeletable()
Returns TRUE if the whole node can be deleted.

Returns:
TRUE if the node is deletable
Since:
1.0
See Also:
INodeEditPolicy.isDeletable(Object, ITreeTableModel), INodeEditPolicy.getDeleteNodeCommand(Object, ITreeTableModel), DefaultNodeDeleteCommand

getRowHeight

int getRowHeight()
Returns the current row height of the node.

Returns:
the node's row height
Since:
1.0
See Also:
getRowHeightMaximum(), getRowHeightMinimum(), IRowPolicy.getRowHeight(Object, ITreeTableModel), IRowPolicy.getRowResizeCommand(Object, ITreeTableModel, int), DefaultRowResizeCommand

getRowHeightMinimum

int getRowHeightMinimum()
Returns the node's minimum row height.

Returns:
the node's minimum row height
Since:
1.0
See Also:
getRowHeight(), getRowHeightMaximum(), IRowPolicy.getRowHeightMinimum(Object, ITreeTableModel), IRowPolicy.getRowResizeCommand(Object, ITreeTableModel, int), DefaultRowResizeCommand

getRowHeightMaximum

int getRowHeightMaximum()
Returns the node's maximum row height.

Returns:
the node's maximum row height
Since:
1.0
See Also:
getRowHeight(), getRowHeightMinimum(), IRowPolicy.getRowHeightMaximum(Object, ITreeTableModel), IRowPolicy.getRowResizeCommand(Object, ITreeTableModel, int), DefaultRowResizeCommand

getToolTipText

java.lang.String getToolTipText(TreeTableColumn column)
Returns the appropriate tooltip text for the given column / model index.

Parameters:
column - the column model index for which to return a tooltip text
Returns:
a tooltip text for the given column
Since:
1.0
See Also:
IRowPolicy.getRowToolTip(Object, ITreeTableModel, TreeTableColumn), DefaultRowPolicy

setRowHeight

void setRowHeight(int height)
Specifies a new row height for the tree table node.

Parameters:
height - the new row height
Since:
1.0
See Also:
IRowPolicy.isRowResizable(Object, ITreeTableModel), IRowPolicy.getRowResizeCommand(Object, ITreeTableModel, int), DefaultRowPolicy, DefaultRowResizeCommand

getRowHeaderValue

java.lang.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.

Returns:
a row header value
Since:
1.0
See Also:
IRowHeaderRenderer, ITreeTableModel.getRowHeaderValue(Object)

setRowHeaderValue

void setRowHeaderValue(java.lang.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.

Parameters:
value - the row header value
Since:
1.0
See Also:
IRowHeaderRenderer, ITreeTableModel.getRowHeaderValue(Object)

sort

void sort(int[] modelIndices,
          boolean[] sortDirections)
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.

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
Since:
1.0
See Also:
ITreeTableModel.sort(Object, int[], boolean[])

getDragActions

int getDragActions()
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: 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 getDropActions(ITreeTableNode).

Returns:
the supported drag actions (move, copy, or both)
Since:
1.0
See Also:
DefaultNodeDragAndDropCommand, INodeDragAndDropPolicy.getDragActions(Object, ITreeTableModel)

getDropActions

int getDropActions(ITreeTableNode dropCandidate)
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: 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 getDragActions().

Parameters:
dropCandidate - the node that might get dropped onto this node
Returns:
the supported drop actions (move, copy, or both)
Since:
1.0
See Also:
DefaultNodeDragAndDropCommand, INodeDragAndDropPolicy.getDropActions(Object, Object, ITreeTableModel, Object, ITreeTableModel)