com.dlsc.flexgantt.policy.treetable
Class DefaultRowPolicy

java.lang.Object
  extended by com.dlsc.flexgantt.policy.AbstractPolicy
      extended by com.dlsc.flexgantt.policy.treetable.DefaultRowPolicy
All Implemented Interfaces:
IPolicy, IRowPolicy

public class DefaultRowPolicy
extends AbstractPolicy
implements IRowPolicy

The default implementation of the row policy. For a general description of the purpose of this policy please refer to IRowPolicy.

Since:
1.0
Author:
Dirk Lemmermann

Constructor Summary
DefaultRowPolicy()
           
 
Method Summary
 int getRowHeight(java.lang.Object node, ITreeTableModel model)
          Returns the current height of the row in which the given tree node gets displayed.
 int getRowHeightMaximum(java.lang.Object node, ITreeTableModel model)
          Returns the maximum height of the row in which the given tree node gets displayed.
 int getRowHeightMinimum(java.lang.Object node, ITreeTableModel model)
          Returns the minimum height of the row in which the given tree node gets displayed.
 ICommand getRowResizeCommand(java.lang.Object node, ITreeTableModel model, int rowHeight)
          Returns a command object that will peform the actual resizing of the row / node.
 java.lang.String getRowToolTip(java.lang.Object node, ITreeTableModel model, TreeTableColumn modelIndex)
          Returns a tooltip text for the given node and column.
 boolean isRowLineVisible(java.lang.Object node, boolean expanded, ITreeTableModel model)
          Determines whether or not the horizontal grid line for the row will be visible or not.
 boolean isRowResizable(java.lang.Object node, ITreeTableModel model)
          Determines whether or not the row in which the given tree node gets displayed is resizable at all by the user.
 boolean isRowSelectable(java.lang.Object node, ITreeTableModel model)
          Determines whether or not the row in which the given tree node gets displayed is selectable by the user.
 
Methods inherited from class com.dlsc.flexgantt.policy.AbstractPolicy
assertClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultRowPolicy

public DefaultRowPolicy()
Method Detail

getRowHeight

public int getRowHeight(java.lang.Object node,
                        ITreeTableModel model)
Description copied from interface: IRowPolicy
Returns the current height of the row in which the given tree node gets displayed.

Specified by:
getRowHeight in interface IRowPolicy
Parameters:
node - the tree table node for which the row height gets returned
model - the data source that returned the tree table node
Returns:
the current height of the row

getRowHeightMinimum

public int getRowHeightMinimum(java.lang.Object node,
                               ITreeTableModel model)
Description copied from interface: IRowPolicy
Returns the minimum height of the row in which the given tree node gets displayed.

Specified by:
getRowHeightMinimum in interface IRowPolicy
Parameters:
node - the tree table node for which the row height gets returned
model - the data source that returned the tree table node
Returns:
the minimum height of the row

getRowHeightMaximum

public int getRowHeightMaximum(java.lang.Object node,
                               ITreeTableModel model)
Description copied from interface: IRowPolicy
Returns the maximum height of the row in which the given tree node gets displayed.

Specified by:
getRowHeightMaximum in interface IRowPolicy
Parameters:
node - the tree table node for which the row height gets returned
model - the data source that returned the tree table node
Returns:
the maximum height of the row

isRowSelectable

public boolean isRowSelectable(java.lang.Object node,
                               ITreeTableModel model)
Description copied from interface: IRowPolicy
Determines whether or not the row in which the given tree node gets displayed is selectable by the user.

Specified by:
isRowSelectable in interface IRowPolicy
Parameters:
node - the tree table node for wich to check selectability
model - the data source that returned the tree table node
Returns:
TRUE if the given row / node can be selected

isRowResizable

public boolean isRowResizable(java.lang.Object node,
                              ITreeTableModel model)
Description copied from interface: IRowPolicy
Determines whether or not the row in which the given tree node gets displayed is resizable at all by the user.

Specified by:
isRowResizable in interface IRowPolicy
Parameters:
node - the tree table node for which to check resizability
model - the data source that returned the tree table node
Returns:
TRUE if the given row / node can be resized

isRowLineVisible

public boolean isRowLineVisible(java.lang.Object node,
                                boolean expanded,
                                ITreeTableModel model)
Description copied from interface: IRowPolicy
Determines whether or not the horizontal grid line for the row will be visible or not. By definition the horizontal grid line is located at the bottom of the row.

Specified by:
isRowLineVisible in interface IRowPolicy
Parameters:
node - the tree table node for wich to check the line visibility
expanded - if TRUE the tree node is currently expanded (the visibility often depends on this information)
model - the data source that returned the tree table node
Returns:
TRUE if horizontal grid line for the given row / node can be is visible

getRowToolTip

public java.lang.String getRowToolTip(java.lang.Object node,
                                      ITreeTableModel model,
                                      TreeTableColumn modelIndex)
Description copied from interface: IRowPolicy
Returns a tooltip text for the given node and column.

Specified by:
getRowToolTip in interface IRowPolicy
Parameters:
node - the node / row for which to return a tooltip
model - the data source that returned the node
modelIndex - the column for which to return a tooltip
Returns:
a text that will be displayed as a tooltip

getRowResizeCommand

public ICommand getRowResizeCommand(java.lang.Object node,
                                    ITreeTableModel model,
                                    int rowHeight)
Description copied from interface: IRowPolicy
Returns a command object that will peform the actual resizing of the row / node.

Specified by:
getRowResizeCommand in interface IRowPolicy
Parameters:
node - the node / row that is getting resized
model - the data source that returned the node
rowHeight - the new row height that the command shall apply
Returns:
a command used for resizing the given node