com.dlsc.flexgantt.command.layer

## Class DefaultChangePercentageCommand

- java.lang.Object
- - com.dlsc.flexgantt.command.AbstractCommand
  - - com.dlsc.flexgantt.command.layer.DefaultChangePercentageCommand

- All Implemented Interfaces:
    ICommand, 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
  Version:
    $Revision: 1.6 $
  Author:
    Dirk Lemmermann
  See Also:
    `IActivityObject.setPercentageComplete(double)`, `IEditActivityObjectPolicy.isPercentageChangeable(com.dlsc.flexgantt.model.gantt.TimelineObjectPath, com.dlsc.flexgantt.model.gantt.IGanttChartModel)`, `IEditActivityObjectPolicy.getChangePercentageCommand(com.dlsc.flexgantt.model.gantt.TimelineObjectPath, com.dlsc.flexgantt.model.gantt.IGanttChartModel, double)`, Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultChangePercentageCommand(IActivityObject object, DefaultGanttChartModel model, double percentage)` Constructs a new command.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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, setName`

    - ### 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)
                              throws CommandException

      Description copied from interface: `ICommand`
      Executes the command.
      Parameters:
        `monitor` - a progress monitor
      Throws:
        `CommandException` - if anything during the execution of the command has gone wrong

    - #### undoCommand

          public void undoCommand(IProgressMonitor monitor)
                           throws CommandException

      Description copied from interface: `ICommand`
      Undos the command.
      Parameters:
        `monitor` - a progress monitor
      Throws:
        `CommandException` - if anything during the execution of the command has gone wrong

    - #### 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

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