public class DefaultRelationshipPolicy extends AbstractPolicy implements IRelationshipPolicy
IRelationshipPolicy
allows all
timeline objects to be linked with each other and returns a
DefaultCreateRelationshipCommand
command object for performing the
actual linking.Constructor and Description |
---|
DefaultRelationshipPolicy() |
Modifier and Type | Method and Description |
---|---|
ICommand |
getCreateRelationshipCommand(TimelineObjectPath sourcePath,
TimelineObjectPath targetPath,
RelationshipType type,
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.
|
ICommand |
getDeleteRelationshipsCommand(Collection<IRelationship> relationships,
IGanttChartModel model)
Returns a command object that will perform the actual deletion of several
relationship objects from the given model.
|
RelationshipType[] |
getSupportedRelationshipTypes(TimelineObjectPath path,
IGanttChartModel model)
Determines the types of relationships that are supported by the given
timeline object (end to start, start to end, start to start, end to end).
|
boolean |
isDeletable(IRelationship relationship,
IGanttChartModel model)
Determines whether the given relationship object is deletable.
|
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.
|
assertClass
public RelationshipType[] getSupportedRelationshipTypes(TimelineObjectPath path, IGanttChartModel model)
IRelationshipPolicy
getSupportedRelationshipTypes
in interface IRelationshipPolicy
path
- the path to the timeline objectmodel
- the model of the nodes and timeline objectspublic ICommand getCreateRelationshipCommand(TimelineObjectPath sourcePath, TimelineObjectPath targetPath, RelationshipType type, IGanttChartModel model)
IRelationshipPolicy
getCreateRelationshipCommand
in interface IRelationshipPolicy
sourcePath
- the path to the source timeline objecttargetPath
- the path to the target timeline objecttype
- the type of relationship that the user wants to create (end to
start, start to end, start to start, end to end)model
- the source model of the node and timeline objectIRelationship
,
DefaultCreateRelationshipCommand
public ICommand getDeleteRelationshipsCommand(Collection<IRelationship> relationships, IGanttChartModel model)
IRelationshipPolicy
getDeleteRelationshipsCommand
in interface IRelationshipPolicy
relationships
- the relationships to deletemodel
- the model to which the relationship belongs objectsIRelationship
,
DefaultDeleteMultipleRelationshipsCommand
public boolean isDeletable(IRelationship relationship, IGanttChartModel model)
IRelationshipPolicy
IRelationship.isDeletable()
.isDeletable
in interface IRelationshipPolicy
relationship
- the relationship to checkmodel
- the model to which the relationship belongspublic boolean isRelationshipSource(TimelineObjectPath path, IGanttChartModel model)
IRelationshipPolicy
isRelationshipSource
in interface IRelationshipPolicy
path
- the source timeline object pathmodel
- the model of the node and timeline objectIRelationshipPolicy.isRelationshipTarget(TimelineObjectPath, TimelineObjectPath,
IGanttChartModel)
public boolean isRelationshipTarget(TimelineObjectPath sourcePath, TimelineObjectPath targetPath, IGanttChartModel model)
IRelationshipPolicy
isRelationshipTarget
in interface IRelationshipPolicy
sourcePath
- the source timeline objecttargetPath
- the target timeline objectmodel
- the model of the nodes and timeline objectsIRelationshipPolicy.isRelationshipSource(TimelineObjectPath, IGanttChartModel)
Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.