com.dlsc.flexgantt.policy.layer
Class DefaultRelationshipPolicy
java.lang.Object
com.dlsc.flexgantt.policy.AbstractPolicy
com.dlsc.flexgantt.policy.layer.DefaultRelationshipPolicy
- All Implemented Interfaces:
- IPolicy, IRelationshipPolicy
public class DefaultRelationshipPolicy
- extends AbstractPolicy
- implements IRelationshipPolicy
The default implementation of the IRelationshipPolicy
allows all
timeline objects to be linked with each other and returns a
DefaultCreateRelationshipCommand
command object for performing the
actual linking.
- Since:
- 1.0
- Author:
- Dirk Lemmermann
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultRelationshipPolicy
public DefaultRelationshipPolicy()
getCreateRelationshipCommand
public ICommand getCreateRelationshipCommand(TimelineObjectPath sourcePath,
TimelineObjectPath targetPath,
IGanttChartModel model)
- Description copied from interface:
IRelationshipPolicy
- Returns a command object that will perform the actual linking of the
source and target timeline objects by making the appropriate changes in
the model.
- Specified by:
getCreateRelationshipCommand
in interface IRelationshipPolicy
- Parameters:
sourcePath
- the path to the source timeline objecttargetPath
- the path to the target timeline objectmodel
- the source model of the node and timeline object
- Returns:
- a command that will create a relationship between the timeline
objects
- See Also:
IRelationship
,
DefaultCreateRelationshipCommand
isRelationshipSource
public boolean isRelationshipSource(TimelineObjectPath path,
IGanttChartModel model)
- Description copied from interface:
IRelationshipPolicy
- Determines whether the given timeline object can be used for creating a
relationship to another object.
- Specified by:
isRelationshipSource
in interface IRelationshipPolicy
- Parameters:
path
- the source timeline object pathmodel
- the model of the node and timeline object
- Returns:
- TRUE if the given timeline object can be used for a relationship
object
- See Also:
IRelationshipPolicy.isRelationshipTarget(TimelineObjectPath, TimelineObjectPath,
IGanttChartModel)
isRelationshipTarget
public boolean isRelationshipTarget(TimelineObjectPath sourcePath,
TimelineObjectPath targetPath,
IGanttChartModel model)
- Description copied from interface:
IRelationshipPolicy
- Determines whether the given source timeline object can be linked to the
given target timeline object.
- Specified by:
isRelationshipTarget
in interface IRelationshipPolicy
- Parameters:
sourcePath
- the source tree nodetargetPath
- the target tree nodemodel
- the model of the nodes and timeline objects
- Returns:
- TRUE if the given source timeline object can be linked with the
given target timeline object
- See Also:
IRelationshipPolicy.isRelationshipSource(TimelineObjectPath, IGanttChartModel)