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.
|
assertClasspublic RelationshipType[] getSupportedRelationshipTypes(TimelineObjectPath path, IGanttChartModel model)
IRelationshipPolicygetSupportedRelationshipTypes in interface IRelationshipPolicypath - the path to the timeline objectmodel - the model of the nodes and timeline objectspublic ICommand getCreateRelationshipCommand(TimelineObjectPath sourcePath, TimelineObjectPath targetPath, RelationshipType type, IGanttChartModel model)
IRelationshipPolicygetCreateRelationshipCommand in interface IRelationshipPolicysourcePath - 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,
DefaultCreateRelationshipCommandpublic ICommand getDeleteRelationshipsCommand(Collection<IRelationship> relationships, IGanttChartModel model)
IRelationshipPolicygetDeleteRelationshipsCommand in interface IRelationshipPolicyrelationships - the relationships to deletemodel - the model to which the relationship belongs objectsIRelationship,
DefaultDeleteMultipleRelationshipsCommandpublic boolean isDeletable(IRelationship relationship, IGanttChartModel model)
IRelationshipPolicyIRelationship.isDeletable().isDeletable in interface IRelationshipPolicyrelationship - the relationship to checkmodel - the model to which the relationship belongspublic boolean isRelationshipSource(TimelineObjectPath path, IGanttChartModel model)
IRelationshipPolicyisRelationshipSource in interface IRelationshipPolicypath - 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)
IRelationshipPolicyisRelationshipTarget in interface IRelationshipPolicysourcePath - 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.