com.dlsc.flexgantt.command.treetable
Class DefaultRowResizeCommand

java.lang.Object
  extended by com.dlsc.flexgantt.command.AbstractCommand
      extended by com.dlsc.flexgantt.command.treetable.DefaultRowResizeCommand
All Implemented Interfaces:
ICommand, java.io.Serializable

public class DefaultRowResizeCommand
extends AbstractCommand

A command that changes the height of a tree table node. This command only works in situations where the tree table node is an implementor of the ITreeTableNode interface.

Since:
1.0
Author:
Dirk Lemmermann
See Also:
IRowPolicy.getRowResizeCommand(Object, com.dlsc.flexgantt.model.treetable.ITreeTableModel, int), Serialized Form

Constructor Summary
DefaultRowResizeCommand(ITreeTableNode node, int height)
          Constructs a new command.
 
Method Summary
 void executeCommand(IProgressMonitor monitor)
          Executes the command.
 int getNewRowHeight()
          Returns the new height of the tree table node.
 ITreeTableNode getNode()
          Returns the node that received a new row height.
 int getOldRowHeight()
          Returns the old height of the tree table node.
 void undoCommand(IProgressMonitor monitor)
          Undos the command.
 
Methods inherited from class com.dlsc.flexgantt.command.AbstractCommand
getName, isRedoable, isRelevant, isUndoable, redoCommand
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultRowResizeCommand

public DefaultRowResizeCommand(ITreeTableNode node,
                               int height)
Constructs a new command.

Parameters:
node - the tree table node that will receive a new height
height - the new height that will be assigned to the node
Since:
1.0
Method Detail

executeCommand

public void executeCommand(IProgressMonitor monitor)
Description copied from interface: ICommand
Executes the command.

Parameters:
monitor - a progress monitor

undoCommand

public void undoCommand(IProgressMonitor monitor)
Description copied from interface: ICommand
Undos the command.

Parameters:
monitor - a progress monitor

getNode

public ITreeTableNode getNode()
Returns the node that received a new row height.

Returns:
the node that gets modified
Since:
1.0

getNewRowHeight

public int getNewRowHeight()
Returns the new height of the tree table node.

Returns:
the new row height
Since:
1.0

getOldRowHeight

public int getOldRowHeight()
Returns the old height of the tree table node. This method only returns reasonable values after the command has been executed.

Returns:
the old row height
Since:
1.0