com.dlsc.flexgantt.policy.layer
Interface IRelationshipPolicy

All Superinterfaces:
IPolicy
All Known Implementing Classes:
DefaultRelationshipPolicy

public interface IRelationshipPolicy
extends IPolicy

A policy that supports the creation of relationships between timeline objects. The policy determines which objects can be linked and how the linking gets executed (the relationship command).

Since:
1.0
Author:
Dirk Lemmermann

Method Summary
 ICommand getCreateRelationshipCommand(TimelineObjectPath sourcePath, TimelineObjectPath targetPath, IGanttChartModel model)
          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.
 boolean isRelationshipSource(TimelineObjectPath path, IGanttChartModel model)
          Determines whether the given timeline object can be used for creating a relationship to another object.
 boolean isRelationshipTarget(TimelineObjectPath sourcePath, TimelineObjectPath targetPath, IGanttChartModel model)
          Determines whether the given source timeline object can be linked to the given target timeline object.
 

Method Detail

isRelationshipSource

boolean isRelationshipSource(TimelineObjectPath path,
                             IGanttChartModel model)
Determines whether the given timeline object can be used for creating a relationship to another object.

Parameters:
path - the source timeline object path
model - the model of the node and timeline object
Returns:
TRUE if the given timeline object can be used for a relationship object
Since:
1.0
See Also:
isRelationshipTarget(TimelineObjectPath, TimelineObjectPath, IGanttChartModel)

isRelationshipTarget

boolean isRelationshipTarget(TimelineObjectPath sourcePath,
                             TimelineObjectPath targetPath,
                             IGanttChartModel model)
Determines whether the given source timeline object can be linked to the given target timeline object.

Parameters:
sourcePath - the source tree node
targetPath - the target tree node
model - 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
Since:
1.0
See Also:
isRelationshipSource(TimelineObjectPath, IGanttChartModel)

getCreateRelationshipCommand

ICommand getCreateRelationshipCommand(TimelineObjectPath sourcePath,
                                      TimelineObjectPath targetPath,
                                      IGanttChartModel model)
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.

Parameters:
sourcePath - the path to the source timeline object
targetPath - the path to the target timeline object
model - the source model of the node and timeline object
Returns:
a command that will create a relationship between the timeline objects
Since:
1.0
See Also:
IRelationship, DefaultCreateRelationshipCommand