Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AbstractExecutionSpecificationEditPart.java437
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AbstractMessageEditPart.java23
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AnnotatedLinkEditPart.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/BorderItemLabelEditPart.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CCombinedCompartmentEditPart.java225
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CCombinedFragmentEditPart.java88
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CInteractionEditPart.java182
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CLifeLineEditPart.java76
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomActionExecutionSpecificationEditPart.java43
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCombinedFragment2EditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCombinedFragmentCombinedFragmentCompartmentEditPart.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCommentAnnotatedElementEditPart.java10
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCommentEditPart.java10
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomConsiderIgnoreFragmentEditPart.java15
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomConstraintConstrainedElementEditPart.java42
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomConstraintEditPart.java10
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomContinuationEditPart.java10
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDestructionOccurrenceSpecificationEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationConstraintEditPart.java5
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationConstraintInMessageEditPart.java11
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationObservationEditPart.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomGeneralOrderingEditPart.java11
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionInteractionCompartmentEditPart.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionNameEditPart.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionOperandEditPart.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionUseEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomLifelineNameEditPart.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageAsyncEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageCreateEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageDeleteEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageFoundEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageLostEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageReplyEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageSyncEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomStateInvariantEditPart.java17
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeConstraintEditPart.java11
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeObservationEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ExecutionSpecificationEndEditPart.java88
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ExecutionSpecificationRectangleFigure.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GateEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionOperandGuardEditPart.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageEndEditPart.java137
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/OLDCustomBehaviorExecutionSpecificationEditPart.java (renamed from plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomBehaviorExecutionSpecificationEditPart.java)25
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/OLDCustomCombinedFragmentEditPart.java (renamed from plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCombinedFragmentEditPart.java)13
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/OLDLifelineEditPart.java (renamed from plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomLifelineEditPart.java)29
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/OLDPackageEditPart.java (renamed from plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomPackageEditPart.java)6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/OldCustomInteractionEditPart.java (renamed from plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionEditPart.java)20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AnnotatedLinkEndEditPolicy.java14
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentCreationEditPolicy.java4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentHeadImpactLayoutEditPolicy.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentItemComponentEditPolicy.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CreationOnMessageEditPolicy.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CustomCombinedFragment2ResizeEditPolicy.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CustomDiagramDragDropEditPolicy.java53
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DeleteTimeElementWithoutEventPolicy.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ElementCreationWithMessageEditPolicy.java49
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ExecutionSpecificationComponentEditPolicy.java4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ExecutionSpecificationEndGraphicalNodeEditPolicy.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/GatesHolderGraphicalNodeEditPolicy.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/HighlightEditPolicy.java14
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionCompartmentXYLayoutEditPolicy.java12
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionGraphicalNodeEditPolicy.java4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionHeadImpactLayoutEditPolicy.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandDragDropEditPolicy.java43
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifeLineAffixedNodesCreationEditPolicy.java89
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineAppliedStereotypeNodeLabelDisplayEditPolicy.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineChildGraphicalNodeEditPolicy.java16
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineHeadImpactLayoutEditPolicy.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineSelectionEditPolicy.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/OLDDestructionEventComponentEditPolicy.java (renamed from plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DestructionEventComponentEditPolicy.java)2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/OLDLifeLineLayoutEditPolicy.java123
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/OLDLifelineCreationEditPolicy.java (renamed from plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineCreationEditPolicy.java)19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/OLDLifelineXYLayoutEditPolicy.java (renamed from plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineXYLayoutEditPolicy.java)35
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/OLDMessageConnectionEditPolicy.java (renamed from plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageConnectionEditPolicy.java)2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/OLDSequenceGraphicalNodeEditPolicy.java710
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ObservationLinkPolicy.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/SequenceGraphicalNodeEditPolicy.java710
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomActionExecutionSpecificationItemSemanticEditPolicy.java257
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomBehaviorExecutionSpecificationItemSemanticEditPolicy.java257
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomCombinedFragment2ItemSemanticEditPolicy.java223
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomCombinedFragmentCombinedFragmentCompartmentItemSemanticEditPolicy.java96
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomCombinedFragmentItemSemanticEditPolicy.java210
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomCommentAnnotatedElementItemSemanticEditPolicy.java52
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomCommentItemSemanticEditPolicy.java210
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomConsiderIgnoreFragmentItemSemanticEditPolicy.java209
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomConstraintConstrainedElementItemSemanticEditPolicy.java52
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomConstraintItemSemanticEditPolicy.java217
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomContinuationItemSemanticEditPolicy.java210
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomDestructionOccurrenceSpecificationItemSemanticEditPolicy.java235
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomDurationConstraintInMessageItemSemanticEditPolicy.java210
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomDurationConstraintItemSemanticEditPolicy.java210
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomDurationObservationItemSemanticEditPolicy.java210
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomGeneralOrderingItemSemanticEditPolicy.java200
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionContextLinkSemanticEditPolicy.java33
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionInteractionCompartmentItemSemanticEditPolicy.java70
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionItemSemanticEditPolicy.java219
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionOperandContextLinkSemanticEditPolicy.java92
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionOperandItemSemanticEditPolicy.java311
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionUseItemSemanticEditPolicy.java210
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomLifelineItemSemanticEditPolicy.java339
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageASyncItemSemanticEditPolicy.java233
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageCreateItemSemanticEditPolicy.java234
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageDeleteItemSemanticEditPolicy.java230
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageFoundItemSemanticEditPolicy.java230
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageLostItemSemanticEditPolicy.java230
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageReplyItemSemanticEditPolicy.java230
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageSyncItemSemanticEditPolicy.java230
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomPackageItemSemanticEditPolicy.java38
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomStateInvariantItemSemanticEditPolicy.java210
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomTimeConstraintItemSemanticEditPolicy.java210
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomTimeObservationItemSemanticEditPolicy.java210
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/GateItemSemanticEditPolicy.java160
112 files changed, 2015 insertions, 8437 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AbstractExecutionSpecificationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AbstractExecutionSpecificationEditPart.java
index 1db2a3008f9..7175a1e520c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AbstractExecutionSpecificationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AbstractExecutionSpecificationEditPart.java
@@ -10,7 +10,6 @@ import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.Locator;
import org.eclipse.draw2d.PositionConstants;
import org.eclipse.draw2d.RelativeLocator;
-import org.eclipse.draw2d.TreeSearch;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.PrecisionPoint;
@@ -32,6 +31,7 @@ import org.eclipse.gef.requests.ReconnectRequest;
import org.eclipse.gmf.runtime.common.core.util.Log;
import org.eclipse.gmf.runtime.common.core.util.Trace;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableShapeEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.internal.DiagramUIDebugOptions;
import org.eclipse.gmf.runtime.diagram.ui.internal.DiagramUIPlugin;
@@ -52,15 +52,18 @@ import org.eclipse.gmf.runtime.notation.IdentityAnchor;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.gmf.runtime.notation.datatype.GradientData;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure;
import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.LinkLFSVGNodePlateFigure;
import org.eclipse.papyrus.uml.diagram.common.editparts.RoundedCompartmentEditPart;
import org.eclipse.papyrus.uml.diagram.common.figure.node.NodeNamedElementFigure;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure;
import org.eclipse.papyrus.uml.diagram.sequence.edit.helpers.AnchorHelper;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.AppliedStereotypeCommentCreationEditPolicyEx;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.LifelineXYLayoutEditPolicy;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.OLDLifelineXYLayoutEditPolicy;
+import org.eclipse.papyrus.uml.diagram.sequence.figures.ExecutionSpecificationNodePlate;
+import org.eclipse.papyrus.uml.diagram.sequence.figures.ILifelineInternalFigure;
import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.sequence.referencialgrilling.ConnectExecutionNodeToGrillingEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.util.HighlightUtil;
import org.eclipse.papyrus.uml.diagram.sequence.util.LifelineEditPartUtil;
import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceUtil;
@@ -77,7 +80,9 @@ import org.eclipse.uml2.uml.UMLPackage;
public abstract class AbstractExecutionSpecificationEditPart extends RoundedCompartmentEditPart {
public static final String EXECUTION_FIX_ANCHOR_POSITION = "Execution Fix Anchor Position";
-
+ public static int DEFAUT_HEIGHT=100;
+ public static int DEFAUT_WIDTH=20;
+
private List<ExecutionSpecificationEndEditPart> executionSpecificationEndParts;
public AbstractExecutionSpecificationEditPart(View view) {
@@ -121,141 +126,7 @@ public abstract class AbstractExecutionSpecificationEditPart extends RoundedComp
@Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ResizableShapeEditPolicy() {
-
- @Override
- protected Command getResizeCommand(ChangeBoundsRequest request) {
- CompoundCommand command = new CompoundCommand();
- command.add(super.getResizeCommand(request));
- EditPart host = getHost();
- LifelineEditPart lifelinePart = SequenceUtil.getParentLifelinePart(host);
- // Calculate children levels
- List<ShapeNodeEditPart> movedChildrenParts = LifelineXYLayoutEditPolicy.getAffixedExecutionSpecificationEditParts((ShapeNodeEditPart) host);
- List<ShapeNodeEditPart> testChildrenParts = new ArrayList<ShapeNodeEditPart>(movedChildrenParts);
- HashMap<ShapeNodeEditPart, Integer> childrenLevels = new HashMap<ShapeNodeEditPart, Integer>();
- Integer currentLevel = 0;
- while (!testChildrenParts.isEmpty()) {
- currentLevel++;
- List<ShapeNodeEditPart> testChildrenPartsNew = new ArrayList<ShapeNodeEditPart>(testChildrenParts);
- HashMap<ShapeNodeEditPart, Integer> childrenLevelsNew = new HashMap<ShapeNodeEditPart, Integer>(childrenLevels);
- for (ShapeNodeEditPart child : testChildrenParts) {
- IFigure figure = child.getFigure();
- Rectangle childRect = figure.getBounds().getCopy();
- if (figure instanceof HandleBounds) {
- childRect = ((HandleBounds) figure).getBounds().getCopy();
- }
- movedChildrenParts.remove(child);
- ShapeNodeEditPart parentTest = LifelineXYLayoutEditPolicy.getParent(lifelinePart, childRect, movedChildrenParts);
- movedChildrenParts.add(child);
- if (childrenLevels.containsKey(parentTest) || parentTest == null) {
- testChildrenPartsNew.remove(child);
- childrenLevelsNew.put(child, currentLevel);
- }
- }
- childrenLevels = childrenLevelsNew;
- testChildrenParts = testChildrenPartsNew;
- }
- // Fetch basic coords
- Rectangle rectRequest = getInitialFeedbackBounds().getCopy();
- getHostFigure().translateToAbsolute(rectRequest);
- rectRequest.translate(0, request.getMoveDelta().y);
- rectRequest.resize(0, request.getSizeDelta().height);
- for (ShapeNodeEditPart child : movedChildrenParts) {
- IFigure figure = child.getFigure();
- Rectangle originalRect = figure.getBounds().getCopy();
- if (figure instanceof HandleBounds) {
- originalRect = ((HandleBounds) figure).getBounds().getCopy();
- }
- Integer level = childrenLevels.get(child);
- Rectangle r = rectRequest.getCopy();
- r.translate(0, level * LifelineXYLayoutEditPolicy.SPACING_HEIGHT);
- r.resize(0, -2 * level * LifelineXYLayoutEditPolicy.SPACING_HEIGHT);
- Rectangle translatedRect = originalRect.getCopy();
- figure.translateToAbsolute(translatedRect);
- if (translatedRect.y < r.y || translatedRect.bottom() > r.bottom()) {
- int moveAmount = 0;
- int resizeAmount = 0;
- if (translatedRect.y < r.y) {
- moveAmount = r.y - translatedRect.y;
- resizeAmount = moveAmount;
- } else { // translatedRect.bottom() > r.bottom()
- resizeAmount = translatedRect.bottom() - r.bottom();
- }
- if (translatedRect.height() - resizeAmount < figure.getMinimumSize().height()) {
- return UnexecutableCommand.INSTANCE;
- }
- // Resize child ES
- ChangeBoundsRequest esRequest = new ChangeBoundsRequest(org.eclipse.gef.RequestConstants.REQ_MOVE);
- esRequest.setEditParts(child);
- esRequest.setResizeDirection(PositionConstants.SOUTH);
- esRequest.setMoveDelta(new Point(0, moveAmount));
- esRequest.setSizeDelta(new Dimension(0, -resizeAmount));
- Command moveESCommand = LifelineXYLayoutEditPolicy.getResizeOrMoveChildrenCommand((LifelineEditPart) lifelinePart, esRequest, false, false, true);
- if (moveESCommand != null && !moveESCommand.canExecute()) {
- // forbid creation of the message if the es can't be moved correctly
- return UnexecutableCommand.INSTANCE;
- } else if (moveESCommand != null) {
- command.add(moveESCommand);
- }
- }
- }
- return command.unwrap();
- }
-
- @Override
- protected void showChangeBoundsFeedback(ChangeBoundsRequest request) {
- request.getMoveDelta().x = 0; // reset offset
- IFigure feedback = getDragSourceFeedbackFigure();
- PrecisionRectangle rect = new PrecisionRectangle(getInitialFeedbackBounds().getCopy());
- getHostFigure().translateToAbsolute(rect);
- IFigure f = getHostFigure();
- Dimension min = f.getMinimumSize().getCopy();
- Dimension max = f.getMaximumSize().getCopy();
- IMapMode mmode = MapModeUtil.getMapMode(f);
- min.height = mmode.LPtoDP(min.height);
- min.width = mmode.LPtoDP(min.width);
- max.height = mmode.LPtoDP(max.height);
- max.width = mmode.LPtoDP(max.width);
- Rectangle originalBounds = rect.getCopy();
- rect.translate(request.getMoveDelta());
- rect.resize(request.getSizeDelta());
- if (min.width > rect.width) {
- rect.width = min.width;
- } else if (max.width < rect.width) {
- rect.width = max.width;
- }
- if (min.height > rect.height) {
- rect.height = min.height;
- } else if (max.height < rect.height) {
- rect.height = max.height;
- }
- if (rect.height == min.height && request.getSizeDelta().height < 0 && request.getMoveDelta().y > 0) { // shrink at north
- Point loc = rect.getLocation();
- loc.y = originalBounds.getBottom().y - min.height;
- rect.setLocation(loc);
- request.getSizeDelta().height = min.height - originalBounds.height;
- request.getMoveDelta().y = loc.y - originalBounds.y;
- }
- if (request.getSizeDelta().height == 0) { // moving
- EditPart parentBar = moveExecutionSpecificationFeedback(request, AbstractExecutionSpecificationEditPart.this, rect);
- if (parentBar == null) {
- parentBar = getParent();
- }
- // Highlight the parentBar when perform moving.
- HighlightUtil.unhighlight();
- HighlightUtil.highlight(parentBar);
- }
- feedback.translateToRelative(rect);
- feedback.setBounds(rect);
- }
-
- @Override
- protected void eraseChangeBoundsFeedback(ChangeBoundsRequest request) {
- super.eraseChangeBoundsFeedback(request);
- HighlightUtil.unhighlight();
- }
- });
- // install a editpolicy to display stereotypes
+ installEditPolicy(ConnectExecutionNodeToGrillingEditPolicy.CONNECT_TO_GRILLING_MANAGEMENT, new ConnectExecutionNodeToGrillingEditPolicy());
installEditPolicy(AppliedStereotypeCommentEditPolicy.APPLIED_STEREOTYPE_COMMENT, new AppliedStereotypeCommentCreationEditPolicyEx());
}
@@ -307,164 +178,123 @@ public abstract class AbstractExecutionSpecificationEditPart extends RoundedComp
return true;
}
- @Override
- protected void handleNotificationEvent(Notification event) {
- super.handleNotificationEvent(event);
- Object feature = event.getFeature();
- if ((getModel() != null) && (getModel() == event.getNotifier())) {
- if (NotationPackage.eINSTANCE.getLineStyle_LineWidth().equals(feature)) {
- refreshLineWidth();
- } else if (NotationPackage.eINSTANCE.getLineTypeStyle_LineType().equals(feature)) {
- refreshLineType();
- }
- } else if (NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
- || NotationPackage.eINSTANCE.getSize_Width().equals(feature)) {
- getParent().refresh();
- } else if (UMLPackage.eINSTANCE.getExecutionSpecification_Finish().equals(feature) || UMLPackage.eINSTANCE.getExecutionSpecification_Start().equals(feature)) {
- if (executionSpecificationEndParts != null) {
- for (ExecutionSpecificationEndEditPart child : executionSpecificationEndParts) {
- removeChild(child);
- child.removeFromResource();
- }
- executionSpecificationEndParts = null;
- }
- refreshChildren();
- }
- refreshShadow();
- }
-
- public class ExecutionSpecificationRectangleFigure extends RoundedCompartmentFigure {
- public ExecutionSpecificationRectangleFigure() {
- this.setPreferredSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(60)));
- this.setMinimumSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(20)));
- }
-
- @Override
- public IFigure findMouseEventTargetAt(int x, int y) {
- // check children first instead of self
- IFigure f = findMouseEventTargetInDescendantsAt(x, y);
- if (f != null) {
- return f;
- }
- if (!containsPoint(x, y)) {
- return null;
- }
- if (isMouseEventTarget()) {
- return this;
- }
- return null;
- }
-
- @Override
- public IFigure findFigureAt(int x, int y, TreeSearch search) {
- if (search.prune(this)) {
- return null;
- }
- IFigure child = findDescendantAtExcluding(x, y, search);
- if (child != null) {
- return child;
- }
- if (!containsPoint(x, y)) {
- return null;
- }
- if (search.accept(this)) {
- return this;
- }
- return null;
- }
- }
+// @Override
+// protected void handleNotificationEvent(Notification event) {
+// super.handleNotificationEvent(event);
+// Object feature = event.getFeature();
+// if ((getModel() != null) && (getModel() == event.getNotifier())) {
+// if (NotationPackage.eINSTANCE.getLineStyle_LineWidth().equals(feature)) {
+// refreshLineWidth();
+// } else if (NotationPackage.eINSTANCE.getLineTypeStyle_LineType().equals(feature)) {
+// refreshLineType();
+// }
+// } else if (NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+// || NotationPackage.eINSTANCE.getSize_Width().equals(feature)) {
+// getParent().refresh();
+// } else if (UMLPackage.eINSTANCE.getExecutionSpecification_Finish().equals(feature) || UMLPackage.eINSTANCE.getExecutionSpecification_Start().equals(feature)) {
+// if (executionSpecificationEndParts != null) {
+// for (ExecutionSpecificationEndEditPart child : executionSpecificationEndParts) {
+// removeChild(child);
+// child.removeFromResource();
+// }
+// executionSpecificationEndParts = null;
+// }
+// refreshChildren();
+// }
+// refreshShadow();
+// }
@Override
public abstract ExecutionSpecificationRectangleFigure getPrimaryShape();
// see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=385604
- protected ShapeNodeEditPart moveExecutionSpecificationFeedback(ChangeBoundsRequest request, AbstractExecutionSpecificationEditPart movedPart, PrecisionRectangle rect) {
- CustomLifelineEditPart lifelineEP = (CustomLifelineEditPart) movedPart.getParent();
- Rectangle copy = rect.getCopy();
- lifelineEP.getPrimaryShape().translateToRelative(copy);
- List<ShapeNodeEditPart> executionSpecificationList = LifelineEditPartUtil.getChildShapeNodeEditPart(lifelineEP);
- List<ShapeNodeEditPart> movedChildrenParts = LifelineXYLayoutEditPolicy.getAffixedExecutionSpecificationEditParts(AbstractExecutionSpecificationEditPart.this);
- executionSpecificationList.remove(movedPart); // ignore current action and its children
- executionSpecificationList.removeAll(movedChildrenParts);
- ShapeNodeEditPart parentBar = LifelineXYLayoutEditPolicy.getParent(lifelineEP, copy, executionSpecificationList);
- Rectangle dotLineBounds = lifelineEP.getPrimaryShape().getFigureLifelineDotLineFigure().getBounds();
- int dotLineBarLocationX = dotLineBounds.x + dotLineBounds.width / 2 - LifelineXYLayoutEditPolicy.EXECUTION_INIT_WIDTH / 2;
- if (parentBar == null) {
- if (dotLineBarLocationX < copy.x) { // there is no parent bar, move to the center dotline position
- int dx = dotLineBarLocationX - copy.x;
- request.getMoveDelta().x += dx;
- rect.x += dx;
- }
- } else {
- while (!executionSpecificationList.isEmpty()) {
- Rectangle parentBounds = parentBar.getFigure().getBounds();
- int width = parentBounds.width > 0 ? parentBounds.width : LifelineXYLayoutEditPolicy.EXECUTION_INIT_WIDTH;
- int x = parentBounds.x + width / 2 + 1; // affixed to the parent bar
- int dx = x - copy.x;
- rect.x += dx;
- request.getMoveDelta().x += dx;
- copy.x = x;
- // check again to see if the new bar location overlaps with existing bars
- ShapeNodeEditPart part = LifelineXYLayoutEditPolicy.getParent(lifelineEP, copy, executionSpecificationList);
- if (part == parentBar) {
- break;
- } else {
- // if overlaps, go on moving the bar to next x position
- parentBar = part;
- }
- }
- }
- return parentBar;
- }
-
- /**
- * Override for add elements on ExecutionSpecification
- */
- @Override
- public Command getCommand(Request request) {
- if (request instanceof CreateUnspecifiedTypeRequest) {
- return getParent().getCommand(request);
- }
- return super.getCommand(request);
- }
-
- /**
- * @generated NOT Override for redirecting creation request to the lifeline
- */
- @Override
- public void showSourceFeedback(Request request) {
- if (request instanceof CreateUnspecifiedTypeRequest) {
- getParent().showSourceFeedback(request);
- }
- super.showSourceFeedback(request);
- }
-
- /**
- * @generated NOT Override for redirecting creation request to the lifeline
- */
- @Override
- public void eraseSourceFeedback(Request request) {
- if (request instanceof CreateUnspecifiedTypeRequest) {
- getParent().eraseSourceFeedback(request);
- }
- super.eraseSourceFeedback(request);
- }
-
- @Override
- public void showTargetFeedback(Request request) {
- if (request instanceof CreateUnspecifiedTypeRequest) {
- getParent().showTargetFeedback(request);
- }
- super.showTargetFeedback(request);
- }
-
- @Override
- public void eraseTargetFeedback(Request request) {
- if (request instanceof CreateUnspecifiedTypeRequest) {
- getParent().eraseTargetFeedback(request);
- }
- super.eraseTargetFeedback(request);
- }
+// protected ShapeNodeEditPart moveExecutionSpecificationFeedback(ChangeBoundsRequest request, AbstractExecutionSpecificationEditPart movedPart, PrecisionRectangle rect) {
+// OLDLifelineEditPart lifelineEP = (OLDLifelineEditPart) movedPart.getParent();
+// Rectangle copy = rect.getCopy();
+// lifelineEP.getPrimaryShape().translateToRelative(copy);
+// List<ShapeNodeEditPart> executionSpecificationList = LifelineEditPartUtil.getChildShapeNodeEditPart(lifelineEP);
+// List<ShapeNodeEditPart> movedChildrenParts = OLDLifelineXYLayoutEditPolicy.getAffixedExecutionSpecificationEditParts(AbstractExecutionSpecificationEditPart.this);
+// executionSpecificationList.remove(movedPart); // ignore current action and its children
+// executionSpecificationList.removeAll(movedChildrenParts);
+// ShapeNodeEditPart parentBar = OLDLifelineXYLayoutEditPolicy.getParent(lifelineEP, copy, executionSpecificationList);
+// Rectangle dotLineBounds = lifelineEP.getPrimaryShape().getFigureLifelineDotLineFigure().getBounds();
+// int dotLineBarLocationX = dotLineBounds.x + dotLineBounds.width / 2 - OLDLifelineXYLayoutEditPolicy.EXECUTION_INIT_WIDTH / 2;
+// if (parentBar == null) {
+// if (dotLineBarLocationX < copy.x) { // there is no parent bar, move to the center dotline position
+// int dx = dotLineBarLocationX - copy.x;
+// request.getMoveDelta().x += dx;
+// rect.x += dx;
+// }
+// } else {
+// while (!executionSpecificationList.isEmpty()) {
+// Rectangle parentBounds = parentBar.getFigure().getBounds();
+// int width = parentBounds.width > 0 ? parentBounds.width : OLDLifelineXYLayoutEditPolicy.EXECUTION_INIT_WIDTH;
+// int x = parentBounds.x + width / 2 + 1; // affixed to the parent bar
+// int dx = x - copy.x;
+// rect.x += dx;
+// request.getMoveDelta().x += dx;
+// copy.x = x;
+// // check again to see if the new bar location overlaps with existing bars
+// ShapeNodeEditPart part = OLDLifelineXYLayoutEditPolicy.getParent(lifelineEP, copy, executionSpecificationList);
+// if (part == parentBar) {
+// break;
+// } else {
+// // if overlaps, go on moving the bar to next x position
+// parentBar = part;
+// }
+// }
+// }
+// return parentBar;
+// }
+
+// /**
+// * Override for add elements on ExecutionSpecification
+// */
+// @Override
+// public Command getCommand(Request request) {
+// if (request instanceof CreateUnspecifiedTypeRequest) {
+// return getParent().getCommand(request);
+// }
+// return super.getCommand(request);
+// }
+//
+// /**
+// * @generated NOT Override for redirecting creation request to the lifeline
+// */
+// @Override
+// public void showSourceFeedback(Request request) {
+// if (request instanceof CreateUnspecifiedTypeRequest) {
+// getParent().showSourceFeedback(request);
+// }
+// super.showSourceFeedback(request);
+// }
+//
+// /**
+// * @generated NOT Override for redirecting creation request to the lifeline
+// */
+// @Override
+// public void eraseSourceFeedback(Request request) {
+// if (request instanceof CreateUnspecifiedTypeRequest) {
+// getParent().eraseSourceFeedback(request);
+// }
+// super.eraseSourceFeedback(request);
+// }
+//
+// @Override
+// public void showTargetFeedback(Request request) {
+// if (request instanceof CreateUnspecifiedTypeRequest) {
+// getParent().showTargetFeedback(request);
+// }
+// super.showTargetFeedback(request);
+// }
+//
+// @Override
+// public void eraseTargetFeedback(Request request) {
+// if (request instanceof CreateUnspecifiedTypeRequest) {
+// getParent().eraseTargetFeedback(request);
+// }
+// super.eraseTargetFeedback(request);
+// }
/**
* Add connection on top off the figure during the feedback.
@@ -662,30 +492,11 @@ public abstract class AbstractExecutionSpecificationEditPart extends RoundedComp
@Override
protected NodeFigure createSVGNodePlate() {
- LinkLFSVGNodePlateFigure svgNodePlateFigure = new LinkLFSVGNodePlateFigure(this, -1, -1) {
- /**
- * @see org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure#isDefaultAnchorArea(org.eclipse.draw2d.geometry.PrecisionPoint)
- */
- @Override
- protected boolean isDefaultAnchorArea(PrecisionPoint p) {
- return false;
- }
-
- @Override
- public ConnectionAnchor getConnectionAnchor(String terminal) {
- // Use FixedAnchorEx for MessageSync, this will be invoked by mapConnectionAnchor(termial) operation.
- if (terminal != null && terminal.indexOf("{") != -1 && terminal.indexOf("}") != -1) {
- int position = AnchorHelper.FixedAnchorEx.parsePosition(terminal);
- if (PositionConstants.TOP == position || PositionConstants.BOTTOM == position) {
- return new AnchorHelper.FixedAnchorEx(this, position);
- }
- }
- return super.getConnectionAnchor(terminal);
- }
- };
+ ExecutionSpecificationNodePlate svgNodePlateFigure= new ExecutionSpecificationNodePlate(this, -1, -1);
svgNodePlateFigure.setMinimumSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(20))); // min height 20
svgNodePlate = svgNodePlateFigure.withLinkLFEnabled();
svgNodePlate.setDefaultNodePlate(createNodePlate());
return svgNodePlate;
}
+
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AbstractMessageEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AbstractMessageEditPart.java
index c069917bb87..2140d3b833a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AbstractMessageEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AbstractMessageEditPart.java
@@ -10,6 +10,7 @@ import org.eclipse.draw2d.geometry.PointList;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gef.ConnectionEditPart;
+import org.eclipse.gef.DragTracker;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.Request;
import org.eclipse.gef.requests.ReconnectRequest;
@@ -25,6 +26,7 @@ import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.Shape;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.selection.SelectSeveralLinksEditPartTracker;
import org.eclipse.papyrus.uml.diagram.common.editparts.UMLConnectionNodeEditPart;
import org.eclipse.papyrus.uml.diagram.common.figure.edge.UMLEdgeFigure;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.InteractionFragmentsOrderingEditPolicy;
@@ -32,6 +34,9 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.LifelineChildGraph
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.MessageLabelEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.figures.MessageFigure;
import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.sequence.referencialgrilling.ConnectEdgeToGrillingEditPolicy;
+import org.eclipse.papyrus.uml.diagram.sequence.referencialgrilling.ConnectLifeLineToGrillingEditPolicy;
+import org.eclipse.papyrus.uml.diagram.sequence.util.SelectMessagesEditPartTracker;
import org.eclipse.papyrus.uml.diagram.sequence.util.SelfMessageHelper;
import org.eclipse.swt.events.MouseMoveListener;
import org.eclipse.swt.graphics.Cursor;
@@ -71,6 +76,22 @@ public abstract class AbstractMessageEditPart extends UMLConnectionNodeEditPart
}
}
+ /**
+ * This method has been added in order to satisfy the requirement Diagram.UML.Sequence.REQ_004:
+ * <I>"It should be possible to select and move several messages at the same time."</I>
+ * @see org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart#getDragTracker(org.eclipse.gef.Request)
+ *
+ *
+ * @param req
+ * @return the drag tracker
+ *
+ */
+ @Override
+ public DragTracker getDragTracker(Request req) {
+ return new SelectMessagesEditPartTracker(this);
+ }
+
+
private void hookGraphicalViewer() {
if (SelfMessageHelper.isSelfLink(this)) {
getViewer().getControl().addMouseMoveListener(mouseMoveListener = new MouseMoveListener() {
@@ -227,6 +248,8 @@ public abstract class AbstractMessageEditPart extends UMLConnectionNodeEditPart
installEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY, new MessageLabelEditPolicy());
// Ordering Message Occurrence Specification. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=403233
installEditPolicy(InteractionFragmentsOrderingEditPolicy.ORDERING_ROLE, new InteractionFragmentsOrderingEditPolicy());
+ installEditPolicy(ConnectLifeLineToGrillingEditPolicy.CONNECT_TO_GRILLING_MANAGEMENT, new ConnectEdgeToGrillingEditPolicy());
+
}
@Override
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AnnotatedLinkEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AnnotatedLinkEditPart.java
index 41b7f538dbb..8bb135e1613 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AnnotatedLinkEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AnnotatedLinkEditPart.java
@@ -36,7 +36,7 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.AnnotatedLinkEndpo
*
* @author Jin Liu (jin.liu@soyatec.com)
*/
-public abstract class AnnotatedLinkEditPart extends ConnectionNodeEditPart implements ITreeBranchEditPart {
+public abstract class AnnotatedLinkEditPart extends org.eclipse.papyrus.infra.gmfdiag.common.editpart.ConnectionEditPart implements ITreeBranchEditPart {
/**
* Constructor.
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/BorderItemLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/BorderItemLabelEditPart.java
index ea006fbd709..4d767a4daf5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/BorderItemLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/BorderItemLabelEditPart.java
@@ -70,8 +70,8 @@ import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEd
import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.uml.diagram.sequence.Activator;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.uml.diagram.sequence.part.UMLDiagramEditorPlugin;
import org.eclipse.swt.SWT;
import org.eclipse.swt.accessibility.AccessibleEvent;
import org.eclipse.swt.graphics.Color;
@@ -553,7 +553,7 @@ public abstract class BorderItemLabelEditPart extends PapyrusLabelEditPart imple
protected void initExtendedEditorConfiguration() {
if (configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ final String languagePreferred = UMLDiagramEditorPlugin.getInstance().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
@@ -563,7 +563,7 @@ public abstract class BorderItemLabelEditPart extends PapyrusLabelEditPart imple
}
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ String languagePreferred = UMLDiagramEditorPlugin.getInstance().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CCombinedCompartmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CCombinedCompartmentEditPart.java
new file mode 100644
index 00000000000..3438dcf8d21
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CCombinedCompartmentEditPart.java
@@ -0,0 +1,225 @@
+/**
+ * Copyright (c) 2016 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ */
+package org.eclipse.papyrus.uml.diagram.sequence.edit.parts;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.editpolicies.ResizableEditPolicy;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultGraphicalNodeEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure;
+import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.RoundedRectangleNodePlateFigure;
+import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.SelectableBorderedNodeFigure;
+import org.eclipse.papyrus.uml.diagram.common.editparts.RoundedCompartmentEditPart;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.ElementCreationWithMessageEditPolicy;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.ExecutionSpecificationComponentEditPolicy;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * @generated
+ */
+public class CCombinedCompartmentEditPart extends RoundedCompartmentEditPart {
+
+ /**
+ * @generated
+ */
+ public static final String VISUAL_ID = "CombinedFragment_SubfragmentCompartment";
+
+ /**
+ * @generated
+ */
+ protected IFigure contentPane;
+
+ /**
+ * @generated
+ */
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
+ public CCombinedCompartmentEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
+ installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
+ // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
+ // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
+ }
+
+ /**
+ * Papyrus codeGen
+ *
+ * @generated
+ **/
+ @Override
+ protected void handleNotificationEvent(Notification event) {
+ super.handleNotificationEvent(event);
+
+ }
+
+ /**
+ * @generated
+ */
+ protected LayoutEditPolicy createLayoutEditPolicy() {
+ org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
+
+ @Override
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (result == null) {
+ result = new NonResizableEditPolicy();
+ }
+ return result;
+ }
+
+ @Override
+ protected Command getMoveChildrenCommand(Request request) {
+ return null;
+ }
+
+ @Override
+ protected Command getCreateCommand(CreateRequest request) {
+ return null;
+ }
+ };
+ return lep;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ protected IFigure createNodeShape() {
+ return primaryShape = new RoundedCompartmentFigure();
+ }
+
+ /**
+ * org.eclipse.papyrus.uml.diagram.sequence.edit.parts.AbstractExecutionSpecificationEditPart.ExecutionSpecificationRectangleFigure
+ *
+ * @generated
+ */
+ public RoundedCompartmentFigure getPrimaryShape() {
+ return (RoundedCompartmentFigure) primaryShape;
+ }
+
+ /**
+ * @generated
+ */
+ protected NodeFigure createNodePlate() {
+ RoundedRectangleNodePlateFigure result = new RoundedRectangleNodePlateFigure(200, 100);
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public EditPolicy getPrimaryDragEditPolicy() {
+ EditPolicy result = super.getPrimaryDragEditPolicy();
+ if (result instanceof ResizableEditPolicy) {
+ ResizableEditPolicy ep = (ResizableEditPolicy) result;
+ ep.setResizeDirections(PositionConstants.NORTH | PositionConstants.SOUTH);
+ }
+ return result;
+ }
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+ @Override
+ protected NodeFigure createNodeFigure() {
+ return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
+ }
+
+ /**
+ * Default implementation treats passed figure as content pane.
+ * Respects layout one may have set for generated figure.
+ *
+ * @param nodeShape
+ * instance of generated figure class
+ * @generated
+ */
+ protected IFigure setupContentPane(IFigure nodeShape) {
+ return nodeShape; // use nodeShape itself as contentPane
+ }
+
+ /**
+ * @generated
+ */
+ public IFigure getContentPane() {
+ if (contentPane != null) {
+ return contentPane;
+ }
+ return super.getContentPane();
+ }
+
+ /**
+ * @generated
+ */
+ protected void setForegroundColor(Color color) {
+ if (primaryShape != null) {
+ primaryShape.setForegroundColor(color);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLineWidth(int width) {
+ super.setLineWidth(width);
+ }
+
+ // /**
+ // * @generated
+ // */
+ // @Override
+ // protected void setLineWidth(int width) {
+ // if(primaryShape instanceof Shape) {
+ // ((Shape)primaryShape).setLineWidth(width);
+ // }
+ // }
+ /**
+ * @generated
+ */
+ protected void setLineType(int style) {
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CCombinedFragmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CCombinedFragmentEditPart.java
new file mode 100644
index 00000000000..2a30b822f32
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CCombinedFragmentEditPart.java
@@ -0,0 +1,88 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.sequence.edit.parts;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.uml2.uml.CombinedFragment;
+
+/**
+ * @author PT202707
+ * @since 3.0
+ *
+ */
+public class CCombinedFragmentEditPart extends CombinedFragmentEditPart {
+ public static int DEFAULT_HEIGHT=40;
+ public static int DEFAULT_WIDTH=40;
+
+
+ /**
+ * Constructor.
+ *
+ * @param view
+ */
+ public CCombinedFragmentEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentEditPart#handleNotificationEvent(org.eclipse.emf.common.notify.Notification)
+ *
+ * @param event
+ */
+ @Override
+ protected void handleNotificationEvent(Notification event) {
+ // TODO Auto-generated method stub
+ super.handleNotificationEvent(event);
+ getPrimaryShape().setName(((CombinedFragment)this.resolveSemanticElement()).getInteractionOperator().getLiteral());
+ }
+
+
+// /**
+// * Modify it to avoid scrollbar
+// */
+// protected boolean addFixedChild(EditPart childEditPart) {
+//
+// if (childEditPart instanceof CCombinedCompartmentEditPart) {
+// IFigure pane = getPrimaryShape().getCompartmentFigure();
+// setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+// pane.add(((CCombinedCompartmentEditPart) childEditPart).getFigure());
+// return true;
+// }
+//
+// return false;
+// }
+//
+// /**
+// * @generated
+// */
+// protected boolean removeFixedChild(EditPart childEditPart) {
+// if (childEditPart instanceof CCombinedCompartmentEditPart) {
+// IFigure pane = getPrimaryShape().getCompartmentFigure();
+// pane.remove(((CCombinedCompartmentEditPart) childEditPart).getFigure());
+// return true;
+// }
+// return false;
+// }
+// protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
+// if (editPart instanceof CCombinedCompartmentEditPart) {
+// return getPrimaryShape().getCompartmentFigure();
+// }
+// return getContentPane();
+// }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CInteractionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CInteractionEditPart.java
new file mode 100644
index 00000000000..cf738c485b9
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CInteractionEditPart.java
@@ -0,0 +1,182 @@
+/*****************************************************************************
+ * Copyright (c) 2016 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.sequence.edit.parts;
+
+import java.util.List;
+
+import org.eclipse.draw2d.ConnectionAnchor;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.PrecisionPoint;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.gef.ConnectionEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.LocationRequest;
+import org.eclipse.gef.requests.ReconnectRequest;
+import org.eclipse.gef.requests.TargetRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest.ConnectionViewDescriptor;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeConnectionRequest;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.BaseSlidableAnchor;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.helpers.AnchorHelper;
+import org.eclipse.papyrus.uml.service.types.element.UMLDIElementTypes;
+
+
+
+
+/**
+ * @author PT202707
+ * @since 3.0
+ *
+ */
+public class CInteractionEditPart extends InteractionEditPart{
+
+ /**
+ * Constructor.
+ *
+ * @param view
+ */
+ public CInteractionEditPart(View view) {
+ super(view);
+ }
+
+
+ //***********************************************************************
+ //**ALL this code is used to manage LOST and CREATE MESSAGE on Interaction.
+ //**************************************************************************
+ /**
+ * Handle found message
+ */
+ @Override
+ public ConnectionAnchor getSourceConnectionAnchor(Request request) {
+ ConnectionAnchor sourceAnchor = createAnchor(request, UMLDIElementTypes.MESSAGE_FOUND_EDGE, MessageFoundEditPart.VISUAL_ID, MessageFoundEditPart.class);
+ System.err.println("getSourceConnectionAnchor "+((AnchorHelper.InnerPointAnchor)(sourceAnchor)).getTerminal());
+ if (sourceAnchor == null) {
+ sourceAnchor = super.getSourceConnectionAnchor(request);
+ }
+ return sourceAnchor;
+ }
+
+ /**
+ * Handle found message
+ */
+ @Override
+ public ConnectionAnchor getSourceConnectionAnchor(ConnectionEditPart connEditPart) {
+
+ // Read the anchor and load it, it read the absolute position
+ if (connEditPart instanceof MessageFoundEditPart) {
+ String terminal = AnchorHelper.getAnchorId(getEditingDomain(), connEditPart, true);
+ if (terminal.length() > 0) {
+ PrecisionPoint pt = BaseSlidableAnchor.parseTerminalString(terminal);
+ return new AnchorHelper.InnerPointAnchor(getFigure(), pt);
+ }
+ }
+ ConnectionAnchor sourceConnectionAnchor = super.getSourceConnectionAnchor(connEditPart);
+ return sourceConnectionAnchor;
+ }
+
+ /**
+ * Handle lost message
+ */
+ @Override
+ public ConnectionAnchor getTargetConnectionAnchor(Request request) {
+
+ ConnectionAnchor targetAnchor = createAnchor(request, UMLDIElementTypes.MESSAGE_LOST_EDGE, MessageLostEditPart.VISUAL_ID, MessageLostEditPart.class);
+// if (targetAnchor == null) {
+// // Enabled to find Anchor for MessageCreate, this would be useful when showing feedbacks.
+// // Fixed bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=403134
+// targetAnchor = createAnchor(request, UMLDIElementTypes.MESSAGE_CREATE_EDGE, MessageCreateEditPart.VISUAL_ID, MessageCreateEditPart.class);
+// }
+ if (targetAnchor == null) {
+ targetAnchor = super.getTargetConnectionAnchor(request);
+ }
+ return targetAnchor;
+ }
+
+ /**
+ * Handle lost message
+ */
+ @Override
+ public ConnectionAnchor getTargetConnectionAnchor(ConnectionEditPart connEditPart) {
+ // Enabled to find Anchor for MessageCreate, this would be useful when showing feedbacks.
+ // Fixed bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=403134
+ if (connEditPart instanceof MessageLostEditPart || connEditPart instanceof MessageCreateEditPart) {
+ String terminal = AnchorHelper.getAnchorId(getEditingDomain(), connEditPart, false);
+ if (terminal.length() > 0) {
+ PrecisionPoint pt = BaseSlidableAnchor.parseTerminalString(terminal);
+ return new AnchorHelper.InnerPointAnchor(getFigure(), pt);
+ }
+ }
+ ConnectionAnchor targetConnectionAnchor = super.getTargetConnectionAnchor(connEditPart);
+ return targetConnectionAnchor;
+ }
+
+ /**
+ * Create Anchor
+ *
+ * @param request
+ * The request
+ * @param elementType
+ * The element type of the message
+ * @param visualId
+ * The visual ID of the message
+ * @param messageType
+ * The type of the message
+ * @return The connection anchor
+ */
+ private ConnectionAnchor createAnchor(Request request, IElementType elementType, String visualId, Class<?> messageType) {
+ if (request instanceof CreateUnspecifiedTypeConnectionRequest) {
+
+
+ CreateUnspecifiedTypeConnectionRequest createRequest = (CreateUnspecifiedTypeConnectionRequest) request;
+
+ List<?> relationshipTypes = createRequest.getElementTypes();
+ for (Object obj : relationshipTypes) {
+ if (elementType.equals(obj)) {
+ return createAnchor(createRequest.getLocation().getCopy());
+ }
+ }
+ } else if (request instanceof CreateConnectionViewRequest) {
+ CreateConnectionViewRequest createRequest = (CreateConnectionViewRequest) request;
+ ConnectionViewDescriptor connectionViewDescriptor = createRequest.getConnectionViewDescriptor();
+ if (connectionViewDescriptor != null) {
+ if (visualId.equals(connectionViewDescriptor.getSemanticHint())) {
+ return createAnchor(createRequest.getLocation().getCopy());
+ }
+ }
+ } else if (request instanceof ReconnectRequest) {
+ ReconnectRequest reconnectRequest = (ReconnectRequest) request;
+ ConnectionEditPart connectionEditPart = reconnectRequest.getConnectionEditPart();
+ // Fixed bug creating anchors for MessageLost and MessageFound.
+ if (messageType.isInstance(connectionEditPart) && request instanceof LocationRequest) {
+ return createAnchor(((LocationRequest) request).getLocation().getCopy());
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Create Anchor
+ *
+ * @param location
+ * The location
+ * @return The connection anchor
+ */
+ private ConnectionAnchor createAnchor(Point location) {
+ // return new SlidableAnchor(getFigure(), BaseSlidableAnchor.getAnchorRelativeLocation(location, getFigure().getBounds()));
+ return AnchorHelper.InnerPointAnchor.createAnchorAtLocation(getFigure(), new PrecisionPoint(location));
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CLifeLineEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CLifeLineEditPart.java
new file mode 100644
index 00000000000..59094fb0d18
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CLifeLineEditPart.java
@@ -0,0 +1,76 @@
+/*****************************************************************************
+ * Copyright (c) 2016 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.sequence.edit.parts;
+
+import org.eclipse.draw2d.ConnectionAnchor;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.sequence.LifelineNodePlate;
+import org.eclipse.papyrus.uml.diagram.sequence.figures.ILifelineInternalFigure;
+
+/**
+ * @author PT202707
+ * @since 3.0
+ *
+ */
+public class CLifeLineEditPart extends LifelineEditPart {
+
+ public static int DEFAUT_HEIGHT=250;
+ public static int DEFAUT_WIDTH=100;
+ /**
+ * Constructor.
+ *
+ * @param view
+ */
+ public CLifeLineEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @see org.eclipse.papyrus.infra.gmfdiag.common.editpart.NodeEditPart#createSVGNodePlate()
+ *
+ * @return
+ */
+ @Override
+ protected NodeFigure createSVGNodePlate() {
+ svgNodePlate = new LifelineNodePlate(this, -1, -1).withLinkLFEnabled();
+ svgNodePlate.setDefaultNodePlate(createNodePlate());
+
+ return svgNodePlate;
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart#getCommand(org.eclipse.gef.Request)
+ *
+ * @param _request
+ * @return
+ */
+ @Override
+ public Command getCommand(Request _request) {
+ // TODO Auto-generated method stub
+ return super.getCommand(_request);
+ }
+
+ @Override
+ public void setLayoutConstraint(EditPart child, IFigure childFigure, Object constraint) {
+ if (!(childFigure instanceof ILifelineInternalFigure)) {
+ getPrimaryShape().setConstraint(childFigure, constraint);
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomActionExecutionSpecificationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomActionExecutionSpecificationEditPart.java
index f049e1d1822..607d940d977 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomActionExecutionSpecificationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomActionExecutionSpecificationEditPart.java
@@ -13,17 +13,22 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.sequence.edit.parts;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.AppliedStereotypeCompartmentFigure;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.ExecutionGraphicalNodeEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomActionExecutionSpecificationItemSemanticEditPolicy;
+import org.eclipse.papyrus.uml.diagram.sequence.figures.ILifelineInternalFigure;
/**
* @author Jin Liu (jin.liu@soyatec.com)
*/
-public class CustomActionExecutionSpecificationEditPart extends ActionExecutionSpecificationEditPart {
+public class CustomActionExecutionSpecificationEditPart extends CCombinedCompartmentEditPart {
+ public static int DEFAULT_HEIGHT=100;
/**
* Constructor.
*
@@ -39,9 +44,39 @@ public class CustomActionExecutionSpecificationEditPart extends ActionExecutionS
@Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomActionExecutionSpecificationItemSemanticEditPolicy());
// Fixed bug about reconnect message when the ends of execution were MessageOccurrenceSpecification.
removeEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE);
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new ExecutionGraphicalNodeEditPolicy());
}
+
+
+
+ /**
+ * @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeEditPart#refreshBounds()
+ *
+ */
+ @Override
+ protected void refreshBounds() {
+ // TODO Auto-generated method stub
+ super.refreshBounds();
+ }
+ /**
+ * @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.AbstractExecutionSpecificationEditPart#refreshVisuals()
+ *
+ */
+ @Override
+ protected void refreshVisuals() {
+ // TODO Auto-generated method stub
+ super.refreshVisuals();
+ }
+ /**
+ * @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CCombinedCompartmentEditPart#handleNotificationEvent(org.eclipse.emf.common.notify.Notification)
+ *
+ * @param event
+ */
+ @Override
+ protected void handleNotificationEvent(Notification event) {
+ // TODO Auto-generated method stub
+ super.handleNotificationEvent(event);
+ }
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCombinedFragment2EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCombinedFragment2EditPart.java
index 070cbfa84cd..8ac37f0b90d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCombinedFragment2EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCombinedFragment2EditPart.java
@@ -16,12 +16,10 @@ package org.eclipse.papyrus.uml.diagram.sequence.edit.parts;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.CustomCombinedFragment2ResizeEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomCombinedFragment2ItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.figures.CoRegionCombinedFragmentFigure;
import org.eclipse.uml2.uml.Lifeline;
@@ -45,7 +43,6 @@ public class CustomCombinedFragment2EditPart extends CombinedFragment2EditPart {
@Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomCombinedFragment2ItemSemanticEditPolicy());
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new CustomCombinedFragment2ResizeEditPolicy());
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCombinedFragmentCombinedFragmentCompartmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCombinedFragmentCombinedFragmentCompartmentEditPart.java
index 9c5335e9942..e02b1072130 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCombinedFragmentCombinedFragmentCompartmentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCombinedFragmentCombinedFragmentCompartmentEditPart.java
@@ -39,7 +39,6 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.PapyrusCreationEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.CustomDiagramDragDropEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.RemoveOrphanViewPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomCombinedFragmentCombinedFragmentCompartmentItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
import org.eclipse.papyrus.uml.diagram.sequence.util.OperandBoundsComputeHelper;
@@ -96,7 +95,6 @@ public class CustomCombinedFragmentCombinedFragmentCompartmentEditPart extends C
@Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomCombinedFragmentCombinedFragmentCompartmentItemSemanticEditPolicy());
installEditPolicy(EditPolicyRoles.CREATION_ROLE, createCreationEditPolicy());
installEditPolicy("RemoveOrphanView", new RemoveOrphanViewPolicy()); //$NON-NLS-1$
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCommentAnnotatedElementEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCommentAnnotatedElementEditPart.java
index a204f1bd36c..83183cce428 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCommentAnnotatedElementEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCommentAnnotatedElementEditPart.java
@@ -20,7 +20,6 @@ import org.eclipse.gef.EditPart;
import org.eclipse.gef.LayerConstants;
import org.eclipse.gef.Request;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.draw2d.ui.internal.figures.ConnectionLayerEx;
import org.eclipse.gmf.runtime.draw2d.ui.internal.routers.FanRouter;
import org.eclipse.gmf.runtime.gef.ui.internal.tools.SelectConnectionEditPartTracker;
@@ -28,7 +27,6 @@ import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.RoutingStyle;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.uml.diagram.sequence.draw2d.routers.DurationConstraintAutomaticRouter;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomCommentAnnotatedElementItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.util.LinkRouteModelElementFactory;
/**
@@ -45,14 +43,6 @@ public class CustomCommentAnnotatedElementEditPart extends CommentAnnotatedEleme
super(view);
}
- /**
- * @Override
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomCommentAnnotatedElementItemSemanticEditPolicy());
- }
@Override
protected void handleNotificationEvent(Notification event) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCommentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCommentEditPart.java
index 7b638e11935..e809d7855ed 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCommentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCommentEditPart.java
@@ -13,12 +13,10 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.sequence.edit.parts;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
import org.eclipse.gmf.runtime.notation.FillStyle;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomCommentItemSemanticEditPolicy;
/**
* @author Jin Liu (jin.liu@soyatec.com)
@@ -34,14 +32,6 @@ public class CustomCommentEditPart extends CommentEditPart {
super(view);
}
- /**
- * @Override
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomCommentItemSemanticEditPolicy());
- }
@Override
protected void setLineWidth(int width) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomConsiderIgnoreFragmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomConsiderIgnoreFragmentEditPart.java
index abeba2b82d7..4fc04e0ecc2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomConsiderIgnoreFragmentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomConsiderIgnoreFragmentEditPart.java
@@ -19,7 +19,6 @@ import java.lang.reflect.Field;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.util.EList;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
import org.eclipse.gmf.runtime.notation.View;
@@ -28,7 +27,6 @@ import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstants
import org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper;
import org.eclipse.papyrus.uml.diagram.common.providers.UIAdapterImpl;
import org.eclipse.papyrus.uml.diagram.sequence.edit.helpers.AnchorHelper;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomConsiderIgnoreFragmentItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.part.UMLDiagramEditorPlugin;
import org.eclipse.papyrus.uml.diagram.sequence.util.NotificationHelper;
import org.eclipse.papyrus.uml.internationalization.utils.utils.UMLLabelInternationalization;
@@ -43,7 +41,7 @@ import org.eclipse.uml2.uml.UMLPackage;
/**
* @author Jin Liu (jin.liu@soyatec.com)
*/
-public class CustomConsiderIgnoreFragmentEditPart extends CustomCombinedFragmentEditPart {
+public class CustomConsiderIgnoreFragmentEditPart extends OLDCustomCombinedFragmentEditPart {
/**
* Notfier for listen and unlistend model element.
@@ -92,15 +90,6 @@ public class CustomConsiderIgnoreFragmentEditPart extends CustomCombinedFragment
}
/**
- * @Override
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomConsiderIgnoreFragmentItemSemanticEditPolicy());
- }
-
- /**
* Handle for message
*/
@Override
@@ -147,7 +136,7 @@ public class CustomConsiderIgnoreFragmentEditPart extends CustomCombinedFragment
operatorKind.append(" {").append(sb.deleteCharAt(sb.length() - 1).toString()).append("}");
}
}
- getPrimaryShape().getHeaderLabel().setText(operatorKind.toString());
+ getPrimaryShape().getNameLabel().setText(operatorKind.toString());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomConstraintConstrainedElementEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomConstraintConstrainedElementEditPart.java
deleted file mode 100644
index bf0b096cf4b..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomConstraintConstrainedElementEditPart.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.parts;
-
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomConstraintConstrainedElementItemSemanticEditPolicy;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomConstraintConstrainedElementEditPart extends ConstraintConstrainedElementEditPart {
-
- /**
- * Constructor.
- *
- * @param view
- */
- public CustomConstraintConstrainedElementEditPart(View view) {
- super(view);
- }
-
- /**
- * @Override
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomConstraintConstrainedElementItemSemanticEditPolicy());
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomConstraintEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomConstraintEditPart.java
index 5da50198f89..7a4b2103fcb 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomConstraintEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomConstraintEditPart.java
@@ -18,13 +18,11 @@ import java.util.List;
import org.eclipse.draw2d.ColorConstants;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EReference;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
import org.eclipse.gmf.runtime.notation.FillStyle;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomConstraintItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
/**
@@ -49,14 +47,6 @@ public class CustomConstraintEditPart extends ConstraintEditPart {
return figure;
}
- /**
- * @Override
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomConstraintItemSemanticEditPolicy());
- }
@Override
protected void handleNotificationEvent(Notification event) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomContinuationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomContinuationEditPart.java
index 90561e64cc2..4118c9db989 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomContinuationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomContinuationEditPart.java
@@ -17,12 +17,10 @@ import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.PositionConstants;
import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomContinuationItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.figures.ContinuationFigure;
import org.eclipse.papyrus.uml.diagram.sequence.locator.ContinuationLocator;
import org.eclipse.uml2.uml.UMLPackage;
@@ -41,14 +39,6 @@ public class CustomContinuationEditPart extends ContinuationEditPart implements
super(view);
}
- /**
- * @Override
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomContinuationItemSemanticEditPolicy());
- }
/**
* Overrides to manage the position of the Continuation
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDestructionOccurrenceSpecificationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDestructionOccurrenceSpecificationEditPart.java
index 95da6bcdcd3..e603ac18a2f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDestructionOccurrenceSpecificationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDestructionOccurrenceSpecificationEditPart.java
@@ -17,13 +17,11 @@ import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.AppliedStereotypeCommentCreationEditPolicyEx;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomDestructionOccurrenceSpecificationItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.stereotype.edition.editpolicies.AppliedStereotypeCommentEditPolicy;
/**
@@ -56,7 +54,6 @@ public class CustomDestructionOccurrenceSpecificationEditPart extends Destructio
@Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomDestructionOccurrenceSpecificationItemSemanticEditPolicy());
// install a editpolicy to display stereotypes
installEditPolicy(AppliedStereotypeCommentEditPolicy.APPLIED_STEREOTYPE_COMMENT, new AppliedStereotypeCommentCreationEditPolicyEx());
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationConstraintEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationConstraintEditPart.java
index eb902e87c76..b896b942855 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationConstraintEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationConstraintEditPart.java
@@ -48,7 +48,6 @@ import org.eclipse.gef.requests.ReconnectRequest;
import org.eclipse.gmf.runtime.common.core.util.StringStatics;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableShapeEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
import org.eclipse.gmf.runtime.diagram.ui.render.editparts.RenderedDiagramRootEditPart;
@@ -71,7 +70,6 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.helpers.AnchorHelper;
import org.eclipse.papyrus.uml.diagram.sequence.edit.helpers.AnchorHelper.FixedAnchorEx;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.AppliedStereotypeCommentCreationEditPolicyEx;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.ExternalLabelPrimaryDragRoleEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomDurationConstraintItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.figures.DurationConstraintFigure;
import org.eclipse.papyrus.uml.diagram.sequence.part.UMLDiagramEditorPlugin;
import org.eclipse.papyrus.uml.diagram.sequence.part.UMLVisualIDRegistry;
@@ -113,7 +111,6 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
@Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomDurationConstraintItemSemanticEditPolicy());
// install a editpolicy to display stereotypes, there's a bug on super class.
installEditPolicy(AppliedStereotypeCommentEditPolicy.APPLIED_STEREOTYPE_COMMENT, new AppliedStereotypeCommentCreationEditPolicyEx());
}
@@ -691,7 +688,7 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
}
public static Rectangle fixMessageBounds(Rectangle newBounds, Request cvr, LifelineEditPart host) {
- Object oc1 = getFirstElement(cvr.getExtendedData().get(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION));
+ Object oc1 = getFirstElement(cvr.getExtendedData().get(org.eclipse.papyrus.uml.service.types.utils.SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION));
Object oc2 = getFirstElement(cvr.getExtendedData().get(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2));
if (oc1 != null && oc2 != null && (oc1 instanceof MessageOccurrenceSpecification || oc2 instanceof MessageOccurrenceSpecification)) {
Point start = null, end = null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationConstraintInMessageEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationConstraintInMessageEditPart.java
index 86d85cf3327..206bbc7de82 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationConstraintInMessageEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationConstraintInMessageEditPart.java
@@ -26,14 +26,12 @@ import org.eclipse.gef.editpolicies.LayoutEditPolicy;
import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
import org.eclipse.gef.requests.CreateRequest;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
import org.eclipse.gmf.runtime.diagram.ui.figures.LabelLocator;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.uml.diagram.common.locator.ExternalLabelPositionLocator;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.ExternalLabelPrimaryDragRoleEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomDurationConstraintInMessageItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.part.UMLVisualIDRegistry;
/**
@@ -51,15 +49,6 @@ public class CustomDurationConstraintInMessageEditPart extends DurationConstrain
}
/**
- * @Override
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomDurationConstraintInMessageItemSemanticEditPolicy());
- }
-
- /**
* Make sure bounds are also refreshed.
*
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart#refresh()
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationObservationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationObservationEditPart.java
index 0f8bb0f0598..d8a7844d1e0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationObservationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationObservationEditPart.java
@@ -33,7 +33,6 @@ import org.eclipse.papyrus.uml.diagram.common.locator.ExternalLabelPositionLocat
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.CustomConnectionHandleEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.CustomExternalLabelPrimaryDragRoleEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.DeleteTimeElementWithoutEventPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomDurationObservationItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.part.UMLVisualIDRegistry;
/**
@@ -56,7 +55,6 @@ public class CustomDurationObservationEditPart extends DurationObservationEditPa
@Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomDurationObservationItemSemanticEditPolicy());
installEditPolicy(EditPolicyRoles.CONNECTION_HANDLES_ROLE, new CustomConnectionHandleEditPolicy());
removeEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
removeEditPolicy(DeleteTimeElementWithoutEventPolicy.KEY);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomGeneralOrderingEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomGeneralOrderingEditPart.java
index 944b887fd71..7586b9b3669 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomGeneralOrderingEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomGeneralOrderingEditPart.java
@@ -30,13 +30,11 @@ import org.eclipse.gef.ConnectionEditPart;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.Request;
import org.eclipse.gef.requests.ReconnectRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart;
import org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusUMLElementFigure;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomGeneralOrderingItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.figures.GeneralOrderingDescriptor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
@@ -56,15 +54,6 @@ public class CustomGeneralOrderingEditPart extends GeneralOrderingEditPart imple
super(view);
}
- /**
- * @Override
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomGeneralOrderingItemSemanticEditPolicy());
- }
-
@Override
protected void handleNotificationEvent(Notification notification) {
super.handleNotificationEvent(notification);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionInteractionCompartmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionInteractionCompartmentEditPart.java
index eaec5055deb..eb4ec63c38d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionInteractionCompartmentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionInteractionCompartmentEditPart.java
@@ -19,7 +19,6 @@ import org.eclipse.gef.Request;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.CombinedFragmentCreationEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomInteractionInteractionCompartmentItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.util.HighlightUtil;
/**
@@ -42,7 +41,6 @@ public class CustomInteractionInteractionCompartmentEditPart extends Interaction
@Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomInteractionInteractionCompartmentItemSemanticEditPolicy());
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CombinedFragmentCreationEditPolicy());
removeEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionNameEditPart.java
index d3bcd9ba40f..b583995726f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionNameEditPart.java
@@ -42,7 +42,7 @@ public class CustomInteractionNameEditPart extends InteractionNameEditPart {
Object p = getParent();
if (p instanceof InteractionEditPart) {
InteractionEditPart iep = (InteractionEditPart) p;
- IFigure container = iep.getPrimaryShape().getHeaderLabel().getParent();
+ IFigure container = iep.getPrimaryShape().getNameLabel().getParent();
if (container != null) {
container.revalidate();
container.repaint();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionOperandEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionOperandEditPart.java
index e1fc8267e67..2a691b5c956 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionOperandEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionOperandEditPart.java
@@ -84,7 +84,6 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ExecutionSpecificatio
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionOperandGuardEditPart.GuardFigure;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.CombinedFragmentCreationEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.InteractionOperandAppliedStereotypeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomInteractionOperandItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.figures.InteractionOperandFigure;
import org.eclipse.papyrus.uml.diagram.sequence.locator.ContinuationLocator;
import org.eclipse.papyrus.uml.diagram.sequence.locator.TextCellEditorLocator;
@@ -176,7 +175,6 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CombinedFragmentCreationEditPolicy());
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomInteractionOperandItemSemanticEditPolicy());
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new GuardConditionDirectEditPolicy());
removeEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE);
// display stereotype
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionUseEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionUseEditPart.java
index b8673848d99..b9d05f15680 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionUseEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionUseEditPart.java
@@ -28,7 +28,6 @@ import org.eclipse.gef.EditPolicy;
import org.eclipse.gef.Request;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.diagram.ui.figures.BorderedNodeFigure;
import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
import org.eclipse.gmf.runtime.notation.Bounds;
@@ -45,7 +44,6 @@ import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNode
import org.eclipse.papyrus.uml.diagram.common.providers.UIAdapterImpl;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.GateCreationEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.GatesHolderGraphicalNodeEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomInteractionUseItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.figures.InteractionUseRectangleFigure;
import org.eclipse.papyrus.uml.diagram.sequence.locator.GateLocator;
import org.eclipse.papyrus.uml.diagram.sequence.util.CommandHelper;
@@ -124,7 +122,6 @@ public class CustomInteractionUseEditPart extends InteractionUseEditPart {
@Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomInteractionUseItemSemanticEditPolicy());
// installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new SequenceGraphicalNodeEditPolicy());
// Fixed bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=389531
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new GatesHolderGraphicalNodeEditPolicy());
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomLifelineNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomLifelineNameEditPart.java
index 6cfd969a8d6..ec48af10dae 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomLifelineNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomLifelineNameEditPart.java
@@ -155,7 +155,7 @@ public class CustomLifelineNameEditPart extends LifelineNameEditPart {
*/
@Override
protected void handleNotificationEvent(Notification event) {
- if (getParent() instanceof CustomLifelineEditPart) {
+ if (getParent() instanceof OLDLifelineEditPart) {
Object feature = event.getFeature();
Object notifier = event.getNotifier();
Lifeline lifeline = (Lifeline) this.resolveSemanticElement();
@@ -165,10 +165,10 @@ public class CustomLifelineNameEditPart extends LifelineNameEditPart {
|| UMLPackage.Literals.NAMED_ELEMENT__NAME.equals(feature) || UMLPackage.Literals.LIFELINE__REPRESENTS.equals(feature)
|| UMLPackage.Literals.LIFELINE__DECOMPOSED_AS.equals(feature) || UMLPackage.Literals.LIFELINE__SELECTOR.equals(feature)
|| event.getNotifier() instanceof Bounds) {
- ((CustomLifelineEditPart) getParent()).updateLifelinePosition();
+ ((OLDLifelineEditPart) getParent()).updateLifelinePosition();
}
if (notifier instanceof EAnnotation && ((EAnnotation) notifier).getSource().equals(VisualInformationPapyrusConstants.CUSTOM_APPEARENCE_ANNOTATION)) {
- ((CustomLifelineEditPart) getParent()).updateLifelinePosition();
+ ((OLDLifelineEditPart) getParent()).updateLifelinePosition();
}
}
super.handleNotificationEvent(event);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageAsyncEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageAsyncEditPart.java
index ead767b1e94..18962ced9c4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageAsyncEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageAsyncEditPart.java
@@ -16,9 +16,7 @@ package org.eclipse.papyrus.uml.diagram.sequence.edit.parts;
import org.eclipse.draw2d.Connection;
import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomMessageASyncItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.figures.MessageAsync;
import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceUtil;
import org.eclipse.uml2.uml.Message;
@@ -44,7 +42,6 @@ public class CustomMessageAsyncEditPart extends MessageAsyncEditPart {
@Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomMessageASyncItemSemanticEditPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageCreateEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageCreateEditPart.java
index 0c3e9e911dd..eb6b4f51cf8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageCreateEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageCreateEditPart.java
@@ -16,9 +16,7 @@ package org.eclipse.papyrus.uml.diagram.sequence.edit.parts;
import org.eclipse.draw2d.Connection;
import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomMessageCreateItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.figures.MessageCreate;
import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceUtil;
import org.eclipse.uml2.uml.Message;
@@ -44,7 +42,6 @@ public class CustomMessageCreateEditPart extends MessageCreateEditPart {
@Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomMessageCreateItemSemanticEditPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageDeleteEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageDeleteEditPart.java
index 9f7e7687cf3..6dacce143b5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageDeleteEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageDeleteEditPart.java
@@ -16,9 +16,7 @@ package org.eclipse.papyrus.uml.diagram.sequence.edit.parts;
import org.eclipse.draw2d.Connection;
import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomMessageDeleteItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.figures.MessageDelete;
import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceUtil;
import org.eclipse.uml2.uml.Message;
@@ -44,7 +42,6 @@ public class CustomMessageDeleteEditPart extends MessageDeleteEditPart {
@Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomMessageDeleteItemSemanticEditPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageFoundEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageFoundEditPart.java
index 8db900a2596..befe2ca3185 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageFoundEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageFoundEditPart.java
@@ -15,9 +15,7 @@ package org.eclipse.papyrus.uml.diagram.sequence.edit.parts;
import org.eclipse.draw2d.Connection;
import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomMessageFoundItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.figures.MessageFound;
import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceUtil;
import org.eclipse.uml2.uml.Message;
@@ -43,7 +41,6 @@ public class CustomMessageFoundEditPart extends MessageFoundEditPart {
@Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomMessageFoundItemSemanticEditPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageLostEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageLostEditPart.java
index 83c3475e0c9..000b29592a0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageLostEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageLostEditPart.java
@@ -15,9 +15,7 @@ package org.eclipse.papyrus.uml.diagram.sequence.edit.parts;
import org.eclipse.draw2d.Connection;
import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomMessageLostItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.figures.MessageLost;
import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceUtil;
import org.eclipse.uml2.uml.Message;
@@ -43,7 +41,6 @@ public class CustomMessageLostEditPart extends MessageLostEditPart {
@Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomMessageLostItemSemanticEditPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageReplyEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageReplyEditPart.java
index 89afce8ea5e..d27e5c7fb18 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageReplyEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageReplyEditPart.java
@@ -16,9 +16,7 @@ package org.eclipse.papyrus.uml.diagram.sequence.edit.parts;
import org.eclipse.draw2d.Connection;
import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomMessageReplyItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.figures.MessageReply;
import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceUtil;
import org.eclipse.uml2.uml.Message;
@@ -44,7 +42,6 @@ public class CustomMessageReplyEditPart extends MessageReplyEditPart {
@Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomMessageReplyItemSemanticEditPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageSyncEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageSyncEditPart.java
index d83704df902..2d2ef0d01f2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageSyncEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageSyncEditPart.java
@@ -15,9 +15,7 @@ package org.eclipse.papyrus.uml.diagram.sequence.edit.parts;
import org.eclipse.draw2d.Connection;
import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomMessageSyncItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.figures.MessageSync;
import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceUtil;
import org.eclipse.uml2.uml.Message;
@@ -43,7 +41,6 @@ public class CustomMessageSyncEditPart extends MessageSyncEditPart {
@Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomMessageSyncItemSemanticEditPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomStateInvariantEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomStateInvariantEditPart.java
index b2d31ed2ec4..ac25d971b57 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomStateInvariantEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomStateInvariantEditPart.java
@@ -40,7 +40,6 @@ import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
import org.eclipse.gmf.runtime.diagram.ui.commands.SetBoundsCommand;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
import org.eclipse.gmf.runtime.draw2d.ui.text.TextFlowEx;
@@ -64,7 +63,6 @@ import org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeUMLElement
import org.eclipse.papyrus.uml.diagram.common.providers.UIAdapterImpl;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ExecutionSpecificationEndEditPart.DummyCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.AppliedStereotypeCommentCreationEditPolicyEx;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomStateInvariantItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.figures.ContinuationFigure;
import org.eclipse.papyrus.uml.diagram.sequence.locator.CenterLocator;
import org.eclipse.papyrus.uml.diagram.sequence.part.UMLVisualIDRegistry;
@@ -150,7 +148,6 @@ public class CustomStateInvariantEditPart extends StateInvariantEditPart impleme
@Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomStateInvariantItemSemanticEditPolicy());
// install a editpolicy to display stereotypes
installEditPolicy(AppliedStereotypeCommentEditPolicy.APPLIED_STEREOTYPE_COMMENT, new AppliedStereotypeCommentCreationEditPolicyEx());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -642,13 +639,13 @@ public class CustomStateInvariantEditPart extends StateInvariantEditPart impleme
borderItemEP.getFigure().translateToAbsolute(realLocation);
Rectangle bounds = ep.getPrimaryShape().getBounds().getCopy();
ep.getPrimaryShape().translateToAbsolute(bounds);
- int nameHeight = ep.getPrimaryShape().getFigureLifelineNameContainerFigure().getBounds().height;
- if (realLocation.y - nameHeight < bounds.y) {
- return false;
- }
- if (realLocation.getBottom().y > bounds.getBottom().y) {
- return false;
- }
+// int nameHeight = ep.getPrimaryShape().getFigureLifelineNameContainerFigure().getBounds().height;
+// if (realLocation.y - nameHeight < bounds.y) {
+// return false;
+// }
+// if (realLocation.getBottom().y > bounds.getBottom().y) {
+// return false;
+// }
return true;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeConstraintEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeConstraintEditPart.java
index 4a9640a12a1..7b154b08b90 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeConstraintEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeConstraintEditPart.java
@@ -22,7 +22,6 @@ import org.eclipse.gef.editpolicies.LayoutEditPolicy;
import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
import org.eclipse.gef.requests.CreateRequest;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeRequest;
import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
@@ -31,7 +30,6 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.uml.diagram.common.locator.ExternalLabelPositionLocator;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.ExternalLabelPrimaryDragRoleEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.TimeRelatedSelectionEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomTimeConstraintItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.figures.TimeMarkElementFigure;
import org.eclipse.papyrus.uml.diagram.sequence.part.UMLVisualIDRegistry;
@@ -50,15 +48,6 @@ public class CustomTimeConstraintEditPart extends TimeConstraintEditPart {
}
/**
- * @Override
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomTimeConstraintItemSemanticEditPolicy());
- }
-
- /**
* @Override use ExternalLabelPrimaryDragRoleEditPolicy
*/
@Override
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeObservationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeObservationEditPart.java
index 79d12e23bf7..98d050c240f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeObservationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeObservationEditPart.java
@@ -22,7 +22,6 @@ import org.eclipse.gef.editpolicies.LayoutEditPolicy;
import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
import org.eclipse.gef.requests.CreateRequest;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeRequest;
import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
@@ -31,7 +30,6 @@ import org.eclipse.papyrus.uml.diagram.common.locator.ExternalLabelPositionLocat
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.CustomExternalLabelPrimaryDragRoleEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.DeleteTimeElementWithoutEventPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.TimeRelatedSelectionEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomTimeObservationItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.figures.TimeObservationFigure;
import org.eclipse.papyrus.uml.diagram.sequence.part.UMLVisualIDRegistry;
@@ -55,7 +53,6 @@ public class CustomTimeObservationEditPart extends TimeObservationEditPart {
@Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomTimeObservationItemSemanticEditPolicy());
removeEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
removeEditPolicy(DeleteTimeElementWithoutEventPolicy.KEY);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ExecutionSpecificationEndEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ExecutionSpecificationEndEditPart.java
index bc600131dea..f466a346ad8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ExecutionSpecificationEndEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ExecutionSpecificationEndEditPart.java
@@ -30,33 +30,26 @@ import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPolicy;
import org.eclipse.gef.Request;
import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.commands.Command;
import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
import org.eclipse.gef.requests.CreateRequest;
import org.eclipse.gef.requests.DropRequest;
import org.eclipse.gef.requests.ReconnectRequest;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.common.core.util.Log;
import org.eclipse.gmf.runtime.common.core.util.Trace;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.INodeEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.SemanticEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.internal.DiagramUIDebugOptions;
import org.eclipse.gmf.runtime.diagram.ui.internal.DiagramUIPlugin;
import org.eclipse.gmf.runtime.diagram.ui.internal.DiagramUIStatusCodes;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeConnectionRequest;
import org.eclipse.gmf.runtime.draw2d.ui.figures.IAnchorableFigure;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
import org.eclipse.gmf.runtime.gef.ui.figures.SlidableOvalAnchor;
import org.eclipse.gmf.runtime.gef.ui.internal.figures.CircleFigure;
import org.eclipse.gmf.runtime.notation.Anchor;
@@ -69,10 +62,6 @@ import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.Shape;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.gmf.runtime.notation.impl.ShapeImpl;
-import org.eclipse.papyrus.uml.diagram.sequence.command.ExecutionOccurrenceSpecificationMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.ExecutionOccurrenceSpecificationMessageReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.helpers.AnchorHelper;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.AnnotatedLinkEndEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.ExecutionSpecificationEndGraphicalNodeEditPolicy;
@@ -182,7 +171,6 @@ public class ExecutionSpecificationEndEditPart extends GraphicalEditPart impleme
@Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ExecutionSpecificationEndSemanticEditPolicy());
// The custom Graphical node edit policy for showing feedback has been removed, and this will be finished in HighlightEditPolicy.
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new ExecutionSpecificationEndGraphicalNodeEditPolicy());
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableEditPolicy() {
@@ -346,50 +334,6 @@ public class ExecutionSpecificationEndEditPart extends GraphicalEditPart impleme
}
}
- static class ExecutionSpecificationEndSemanticEditPolicy extends SemanticEditPolicy {
-
- @Override
- protected Command getSemanticCommand(final IEditCommandRequest request) {
- if (request instanceof CreateRelationshipRequest) {
- return getCreateRelationshipCommand((CreateRelationshipRequest) request);
- } else if (request instanceof ReorientReferenceRelationshipRequest) {
- return getGEFWrapper(new ReorientExecutionSpecificationEndCommand((ReorientReferenceRelationshipRequest) request));
- } else if (request instanceof ReorientRelationshipRequest) {
- return getGEFWrapper(new ExecutionOccurrenceSpecificationMessageReorientCommand((ReorientRelationshipRequest) request));
- }
- Command cmd = super.getSemanticCommand(request);
- return cmd;
- }
-
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommandEx(req, req.getSource(), req.getTarget()));
- } else if (UMLElementTypes.Message_SynchEdge == req.getElementType() || UMLElementTypes.Message_AsynchEdge == req.getElementType() || UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new ExecutionOccurrenceSpecificationMessageCreateCommand(req));
- }
- return null;
- }
-
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommandEx(req, req.getSource(), req.getTarget()));
- } else if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommandEx(req, req.getSource(), req.getTarget()));
- } else if (UMLElementTypes.Message_SynchEdge == req.getElementType() || UMLElementTypes.Message_AsynchEdge == req.getElementType() || UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new ExecutionOccurrenceSpecificationMessageCreateCommand(req));
- }
- return null;
- }
-
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command;
- }
-
- protected final Command getGEFWrapper(ICommand cmd) {
- return new ICommandProxy(cmd);
- }
- }
public static class ExecutionSpecificationEndHelper {
@@ -413,37 +357,8 @@ public class ExecutionSpecificationEndEditPart extends GraphicalEditPart impleme
}
}
- static class CommentAnnotatedElementCreateCommandEx extends CommentAnnotatedElementCreateCommand {
- public CommentAnnotatedElementCreateCommandEx(CreateRelationshipRequest request, EObject source, EObject target) {
- super(request, source, target);
- }
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- CommandResult res = super.doExecuteWithResult(monitor, info);
- if (getTarget() instanceof OccurrenceSpecification) {
- ExecutionSpecificationEndHelper.addConnectionSourceToExecutionSpecificationEnd((OccurrenceSpecification) getTarget(), getSource());
- }
- return res;
- }
- }
-
- static class ConstraintConstrainedElementCreateCommandEx extends ConstraintConstrainedElementCreateCommand {
- public ConstraintConstrainedElementCreateCommandEx(CreateRelationshipRequest request, EObject source, EObject target) {
- super(request, source, target);
- }
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- CommandResult res = super.doExecuteWithResult(monitor, info);
- if (getTarget() instanceof OccurrenceSpecification) {
- ExecutionSpecificationEndHelper.addConnectionSourceToExecutionSpecificationEnd((OccurrenceSpecification) getTarget(), getSource());
- }
- return res;
- }
- }
public Locator getLocator() {
return locator;
@@ -659,8 +574,7 @@ public class ExecutionSpecificationEndEditPart extends GraphicalEditPart impleme
if (locator == null) {
initLocator();
}
- if (locator != null)
- {
+ if (locator != null) {
locator.relocate(fig); // place figure at north or south, ignore layout manager
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ExecutionSpecificationRectangleFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ExecutionSpecificationRectangleFigure.java
new file mode 100644
index 00000000000..7df1a7caf06
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ExecutionSpecificationRectangleFigure.java
@@ -0,0 +1,66 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.sequence.edit.parts;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.TreeSearch;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure;
+import org.eclipse.papyrus.uml.diagram.sequence.figures.ILifelineInternalFigure;
+
+public class ExecutionSpecificationRectangleFigure extends RoundedCompartmentFigure implements ILifelineInternalFigure {
+ /**
+ *
+ */
+ private final AbstractExecutionSpecificationEditPart abstractExecutionSpecificationEditPart;
+
+ public ExecutionSpecificationRectangleFigure(AbstractExecutionSpecificationEditPart abstractExecutionSpecificationEditPart) {
+ this.abstractExecutionSpecificationEditPart = abstractExecutionSpecificationEditPart;
+
+ }
+
+ @Override
+ public IFigure findMouseEventTargetAt(int x, int y) {
+ // check children first instead of self
+ IFigure f = findMouseEventTargetInDescendantsAt(x, y);
+ if (f != null) {
+ return f;
+ }
+ if (!containsPoint(x, y)) {
+ return null;
+ }
+ if (isMouseEventTarget()) {
+ return this;
+ }
+ return null;
+ }
+
+ @Override
+ public IFigure findFigureAt(int x, int y, TreeSearch search) {
+ if (search.prune(this)) {
+ return null;
+ }
+ IFigure child = findDescendantAtExcluding(x, y, search);
+ if (child != null) {
+ return child;
+ }
+ if (!containsPoint(x, y)) {
+ return null;
+ }
+ if (search.accept(this)) {
+ return this;
+ }
+ return null;
+ }
+} \ No newline at end of file
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GateEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GateEditPart.java
index 45e8d493f14..eb91bbf2ee8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GateEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GateEditPart.java
@@ -42,7 +42,6 @@ import org.eclipse.gmf.runtime.diagram.ui.commands.SetBoundsCommand;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
@@ -59,7 +58,6 @@ import org.eclipse.papyrus.uml.diagram.common.locator.ExternalLabelPositionLocat
import org.eclipse.papyrus.uml.diagram.common.providers.UIAdapterImpl;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.ExternalLabelPrimaryDragRoleEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.GateGraphicalNodeEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.GateItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.util.GateHelper;
import org.eclipse.papyrus.uml.diagram.sequence.util.GateModelElementFactory;
import org.eclipse.uml2.uml.CombinedFragment;
@@ -161,7 +159,6 @@ public class GateEditPart extends AbstractBorderEditPart implements IBorderItemE
@Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new GateItemSemanticEditPolicy());
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, getPrimaryDragEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new GateGraphicalNodeEditPolicy());
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionOperandGuardEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionOperandGuardEditPart.java
index 0e9c23a9ac4..048ff508786 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionOperandGuardEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionOperandGuardEditPart.java
@@ -100,10 +100,10 @@ import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEdi
import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
import org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeUMLElementFigure;
-import org.eclipse.papyrus.uml.diagram.sequence.Activator;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.UMLTextSelectionEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.locator.TextCellEditorLocator;
import org.eclipse.papyrus.uml.diagram.sequence.parsers.MessageFormatParser;
+import org.eclipse.papyrus.uml.diagram.sequence.part.UMLDiagramEditorPlugin;
import org.eclipse.papyrus.uml.diagram.sequence.util.ElementIconUtil;
import org.eclipse.papyrus.uml.diagram.sequence.util.InteractionOperandModelElementFactory;
import org.eclipse.papyrus.uml.diagram.sequence.util.LoopOperatorUtil;
@@ -649,7 +649,7 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
protected void initExtendedEditorConfiguration() {
if (configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ final String languagePreferred = UMLDiagramEditorPlugin.getInstance().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
@@ -659,7 +659,7 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
}
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ String languagePreferred = UMLDiagramEditorPlugin.getInstance().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageEndEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageEndEditPart.java
index 7ed17487338..29324f7ae36 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageEndEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageEndEditPart.java
@@ -50,17 +50,14 @@ import org.eclipse.gef.requests.CreateRequest;
import org.eclipse.gef.requests.DropRequest;
import org.eclipse.gef.requests.ReconnectRequest;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.common.core.util.Log;
import org.eclipse.gmf.runtime.common.core.util.Trace;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.INodeEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.GraphicalNodeEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.SemanticEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.internal.DiagramUIDebugOptions;
import org.eclipse.gmf.runtime.diagram.ui.internal.DiagramUIPlugin;
import org.eclipse.gmf.runtime.diagram.ui.internal.DiagramUIStatusCodes;
@@ -70,8 +67,6 @@ import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeRequest;
import org.eclipse.gmf.runtime.draw2d.ui.figures.IAnchorableFigure;
import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
import org.eclipse.gmf.runtime.gef.ui.figures.SlidableOvalAnchor;
import org.eclipse.gmf.runtime.gef.ui.internal.figures.CircleFigure;
@@ -85,9 +80,6 @@ import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.Shape;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.gmf.runtime.notation.impl.ShapeImpl;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.GeneralOrderingCreateCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.AnnotatedLinkEndEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.HighlightEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
@@ -230,19 +222,18 @@ public class MessageEndEditPart extends GraphicalEditPart implements INodeEditPa
@Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new MessageEndSemanticEditPolicy());
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new MessageEndGraphicalNodeEditPolicy());
- installEditPolicy(HighlightEditPolicy.HIGHLIGHT_ROLE, new HighlightEditPolicy() {
-
- @Override
- protected void highlight(EditPart object) {
- super.highlight(getParent());
- IFigure feedback = getTargetIndicator();
- Rectangle rect = getFigure().getBounds().getCopy();
- getFigure().translateToAbsolute(rect);
- setFeedbackLocation(feedback, rect.getCenter());
- }
- });
+// installEditPolicy(HighlightEditPolicy.HIGHLIGHT_ROLE, new HighlightEditPolicy() {
+//
+// @Override
+// protected void highlight(EditPart object) {
+// super.highlight(getParent());
+// IFigure feedback = getTargetIndicator();
+// Rectangle rect = getFigure().getBounds().getCopy();
+// getFigure().translateToAbsolute(rect);
+// setFeedbackLocation(feedback, rect.getCenter());
+// }
+// });
// Remove CREATION_ROLE if there's no custom DRAG_DROP_ROLE and CREATION_ROLE editpolicies, otherwise, CustomizableDropEditPolicy will be added as a defaultCreationEditPolicy in new CustomizableDropEditPolicy.
removeEditPolicy(EditPolicyRoles.CREATION_ROLE);
}
@@ -251,7 +242,7 @@ public class MessageEndEditPart extends GraphicalEditPart implements INodeEditPa
protected IFigure createFigure() {
final MessageEnd messageEnd = (MessageEnd) this.resolveSemanticElement();
IFigure fig = new MessageEndFigure();
- fig.setForegroundColor(ColorConstants.white);
+ fig.setForegroundColor(ColorConstants.yellow);
Label tooltip = new Label();
if (messageEnd != null) {
tooltip.setText(UMLLabelInternationalization.getInstance().getLabel(messageEnd));
@@ -263,27 +254,6 @@ public class MessageEndEditPart extends GraphicalEditPart implements INodeEditPa
return fig;
}
- /**
- * @see org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart#resolveSemanticElement()
- *
- * @return
- */
- @Override
- public EObject resolveSemanticElement() {
- EObject resolveSemanticElement = super.resolveSemanticElement();
- if (resolveSemanticElement instanceof Message){
- // This should never happen but does see Bug 502155
- Message message = (Message) resolveSemanticElement;
- final MessageEnd messageEnd = message.getReceiveEvent();
- if (messageEnd != null) {
- return messageEnd;
- } else {
- return message.getSendEvent();
- }
- }
- return resolveSemanticElement;
- }
-
@Override
public boolean hasNotationView() {
return true;
@@ -301,8 +271,7 @@ public class MessageEndEditPart extends GraphicalEditPart implements INodeEditPa
Anchor a = ((Edge) connection.getModel()).getSourceAnchor();
if (a instanceof IdentityAnchor) {
setResult(((IdentityAnchor) a).getId());
- }
- else {
+ } else {
setResult(""); //$NON-NLS-1$
}
}
@@ -327,8 +296,7 @@ public class MessageEndEditPart extends GraphicalEditPart implements INodeEditPa
Anchor a = ((Edge) connection.getModel()).getTargetAnchor();
if (a instanceof IdentityAnchor) {
setResult(((IdentityAnchor) a).getId());
- }
- else {
+ } else {
setResult(""); //$NON-NLS-1$
}
}
@@ -396,8 +364,7 @@ public class MessageEndEditPart extends GraphicalEditPart implements INodeEditPa
if (annotation != null) {
for (EObject eo : annotation.getReferences()) {
View view = helper.findView(eo);
- if (view == null)
- {
+ if (view == null) {
continue; // should not happen
}
EList edges = view.getSourceEdges();
@@ -456,7 +423,7 @@ public class MessageEndEditPart extends GraphicalEditPart implements INodeEditPa
List<OccurrenceSpecification> events = new ArrayList<OccurrenceSpecification>(2);
final MessageOccurrenceSpecification messageEnd = (MessageOccurrenceSpecification) ((MessageEndEditPart) getHost()).resolveSemanticElement();
events.add(messageEnd);
- extendedData.put(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION, events);
+ extendedData.put(org.eclipse.papyrus.uml.service.types.utils.SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION, events);
extendedData.put(SequenceRequestConstant.OCCURRENCE_SPECIFICATION_LOCATION, request.getLocation());
}
}
@@ -518,80 +485,8 @@ public class MessageEndEditPart extends GraphicalEditPart implements INodeEditPa
}
}
- static class MessageEndSemanticEditPolicy extends SemanticEditPolicy {
-
- @Override
- protected Command getSemanticCommand(final IEditCommandRequest request) {
- if (request instanceof CreateRelationshipRequest) {
- return getCreateRelationshipCommand((CreateRelationshipRequest) request);
- } else if (request instanceof ReorientReferenceRelationshipRequest) {
- return getGEFWrapper(new ReorientMessageEndCommand((ReorientReferenceRelationshipRequest) request));
- }
- Command cmd = super.getSemanticCommand(request);
- return cmd;
- }
-
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommandEx(req, req.getSource(), req.getTarget()));
- } else if (UMLElementTypes.GeneralOrdering_Edge == req.getElementType()) {
- return getGEFWrapper(new GeneralOrderingCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommandEx(req, req.getSource(), req.getTarget()));
- } else if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommandEx(req, req.getSource(), req.getTarget()));
- } else if (UMLElementTypes.GeneralOrdering_Edge == req.getElementType()) {
- return getGEFWrapper(new GeneralOrderingCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command;
- }
-
- protected final Command getGEFWrapper(ICommand cmd) {
- return new ICommandProxy(cmd);
- }
- }
-
- static class CommentAnnotatedElementCreateCommandEx extends CommentAnnotatedElementCreateCommand {
- public CommentAnnotatedElementCreateCommandEx(CreateRelationshipRequest request, EObject source, EObject target) {
- super(request, source, target);
- }
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- CommandResult res = super.doExecuteWithResult(monitor, info);
- if (getTarget() instanceof MessageEnd) {
- MessageEndHelper.addConnectionSourceToMessageEnd((MessageEnd) getTarget(), getSource());
- }
- return res;
- }
- }
-
- static class ConstraintConstrainedElementCreateCommandEx extends ConstraintConstrainedElementCreateCommand {
-
- public ConstraintConstrainedElementCreateCommandEx(CreateRelationshipRequest request, EObject source, EObject target) {
- super(request, source, target);
- }
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- CommandResult res = super.doExecuteWithResult(monitor, info);
- if (getTarget() instanceof MessageEnd) {
- MessageEndHelper.addConnectionSourceToMessageEnd((MessageEnd) getTarget(), getSource());
- }
- return res;
- }
- }
static class MessageEndAnchor extends SlidableOvalAnchor {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomBehaviorExecutionSpecificationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/OLDCustomBehaviorExecutionSpecificationEditPart.java
index 030182efc25..315165f0cc5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomBehaviorExecutionSpecificationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/OLDCustomBehaviorExecutionSpecificationEditPart.java
@@ -41,7 +41,6 @@ import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
import org.eclipse.gmf.runtime.diagram.ui.commands.SetBoundsCommand;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.diagram.ui.figures.BorderedNodeFigure;
import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
@@ -56,7 +55,6 @@ import org.eclipse.papyrus.uml.diagram.common.helper.NotificationHelper;
import org.eclipse.papyrus.uml.diagram.common.providers.UIAdapterImpl;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ExecutionSpecificationEndEditPart.DummyCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.ExecutionGraphicalNodeEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomBehaviorExecutionSpecificationItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.util.BehaviorDisplayHelper;
import org.eclipse.papyrus.uml.diagram.sequence.util.CommandHelper;
import org.eclipse.uml2.uml.Behavior;
@@ -72,7 +70,17 @@ import org.eclipse.uml2.uml.UMLPackage;
*
* @author Jin Liu (jin.liu@soyatec.com)
*/
-public class CustomBehaviorExecutionSpecificationEditPart extends BehaviorExecutionSpecificationEditPart {
+public class OLDCustomBehaviorExecutionSpecificationEditPart extends BehaviorExecutionSpecificationEditPart {
+
+ /**
+ * Constructor.
+ *
+ * @param view
+ */
+ public OLDCustomBehaviorExecutionSpecificationEditPart(View view) {
+ super(view);
+ // TODO Auto-generated constructor stub
+ }
private NotificationHelper helper = new NotificationHelper(new UIAdapterImpl() {
@@ -88,14 +96,6 @@ public class CustomBehaviorExecutionSpecificationEditPart extends BehaviorExecut
*/
private EditPartListener selfRemovingListener;
- /**
- * Constructor.
- *
- * @param view
- */
- public CustomBehaviorExecutionSpecificationEditPart(View view) {
- super(view);
- }
/**
* @Override
@@ -103,7 +103,6 @@ public class CustomBehaviorExecutionSpecificationEditPart extends BehaviorExecut
@Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomBehaviorExecutionSpecificationItemSemanticEditPolicy());
// Fixed bug about reconnect message when the ends of execution were MessageOccurrenceSpecification.
removeEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE);
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new ExecutionGraphicalNodeEditPolicy());
@@ -243,7 +242,7 @@ public class CustomBehaviorExecutionSpecificationEditPart extends BehaviorExecut
@Override
public void removingChild(EditPart child, int index) {
boolean removeBehavior = false;
- EditPart editPart = CustomBehaviorExecutionSpecificationEditPart.this;
+ EditPart editPart = OLDCustomBehaviorExecutionSpecificationEditPart.this;
while (editPart != null && !(editPart instanceof RootEditPart)) {
if (editPart == child) {
removeBehavior = true;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCombinedFragmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/OLDCustomCombinedFragmentEditPart.java
index 3b5388001f5..cbed6655e7a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCombinedFragmentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/OLDCustomCombinedFragmentEditPart.java
@@ -61,7 +61,6 @@ import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableShapeEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
@@ -100,7 +99,6 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.AbstractHeadImpact
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.CombinedFragmentHeadImpactLayoutEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.GateCreationEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.GatesHolderGraphicalNodeEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomCombinedFragmentItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.figures.CombinedFragmentFigure;
import org.eclipse.papyrus.uml.diagram.sequence.locator.GateLocator;
import org.eclipse.papyrus.uml.diagram.sequence.locator.TextCellEditorLocator;
@@ -129,7 +127,7 @@ import org.eclipse.uml2.uml.UMLPackage;
*
* @author Jin Liu (jin.liu@soyatec.com)
*/
-public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart implements ITextAwareEditPart {
+public class OLDCustomCombinedFragmentEditPart extends CombinedFragmentEditPart implements ITextAwareEditPart {
/**
@@ -187,7 +185,7 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
*
* @param view
*/
- public CustomCombinedFragmentEditPart(View view) {
+ public OLDCustomCombinedFragmentEditPart(View view) {
super(view);
}
@@ -197,7 +195,6 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
@Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomCombinedFragmentItemSemanticEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new CombinedFragmentDirectEditPolicy());
// Fixed bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=389531
@@ -405,7 +402,7 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
@Override
public void run() {
LifelineCoveredByUpdater updater = new LifelineCoveredByUpdater();
- updater.update(CustomCombinedFragmentEditPart.this);
+ updater.update(OLDCustomCombinedFragmentEditPart.this);
}
});
}
@@ -467,7 +464,7 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
if (element instanceof CombinedFragment) {
CombinedFragment combinedFragment = (CombinedFragment) element;
String operatorKind = combinedFragment.getInteractionOperator().getName();
- getPrimaryShape().getHeaderLabel().setText(operatorKind);
+ getPrimaryShape().getNameLabel().setText(operatorKind);
}
}
@@ -568,7 +565,7 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
protected void refreshLabelIcon() {
Image image = ElementIconUtil.getLabelIcon(this);
- getPrimaryShape().getHeaderLabel().setIcon(image);
+ getPrimaryShape().getNameLabel().setIcon(image);
}
// update label visibility and text
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomLifelineEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/OLDLifelineEditPart.java
index 771cc43d301..9aa57d8fa57 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomLifelineEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/OLDLifelineEditPart.java
@@ -106,8 +106,7 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.InteractionCompart
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.LifelineHeadImpactLayoutEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.LifelineLabelEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.LifelineSelectionEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.LifelineXYLayoutEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomLifelineItemSemanticEditPolicy;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.OLDLifelineXYLayoutEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.figures.LifelineDotLineCustomFigure;
import org.eclipse.papyrus.uml.diagram.sequence.figures.LifelineFigure;
import org.eclipse.papyrus.uml.diagram.sequence.locator.TimeMarkElementPositionLocator;
@@ -143,8 +142,9 @@ import org.eclipse.uml2.uml.UMLPackage;
/**
* @author Jin Liu (jin.liu@soyatec.com)
+ * @deprecated will be remove in Oxygen
*/
-public class CustomLifelineEditPart extends LifelineEditPart {
+public class OLDLifelineEditPart extends LifelineEditPart {
public class CustomLifelineFigure extends LifelineFigure {
@@ -157,7 +157,7 @@ public class CustomLifelineEditPart extends LifelineEditPart {
@Override
protected IMapMode getMapMode() {
- return CustomLifelineEditPart.this.getMapMode();
+ return OLDLifelineEditPart.this.getMapMode();
}
@Override
@@ -318,7 +318,7 @@ public class CustomLifelineEditPart extends LifelineEditPart {
/**
* Layout role for normal mode
*/
- private LayoutEditPolicy normalModeLayoutRole = new LifelineXYLayoutEditPolicy();
+ private LayoutEditPolicy normalModeLayoutRole = new OLDLifelineXYLayoutEditPolicy();
/**
* Layout role for drag drop
@@ -332,7 +332,7 @@ public class CustomLifelineEditPart extends LifelineEditPart {
*
* @param view
*/
- public CustomLifelineEditPart(View view) {
+ public OLDLifelineEditPart(View view) {
super(view);
}
@@ -450,7 +450,6 @@ public class CustomLifelineEditPart extends LifelineEditPart {
@Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomLifelineItemSemanticEditPolicy());
// Fixed bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=364608
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new LifelineSelectionEditPolicy());
installEditPolicy(EditPolicy.COMPONENT_ROLE, new LifelineMessageCreateHelper.ComponentEditPolicyEx());
@@ -765,8 +764,8 @@ public class CustomLifelineEditPart extends LifelineEditPart {
if (request instanceof CreateConnectionRequest) {
CreateConnectionRequest createConnectionRequest = (CreateConnectionRequest) request;
EditPart target = createConnectionRequest.getTargetEditPart();
- if (target instanceof CustomLifelineEditPart) {
- CustomLifelineEditPart lifelineEditPart = (CustomLifelineEditPart) target;
+ if (target instanceof OLDLifelineEditPart) {
+ OLDLifelineEditPart lifelineEditPart = (OLDLifelineEditPart) target;
Rectangle lifelineBounds = lifelineEditPart.getContentPane().getBounds();
for (ShapeNodeEditPart executionSpecificationEditPart : LifelineEditPartUtil.getChildShapeNodeEditPart(lifelineEditPart)) {
IFigure executionSpecificationFigure = executionSpecificationEditPart.getFigure();
@@ -829,7 +828,7 @@ public class CustomLifelineEditPart extends LifelineEditPart {
LifelineDotLineFigure figureLifelineDotLineFigure = getPrimaryShape().getFigureLifelineDotLineFigure();
Rectangle rectDotLine = figureLifelineDotLineFigure.getBounds().getCopy();
figureLifelineDotLineFigure.translateToAbsolute(rectDotLine);
- int bottom = rectDotLine.y + LifelineXYLayoutEditPolicy.SPACING_HEIGHT; // at least header height + spacing
+ int bottom = rectDotLine.y + OLDLifelineXYLayoutEditPolicy.SPACING_HEIGHT; // at least header height + spacing
for (InteractionFragment interactionFragment : coveredBys) {
Collection<Setting> settings = CacheAdapter.getInstance().getNonNavigableInverseReferences(interactionFragment);
for (Setting ref : settings) {
@@ -1055,8 +1054,8 @@ public class CustomLifelineEditPart extends LifelineEditPart {
@Override
public void run() {
- LifelineCoveredByUpdater updater = new LifelineCoveredByUpdater();
- updater.update(CustomLifelineEditPart.this);
+// LifelineCoveredByUpdater updater = new LifelineCoveredByUpdater();
+// updater.update(CustomLifelineEditPart.this);
}
});
}
@@ -1279,7 +1278,7 @@ public class CustomLifelineEditPart extends LifelineEditPart {
return -1;
}
CustomInteractionInteractionCompartmentEditPart parentEP = (CustomInteractionInteractionCompartmentEditPart) getParent();
- CustomInteractionEditPart grandParent = (CustomInteractionEditPart) parentEP.getParent();
+ OldCustomInteractionEditPart grandParent = (OldCustomInteractionEditPart) parentEP.getParent();
final Bounds bounds = (Bounds) ((Shape) getModel()).getLayoutConstraint();
final Bounds boundsGrandParent = (Bounds) ((Shape) grandParent.getModel()).getLayoutConstraint();
if (bounds != null && boundsGrandParent != null) {
@@ -1294,7 +1293,7 @@ public class CustomLifelineEditPart extends LifelineEditPart {
grandParent.getFigure().translateToRelative(boundsRect);
// return boundsGrandParent.getHeight() - boundsRect.y - LifelineXYLayoutEditPolicy.LIFELINE_SOUTH_SPACING;
int heightDiff = grandParent.getFigure().getBounds().height - parentEP.getFigure().getBounds().height;
- Dimension zoomedAddon = new Dimension(0, LifelineXYLayoutEditPolicy.LIFELINE_SOUTH_SPACING);
+ Dimension zoomedAddon = new Dimension(0, OLDLifelineXYLayoutEditPolicy.LIFELINE_SOUTH_SPACING);
grandParent.getFigure().translateToRelative(zoomedAddon);
return grandParentRect.height() - bounds.getY() - heightDiff - zoomedAddon.height;
}
@@ -1335,7 +1334,7 @@ public class CustomLifelineEditPart extends LifelineEditPart {
}
org.eclipse.emf.common.command.Command changeHeightCommand = SetCommand.create(getEditingDomain(), bounds, NotationPackage.Literals.SIZE__HEIGHT, bounds.getHeight());
changeHeightCommand.execute();
- PreserveAnchorsPositionCommandEx preserveAnchorsCommand = new PreserveAnchorsPositionCommandEx(CustomLifelineEditPart.this, new Dimension(0, heightDelta), PreserveAnchorsPositionCommand.PRESERVE_Y, getPrimaryShape()
+ PreserveAnchorsPositionCommandEx preserveAnchorsCommand = new PreserveAnchorsPositionCommandEx(OLDLifelineEditPart.this, new Dimension(0, heightDelta), PreserveAnchorsPositionCommand.PRESERVE_Y, getPrimaryShape()
.getFigureLifelineDotLineFigure(), PositionConstants.SOUTH);
if (preserveAnchorsCommand.canExecute()) {
preserveAnchorsCommand.execute(monitor, info);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomPackageEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/OLDPackageEditPart.java
index 37a4e17d688..2d67082ddad 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomPackageEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/OLDPackageEditPart.java
@@ -24,20 +24,19 @@ import org.eclipse.gmf.runtime.diagram.ui.editpolicies.XYLayoutEditPolicy;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.uml.diagram.common.providers.BaseViewInfo;
import org.eclipse.papyrus.uml.diagram.common.providers.ViewInfo;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomPackageItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceUtil;
/**
* @author Jin Liu (jin.liu@soyatec.com)
*/
-public class CustomPackageEditPart extends PackageEditPart {
+public class OLDPackageEditPart extends SequenceDiagramEditPart {
/**
* Constructor.
*
* @param view
*/
- public CustomPackageEditPart(View view) {
+ public OLDPackageEditPart(View view) {
super(view);
}
@@ -49,7 +48,6 @@ public class CustomPackageEditPart extends PackageEditPart {
@Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomPackageItemSemanticEditPolicy());
removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE);
removeEditPolicy(EditPolicyRoles.CONNECTION_HANDLES_ROLE);
// fix https://bugs.eclipse.org/bugs/show_bug.cgi?id=364688
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/OldCustomInteractionEditPart.java
index 0cd63fb04f2..56ed6481597 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/OldCustomInteractionEditPart.java
@@ -67,7 +67,6 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.GateCreationEditPo
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.InteractionFragmentsCreationEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.InteractionGraphicalNodeEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.InteractionHeadImpactLayoutEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomInteractionItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.figures.StereotypeInteractionFigure;
import org.eclipse.papyrus.uml.diagram.sequence.locator.GateLocator;
import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
@@ -83,7 +82,7 @@ import org.eclipse.uml2.uml.UMLPackage;
*
* @author Jin Liu (jin.liu@soyatec.com)
*/
-public class CustomInteractionEditPart extends InteractionEditPart implements IPapyrusEditPart {
+public class OldCustomInteractionEditPart extends InteractionEditPart implements IPapyrusEditPart {
/**
* Default Margin when not present in CSS
@@ -120,7 +119,7 @@ public class CustomInteractionEditPart extends InteractionEditPart implements IP
*
* @param view
*/
- public CustomInteractionEditPart(View view) {
+ public OldCustomInteractionEditPart(View view) {
super(view);
}
@@ -147,12 +146,12 @@ public class CustomInteractionEditPart extends InteractionEditPart implements IP
}
public Command getUpdateLifelinesHeightsCommand(Command command) {
- for (Object child : CustomInteractionEditPart.this.getChildren()) {
+ for (Object child : OldCustomInteractionEditPart.this.getChildren()) {
if (child instanceof InteractionInteractionCompartmentEditPart) {
InteractionInteractionCompartmentEditPart childEditPart = (InteractionInteractionCompartmentEditPart) child;
for (Object grandChild : childEditPart.getChildren()) {
- if (grandChild instanceof CustomLifelineEditPart) {
- command = ((CustomLifelineEditPart) grandChild).getAlignLifelineBottomToParentCommand(command, false);
+ if (grandChild instanceof OLDLifelineEditPart) {
+ //command = ((CustomLifelineEditPart) grandChild).getAlignLifelineBottomToParentCommand(command, false);
}
}
}
@@ -166,7 +165,6 @@ public class CustomInteractionEditPart extends InteractionEditPart implements IP
@Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomInteractionItemSemanticEditPolicy());
// Fixed bugs: https://bugs.eclipse.org/bugs/show_bug.cgi?id=403134 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=389531
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new InteractionGraphicalNodeEditPolicy());
// Create gate: https://bugs.eclipse.org/bugs/show_bug.cgi?id=389531
@@ -212,15 +210,15 @@ public class CustomInteractionEditPart extends InteractionEditPart implements IP
@Override
public Dimension getMinimumSize(int wHint, int hHint) {
Rectangle bounds = new Rectangle();
- for (Object child : CustomInteractionEditPart.this.getChildren()) {
+ for (Object child : OldCustomInteractionEditPart.this.getChildren()) {
if (child instanceof InteractionInteractionCompartmentEditPart) {
InteractionInteractionCompartmentEditPart childEditPart = (InteractionInteractionCompartmentEditPart) child;
for (Object grandChild : childEditPart.getChildren()) {
GraphicalEditPart editPart = (GraphicalEditPart) grandChild;
IFigure figure = editPart.getFigure();
- if (grandChild instanceof CustomLifelineEditPart) {
+ if (grandChild instanceof OLDLifelineEditPart) {
Rectangle childBounds = figure.getBounds().getCopy();
- childBounds.height = ((CustomLifelineEditPart) grandChild).getMinimumHeight(-1);
+ //childBounds.height = ((CustomLifelineEditPart) grandChild).getMinimumHeight(-1);
bounds.union(childBounds);
} else {
bounds.union(figure.getBounds());
@@ -228,7 +226,7 @@ public class CustomInteractionEditPart extends InteractionEditPart implements IP
}
IFigure figure = childEditPart.getFigure();
Rectangle rectangle = figure.getBounds();
- IFigure parentfigure = CustomInteractionEditPart.this.getFigure();
+ IFigure parentfigure = OldCustomInteractionEditPart.this.getFigure();
Rectangle parentRectangle = parentfigure.getBounds();
Dimension zoomedAddon = new Dimension(10, 16);
figure.translateToRelative(zoomedAddon);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AnnotatedLinkEndEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AnnotatedLinkEndEditPolicy.java
index 91db4040eb1..6399b78584b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AnnotatedLinkEndEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AnnotatedLinkEndEditPolicy.java
@@ -39,8 +39,8 @@ import org.eclipse.gmf.runtime.diagram.ui.editpolicies.GraphicalNodeEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.command.AnnotatedLinkEditCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.AnnotatedLinkEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CustomLifelineEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CustomLifelineEditPart.CustomLifelineFigure;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.OLDLifelineEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.OLDLifelineEditPart.CustomLifelineFigure;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionOperandEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.figures.EllipseDecoration;
@@ -70,11 +70,11 @@ public class AnnotatedLinkEndEditPolicy extends GraphicalNodeEditPolicy {
Point location = ((DropRequest) request).getLocation();
EditPart host = getHost();
// Fixed bugs when link with PartDecomposition.
- if (host instanceof CustomLifelineEditPart && ((CustomLifelineEditPart) host).isInlineMode()) {
- List children = ((CustomLifelineEditPart) host).getChildren();
+ if (host instanceof OLDLifelineEditPart && ((OLDLifelineEditPart) host).isInlineMode()) {
+ List children = ((OLDLifelineEditPart) host).getChildren();
for (Object object : children) {
- if (object instanceof CustomLifelineEditPart) {
- CustomLifelineFigure figure = ((CustomLifelineEditPart) object).getPrimaryShape();
+ if (object instanceof OLDLifelineEditPart) {
+ CustomLifelineFigure figure = ((OLDLifelineEditPart) object).getPrimaryShape();
Point pt = location.getCopy();
figure.translateToRelative(pt);
if (figure.containsPoint(pt)) {
@@ -82,7 +82,7 @@ public class AnnotatedLinkEndEditPolicy extends GraphicalNodeEditPolicy {
}
}
}
- IFigure nameFigure = ((CustomLifelineEditPart) host).getPrimaryShape().getFigureLifelineNameContainerFigure();
+ IFigure nameFigure = ((OLDLifelineEditPart) host).getPrimaryShape().getFigureLifelineNameContainerFigure();
Point pt = location.getCopy();
nameFigure.translateToRelative(pt);
if (nameFigure.containsPoint(pt)) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentCreationEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentCreationEditPolicy.java
index d3c34e7c835..9b7ebf0df86 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentCreationEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentCreationEditPolicy.java
@@ -25,11 +25,11 @@ import org.eclipse.gef.requests.CreateRequest;
import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultCreationEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.GateEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
@@ -46,7 +46,7 @@ import org.eclipse.uml2.uml.InteractionFragment;
* @author mvelten
*
*/
-public class CombinedFragmentCreationEditPolicy extends CreationEditPolicy {
+public class CombinedFragmentCreationEditPolicy extends DefaultCreationEditPolicy {
@SuppressWarnings("unchecked")
@Override
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentHeadImpactLayoutEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentHeadImpactLayoutEditPolicy.java
index 0fc07e6813c..67ae048e778 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentHeadImpactLayoutEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentHeadImpactLayoutEditPolicy.java
@@ -51,7 +51,7 @@ public class CombinedFragmentHeadImpactLayoutEditPolicy extends AbstractHeadImpa
protected int getHeadHeight() {
IFigure primaryShape = getPrimaryShape();
if (primaryShape instanceof StereotypeInteractionFigure) {
- IFigure headContainer = ((StereotypeInteractionFigure) primaryShape).getHeaderLabel().getParent();
+ IFigure headContainer = ((StereotypeInteractionFigure) primaryShape).getNameLabel().getParent();
Rectangle boundsRect = getBoundsRect();
return headContainer.getPreferredSize(boundsRect.width, -1).height;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentItemComponentEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentItemComponentEditPolicy.java
index 1eec7839c61..a0dcc7d310d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentItemComponentEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentItemComponentEditPolicy.java
@@ -28,7 +28,7 @@ import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalC
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.util.CombinedFragmentDeleteHelper;
import org.eclipse.uml2.uml.CombinedFragment;
-
+@Deprecated
public class CombinedFragmentItemComponentEditPolicy extends ComponentEditPolicy {
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CreationOnMessageEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CreationOnMessageEditPolicy.java
index b63d49f60c8..067ff526721 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CreationOnMessageEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CreationOnMessageEditPolicy.java
@@ -70,7 +70,7 @@ public class CreationOnMessageEditPolicy extends CreationEditPolicy {
if (extendedData.containsKey(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2)) {
extendedData.put(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2, events);
} else {
- extendedData.put(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION, events);
+ extendedData.put(org.eclipse.papyrus.uml.service.types.utils.SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION, events);
}
if (extendedData.containsKey(SequenceRequestConstant.OCCURRENCE_SPECIFICATION_LOCATION_2)) {
extendedData.put(SequenceRequestConstant.OCCURRENCE_SPECIFICATION_LOCATION_2, location);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CustomCombinedFragment2ResizeEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CustomCombinedFragment2ResizeEditPolicy.java
index 96c28311655..bd018c3e4eb 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CustomCombinedFragment2ResizeEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CustomCombinedFragment2ResizeEditPolicy.java
@@ -25,7 +25,7 @@ import org.eclipse.gef.requests.ChangeBoundsRequest;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableShapeEditPolicy;
import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
import org.eclipse.gmf.runtime.draw2d.ui.mapmode.MapModeUtil;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CustomLifelineEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.OLDLifelineEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.figures.LifelineFigure;
import org.eclipse.papyrus.uml.diagram.sequence.util.HighlightUtil;
@@ -37,7 +37,7 @@ public class CustomCombinedFragment2ResizeEditPolicy extends ResizableShapeEditP
@Override
protected void showChangeBoundsFeedback(ChangeBoundsRequest request) {
- CustomLifelineEditPart lifelineEP = (CustomLifelineEditPart) getHost().getParent();
+ OLDLifelineEditPart lifelineEP = (OLDLifelineEditPart) getHost().getParent();
request.getMoveDelta().x = 0; // reset offset
request.getSizeDelta().width = 0; // reset offset
IFigure feedback = getDragSourceFeedbackFigure();
@@ -70,7 +70,7 @@ public class CustomCombinedFragment2ResizeEditPolicy extends ResizableShapeEditP
IFigure dotlineFigure = ((LifelineFigure)lifelineEP.getPrimaryShape()).getFigureLifelineDotLineFigure();
Rectangle rectParent = dotlineFigure.getBounds().getCopy();
lifelineEP.getPrimaryShape().translateToAbsolute(rectParent);
- int minLifelineY = rectParent.y + LifelineXYLayoutEditPolicy.SPACING_HEIGHT;
+ int minLifelineY = rectParent.y + OLDLifelineXYLayoutEditPolicy.SPACING_HEIGHT;
if (rect.y < minLifelineY) {
request.getMoveDelta().y += minLifelineY - rect.y;
rect.y = minLifelineY;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CustomDiagramDragDropEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CustomDiagramDragDropEditPolicy.java
index 9d973361526..ba216d9b144 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CustomDiagramDragDropEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CustomDiagramDragDropEditPolicy.java
@@ -74,6 +74,7 @@ import org.eclipse.papyrus.uml.diagram.common.helper.DurationObservationHelper;
import org.eclipse.papyrus.uml.diagram.sequence.command.CreateGateViewCommand;
import org.eclipse.papyrus.uml.diagram.sequence.command.CreateLocatedConnectionViewCommand;
import org.eclipse.papyrus.uml.diagram.sequence.command.RestoreDurationConstraintLinkCommand;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CCombinedCompartmentEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ActionExecutionSpecificationEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragment2EditPart;
@@ -86,7 +87,7 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Constraint2EditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContinuationEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CustomCombinedFragmentEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.OLDCustomCombinedFragmentEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DestructionOccurrenceSpecificationEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintInMessageEditPart;
@@ -105,7 +106,7 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.PackageEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.SequenceDiagramEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.StateInvariantEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeConstraintEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeObservationEditPart;
@@ -163,6 +164,7 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
protected Set<String> getDroppableElementVisualId() {
Set<String> elementsVisualId = new HashSet<String>();
elementsVisualId.add(LifelineEditPart.VISUAL_ID);
+ elementsVisualId.add(CCombinedCompartmentEditPart.VISUAL_ID);
elementsVisualId.add(ActionExecutionSpecificationEditPart.VISUAL_ID);
elementsVisualId.add(BehaviorExecutionSpecificationEditPart.VISUAL_ID);
elementsVisualId.add(InteractionUseEditPart.VISUAL_ID);
@@ -184,7 +186,7 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
elementsVisualId.add(TimeConstraintEditPart.VISUAL_ID);
elementsVisualId.add(TimeObservationEditPart.VISUAL_ID);
elementsVisualId.add(DurationConstraintEditPart.VISUAL_ID);
- elementsVisualId.add(PackageEditPart.VISUAL_ID);
+ elementsVisualId.add(SequenceDiagramEditPart.VISUAL_ID);
elementsVisualId.add(MessageSyncEditPart.VISUAL_ID);
elementsVisualId.add(MessageAsyncEditPart.VISUAL_ID);
elementsVisualId.add(MessageReplyEditPart.VISUAL_ID);
@@ -222,8 +224,8 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
if (editParts != null) {
for (Object part : editParts) {
- someCombinedFragment |= (part instanceof CustomCombinedFragmentEditPart);
- someNonCombinedFragment |= !(part instanceof CustomCombinedFragmentEditPart);
+ someCombinedFragment |= (part instanceof OLDCustomCombinedFragmentEditPart);
+ someNonCombinedFragment |= !(part instanceof OLDCustomCombinedFragmentEditPart);
}
}
@@ -251,7 +253,7 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
// Move the request's CFs models and views
if (editParts != null) {
for (Object part : editParts) {
- CustomCombinedFragmentEditPart combinedFragmentEP = (CustomCombinedFragmentEditPart) part;
+ OLDCustomCombinedFragmentEditPart combinedFragmentEP = (OLDCustomCombinedFragmentEditPart) part;
CombinedFragment combinedFragment = (CombinedFragment) ViewUtil.resolveSemanticElement((View) ((IGraphicalEditPart) combinedFragmentEP).getModel());
if (combinedFragmentEP.getParent() == newParentEP) {
@@ -283,7 +285,7 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
newParentEP.getFigure().translateToAbsolute(newParentOldRect);
Rectangle newParentNewRect = new Rectangle(newParentOldRect.getUnion(rectangleDroppedCombined));
- if (getHost().getParent() instanceof CustomCombinedFragmentEditPart) {
+ if (getHost().getParent() instanceof OLDCustomCombinedFragmentEditPart) {
CombinedFragmentMoveHelper.adjustNewParentOperands(cc, newParentNewRect, newParentOldRect, getHost());
}
// TODO: resize parent's parent (and so on)
@@ -303,7 +305,7 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
if (editParts != null) {
for (Object part : request.getEditParts()) {
- CustomCombinedFragmentEditPart combinedFragmentEP = (CustomCombinedFragmentEditPart) part;
+ OLDCustomCombinedFragmentEditPart combinedFragmentEP = (OLDCustomCombinedFragmentEditPart) part;
CombinedFragmentMoveHelper.moveCombinedFragmentEP(cc, request, combinedFragmentEP, newParentEP, newParentOffsetSW);
}
}
@@ -379,8 +381,9 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
}
if (nodeVISUALID != null) {
switch (nodeVISUALID) {
- case BehaviorExecutionSpecificationEditPart.VISUAL_ID:
case ActionExecutionSpecificationEditPart.VISUAL_ID:
+ case BehaviorExecutionSpecificationEditPart.VISUAL_ID:
+ case CCombinedCompartmentEditPart.VISUAL_ID:
return dropExecutionSpecification((ExecutionSpecification) semanticElement, nodeVISUALID, location);
case DestructionOccurrenceSpecificationEditPart.VISUAL_ID:
return dropDestructionOccurrence((DestructionOccurrenceSpecification) semanticElement, nodeVISUALID, location);
@@ -465,7 +468,7 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
if (getHostObject().equals(parentContainer)) {
List<View> existingViews = DiagramEditPartsUtil.findViews(parent, getViewer());
if (!existingViews.isEmpty()) {
- EditPart parentEditPart = lookForEditPart(parent);
+ EditPart parentEditPart = getHost();
if (parentEditPart instanceof GraphicalEditPart) {
// check if all lifelines coversby exist in diagram.
Rectangle bounds = null;
@@ -781,7 +784,7 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
if (execution != null) {
List<View> existingViews = DiagramEditPartsUtil.findViews(execution, getViewer());
for (View view : existingViews) {
- if (ActionExecutionSpecificationEditPart.VISUAL_ID.equals(UMLVisualIDRegistry.getVisualID(view)) || BehaviorExecutionSpecificationEditPart.VISUAL_ID.equals(UMLVisualIDRegistry.getVisualID(view))) {
+ if (CCombinedCompartmentEditPart.VISUAL_ID.equals(UMLVisualIDRegistry.getVisualID(view)) || BehaviorExecutionSpecificationEditPart.VISUAL_ID.equals(UMLVisualIDRegistry.getVisualID(view))) {
Object object = getViewer().getEditPartRegistry().get(view);
if (object instanceof IGraphicalEditPart) {
Rectangle bounds = SequenceUtil.getAbsoluteBounds((IGraphicalEditPart) object);
@@ -1079,19 +1082,19 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
// Get the lifelines containing the graphical destructionEvent
List<Lifeline> lifelines = getLifelines(existingViews);
// If the list of lifeline already containing the destructionEvent doesn't contain the lifeline targeted.
- if (!lifelines.contains(getHostObject())) {
- Lifeline lifeline = (Lifeline) getHostObject();
- for (InteractionFragment ift : lifeline.getCoveredBys()) {
- if (ift instanceof DestructionOccurrenceSpecification) {
- DestructionOccurrenceSpecification occurrenceSpecification = (DestructionOccurrenceSpecification) ift;
- // if the event of the occurrenceSpecification is the DestructionEvent, create the command
- if (destructionOccurence.equals(occurrenceSpecification)) {
+// if (!lifelines.contains(getHostObject())) {
+// Lifeline lifeline = (Lifeline) getHostObject();
+// for (InteractionFragment ift : lifeline.getCoveredBys()) {
+// if (ift instanceof DestructionOccurrenceSpecification) {
+// DestructionOccurrenceSpecification occurrenceSpecification = (DestructionOccurrenceSpecification) ift;
+// // if the event of the occurrenceSpecification is the DestructionEvent, create the command
+// if (destructionOccurence.equals(occurrenceSpecification)) {
return new ICommandProxy(getDefaultDropNodeCommand(nodeVISUALID, location, destructionOccurence));
- }
- }
- }
- }
- return UnexecutableCommand.INSTANCE;
+// }
+// }
+// }
+// }
+// return UnexecutableCommand.INSTANCE;
}
/**
@@ -1206,7 +1209,7 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
// Minimum shape (not just an horizontal line)
if (possibleFinishLocations.height <= 0) {
- possibleFinishLocations.height = LifelineXYLayoutEditPolicy.EXECUTION_INIT_HEIGHT;
+ possibleFinishLocations.height = OLDLifelineXYLayoutEditPolicy.EXECUTION_INIT_HEIGHT;
}
}
// find start and finish locations with correct y (start.y < finish.y) and proportions
@@ -1253,7 +1256,7 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
}
// deduce bounds
Rectangle result = new Rectangle(startLocation, finishLocation);
- result.width = LifelineXYLayoutEditPolicy.EXECUTION_INIT_WIDTH;
+ result.width = OLDLifelineXYLayoutEditPolicy.EXECUTION_INIT_WIDTH;
return result;
}
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DeleteTimeElementWithoutEventPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DeleteTimeElementWithoutEventPolicy.java
index 917959accb9..90ffa995a41 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DeleteTimeElementWithoutEventPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DeleteTimeElementWithoutEventPolicy.java
@@ -246,7 +246,7 @@ public class DeleteTimeElementWithoutEventPolicy extends AbstractEditPolicy impl
} else if (getHost() instanceof TimeConstraintEditPart && hostSemanticElement instanceof TimeConstraint) {
LifelineEditPart lifeline = SequenceUtil.getParentLifelinePart(getHost());
List<Element> occs = ((TimeConstraint) hostSemanticElement).getConstrainedElements();
- if (occs.size() > 0 & occs.get(0) instanceof OccurrenceSpecification) {
+ if (occs.size() > 0 && occs.get(0) instanceof OccurrenceSpecification) {
EditPart part = SequenceUtil.getLinkedEditPart(lifeline, (OccurrenceSpecification) occs.get(0));
if (part != null) {
return Collections.singletonList((View) part.getModel());
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ElementCreationWithMessageEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ElementCreationWithMessageEditPolicy.java
index 75f6a01a565..1e7f5919f54 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ElementCreationWithMessageEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ElementCreationWithMessageEditPolicy.java
@@ -37,11 +37,14 @@ import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewAndElemen
import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.commands.wrappers.EMFtoGEFCommandWrapper;
+import org.eclipse.papyrus.infra.emf.gmf.command.EMFtoGMFCommandWrapper;
+import org.eclipse.papyrus.uml.diagram.sequence.command.DropDestructionOccurenceSpecification;
import org.eclipse.papyrus.uml.diagram.sequence.command.PromptCreateElementAndNodeCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ActionExecutionSpecificationEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CCombinedCompartmentEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CustomLifelineEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CustomLifelineEditPart.CustomLifelineFigure;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.OLDLifelineEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.OLDLifelineEditPart.CustomLifelineFigure;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.figures.LifelineDotLineCustomFigure;
import org.eclipse.papyrus.uml.diagram.sequence.part.UMLVisualIDRegistry;
@@ -86,30 +89,16 @@ public class ElementCreationWithMessageEditPolicy extends LifelineChildGraphical
target = ViewUtil.resolveSemanticElement((View) targetEP.getModel());
}
EditPart sourceEditPart = request.getSourceEditPart();
- if (sourceEditPart instanceof ActionExecutionSpecificationEditPart || sourceEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (sourceEditPart instanceof CCombinedCompartmentEditPart || sourceEditPart instanceof BehaviorExecutionSpecificationEditPart) {
return new ICommandProxy(new PromptCreateElementAndNodeCommand(command, getEditingDomain(), viewRequest.getConnectionViewDescriptor(), (ShapeNodeEditPart) targetEP, target, sourceEP, request, ift));
}
- // IHintedType elementType = null;
- // if(sourceEditPart instanceof ActionExecutionSpecificationEditPart) {
- // elementType = (IHintedType)UMLElementTypes.ActionExecutionSpecification_Shape;
- // } else if(request.getSourceEditPart() instanceof BehaviorExecutionSpecificationEditPart) {
- // elementType = (IHintedType)UMLElementTypes.BehaviorExecutionSpecification_Shape;
- // }
- //
- //
- // if(elementType != null) {
- // CreateElementAndNodeCommand createExecutionSpecificationCommand = new CreateElementAndNodeCommand(getEditingDomain(), (ShapeNodeEditPart)targetEP, target, elementType, request.getLocation());
- // createExecutionSpecificationCommand.putCreateElementRequestParameter(SequenceRequestConstant.INTERACTIONFRAGMENT_CONTAINER, ift);
- // compound.add(createExecutionSpecificationCommand);
- //
- // // put the anchor at the top of the figure
- // ChangeEdgeTargetCommand changeTargetCommand = new ChangeEdgeTargetCommand(getEditingDomain(), createExecutionSpecificationCommand, viewRequest.getConnectionViewDescriptor(), "(0.5, 0.0)");
- // compound.add(new ICommandProxy(changeTargetCommand));
- // }
}
}
+
+ //if the message is DELETE KIND, we must drop the view of the DestructionOccurrenceSpecification
if (getDeleteMessageHint().equals(viewRequest.getConnectionViewDescriptor().getSemanticHint())) {
- command = LifelineMessageDeleteHelper.getAttachToNewDosCommand(command, viewRequest, getEditingDomain(), targetEP, getHost());
+// DropDestructionOccurenceSpecification dropDestructionOccurenceSpecification= new DropDestructionOccurenceSpecification(getEditingDomain(), viewRequest, targetEP);
+// command=command.chain(new EMFtoGEFCommandWrapper(dropDestructionOccurenceSpecification));
}
}
}
@@ -139,8 +128,8 @@ public class ElementCreationWithMessageEditPolicy extends LifelineChildGraphical
@Override
public EditPart getTargetEditPart(Request request) {
EditPart host = getHost();
- if (host instanceof CustomLifelineEditPart) {
- CustomLifelineEditPart lifeline = (CustomLifelineEditPart) host;
+ if (host instanceof OLDLifelineEditPart) {
+ OLDLifelineEditPart lifeline = (OLDLifelineEditPart) host;
boolean inlineMode = lifeline.isInlineMode();
if (inlineMode) {
Object type = request.getType();
@@ -170,10 +159,10 @@ public class ElementCreationWithMessageEditPolicy extends LifelineChildGraphical
return super.getTargetEditPart(request);
}
- private EditPart getTargetEditPart(Request request, CustomLifelineEditPart lifeline, Point location) {
+ private EditPart getTargetEditPart(Request request, OLDLifelineEditPart lifeline, Point location) {
EditPart childEditPart = getChildEditPart(lifeline, location);
- if (childEditPart instanceof CustomLifelineEditPart) {
- CustomLifelineEditPart childLifeline = (CustomLifelineEditPart) childEditPart;
+ if (childEditPart instanceof OLDLifelineEditPart) {
+ OLDLifelineEditPart childLifeline = (OLDLifelineEditPart) childEditPart;
if (isCreateConnectionRequest(request, UMLElementTypes.Message_CreateEdge) && isLocatedOnLifelineHeader(childLifeline, location)) {
return childEditPart;
} else if (request instanceof ReconnectRequest && (UMLVisualIDRegistry.getVisualID((View) ((ReconnectRequest) request).getConnectionEditPart().getModel()).equals(MessageCreateEditPart.VISUAL_ID) && isLocatedOnLifelineHeader(childLifeline, location))) {
@@ -187,7 +176,7 @@ public class ElementCreationWithMessageEditPolicy extends LifelineChildGraphical
return childEditPart;
}
- private EditPart getChildEditPart(CustomLifelineEditPart lifeline, Point location) {
+ private EditPart getChildEditPart(OLDLifelineEditPart lifeline, Point location) {
List children = lifeline.getChildren();
for (Object object : children) {
if (!(object instanceof GraphicalEditPart)) {
@@ -204,7 +193,7 @@ public class ElementCreationWithMessageEditPolicy extends LifelineChildGraphical
return null;
}
- private boolean isLocatedOnLifelineDotLine(CustomLifelineEditPart host, Point location) {
+ private boolean isLocatedOnLifelineDotLine(OLDLifelineEditPart host, Point location) {
CustomLifelineFigure primaryShape = host.getPrimaryShape();
LifelineDotLineCustomFigure figureLifelineDotLineFigure = primaryShape.getFigureLifelineDotLineFigure();
Point pt = location.getCopy();
@@ -214,7 +203,7 @@ public class ElementCreationWithMessageEditPolicy extends LifelineChildGraphical
return rect.contains(pt);
}
- private boolean isLocatedOnLifelineHeader(CustomLifelineEditPart host, Point location) {
+ private boolean isLocatedOnLifelineHeader(OLDLifelineEditPart host, Point location) {
RectangleFigure figureLifelineNameContainerFigure = host.getPrimaryShape().getFigureLifelineNameContainerFigure();
Point pt = location.getCopy();
figureLifelineNameContainerFigure.translateToRelative(pt);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ExecutionSpecificationComponentEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ExecutionSpecificationComponentEditPolicy.java
index 9cfb33c7524..b1152caf199 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ExecutionSpecificationComponentEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ExecutionSpecificationComponentEditPolicy.java
@@ -53,7 +53,7 @@ public class ExecutionSpecificationComponentEditPolicy extends ComponentEditPoli
// support nested actions and behaviors execution, https://bugs.eclipse.org/bugs/show_bug.cgi?id=384616
public static void addDeleteViewChildrenCommand(CompoundCommand deleteViewsCommand, TransactionalEditingDomain editingDomain, ShapeNodeEditPart part) {
- List<ShapeNodeEditPart> list = LifelineXYLayoutEditPolicy.getAffixedExecutionSpecificationEditParts(part);
+ List<ShapeNodeEditPart> list = OLDLifelineXYLayoutEditPolicy.getAffixedExecutionSpecificationEditParts(part);
for (ShapeNodeEditPart p : list) {
deleteViewsCommand.add(new ICommandProxy(new DeleteCommand(editingDomain, (View) p.getModel())));
SequenceDeleteHelper.completeDeleteExecutionSpecificationViewCommand(deleteViewsCommand, editingDomain, p);
@@ -62,7 +62,7 @@ public class ExecutionSpecificationComponentEditPolicy extends ComponentEditPoli
}
public static void addDestroyElementChildrenCommand(CompoundCommand deleteElementsCommand, TransactionalEditingDomain editingDomain, EditPart part) {
- List<ShapeNodeEditPart> list = LifelineXYLayoutEditPolicy.getAffixedExecutionSpecificationEditParts((ShapeNodeEditPart) part);
+ List<ShapeNodeEditPart> list = OLDLifelineXYLayoutEditPolicy.getAffixedExecutionSpecificationEditParts((ShapeNodeEditPart) part);
for (ShapeNodeEditPart p : list) {
Request request = new EditCommandRequestWrapper(new DestroyElementRequest(p.resolveSemanticElement(), false));
deleteElementsCommand.add(p.getCommand(request));
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ExecutionSpecificationEndGraphicalNodeEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ExecutionSpecificationEndGraphicalNodeEditPolicy.java
index d8f7e73236d..8f6a9ebcf9e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ExecutionSpecificationEndGraphicalNodeEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ExecutionSpecificationEndGraphicalNodeEditPolicy.java
@@ -219,16 +219,16 @@ public class ExecutionSpecificationEndGraphicalNodeEditPolicy extends GraphicalN
private Command getCreateAdditionalESCommand(CreateConnectionRequest request) {
INodeEditPart sourceEP = getSourceEditPart(request.getSourceEditPart());
- INodeEditPart targetEP = getConnectionCompleteEditPart(request);
- View targetView = (View) targetEP.getModel();
+ INodeEditPart targetEditPart = getConnectionCompleteEditPart(request);
+ View targetView = (View) targetEditPart.getModel();
EObject target = ViewUtil.resolveSemanticElement(targetView);
if (target == null) {
target = targetView;
}
- if (targetEP == sourceEP) {
+ if (targetEditPart == sourceEP) {
return null;
}
- if (!(targetEP instanceof AbstractExecutionSpecificationEditPart
+ if (!(targetEditPart instanceof AbstractExecutionSpecificationEditPart
&& getHost() instanceof ExecutionSpecificationEndEditPart)) {
return null;
}
@@ -248,13 +248,16 @@ public class ExecutionSpecificationEndGraphicalNodeEditPolicy extends GraphicalN
if (false == ((IHintedType) UMLElementTypes.Message_SynchEdge).getSemanticHint().equals(((CreateConnectionViewRequest) request).getConnectionViewDescriptor().getSemanticHint())) {
return null;
}
- InteractionFragment ift = SequenceUtil.findInteractionFragmentContainerAt(request.getLocation(), getHost());
- EObject parentElement = ((AbstractExecutionSpecificationEditPart) targetEP).resolveSemanticElement();
- EObject element = ((ExecutionSpecificationEndEditPart) getHost()).resolveSemanticElement();
- boolean executionLinkedAlready = parentElement instanceof ExecutionSpecification && element instanceof MessageOccurrenceSpecification;
+
+ //find semantic container
+ InteractionFragment semanticContainer = SequenceUtil.findInteractionFragmentContainerAt(request.getLocation(), getHost());
+ EObject executionTarget = ((AbstractExecutionSpecificationEditPart) targetEditPart).resolveSemanticElement();
+ EObject executionEnd = ((ExecutionSpecificationEndEditPart) getHost()).resolveSemanticElement();
+ boolean executionLinkedAlready = executionTarget instanceof ExecutionSpecification && executionEnd instanceof MessageOccurrenceSpecification;
+
// Check if we go uphill
ConnectionAnchor sourceAnchor = getActualSourceConnectionAnchor(request);
- ConnectionAnchor targetAnchor = getSourceConnectionAnchor(targetEP, request);
+ ConnectionAnchor targetAnchor = getSourceConnectionAnchor(targetEditPart, request);
Point sourceLocation = sourceAnchor.getLocation(targetAnchor.getReferencePoint()).getCopy();
if (sourceEP instanceof GateEditPart) {
// Changing target for Gates changes anchor location - we're taking care of it
@@ -262,30 +265,30 @@ public class ExecutionSpecificationEndGraphicalNodeEditPolicy extends GraphicalN
sourceEP.getFigure().translateToAbsolute(gateBounds);
sourceLocation.y = gateBounds.y + gateBounds.height/2;
}
- Point targetLocation = targetEP.getFigure().getBounds().getTopLeft().getCopy();
- targetEP.getFigure().translateToAbsolute(targetLocation);
+ Point targetLocation = targetEditPart.getFigure().getBounds().getTopLeft().getCopy();
+ targetEditPart.getFigure().translateToAbsolute(targetLocation);
boolean messageGoUphill = targetLocation.y < sourceLocation.y;
if (!executionLinkedAlready && !messageGoUphill) {
return null;
}
CompositeCommand compound = new CompositeCommand(SequenceRequestConstant.INTERACTIONFRAGMENT_CONTAINER);
Point newExecutionLocation = targetLocation.getCopy();
- INodeEditPart targetLifelineEP = (INodeEditPart)targetEP.getParent();
+ INodeEditPart targetLifelineEP = (INodeEditPart)targetEditPart.getParent();
if (messageGoUphill) {
newExecutionLocation.y = sourceLocation.y;
// Calc resize amount
- org.eclipse.draw2d.geometry.Rectangle targetBounds = targetEP.getFigure().getBounds().getCopy();
- targetEP.getFigure().translateToAbsolute(targetBounds);
+ org.eclipse.draw2d.geometry.Rectangle targetBounds = targetEditPart.getFigure().getBounds().getCopy();
+ targetEditPart.getFigure().translateToAbsolute(targetBounds);
int resizeAmount = newExecutionLocation.y
- + LifelineXYLayoutEditPolicy.EXECUTION_INIT_HEIGHT + LifelineXYLayoutEditPolicy.SPACING_HEIGHT
+ + OLDLifelineXYLayoutEditPolicy.EXECUTION_INIT_HEIGHT + OLDLifelineXYLayoutEditPolicy.SPACING_HEIGHT
- targetBounds.bottom();
if (resizeAmount > 0) {
// Resize parent ES
ChangeBoundsRequest esRequest = new ChangeBoundsRequest(org.eclipse.gef.RequestConstants.REQ_MOVE);
- esRequest.setEditParts(targetEP);
+ esRequest.setEditParts(targetEditPart);
esRequest.setResizeDirection(PositionConstants.SOUTH);
esRequest.setSizeDelta(new Dimension(0, resizeAmount));
- Command moveESCommand = LifelineXYLayoutEditPolicy.getResizeOrMoveChildrenCommand((LifelineEditPart) targetLifelineEP, esRequest, false, false, true);
+ Command moveESCommand = OLDLifelineXYLayoutEditPolicy.getResizeOrMoveChildrenCommand((LifelineEditPart) targetLifelineEP, esRequest, false, false, true);
if (moveESCommand != null && !moveESCommand.canExecute()) {
// forbid creation of the message if the es can't be moved correctly
return UnexecutableCommand.INSTANCE;
@@ -294,13 +297,14 @@ public class ExecutionSpecificationEndGraphicalNodeEditPolicy extends GraphicalN
}
}
}
- EObject targetLifeline = ViewUtil.resolveSemanticElement((View) targetEP.getParent().getModel());
- CreateElementAndNodeCommand createExecutionSpecificationCommand = new CreateElementAndNodeCommand(getEditingDomain(), (ShapeNodeEditPart)targetLifelineEP, targetLifeline, elementType, newExecutionLocation);
- createExecutionSpecificationCommand.putCreateElementRequestParameter(SequenceRequestConstant.INTERACTIONFRAGMENT_CONTAINER, ift);
- compound.compose(createExecutionSpecificationCommand);
+ EObject targetLifeline = ViewUtil.resolveSemanticElement((View) targetEditPart.getParent().getModel());
+ //create a DestructionOccurence
+ //CreateElementAndNodeCommand createExecutionSpecificationCommand = new CreateElementAndNodeCommand(getEditingDomain(), (ShapeNodeEditPart)targetLifelineEP, semanticContainer, elementType, newExecutionLocation);
+ //createExecutionSpecificationCommand.putCreateElementRequestParameter(org.eclipse.papyrus.uml.service.types.utils.SequenceRequestConstant.COVERED, targetLifeline);
+ //compound.compose(createExecutionSpecificationCommand);
// put the anchor at the top of the figure
- ChangeEdgeTargetCommand changeTargetCommand = new ChangeEdgeTargetCommand(getEditingDomain(), createExecutionSpecificationCommand, viewRequest.getConnectionViewDescriptor(), "(0.5, 0.0)");
- compound.compose(changeTargetCommand);
+ //ChangeEdgeTargetCommand changeTargetCommand = new ChangeEdgeTargetCommand(getEditingDomain(), createExecutionSpecificationCommand, viewRequest.getConnectionViewDescriptor(), "(0.5, 0.0)");
+ //compound.compose(changeTargetCommand);
return new ICommandProxy(compound);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/GatesHolderGraphicalNodeEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/GatesHolderGraphicalNodeEditPolicy.java
index 17b5890f5d9..b1b0c3fc0fa 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/GatesHolderGraphicalNodeEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/GatesHolderGraphicalNodeEditPolicy.java
@@ -75,10 +75,10 @@ import org.eclipse.uml2.uml.Message;
* @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=389531
* @author Jin Liu (jin.liu@soyatec.com)
*/
-public class GatesHolderGraphicalNodeEditPolicy extends SequenceGraphicalNodeEditPolicy {
+public class GatesHolderGraphicalNodeEditPolicy extends OLDSequenceGraphicalNodeEditPolicy {
/**
- * @see org.eclipse.papyrus.uml.diagram.sequence.edit.policies.SequenceGraphicalNodeEditPolicy#getReconnectSourceCommand(org.eclipse.gef.requests.ReconnectRequest)
+ * @see org.eclipse.papyrus.uml.diagram.sequence.edit.policies.OLDSequenceGraphicalNodeEditPolicy#getReconnectSourceCommand(org.eclipse.gef.requests.ReconnectRequest)
*
* @param request
* @return
@@ -120,7 +120,7 @@ public class GatesHolderGraphicalNodeEditPolicy extends SequenceGraphicalNodeEdi
}
/**
- * @see org.eclipse.papyrus.uml.diagram.sequence.edit.policies.SequenceGraphicalNodeEditPolicy#getReconnectTargetCommand(org.eclipse.gef.requests.ReconnectRequest)
+ * @see org.eclipse.papyrus.uml.diagram.sequence.edit.policies.OLDSequenceGraphicalNodeEditPolicy#getReconnectTargetCommand(org.eclipse.gef.requests.ReconnectRequest)
*
* @param request
* @return
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/HighlightEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/HighlightEditPolicy.java
index b7714cf1d4d..a1bf9ad7f2a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/HighlightEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/HighlightEditPolicy.java
@@ -13,6 +13,7 @@ import org.eclipse.draw2d.PolylineConnection;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.PointList;
+import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.ConnectionEditPart;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPolicy;
@@ -23,11 +24,14 @@ import org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy;
import org.eclipse.gef.requests.CreateConnectionRequest;
import org.eclipse.gef.requests.GroupRequest;
import org.eclipse.gef.requests.ReconnectRequest;
+import org.eclipse.gef.requests.TargetRequest;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramRootEditPart;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeRequest;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageEndEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.figures.EllipseDecoration;
@@ -65,6 +69,9 @@ public class HighlightEditPolicy extends GraphicalEditPolicy {
}
if (editPolicy != null) {
EditPart targetEditPart = ((CreateConnectionRequest) request).getTargetEditPart();
+ if( targetEditPart instanceof InteractionEditPart){
+ System.err.println();
+ }
boolean canExecute = targetEditPart != null;
if (targetEditPart != null) {
Command command = targetEditPart.getCommand(request);
@@ -141,6 +148,10 @@ public class HighlightEditPolicy extends GraphicalEditPolicy {
highlight((EditPart) object);
}
} else if (request instanceof CreateConnectionRequest) {
+ if( request instanceof CreateConnectionRequest){
+ Rectangle ptOnScreen=new Rectangle(((CreateConnectionRequest)request).getLocation(), new Dimension());
+ ((CreateConnectionRequest)request).setLocation(ptOnScreen.getTopLeft());
+ }
CreateConnectionRequest req = (CreateConnectionRequest) request;
EditPart sourceEditPart = req.getSourceEditPart();
EditPart targetEditPart = req.getTargetEditPart();
@@ -265,7 +276,7 @@ public class HighlightEditPolicy extends GraphicalEditPolicy {
*/
private void highlightEventsAboutConstraints(Request request) {
Object locTop = request.getExtendedData().get(SequenceRequestConstant.OCCURRENCE_SPECIFICATION_LOCATION);
- Object topEvents = request.getExtendedData().get(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION);
+ Object topEvents = request.getExtendedData().get(org.eclipse.papyrus.uml.service.types.utils.SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION);
if (locTop instanceof Point && topEvents != null && topEvents instanceof Collection<?> && !((Collection<?>) topEvents).isEmpty()) {
Point referenceTop = ((Point) locTop).getCopy();
OccurrenceSpecification event = (OccurrenceSpecification) ((Collection<?>) topEvents).iterator().next();
@@ -408,6 +419,7 @@ public class HighlightEditPolicy extends GraphicalEditPolicy {
@Override
public void eraseTargetFeedback(Request request) {
+
unhighlight();
safeRemoveFeedback(sourceIndicator);
sourceIndicator = null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionCompartmentXYLayoutEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionCompartmentXYLayoutEditPolicy.java
index 59ef3604909..d86afe17953 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionCompartmentXYLayoutEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionCompartmentXYLayoutEditPolicy.java
@@ -70,8 +70,8 @@ import org.eclipse.papyrus.infra.gmfdiag.common.service.palette.AspectUnspecifie
import org.eclipse.papyrus.uml.diagram.common.commands.PreserveAnchorsPositionCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentCombinedFragmentCompartmentEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CustomInteractionEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CustomLifelineEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.OldCustomInteractionEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.OLDLifelineEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionOperandEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart;
@@ -133,7 +133,7 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
// Adjust excessive vertical resizing
if (child instanceof LifelineEditPart && hasCreateLink && request.getMoveDelta().y > 0) {
int oldHeight = child.getFigure().getBounds().height;
- int oldMinimumHeight = ((CustomLifelineEditPart)child).getMinimumHeight(-1);
+ int oldMinimumHeight = ((OLDLifelineEditPart)child).getMinimumHeight(-1);
int requestHeight = oldHeight + request.getMoveDelta().y;
int newMinimumHeight = oldMinimumHeight + request.getMoveDelta().y;
int newHeight = Math.max(oldHeight, newMinimumHeight);
@@ -172,7 +172,7 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
compoundCmd.add(changeConstraintCommand);
// Update heights of all the lifelines
if (child instanceof LifelineEditPart && changeConstraintCommand != null && request.getMoveDelta().y != 0) {
- CustomInteractionEditPart hostParent = (CustomInteractionEditPart)getHost().getParent();
+ OldCustomInteractionEditPart hostParent = (OldCustomInteractionEditPart)getHost().getParent();
Command commandUpdateLifelines = hostParent.getUpdateLifelinesHeightsCommand(null);
compoundCmd.add(commandUpdateLifelines);
}
@@ -414,7 +414,7 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
ChangeBoundsRequest esRequest = new ChangeBoundsRequest(org.eclipse.gef.RequestConstants.REQ_MOVE);
esRequest.setEditParts(sep);
esRequest.setMoveDelta(moveDelta);
- Command moveESCommand = LifelineXYLayoutEditPolicy.getResizeOrMoveChildrenCommand((LifelineEditPart) parentEP, esRequest, true, false, true);
+ Command moveESCommand = OLDLifelineXYLayoutEditPolicy.getResizeOrMoveChildrenCommand((LifelineEditPart) parentEP, esRequest, true, false, true);
if (moveESCommand != null && !moveESCommand.canExecute()) {
// forbid move if the es can't be moved correctly
return UnexecutableCommand.INSTANCE;
@@ -733,7 +733,7 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
// SetBounds command modifying the sizeDelta
compoundCmd.add(getSetBoundsCommand(lifelineEP, cbr, newSizeDelta));
// PreserveAnchors command
- compoundCmd.add(new ICommandProxy(new CustomLifelineEditPart.PreserveAnchorsPositionCommandEx(lifelineEP, newSizeDelta, preserveY, lifelineEP.getPrimaryShape().getFigureLifelineDotLineFigure(), resizeDirection)));
+ compoundCmd.add(new ICommandProxy(new OLDLifelineEditPart.PreserveAnchorsPositionCommandEx(lifelineEP, newSizeDelta, preserveY, lifelineEP.getPrimaryShape().getFigureLifelineDotLineFigure(), resizeDirection)));
}
}
if (compoundCmd.size() == 0) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionGraphicalNodeEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionGraphicalNodeEditPolicy.java
index ca5e10c465b..11480485742 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionGraphicalNodeEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionGraphicalNodeEditPolicy.java
@@ -84,7 +84,7 @@ public class InteractionGraphicalNodeEditPolicy extends GatesHolderGraphicalNode
}
/**
- * @see org.eclipse.papyrus.uml.diagram.sequence.edit.policies.SequenceGraphicalNodeEditPolicy#getTargetEditPart(org.eclipse.gef.Request)
+ * @see org.eclipse.papyrus.uml.diagram.sequence.edit.policies.OLDSequenceGraphicalNodeEditPolicy#getTargetEditPart(org.eclipse.gef.Request)
*
* @param request
* @return
@@ -115,7 +115,7 @@ public class InteractionGraphicalNodeEditPolicy extends GatesHolderGraphicalNode
}
/**
- * @see org.eclipse.papyrus.uml.diagram.sequence.edit.policies.SequenceGraphicalNodeEditPolicy#getConnectionCompleteCommand(org.eclipse.gef.requests.CreateConnectionRequest)
+ * @see org.eclipse.papyrus.uml.diagram.sequence.edit.policies.OLDSequenceGraphicalNodeEditPolicy#getConnectionCompleteCommand(org.eclipse.gef.requests.CreateConnectionRequest)
*
* @param request
* @return
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionHeadImpactLayoutEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionHeadImpactLayoutEditPolicy.java
index 9d51bf17a2c..c8a9dc107fd 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionHeadImpactLayoutEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionHeadImpactLayoutEditPolicy.java
@@ -54,7 +54,7 @@ public class InteractionHeadImpactLayoutEditPolicy extends AbstractHeadImpactLay
protected int getHeadHeight() {
IFigure primaryShape = getPrimaryShape();
if (primaryShape instanceof StereotypeInteractionFigure) {
- IFigure headContainer = ((StereotypeInteractionFigure) primaryShape).getHeaderLabel().getParent();
+ IFigure headContainer = ((StereotypeInteractionFigure) primaryShape).getNameLabel().getParent();
Rectangle boundsRect = getBoundsRect();
return headContainer.getPreferredSize(boundsRect.width, -1).height;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandDragDropEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandDragDropEditPolicy.java
index 3b28af3563e..45056f6a02a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandDragDropEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandDragDropEditPolicy.java
@@ -40,26 +40,27 @@ public class InteractionOperandDragDropEditPolicy extends ResizableEditPolicy {
*/
@Override
protected Command getResizeCommand(ChangeBoundsRequest request) {
- boolean isVertResize = (request.getResizeDirection() & PositionConstants.NORTH_SOUTH) != 0;
- boolean isHorResize = (request.getResizeDirection() & PositionConstants.EAST_WEST) != 0;
- boolean isNorthResize = (request.getResizeDirection() & PositionConstants.NORTH) != 0;
- boolean isSouthResize = (request.getResizeDirection() & PositionConstants.SOUTH) != 0;
- if (isHorResize && !isVertResize) {
- EditPart parent = getHost().getParent().getParent();
- return parent.getCommand(request);
- } else if (isVertResize) {
- if (this.getHost() instanceof InteractionOperandEditPart && this.getHost().getParent() instanceof CombinedFragmentCombinedFragmentCompartmentEditPart) {
- InteractionOperandEditPart currentIOEP = (InteractionOperandEditPart) this.getHost();
- CombinedFragmentCombinedFragmentCompartmentEditPart compartEP = (CombinedFragmentCombinedFragmentCompartmentEditPart) this.getHost().getParent();
- // if the OP's border same as/linked to the CF's border
- if (this.getHost() == OperandBoundsComputeHelper.findFirstIOEP(compartEP) && isNorthResize
- || this.getHost() == OperandBoundsComputeHelper.findLastIOEP(compartEP) && isSouthResize) {
- return getHost().getParent().getParent().getCommand(request);
- } else {
- return OperandBoundsComputeHelper.createIOEPResizeCommand(currentIOEP, request, compartEP);
- }
- }
- }
- return null;
+ Command cmd= super.getResizeCommand(request);
+// boolean isVertResize = (request.getResizeDirection() & PositionConstants.NORTH_SOUTH) != 0;
+// boolean isHorResize = (request.getResizeDirection() & PositionConstants.EAST_WEST) != 0;
+// boolean isNorthResize = (request.getResizeDirection() & PositionConstants.NORTH) != 0;
+// boolean isSouthResize = (request.getResizeDirection() & PositionConstants.SOUTH) != 0;
+// if (isHorResize && !isVertResize) {
+// EditPart parent = getHost().getParent().getParent();
+// return parent.getCommand(request);
+// } else if (isVertResize) {
+// if (this.getHost() instanceof InteractionOperandEditPart && this.getHost().getParent() instanceof CombinedFragmentCombinedFragmentCompartmentEditPart) {
+// InteractionOperandEditPart currentIOEP = (InteractionOperandEditPart) this.getHost();
+// CombinedFragmentCombinedFragmentCompartmentEditPart compartEP = (CombinedFragmentCombinedFragmentCompartmentEditPart) this.getHost().getParent();
+// // if the OP's border same as/linked to the CF's border
+// if (this.getHost() == OperandBoundsComputeHelper.findFirstIOEP(compartEP) && isNorthResize
+// || this.getHost() == OperandBoundsComputeHelper.findLastIOEP(compartEP) && isSouthResize) {
+// return getHost().getParent().getParent().getCommand(request);
+// } else {
+// return OperandBoundsComputeHelper.createIOEPResizeCommand(currentIOEP, request, compartEP);
+// }
+// }
+// }
+ return cmd;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifeLineAffixedNodesCreationEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifeLineAffixedNodesCreationEditPolicy.java
new file mode 100644
index 00000000000..fb7ae58c39b
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifeLineAffixedNodesCreationEditPolicy.java
@@ -0,0 +1,89 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+
+package org.eclipse.papyrus.uml.diagram.sequence.edit.policies;
+
+import java.util.Map;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.ui.commands.SetBoundsCommand;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultCreationEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.service.AspectUnspecifiedTypeCreationTool;
+import org.eclipse.papyrus.uml.diagram.sequence.figures.DestructionEventFigure;
+import org.eclipse.papyrus.uml.diagram.sequence.locator.CenterLocator;
+import org.eclipse.papyrus.uml.service.types.element.UMLDIElementTypes;
+
+/**
+ * This class place element for the border item of the lifeline
+ * @since 3.0
+ *
+ */
+public class LifeLineAffixedNodesCreationEditPolicy extends DefaultCreationEditPolicy {
+
+
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected ICommand getSetBoundsCommand(CreateViewRequest request, CreateViewRequest.ViewDescriptor descriptor) {
+ ICommand setBoundsCommand = null;
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
+ // Retrieve parent location
+ Point parentLoc = getHostFigure().getBounds().getLocation().getCopy();
+ final Point realWantedLocation;
+ Map<?, ?> params = request.getExtendedData();
+ Point realLocation = (Point) params.get(AspectUnspecifiedTypeCreationTool.INITIAL_MOUSE_LOCATION_FOR_CREATION);
+ if (realLocation != null) {
+ realWantedLocation = realLocation.getCopy();
+ } else {
+ // we use this location to be able to create Port in the corners of the figure
+ realWantedLocation = request.getLocation().getCopy();
+ }
+ // Compute relative creation location
+ Point requestedLocation = realWantedLocation.getCopy();
+
+ //The position of the node must be relation form its container
+ requestedLocation.translate(parentLoc.negate());
+ //In the case of the destruction event we contsider the center as the origin.
+ if( descriptor.getSemanticHint().equals(UMLDIElementTypes.DESTRUCTION_OCCURRENCE_SPECIFICATION_SHAPE.getSemanticHint())){
+ DestructionEventFigure destructionEventFigure= new DestructionEventFigure();
+ requestedLocation.y=requestedLocation.y-destructionEventFigure.getDefaultSize().height/2;
+ }
+
+ setBoundsCommand = new SetBoundsCommand(editingDomain, DiagramUIMessages.SetLocationCommand_Label_Resize, descriptor, requestedLocation);
+
+ return setBoundsCommand;
+ }
+
+ protected CenterLocator getPositionLocator() {
+ return new CenterLocator(getHostFigure(), PositionConstants.NONE);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected IFigure getHostFigure() {
+ return ((GraphicalEditPart) getHost()).getFigure();
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineAppliedStereotypeNodeLabelDisplayEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineAppliedStereotypeNodeLabelDisplayEditPolicy.java
index ca60bb99f83..47e38d7935e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineAppliedStereotypeNodeLabelDisplayEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineAppliedStereotypeNodeLabelDisplayEditPolicy.java
@@ -13,7 +13,7 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.sequence.edit.policies;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CustomLifelineEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.OLDLifelineEditPart;
import org.eclipse.papyrus.uml.diagram.stereotype.edition.editpolicies.AppliedStereotypeLabelEditPolicy;
/**
@@ -31,8 +31,8 @@ public class LifelineAppliedStereotypeNodeLabelDisplayEditPolicy extends Applied
@Override
public void refreshStereotypeDisplay() {
super.refreshStereotypeDisplay();
- if (getHost() instanceof CustomLifelineEditPart) {
- ((CustomLifelineEditPart) getHost()).updateLifelinePosition();
+ if (getHost() instanceof OLDLifelineEditPart) {
+ ((OLDLifelineEditPart) getHost()).updateLifelinePosition();
}
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineChildGraphicalNodeEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineChildGraphicalNodeEditPolicy.java
index b33f15b8979..91f663048f0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineChildGraphicalNodeEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineChildGraphicalNodeEditPolicy.java
@@ -45,7 +45,7 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.uml.diagram.sequence.command.CreateGateViewCommand;
import org.eclipse.papyrus.uml.diagram.sequence.draw2d.routers.MessageRouter;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragment2EditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CustomLifelineEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.OLDLifelineEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
@@ -64,13 +64,13 @@ import org.eclipse.uml2.uml.MessageEnd;
/**
* A specific policy to handle :
- * - Message aspects inherited from {@link SequenceGraphicalNodeEditPolicy}.
+ * - Message aspects inherited from {@link OLDSequenceGraphicalNodeEditPolicy}.
* - Time/duration move when a message end or an execution is moved.
* - Duration constraint/observation creation feedback.
* - Creation of general ordering links.
* This edit policy is intended to be installed on parts which represent a lifeline or which are contained within a lifeline part.
*/
-public class LifelineChildGraphicalNodeEditPolicy extends SequenceGraphicalNodeEditPolicy {
+public class LifelineChildGraphicalNodeEditPolicy extends OLDSequenceGraphicalNodeEditPolicy {
/** the feedback for creating a duration constraint node */
private Polyline durationCreationFeedback = null;
@@ -149,7 +149,7 @@ public class LifelineChildGraphicalNodeEditPolicy extends SequenceGraphicalNodeE
/**
* Get the command to reconnect the source and move associated time/duration constraints/observation.
*
- * @see org.eclipse.papyrus.uml.diagram.sequence.edit.policies.SequenceGraphicalNodeEditPolicy#getReconnectSourceCommand(org.eclipse.gef.requests.ReconnectRequest)
+ * @see org.eclipse.papyrus.uml.diagram.sequence.edit.policies.OLDSequenceGraphicalNodeEditPolicy#getReconnectSourceCommand(org.eclipse.gef.requests.ReconnectRequest)
*
* @param request
* the reconnection request
@@ -162,7 +162,7 @@ public class LifelineChildGraphicalNodeEditPolicy extends SequenceGraphicalNodeE
command = OccurrenceSpecificationMoveHelper.completeReconnectConnectionCommand(command, request, getConnectableEditPart());
if (request.getConnectionEditPart() instanceof MessageCreateEditPart && request.getTarget() instanceof LifelineEditPart) {
LifelineEditPart newSource = (LifelineEditPart) request.getTarget();
- CustomLifelineEditPart target = (CustomLifelineEditPart) request.getConnectionEditPart().getTarget();
+ OLDLifelineEditPart target = (OLDLifelineEditPart) request.getConnectionEditPart().getTarget();
command = LifelineMessageCreateHelper.moveLifelineDown(command, target, newSource.getFigure().getBounds().getLocation().getCopy());
}
}
@@ -172,7 +172,7 @@ public class LifelineChildGraphicalNodeEditPolicy extends SequenceGraphicalNodeE
/**
* Get the command to reconnect the target and move associated time/duration constraints/observation.
*
- * @see org.eclipse.papyrus.uml.diagram.sequence.edit.policies.SequenceGraphicalNodeEditPolicy#getReconnectTargetCommand(org.eclipse.gef.requests.ReconnectRequest)
+ * @see org.eclipse.papyrus.uml.diagram.sequence.edit.policies.OLDSequenceGraphicalNodeEditPolicy#getReconnectTargetCommand(org.eclipse.gef.requests.ReconnectRequest)
*
* @param request
* the reconnection request
@@ -187,7 +187,7 @@ public class LifelineChildGraphicalNodeEditPolicy extends SequenceGraphicalNodeE
command = LifelineMessageCreateHelper.reconnectMessageCreateTarget(request, command);
}
if (request.getConnectionEditPart() instanceof MessageDeleteEditPart && request.getTarget() instanceof LifelineEditPart) {
- command = LifelineMessageDeleteHelper.getReconnectMessageDeleteTargetCommand(request, command);
+ // command = LifelineMessageDeleteHelper.getReconnectMessageDeleteTargetCommand(request, command);
}
}
return command;
@@ -260,7 +260,7 @@ public class LifelineChildGraphicalNodeEditPolicy extends SequenceGraphicalNodeE
}
/**
- * @see org.eclipse.papyrus.uml.diagram.sequence.edit.policies.SequenceGraphicalNodeEditPolicy#getConnectionCompleteCommand(org.eclipse.gef.requests.CreateConnectionRequest)
+ * @see org.eclipse.papyrus.uml.diagram.sequence.edit.policies.OLDSequenceGraphicalNodeEditPolicy#getConnectionCompleteCommand(org.eclipse.gef.requests.CreateConnectionRequest)
*
* @param request
* @return
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineHeadImpactLayoutEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineHeadImpactLayoutEditPolicy.java
index 2fcbac9650c..8ac32fae40d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineHeadImpactLayoutEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineHeadImpactLayoutEditPolicy.java
@@ -16,8 +16,8 @@ package org.eclipse.papyrus.uml.diagram.sequence.edit.policies;
import org.eclipse.draw2d.RectangleFigure;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CustomLifelineEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CustomLifelineEditPart.CustomLifelineFigure;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.OLDLifelineEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.OLDLifelineEditPart.CustomLifelineFigure;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.util.LifelineHeadUtil;
@@ -29,7 +29,7 @@ public class LifelineHeadImpactLayoutEditPolicy extends AbstractHeadImpactLayout
@Override
protected int getHeadHeight() {
- CustomLifelineFigure primaryShape = ((CustomLifelineEditPart) getHost()).getPrimaryShape();
+ CustomLifelineFigure primaryShape = ((OLDLifelineEditPart) getHost()).getPrimaryShape();
RectangleFigure figure = primaryShape.getFigureLifelineNameContainerFigure();
Rectangle r = getBoundsRect();
Dimension preferredSize = figure.getPreferredSize(r.width, -1);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineSelectionEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineSelectionEditPolicy.java
index 9c69de10cf4..0ecdac5f885 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineSelectionEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineSelectionEditPolicy.java
@@ -27,7 +27,7 @@ import org.eclipse.gef.tools.ResizeTracker;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableEditPolicyEx;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CustomLifelineEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.OLDLifelineEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DestructionOccurrenceSpecificationEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.figures.LifelineFigure;
@@ -94,9 +94,9 @@ public class LifelineSelectionEditPolicy extends ResizableEditPolicyEx {
boolean skipMinSize = false;
// Only enable horizontal dragging on lifelines(except lifelines that are result of a create message).
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=364688
- if (this.getHost() instanceof CustomLifelineEditPart) {
+ if (this.getHost() instanceof OLDLifelineEditPart) {
skipMinSize = true;
- CustomLifelineEditPart lifelineEP = (CustomLifelineEditPart) this.getHost();
+ OLDLifelineEditPart lifelineEP = (OLDLifelineEditPart) this.getHost();
if (!SequenceUtil.isCreateMessageEndLifeline(lifelineEP)) {
request.getMoveDelta().y = 0;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DestructionEventComponentEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/OLDDestructionEventComponentEditPolicy.java
index 906d3451887..c78ec6b4dc8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DestructionEventComponentEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/OLDDestructionEventComponentEditPolicy.java
@@ -24,7 +24,7 @@ import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceDeleteHelper;
/**
* This edit policy also deletes time/duration edit parts which are linked with the deleted edit part.
*/
-public class DestructionEventComponentEditPolicy extends ComponentEditPolicy {
+public class OLDDestructionEventComponentEditPolicy extends ComponentEditPolicy {
/**
* {@inheritDoc}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/OLDLifeLineLayoutEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/OLDLifeLineLayoutEditPolicy.java
new file mode 100644
index 00000000000..6c017c4a732
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/OLDLifeLineLayoutEditPolicy.java
@@ -0,0 +1,123 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+
+package org.eclipse.papyrus.uml.diagram.sequence.edit.policies;
+
+import java.util.Map;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdapter;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.diagram.ui.commands.SetBoundsCommand;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest.ViewAndElementDescriptor;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultCreationEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.service.AspectUnspecifiedTypeCreationTool;
+import org.eclipse.papyrus.uml.diagram.sequence.figures.DestructionEventFigure;
+import org.eclipse.papyrus.uml.service.types.element.UMLDIElementTypes;
+import org.eclipse.papyrus.uml.service.types.utils.SequenceRequestConstant;
+
+/**
+ *
+ * This class is manage border item and element inside Lifeline
+ * @since 3.0
+ *
+ */
+public class OLDLifeLineLayoutEditPolicy extends DefaultCreationEditPolicy {
+
+
+
+ /**
+ * @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy#getCreateElementAndViewCommand(org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest)
+ *
+ * @param request
+ * @return
+ */
+ @Override
+ protected Command getCreateElementAndViewCommand(CreateViewAndElementRequest request) {
+ ViewAndElementDescriptor descriptor=request.getViewAndElementDescriptor();
+ if (UMLDIElementTypes.ACTION_EXECUTION_SPECIFICATION_SHAPE.getSemanticHint().equals(descriptor.getSemanticHint())){
+ // get the element descriptor
+ CreateElementRequestAdapter requestAdapter =
+ request.getViewAndElementDescriptor().getCreateElementRequestAdapter();
+ // get the semantic request
+ CreateElementRequest createElementRequest =
+ (CreateElementRequest) requestAdapter.getAdapter(
+ CreateElementRequest.class);
+ View view = (View)getHost().getModel();
+ EObject hostElement = ViewUtil.resolveSemanticElement(view);
+ createElementRequest.setContainer(hostElement.eContainer());
+ createElementRequest.setParameter(SequenceRequestConstant.COVERED, hostElement);
+
+ }
+ return super.getCreateElementAndViewCommand(request);
+ }
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected ICommand getSetBoundsCommand(CreateViewRequest request, CreateViewRequest.ViewDescriptor descriptor) {
+ ICommand setBoundsCommand = null;
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
+ // Retrieve parent location
+ if( descriptor.getSemanticHint().equals(UMLDIElementTypes.DESTRUCTION_OCCURRENCE_SPECIFICATION_SHAPE.getSemanticHint())){
+ Point parentLoc = getHostFigure().getBounds().getLocation().getCopy();
+ final Point realWantedLocation;
+ Map<?, ?> params = request.getExtendedData();
+ Point realLocation = (Point) params.get(AspectUnspecifiedTypeCreationTool.INITIAL_MOUSE_LOCATION_FOR_CREATION);
+ if (realLocation != null) {
+ realWantedLocation = realLocation.getCopy();
+ } else {
+ // we use this location to be able to create Port in the corners of the figure
+ realWantedLocation = request.getLocation().getCopy();
+ }
+ // Compute relative creation location
+ Point requestedLocation = realWantedLocation.getCopy();
+
+ //The position of the node must be relation form its container
+ requestedLocation.translate(parentLoc.negate());
+ //In the case of the destruction event we contsider the center as the origin.
+
+ DestructionEventFigure destructionEventFigure= new DestructionEventFigure();
+ requestedLocation.y=requestedLocation.y-destructionEventFigure.getDefaultSize().height/2;
+ setBoundsCommand = new SetBoundsCommand(editingDomain, DiagramUIMessages.SetLocationCommand_Label_Resize, descriptor, requestedLocation);
+ }
+ else{
+ super.getSetBoundsCommand(request, descriptor);
+ }
+
+
+
+ return setBoundsCommand;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ protected IFigure getHostFigure() {
+ return ((GraphicalEditPart) getHost()).getFigure();
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineCreationEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/OLDLifelineCreationEditPolicy.java
index ee9afca5ce2..0df5a6cd274 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineCreationEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/OLDLifelineCreationEditPolicy.java
@@ -54,22 +54,22 @@ import org.eclipse.uml2.uml.OccurrenceSpecification;
*
* Occurrence Specification is located on the lifeline, but not visible. Though, elements must be created on it.
*/
-public class LifelineCreationEditPolicy extends CreationEditPolicy {
+public class OLDLifelineCreationEditPolicy extends CreationEditPolicy {
@Override
protected Command getCreateElementAndViewCommand(CreateViewAndElementRequest request) {
// get the element descriptor
CreateElementRequestAdapter requestAdapter = request.getViewAndElementDescriptor().getCreateElementRequestAdapter();
// get the semantic request
+ View view = (View) getHost().getModel();
+ EObject hostElement = ViewUtil.resolveSemanticElement(view);
+ if (hostElement == null && view.getElement() == null) {
+ hostElement = view;
+ }
+
CreateElementRequest createElementRequest = (CreateElementRequest) requestAdapter.getAdapter(CreateElementRequest.class);
if (createElementRequest.getContainer() == null) {
// complete the semantic request by filling in the host's semantic
- // element as the context
- View view = (View) getHost().getModel();
- EObject hostElement = ViewUtil.resolveSemanticElement(view);
- if (hostElement == null && view.getElement() == null) {
- hostElement = view;
- }
// Returns null if host is unresolvable so that trying to create a
// new element in an unresolved shape will not be allowed.
if (hostElement == null) {
@@ -80,6 +80,9 @@ public class LifelineCreationEditPolicy extends CreationEditPolicy {
InteractionFragment ift = SequenceUtil.findInteractionFragmentContainerAt(request.getLocation(), getHost());
Map<String, Object> extendedData = request.getExtendedData();
extendedData.put(SequenceRequestConstant.INTERACTIONFRAGMENT_CONTAINER, ift);
+ extendedData.put(org.eclipse.papyrus.uml.service.types.utils.SequenceRequestConstant.COVERED, hostElement);
+
+ createElementRequest.setContainer(ift);
// record the nearest event if necessary
String requestHint = request.getViewAndElementDescriptor().getSemanticHint();
if (isCreatedOnOccurrenceSpecification(requestHint)) {
@@ -96,7 +99,7 @@ public class LifelineCreationEditPolicy extends CreationEditPolicy {
if (extendedData.containsKey(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2)) {
extendedData.put(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2, events);
} else {
- extendedData.put(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION, events);
+ extendedData.put(org.eclipse.papyrus.uml.service.types.utils.SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION, events);
}
if (extendedData.containsKey(SequenceRequestConstant.OCCURRENCE_SPECIFICATION_LOCATION_2)) {
extendedData.put(SequenceRequestConstant.OCCURRENCE_SPECIFICATION_LOCATION_2, location);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineXYLayoutEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/OLDLifelineXYLayoutEditPolicy.java
index 86ddf4c8b14..aed8529a428 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineXYLayoutEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/OLDLifelineXYLayoutEditPolicy.java
@@ -51,12 +51,12 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.uml.diagram.common.commands.PreserveAnchorsPositionCommand;
import org.eclipse.papyrus.uml.diagram.common.draw2d.LifelineDotLineFigure;
import org.eclipse.papyrus.uml.diagram.sequence.command.CustomZOrderCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ActionExecutionSpecificationEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CCombinedCompartmentEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragment2EditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CustomDurationConstraintEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CustomLifelineEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CustomLifelineEditPart.PreserveAnchorsPositionCommandEx;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.OLDLifelineEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.OLDLifelineEditPart.PreserveAnchorsPositionCommandEx;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CustomStateInvariantEditPart.StateInvariantResizableEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DestructionOccurrenceSpecificationEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart;
@@ -70,8 +70,9 @@ import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceUtil;
/**
* The custom LayoutEditPolicy for LifelineEditPart.
+ * @deprecated will be removed in Oxygen
*/
-public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
+public class OLDLifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
/** Initialization width of Execution Specification. */
public final static int EXECUTION_INIT_WIDTH = 16;
@@ -113,8 +114,8 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
@Override
public EditPart getTargetEditPart(Request request) {
EditPart targetEditPart = super.getTargetEditPart(request);
- if (targetEditPart instanceof CustomLifelineEditPart) {
- CustomLifelineEditPart lifelineEditPart = (CustomLifelineEditPart) targetEditPart;
+ if (targetEditPart instanceof OLDLifelineEditPart) {
+ OLDLifelineEditPart lifelineEditPart = (OLDLifelineEditPart) targetEditPart;
if (lifelineEditPart.isInlineMode()) {
Point location = null;
if (request instanceof DropRequest) {
@@ -123,10 +124,10 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
if (location != null) {
List children = lifelineEditPart.getChildren();
for (Object object : children) {
- if (!(object instanceof CustomLifelineEditPart)) {
+ if (!(object instanceof OLDLifelineEditPart)) {
continue;
}
- CustomLifelineEditPart child = (CustomLifelineEditPart) object;
+ OLDLifelineEditPart child = (OLDLifelineEditPart) object;
IFigure figure = child.getFigure();
Point pt = location.getCopy();
figure.translateToRelative(pt);
@@ -159,9 +160,9 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
@Override
protected Command getCreateCommand(CreateRequest request) {
EditPart targetEditPart = getTargetEditPart(request);
- if (targetEditPart instanceof CustomLifelineEditPart && targetEditPart.getParent() instanceof CustomLifelineEditPart) {
+ if (targetEditPart instanceof OLDLifelineEditPart && targetEditPart.getParent() instanceof OLDLifelineEditPart) {
Point location = request.getLocation();
- IFigure figure = ((CustomLifelineEditPart) targetEditPart).getPrimaryShape();
+ IFigure figure = ((OLDLifelineEditPart) targetEditPart).getPrimaryShape();
Point pt = location.getCopy();
figure.translateToRelative(pt);
if (!figure.containsPoint(pt)) {
@@ -425,7 +426,7 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
// resize parent bar
if (parent != null) {
Rectangle newAdjustedBounds = newBounds.getCopy();
- newAdjustedBounds.height += LifelineXYLayoutEditPolicy.SPACING_HEIGHT;
+ newAdjustedBounds.height += OLDLifelineXYLayoutEditPolicy.SPACING_HEIGHT;
p = p.chain(resizeParentExecutionSpecification((LifelineEditPart) getHost(), parent, newAdjustedBounds, executionSpecificationList));
}
return p;
@@ -436,7 +437,7 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
childBounds.x = bounds.x;
childBounds.width = bounds.width;
Rectangle rect = bounds.getCopy();
- int spacingY = LifelineXYLayoutEditPolicy.SPACING_HEIGHT;
+ int spacingY = OLDLifelineXYLayoutEditPolicy.SPACING_HEIGHT;
if (childBounds.y - spacingY < rect.y) {
rect.height += rect.y - childBounds.y + spacingY;
rect.y = childBounds.y - spacingY;
@@ -537,7 +538,7 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
* @return the height defined in the create request or a default value depending on the created figure
*/
private int getFigureHeight(String semanticHint, Dimension size) {
- int newHeight;
+ int newHeight=10;
if (TIME_OBSERVATION_HINT.equals(semanticHint) || TIME_CONSTRAINT_HINT.equals(semanticHint)) {
// height for a time bar (takes precedence on request's size)
newHeight = TIME_BAR_HEIGHT;
@@ -644,7 +645,7 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
compoundCmd.setLabel("Move or resize");
compoundCmd.setDebugLabel("Debug: Move or resize of a Lifeline's children");
for (EditPart ep : editParts) {
- if (ep instanceof ActionExecutionSpecificationEditPart || ep instanceof BehaviorExecutionSpecificationEditPart) {
+ if (ep instanceof CCombinedCompartmentEditPart || ep instanceof BehaviorExecutionSpecificationEditPart) {
// an execution specification have been moved or resized
ShapeNodeEditPart executionSpecificationEP = (ShapeNodeEditPart) ep;
// Check if height is within the limits of the figure
@@ -716,7 +717,7 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
compoundCmd.add(SequenceUtil.createUpdateEnclosingInteractionCommand(executionSpecificationEP, request.getMoveDelta(), newSizeDelta));
}
// keep absolute position of anchors
- compoundCmd.add(new ICommandProxy(new CustomLifelineEditPart.PreserveAnchorsPositionCommandEx(executionSpecificationEP, new Dimension(realMoveDelta.width, realMoveDelta.height), PreserveAnchorsPositionCommand.PRESERVE_Y,
+ compoundCmd.add(new ICommandProxy(new OLDLifelineEditPart.PreserveAnchorsPositionCommandEx(executionSpecificationEP, new Dimension(realMoveDelta.width, realMoveDelta.height), PreserveAnchorsPositionCommand.PRESERVE_Y,
executionSpecificationEP.getFigure(), request.getResizeDirection())));
}
if (ep instanceof CombinedFragment2EditPart) {
@@ -740,7 +741,7 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
compoundCmd.add(new ICommandProxy(setBoundsCmd));
// keep absolute position of anchors
if (sizeDelta != null && sizeDelta.height != 0) {
- compoundCmd.add(new ICommandProxy(new CustomLifelineEditPart.PreserveAnchorsPositionCommandEx(cf2EP, new Dimension(0, sizeDelta.height), PreserveAnchorsPositionCommand.PRESERVE_Y, cf2EP.getPrimaryShape().getCentralVerticalLine(),
+ compoundCmd.add(new ICommandProxy(new OLDLifelineEditPart.PreserveAnchorsPositionCommandEx(cf2EP, new Dimension(0, sizeDelta.height), PreserveAnchorsPositionCommand.PRESERVE_Y, cf2EP.getPrimaryShape().getCentralVerticalLine(),
request.getResizeDirection())));
}
}
@@ -772,7 +773,7 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
Rectangle rectLifeline = lifelineEP.getFigure().getBounds() .getCopy();
Dimension zoomedAddon = new Dimension(0, DESTRUCTION_INIT_SIZE/2);
lifelineEP.getFigure().translateToRelative(zoomedAddon);
- int minimumHeight = ((CustomLifelineEditPart)lifelineEP).getMinimumHeight(-1, true) + zoomedAddon.height;
+ int minimumHeight = ((OLDLifelineEditPart)lifelineEP).getMinimumHeight(-1, true) + zoomedAddon.height;
newHeight = Math.max(newHeight, minimumHeight);
int heightDelta = newHeight - rectLifeline.height;
if (heightDelta == 0) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageConnectionEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/OLDMessageConnectionEditPolicy.java
index 17209ff9e0c..9d3444de84b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageConnectionEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/OLDMessageConnectionEditPolicy.java
@@ -25,7 +25,7 @@ import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceDeleteHelper;
/**
* This edit policy also deletes time/duration edit parts which are linked with the deleted edit part.
*/
-public class MessageConnectionEditPolicy extends ConnectionEditPolicy {
+public class OLDMessageConnectionEditPolicy extends ConnectionEditPolicy {
@Override
protected Command createDeleteSemanticCommand(GroupRequest deleteRequest) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/OLDSequenceGraphicalNodeEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/OLDSequenceGraphicalNodeEditPolicy.java
new file mode 100644
index 00000000000..7d1d663c339
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/OLDSequenceGraphicalNodeEditPolicy.java
@@ -0,0 +1,710 @@
+/*****************************************************************************
+ * Copyright (c) 2010 CEA
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.sequence.edit.policies;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.eclipse.draw2d.Connection;
+import org.eclipse.draw2d.ConnectionAnchor;
+import org.eclipse.draw2d.ConnectionRouter;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Polyline;
+import org.eclipse.draw2d.Viewport;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.PointList;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.ConnectionEditPart;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gef.requests.CreateConnectionRequest;
+import org.eclipse.gef.requests.ReconnectRequest;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.core.commands.SetConnectionAnchorsCommand;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.INodeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.GraphicalNodeEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.internal.commands.SetConnectionBendpointsCommand;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewAndElementRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewAndElementRequest.ConnectionViewAndElementDescriptor;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeConnectionRequest;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.papyrus.uml.diagram.common.service.AspectUnspecifiedTypeConnectionTool.CreateAspectUnspecifiedTypeConnectionRequest;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CustomCombinedFragment2EditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.OLDLifelineEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionFragmentEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionOperandEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.part.Messages;
+import org.eclipse.papyrus.uml.diagram.sequence.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.sequence.util.FragmentsOrdererHelper;
+import org.eclipse.papyrus.uml.diagram.sequence.util.LifelineMessageCreateHelper;
+import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceRequestConstant;
+import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceUtil;
+import org.eclipse.papyrus.uml.diagram.stereotype.edition.editpart.AppliedStereotypesCommentLinkEditPart;
+import org.eclipse.uml2.uml.Message;
+import org.eclipse.uml2.uml.OccurrenceSpecification;
+
+/**
+ * A specific policy to handle the message :
+ * - Message cannot be uphill.
+ * - Message Occurrence Specification which are created along the message may have a different container than the message.
+ * - Message feedback on creation is always drawn in black (to avoid invisible feedback)
+ *
+ */
+@SuppressWarnings({ "restriction", "unchecked", "rawtypes" })
+public class OLDSequenceGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
+
+ /** A static margin to allow drawing of straight message */
+ private static final int MARGIN = 2;
+
+ /**
+ * Gets the command to start the creation of a new connection and relationship. This will update the request appropriately. Also completes the
+ * request with nearby occurrence specification information.
+ *
+ * @param request
+ * creation request
+ * @return Command
+ */
+ @Override
+ protected Command getConnectionAndRelationshipCreateCommand(CreateConnectionViewAndElementRequest request) {
+ Map<String, Object> extendedData = request.getExtendedData();
+ // record the nearest event if necessary
+ String requestHint = request.getConnectionViewAndElementDescriptor().getSemanticHint();
+ if (isCreatedNearOccurrenceSpecification(requestHint) || isOnOccerrenceSpecification(request.getLocation())) {
+ LifelineEditPart lifelinePart = SequenceUtil.getParentLifelinePart(getHost());
+ if (lifelinePart != null) {
+ Entry<Point, List<OccurrenceSpecification>> eventAndLocation = SequenceUtil.findNearestEvent(request.getLocation(), lifelinePart);
+ // find an event near enough to create the constraint or observation
+ List<OccurrenceSpecification> events = Collections.emptyList();
+ Point location = null;
+ if (eventAndLocation != null) {
+ location = eventAndLocation.getKey();
+ events = eventAndLocation.getValue();
+ }
+ extendedData.put(org.eclipse.papyrus.uml.service.types.utils.SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION, events);
+ extendedData.put(SequenceRequestConstant.OCCURRENCE_SPECIFICATION_LOCATION, location);
+ if (location != null) {
+ request.setLocation(location);
+ }
+ }
+ }
+ return super.getConnectionAndRelationshipCreateCommand(request);
+ }
+
+ private boolean isOnOccerrenceSpecification(Point location) {
+ EditPart editPart = getHost().getViewer().findObjectAt(location);
+ if (editPart == null) {
+ return false;
+ }
+ Object model = editPart.getModel();
+ if (model instanceof View) {
+ return (ViewUtil.resolveSemanticElement((View) model) instanceof OccurrenceSpecification);
+ }
+ return false;
+ }
+
+ /**
+ * Gets the command to complete the creation of a new connection and relationship. Also completes the request with nearby occurrence specification
+ * information.
+ *
+ * @param request
+ * the creation request
+ * @return Command
+ */
+ @Override
+ protected Command getConnectionAndRelationshipCompleteCommand(CreateConnectionViewAndElementRequest request) {
+ Map<String, Object> extendedData = request.getExtendedData();
+ // record the nearest event if necessary
+ String requestHint = request.getConnectionViewAndElementDescriptor().getSemanticHint();
+ if (isCreatedNearOccurrenceSpecification(requestHint) || isOnOccerrenceSpecification(request.getLocation())) {
+ LifelineEditPart lifelinePart = SequenceUtil.getParentLifelinePart(getHost());
+ if (lifelinePart != null) {
+ Entry<Point, List<OccurrenceSpecification>> eventAndLocation = SequenceUtil.findNearestEvent(request.getLocation(), lifelinePart);
+ // find an event near enough to create the constraint or observation
+ List<OccurrenceSpecification> events = Collections.emptyList();
+ Point location = null;
+ if (eventAndLocation != null) {
+ location = eventAndLocation.getKey();
+ events = eventAndLocation.getValue();
+ }
+ extendedData.put(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2, events);
+ extendedData.put(SequenceRequestConstant.OCCURRENCE_SPECIFICATION_LOCATION_2, location);
+ if (location != null) {
+ request.setLocation(location);
+ }
+ }
+ }
+ // Ordering message occurrence specifications after message creation, See https://bugs.eclipse.org/bugs/show_bug.cgi?id=403233
+ Command command = super.getConnectionAndRelationshipCompleteCommand(request);
+ if (command != null && command.canExecute()) {
+ command = command.chain(FragmentsOrdererHelper.createOrderingFragmentsCommand(getHost(), request));
+ }
+ return command;
+ }
+
+ /**
+ * Return true if creation must be performed to or from an occurrence specification
+ *
+ * @param requestHint
+ * the hint of object to create
+ * @return true if creation to or from an occurrence specification
+ */
+ private boolean isCreatedNearOccurrenceSpecification(String requestHint) {
+ String generalOrderingHint = ((IHintedType) UMLElementTypes.GeneralOrdering_Edge).getSemanticHint();
+ return generalOrderingHint.equals(requestHint);
+ }
+
+ /**
+ * Return true if a message is being created
+ *
+ * @param requestHint
+ * the hint of object to create
+ * @return true if creation of a message
+ */
+ protected boolean isMessageHint(String requestHint) {
+ List<String> messageHints = new ArrayList<String>(7);
+ String messageHint = ((IHintedType) UMLElementTypes.Message_SynchEdge).getSemanticHint();
+ messageHints.add(messageHint);
+ messageHint = ((IHintedType) UMLElementTypes.Message_AsynchEdge).getSemanticHint();
+ messageHints.add(messageHint);
+ messageHint = ((IHintedType) UMLElementTypes.Message_ReplyEdge).getSemanticHint();
+ messageHints.add(messageHint);
+ messageHint = ((IHintedType) UMLElementTypes.Message_CreateEdge).getSemanticHint();
+ messageHints.add(messageHint);
+ messageHint = ((IHintedType) UMLElementTypes.Message_DeleteEdge).getSemanticHint();
+ messageHints.add(messageHint);
+ messageHint = ((IHintedType) UMLElementTypes.Message_LostEdge).getSemanticHint();
+ messageHints.add(messageHint);
+ messageHint = ((IHintedType) UMLElementTypes.Message_FoundEdge).getSemanticHint();
+ messageHints.add(messageHint);
+ return messageHints.contains(requestHint);
+ }
+
+ @Override
+ protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
+ // move source point to the bottom if it is contained in LifelineNameContainerFigure
+ EditPart targetEditPart = request.getTargetEditPart();
+ if (targetEditPart != null && targetEditPart instanceof LifelineEditPart) {
+ LifelineEditPart target = (LifelineEditPart) targetEditPart;
+ if (target.getPrimaryShape() != null) {
+ Rectangle sourceBounds = target.getPrimaryShape().getFigureLifelineNameContainerFigure().getBounds().getCopy();
+ Point sourcePointCopy = request.getLocation().getCopy();
+ target.getFigure().translateToRelative(sourcePointCopy);
+ if (sourcePointCopy.y() < sourceBounds.getBottom().y()) {
+ target.getFigure().translateToAbsolute(sourceBounds);
+ request.getLocation().setY(sourceBounds.getBottom().y() + 1);
+ }
+ }
+ }
+ /**
+ * Sometime, the viewport would be scrolled when drag to select the target of connection by using AutoexposeHelper. We need to adjust the
+ * source
+ * location if needed.
+ */
+ PointEx sourcePoint = new PointEx(request.getLocation());
+ Viewport vp = findViewport((GraphicalEditPart) getHost().getViewer().getRootEditPart());
+ if (vp != null) {
+ Point loc1 = vp.getClientArea().getLocation().getCopy();
+ sourcePoint.setViewportLocation(loc1);
+ }
+ request.getExtendedData().put(SequenceRequestConstant.SOURCE_LOCATION_DATA, sourcePoint);
+ // Safely calculate the source model container here.
+ request.getExtendedData().put(SequenceRequestConstant.SOURCE_MODEL_CONTAINER, SequenceUtil.findInteractionFragmentContainerAt(sourcePoint, getHost()));
+ return super.getConnectionCreateCommand(request);
+ }
+
+ protected Viewport findViewport(GraphicalEditPart part) {
+ IFigure figure = null;
+ Viewport port = null;
+ do {
+ if (figure == null) {
+ figure = part.getContentPane();
+ } else {
+ figure = figure.getParent();
+ }
+ if (figure instanceof Viewport) {
+ port = (Viewport) figure;
+ break;
+ }
+ } while (figure != part.getFigure() && figure != null);
+ return port;
+ }
+
+ /**
+ * Overrides to disable uphill message
+ */
+ @Override
+ protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
+ Command command = super.getConnectionCompleteCommand(request);
+ if (command == null) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ // disable the following code if we are not creating a message.
+ String requestHint = null;
+ if (request instanceof CreateConnectionViewRequest) {
+ requestHint = ((CreateConnectionViewRequest) request).getConnectionViewDescriptor().getSemanticHint();
+ if (!isMessageHint(requestHint)) {
+ return command;
+ }
+ }
+ // ICommandProxy proxy = (ICommandProxy)request.getStartCommand();
+ // CompositeCommand cc = (CompositeCommand)proxy.getICommand();
+ // Iterator<?> commandItr = cc.iterator();
+ // while(commandItr.hasNext()) {
+ // Object obj = commandItr.next();
+ // if(obj instanceof SetConnectionBendpointsCommand) {
+ // SetConnectionBendpointsCommand sbbCommand = (SetConnectionBendpointsCommand)obj;
+ // final PointList pointList = sbbCommand.getNewPointList();
+ Point sourcePoint = (Point) request.getExtendedData().get(SequenceRequestConstant.SOURCE_LOCATION_DATA);
+ Point targetPoint = request.getLocation();
+ // Adjust source location to current coordinate system (the viewport may be scrolled by AutoexposeHelper.).
+ if (sourcePoint instanceof PointEx) {
+ Viewport vp = findViewport((GraphicalEditPart) getHost().getViewer().getRootEditPart());
+ if (vp != null) {
+ Point loc2 = vp.getClientArea().getLocation();
+ sourcePoint = ((PointEx) sourcePoint).adjustToFitNewViewport(loc2);
+ }
+ }
+ // prevent uphill message (leave margin for horizontal messages)
+ boolean messageCreate = ((IHintedType) UMLElementTypes.Message_CreateEdge).getSemanticHint().equals(requestHint);
+ if (sourcePoint == null || sourcePoint.y >= targetPoint.y + MARGIN) {
+ if (!messageCreate && !isLostFoundMessage(requestHint)) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ }
+ // prevent uphill message (for self recursive message)
+ if (request.getSourceEditPart().equals(request.getTargetEditPart()) && sourcePoint.y >= targetPoint.y) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ // prevent uphill message (for reply message)
+ if (request instanceof CreateConnectionViewAndElementRequest) {
+ ConnectionViewAndElementDescriptor desc = ((CreateConnectionViewAndElementRequest) request).getConnectionViewAndElementDescriptor();
+ String replyHint = ((IHintedType) UMLElementTypes.Message_ReplyEdge).getSemanticHint();
+ if (replyHint.equals(desc.getSemanticHint()) && request.getSourceEditPart() instanceof IGraphicalEditPart) {
+ Rectangle srcBounds = SequenceUtil.getAbsoluteBounds((IGraphicalEditPart) request.getSourceEditPart());
+ int bottom = srcBounds.getBottom().y;
+ if (bottom >= targetPoint.y + MARGIN) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ }
+ }
+ // prevent duplicate create link
+ if (messageCreate && request.getSourceEditPart() != null && request.getTargetEditPart() != null) {
+ if (LifelineMessageCreateHelper.hasMessageCreate((GraphicalEditPart) request.getSourceEditPart(), request.getTargetEditPart())) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ }
+ // The SOURCE MODEL should be calculated when connection started, the scroll bar maybe already changed when connection come to finished.
+ // request.getExtendedData().put(SequenceRequestConstant.SOURCE_MODEL_CONTAINER, SequenceUtil.findInteractionFragmentContainerAt(sourcePoint, getHost()));
+ request.getExtendedData().put(SequenceRequestConstant.TARGET_MODEL_CONTAINER, SequenceUtil.findInteractionFragmentContainerAt(targetPoint, getHost()));
+ // In case we are creating a connection to/from a CoRegion, we will need the lifeline element where is drawn the CoRegion later in the process.
+ EditPart targetEditPart = getTargetEditPart(request);
+ if (targetEditPart instanceof CustomCombinedFragment2EditPart) {
+ request.getExtendedData().put(SequenceRequestConstant.LIFELINE_GRAPHICAL_CONTAINER, ((CustomCombinedFragment2EditPart) targetEditPart).getAttachedLifeline());
+ }
+ // update bendpoints for self link message.
+ if (connectionFeedback != null && ((IHintedType) UMLElementTypes.Message_AsynchEdge).getSemanticHint().equals(requestHint)) {
+ updateConnectionBendpoints(request, command);
+ }
+ // change constraint of the target lifeline after added a Create Message
+ if (request.getTargetEditPart() instanceof LifelineEditPart && !(request.getSourceEditPart().equals(request.getTargetEditPart()))) {
+ if (requestHint.equals((((IHintedType) UMLElementTypes.Message_CreateEdge).getSemanticHint()))) {
+ OLDLifelineEditPart target = (OLDLifelineEditPart) request.getTargetEditPart();
+ command = LifelineMessageCreateHelper.moveLifelineDown(command, target, sourcePoint.getCopy());
+ }
+ }
+ return command;
+ }
+
+ /**
+ * Update bendpoints when creating self message with the feedback, so that, the message can be created like feedback,
+ */
+ private void updateConnectionBendpoints(CreateConnectionRequest request, Command command) {
+ if (connectionFeedback == null || connectionFeedback.getPoints().size() < 4) {
+ return;
+ }
+ if (!(command instanceof ICommandProxy)) {
+ return;
+ }
+ ICommand iCommand = ((ICommandProxy) command).getICommand();
+ if (!(iCommand instanceof CompositeCommand)) {
+ return;
+ }
+ INodeEditPart targetEP = getConnectionCompleteEditPart(request);
+ if (targetEP == null) {
+ return;
+ }
+ LifelineEditPart sourceLifeline = getLifeline(request.getSourceEditPart());
+ LifelineEditPart targetLifeline = getLifeline(request.getTargetEditPart());
+ boolean isSelfLink = sourceLifeline != null && sourceLifeline.equals(targetLifeline);
+ if (!isSelfLink) {
+ return;
+ }
+ CompositeCommand cc = (CompositeCommand) iCommand;
+ SetConnectionAnchorsCommand scaCommand = null;
+ SetConnectionBendpointsCommand sbbCommand = null;
+ Iterator it = cc.iterator();
+ while (it.hasNext()) {
+ Object next = it.next();
+ if (next instanceof SetConnectionBendpointsCommand) {
+ sbbCommand = (SetConnectionBendpointsCommand) next;
+ } else if (next instanceof SetConnectionAnchorsCommand) {
+ scaCommand = (SetConnectionAnchorsCommand) next;
+ }
+ if (sbbCommand != null && scaCommand != null) {
+ break;
+ }
+ }
+ if (sbbCommand == null || scaCommand == null) {
+ return;
+ }
+ ConnectionAnchor targetAnchor = targetEP.getTargetConnectionAnchor(request);
+ INodeEditPart sourceEditPart = (INodeEditPart) request.getSourceEditPart();
+ ConnectionAnchor sourceAnchor = sourceEditPart.mapTerminalToConnectionAnchor(scaCommand.getNewSourceTerminal());
+ PointList pointList = connectionFeedback.getPoints().getCopy();
+ connectionFeedback.translateToAbsolute(pointList);
+ sbbCommand.setNewPointList(pointList, sourceAnchor.getReferencePoint(), targetAnchor.getReferencePoint());
+ }
+
+ private LifelineEditPart getLifeline(EditPart editPart) {
+ if (editPart == null) {
+ return null;
+ }
+ if (editPart instanceof LifelineEditPart) {
+ return (LifelineEditPart) editPart;
+ }
+ return getLifeline(editPart.getParent());
+ }
+
+ /**
+ * Override to disable uphill message
+ */
+ @Override
+ protected Command getReconnectSourceCommand(ReconnectRequest request) {
+ if (isUphillMessage(request) && !isLostFoundMessage(request)) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ // prevent duplicate link
+ if (request.getConnectionEditPart() instanceof MessageCreateEditPart && request.getTarget() != null && !LifelineMessageCreateHelper.canReconnectMessageCreate(request)) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ // Avoid to reconnect AppliedStereotypesCommentLink to another EditPart.
+ ConnectionEditPart connection = request.getConnectionEditPart();
+ if (connection instanceof AppliedStereotypesCommentLinkEditPart) {
+ if (connection.getSource() != getConnectableEditPart()) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ }
+ Command command = super.getReconnectSourceCommand(request);
+ // //Ordering message occurrence specifications after message reconnected, See https://bugs.eclipse.org/bugs/show_bug.cgi?id=403233
+ if (command != null && command.canExecute()) {
+ command = command.chain(FragmentsOrdererHelper.createOrderingFragmentsCommand(getHost(), request));
+ }
+ return command;
+ }
+
+ private boolean isLostFoundMessage(ReconnectRequest request) {
+ ConnectionEditPart connectionEditPart = request.getConnectionEditPart();
+ if (connectionEditPart instanceof MessageFoundEditPart || connectionEditPart instanceof MessageLostEditPart) {
+ return true;
+ }
+ return false;
+ }
+
+ private boolean isLostFoundMessage(String requestHint) {
+ if (((IHintedType) UMLElementTypes.Message_LostEdge).getSemanticHint().equals(requestHint) || ((IHintedType) UMLElementTypes.Message_FoundEdge).getSemanticHint().equals(requestHint)) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Override to disable uphill message
+ */
+ @Override
+ protected Command getReconnectTargetCommand(ReconnectRequest request) {
+ if (isUphillMessage(request) && !isLostFoundMessage(request)) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ // prevent duplicate link
+ if (request.getConnectionEditPart() instanceof MessageCreateEditPart && request.getTarget() != null && !LifelineMessageCreateHelper.canReconnectMessageCreate(request)) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ Command command = super.getReconnectTargetCommand(request);
+ // Ordering message occurrence specifications after message reconnected, See https://bugs.eclipse.org/bugs/show_bug.cgi?id=403233
+ if (command != null && command.canExecute()) {
+ command = command.chain(FragmentsOrdererHelper.createOrderingFragmentsCommand(getHost(), request));
+ }
+ return command;
+ }
+
+ /**
+ * Check that a message doesn't have its target point above its source point
+ *
+ * @param request
+ * the ReconnectRequest
+ * @return true if the target point is above the source point
+ */
+ protected boolean isUphillMessage(ReconnectRequest request) {
+ ConnectionEditPart connectionEditPart = request.getConnectionEditPart();
+ if (connectionEditPart.getModel() instanceof Edge) {
+ Edge edge = (Edge) connectionEditPart.getModel();
+ if (edge.getElement() instanceof Message) {
+ if (connectionEditPart.getFigure() instanceof Polyline) {
+ // get connection end points translated to absolute
+ Polyline polyline = (Polyline) connectionEditPart.getFigure();
+ Point end = polyline.getEnd().getCopy();
+ Point start = polyline.getStart().getCopy();
+ polyline.getParent().translateToAbsolute(end);
+ polyline.getParent().translateToAbsolute(start);
+ // look at the request rather than at both polyline ends which may not be up to date
+ if (REQ_RECONNECT_SOURCE.equals(request.getType())) {
+ return request.getLocation().y >= end.y + MARGIN;
+ } else if (REQ_RECONNECT_TARGET.equals(request.getType())) {
+ return start.y >= request.getLocation().y + MARGIN;
+ } else {
+ return start.y >= end.y + MARGIN;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Overrides to set the color of the dummyConnection to color black.
+ * This allow to see the feedback of the connection when it is created.
+ * By default, the color was the foreground color of the lifeline, which is always blank leading to an invisible feedback.
+ *
+ */
+ @Override
+ protected Connection createDummyConnection(Request req) {
+ Connection conn = super.createDummyConnection(req);
+ conn.setForegroundColor(org.eclipse.draw2d.ColorConstants.black);
+ return conn;
+ }
+
+ /**
+ * Gets a command that pops up a menu which allows the user to select which
+ * type of connection to be created and then creates the connection.
+ *
+ * @param content
+ * The list of items making up the content of the popup menu.
+ * @param request
+ * The relevant create connection request.
+ * @return the command to popup up the menu and create the connection
+ */
+ @Override
+ protected ICommand getPromptAndCreateConnectionCommand(List content, CreateConnectionRequest request) {
+ return new SequencePromptAndCreateConnectionCommand(content, request);
+ }
+
+ /**
+ * Extends {@link PromptAndCreateConnectionCommand} to specify the type of message that can be selected.
+ */
+ protected class SequencePromptAndCreateConnectionCommand extends PromptAndCreateConnectionCommand {
+
+ /**
+ * @see {@link PromptAndCreateConnectionCommand#PromptAndCreateConnectionCommand(List, CreateConnectionRequest)}
+ */
+ public SequencePromptAndCreateConnectionCommand(List content, CreateConnectionRequest request) {
+ super(content, request);
+ }
+
+ /**
+ * Defines a specific label provider to handle message.
+ */
+ @Override
+ protected ILabelProvider getLabelProvider() {
+ return new LabelProvider() {
+
+ @Override
+ public String getText(Object object) {
+ if (object instanceof IHintedType) {
+ IHintedType elementType = (IHintedType) object;
+ switch (UMLVisualIDRegistry.getVisualID(elementType.getSemanticHint())) {
+ case MessageSyncEditPart.VISUAL_ID:
+ return Messages.MessageSync1CreationTool_title;
+ case MessageAsyncEditPart.VISUAL_ID:
+ return Messages.MessageAsync2CreationTool_title;
+ case MessageReplyEditPart.VISUAL_ID:
+ return Messages.MessageReply3CreationTool_title;
+ case MessageCreateEditPart.VISUAL_ID:
+ return Messages.MessageCreate4CreationTool_title;
+ case MessageDeleteEditPart.VISUAL_ID:
+ return Messages.MessageDelete5CreationTool_title;
+ case MessageLostEditPart.VISUAL_ID:
+ return Messages.MessageLost6CreationTool_title;
+ case MessageFoundEditPart.VISUAL_ID:
+ return Messages.MessageFound7CreationTool_title;
+ }
+ }
+ return super.getText(object);
+ }
+ };
+ }
+ }
+
+ @Override
+ public EditPart getTargetEditPart(Request request) {
+ if (REQ_CONNECTION_START.equals(request.getType()) || REQ_CONNECTION_END.equals(request.getType()) || REQ_RECONNECT_SOURCE.equals(request.getType()) || REQ_RECONNECT_TARGET.equals(request.getType())) {
+ EditPart host = getHost();
+ if (request instanceof CreateConnectionRequest) {
+ if (host instanceof InteractionEditPart) {
+ if (REQ_CONNECTION_END.equals(request.getType()) && isCreateConnectionRequest(request, UMLElementTypes.Message_LostEdge)) {
+ return host;
+ }
+ if (REQ_CONNECTION_START.equals(request.getType()) && isCreateConnectionRequest(request, UMLElementTypes.Message_FoundEdge)) {
+ return host;
+ }
+ InteractionEditPart interactionPart = (InteractionEditPart) host;
+ if (!touchesInteractionBounds(interactionPart, ((CreateConnectionRequest) request).getLocation())) {
+ return null;
+ }
+ } else if (host instanceof InteractionOperandEditPart) {
+ return null;
+ } else if (host instanceof InteractionFragmentEditPart) {
+ CreateConnectionRequest req = (CreateConnectionRequest) request;
+ Point location = req.getLocation().getCopy();
+ // if mouse location is far from border, do not handle connection event
+ if (!touchesInteractionBounds((GraphicalEditPart) host, location)) {
+ return null;
+ }
+ }
+ } else if (request instanceof ReconnectRequest) {
+ if (host instanceof InteractionEditPart) {
+ ConnectionEditPart conn = ((ReconnectRequest) request).getConnectionEditPart();
+ Object model = conn.getModel();
+ if (model instanceof View) {
+ if (REQ_RECONNECT_TARGET.equals(request.getType()) && UMLVisualIDRegistry.getVisualID((View) model).equals(MessageLostEditPart.VISUAL_ID)) {
+ return host;
+ }
+ if (REQ_RECONNECT_SOURCE.equals(request.getType()) && UMLVisualIDRegistry.getVisualID((View) model).equals(MessageFoundEditPart.VISUAL_ID)) {
+ return host;
+ }
+ }
+ InteractionEditPart interactionEditPart = (InteractionEditPart) getHost();
+ if (!touchesInteractionBounds(interactionEditPart, ((ReconnectRequest) request).getLocation())) {
+ return null;
+ }
+ } else if (host instanceof InteractionOperandEditPart) {
+ return null;
+ } else if (host instanceof InteractionFragmentEditPart) {
+ Point location = ((ReconnectRequest) request).getLocation().getCopy();
+ // if mouse location is far from border, do not handle connection event
+ if (!touchesInteractionBounds((GraphicalEditPart) host, location)) {
+ return null;
+ }
+ }
+ }
+ return host;
+ }
+ return null;
+ }
+
+ private boolean touchesInteractionBounds(GraphicalEditPart interaction, Point location) {
+ Point p = location.getCopy();
+ IFigure figure = interaction.getFigure();
+ figure.translateToRelative(p);
+ // if mouse location is far from border, do not handle connection event
+ Rectangle r = figure.getBounds().getCopy();
+ Rectangle innerRetangle = r.getShrinked(20, 20);
+ if (innerRetangle.contains(p)) {
+ return false;
+ }
+ return r.getExpanded(1, 1).contains(p);
+ }
+
+ protected boolean isCreateConnectionRequest(Request request, IElementType type) {
+ if (request instanceof CreateAspectUnspecifiedTypeConnectionRequest) {
+ List types = ((CreateUnspecifiedTypeConnectionRequest) request).getElementTypes();
+ if (types.contains(type)) {
+ return true;
+ }
+ }
+ if (request instanceof CreateConnectionViewRequest) {
+ String requestHint = ((CreateConnectionViewRequest) request).getConnectionViewDescriptor().getSemanticHint();
+ if (((IHintedType) type).getSemanticHint().equals(requestHint)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ protected ConnectionRouter getDummyConnectionRouter(CreateConnectionRequest req) {
+ if (req.getSourceEditPart() instanceof InteractionEditPart || req.getSourceEditPart() instanceof CombinedFragmentEditPart) {
+ return ConnectionRouter.NULL;
+ }
+ return super.getDummyConnectionRouter(req);
+ }
+
+ /**
+ * A new point class which can hold the location of the viewpoint. The user can use adjustToFitNewViewport() service to get the correctly point in
+ * given viewport.
+ *
+ * @author Jin Liu
+ */
+ private static class PointEx extends Point {
+
+ private static final long serialVersionUID = -3049675238350676816L;
+
+ private Point viewportLocation;
+
+ public PointEx(Point pt) {
+ super(pt);
+ }
+
+ public void setViewportLocation(Point p) {
+ if (p != null) {
+ viewportLocation = p.getCopy();
+ }
+ }
+
+ public Point adjustToFitNewViewport(Point newViewportLoc) {
+ Point pt = getCopy();
+ if (newViewportLoc != null && viewportLocation != null && !newViewportLoc.equals(viewportLocation)) {
+ pt.x += (viewportLocation.x - newViewportLoc.x);
+ pt.y += (viewportLocation.y - newViewportLoc.y);
+ }
+ return pt;
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ObservationLinkPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ObservationLinkPolicy.java
index 5ff5aefb851..5fad87c3488 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ObservationLinkPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ObservationLinkPolicy.java
@@ -343,7 +343,7 @@ public class ObservationLinkPolicy extends GraphicalNodeEditPolicy {
}
Map<String, Object> extendedData = request.getExtendedData();
// assign the occurrence specification
- Object paramOcc1 = extendedData.get(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION);
+ Object paramOcc1 = extendedData.get(org.eclipse.papyrus.uml.service.types.utils.SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION);
Object paramOcc2 = extendedData.get(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2);
if (paramOcc1 != null && paramOcc2 != null) {
events.add((OccurrenceSpecification) paramOcc1);
@@ -361,13 +361,13 @@ public class ObservationLinkPolicy extends GraphicalNodeEditPolicy {
View view = (View) messageEP.getModel();
Message message = (Message) view.getElement();
if (message.getSendEvent() != null) {
- extendedData.put(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION, message.getSendEvent());
+ extendedData.put(org.eclipse.papyrus.uml.service.types.utils.SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION, message.getSendEvent());
}
if (message.getReceiveEvent() != null) {
extendedData.put(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2, message.getReceiveEvent());
}
}
- if (extendedData.containsKey(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION) && extendedData.containsKey(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2)) {
+ if (extendedData.containsKey(org.eclipse.papyrus.uml.service.types.utils.SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION) && extendedData.containsKey(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2)) {
return true;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/SequenceGraphicalNodeEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/SequenceGraphicalNodeEditPolicy.java
index bca749d9d21..e69de29bb2d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/SequenceGraphicalNodeEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/SequenceGraphicalNodeEditPolicy.java
@@ -1,710 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.eclipse.draw2d.Connection;
-import org.eclipse.draw2d.ConnectionAnchor;
-import org.eclipse.draw2d.ConnectionRouter;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Polyline;
-import org.eclipse.draw2d.Viewport;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.PointList;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.ConnectionEditPart;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.requests.CreateConnectionRequest;
-import org.eclipse.gef.requests.ReconnectRequest;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.core.commands.SetConnectionAnchorsCommand;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.INodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.GraphicalNodeEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.internal.commands.SetConnectionBendpointsCommand;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewAndElementRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewAndElementRequest.ConnectionViewAndElementDescriptor;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeConnectionRequest;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.papyrus.infra.gmfdiag.common.service.palette.AspectUnspecifiedTypeConnectionTool.CreateAspectUnspecifiedTypeConnectionRequest;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CustomCombinedFragment2EditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CustomLifelineEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionFragmentEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionOperandEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.part.Messages;
-import org.eclipse.papyrus.uml.diagram.sequence.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-import org.eclipse.papyrus.uml.diagram.sequence.util.FragmentsOrdererHelper;
-import org.eclipse.papyrus.uml.diagram.sequence.util.LifelineMessageCreateHelper;
-import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceRequestConstant;
-import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceUtil;
-import org.eclipse.papyrus.uml.diagram.stereotype.edition.editpart.AppliedStereotypesCommentLinkEditPart;
-import org.eclipse.uml2.uml.Message;
-import org.eclipse.uml2.uml.OccurrenceSpecification;
-
-/**
- * A specific policy to handle the message :
- * - Message cannot be uphill.
- * - Message Occurrence Specification which are created along the message may have a different container than the message.
- * - Message feedback on creation is always drawn in black (to avoid invisible feedback)
- *
- */
-@SuppressWarnings({ "restriction", "unchecked", "rawtypes" })
-public class SequenceGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
-
- /** A static margin to allow drawing of straight message */
- private static final int MARGIN = 2;
-
- /**
- * Gets the command to start the creation of a new connection and relationship. This will update the request appropriately. Also completes the
- * request with nearby occurrence specification information.
- *
- * @param request
- * creation request
- * @return Command
- */
- @Override
- protected Command getConnectionAndRelationshipCreateCommand(CreateConnectionViewAndElementRequest request) {
- Map<String, Object> extendedData = request.getExtendedData();
- // record the nearest event if necessary
- String requestHint = request.getConnectionViewAndElementDescriptor().getSemanticHint();
- if (isCreatedNearOccurrenceSpecification(requestHint) || isOnOccerrenceSpecification(request.getLocation())) {
- LifelineEditPart lifelinePart = SequenceUtil.getParentLifelinePart(getHost());
- if (lifelinePart != null) {
- Entry<Point, List<OccurrenceSpecification>> eventAndLocation = SequenceUtil.findNearestEvent(request.getLocation(), lifelinePart);
- // find an event near enough to create the constraint or observation
- List<OccurrenceSpecification> events = Collections.emptyList();
- Point location = null;
- if (eventAndLocation != null) {
- location = eventAndLocation.getKey();
- events = eventAndLocation.getValue();
- }
- extendedData.put(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION, events);
- extendedData.put(SequenceRequestConstant.OCCURRENCE_SPECIFICATION_LOCATION, location);
- if (location != null) {
- request.setLocation(location);
- }
- }
- }
- return super.getConnectionAndRelationshipCreateCommand(request);
- }
-
- private boolean isOnOccerrenceSpecification(Point location) {
- EditPart editPart = getHost().getViewer().findObjectAt(location);
- if (editPart == null) {
- return false;
- }
- Object model = editPart.getModel();
- if (model instanceof View) {
- return (ViewUtil.resolveSemanticElement((View) model) instanceof OccurrenceSpecification);
- }
- return false;
- }
-
- /**
- * Gets the command to complete the creation of a new connection and relationship. Also completes the request with nearby occurrence specification
- * information.
- *
- * @param request
- * the creation request
- * @return Command
- */
- @Override
- protected Command getConnectionAndRelationshipCompleteCommand(CreateConnectionViewAndElementRequest request) {
- Map<String, Object> extendedData = request.getExtendedData();
- // record the nearest event if necessary
- String requestHint = request.getConnectionViewAndElementDescriptor().getSemanticHint();
- if (isCreatedNearOccurrenceSpecification(requestHint) || isOnOccerrenceSpecification(request.getLocation())) {
- LifelineEditPart lifelinePart = SequenceUtil.getParentLifelinePart(getHost());
- if (lifelinePart != null) {
- Entry<Point, List<OccurrenceSpecification>> eventAndLocation = SequenceUtil.findNearestEvent(request.getLocation(), lifelinePart);
- // find an event near enough to create the constraint or observation
- List<OccurrenceSpecification> events = Collections.emptyList();
- Point location = null;
- if (eventAndLocation != null) {
- location = eventAndLocation.getKey();
- events = eventAndLocation.getValue();
- }
- extendedData.put(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2, events);
- extendedData.put(SequenceRequestConstant.OCCURRENCE_SPECIFICATION_LOCATION_2, location);
- if (location != null) {
- request.setLocation(location);
- }
- }
- }
- // Ordering message occurrence specifications after message creation, See https://bugs.eclipse.org/bugs/show_bug.cgi?id=403233
- Command command = super.getConnectionAndRelationshipCompleteCommand(request);
- if (command != null && command.canExecute()) {
- command = command.chain(FragmentsOrdererHelper.createOrderingFragmentsCommand(getHost(), request));
- }
- return command;
- }
-
- /**
- * Return true if creation must be performed to or from an occurrence specification
- *
- * @param requestHint
- * the hint of object to create
- * @return true if creation to or from an occurrence specification
- */
- private boolean isCreatedNearOccurrenceSpecification(String requestHint) {
- String generalOrderingHint = ((IHintedType) UMLElementTypes.GeneralOrdering_Edge).getSemanticHint();
- return generalOrderingHint.equals(requestHint);
- }
-
- /**
- * Return true if a message is being created
- *
- * @param requestHint
- * the hint of object to create
- * @return true if creation of a message
- */
- protected boolean isMessageHint(String requestHint) {
- List<String> messageHints = new ArrayList<String>(7);
- String messageHint = ((IHintedType) UMLElementTypes.Message_SynchEdge).getSemanticHint();
- messageHints.add(messageHint);
- messageHint = ((IHintedType) UMLElementTypes.Message_AsynchEdge).getSemanticHint();
- messageHints.add(messageHint);
- messageHint = ((IHintedType) UMLElementTypes.Message_ReplyEdge).getSemanticHint();
- messageHints.add(messageHint);
- messageHint = ((IHintedType) UMLElementTypes.Message_CreateEdge).getSemanticHint();
- messageHints.add(messageHint);
- messageHint = ((IHintedType) UMLElementTypes.Message_DeleteEdge).getSemanticHint();
- messageHints.add(messageHint);
- messageHint = ((IHintedType) UMLElementTypes.Message_LostEdge).getSemanticHint();
- messageHints.add(messageHint);
- messageHint = ((IHintedType) UMLElementTypes.Message_FoundEdge).getSemanticHint();
- messageHints.add(messageHint);
- return messageHints.contains(requestHint);
- }
-
- @Override
- protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
- // move source point to the bottom if it is contained in LifelineNameContainerFigure
- EditPart targetEditPart = request.getTargetEditPart();
- if (targetEditPart != null && targetEditPart instanceof LifelineEditPart) {
- LifelineEditPart target = (LifelineEditPart) targetEditPart;
- if (target.getPrimaryShape() != null) {
- Rectangle sourceBounds = target.getPrimaryShape().getFigureLifelineNameContainerFigure().getBounds().getCopy();
- Point sourcePointCopy = request.getLocation().getCopy();
- target.getFigure().translateToRelative(sourcePointCopy);
- if (sourcePointCopy.y() < sourceBounds.getBottom().y()) {
- target.getFigure().translateToAbsolute(sourceBounds);
- request.getLocation().setY(sourceBounds.getBottom().y() + 1);
- }
- }
- }
- /**
- * Sometime, the viewport would be scrolled when drag to select the target of connection by using AutoexposeHelper. We need to adjust the
- * source
- * location if needed.
- */
- PointEx sourcePoint = new PointEx(request.getLocation());
- Viewport vp = findViewport((GraphicalEditPart) getHost().getViewer().getRootEditPart());
- if (vp != null) {
- Point loc1 = vp.getClientArea().getLocation().getCopy();
- sourcePoint.setViewportLocation(loc1);
- }
- request.getExtendedData().put(SequenceRequestConstant.SOURCE_LOCATION_DATA, sourcePoint);
- // Safely calculate the source model container here.
- request.getExtendedData().put(SequenceRequestConstant.SOURCE_MODEL_CONTAINER, SequenceUtil.findInteractionFragmentContainerAt(sourcePoint, getHost()));
- return super.getConnectionCreateCommand(request);
- }
-
- protected Viewport findViewport(GraphicalEditPart part) {
- IFigure figure = null;
- Viewport port = null;
- do {
- if (figure == null) {
- figure = part.getContentPane();
- } else {
- figure = figure.getParent();
- }
- if (figure instanceof Viewport) {
- port = (Viewport) figure;
- break;
- }
- } while (figure != part.getFigure() && figure != null);
- return port;
- }
-
- /**
- * Overrides to disable uphill message
- */
- @Override
- protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
- Command command = super.getConnectionCompleteCommand(request);
- if (command == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // disable the following code if we are not creating a message.
- String requestHint = null;
- if (request instanceof CreateConnectionViewRequest) {
- requestHint = ((CreateConnectionViewRequest) request).getConnectionViewDescriptor().getSemanticHint();
- if (!isMessageHint(requestHint)) {
- return command;
- }
- }
- // ICommandProxy proxy = (ICommandProxy)request.getStartCommand();
- // CompositeCommand cc = (CompositeCommand)proxy.getICommand();
- // Iterator<?> commandItr = cc.iterator();
- // while(commandItr.hasNext()) {
- // Object obj = commandItr.next();
- // if(obj instanceof SetConnectionBendpointsCommand) {
- // SetConnectionBendpointsCommand sbbCommand = (SetConnectionBendpointsCommand)obj;
- // final PointList pointList = sbbCommand.getNewPointList();
- Point sourcePoint = (Point) request.getExtendedData().get(SequenceRequestConstant.SOURCE_LOCATION_DATA);
- Point targetPoint = request.getLocation();
- // Adjust source location to current coordinate system (the viewport may be scrolled by AutoexposeHelper.).
- if (sourcePoint instanceof PointEx) {
- Viewport vp = findViewport((GraphicalEditPart) getHost().getViewer().getRootEditPart());
- if (vp != null) {
- Point loc2 = vp.getClientArea().getLocation();
- sourcePoint = ((PointEx) sourcePoint).adjustToFitNewViewport(loc2);
- }
- }
- // prevent uphill message (leave margin for horizontal messages)
- boolean messageCreate = ((IHintedType) UMLElementTypes.Message_CreateEdge).getSemanticHint().equals(requestHint);
- if (sourcePoint == null || sourcePoint.y >= targetPoint.y + MARGIN) {
- if (!messageCreate && !isLostFoundMessage(requestHint)) {
- return UnexecutableCommand.INSTANCE;
- }
- }
- // prevent uphill message (for self recursive message)
- if (request.getSourceEditPart().equals(request.getTargetEditPart()) && sourcePoint.y >= targetPoint.y) {
- return UnexecutableCommand.INSTANCE;
- }
- // prevent uphill message (for reply message)
- if (request instanceof CreateConnectionViewAndElementRequest) {
- ConnectionViewAndElementDescriptor desc = ((CreateConnectionViewAndElementRequest) request).getConnectionViewAndElementDescriptor();
- String replyHint = ((IHintedType) UMLElementTypes.Message_ReplyEdge).getSemanticHint();
- if (replyHint.equals(desc.getSemanticHint()) && request.getSourceEditPart() instanceof IGraphicalEditPart) {
- Rectangle srcBounds = SequenceUtil.getAbsoluteBounds((IGraphicalEditPart) request.getSourceEditPart());
- int bottom = srcBounds.getBottom().y;
- if (bottom >= targetPoint.y + MARGIN) {
- return UnexecutableCommand.INSTANCE;
- }
- }
- }
- // prevent duplicate create link
- if (messageCreate && request.getSourceEditPart() != null && request.getTargetEditPart() != null) {
- if (LifelineMessageCreateHelper.hasMessageCreate((GraphicalEditPart) request.getSourceEditPart(), request.getTargetEditPart())) {
- return UnexecutableCommand.INSTANCE;
- }
- }
- // The SOURCE MODEL should be calculated when connection started, the scroll bar maybe already changed when connection come to finished.
- // request.getExtendedData().put(SequenceRequestConstant.SOURCE_MODEL_CONTAINER, SequenceUtil.findInteractionFragmentContainerAt(sourcePoint, getHost()));
- request.getExtendedData().put(SequenceRequestConstant.TARGET_MODEL_CONTAINER, SequenceUtil.findInteractionFragmentContainerAt(targetPoint, getHost()));
- // In case we are creating a connection to/from a CoRegion, we will need the lifeline element where is drawn the CoRegion later in the process.
- EditPart targetEditPart = getTargetEditPart(request);
- if (targetEditPart instanceof CustomCombinedFragment2EditPart) {
- request.getExtendedData().put(SequenceRequestConstant.LIFELINE_GRAPHICAL_CONTAINER, ((CustomCombinedFragment2EditPart) targetEditPart).getAttachedLifeline());
- }
- // update bendpoints for self link message.
- if (connectionFeedback != null && ((IHintedType) UMLElementTypes.Message_AsynchEdge).getSemanticHint().equals(requestHint)) {
- updateConnectionBendpoints(request, command);
- }
- // change constraint of the target lifeline after added a Create Message
- if (request.getTargetEditPart() instanceof LifelineEditPart && !(request.getSourceEditPart().equals(request.getTargetEditPart()))) {
- if (requestHint.equals((((IHintedType) UMLElementTypes.Message_CreateEdge).getSemanticHint()))) {
- CustomLifelineEditPart target = (CustomLifelineEditPart) request.getTargetEditPart();
- command = LifelineMessageCreateHelper.moveLifelineDown(command, target, sourcePoint.getCopy());
- }
- }
- return command;
- }
-
- /**
- * Update bendpoints when creating self message with the feedback, so that, the message can be created like feedback,
- */
- private void updateConnectionBendpoints(CreateConnectionRequest request, Command command) {
- if (connectionFeedback == null || connectionFeedback.getPoints().size() < 4) {
- return;
- }
- if (!(command instanceof ICommandProxy)) {
- return;
- }
- ICommand iCommand = ((ICommandProxy) command).getICommand();
- if (!(iCommand instanceof CompositeCommand)) {
- return;
- }
- INodeEditPart targetEP = getConnectionCompleteEditPart(request);
- if (targetEP == null) {
- return;
- }
- LifelineEditPart sourceLifeline = getLifeline(request.getSourceEditPart());
- LifelineEditPart targetLifeline = getLifeline(request.getTargetEditPart());
- boolean isSelfLink = sourceLifeline != null && sourceLifeline.equals(targetLifeline);
- if (!isSelfLink) {
- return;
- }
- CompositeCommand cc = (CompositeCommand) iCommand;
- SetConnectionAnchorsCommand scaCommand = null;
- SetConnectionBendpointsCommand sbbCommand = null;
- Iterator it = cc.iterator();
- while (it.hasNext()) {
- Object next = it.next();
- if (next instanceof SetConnectionBendpointsCommand) {
- sbbCommand = (SetConnectionBendpointsCommand) next;
- } else if (next instanceof SetConnectionAnchorsCommand) {
- scaCommand = (SetConnectionAnchorsCommand) next;
- }
- if (sbbCommand != null && scaCommand != null) {
- break;
- }
- }
- if (sbbCommand == null || scaCommand == null) {
- return;
- }
- ConnectionAnchor targetAnchor = targetEP.getTargetConnectionAnchor(request);
- INodeEditPart sourceEditPart = (INodeEditPart) request.getSourceEditPart();
- ConnectionAnchor sourceAnchor = sourceEditPart.mapTerminalToConnectionAnchor(scaCommand.getNewSourceTerminal());
- PointList pointList = connectionFeedback.getPoints().getCopy();
- connectionFeedback.translateToAbsolute(pointList);
- sbbCommand.setNewPointList(pointList, sourceAnchor.getReferencePoint(), targetAnchor.getReferencePoint());
- }
-
- private LifelineEditPart getLifeline(EditPart editPart) {
- if (editPart == null) {
- return null;
- }
- if (editPart instanceof LifelineEditPart) {
- return (LifelineEditPart) editPart;
- }
- return getLifeline(editPart.getParent());
- }
-
- /**
- * Override to disable uphill message
- */
- @Override
- protected Command getReconnectSourceCommand(ReconnectRequest request) {
- if (isUphillMessage(request) && !isLostFoundMessage(request)) {
- return UnexecutableCommand.INSTANCE;
- }
- // prevent duplicate link
- if (request.getConnectionEditPart() instanceof MessageCreateEditPart && request.getTarget() != null && !LifelineMessageCreateHelper.canReconnectMessageCreate(request)) {
- return UnexecutableCommand.INSTANCE;
- }
- // Avoid to reconnect AppliedStereotypesCommentLink to another EditPart.
- ConnectionEditPart connection = request.getConnectionEditPart();
- if (connection instanceof AppliedStereotypesCommentLinkEditPart) {
- if (connection.getSource() != getConnectableEditPart()) {
- return UnexecutableCommand.INSTANCE;
- }
- }
- Command command = super.getReconnectSourceCommand(request);
- // //Ordering message occurrence specifications after message reconnected, See https://bugs.eclipse.org/bugs/show_bug.cgi?id=403233
- if (command != null && command.canExecute()) {
- command = command.chain(FragmentsOrdererHelper.createOrderingFragmentsCommand(getHost(), request));
- }
- return command;
- }
-
- private boolean isLostFoundMessage(ReconnectRequest request) {
- ConnectionEditPart connectionEditPart = request.getConnectionEditPart();
- if (connectionEditPart instanceof MessageFoundEditPart || connectionEditPart instanceof MessageLostEditPart) {
- return true;
- }
- return false;
- }
-
- private boolean isLostFoundMessage(String requestHint) {
- if (((IHintedType) UMLElementTypes.Message_LostEdge).getSemanticHint().equals(requestHint) || ((IHintedType) UMLElementTypes.Message_FoundEdge).getSemanticHint().equals(requestHint)) {
- return true;
- }
- return false;
- }
-
- /**
- * Override to disable uphill message
- */
- @Override
- protected Command getReconnectTargetCommand(ReconnectRequest request) {
- if (isUphillMessage(request) && !isLostFoundMessage(request)) {
- return UnexecutableCommand.INSTANCE;
- }
- // prevent duplicate link
- if (request.getConnectionEditPart() instanceof MessageCreateEditPart && request.getTarget() != null && !LifelineMessageCreateHelper.canReconnectMessageCreate(request)) {
- return UnexecutableCommand.INSTANCE;
- }
- Command command = super.getReconnectTargetCommand(request);
- // Ordering message occurrence specifications after message reconnected, See https://bugs.eclipse.org/bugs/show_bug.cgi?id=403233
- if (command != null && command.canExecute()) {
- command = command.chain(FragmentsOrdererHelper.createOrderingFragmentsCommand(getHost(), request));
- }
- return command;
- }
-
- /**
- * Check that a message doesn't have its target point above its source point
- *
- * @param request
- * the ReconnectRequest
- * @return true if the target point is above the source point
- */
- protected boolean isUphillMessage(ReconnectRequest request) {
- ConnectionEditPart connectionEditPart = request.getConnectionEditPart();
- if (connectionEditPart.getModel() instanceof Edge) {
- Edge edge = (Edge) connectionEditPart.getModel();
- if (edge.getElement() instanceof Message) {
- if (connectionEditPart.getFigure() instanceof Polyline) {
- // get connection end points translated to absolute
- Polyline polyline = (Polyline) connectionEditPart.getFigure();
- Point end = polyline.getEnd().getCopy();
- Point start = polyline.getStart().getCopy();
- polyline.getParent().translateToAbsolute(end);
- polyline.getParent().translateToAbsolute(start);
- // look at the request rather than at both polyline ends which may not be up to date
- if (REQ_RECONNECT_SOURCE.equals(request.getType())) {
- return request.getLocation().y >= end.y + MARGIN;
- } else if (REQ_RECONNECT_TARGET.equals(request.getType())) {
- return start.y >= request.getLocation().y + MARGIN;
- } else {
- return start.y >= end.y + MARGIN;
- }
- }
- }
- }
- return false;
- }
-
- /**
- * Overrides to set the color of the dummyConnection to color black.
- * This allow to see the feedback of the connection when it is created.
- * By default, the color was the foreground color of the lifeline, which is always blank leading to an invisible feedback.
- *
- */
- @Override
- protected Connection createDummyConnection(Request req) {
- Connection conn = super.createDummyConnection(req);
- conn.setForegroundColor(org.eclipse.draw2d.ColorConstants.black);
- return conn;
- }
-
- /**
- * Gets a command that pops up a menu which allows the user to select which
- * type of connection to be created and then creates the connection.
- *
- * @param content
- * The list of items making up the content of the popup menu.
- * @param request
- * The relevant create connection request.
- * @return the command to popup up the menu and create the connection
- */
- @Override
- protected ICommand getPromptAndCreateConnectionCommand(List content, CreateConnectionRequest request) {
- return new SequencePromptAndCreateConnectionCommand(content, request);
- }
-
- /**
- * Extends {@link PromptAndCreateConnectionCommand} to specify the type of message that can be selected.
- */
- protected class SequencePromptAndCreateConnectionCommand extends PromptAndCreateConnectionCommand {
-
- /**
- * @see {@link PromptAndCreateConnectionCommand#PromptAndCreateConnectionCommand(List, CreateConnectionRequest)}
- */
- public SequencePromptAndCreateConnectionCommand(List content, CreateConnectionRequest request) {
- super(content, request);
- }
-
- /**
- * Defines a specific label provider to handle message.
- */
- @Override
- protected ILabelProvider getLabelProvider() {
- return new LabelProvider() {
-
- @Override
- public String getText(Object object) {
- if (object instanceof IHintedType) {
- IHintedType elementType = (IHintedType) object;
- switch (UMLVisualIDRegistry.getVisualID(elementType.getSemanticHint())) {
- case MessageSyncEditPart.VISUAL_ID:
- return Messages.MessageSync2CreationTool_title;
- case MessageAsyncEditPart.VISUAL_ID:
- return Messages.MessageAsync3CreationTool_title;
- case MessageReplyEditPart.VISUAL_ID:
- return Messages.MessageReply4CreationTool_title;
- case MessageCreateEditPart.VISUAL_ID:
- return Messages.MessageCreate5CreationTool_title;
- case MessageDeleteEditPart.VISUAL_ID:
- return Messages.MessageDelete6CreationTool_title;
- case MessageLostEditPart.VISUAL_ID:
- return Messages.MessageLost7CreationTool_title;
- case MessageFoundEditPart.VISUAL_ID:
- return Messages.MessageFound8CreationTool_title;
- }
- }
- return super.getText(object);
- }
- };
- }
- }
-
- @Override
- public EditPart getTargetEditPart(Request request) {
- if (REQ_CONNECTION_START.equals(request.getType()) || REQ_CONNECTION_END.equals(request.getType()) || REQ_RECONNECT_SOURCE.equals(request.getType()) || REQ_RECONNECT_TARGET.equals(request.getType())) {
- EditPart host = getHost();
- if (request instanceof CreateConnectionRequest) {
- if (host instanceof InteractionEditPart) {
- if (REQ_CONNECTION_END.equals(request.getType()) && isCreateConnectionRequest(request, UMLElementTypes.Message_LostEdge)) {
- return host;
- }
- if (REQ_CONNECTION_START.equals(request.getType()) && isCreateConnectionRequest(request, UMLElementTypes.Message_FoundEdge)) {
- return host;
- }
- InteractionEditPart interactionPart = (InteractionEditPart) host;
- if (!touchesInteractionBounds(interactionPart, ((CreateConnectionRequest) request).getLocation())) {
- return null;
- }
- } else if (host instanceof InteractionOperandEditPart) {
- return null;
- } else if (host instanceof InteractionFragmentEditPart) {
- CreateConnectionRequest req = (CreateConnectionRequest) request;
- Point location = req.getLocation().getCopy();
- // if mouse location is far from border, do not handle connection event
- if (!touchesInteractionBounds((GraphicalEditPart) host, location)) {
- return null;
- }
- }
- } else if (request instanceof ReconnectRequest) {
- if (host instanceof InteractionEditPart) {
- ConnectionEditPart conn = ((ReconnectRequest) request).getConnectionEditPart();
- Object model = conn.getModel();
- if (model instanceof View) {
- if (REQ_RECONNECT_TARGET.equals(request.getType()) && UMLVisualIDRegistry.getVisualID((View) model).equals(MessageLostEditPart.VISUAL_ID)) {
- return host;
- }
- if (REQ_RECONNECT_SOURCE.equals(request.getType()) && UMLVisualIDRegistry.getVisualID((View) model).equals(MessageFoundEditPart.VISUAL_ID)) {
- return host;
- }
- }
- InteractionEditPart interactionEditPart = (InteractionEditPart) getHost();
- if (!touchesInteractionBounds(interactionEditPart, ((ReconnectRequest) request).getLocation())) {
- return null;
- }
- } else if (host instanceof InteractionOperandEditPart) {
- return null;
- } else if (host instanceof InteractionFragmentEditPart) {
- Point location = ((ReconnectRequest) request).getLocation().getCopy();
- // if mouse location is far from border, do not handle connection event
- if (!touchesInteractionBounds((GraphicalEditPart) host, location)) {
- return null;
- }
- }
- }
- return host;
- }
- return null;
- }
-
- private boolean touchesInteractionBounds(GraphicalEditPart interaction, Point location) {
- Point p = location.getCopy();
- IFigure figure = interaction.getFigure();
- figure.translateToRelative(p);
- // if mouse location is far from border, do not handle connection event
- Rectangle r = figure.getBounds().getCopy();
- Rectangle innerRetangle = r.getShrinked(20, 20);
- if (innerRetangle.contains(p)) {
- return false;
- }
- return r.getExpanded(1, 1).contains(p);
- }
-
- protected boolean isCreateConnectionRequest(Request request, IElementType type) {
- if (request instanceof CreateAspectUnspecifiedTypeConnectionRequest) {
- List types = ((CreateUnspecifiedTypeConnectionRequest) request).getElementTypes();
- if (types.contains(type)) {
- return true;
- }
- }
- if (request instanceof CreateConnectionViewRequest) {
- String requestHint = ((CreateConnectionViewRequest) request).getConnectionViewDescriptor().getSemanticHint();
- if (((IHintedType) type).getSemanticHint().equals(requestHint)) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- protected ConnectionRouter getDummyConnectionRouter(CreateConnectionRequest req) {
- if (req.getSourceEditPart() instanceof InteractionEditPart || req.getSourceEditPart() instanceof CombinedFragmentEditPart) {
- return ConnectionRouter.NULL;
- }
- return super.getDummyConnectionRouter(req);
- }
-
- /**
- * A new point class which can hold the location of the viewpoint. The user can use adjustToFitNewViewport() service to get the correctly point in
- * given viewport.
- *
- * @author Jin Liu
- */
- private static class PointEx extends Point {
-
- private static final long serialVersionUID = -3049675238350676816L;
-
- private Point viewportLocation;
-
- public PointEx(Point pt) {
- super(pt);
- }
-
- public void setViewportLocation(Point p) {
- if (p != null) {
- viewportLocation = p.getCopy();
- }
- }
-
- public Point adjustToFitNewViewport(Point newViewportLoc) {
- Point pt = getCopy();
- if (newViewportLoc != null && viewportLocation != null && !newViewportLoc.equals(viewportLocation)) {
- pt.x += (viewportLocation.x - newViewportLoc.x);
- pt.y += (viewportLocation.y - newViewportLoc.y);
- }
- return pt;
- }
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomActionExecutionSpecificationItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomActionExecutionSpecificationItemSemanticEditPolicy.java
deleted file mode 100644
index 80034b625b9..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomActionExecutionSpecificationItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomGeneralOrderingCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.GeneralOrderingReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.GeneralOrderingEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.ActionExecutionSpecificationItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.ExecutionSpecificationComponentEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceDeleteHelper;
-import org.eclipse.uml2.uml.ExecutionSpecification;
-import org.eclipse.uml2.uml.OccurrenceSpecification;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomActionExecutionSpecificationItemSemanticEditPolicy extends ActionExecutionSpecificationItemSemanticEditPolicy {
-
- /**
- * @Override
- */
- @Override
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- CompoundCommand deleteElementsCommand = new CompoundCommand();
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if (provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
- if (deleteCommand != null) {
- deleteElementsCommand.add(new ICommandProxy(deleteCommand));
- if (selectedEObject instanceof ExecutionSpecification && getHost() instanceof ShapeNodeEditPart) {
- SequenceDeleteHelper.destroyExecutionOccurrenceSpecification(req, deleteElementsCommand, (ShapeNodeEditPart) getHost(), (ExecutionSpecification) selectedEObject);
- }
- }
- }
- if (deleteElementsCommand.size() > 0) {
- return deleteElementsCommand;
- }
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * This method has been overridden to also delete linked time/duration views
- *
- * @Override
- */
- @Override
- protected Command addDeleteViewCommand(Command mainCommand, DestroyRequest completedRequest) {
- CompoundCommand deleteViewsCommand = new CompoundCommand();
- Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View) getHost().getModel()));
- deleteViewsCommand.add(deleteViewCommand);
- SequenceDeleteHelper.completeDeleteExecutionSpecificationViewCommand(deleteViewsCommand, getEditingDomain(), getHost());
- ExecutionSpecificationComponentEditPolicy.addDeleteViewChildrenCommand(deleteViewsCommand, getEditingDomain(), (ShapeNodeEditPart) getHost());
- if (mainCommand == null) {
- return deleteViewsCommand;
- } else {
- return mainCommand.chain(deleteViewsCommand);
- }
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @Override
- * (update at each lifeline modification) add general ordering
- */
- @Override
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return null;
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return null;
- }
- // add general ordering
- if (UMLElementTypes.GeneralOrdering_Edge == req.getElementType()) {
- return getGEFWrapper(new CustomGeneralOrderingCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @Override
- * (update at each lifeline modification) add general ordering
- */
- @Override
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- // add general ordering
- if (UMLElementTypes.GeneralOrdering_Edge == req.getElementType()) {
- return getGEFWrapper(new CustomGeneralOrderingCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source should be the domain
- * model element associated with this node.
- *
- * @Override
- * (update at each lifeline modification) add general ordering
- */
- @Override
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch (getVisualID(req)) {
- case MessageSyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessageReorientCommand(req));
- case MessageAsyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage2ReorientCommand(req));
- case MessageReplyEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage3ReorientCommand(req));
- case MessageCreateEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage4ReorientCommand(req));
- case MessageDeleteEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage5ReorientCommand(req));
- case MessageLostEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage6ReorientCommand(req));
- case MessageFoundEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- // add general ordering
- case GeneralOrderingEditPart.VISUAL_ID:
- if (req.getNewRelationshipEnd() instanceof OccurrenceSpecification) {
- return getGEFWrapper(new GeneralOrderingReorientCommand(req));
- } else {
- return null;
- }
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch (getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomBehaviorExecutionSpecificationItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomBehaviorExecutionSpecificationItemSemanticEditPolicy.java
deleted file mode 100644
index 19d025652ce..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomBehaviorExecutionSpecificationItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomGeneralOrderingCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.GeneralOrderingReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.GeneralOrderingEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.BehaviorExecutionSpecificationItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.ExecutionSpecificationComponentEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceDeleteHelper;
-import org.eclipse.uml2.uml.ExecutionSpecification;
-import org.eclipse.uml2.uml.OccurrenceSpecification;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomBehaviorExecutionSpecificationItemSemanticEditPolicy extends BehaviorExecutionSpecificationItemSemanticEditPolicy {
-
- /**
- * @Override
- */
- @Override
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- CompoundCommand deleteElementsCommand = new CompoundCommand();
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if (provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
- if (deleteCommand != null) {
- deleteElementsCommand.add(new ICommandProxy(deleteCommand));
- if (selectedEObject instanceof ExecutionSpecification && getHost() instanceof ShapeNodeEditPart) {
- SequenceDeleteHelper.destroyExecutionOccurrenceSpecification(req, deleteElementsCommand, (ShapeNodeEditPart) getHost(), (ExecutionSpecification) selectedEObject);
- }
- }
- }
- if (deleteElementsCommand.size() > 0) {
- return deleteElementsCommand;
- }
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * This method has been overridden to also delete linked time/duration views
- *
- * @Override
- */
- @Override
- protected Command addDeleteViewCommand(Command mainCommand, DestroyRequest completedRequest) {
- CompoundCommand deleteViewsCommand = new CompoundCommand();
- Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View) getHost().getModel()));
- deleteViewsCommand.add(deleteViewCommand);
- SequenceDeleteHelper.completeDeleteExecutionSpecificationViewCommand(deleteViewsCommand, getEditingDomain(), getHost());
- ExecutionSpecificationComponentEditPolicy.addDeleteViewChildrenCommand(deleteViewsCommand, getEditingDomain(), (ShapeNodeEditPart) getHost());
- if (mainCommand == null) {
- return deleteViewsCommand;
- } else {
- return mainCommand.chain(deleteViewsCommand);
- }
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @Override
- * (update at each lifeline modification) add general ordering
- */
- @Override
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return null;
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return null;
- }
- // add general ordering
- if (UMLElementTypes.GeneralOrdering_Edge == req.getElementType()) {
- return getGEFWrapper(new CustomGeneralOrderingCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @Override
- * (update at each lifeline modification) add general ordering
- */
- @Override
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- // add general ordering
- if (UMLElementTypes.GeneralOrdering_Edge == req.getElementType()) {
- return getGEFWrapper(new CustomGeneralOrderingCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source should be the domain
- * model element associated with this node.
- *
- * @Override
- * (update at each lifeline modification) add general ordering
- */
- @Override
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch (getVisualID(req)) {
- case MessageSyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessageReorientCommand(req));
- case MessageAsyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage2ReorientCommand(req));
- case MessageReplyEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage3ReorientCommand(req));
- case MessageCreateEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage4ReorientCommand(req));
- case MessageDeleteEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage5ReorientCommand(req));
- case MessageLostEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage6ReorientCommand(req));
- case MessageFoundEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- // add general ordering
- case GeneralOrderingEditPart.VISUAL_ID:
- if (req.getNewRelationshipEnd() instanceof OccurrenceSpecification) {
- return getGEFWrapper(new GeneralOrderingReorientCommand(req));
- } else {
- return null;
- }
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch (getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomCombinedFragment2ItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomCombinedFragment2ItemSemanticEditPolicy.java
deleted file mode 100644
index 884d36a1069..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomCombinedFragment2ItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomGeneralOrderingCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.GeneralOrderingReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.GeneralOrderingEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.CombinedFragment2ItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-import org.eclipse.uml2.uml.OccurrenceSpecification;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomCombinedFragment2ItemSemanticEditPolicy extends CombinedFragment2ItemSemanticEditPolicy {
-
- /**
- * @Override
- */
- @Override
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if (provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
- if (deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @Override
- * (update at each lifeline modification) add general ordering
- */
- @Override
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return null;
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return null;
- }
- // add general ordering
- if (UMLElementTypes.GeneralOrdering_Edge == req.getElementType()) {
- return getGEFWrapper(new CustomGeneralOrderingCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @Override
- * (update at each lifeline modification) add general ordering
- */
- @Override
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- // add general ordering
- if (UMLElementTypes.GeneralOrdering_Edge == req.getElementType()) {
- return getGEFWrapper(new CustomGeneralOrderingCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- * (update at each lifeline modification) add general ordering
- */
- @Override
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch (getVisualID(req)) {
- case MessageSyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessageReorientCommand(req));
- case MessageAsyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage2ReorientCommand(req));
- case MessageReplyEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage3ReorientCommand(req));
- case MessageCreateEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage4ReorientCommand(req));
- case MessageDeleteEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage5ReorientCommand(req));
- case MessageLostEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage6ReorientCommand(req));
- case MessageFoundEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- // add general ordering
- case GeneralOrderingEditPart.VISUAL_ID:
- if (req.getNewRelationshipEnd() instanceof OccurrenceSpecification) {
- return getGEFWrapper(new GeneralOrderingReorientCommand(req));
- } else {
- return null;
- }
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch (getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomCombinedFragmentCombinedFragmentCompartmentItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomCombinedFragmentCombinedFragmentCompartmentItemSemanticEditPolicy.java
deleted file mode 100644
index 6aed6fe1f3f..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomCombinedFragmentCombinedFragmentCompartmentItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomInteractionOperandCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.CombinedFragmentCombinedFragmentCompartmentItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-import org.eclipse.uml2.uml.CombinedFragment;
-import org.eclipse.uml2.uml.InteractionOperand;
-import org.eclipse.uml2.uml.InteractionOperatorKind;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomCombinedFragmentCombinedFragmentCompartmentItemSemanticEditPolicy extends CombinedFragmentCombinedFragmentCompartmentItemSemanticEditPolicy {
-
- /**
- * Generated not for limit InteractionOperand number. {@inheritDoc}
- *
- * @Override
- */
- @Override
- protected Command getCreateCommand(CreateElementRequest req) {
- if (UMLElementTypes.InteractionOperand_Shape == req.getElementType()) {
- CombinedFragment combinedFragment = getAssociatedCombinedFragment(req.getContainer());
- if (combinedFragment == null) {
- return UnexecutableCommand.INSTANCE;
- }
- // Set the container of the request to the combinedFragment.
- req.setContainer(combinedFragment);
- InteractionOperatorKind interactionOperator = combinedFragment.getInteractionOperator();
- EList<InteractionOperand> operands = combinedFragment.getOperands();
- if (interactionOperator != null
- && !operands.isEmpty()
- && (InteractionOperatorKind.OPT_LITERAL.equals(interactionOperator) || InteractionOperatorKind.LOOP_LITERAL.equals(interactionOperator) || InteractionOperatorKind.BREAK_LITERAL.equals(interactionOperator) || InteractionOperatorKind.NEG_LITERAL
- .equals(interactionOperator))) {
- return UnexecutableCommand.INSTANCE;
- }
- // make compound command
- CompoundCommand result = new CompoundCommand();
- Command cmd = getGEFWrapper(new CustomInteractionOperandCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- result.add(cmd);
- // append a command which notifies
- // Fixed bug: remove the notify dialog, see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=402977
- // Command notifyCmd = new Command() {
- //
- // @Override
- // public void execute() {
- // NotificationBuilder warning = NotificationBuilder.createAsyncPopup(CustomMessages.Warning_ResizeInteractionOperandTitle, NLS.bind(CustomMessages.Warning_ResizeInteractionOperandTxt, System.getProperty("line.separator")));
- // warning.run();
- // }
- //
- // @Override
- // public void undo() {
- // execute();
- // }
- // };
- // if(notifyCmd.canExecute()) {
- // result.add(notifyCmd);
- // }
- return result;
- }
- return super.getCreateCommand(req);
- }
-
- /**
- * Retrieve the combined fragment associated with the request.
- */
- private CombinedFragment getAssociatedCombinedFragment(EObject eObject) {
- CombinedFragment combinedFragment = null;
- if (eObject instanceof CombinedFragment) {
- return (CombinedFragment) eObject;
- } else if (eObject != null) {
- combinedFragment = getAssociatedCombinedFragment(eObject.eContainer());
- }
- return combinedFragment;
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomCombinedFragmentItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomCombinedFragmentItemSemanticEditPolicy.java
deleted file mode 100644
index 84bbea76a9e..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomCombinedFragmentItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.CombinedFragmentItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-import org.eclipse.papyrus.uml.diagram.sequence.util.CombinedFragmentDeleteHelper;
-import org.eclipse.uml2.uml.CombinedFragment;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomCombinedFragmentItemSemanticEditPolicy extends CombinedFragmentItemSemanticEditPolicy {
-
- /**
- * @Override
- */
- @Override
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if (provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
- if (deleteCommand != null) {
- if (selectedEObject instanceof CombinedFragment) {
- ICommand selectCmd = CombinedFragmentDeleteHelper.createDestroyElementCommand((CombinedFragment) selectedEObject, getEditingDomain(), provider, req, deleteCommand, (CombinedFragmentEditPart) getHost());
- return new ICommandProxy(selectCmd);
- } else {
- return new ICommandProxy(deleteCommand);
- }
- }
- return null;
- }
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return null;
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return null;
- }
- return null;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source should be the domain
- * model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch (getVisualID(req)) {
- case MessageSyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessageReorientCommand(req));
- case MessageAsyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage2ReorientCommand(req));
- case MessageReplyEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage3ReorientCommand(req));
- case MessageCreateEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage4ReorientCommand(req));
- case MessageDeleteEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage5ReorientCommand(req));
- case MessageLostEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage6ReorientCommand(req));
- case MessageFoundEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch (getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomCommentAnnotatedElementItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomCommentAnnotatedElementItemSemanticEditPolicy.java
deleted file mode 100644
index 78371180289..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomCommentAnnotatedElementItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageEndHelper;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.CommentAnnotatedElementItemSemanticEditPolicy;
-import org.eclipse.uml2.uml.MessageEnd;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomCommentAnnotatedElementItemSemanticEditPolicy extends CommentAnnotatedElementItemSemanticEditPolicy {
-
- /**
- * @Override
- */
- @Override
- protected Command getDestroyReferenceCommand(final DestroyReferenceRequest req) {
- if (req.getReferencedObject() instanceof MessageEnd) {
- return getGEFWrapper(new DestroyReferenceCommand(req) {
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- CommandResult res = super.doExecuteWithResult(monitor, info);
- if (res.getStatus().isOK()) {
- MessageEndHelper.removeConnectionSourceFromMessageEnd((MessageEnd) req.getReferencedObject(), req.getContainer());
- }
- return res;
- }
- });
- }
- return getGEFWrapper(new DestroyReferenceCommand(req));
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomCommentItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomCommentItemSemanticEditPolicy.java
deleted file mode 100644
index 56ad5817673..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomCommentItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.emf.gmf.command.EMFtoGMFCommandWrapper;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.CommentItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomCommentItemSemanticEditPolicy extends CommentItemSemanticEditPolicy {
-
- /**
- * @Override
- */
- @Override
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View) getHost().getModel();
- CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
- cmd.setTransactionNestingEnabled(true);
- EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
- if (annotation == null) {
- // there are indirectly referenced children, need extra commands: false
- addDestroyShortcutsCommand(cmd, view);
- // delete host element
- List<EObject> todestroy = new ArrayList<EObject>();
- todestroy.add(req.getElementToDestroy());
- // cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- cmd.add(new EMFtoGMFCommandWrapper(new org.eclipse.emf.edit.command.DeleteCommand(getEditingDomain(), todestroy)));
- } else {
- cmd.add(new DeleteCommand(getEditingDomain(), view));
- }
- return getGEFWrapper(cmd.reduce());
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return null;
- }
- return null;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch (getVisualID(req)) {
- case MessageSyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessageReorientCommand(req));
- case MessageAsyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage2ReorientCommand(req));
- case MessageReplyEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage3ReorientCommand(req));
- case MessageCreateEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage4ReorientCommand(req));
- case MessageDeleteEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage5ReorientCommand(req));
- case MessageLostEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage6ReorientCommand(req));
- case MessageFoundEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch (getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomConsiderIgnoreFragmentItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomConsiderIgnoreFragmentItemSemanticEditPolicy.java
deleted file mode 100644
index e94613afc87..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomConsiderIgnoreFragmentItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.ConsiderIgnoreFragmentItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-import org.eclipse.papyrus.uml.diagram.sequence.util.CombinedFragmentDeleteHelper;
-import org.eclipse.uml2.uml.CombinedFragment;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomConsiderIgnoreFragmentItemSemanticEditPolicy extends ConsiderIgnoreFragmentItemSemanticEditPolicy {
-
- /**
- * @Override
- */
- @Override
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if (provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
- if (deleteCommand != null) {
- if (selectedEObject instanceof CombinedFragment) {
- ICommand selectCmd = CombinedFragmentDeleteHelper.createDestroyElementCommand((CombinedFragment) selectedEObject, getEditingDomain(), provider, req, deleteCommand, (CombinedFragmentEditPart) getHost());
- return new ICommandProxy(selectCmd);
- } else {
- return new ICommandProxy(deleteCommand);
- }
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return null;
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return null;
- }
- return null;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source should be the domain
- * model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch (getVisualID(req)) {
- case MessageSyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessageReorientCommand(req));
- case MessageAsyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage2ReorientCommand(req));
- case MessageReplyEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage3ReorientCommand(req));
- case MessageCreateEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage4ReorientCommand(req));
- case MessageDeleteEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage5ReorientCommand(req));
- case MessageLostEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage6ReorientCommand(req));
- case MessageFoundEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch (getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomConstraintConstrainedElementItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomConstraintConstrainedElementItemSemanticEditPolicy.java
deleted file mode 100644
index 2e93d6bc877..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomConstraintConstrainedElementItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageEndHelper;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.ConstraintConstrainedElementItemSemanticEditPolicy;
-import org.eclipse.uml2.uml.MessageEnd;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomConstraintConstrainedElementItemSemanticEditPolicy extends ConstraintConstrainedElementItemSemanticEditPolicy {
-
- /**
- * @Override
- */
- @Override
- protected Command getDestroyReferenceCommand(final DestroyReferenceRequest req) {
- if (req.getReferencedObject() instanceof MessageEnd) {
- return getGEFWrapper(new DestroyReferenceCommand(req) {
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- CommandResult res = super.doExecuteWithResult(monitor, info);
- if (res.getStatus().isOK()) {
- MessageEndHelper.removeConnectionSourceFromMessageEnd((MessageEnd) req.getReferencedObject(), req.getContainer());
- }
- return res;
- }
- });
- }
- return getGEFWrapper(new DestroyReferenceCommand(req));
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomConstraintItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomConstraintItemSemanticEditPolicy.java
deleted file mode 100644
index 0dcb091b62b..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomConstraintItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.emf.gmf.command.EMFtoGMFCommandWrapper;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomContextLinkCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.ConstraintItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomConstraintItemSemanticEditPolicy extends ConstraintItemSemanticEditPolicy {
-
- /**
- * @Override
- */
- @Override
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View) getHost().getModel();
- CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
- cmd.setTransactionNestingEnabled(true);
- EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
- if (annotation == null) {
- // there are indirectly referenced children, need extra commands: false
- addDestroyShortcutsCommand(cmd, view);
- // delete host element
- List<EObject> todestroy = new ArrayList<EObject>();
- todestroy.add(req.getElementToDestroy());
- // cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- cmd.add(new EMFtoGMFCommandWrapper(new org.eclipse.emf.edit.command.DeleteCommand(getEditingDomain(), todestroy)));
- } else {
- cmd.add(new DeleteCommand(getEditingDomain(), view));
- }
- return getGEFWrapper(cmd.reduce());
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return null;
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Constraint_ContextEdge == req.getElementType()) {
- return getGEFWrapper(new CustomContextLinkCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Constraint_ContextEdge == req.getElementType()) {
- return getGEFWrapper(new CustomContextLinkCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch (getVisualID(req)) {
- case MessageSyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessageReorientCommand(req));
- case MessageAsyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage2ReorientCommand(req));
- case MessageReplyEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage3ReorientCommand(req));
- case MessageCreateEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage4ReorientCommand(req));
- case MessageDeleteEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage5ReorientCommand(req));
- case MessageLostEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage6ReorientCommand(req));
- case MessageFoundEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch (getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomContinuationItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomContinuationItemSemanticEditPolicy.java
deleted file mode 100644
index eec95757a86..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomContinuationItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.emf.gmf.command.EMFtoGMFCommandWrapper;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.ContinuationItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomContinuationItemSemanticEditPolicy extends ContinuationItemSemanticEditPolicy {
-
- /**
- * @Override
- */
- @Override
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View) getHost().getModel();
- CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
- cmd.setTransactionNestingEnabled(true);
- EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
- if (annotation == null) {
- // there are indirectly referenced children, need extra commands: false
- addDestroyShortcutsCommand(cmd, view);
- // delete host element
- List<EObject> todestroy = new ArrayList<EObject>();
- todestroy.add(req.getElementToDestroy());
- // cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- cmd.add(new EMFtoGMFCommandWrapper(new org.eclipse.emf.edit.command.DeleteCommand(getEditingDomain(), todestroy)));
- } else {
- cmd.add(new DeleteCommand(getEditingDomain(), view));
- }
- return getGEFWrapper(cmd.reduce());
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return null;
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return null;
- }
- return null;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch (getVisualID(req)) {
- case MessageSyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessageReorientCommand(req));
- case MessageAsyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage2ReorientCommand(req));
- case MessageReplyEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage3ReorientCommand(req));
- case MessageCreateEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage4ReorientCommand(req));
- case MessageDeleteEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage5ReorientCommand(req));
- case MessageLostEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage6ReorientCommand(req));
- case MessageFoundEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch (getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomDestructionOccurrenceSpecificationItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomDestructionOccurrenceSpecificationItemSemanticEditPolicy.java
deleted file mode 100644
index a67cad6e95c..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomDestructionOccurrenceSpecificationItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomGeneralOrderingCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.GeneralOrderingReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.GeneralOrderingEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.DestructionOccurrenceSpecificationItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceDeleteHelper;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomDestructionOccurrenceSpecificationItemSemanticEditPolicy extends DestructionOccurrenceSpecificationItemSemanticEditPolicy {
-
- /**
- * @Override
- */
- @Override
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if (provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
- if (deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return null;
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return null;
- }
- if (UMLElementTypes.GeneralOrdering_Edge == req.getElementType()) {
- return getGEFWrapper(new CustomGeneralOrderingCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.GeneralOrdering_Edge == req.getElementType()) {
- return getGEFWrapper(new CustomGeneralOrderingCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch (getVisualID(req)) {
- case MessageSyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessageReorientCommand(req));
- case MessageAsyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage2ReorientCommand(req));
- case MessageReplyEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage3ReorientCommand(req));
- case MessageCreateEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage4ReorientCommand(req));
- case MessageDeleteEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage5ReorientCommand(req));
- case MessageLostEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage6ReorientCommand(req));
- case MessageFoundEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- case GeneralOrderingEditPart.VISUAL_ID:
- return getGEFWrapper(new GeneralOrderingReorientCommand(req));
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch (getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
- /**
- * This method has been overridden to also delete linked time/duration views
- *
- * @Override
- */
- @Override
- protected Command addDeleteViewCommand(Command mainCommand, DestroyRequest completedRequest) {
- CompoundCommand deleteViewsCommand = new CompoundCommand();
- Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View) getHost().getModel()));
- deleteViewsCommand.add(deleteViewCommand);
- SequenceDeleteHelper.completeDeleteDestructionOccurenceViewCommand(deleteViewsCommand, getEditingDomain(), getHost());
- if (mainCommand == null) {
- return deleteViewsCommand;
- } else {
- return mainCommand.chain(deleteViewsCommand);
- }
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomDurationConstraintInMessageItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomDurationConstraintInMessageItemSemanticEditPolicy.java
deleted file mode 100644
index d8a9e4b80d9..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomDurationConstraintInMessageItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.emf.gmf.command.EMFtoGMFCommandWrapper;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.DurationConstraintInMessageItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomDurationConstraintInMessageItemSemanticEditPolicy extends DurationConstraintInMessageItemSemanticEditPolicy {
-
- /**
- * @Override
- */
- @Override
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View) getHost().getModel();
- CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
- cmd.setTransactionNestingEnabled(true);
- EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
- if (annotation == null) {
- // there are indirectly referenced children, need extra commands: false
- addDestroyShortcutsCommand(cmd, view);
- // delete host element
- List<EObject> todestroy = new ArrayList<EObject>();
- todestroy.add(req.getElementToDestroy());
- // cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- cmd.add(new EMFtoGMFCommandWrapper(new org.eclipse.emf.edit.command.DeleteCommand(getEditingDomain(), todestroy)));
- } else {
- cmd.add(new DeleteCommand(getEditingDomain(), view));
- }
- return getGEFWrapper(cmd.reduce());
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return null;
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch (getVisualID(req)) {
- case MessageSyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessageReorientCommand(req));
- case MessageAsyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage2ReorientCommand(req));
- case MessageReplyEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage3ReorientCommand(req));
- case MessageCreateEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage4ReorientCommand(req));
- case MessageDeleteEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage5ReorientCommand(req));
- case MessageLostEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage6ReorientCommand(req));
- case MessageFoundEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch (getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomDurationConstraintItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomDurationConstraintItemSemanticEditPolicy.java
deleted file mode 100644
index 0478f02d96f..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomDurationConstraintItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.emf.gmf.command.EMFtoGMFCommandWrapper;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.DurationConstraintItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomDurationConstraintItemSemanticEditPolicy extends DurationConstraintItemSemanticEditPolicy {
-
- /**
- * @Override
- */
- @Override
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View) getHost().getModel();
- CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
- cmd.setTransactionNestingEnabled(true);
- EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
- if (annotation == null) {
- // there are indirectly referenced children, need extra commands: false
- addDestroyShortcutsCommand(cmd, view);
- // delete host element
- List<EObject> todestroy = new ArrayList<EObject>();
- todestroy.add(req.getElementToDestroy());
- // cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- cmd.add(new EMFtoGMFCommandWrapper(new org.eclipse.emf.edit.command.DeleteCommand(getEditingDomain(), todestroy)));
- } else {
- cmd.add(new DeleteCommand(getEditingDomain(), view));
- }
- return getGEFWrapper(cmd.reduce());
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return null;
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch (getVisualID(req)) {
- case MessageSyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessageReorientCommand(req));
- case MessageAsyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage2ReorientCommand(req));
- case MessageReplyEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage3ReorientCommand(req));
- case MessageCreateEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage4ReorientCommand(req));
- case MessageDeleteEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage5ReorientCommand(req));
- case MessageLostEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage6ReorientCommand(req));
- case MessageFoundEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch (getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomDurationObservationItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomDurationObservationItemSemanticEditPolicy.java
deleted file mode 100644
index 6c79e7b60af..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomDurationObservationItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.emf.gmf.command.EMFtoGMFCommandWrapper;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.DurationObservationItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomDurationObservationItemSemanticEditPolicy extends DurationObservationItemSemanticEditPolicy {
-
- /**
- * @Override
- */
- @Override
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View) getHost().getModel();
- CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
- cmd.setTransactionNestingEnabled(true);
- EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
- if (annotation == null) {
- // there are indirectly referenced children, need extra commands: false
- addDestroyShortcutsCommand(cmd, view);
- // delete host element
- List<EObject> todestroy = new ArrayList<EObject>();
- todestroy.add(req.getElementToDestroy());
- // cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- cmd.add(new EMFtoGMFCommandWrapper(new org.eclipse.emf.edit.command.DeleteCommand(getEditingDomain(), todestroy)));
- } else {
- cmd.add(new DeleteCommand(getEditingDomain(), view));
- }
- return getGEFWrapper(cmd.reduce());
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return null;
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return null;
- }
- return null;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch (getVisualID(req)) {
- case MessageSyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessageReorientCommand(req));
- case MessageAsyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage2ReorientCommand(req));
- case MessageReplyEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage3ReorientCommand(req));
- case MessageCreateEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage4ReorientCommand(req));
- case MessageDeleteEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage5ReorientCommand(req));
- case MessageLostEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage6ReorientCommand(req));
- case MessageFoundEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch (getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomGeneralOrderingItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomGeneralOrderingItemSemanticEditPolicy.java
deleted file mode 100644
index e2456b5e9c4..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomGeneralOrderingItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.command.DeleteCommand;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.infra.emf.gmf.command.EMFtoGMFCommandWrapper;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.GeneralOrderingItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomGeneralOrderingItemSemanticEditPolicy extends GeneralOrderingItemSemanticEditPolicy {
-
- /**
- * @Override
- */
- @Override
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
- cmd.setTransactionNestingEnabled(true);
- List<EObject> todestroy = new ArrayList<EObject>();
- todestroy.add(req.getElementToDestroy());
- // cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- cmd.add(new EMFtoGMFCommandWrapper(new DeleteCommand(getEditingDomain(), todestroy)));
- return getGEFWrapper(cmd.reduce());
- // return getGEFWrapper(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return null;
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return null;
- }
- return null;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch (getVisualID(req)) {
- case MessageSyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessageReorientCommand(req));
- case MessageAsyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage2ReorientCommand(req));
- case MessageReplyEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage3ReorientCommand(req));
- case MessageCreateEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage4ReorientCommand(req));
- case MessageDeleteEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage5ReorientCommand(req));
- case MessageLostEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage6ReorientCommand(req));
- case MessageFoundEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch (getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionContextLinkSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionContextLinkSemanticEditPolicy.java
deleted file mode 100644
index 9686bf53eb1..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionContextLinkSemanticEditPolicy.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boutheina Bannour (CEA LIST) boutheina.bannour@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomContextLinkCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-
-/**
- * This class is used to manage the the creation of a contextLink
- */
-public class CustomInteractionContextLinkSemanticEditPolicy extends CustomInteractionItemSemanticEditPolicy {
-
- @Override
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Constraint_ContextEdge == req.getElementType()) {
- return getGEFWrapper(new CustomContextLinkCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return super.getCompleteCreateRelationshipCommand(req);
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionInteractionCompartmentItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionInteractionCompartmentItemSemanticEditPolicy.java
deleted file mode 100644
index 784312c38c8..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionInteractionCompartmentItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCombinedFragmentCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConsiderIgnoreFragmentCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConstraintCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomDurationConstraintCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomDurationObservationCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomInteractionUseCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomLifelineCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomTimeObservationCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.InteractionInteractionCompartmentItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomInteractionInteractionCompartmentItemSemanticEditPolicy extends InteractionInteractionCompartmentItemSemanticEditPolicy {
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateCommand(CreateElementRequest req) {
- if (UMLElementTypes.ConsiderIgnoreFragment_Shape == req.getElementType()) {
- return getGEFWrapper(new CustomConsiderIgnoreFragmentCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- if (UMLElementTypes.CombinedFragment_Shape == req.getElementType()) {
- return getGEFWrapper(new CustomCombinedFragmentCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- if (UMLElementTypes.Lifeline_Shape == req.getElementType()) {
- return getGEFWrapper(new CustomLifelineCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- if (UMLElementTypes.InteractionUse_Shape == req.getElementType()) {
- return getGEFWrapper(new CustomInteractionUseCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- if (UMLElementTypes.Constraint_Shape == req.getElementType()) {
- return getGEFWrapper(new CustomConstraintCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- if (UMLElementTypes.Comment_Shape == req.getElementType()) {
- return getGEFWrapper(new CommentCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- if (UMLElementTypes.TimeObservation_Shape == req.getElementType()) {
- return getGEFWrapper(new CustomTimeObservationCreateCommand(req));
- }
- if (UMLElementTypes.DurationObservation_Shape == req.getElementType()) {
- return getGEFWrapper(new CustomDurationObservationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- if (UMLElementTypes.DurationConstraint_Shape == req.getElementType()) {
- return getGEFWrapper(new CustomDurationConstraintCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- return super.getCreateCommand(req);
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionItemSemanticEditPolicy.java
deleted file mode 100644
index 33be1093635..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomDurationConstraintInMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomDurationObservationCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.InteractionItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomInteractionItemSemanticEditPolicy extends InteractionItemSemanticEditPolicy {
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateCommand(CreateElementRequest req) {
- if (UMLElementTypes.DurationConstraint_Shape_CN == req.getElementType()) {
- return getGEFWrapper(new CustomDurationConstraintInMessageCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- if (UMLElementTypes.DurationObservation_Shape == req.getElementType()) {
- return getGEFWrapper(new CustomDurationObservationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- return super.getCreateCommand(req);
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if (provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
- if (deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return null;
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return null;
- }
- return null;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source should be the domain
- * model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch (getVisualID(req)) {
- case MessageSyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessageReorientCommand(req));
- case MessageAsyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage2ReorientCommand(req));
- case MessageReplyEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage3ReorientCommand(req));
- case MessageCreateEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage4ReorientCommand(req));
- case MessageDeleteEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage5ReorientCommand(req));
- case MessageLostEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage6ReorientCommand(req));
- case MessageFoundEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch (getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionOperandContextLinkSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionOperandContextLinkSemanticEditPolicy.java
deleted file mode 100644
index 69b90716490..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionOperandContextLinkSemanticEditPolicy.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boutheina Bannour (CEA LIST) boutheina.bannour@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.ConnectionEditPart;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.gef.requests.DropRequest;
-import org.eclipse.gef.requests.ReconnectRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeConnectionRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomContextLinkCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContextLinkEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionOperandEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-
-/**
- * This class is used to manage the the creation of a contextLink
- */
-public class CustomInteractionOperandContextLinkSemanticEditPolicy extends CustomInteractionOperandItemSemanticEditPolicy {
-
- @Override
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Constraint_ContextEdge == req.getElementType()) {
- return getGEFWrapper(new CustomContextLinkCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return super.getCompleteCreateRelationshipCommand(req);
- }
-
- @Override
- public EditPart getTargetEditPart(Request request) {
- if (request instanceof CreateUnspecifiedTypeConnectionRequest) {
- CreateUnspecifiedTypeConnectionRequest createRequest = (CreateUnspecifiedTypeConnectionRequest) request;
- List<?> relationshipTypes = createRequest.getElementTypes();
- for (Object obj : relationshipTypes) {
- if (UMLElementTypes.Constraint_ContextEdge.equals(obj)) {
- Point location = ((DropRequest) request).getLocation();
- EditPart host = getHost();
- if (isEnterAnchorArea(host, location)) {
- return host;
- }
- }
- }
- }
- if (request instanceof ReconnectRequest) {
- ReconnectRequest reconnectRequest = (ReconnectRequest) request;
- ConnectionEditPart connectionEditPart = reconnectRequest.getConnectionEditPart();
- if (connectionEditPart instanceof ContextLinkEditPart) {
- Point location = ((DropRequest) request).getLocation();
- EditPart host = getHost();
- if (isEnterAnchorArea(host, location)) {
- return host;
- }
- }
- }
- return super.getTargetEditPart(request);
- }
-
- private boolean isEnterAnchorArea(EditPart editPart, Point location) {
- Point p = location.getCopy();
- if (editPart instanceof InteractionEditPart || editPart instanceof CombinedFragmentEditPart || editPart instanceof InteractionOperandEditPart) {
- IFigure figure = ((AbstractGraphicalEditPart) editPart).getFigure();
- figure.translateToRelative(p);
- // if mouse location is far from border, do not handle connection event
- Rectangle innerRetangle = figure.getBounds().getCopy().shrink(10, 10);
- if (innerRetangle.contains(p)) {
- return false;
- }
- }
- return true;
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionOperandItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionOperandItemSemanticEditPolicy.java
deleted file mode 100644
index c81df941ded..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionOperandItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,311 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.ConnectionEditPart;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.requests.ReconnectRequest;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.ICompositeCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCombinedFragmentCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConsiderIgnoreFragmentCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomContinuationCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomInteractionUseCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContextLinkEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.InteractionOperandItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-import org.eclipse.papyrus.uml.diagram.sequence.util.OperandBoundsComputeHelper;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomInteractionOperandItemSemanticEditPolicy extends InteractionOperandItemSemanticEditPolicy {
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateCommand(CreateElementRequest req) {
- if (UMLElementTypes.InteractionUse_Shape == req.getElementType()) {
- return getGEFWrapper(new CustomInteractionUseCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- if (UMLElementTypes.ConsiderIgnoreFragment_Shape == req.getElementType()) {
- return getGEFWrapper(new CustomConsiderIgnoreFragmentCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- if (UMLElementTypes.CombinedFragment_Shape == req.getElementType()) {
- return getGEFWrapper(new CustomCombinedFragmentCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- if (UMLElementTypes.Continuation_Shape == req.getElementType()) {
- return getGEFWrapper(new CustomContinuationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- if (UMLElementTypes.InteractionOperand_Shape == req.getElementType()) {
- // delegate to parent
- return UnexecutableCommand.INSTANCE;
- }
- return super.getCreateCommand(req);
- }
-
- /**
- * @Override
- */
- @Override
- public Command getCommand(Request request) {
- if (request instanceof ReconnectRequest) {
- ReconnectRequest reconnectRequest = (ReconnectRequest) request;
- ConnectionEditPart connectionEditPart = reconnectRequest.getConnectionEditPart();
- if (connectionEditPart instanceof ContextLinkEditPart) {
- return super.getCommand(request);
- }
- }
- if (request instanceof ReconnectRequest) {
- EditPart combinedFragment = getHost().getParent().getParent();
- ((ReconnectRequest) request).setTargetEditPart(combinedFragment);
- return combinedFragment.getCommand(request);
- }
- return super.getCommand(request);
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if (provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
- if (deleteCommand != null) {
- if (deleteCommand instanceof ICompositeCommand) {
- OperandBoundsComputeHelper.addUpdateBoundsCommandForOperandDelelete(this.getHost(), (ICompositeCommand) deleteCommand);
- }
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @Override redirect message creation to CF
- */
- @Override
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- // redirect message creation to CF
- EditPart combinedFragmentPart = getHost().getParent().getParent();
- EObject combinedFragment = ((IGraphicalEditPart) combinedFragmentPart).resolveSemanticElement();
- if (((IGraphicalEditPart) getHost()).resolveSemanticElement().equals(req.getSource())) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, combinedFragment, req.getTarget()));
- }
- return null;// return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- // redirect message creation to CF
- EditPart combinedFragmentPart = getHost().getParent().getParent();
- EObject combinedFragment = ((IGraphicalEditPart) combinedFragmentPart).resolveSemanticElement();
- if (((IGraphicalEditPart) getHost()).resolveSemanticElement().equals(req.getSource())) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, combinedFragment, req.getTarget()));
- }
- return null;// return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- // redirect message creation to CF
- EditPart combinedFragmentPart = getHost().getParent().getParent();
- EObject combinedFragment = ((IGraphicalEditPart) combinedFragmentPart).resolveSemanticElement();
- if (((IGraphicalEditPart) getHost()).resolveSemanticElement().equals(req.getSource())) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, combinedFragment, req.getTarget()));
- }
- return null;// return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- // redirect message creation to CF
- EditPart combinedFragmentPart = getHost().getParent().getParent();
- EObject combinedFragment = ((IGraphicalEditPart) combinedFragmentPart).resolveSemanticElement();
- if (((IGraphicalEditPart) getHost()).resolveSemanticElement().equals(req.getSource())) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, combinedFragment, req.getTarget()));
- }
- return null;// return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- // redirect message creation to CF
- EditPart combinedFragmentPart = getHost().getParent().getParent();
- EObject combinedFragment = ((IGraphicalEditPart) combinedFragmentPart).resolveSemanticElement();
- if (((IGraphicalEditPart) getHost()).resolveSemanticElement().equals(req.getSource())) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, combinedFragment, req.getTarget()));
- }
- return null;// return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- // redirect message creation to CF
- EditPart combinedFragmentPart = getHost().getParent().getParent();
- EObject combinedFragment = ((IGraphicalEditPart) combinedFragmentPart).resolveSemanticElement();
- if (((IGraphicalEditPart) getHost()).resolveSemanticElement().equals(req.getSource())) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, combinedFragment, req.getTarget()));
- }
- return null;// return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- // redirect message creation to CF
- EditPart combinedFragmentPart = getHost().getParent().getParent();
- EObject combinedFragment = ((IGraphicalEditPart) combinedFragmentPart).resolveSemanticElement();
- if (((IGraphicalEditPart) getHost()).resolveSemanticElement().equals(req.getSource())) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, combinedFragment, req.getTarget()));
- }
- return null;// return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return null;
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return null;
- }
- return null;
- }
-
- /**
- * @Override let InteractionOperandLayoutEditPolicy redirect messages
- */
- @Override
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- // let InteractionOperandLayoutEditPolicy redirect messages
- return null;// return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- // let InteractionOperandLayoutEditPolicy redirect messages
- return null;// return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- // let InteractionOperandLayoutEditPolicy redirect messages
- return null;// return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- // let InteractionOperandLayoutEditPolicy redirect messages
- return null;// return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- // let InteractionOperandLayoutEditPolicy redirect messages
- return null;// return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- // let InteractionOperandLayoutEditPolicy redirect messages
- return null;// return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- // let InteractionOperandLayoutEditPolicy redirect messages
- return null;// return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source should be the domain
- * model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch (getVisualID(req)) {
- case MessageSyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessageReorientCommand(req));
- case MessageAsyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage2ReorientCommand(req));
- case MessageReplyEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage3ReorientCommand(req));
- case MessageCreateEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage4ReorientCommand(req));
- case MessageDeleteEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage5ReorientCommand(req));
- case MessageLostEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage6ReorientCommand(req));
- case MessageFoundEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch (getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionUseItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionUseItemSemanticEditPolicy.java
deleted file mode 100644
index 8cfb73a8ae2..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionUseItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.emf.gmf.command.EMFtoGMFCommandWrapper;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.InteractionUseItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomInteractionUseItemSemanticEditPolicy extends InteractionUseItemSemanticEditPolicy {
-
- /**
- * @Override
- */
- @Override
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View) getHost().getModel();
- CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
- cmd.setTransactionNestingEnabled(true);
- EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
- if (annotation == null) {
- // there are indirectly referenced children, need extra commands: false
- addDestroyShortcutsCommand(cmd, view);
- // delete host element
- List<EObject> todestroy = new ArrayList<EObject>();
- todestroy.add(req.getElementToDestroy());
- // cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- cmd.add(new EMFtoGMFCommandWrapper(new org.eclipse.emf.edit.command.DeleteCommand(getEditingDomain(), todestroy)));
- } else {
- cmd.add(new DeleteCommand(getEditingDomain(), view));
- }
- return getGEFWrapper(cmd.reduce());
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return null;
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return null;
- }
- return null;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source should be the domain
- * model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch (getVisualID(req)) {
- case MessageSyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessageReorientCommand(req));
- case MessageAsyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage2ReorientCommand(req));
- case MessageReplyEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage3ReorientCommand(req));
- case MessageCreateEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage4ReorientCommand(req));
- case MessageDeleteEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage5ReorientCommand(req));
- case MessageLostEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage6ReorientCommand(req));
- case MessageFoundEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch (getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomLifelineItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomLifelineItemSemanticEditPolicy.java
deleted file mode 100644
index 2f42b85ae1d..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomLifelineItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.requests.ReconnectRequest;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomActionExecutionSpecificationCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomBehaviorExecutionSpecificationCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCombinedFragment2CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomDestructionOccurrenceSpecificationCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomDurationConstraintCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomGeneralOrderingCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomLifelineCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomStateInvariantCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomTimeConstraintCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.GeneralOrderingReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.AbstractExecutionSpecificationEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CustomLifelineEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DestructionOccurrenceSpecificationEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.GeneralOrderingEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.LifelineItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-import org.eclipse.papyrus.uml.diagram.sequence.util.LifelineMessageCreateHelper;
-import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceDeleteHelper;
-import org.eclipse.uml2.uml.OccurrenceSpecification;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomLifelineItemSemanticEditPolicy extends LifelineItemSemanticEditPolicy {
-
- /**
- * Generated not for add lifelines on lifeline
- *
- * @Override
- * (update at each lifeline modification) add lifelines, add DurationObservation/Constraint
- */
- @Override
- protected Command getCreateCommand(CreateElementRequest req) {
- if (UMLElementTypes.ActionExecutionSpecification_Shape == req.getElementType()) {
- return getGEFWrapper(new CustomActionExecutionSpecificationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- if (UMLElementTypes.BehaviorExecutionSpecification_Shape == req.getElementType()) {
- return getGEFWrapper(new CustomBehaviorExecutionSpecificationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- if (UMLElementTypes.StateInvariant_Shape == req.getElementType()) {
- return getGEFWrapper(new CustomStateInvariantCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- if (UMLElementTypes.CombinedFragment_CoRegionShape == req.getElementType()) {
- return getGEFWrapper(new CustomCombinedFragment2CreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- if (UMLElementTypes.TimeConstraint_Shape == req.getElementType()) {
- return getGEFWrapper(new CustomTimeConstraintCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- // Fix https://bugs.eclipse.org/bugs/show_bug.cgi?id=364826
- // if(UMLElementTypes.TimeObservation_Shape == req.getElementType()) {
- // return getGEFWrapper(new TimeObservationCreateCommand(req));
- // }
- if (UMLElementTypes.DurationConstraint_Shape == req.getElementType()) {
- return getGEFWrapper(new CustomDurationConstraintCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- if (UMLElementTypes.DestructionOccurrenceSpecification_Shape == req.getElementType()) {
- return getGEFWrapper(new CustomDestructionOccurrenceSpecificationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- // add lifelines
- if (UMLElementTypes.Lifeline_Shape == req.getElementType()) {
- CustomLifelineEditPart lifelineEditPart = (CustomLifelineEditPart) getHost();
- if (lifelineEditPart.isInlineCapability()) {
- CustomLifelineCreateCommand cmd = new CustomLifelineCreateCommand(req, DiagramUtils.getDiagramFrom(getHost()));
- cmd.setAvailableProperties(lifelineEditPart.getAvailableProperties());
- return getGEFWrapper(cmd);
- }
- }
- // add DurationObservation/Constraint
- if (UMLElementTypes.DurationConstraint_Shape_CN == req.getElementType()) {
- return getGEFWrapper(new CustomDurationConstraintCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- // Fix https://bugs.eclipse.org/bugs/show_bug.cgi?id=364826
- // if(UMLElementTypes.DurationObservation_Shape == req.getElementType()) {
- // return getGEFWrapper(new DurationObservationCreateCommand(req));
- // }
- return super.getCreateCommand(req);
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if (provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
- if (deleteCommand != null) {
- Command command = new ICommandProxy(deleteCommand);
- command = LifelineMessageCreateHelper.restoreLifelineOnDelete(command, (LifelineEditPart) getHost());
- CompoundCommand deleteElementsCommand = new CompoundCommand();
- deleteElementsCommand.add(command);
- if (getHost() instanceof LifelineEditPart) {
- LifelineEditPart ep = (LifelineEditPart) getHost();
- SequenceDeleteHelper.destroyMessageEvents(deleteElementsCommand, ep, req.getEditingDomain());
- List children = ep.getChildren();
- for (Object obj : children) {
- if (obj instanceof AbstractExecutionSpecificationEditPart) {
- SequenceDeleteHelper.destroyMessageEvents(deleteElementsCommand, (AbstractExecutionSpecificationEditPart) obj, req.getEditingDomain());
- }
- if (obj instanceof DestructionOccurrenceSpecificationEditPart) {
- SequenceDeleteHelper.destroyMessageEvents(deleteElementsCommand, (DestructionOccurrenceSpecificationEditPart) obj, req.getEditingDomain());
- }
- }
- }
- return deleteElementsCommand;
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @Override
- * (update at each lifeline modification) add general ordering
- */
- @Override
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return null;
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return null;
- }
- // add general ordering
- if (UMLElementTypes.GeneralOrdering_Edge == req.getElementType()) {
- return getGEFWrapper(new CustomGeneralOrderingCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @Override
- * (update at each lifeline modification) add general ordering
- */
- @Override
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- // add general ordering
- if (UMLElementTypes.GeneralOrdering_Edge == req.getElementType()) {
- return getGEFWrapper(new CustomGeneralOrderingCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source should be the domain
- * model element associated with this node.
- *
- * @Override
- * (update at each lifeline modification) add general ordering
- */
- @Override
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch (getVisualID(req)) {
- case MessageSyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessageReorientCommand(req));
- case MessageAsyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage2ReorientCommand(req));
- case MessageReplyEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage3ReorientCommand(req));
- case MessageCreateEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage4ReorientCommand(req));
- case MessageDeleteEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage5ReorientCommand(req));
- case MessageLostEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage6ReorientCommand(req));
- case MessageFoundEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- // add general ordering
- case GeneralOrderingEditPart.VISUAL_ID:
- if (req.getNewRelationshipEnd() instanceof OccurrenceSpecification) {
- return getGEFWrapper(new GeneralOrderingReorientCommand(req));
- } else {
- return null;
- }
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch (getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-
- /**
- * Fixed bugs about reconnect Message Found/Lost on a PartDecomposition.
- */
- @Override
- public boolean understandsRequest(Request request) {
- if (REQ_RECONNECT_SOURCE.equals(request.getType())) {
- ReconnectRequest reconnReq = (ReconnectRequest) request;
- Object model = reconnReq.getConnectionEditPart().getModel();
- // Source of Message Found should be always located on Interaction.
- if (model instanceof View && UMLVisualIDRegistry.getVisualID((View) model).equals(MessageFoundEditPart.VISUAL_ID)) {
- return false;
- }
- } else if (REQ_RECONNECT_TARGET.equals(request.getType())) {
- ReconnectRequest reconnReq = (ReconnectRequest) request;
- Object model = reconnReq.getConnectionEditPart().getModel();
- // Target of Message Lost should be always located on Interaction.
- if (model instanceof View && UMLVisualIDRegistry.getVisualID((View) model).equals(MessageLostEditPart.VISUAL_ID)) {
- return false;
- }
- }
- return super.understandsRequest(request);
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageASyncItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageASyncItemSemanticEditPolicy.java
deleted file mode 100644
index 62a95723266..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageASyncItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomDurationConstraintCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomDurationObservationCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.MessageAsyncItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.figures.MessageAsync;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceDeleteHelper;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomMessageASyncItemSemanticEditPolicy extends MessageAsyncItemSemanticEditPolicy {
-
- /**
- * Added to add duration constraint
- *
- * @Override
- * add Duration Constraint
- */
- @Override
- protected Command getCreateCommand(CreateElementRequest req) {
- if (UMLElementTypes.DurationConstraint_Shape_CN == req.getElementType()) {
- return getGEFWrapper(new CustomDurationConstraintCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- if (UMLElementTypes.DurationObservation_Shape == req.getElementType()) {
- return getGEFWrapper(new CustomDurationObservationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- return null;
- }
-
- /**
- * the added code to delete the messageoccurencespecification when the message is deleted
- *
- * @Override
- */
- @Override
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- return SequenceDeleteHelper.completeDeleteMessageCommand(req, getHost());
- }
-
- /**
- * This method has been overridden to also delete linked time/duration views
- *
- * @Override
- */
- @Override
- protected Command addDeleteViewCommand(Command mainCommand, DestroyRequest completedRequest) {
- CompoundCommand deleteViewsCommand = new CompoundCommand();
- Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View) getHost().getModel()));
- deleteViewsCommand.add(deleteViewCommand);
- SequenceDeleteHelper.completeDeleteMessageViewCommand(deleteViewsCommand, getEditingDomain(), getHost());
- if (mainCommand == null) {
- return deleteViewsCommand;
- } else {
- return mainCommand.chain(deleteViewsCommand);
- }
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return null;
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return null;
- }
- return null;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source should be the domain
- * model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch (getVisualID(req)) {
- case MessageSyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessageReorientCommand(req));
- case MessageAsyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage2ReorientCommand(req));
- case MessageReplyEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage3ReorientCommand(req));
- case MessageCreateEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage4ReorientCommand(req));
- case MessageDeleteEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage5ReorientCommand(req));
- case MessageLostEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage6ReorientCommand(req));
- case MessageFoundEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch (getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageCreateItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageCreateItemSemanticEditPolicy.java
deleted file mode 100644
index 0a8fc7a913b..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageCreateItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomDurationConstraintCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomDurationObservationCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.MessageCreateItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-import org.eclipse.papyrus.uml.diagram.sequence.util.LifelineMessageCreateHelper;
-import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceDeleteHelper;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomMessageCreateItemSemanticEditPolicy extends MessageCreateItemSemanticEditPolicy {
-
- /**
- * Added to add duration constraint
- *
- * @Override
- * add Duration Constraint
- */
- @Override
- protected Command getCreateCommand(CreateElementRequest req) {
- if (UMLElementTypes.DurationConstraint_Shape_CN == req.getElementType()) {
- return getGEFWrapper(new CustomDurationConstraintCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- if (UMLElementTypes.DurationObservation_Shape == req.getElementType()) {
- return getGEFWrapper(new CustomDurationObservationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- return null;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- CompoundCommand destroyElementCommand = new CompoundCommand();
- Command deleteCommand = SequenceDeleteHelper.completeDeleteMessageCommand(req, getHost());
- destroyElementCommand.add(deleteCommand);
- return LifelineMessageCreateHelper.restoreLifelineOnMessageDelete(destroyElementCommand, getHost());
- }
-
- /**
- * This method has been overridden to also delete linked time/duration views
- *
- * @Override
- */
- @Override
- protected Command addDeleteViewCommand(Command mainCommand, DestroyRequest completedRequest) {
- CompoundCommand deleteViewsCommand = new CompoundCommand();
- Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View) getHost().getModel()));
- deleteViewsCommand.add(deleteViewCommand);
- SequenceDeleteHelper.completeDeleteMessageViewCommand(deleteViewsCommand, getEditingDomain(), getHost());
- if (mainCommand == null) {
- return deleteViewsCommand;
- } else {
- return mainCommand.chain(deleteViewsCommand);
- }
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return null;
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return null;
- }
- return null;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source should be the domain
- * model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch (getVisualID(req)) {
- case MessageSyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessageReorientCommand(req));
- case MessageAsyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage2ReorientCommand(req));
- case MessageReplyEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage3ReorientCommand(req));
- case MessageCreateEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage4ReorientCommand(req));
- case MessageDeleteEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage5ReorientCommand(req));
- case MessageLostEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage6ReorientCommand(req));
- case MessageFoundEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch (getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageDeleteItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageDeleteItemSemanticEditPolicy.java
deleted file mode 100644
index f59cd40f9ff..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageDeleteItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomDurationConstraintCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomDurationObservationCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.MessageDeleteItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceDeleteHelper;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomMessageDeleteItemSemanticEditPolicy extends MessageDeleteItemSemanticEditPolicy {
-
- /**
- * Added to add duration constraint
- *
- * @Override
- * add Duration Constraint
- */
- @Override
- protected Command getCreateCommand(CreateElementRequest req) {
- if (UMLElementTypes.DurationConstraint_Shape_CN == req.getElementType()) {
- return getGEFWrapper(new CustomDurationConstraintCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- if (UMLElementTypes.DurationObservation_Shape == req.getElementType()) {
- return getGEFWrapper(new CustomDurationObservationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- return null;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- return SequenceDeleteHelper.completeDeleteMessageCommand(req, getHost());
- }
-
- /**
- * This method has been overridden to also delete linked time/duration views
- *
- * @Override
- */
- @Override
- protected Command addDeleteViewCommand(Command mainCommand, DestroyRequest completedRequest) {
- CompoundCommand deleteViewsCommand = new CompoundCommand();
- Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View) getHost().getModel()));
- deleteViewsCommand.add(deleteViewCommand);
- SequenceDeleteHelper.completeDeleteMessageViewCommand(deleteViewsCommand, getEditingDomain(), getHost());
- if (mainCommand == null) {
- return deleteViewsCommand;
- } else {
- return mainCommand.chain(deleteViewsCommand);
- }
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return null;
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return null;
- }
- return null;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source should be the domain
- * model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch (getVisualID(req)) {
- case MessageSyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessageReorientCommand(req));
- case MessageAsyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage2ReorientCommand(req));
- case MessageReplyEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage3ReorientCommand(req));
- case MessageCreateEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage4ReorientCommand(req));
- case MessageDeleteEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage5ReorientCommand(req));
- case MessageLostEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage6ReorientCommand(req));
- case MessageFoundEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch (getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageFoundItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageFoundItemSemanticEditPolicy.java
deleted file mode 100644
index fc8015a39cb..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageFoundItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomDurationConstraintCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomDurationObservationCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.MessageFoundItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceDeleteHelper;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomMessageFoundItemSemanticEditPolicy extends MessageFoundItemSemanticEditPolicy {
-
- /**
- * Added to add duration constraint
- *
- * @Override
- * add Duration Constraint
- */
- @Override
- protected Command getCreateCommand(CreateElementRequest req) {
- if (UMLElementTypes.DurationConstraint_Shape_CN == req.getElementType()) {
- return getGEFWrapper(new CustomDurationConstraintCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- if (UMLElementTypes.DurationObservation_Shape == req.getElementType()) {
- return getGEFWrapper(new CustomDurationObservationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- return null;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- return SequenceDeleteHelper.completeDeleteMessageCommand(req, getHost());
- }
-
- /**
- * This method has been overridden to also delete linked time/duration views
- *
- * @Override
- */
- @Override
- protected Command addDeleteViewCommand(Command mainCommand, DestroyRequest completedRequest) {
- CompoundCommand deleteViewsCommand = new CompoundCommand();
- Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View) getHost().getModel()));
- deleteViewsCommand.add(deleteViewCommand);
- SequenceDeleteHelper.completeDeleteMessageViewCommand(deleteViewsCommand, getEditingDomain(), getHost());
- if (mainCommand == null) {
- return deleteViewsCommand;
- } else {
- return mainCommand.chain(deleteViewsCommand);
- }
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return null;
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return null;
- }
- return null;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source should be the domain
- * model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch (getVisualID(req)) {
- case MessageSyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessageReorientCommand(req));
- case MessageAsyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage2ReorientCommand(req));
- case MessageReplyEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage3ReorientCommand(req));
- case MessageCreateEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage4ReorientCommand(req));
- case MessageDeleteEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage5ReorientCommand(req));
- case MessageLostEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage6ReorientCommand(req));
- case MessageFoundEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch (getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageLostItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageLostItemSemanticEditPolicy.java
deleted file mode 100644
index 92bc33816ff..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageLostItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomDurationConstraintCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomDurationObservationCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.MessageLostItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceDeleteHelper;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomMessageLostItemSemanticEditPolicy extends MessageLostItemSemanticEditPolicy {
-
- /**
- * Added to add duration constraint
- *
- * @Override
- * add Duration Constraint
- */
- @Override
- protected Command getCreateCommand(CreateElementRequest req) {
- if (UMLElementTypes.DurationConstraint_Shape_CN == req.getElementType()) {
- return getGEFWrapper(new CustomDurationConstraintCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- if (UMLElementTypes.DurationObservation_Shape == req.getElementType()) {
- return getGEFWrapper(new CustomDurationObservationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- return null;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- return SequenceDeleteHelper.completeDeleteMessageCommand(req, getHost());
- }
-
- /**
- * This method has been overridden to also delete linked time/duration views
- *
- * @Override
- */
- @Override
- protected Command addDeleteViewCommand(Command mainCommand, DestroyRequest completedRequest) {
- CompoundCommand deleteViewsCommand = new CompoundCommand();
- Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View) getHost().getModel()));
- deleteViewsCommand.add(deleteViewCommand);
- SequenceDeleteHelper.completeDeleteMessageViewCommand(deleteViewsCommand, getEditingDomain(), getHost());
- if (mainCommand == null) {
- return deleteViewsCommand;
- } else {
- return mainCommand.chain(deleteViewsCommand);
- }
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return null;
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return null;
- }
- return null;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source should be the domain
- * model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch (getVisualID(req)) {
- case MessageSyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessageReorientCommand(req));
- case MessageAsyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage2ReorientCommand(req));
- case MessageReplyEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage3ReorientCommand(req));
- case MessageCreateEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage4ReorientCommand(req));
- case MessageDeleteEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage5ReorientCommand(req));
- case MessageLostEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage6ReorientCommand(req));
- case MessageFoundEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch (getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageReplyItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageReplyItemSemanticEditPolicy.java
deleted file mode 100644
index 1fa84a276c5..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageReplyItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomDurationConstraintCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomDurationObservationCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.MessageReplyItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceDeleteHelper;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomMessageReplyItemSemanticEditPolicy extends MessageReplyItemSemanticEditPolicy {
-
- /**
- * Added to add duration constraint
- *
- * @Override
- * add Duration Constraint
- */
- @Override
- protected Command getCreateCommand(CreateElementRequest req) {
- if (UMLElementTypes.DurationConstraint_Shape_CN == req.getElementType()) {
- return getGEFWrapper(new CustomDurationConstraintCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- if (UMLElementTypes.DurationObservation_Shape == req.getElementType()) {
- return getGEFWrapper(new CustomDurationObservationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- return null;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- return SequenceDeleteHelper.completeDeleteMessageCommand(req, getHost());
- }
-
- /**
- * This method has been overridden to also delete linked time/duration views
- *
- * @Override
- */
- @Override
- protected Command addDeleteViewCommand(Command mainCommand, DestroyRequest completedRequest) {
- CompoundCommand deleteViewsCommand = new CompoundCommand();
- Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View) getHost().getModel()));
- deleteViewsCommand.add(deleteViewCommand);
- SequenceDeleteHelper.completeDeleteMessageViewCommand(deleteViewsCommand, getEditingDomain(), getHost());
- if (mainCommand == null) {
- return deleteViewsCommand;
- } else {
- return mainCommand.chain(deleteViewsCommand);
- }
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return null;
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return null;
- }
- return null;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source should be the domain
- * model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch (getVisualID(req)) {
- case MessageSyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessageReorientCommand(req));
- case MessageAsyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage2ReorientCommand(req));
- case MessageReplyEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage3ReorientCommand(req));
- case MessageCreateEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage4ReorientCommand(req));
- case MessageDeleteEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage5ReorientCommand(req));
- case MessageLostEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage6ReorientCommand(req));
- case MessageFoundEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch (getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageSyncItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageSyncItemSemanticEditPolicy.java
deleted file mode 100644
index 41c47deff85..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageSyncItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomDurationConstraintCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomDurationObservationCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.MessageSyncItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceDeleteHelper;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomMessageSyncItemSemanticEditPolicy extends MessageSyncItemSemanticEditPolicy {
-
- /**
- * Added to add duration constraint
- *
- * @Override
- * add Duration Constraint
- */
- @Override
- protected Command getCreateCommand(CreateElementRequest req) {
- if (UMLElementTypes.DurationConstraint_Shape_CN == req.getElementType()) {
- return getGEFWrapper(new CustomDurationConstraintCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- if (UMLElementTypes.DurationObservation_Shape == req.getElementType()) {
- return getGEFWrapper(new CustomDurationObservationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- return null;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- return SequenceDeleteHelper.completeDeleteMessageCommand(req, getHost());
- }
-
- /**
- * This method has been overridden to also delete linked time/duration views
- *
- * @Override
- */
- @Override
- protected Command addDeleteViewCommand(Command mainCommand, DestroyRequest completedRequest) {
- CompoundCommand deleteViewsCommand = new CompoundCommand();
- Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View) getHost().getModel()));
- deleteViewsCommand.add(deleteViewCommand);
- SequenceDeleteHelper.completeDeleteMessageViewCommand(deleteViewsCommand, getEditingDomain(), getHost());
- if (mainCommand == null) {
- return deleteViewsCommand;
- } else {
- return mainCommand.chain(deleteViewsCommand);
- }
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return null;
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return null;
- }
- return null;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source should be the domain
- * model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch (getVisualID(req)) {
- case MessageSyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessageReorientCommand(req));
- case MessageAsyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage2ReorientCommand(req));
- case MessageReplyEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage3ReorientCommand(req));
- case MessageCreateEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage4ReorientCommand(req));
- case MessageDeleteEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage5ReorientCommand(req));
- case MessageLostEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage6ReorientCommand(req));
- case MessageFoundEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch (getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomPackageItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomPackageItemSemanticEditPolicy.java
deleted file mode 100644
index 01cbb1794e6..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomPackageItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomInteractionCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.PackageItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomPackageItemSemanticEditPolicy extends PackageItemSemanticEditPolicy {
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateCommand(CreateElementRequest req) {
- if (UMLElementTypes.Interaction_Shape == req.getElementType()) {
- return getGEFWrapper(new CustomInteractionCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
- }
- return super.getCreateCommand(req);
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomStateInvariantItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomStateInvariantItemSemanticEditPolicy.java
deleted file mode 100644
index 39e59a0ce69..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomStateInvariantItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.emf.gmf.command.EMFtoGMFCommandWrapper;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.StateInvariantItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomStateInvariantItemSemanticEditPolicy extends StateInvariantItemSemanticEditPolicy {
-
- /**
- * @Override
- */
- @Override
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View) getHost().getModel();
- CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
- cmd.setTransactionNestingEnabled(true);
- EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
- if (annotation == null) {
- // there are indirectly referenced children, need extra commands: false
- addDestroyShortcutsCommand(cmd, view);
- // delete host element
- List<EObject> todestroy = new ArrayList<EObject>();
- todestroy.add(req.getElementToDestroy());
- // cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- cmd.add(new EMFtoGMFCommandWrapper(new org.eclipse.emf.edit.command.DeleteCommand(getEditingDomain(), todestroy)));
- } else {
- cmd.add(new DeleteCommand(getEditingDomain(), view));
- }
- return getGEFWrapper(cmd.reduce());
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return null;
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return null;
- }
- return null;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch (getVisualID(req)) {
- case MessageSyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessageReorientCommand(req));
- case MessageAsyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage2ReorientCommand(req));
- case MessageReplyEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage3ReorientCommand(req));
- case MessageCreateEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage4ReorientCommand(req));
- case MessageDeleteEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage5ReorientCommand(req));
- case MessageLostEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage6ReorientCommand(req));
- case MessageFoundEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch (getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomTimeConstraintItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomTimeConstraintItemSemanticEditPolicy.java
deleted file mode 100644
index 56c91f2883b..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomTimeConstraintItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.emf.gmf.command.EMFtoGMFCommandWrapper;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.TimeConstraintItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomTimeConstraintItemSemanticEditPolicy extends TimeConstraintItemSemanticEditPolicy {
-
- /**
- * @Override
- */
- @Override
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View) getHost().getModel();
- CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
- cmd.setTransactionNestingEnabled(true);
- EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
- if (annotation == null) {
- // there are indirectly referenced children, need extra commands: false
- addDestroyShortcutsCommand(cmd, view);
- // delete host element
- List<EObject> todestroy = new ArrayList<EObject>();
- todestroy.add(req.getElementToDestroy());
- // cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- cmd.add(new EMFtoGMFCommandWrapper(new org.eclipse.emf.edit.command.DeleteCommand(getEditingDomain(), todestroy)));
- } else {
- cmd.add(new DeleteCommand(getEditingDomain(), view));
- }
- return getGEFWrapper(cmd.reduce());
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return null;
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch (getVisualID(req)) {
- case MessageSyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessageReorientCommand(req));
- case MessageAsyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage2ReorientCommand(req));
- case MessageReplyEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage3ReorientCommand(req));
- case MessageCreateEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage4ReorientCommand(req));
- case MessageDeleteEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage5ReorientCommand(req));
- case MessageLostEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage6ReorientCommand(req));
- case MessageFoundEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch (getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomTimeObservationItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomTimeObservationItemSemanticEditPolicy.java
deleted file mode 100644
index 71a8afa48e7..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomTimeObservationItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.emf.gmf.command.EMFtoGMFCommandWrapper;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCommentAnnotatedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConstraintConstrainedElementReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.TimeObservationItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class CustomTimeObservationItemSemanticEditPolicy extends TimeObservationItemSemanticEditPolicy {
-
- /**
- * @Override
- */
- @Override
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View) getHost().getModel();
- CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
- cmd.setTransactionNestingEnabled(true);
- EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
- if (annotation == null) {
- // there are indirectly referenced children, need extra commands: false
- addDestroyShortcutsCommand(cmd, view);
- // delete host element
- List<EObject> todestroy = new ArrayList<EObject>();
- todestroy.add(req.getElementToDestroy());
- // cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- cmd.add(new EMFtoGMFCommandWrapper(new org.eclipse.emf.edit.command.DeleteCommand(getEditingDomain(), todestroy)));
- } else {
- cmd.add(new DeleteCommand(getEditingDomain(), view));
- }
- return getGEFWrapper(cmd.reduce());
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return null;
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return null;
- }
- return null;
- }
-
- /**
- * @Override
- */
- @Override
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_CreateEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_DeleteEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Comment_AnnotatedElementEdge == req.getElementType()) {
- return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- if (UMLElementTypes.Constraint_ConstrainedElementEdge == req.getElementType()) {
- return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * Returns command to reorient EClass based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch (getVisualID(req)) {
- case MessageSyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessageReorientCommand(req));
- case MessageAsyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage2ReorientCommand(req));
- case MessageReplyEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage3ReorientCommand(req));
- case MessageCreateEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage4ReorientCommand(req));
- case MessageDeleteEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage5ReorientCommand(req));
- case MessageLostEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage6ReorientCommand(req));
- case MessageFoundEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * Returns command to reorient EReference based link. New link target or source
- * should be the domain model element associated with this node.
- *
- * @Override
- */
- @Override
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch (getVisualID(req)) {
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomConstraintConstrainedElementReorientCommand(req));
- }
- return super.getReorientReferenceRelationshipCommand(req);
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/GateItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/GateItemSemanticEditPolicy.java
deleted file mode 100644
index 7dd212bb3e2..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/GateItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Soyatec - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage4ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage5ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage6ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7CreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage7ReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessageReorientCommand;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-import org.eclipse.uml2.uml.Gate;
-
-/**
- * @author Jin Liu (jin.liu@soyatec.com)
- */
-public class GateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
-
- /**
- * Constructor.
- *
- * @param elementType
- */
- public GateItemSemanticEditPolicy() {
- super(null);
- }
-
- /**
- * @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.SemanticEditPolicy#getSemanticCommand(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest)
- *
- * @param request
- * @return
- */
- @Override
- protected Command getSemanticCommand(IEditCommandRequest request) {
- if (request instanceof CreateRelationshipRequest) {
- return getCreateRelationshipCommand((CreateRelationshipRequest) request);
- } else if (request instanceof ReorientReferenceRelationshipRequest) {
- return getReorientReferenceRelationshipCommand((ReorientReferenceRelationshipRequest) request);
- } else if (request instanceof ReorientRelationshipRequest) {
- return getReorientRelationshipCommand((ReorientRelationshipRequest) request);
- }
- IEditCommandRequest completedRequest = completeRequest(request);
- Command semanticCommand = getSemanticCommandSwitch(completedRequest);
- if (completedRequest instanceof DestroyRequest) {
- DestroyRequest destroyRequest = (DestroyRequest) completedRequest;
- return shouldProceed(destroyRequest) ? addDeleteViewCommand(semanticCommand, destroyRequest) : null;
- }
- return semanticCommand;
- }
-
- @Override
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- if (selectedEObject instanceof Gate && ((Gate) selectedEObject).getMessage() != null) {
- return UnexecutableCommand.INSTANCE;
- }
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if (provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
- if (deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * @param request
- * @return
- */
- @Override
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch (getVisualID(req)) {
- case MessageSyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessageReorientCommand(req));
- case MessageAsyncEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage2ReorientCommand(req));
- case MessageReplyEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage3ReorientCommand(req));
- case MessageCreateEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage4ReorientCommand(req));
- case MessageDeleteEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage5ReorientCommand(req));
- case MessageLostEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage6ReorientCommand(req));
- case MessageFoundEditPart.VISUAL_ID:
- return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- }
- return super.getReorientRelationshipCommand(req);
- }
-
- /**
- * @param request
- * @return
- */
- @Override
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest request) {
- return super.getReorientReferenceRelationshipCommand(request);
- }
-
- /**
- * @param request
- * @return
- */
- @Override
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- if (UMLElementTypes.Message_SynchEdge == req.getElementType()) {
- return new ICommandProxy(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
- } else if (UMLElementTypes.Message_AsynchEdge == req.getElementType()) {
- return new ICommandProxy(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- } else if (UMLElementTypes.Message_ReplyEdge == req.getElementType()) {
- return new ICommandProxy(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- } else if (UMLElementTypes.Message_LostEdge == req.getElementType()) {
- return new ICommandProxy(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- } else if (UMLElementTypes.Message_FoundEdge == req.getElementType()) {
- return new ICommandProxy(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
- }
- return super.getCreateRelationshipCommand(req);
- }
-}

Back to the top