com.dlsc.flexgantt.policy.layer
Class DefaultEditCapacityObjectPolicy

java.lang.Object
  extended by com.dlsc.flexgantt.policy.AbstractPolicy
      extended by com.dlsc.flexgantt.policy.layer.DefaultEditCapacityObjectPolicy
All Implemented Interfaces:
IPolicy, IEditCapacityObjectPolicy

public class DefaultEditCapacityObjectPolicy
extends AbstractPolicy
implements IEditCapacityObjectPolicy

The default implmementation of the edit policy for capacity objects. For a general description of this policy please refer to the policy interface IEditCapacityObjectPolicy.

Since:
1.0
Author:
Dirk Lemmermann

Constructor Summary
DefaultEditCapacityObjectPolicy()
           
 
Method Summary
 ICommand getChangeCapacityCommand(java.lang.Object node, java.lang.Object timelineObject, IGanttChartModel model, double newPercentage)
          Returns a command object that will perform the actual change of the capacity used value.
 boolean isCapacityChangeable(java.lang.Object node, java.lang.Object timelineObject, IGanttChartModel model)
          Decides whether or not the capacity used value of the object can be changed.
 
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

DefaultEditCapacityObjectPolicy

public DefaultEditCapacityObjectPolicy()
Method Detail

isCapacityChangeable

public boolean isCapacityChangeable(java.lang.Object node,
                                    java.lang.Object timelineObject,
                                    IGanttChartModel model)
Description copied from interface: IEditCapacityObjectPolicy
Decides whether or not the capacity used value of the object can be changed.

Specified by:
isCapacityChangeable in interface IEditCapacityObjectPolicy
Parameters:
node - the tree node that owns the capacity object
timelineObject - the capacity object that gets checked for its editing ability
model - the data source of the tree node and the capacity object
Returns:
TRUE if the capacity can be edited

getChangeCapacityCommand

public ICommand getChangeCapacityCommand(java.lang.Object node,
                                         java.lang.Object timelineObject,
                                         IGanttChartModel model,
                                         double newPercentage)
Description copied from interface: IEditCapacityObjectPolicy
Returns a command object that will perform the actual change of the capacity used value.

Specified by:
getChangeCapacityCommand in interface IEditCapacityObjectPolicy
Parameters:
node - the tree node that owns the capacity object
timelineObject - the capacity object that gets checked for its editing ability
model - the data source of the tree node and the capacity object
Returns:
the command object that will change the capacity used value