com.dlsc.flexgantt.command.layer
Class DefaultChangePercentageCommand

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

public class DefaultChangePercentageCommand
extends AbstractCommand

A command that will change the percentage complete value of a timeline object. This command will only work for models that are instances of DefaultGanttChartModel and timeline objects that implement the IActivityObject interface.

Since:
1.0
Author:
Dirk Lemmermann
See Also:
IActivityObject.setPercentageComplete(double), IEditActivityObjectPolicy.isPercentageChangeable(Object, Object, com.dlsc.flexgantt.model.gantt.IGanttChartModel), IEditActivityObjectPolicy.getChangePercentageCommand(Object, Object, com.dlsc.flexgantt.model.gantt.IGanttChartModel, double), Serialized Form

Constructor Summary
DefaultChangePercentageCommand(IActivityObject object, DefaultGanttChartModel model, double percentage)
          Constructs a new command.
 
Method Summary
 void executeCommand(IProgressMonitor monitor)
          Executes the command.
 IActivityObject getActivityObject()
          Returns the activity object that was / will be modified.
 DefaultGanttChartModel getModel()
          Returns the model to which the activity object belongs.
 double getNewPercentage()
          Returns the new value that will be used for the percentage complete value.
 double getOldPercentage()
          Returns the old percentage complete value.
 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

DefaultChangePercentageCommand

public DefaultChangePercentageCommand(IActivityObject object,
                                      DefaultGanttChartModel model,
                                      double percentage)
Constructs a new command.

Parameters:
object - the activity object that will be modified
model - the model to which the object belongs
percentage - the new percentage complete value (0 <= p <= 100)
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

getActivityObject

public IActivityObject getActivityObject()
Returns the activity object that was / will be modified.

Returns:
the modified activity object
Since:
1.0

getModel

public DefaultGanttChartModel getModel()
Returns the model to which the activity object belongs.

Returns:
the data source from which the activity object originated
Since:
1.0

getNewPercentage

public double getNewPercentage()
Returns the new value that will be used for the percentage complete value.

Returns:
the new percentage complete value
Since:
1.0

getOldPercentage

public double getOldPercentage()
Returns the old percentage complete value.

Returns:
the old percentage complete value
Since:
1.0