Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-08-21 11:43:07 +0000
committerCamille Letavernier2014-08-21 13:50:25 +0000
commitdbc038b44bcbb890ae256d15eb09eb285512f020 (patch)
tree757e736583eea3ae352ad9ac91a81df7e59b79ff /plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence
parentea48a20561464c3cbb7895d430583669a9f82fcc (diff)
downloadorg.eclipse.papyrus-dbc038b44bcbb890ae256d15eb09eb285512f020.tar.gz
org.eclipse.papyrus-dbc038b44bcbb890ae256d15eb09eb285512f020.tar.xz
org.eclipse.papyrus-dbc038b44bcbb890ae256d15eb09eb285512f020.zip
[Code style] Apply clean-up and formatter on Main plug-ins
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/CreateSequenceDiagramCommand.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/CustomMessages.java14
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/RestoreExecutionEndAdvice.java93
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/SequenceDiagramCreationCondition.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/SequenceDiagramEditorFactory.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/SequencePaletteFactory.java203
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/SequenceViewDependentsAdvice.java54
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/UmlSequenceDiagramForMultiEditor.java23
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/AnnotatedLinkEditCommand.java81
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/ChangeEdgeTargetCommand.java44
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CreateElementAndNodeCommand.java52
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CreateGateElementAndViewCommand.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CreateGateViewCommand.java88
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CreateLocatedConnectionViewCommand.java81
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomActionExecutionSpecificationCreateCommand.java16
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomBehaviorExecutionSpecificationCreateCommand.java14
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomCombinedFragment2CreateCommand.java16
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomCombinedFragmentCreateCommand.java22
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomCommentAnnotatedElementReorientCommand.java12
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomConsiderIgnoreFragmentCreateCommand.java26
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomConstraintConstrainedElementReorientCommand.java12
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomConstraintCreateCommand.java23
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomContextLinkCreateCommand.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomContinuationCreateCommand.java32
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomDestructionOccurrenceSpecificationCreateCommand.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomDurationConstraintCreateCommand.java18
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomDurationConstraintInMessageCreateCommand.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomDurationObservationCreateCommand.java94
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomGeneralOrderingCreateCommand.java30
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomInteractionCreateCommand.java18
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomInteractionOperandCreateCommand.java28
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomInteractionUseCreateCommand.java18
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomLifelineCreateCommand.java38
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage2CreateCommand.java48
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage2ReorientCommand.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage3CreateCommand.java40
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage3ReorientCommand.java30
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage4CreateCommand.java34
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage4ReorientCommand.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage5CreateCommand.java58
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage5ReorientCommand.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage6CreateCommand.java24
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage6ReorientCommand.java14
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage7CreateCommand.java24
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage7ReorientCommand.java42
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessageCreateCommand.java52
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessageReorientCommand.java44
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomStateInvariantCreateCommand.java14
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomTimeConstraintCreateCommand.java30
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomTimeObservationCreateCommand.java26
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomZOrderCommand.java4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/ExecutionOccurrenceSpecificationMessageCreateCommand.java79
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/ExecutionOccurrenceSpecificationMessageReorientCommand.java64
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/PromptCreateElementAndNodeCommand.java41
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/ReconnectToGateCommand.java34
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/RestoreDurationConstraintLinkCommand.java34
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/draw2d/routers/DurationConstraintAutomaticRouter.java9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/draw2d/routers/MessageRouter.java266
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/AnchorHelper.java115
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/MessageLabelHelper.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/advice/ConstraintHelperAdvice.java44
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/advice/NamespaceHelperAdvice.java40
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AbstractExecutionSpecificationEditPart.java221
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AbstractMessageEditPart.java236
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AnnotatedLinkEditPart.java90
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/BehaviorExecutionSpecificationBehaviorEditPart.java10
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/BorderItemLabelEditPart.java256
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomActionExecutionSpecificationEditPart.java24
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomBehaviorExecutionSpecificationEditPart.java148
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCombinedFragment2EditPart.java18
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCombinedFragmentCombinedFragmentCompartmentEditPart.java110
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCombinedFragmentEditPart.java249
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCommentAnnotatedElementEditPart.java31
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCommentBodyEditPart.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCommentEditPart.java12
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomConsiderIgnoreFragmentEditPart.java45
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomConstraint2EditPart.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomConstraintConstrainedElementEditPart.java4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomConstraintEditPart.java32
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomContinuationEditPart.java36
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDestructionOccurrenceSpecificationEditPart.java24
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationConstraintAppliedStereotypeEditPart.java16
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationConstraintEditPart.java361
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationConstraintInMessageAppliedStereotypeEditPart.java5
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationConstraintInMessageEditPart.java38
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationObservationAppliedStereotypeEditPart.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationObservationEditPart.java28
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomGeneralOrderingEditPart.java59
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionEditPart.java212
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionInteractionCompartmentEditPart.java12
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionNameEditPart.java14
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionOperandEditPart.java412
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionUseEditPart.java173
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionUseName2EditPart.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionUseNameEditPart.java5
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomLifelineEditPart.java569
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomLifelineNameEditPart.java58
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessage2EditPart.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessage3EditPart.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessage4EditPart.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessage5EditPart.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessage6EditPart.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessage7EditPart.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageEditPart.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName2EditPart.java68
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName3EditPart.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName4EditPart.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName5EditPart.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName6EditPart.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName7EditPart.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageNameEditPart.java26
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomPackageEditPart.java24
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomStateInvariantEditPart.java160
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomStateInvariantLabelEditPart.java5
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeConstraintAppliedStereotypeEditPart.java18
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeConstraintEditPart.java70
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeConstraintLabelEditPart.java11
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeObservationAppliedStereotypeEditPart.java18
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeObservationEditPart.java76
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeObservationLabelEditPart.java108
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ExecutionSpecificationEndEditPart.java220
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GateEditPart.java158
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GateNameEditPart.java164
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GatesHolderEditPart.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionFragmentEditPart.java84
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionOperandGuardEditPart.java405
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageEndEditPart.java257
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageEndHelper.java7
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ObservationLinkEditPart.java29
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AbstractHeadImpactLayoutEditPolicy.java85
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AbstractMessageItemSemanticEditPolicy.java33
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AnnotatedConnectionHandleEditPolicy.java12
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AnnotatedLinkEndEditPolicy.java208
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AnnotatedLinkEndpointEditPolicy.java36
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AnnotatedLinkStartEditPolicy.java82
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AppliedStereotypeCommentCreationEditPolicyEx.java188
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AppliedStereotypeExternalNodeLabelEditPolicy.java62
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentCreationEditPolicy.java86
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentHeadImpactLayoutEditPolicy.java44
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentItemComponentEditPolicy.java30
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CreationOnMessageEditPolicy.java65
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CustomAppliedStereotypeContextLinkLabelDisplayEditPolicy.java14
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CustomConnectionHandleEditPolicy.java18
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CustomDiagramDragDropEditPolicy.java659
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CustomExternalLabelPrimaryDragRoleEditPolicy.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DeleteTimeElementWithoutEventPolicy.java209
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DestructionEventComponentEditPolicy.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ElementCreationWithMessageEditPolicy.java121
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ExecutionGraphicalNodeEditPolicy.java49
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ExecutionSpecificationComponentEditPolicy.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ExecutionSpecificationEndGraphicalNodeEditPolicy.java179
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ExternalLabelPrimaryDragRoleEditPolicy.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/GateCreationEditPolicy.java92
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/GateGraphicalNodeEditPolicy.java82
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/GatesHolderGraphicalNodeEditPolicy.java197
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/HighlightEditPolicy.java172
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionCompartmentXYLayoutEditPolicy.java470
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionFragmentsCreationEditPolicy.java14
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionFragmentsOrderingEditPolicy.java18
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionGraphicalNodeEditPolicy.java172
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionHeadImpactLayoutEditPolicy.java69
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandAppliedStereotypeLabelDisplayEditPolicy.java16
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandComponentEditPolicy.java28
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandDragDropEditPolicy.java16
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandLayoutEditPolicy.java96
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineAppliedStereotypeNodeLabelDisplayEditPolicy.java10
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineChildGraphicalNodeEditPolicy.java139
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineCreationEditPolicy.java70
-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/LifelineLabelEditPolicy.java52
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineSelectionEditPolicy.java127
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineXYLayoutEditPolicy.java410
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageConnectionEditPolicy.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageConnectionLineSegEditPolicy.java273
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageLabelEditPolicy.java204
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MoveableNonResizableLabelEditPolicy.java34
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ObservationLinkPolicy.java309
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/RemoveOrphanViewPolicy.java12
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/SequenceConnectionHandleEditPolicy.java42
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/SequenceGraphicalNodeEditPolicy.java326
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/TimeRelatedSelectionEditPolicy.java90
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomActionExecutionSpecificationItemSemanticEditPolicy.java76
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomBehaviorExecutionSpecificationItemSemanticEditPolicy.java76
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomCombinedFragment2ItemSemanticEditPolicy.java62
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomCombinedFragmentCombinedFragmentCompartmentItemSemanticEditPolicy.java47
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomCombinedFragmentItemSemanticEditPolicy.java54
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomCommentAnnotatedElementItemSemanticEditPolicy.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomCommentItemSemanticEditPolicy.java52
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomConsiderIgnoreFragmentItemSemanticEditPolicy.java54
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomConstraintConstrainedElementItemSemanticEditPolicy.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomConstraintItemSemanticEditPolicy.java56
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomContinuationItemSemanticEditPolicy.java52
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomDestructionOccurrenceSpecificationItemSemanticEditPolicy.java60
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomDurationConstraintInMessageItemSemanticEditPolicy.java52
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomDurationConstraintItemSemanticEditPolicy.java52
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomDurationObservationItemSemanticEditPolicy.java52
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomGeneralOrderingItemSemanticEditPolicy.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionContextLinkSemanticEditPolicy.java5
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionInteractionCompartmentItemSemanticEditPolicy.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionItemSemanticEditPolicy.java54
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionOperandContextLinkSemanticEditPolicy.java41
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionOperandItemSemanticEditPolicy.java130
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionUseItemSemanticEditPolicy.java52
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomLifelineItemSemanticEditPolicy.java134
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessage2ItemSemanticEditPolicy.java60
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessage3ItemSemanticEditPolicy.java58
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessage4ItemSemanticEditPolicy.java58
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessage5ItemSemanticEditPolicy.java58
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessage6ItemSemanticEditPolicy.java58
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessage7ItemSemanticEditPolicy.java58
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageItemSemanticEditPolicy.java58
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomPackageItemSemanticEditPolicy.java4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomStateInvariantItemSemanticEditPolicy.java52
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomTimeConstraintItemSemanticEditPolicy.java52
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomTimeObservationItemSemanticEditPolicy.java52
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/GateItemSemanticEditPolicy.java42
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/AppliedStereotypeLabelFigure.java39
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/CoRegionCombinedFragmentFigure.java28
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/CombinedFragmentFigure.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/CustomContextLinkFigure.java4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/DestructionEventFigure.java14
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/EllipseDecoration.java5
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/InteractionOperandFigure.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/InteractionUseRectangleFigure.java4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/LifelineDotLineCustomFigure.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/LifelineFigure.java63
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageAsync.java5
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageCreate.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageDelete.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageFigure.java38
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageFound.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageLost.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageReply.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageSync.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/StereotypeInteractionFigure.java42
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/handlers/CustomAlignmentHandler.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/handlers/CustomSizeHandler.java90
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/CellEditorLocators.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/CenterLocator.java80
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/ContinuationLocator.java16
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/GateLocator.java75
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/LabelCellEditorLocator.java7
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/MultilineCellEditorLocator.java7
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/SelfMessageLabelLocator.java18
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/TextCellEditorLocator.java9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/TimeMarkElementPositionLocator.java158
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/parser/custom/DurationObservationParser.java31
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/parser/custom/InteractionUseCustomParsers.java32
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/parser/custom/LifelineCustomParsers.java61
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/parser/custom/MessageCustomParser.java34
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/parser/custom/TimeConstraintParser.java88
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/parser/custom/TimeObservationParser.java30
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CustomCombinedFragmentPreferencePage.java48
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CustomConsiderIgnoreFragmentPreferencePage.java18
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CustomDestructionOccurrenceSpecificationPreferencePage.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CustomDiagramPreferenceInitializer.java7
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CustomInteractionOperandPreferencePage.java18
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DestructionEventPreferencePage.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomEditPartProvider.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomEditPolicyProvider.java54
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomModelingAssistantProvider.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomNamespaceEditPolicyProvider.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomValidationProvider.java22
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomViewProvider.java17
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/DisplayBehaviorContributionItem.java30
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/DurationConstraintContributionItem.java57
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/PostEditPolicyProvider.java30
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/service/DurationCreationTool.java133
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/BehaviorDisplayHelper.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/CombinedFragmentDeleteHelper.java75
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/CommandHelper.java735
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/DestructionOccurrenceUtil.java27
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/DurationLinkConstraint.java22
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/ElementIconUtil.java14
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/EventHelper.java182
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/FixGateViewOnOpening.java117
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/FixInteractionOperandsOnOpening.java28
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/FragmentsOrderer.java139
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/FragmentsOrdererHelper.java146
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/GateHelper.java268
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/GateModelElementFactory.java18
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/HighlightUtil.java100
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/InteractionOperandModelElementFactory.java22
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/InteractionOperatorKindCompatibleMapping.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/InteractionUseUtil.java14
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineCoveredByUpdater.java64
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineEditPartUtil.java38
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineHeadUtil.java204
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineLabelHelper.java36
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineMessageCreateHelper.java144
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineModelChildrenHelper.java52
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineResizeHelper.java25
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LinkRouteModelElementFactory.java32
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LoopOperatorUtil.java24
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/MessageAnchorRepairer.java58
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/MessageConnectionHelper.java108
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/MessageStyleElementFactory.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/NotificationHelper.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/OccurrenceSpecificationHelper.java70
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/OccurrenceSpecificationMoveHelper.java644
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/OperandBoundsComputeHelper.java755
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/OperationUtil.java98
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/PreferencesModelElementFactory.java4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/ReconnectMessageHelper.java128
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SelectOrCreateDialog.java187
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SelfMessageHelper.java40
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceDeleteHelper.java213
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceLinkMappingHelper.java32
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceRequestConstant.java4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceUtil.java1042
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SignalUtil.java52
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/TooltipHook.java40
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/TooltipUtil.java157
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/validation/FragmentOrderingKeeper.java363
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/validation/UMLValidationHelper.java60
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/Activator.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ActionExecutionSpecificationCreateCommand.java32
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/BehaviorExecutionSpecificationCreateCommand.java32
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/CombinedFragment2CreateCommand.java35
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/CombinedFragmentCreateCommand.java37
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/CommentAnnotatedElementCreateCommand.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/CommentAnnotatedElementReorientCommand.java29
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/CommentCreateCommand.java33
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ConsiderIgnoreFragmentCreateCommand.java37
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ConstraintConstrainedElementCreateCommand.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ConstraintConstrainedElementReorientCommand.java29
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ConstraintCreateCommand.java33
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ContextLinkCreateCommand.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ContextLinkReorientCommand.java27
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ContinuationCreateCommand.java35
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/DestructionOccurrenceSpecificationCreateCommand.java33
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/DurationConstraintCreateCommand.java33
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/DurationConstraintInMessageCreateCommand.java33
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/DurationObservationCreateCommand.java33
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/GeneralOrderingCreateCommand.java37
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/GeneralOrderingReorientCommand.java37
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/InteractionCreateCommand.java33
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/InteractionOperandCreateCommand.java35
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/InteractionUseCreateCommand.java37
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/LifelineCreateCommand.java37
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message2CreateCommand.java36
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message2ReorientCommand.java43
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message3CreateCommand.java36
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message3ReorientCommand.java43
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message4CreateCommand.java36
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message4ReorientCommand.java43
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message5CreateCommand.java36
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message5ReorientCommand.java43
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message6CreateCommand.java36
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message6ReorientCommand.java45
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message7CreateCommand.java36
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message7ReorientCommand.java45
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/MessageCreateCommand.java36
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/MessageReorientCommand.java43
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/StateInvariantCreateCommand.java35
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/TimeConstraintCreateCommand.java33
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/TimeObservationCreateCommand.java33
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/UMLReorientConnectionViewCommand.java10
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/ActionExecutionSpecificationEditHelper.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/BehaviorExecutionSpecificationEditHelper.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/CombinedFragmentEditHelper.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/CommentEditHelper.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/ConsiderIgnoreFragmentEditHelper.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/ConstraintEditHelper.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/ContinuationEditHelper.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/DestructionEventEditHelper.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/DurationConstraintEditHelper.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/DurationConstraintInMessageEditHelper.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/DurationObservationEditHelper.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/InteractionEditHelper.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/InteractionOperandEditHelper.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/InteractionUseEditHelper.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/LifelineEditHelper.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/MessageEditHelper.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/MessageOccurrenceSpecificationEditHelper.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/PackageEditHelper.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/StateInvariantEditHelper.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/TimeConstraintEditHelper.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/TimeObservationEditHelper.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/UMLBaseEditHelper.java9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ActionExecutionSpecificationEditPart.java401
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ActionExecutionSpecificationNameEditPart.java213
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/BehaviorExecutionSpecificationEditPart.java401
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CombinedFragment2EditPart.java353
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CombinedFragmentCombinedFragmentCompartmentEditPart.java33
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CombinedFragmentEditPart.java388
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CommentAnnotatedElementEditPart.java11
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CommentBodyEditPart.java252
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CommentEditPart.java416
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConsiderIgnoreFragmentEditPart.java370
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Constraint2EditPart.java248
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintConstrainedElementEditPart.java11
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintContextAppliedStereotypeEditPart.java239
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintEditPart.java428
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintNameEditPart.java252
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ContextLinkEditPart.java24
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ContinuationEditPart.java366
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ContinuationNameEditPart.java258
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DestructionOccurrenceSpecificationEditPart.java364
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintAppliedStereotypeEditPart.java260
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintEditPart.java412
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintInMessageAppliedStereotypeEditPart.java260
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintInMessageEditPart.java427
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintInMessageLabelEditPart.java252
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintLabelEditPart.java258
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationObservationAppliedStereotypeEditPart.java260
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationObservationEditPart.java381
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationObservationLabelEditPart.java252
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GeneralOrderingAppliedStereotypeEditPart.java249
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GeneralOrderingEditPart.java23
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionEditPart.java387
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionInteractionCompartmentEditPart.java28
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionNameEditPart.java250
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionOperandEditPart.java372
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionUseEditPart.java368
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionUseName2EditPart.java246
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionUseNameEditPart.java246
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/LifelineEditPart.java432
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/LifelineNameEditPart.java254
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Message2EditPart.java32
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Message3EditPart.java32
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Message4EditPart.java32
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Message5EditPart.java32
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Message6EditPart.java32
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Message7EditPart.java32
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageAsyncAppliedStereotypeEditPart.java243
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageCreateAppliedStereotypeEditPart.java243
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageDeleteAppliedStereotypeEditPart.java243
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageEditPart.java32
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageFoundAppliedStereotypeEditPart.java251
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageLostAppliedStereotypeEditPart.java243
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName2EditPart.java247
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName3EditPart.java247
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName4EditPart.java247
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName5EditPart.java247
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName6EditPart.java247
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName7EditPart.java247
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageNameEditPart.java247
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageReplyAppliedStereotypeEditPart.java243
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageSyncAppliedStereotypeEditPart.java243
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/PackageEditPart.java9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/StateInvariantEditPart.java377
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/StateInvariantLabelEditPart.java256
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/StateInvariantNameEditPart.java258
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeConstraintAppliedStereotypeEditPart.java260
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeConstraintEditPart.java412
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeConstraintLabelEditPart.java258
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeObservationAppliedStereotypeEditPart.java260
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeObservationEditPart.java366
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeObservationLabelEditPart.java260
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/UMLEditPartFactory.java26
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ActionExecutionSpecificationItemSemanticEditPolicy.java134
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/BehaviorExecutionSpecificationItemSemanticEditPolicy.java134
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragment2ItemSemanticEditPolicy.java134
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentCombinedFragmentCompartmentCanonicalEditPolicy.java45
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentCombinedFragmentCompartmentItemSemanticEditPolicy.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentItemSemanticEditPolicy.java134
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CommentAnnotatedElementItemSemanticEditPolicy.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CommentItemSemanticEditPolicy.java140
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ConsiderIgnoreFragmentItemSemanticEditPolicy.java134
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ConstraintConstrainedElementItemSemanticEditPolicy.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ConstraintItemSemanticEditPolicy.java148
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ContextLinkItemSemanticEditPolicy.java1
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ContinuationItemSemanticEditPolicy.java136
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DestructionOccurrenceSpecificationItemSemanticEditPolicy.java144
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DurationConstraintInMessageItemSemanticEditPolicy.java148
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DurationConstraintItemSemanticEditPolicy.java148
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DurationObservationItemSemanticEditPolicy.java136
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/GeneralOrderingItemSemanticEditPolicy.java132
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionCanonicalEditPolicy.java47
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionInteractionCompartmentCanonicalEditPolicy.java49
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionInteractionCompartmentItemSemanticEditPolicy.java47
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionItemSemanticEditPolicy.java163
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandCanonicalEditPolicy.java49
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandItemSemanticEditPolicy.java175
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionUseItemSemanticEditPolicy.java136
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineCanonicalEditPolicy.java49
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineItemSemanticEditPolicy.java193
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message2ItemSemanticEditPolicy.java136
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message3ItemSemanticEditPolicy.java134
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message4ItemSemanticEditPolicy.java134
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message5ItemSemanticEditPolicy.java134
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message6ItemSemanticEditPolicy.java134
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message7ItemSemanticEditPolicy.java134
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageItemSemanticEditPolicy.java134
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/OpenDiagramEditPolicy.java31
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/PackageCanonicalEditPolicy.java242
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/PackageItemSemanticEditPolicy.java24
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/StateInvariantItemSemanticEditPolicy.java136
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/TimeConstraintItemSemanticEditPolicy.java148
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/TimeObservationItemSemanticEditPolicy.java136
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UMLBaseItemSemanticEditPolicy.java180
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UMLTextNonResizableEditPolicy.java61
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UMLTextSelectionEditPolicy.java58
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/expressions/UMLAbstractExpression.java48
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/expressions/UMLOCLFactory.java64
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLAbstractNavigatorItem.java9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLDomainNavigatorContentProvider.java68
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLDomainNavigatorItem.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLDomainNavigatorLabelProvider.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorActionProvider.java40
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorContentProvider.java511
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorGroup.java10
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorItem.java16
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorLabelProvider.java113
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorLinkHelper.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorSorter.java7
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/parsers/AbstractParser.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/parsers/MessageFormatParser.java33
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/DeleteElementAction.java4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/DiagramEditorContextMenuProvider.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/LoadResourceAction.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/Messages.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/ModelElementSelectionPage.java7
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLCreationWizard.java15
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLCreationWizardPage.java14
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramActionBarContributor.java7
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramEditor.java68
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramEditorPlugin.java40
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramEditorUtil.java90
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramUpdateCommand.java22
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramUpdater.java676
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDocumentProvider.java277
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLInitDiagramFileAction.java16
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLLinkDescriptor.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLMatchingStrategy.java9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLNewDiagramFileWizard.java15
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLNodeDescriptor.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLPaletteFactory.java57
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLUriEditorInputTester.java7
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLVisualIDRegistry.java282
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/ValidateAction.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/ActionExecutionSpecificationPreferencePage.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/BehaviorExecutionSpecificationPreferencePage.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CombinedFragmentPreferencePage.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CommentPreferencePage.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/ConsiderIgnoreFragmentPreferencePage.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/ConstraintPreferencePage.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/ContinuationPreferencePage.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DestructionOccurrenceSpecificationPreferencePage.java17
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DiagramAppearancePreferencePage.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DiagramConnectionsPreferencePage.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DiagramGeneralPreferencePage.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DiagramPreferenceInitializer.java5
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DiagramPrintingPreferencePage.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DiagramRulersAndGridPreferencePage.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DurationConstraintInMessagePreferencePage.java5
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DurationConstraintPreferencePage.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DurationObservationPreferencePage.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/InteractionOperandPreferencePage.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/InteractionPreferencePage.java26
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/InteractionUsePreferencePage.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/LifelinePreferencePage.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/MessageOccurrenceSpecificationPreferencePage.java5
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/MessagePreferencePage.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/StateInvariantPreferencePage.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/TimeConstraintPreferencePage.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/TimeObservationPreferencePage.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/ElementInitializers.java140
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLEditPartProvider.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLElementTypes.java15
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLIconProvider.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLMarkerNavigationProvider.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLModelingAssistantProvider.java436
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLParserProvider.java107
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLValidationDecoratorProvider.java22
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLValidationProvider.java47
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLViewProvider.java359
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/sheet/UMLPropertySection.java5
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/sheet/UMLSheetLabelProvider.java26
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/test/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineXYLayoutEditPolicyTest.java2
571 files changed, 26976 insertions, 24619 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/CreateSequenceDiagramCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/CreateSequenceDiagramCommand.java
index 03e5c385d8c..c5d50abb0ad 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/CreateSequenceDiagramCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/CreateSequenceDiagramCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/CustomMessages.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/CustomMessages.java
index bf0dbbce63a..faa6b9fd409 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/CustomMessages.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/CustomMessages.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -50,37 +50,37 @@ public class CustomMessages extends NLS {
/**
* Error notification title when a link can not be dropped
- *
+ *
*/
public static String DropError_DefaultTitle;
/**
* Error notification message when a link can not be dropped
- *
+ *
*/
public static String DropError_DefaultTxt;
/**
* Error notification title when a message can not be dropped because it goes uphill
- *
+ *
*/
public static String DropError_UphillMessageTitle;
/**
* Error notification message when a message can not be dropped because it goes uphill
- *
+ *
*/
public static String DropError_UphillMessageTxt;
/**
* Warning notification title when the resize of an interaction operand may have an erratic behavior
- *
+ *
*/
public static String Warning_ResizeInteractionOperandTitle;
/**
* Warning notification message when the resize of an interaction operand may have an erratic behavior
- *
+ *
*/
public static String Warning_ResizeInteractionOperandTxt;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/RestoreExecutionEndAdvice.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/RestoreExecutionEndAdvice.java
index bcc771532f5..679636cbc12 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/RestoreExecutionEndAdvice.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/RestoreExecutionEndAdvice.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -40,48 +40,48 @@ import org.eclipse.uml2.uml.UMLPackage;
/**
* Update execution ends after the connected message was removed.
- *
+ *
* See https://bugs.eclipse.org/bugs/show_bug.cgi?id=402975
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class RestoreExecutionEndAdvice extends AbstractEditHelperAdvice {
/**
* @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getAfterDestroyElementCommand(org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest)
- *
+ *
* @param request
* @return
*/
@Override
protected ICommand getAfterDestroyElementCommand(DestroyElementRequest request) {
EObject elementToDestroy = request.getElementToDestroy();
- if(elementToDestroy instanceof Message) {
- final Message message = (Message)elementToDestroy;
+ if (elementToDestroy instanceof Message) {
+ final Message message = (Message) elementToDestroy;
MessageEnd receiveEvent = message.getReceiveEvent();
MessageEnd sendEvent = message.getSendEvent();
CompositeCommand command = new CompositeCommand("Restore Execution End");
- if(receiveEvent instanceof MessageOccurrenceSpecification) {
- OccurrenceSpecification end = (OccurrenceSpecification)receiveEvent;
+ if (receiveEvent instanceof MessageOccurrenceSpecification) {
+ OccurrenceSpecification end = (OccurrenceSpecification) receiveEvent;
addRestoreExecutionEndCcommand(command, request.getEditingDomain(), end, true);
addRestoreExecutionEndCcommand(command, request.getEditingDomain(), end, false);
}
- if(sendEvent instanceof MessageOccurrenceSpecification) {
- OccurrenceSpecification end = (OccurrenceSpecification)sendEvent;
+ if (sendEvent instanceof MessageOccurrenceSpecification) {
+ OccurrenceSpecification end = (OccurrenceSpecification) sendEvent;
addRestoreExecutionEndCcommand(command, request.getEditingDomain(), end, true);
addRestoreExecutionEndCcommand(command, request.getEditingDomain(), end, false);
}
- if(command.canExecute()) {
+ if (command.canExecute()) {
return command.reduce();
}
}
- //Try to restore the end of execution when the message end has been removed.
- else if(elementToDestroy instanceof MessageOccurrenceSpecification) {
+ // Try to restore the end of execution when the message end has been removed.
+ else if (elementToDestroy instanceof MessageOccurrenceSpecification) {
CompositeCommand command = new CompositeCommand("Restore Execution End");
- MessageOccurrenceSpecification end = (MessageOccurrenceSpecification)elementToDestroy;
+ MessageOccurrenceSpecification end = (MessageOccurrenceSpecification) elementToDestroy;
addRestoreExecutionEndCcommand(command, request.getEditingDomain(), end, true);
addRestoreExecutionEndCcommand(command, request.getEditingDomain(), end, false);
- if(command.canExecute()) {
+ if (command.canExecute()) {
return command.reduce();
}
}
@@ -90,18 +90,18 @@ public class RestoreExecutionEndAdvice extends AbstractEditHelperAdvice {
private void addRestoreExecutionEndCcommand(CompositeCommand command, TransactionalEditingDomain editingDomain, OccurrenceSpecification end, boolean isStart) {
ExecutionSpecification execution = OccurrenceSpecificationHelper.findExecutionWith(end, isStart);
- if(execution == null) {
+ if (execution == null) {
return;
}
RestoreExecutionEndCommand cmd = new RestoreExecutionEndCommand(editingDomain, execution, isStart);
- cmd.setContainer((InteractionFragment)end.eContainer());
+ cmd.setContainer((InteractionFragment) end.eContainer());
cmd.setCovered(end.getCovered());
- //Add index support.
+ // Add index support.
int executionIndex = getIndex(execution);
int index = getIndex(end);
- if(isStart && index > executionIndex) {
+ if (isStart && index > executionIndex) {
index = executionIndex;
- } else if(!isStart && index <= executionIndex) {
+ } else if (!isStart && index <= executionIndex) {
index = executionIndex + 1;
}
cmd.setIndex(index);
@@ -109,14 +109,14 @@ public class RestoreExecutionEndAdvice extends AbstractEditHelperAdvice {
}
private int getIndex(InteractionFragment fragment) {
- if(fragment == null || fragment.eContainer() == null) {
+ if (fragment == null || fragment.eContainer() == null) {
return -1;
}
EObject parent = fragment.eContainer();
- if(parent instanceof Interaction) {
- return ((Interaction)parent).getFragments().indexOf(fragment);
- } else if(parent instanceof InteractionOperand) {
- return ((InteractionOperand)parent).getFragments().indexOf(fragment);
+ if (parent instanceof Interaction) {
+ return ((Interaction) parent).getFragments().indexOf(fragment);
+ } else if (parent instanceof InteractionOperand) {
+ return ((InteractionOperand) parent).getFragments().indexOf(fragment);
}
return -1;
}
@@ -135,7 +135,7 @@ public class RestoreExecutionEndAdvice extends AbstractEditHelperAdvice {
/**
* Constructor.
- *
+ *
* @param domain
* @param isStart
*/
@@ -153,9 +153,8 @@ public class RestoreExecutionEndAdvice extends AbstractEditHelperAdvice {
}
/**
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.core.runtime.IAdaptable)
- *
+ * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+ *
* @param monitor
* @param info
* @return
@@ -163,34 +162,34 @@ public class RestoreExecutionEndAdvice extends AbstractEditHelperAdvice {
*/
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- //Once the execution has been removed, ignore it.
- if(execution.eContainer() == null) {
+ // Once the execution has been removed, ignore it.
+ if (execution.eContainer() == null) {
return CommandResult.newOKCommandResult();
}
ExecutionOccurrenceSpecification newEnd = null;
- InteractionFragment container = (InteractionFragment)getContainer();
+ InteractionFragment container = getContainer();
EList<InteractionFragment> fragments = null;
- if(container instanceof Interaction) {
- newEnd = (ExecutionOccurrenceSpecification)((Interaction)container).createFragment(null, UMLPackage.eINSTANCE.getExecutionOccurrenceSpecification());
- fragments = ((Interaction)container).getFragments();
- } else if(container instanceof InteractionOperand) {
- newEnd = (ExecutionOccurrenceSpecification)((InteractionOperand)container).createFragment(null, UMLPackage.eINSTANCE.getExecutionOccurrenceSpecification());
- fragments = ((InteractionOperand)container).getFragments();
+ if (container instanceof Interaction) {
+ newEnd = (ExecutionOccurrenceSpecification) ((Interaction) container).createFragment(null, UMLPackage.eINSTANCE.getExecutionOccurrenceSpecification());
+ fragments = ((Interaction) container).getFragments();
+ } else if (container instanceof InteractionOperand) {
+ newEnd = (ExecutionOccurrenceSpecification) ((InteractionOperand) container).createFragment(null, UMLPackage.eINSTANCE.getExecutionOccurrenceSpecification());
+ fragments = ((InteractionOperand) container).getFragments();
}
- if(newEnd == null) {
+ if (newEnd == null) {
return CommandResult.newCancelledCommandResult();
}
newEnd.setExecution(execution);
newEnd.setCovered(getCovered());
- if(isStart) {
+ if (isStart) {
newEnd.setName(execution.getName() + "Start");
execution.setStart(newEnd);
} else {
newEnd.setName(execution.getName() + "Finish");
execution.setFinish(newEnd);
}
- //Index support.
- if(index != -1 && fragments != null && index >= 0 && index < fragments.size() && fragments.indexOf(newEnd) != index) {
+ // Index support.
+ if (index != -1 && fragments != null && index >= 0 && index < fragments.size() && fragments.indexOf(newEnd) != index) {
fragments.move(index, newEnd);
}
return CommandResult.newOKCommandResult();
@@ -200,15 +199,15 @@ public class RestoreExecutionEndAdvice extends AbstractEditHelperAdvice {
* @return the container
*/
public InteractionFragment getContainer() {
- if(container == null && execution != null) {
- return (InteractionFragment)execution.eContainer();
+ if (container == null && execution != null) {
+ return (InteractionFragment) execution.eContainer();
}
return container;
}
/**
* @param container
- * the container to set
+ * the container to set
*/
public void setContainer(InteractionFragment container) {
this.container = container;
@@ -218,7 +217,7 @@ public class RestoreExecutionEndAdvice extends AbstractEditHelperAdvice {
* @return the covered
*/
public Lifeline getCovered() {
- if(covered == null && execution != null) {
+ if (covered == null && execution != null) {
EList<Lifeline> covereds = execution.getCovereds();
return covereds.size() != 0 ? covereds.get(0) : null;
}
@@ -227,7 +226,7 @@ public class RestoreExecutionEndAdvice extends AbstractEditHelperAdvice {
/**
* @param covered
- * the covered to set
+ * the covered to set
*/
public void setCovered(Lifeline covered) {
this.covered = covered;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/SequenceDiagramCreationCondition.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/SequenceDiagramCreationCondition.java
index eeb5331c50f..d0aaece96e1 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/SequenceDiagramCreationCondition.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/SequenceDiagramCreationCondition.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010 Atos Origin.
- *
+ *
* 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/SequenceDiagramEditorFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/SequenceDiagramEditorFactory.java
index 32c702571bb..312407be3ed 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/SequenceDiagramEditorFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/SequenceDiagramEditorFactory.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/SequencePaletteFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/SequencePaletteFactory.java
index 0d7490b1216..c5a3ef15b2d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/SequencePaletteFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/SequencePaletteFactory.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -96,59 +96,59 @@ public class SequencePaletteFactory extends PaletteFactory.Adapter {
@Override
public Tool createTool(String toolId) {
- if(toolId.equals(CREATECOMBINEDFRAGMENTTOOL)) {
+ if (toolId.equals(CREATECOMBINEDFRAGMENTTOOL)) {
return createCombinedFragment5CreationTool();
}
// add
- if(toolId.equals(CREATECONSIDERIGNOREFRAGMENTTOOL)) {
+ if (toolId.equals(CREATECONSIDERIGNOREFRAGMENTTOOL)) {
return createConsiderIgnoreFragmentCreationTool();
}
- if(toolId.equals(CREATECOMMENTTOOL)) {
+ if (toolId.equals(CREATECOMMENTTOOL)) {
return createComment9CreationTool();
}
- if(toolId.equals(CREATECONSTRAINTTOOL)) {
+ if (toolId.equals(CREATECONSTRAINTTOOL)) {
return createConstraint10CreationTool();
}
- if(toolId.equals(CREATEDURATIONOBSERVATIONTOOL)) {
+ if (toolId.equals(CREATEDURATIONOBSERVATIONTOOL)) {
return createDurationObservation12CreationTool();
}
- if(toolId.equals(CREATETIMEOBSERVATIONTOOL)) {
+ if (toolId.equals(CREATETIMEOBSERVATIONTOOL)) {
return createTimeObservation14CreationTool();
}
- if(toolId.equals(CREATEDURATIONCONSTRAINTTOOL)) {
+ if (toolId.equals(CREATEDURATIONCONSTRAINTTOOL)) {
return createDurationConstraint15CreationTool();
}
- if(toolId.equals(CREATEDESTRUCTIONEVENTTOOL)) {
+ if (toolId.equals(CREATEDESTRUCTIONEVENTTOOL)) {
return createDestructionEvent16CreationTool();
}
- if(toolId.equals(CREATEMESSAGESYNCTOOL)) {
+ if (toolId.equals(CREATEMESSAGESYNCTOOL)) {
return createMessageSync1CreationTool();
}
- if(toolId.equals(CREATEMESSAGEASYNCTOOL)) {
+ if (toolId.equals(CREATEMESSAGEASYNCTOOL)) {
return createMessageAsync2CreationTool();
}
- if(toolId.equals(CREATEMESSAGEREPLYTOOL)) {
+ if (toolId.equals(CREATEMESSAGEREPLYTOOL)) {
return createMessageReply3CreationTool();
}
- if(toolId.equals(CREATEMESSAGECREATETOOL)) {
+ if (toolId.equals(CREATEMESSAGECREATETOOL)) {
return createMessageCreate4CreationTool();
}
- if(toolId.equals(CREATEMESSAGEDELETETOOL)) {
+ if (toolId.equals(CREATEMESSAGEDELETETOOL)) {
return createMessageDelete5CreationTool();
}
- if(toolId.equals(CREATEMESSAGELOSTTOOL)) {
+ if (toolId.equals(CREATEMESSAGELOSTTOOL)) {
return createMessageLost6CreationTool();
}
- if(toolId.equals(CREATEMESSAGEFOUNDTOOL)) {
+ if (toolId.equals(CREATEMESSAGEFOUNDTOOL)) {
return createMessageFound7CreationTool();
}
- if(toolId.equals(CREATEGENERALORDERINGTOOL)) {
+ if (toolId.equals(CREATEGENERALORDERINGTOOL)) {
return createGeneralOrdering8CreationTool();
}
- if(toolId.equals(CREATEANNOTATEDLINKTOOL)) {
+ if (toolId.equals(CREATEANNOTATEDLINKTOOL)) {
return createAnnotatedLink9CreationTool();
}
- if(toolId.equals(CREATEGATETOOL)) {
+ if (toolId.equals(CREATEGATETOOL)) {
return createGateTool();
}
// default return: null
@@ -161,10 +161,12 @@ public class SequencePaletteFactory extends PaletteFactory.Adapter {
private Tool createGateTool() {
return new CreationTool(new CreationFactory() {
+ @Override
public Object getObjectType() {
return GateEditPart.GATE_TYPE;
}
+ @Override
public Object getNewObject() {
return GateEditPart.GATE_TYPE;
}
@@ -179,7 +181,7 @@ public class SequencePaletteFactory extends PaletteFactory.Adapter {
private Tool createCombinedFragment5CreationTool() {
List<IElementType> types = new ArrayList<IElementType>(2);
- //types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
+ // types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
Tool tool = new AspectUnspecifiedTypeCreationTool(types);
return tool;
@@ -195,19 +197,19 @@ public class SequencePaletteFactory extends PaletteFactory.Adapter {
private Tool createComment9CreationTool() {
List<IElementType> types = new ArrayList<IElementType>(1);
types.add(UMLElementTypes.Comment_3009);
- // Tool tool = new AspectUnspecifiedTypeCreationTool(types){
- // protected Command getCommand() {
- // if (!antiScroll){
- // if(getTargetEditPart() instanceof LifelineEditPart){
- // InteractionInteractionCompartmentEditPart parent = ((LifelineEditPart) getTargetEditPart()).getParentInteractionCompartmentEditPart();
- // if(parent != null)
- // return parent.getCommand( getTargetRequest() );
- // }
- // return super.getCommand();
- // }
- // return null;
- // }
- // };
+ // Tool tool = new AspectUnspecifiedTypeCreationTool(types){
+ // protected Command getCommand() {
+ // if (!antiScroll){
+ // if(getTargetEditPart() instanceof LifelineEditPart){
+ // InteractionInteractionCompartmentEditPart parent = ((LifelineEditPart) getTargetEditPart()).getParentInteractionCompartmentEditPart();
+ // if(parent != null)
+ // return parent.getCommand( getTargetRequest() );
+ // }
+ // return super.getCommand();
+ // }
+ // return null;
+ // }
+ // };
InteractionChildCreationTool tool = new InteractionChildCreationTool(types);
return tool;
}
@@ -215,19 +217,19 @@ public class SequencePaletteFactory extends PaletteFactory.Adapter {
private Tool createConstraint10CreationTool() {
List<IElementType> types = new ArrayList<IElementType>(1);
types.add(UMLElementTypes.Constraint_3008);
- // Tool tool = new AspectUnspecifiedTypeCreationTool(types){
- // protected Command getCommand() {
- // if (!antiScroll){
- // if(getTargetEditPart() instanceof LifelineEditPart){
- // InteractionInteractionCompartmentEditPart parent = ((LifelineEditPart) getTargetEditPart()).getParentInteractionCompartmentEditPart();
- // if(parent != null)
- // return parent.getCommand( getTargetRequest() );
- // }
- // return super.getCommand();
- // }
- // return null;
- // }
- // };
+ // Tool tool = new AspectUnspecifiedTypeCreationTool(types){
+ // protected Command getCommand() {
+ // if (!antiScroll){
+ // if(getTargetEditPart() instanceof LifelineEditPart){
+ // InteractionInteractionCompartmentEditPart parent = ((LifelineEditPart) getTargetEditPart()).getParentInteractionCompartmentEditPart();
+ // if(parent != null)
+ // return parent.getCommand( getTargetRequest() );
+ // }
+ // return super.getCommand();
+ // }
+ // return null;
+ // }
+ // };
InteractionChildCreationTool tool = new InteractionChildCreationTool(types);
return tool;
}
@@ -236,43 +238,43 @@ public class SequencePaletteFactory extends PaletteFactory.Adapter {
List<IElementType> types = new ArrayList<IElementType>(1);
types.add(UMLElementTypes.DurationObservation_3024);
// use DurationCreationTool
- //Tool tool = new DurationCreationTool(types);
- // AspectUnspecifiedTypeCreationTool tool = new AspectUnspecifiedTypeCreationTool(types);
+ // Tool tool = new DurationCreationTool(types);
+ // AspectUnspecifiedTypeCreationTool tool = new AspectUnspecifiedTypeCreationTool(types);
InteractionChildCreationTool tool = new InteractionChildCreationTool(types);
- // tool.setDefaultCursor(SharedCursors.HAND);
- // tool.setDisabledCursor(SharedCursors.NO);
+ // tool.setDefaultCursor(SharedCursors.HAND);
+ // tool.setDisabledCursor(SharedCursors.NO);
return tool;
}
private Tool createTimeObservation14CreationTool() {
List<IElementType> types = new ArrayList<IElementType>(1);
types.add(UMLElementTypes.TimeObservation_3020);
- // AspectUnspecifiedTypeCreationTool tool = new AspectUnspecifiedTypeCreationTool(types){
- // protected Command getCommand() {
- // if (!antiScroll){
- // if(getTargetEditPart() instanceof LifelineEditPart){
- // InteractionInteractionCompartmentEditPart parent = ((LifelineEditPart) getTargetEditPart()).getParentInteractionCompartmentEditPart();
- // if(parent != null)
- // return parent.getCommand( getTargetRequest() );
- // }
- // return super.getCommand();
- // }
- // return null;
- // }
- // };
+ // AspectUnspecifiedTypeCreationTool tool = new AspectUnspecifiedTypeCreationTool(types){
+ // protected Command getCommand() {
+ // if (!antiScroll){
+ // if(getTargetEditPart() instanceof LifelineEditPart){
+ // InteractionInteractionCompartmentEditPart parent = ((LifelineEditPart) getTargetEditPart()).getParentInteractionCompartmentEditPart();
+ // if(parent != null)
+ // return parent.getCommand( getTargetRequest() );
+ // }
+ // return super.getCommand();
+ // }
+ // return null;
+ // }
+ // };
InteractionChildCreationTool tool = new InteractionChildCreationTool(types);
- // tool.setDefaultCursor(SharedCursors.HAND);
- // tool.setDisabledCursor(SharedCursors.NO);
+ // tool.setDefaultCursor(SharedCursors.HAND);
+ // tool.setDisabledCursor(SharedCursors.NO);
return tool;
}
private Tool createDurationConstraint15CreationTool() {
List<IElementType> types = new ArrayList<IElementType>(2);
types.add(UMLElementTypes.DurationConstraint_3021);
- // types.add(UMLElementTypes.DurationConstraint_3023);
+ // types.add(UMLElementTypes.DurationConstraint_3023);
// use DurationCreationTool
- // Tool tool = new DurationCreationTool(types);
- //Disable old DurationConstraint creation.
+ // Tool tool = new DurationCreationTool(types);
+ // Disable old DurationConstraint creation.
InteractionChildCreationTool tool = new InteractionChildCreationTool(types);
return tool;
}
@@ -345,13 +347,13 @@ public class SequencePaletteFactory extends PaletteFactory.Adapter {
@Override
protected CreateConnectionRequest createTargetRequest() {
- IHintedType type = (IHintedType)UMLElementTypes.CommentAnnotatedElement_4010;
+ IHintedType type = (IHintedType) UMLElementTypes.CommentAnnotatedElement_4010;
return new CreateConnectionViewRequest(new ConnectionViewDescriptor(type, type.getSemanticHint(), getPreferencesHint()));
}
@Override
protected String getCommandName() {
- if(isInState(STATE_CONNECTION_STARTED | STATE_ACCESSIBLE_DRAG_IN_PROGRESS)) {
+ if (isInState(STATE_CONNECTION_STARTED | STATE_ACCESSIBLE_DRAG_IN_PROGRESS)) {
return AnnotatedLinkEndEditPolicy.REQ_ANNOTATED_LINK_END;
} else {
return AnnotatedLinkStartEditPolicy.REQ_ANNOTATED_LINK_START;
@@ -361,7 +363,7 @@ public class SequencePaletteFactory extends PaletteFactory.Adapter {
@Override
protected boolean handleCreateConnection() {
boolean handled = super.handleCreateConnection();
- //Make sure to erase source feedback whatever the connection created or not.
+ // Make sure to erase source feedback whatever the connection created or not.
setAvoidDeactivation(false);
eraseSourceFeedback();
deactivate();
@@ -386,8 +388,8 @@ public class SequencePaletteFactory extends PaletteFactory.Adapter {
@Override
public void setViewer(EditPartViewer viewer) {
super.setViewer(viewer);
- if(tooltipHook == null || !tooltipHook.isHooked(viewer)) {
- if(tooltipHook != null) {
+ if (tooltipHook == null || !tooltipHook.isHooked(viewer)) {
+ if (tooltipHook != null) {
tooltipHook.dispose();
}
tooltipHook = new TooltipHook(viewer);
@@ -397,7 +399,7 @@ public class SequencePaletteFactory extends PaletteFactory.Adapter {
@Override
public void deactivate() {
super.deactivate();
- if(tooltipHook != null) {
+ if (tooltipHook != null) {
tooltipHook.dispose();
tooltipHook = null;
}
@@ -410,10 +412,10 @@ public class SequencePaletteFactory extends PaletteFactory.Adapter {
}
public void clearConnectionFeedback() {
- if(!isShowingSourceFeedback()) {
+ if (!isShowingSourceFeedback()) {
return;
}
- if(source != null) {
+ if (source != null) {
Request req = getSourceRequest();
req.setType(REQ_CONNECTION_END);
source.eraseSourceFeedback(req);
@@ -423,14 +425,14 @@ public class SequencePaletteFactory extends PaletteFactory.Adapter {
/**
* Try to create child in Interaction directly.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public static class InteractionChildCreationTool extends AspectUnspecifiedTypeCreationTool {
/**
* Constructor.
- *
+ *
* @param elementTypes
*/
public InteractionChildCreationTool(List<IElementType> elementTypes) {
@@ -439,15 +441,15 @@ public class SequencePaletteFactory extends PaletteFactory.Adapter {
@Override
protected boolean updateTargetUnderMouse() {
- if(antiScroll) {
+ if (antiScroll) {
return super.updateTargetUnderMouse();
}
- if(!isTargetLocked()) {
+ if (!isTargetLocked()) {
EditPart editPart = null;
- if(getCurrentViewer() != null) {
+ if (getCurrentViewer() != null) {
editPart = getCurrentViewer().findObjectAtExcluding(getLocation(), getExclusionSet(), getTargetingConditional());
}
- if(editPart != null) {
+ if (editPart != null) {
editPart = getInteractionEditPart(editPart);
}
boolean changed = getTargetEditPart() != editPart;
@@ -459,10 +461,10 @@ public class SequencePaletteFactory extends PaletteFactory.Adapter {
}
private EditPart getInteractionEditPart(EditPart editPart) {
- if(editPart == null) {
+ if (editPart == null) {
return null;
}
- if(editPart instanceof InteractionInteractionCompartmentEditPart) {
+ if (editPart instanceof InteractionInteractionCompartmentEditPart) {
return editPart;
}
return getInteractionEditPart(editPart.getParent());
@@ -473,7 +475,7 @@ public class SequencePaletteFactory extends PaletteFactory.Adapter {
/**
* Constructor.
- *
+ *
* @param elementTypes
*/
public MessageConnectionTool(List<IElementType> elementTypes) {
@@ -484,35 +486,36 @@ public class SequencePaletteFactory extends PaletteFactory.Adapter {
protected void selectAddedObject(EditPartViewer viewer, Collection objects) {
final List editparts = new ArrayList();
final EditPart[] primaryEP = new EditPart[1];
- for(Iterator i = objects.iterator(); i.hasNext();) {
+ for (Iterator i = objects.iterator(); i.hasNext();) {
Object object = i.next();
- if(object instanceof IAdaptable) {
- Object editPart = viewer.getEditPartRegistry().get(((IAdaptable)object).getAdapter(View.class));
- if(editPart instanceof IPrimaryEditPart) {
+ if (object instanceof IAdaptable) {
+ Object editPart = viewer.getEditPartRegistry().get(((IAdaptable) object).getAdapter(View.class));
+ if (editPart instanceof IPrimaryEditPart) {
editparts.add(editPart);
}
// Priority is to put a shape into direct edit mode.
- if(editPart instanceof ShapeEditPart) {
- primaryEP[0] = (ShapeEditPart)editPart;
+ if (editPart instanceof ShapeEditPart) {
+ primaryEP[0] = (ShapeEditPart) editPart;
}
}
}
- if(!editparts.isEmpty()) {
+ if (!editparts.isEmpty()) {
viewer.setSelection(new StructuredSelection(editparts));
// automatically put the first shape into edit-mode
Display.getCurrent().asyncExec(new Runnable() {
+ @Override
public void run() {
- if(primaryEP[0] == null) {
- primaryEP[0] = (EditPart)editparts.get(0);
+ if (primaryEP[0] == null) {
+ primaryEP[0] = (EditPart) editparts.get(0);
}
//
// add active test since test scripts are failing on this
// basically, the editpart has been deleted when this
// code is being executed. (see RATLC00527114)
- if(primaryEP[0].isActive()) {
- Request request = new Request(RequestConstants.REQ_DIRECT_EDIT);
- //Mark this request as the first direct edit after creation.
+ if (primaryEP[0].isActive()) {
+ Request request = new Request(org.eclipse.gef.RequestConstants.REQ_DIRECT_EDIT);
+ // Mark this request as the first direct edit after creation.
request.getExtendedData().put(SequenceRequestConstant.DIRECT_EDIT_AFTER_CREATION, true);
primaryEP[0].performRequest(request);
}
@@ -523,14 +526,14 @@ public class SequencePaletteFactory extends PaletteFactory.Adapter {
/**
* @see org.eclipse.gmf.runtime.diagram.ui.tools.ConnectionCreationTool#deactivate()
- *
+ *
*/
@Override
public void deactivate() {
EditPart targetEditPart = getTargetEditPart();
- if(targetEditPart != null) {
+ if (targetEditPart != null) {
EditPolicy editPolicy = targetEditPart.getEditPolicy(HighlightEditPolicy.HIGHLIGHT_ROLE);
- if(editPolicy != null) {
+ if (editPolicy != null) {
editPolicy.eraseSourceFeedback(getTargetRequest());
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/SequenceViewDependentsAdvice.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/SequenceViewDependentsAdvice.java
index c94caac2bdb..47bf88300c4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/SequenceViewDependentsAdvice.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/SequenceViewDependentsAdvice.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -50,50 +50,50 @@ public class SequenceViewDependentsAdvice extends AbstractEditHelperAdvice {
protected ICommand getBeforeSetCommand(SetRequest request) {
EObject element = request.getElementToEdit();
View view = findView(element);
- if(view != null) {
- //Clear edge's when the UML model has been changed.
+ if (view != null) {
+ // Clear edge's when the UML model has been changed.
EStructuralFeature feature = request.getFeature();
Object value = request.getValue();
- if(!(value instanceof List<?>)) {
+ if (!(value instanceof List<?>)) {
return null;
}
List<Edge> destroyEdges = new ArrayList<Edge>();
List<Element> targetObjects = new ArrayList<Element>();
- if(element instanceof Comment && UMLPackage.Literals.COMMENT__ANNOTATED_ELEMENT == feature) {
- targetObjects.addAll(((Comment)element).getAnnotatedElements());
- } else if(element instanceof DurationObservation && UMLPackage.Literals.DURATION_OBSERVATION__EVENT == feature) {
- targetObjects.addAll(((DurationObservation)element).getEvents());
- } else if(element instanceof TimeObservation && UMLPackage.Literals.TIME_OBSERVATION__EVENT == feature) {
- targetObjects.add(((TimeObservation)element).getEvent());
- } else if(element instanceof Constraint && UMLPackage.Literals.CONSTRAINT__CONSTRAINED_ELEMENT == feature) {
- targetObjects.addAll(((Constraint)element).getConstrainedElements());
+ if (element instanceof Comment && UMLPackage.Literals.COMMENT__ANNOTATED_ELEMENT == feature) {
+ targetObjects.addAll(((Comment) element).getAnnotatedElements());
+ } else if (element instanceof DurationObservation && UMLPackage.Literals.DURATION_OBSERVATION__EVENT == feature) {
+ targetObjects.addAll(((DurationObservation) element).getEvents());
+ } else if (element instanceof TimeObservation && UMLPackage.Literals.TIME_OBSERVATION__EVENT == feature) {
+ targetObjects.add(((TimeObservation) element).getEvent());
+ } else if (element instanceof Constraint && UMLPackage.Literals.CONSTRAINT__CONSTRAINED_ELEMENT == feature) {
+ targetObjects.addAll(((Constraint) element).getConstrainedElements());
}
- for(Element object : targetObjects) {
- if(value instanceof List && ((List)value).contains(object)) {
+ for (Element object : targetObjects) {
+ if (value instanceof List && ((List) value).contains(object)) {
continue;
}
View target = findView(object);
List sourceConnections = ViewUtil.getSourceConnections(view);
- for(Object connector : sourceConnections) {
- if(!(connector instanceof Edge)) {
+ for (Object connector : sourceConnections) {
+ if (!(connector instanceof Edge)) {
continue;
}
- Edge edge = (Edge)connector;
- if(target == edge.getTarget()) {
+ Edge edge = (Edge) connector;
+ if (target == edge.getTarget()) {
destroyEdges.add(edge);
}
}
}
- if(!destroyEdges.isEmpty()) {
+ if (!destroyEdges.isEmpty()) {
TransactionalEditingDomain editingDomain = request.getEditingDomain();
CompositeCommand command = new CompositeCommand("Clear Connectors");
- for(Edge edge : destroyEdges) {
+ for (Edge edge : destroyEdges) {
DestroyElementRequest destroy = new DestroyElementRequest(editingDomain, edge, false);
Object eHelperContext = destroy.getEditHelperContext();
IElementType context = ElementTypeRegistry.getInstance().getElementType(eHelperContext);
- if(context != null) {
+ if (context != null) {
ICommand result = context.getEditCommand(destroy);
- if(result != null) {
+ if (result != null) {
command.add(result);
}
}
@@ -105,14 +105,14 @@ public class SequenceViewDependentsAdvice extends AbstractEditHelperAdvice {
}
private View findView(EObject element) {
- if(element == null) {
+ if (element == null) {
return null;
}
Collection<Setting> settings = CacheAdapter.getInstance().getNonNavigableInverseReferences(element);
- for(Setting ref : settings) {
- if(NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
- View view = (View)ref.getEObject();
- if(view != null) {
+ for (Setting ref : settings) {
+ if (NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
+ View view = (View) ref.getEObject();
+ if (view != null) {
return view;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/UmlSequenceDiagramForMultiEditor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/UmlSequenceDiagramForMultiEditor.java
index 77bc739a873..caa8c6c0731 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/UmlSequenceDiagramForMultiEditor.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/UmlSequenceDiagramForMultiEditor.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009, 2014 Atos Origin, CEA, 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
@@ -61,11 +61,11 @@ public class UmlSequenceDiagramForMultiEditor extends UMLDiagramEditor {
private Composite splitter;
private Image titleImage;
-
+
/**
* Constructor for SashSystem v2. Context and required objects are retrieved from the
* ServiceRegistry.
- *
+ *
* @throws BackboneException
* @throws ServiceException
*/
@@ -90,11 +90,11 @@ public class UmlSequenceDiagramForMultiEditor extends UMLDiagramEditor {
@Override
public void dispose() {
- if(titleImage != null) {
+ if (titleImage != null) {
titleImage.dispose();
titleImage = null;
}
-
+
super.dispose();
}
@@ -145,28 +145,29 @@ public class UmlSequenceDiagramForMultiEditor extends UMLDiagramEditor {
@Override
protected void applyCustomizationsToPalette(PaletteRoot paletteRoot) {
super.applyCustomizationsToPalette(paletteRoot);
- //Sort Nodes of Palette
+ // Sort Nodes of Palette
List children = paletteRoot.getChildren();
- if(children.size() > 2) {
+ if (children.size() > 2) {
Object nodes = children.get(1);
- if(nodes instanceof PaletteContainer) {
- doSort((PaletteContainer)nodes);
+ if (nodes instanceof PaletteContainer) {
+ doSort((PaletteContainer) nodes);
}
}
}
@SuppressWarnings("unchecked")
private void doSort(PaletteContainer nodes) {
- if(nodes == null) {
+ if (nodes == null) {
return;
}
List children = nodes.getChildren();
Collections.sort(children, new Comparator<PaletteEntry>() {
+ @Override
public int compare(PaletteEntry o1, PaletteEntry o2) {
String l1 = o1.getLabel();
String l2 = o2.getLabel();
- if(l1 != null && l2 != null) {
+ if (l1 != null && l2 != null) {
return Collator.getInstance().compare(l1, l2);
}
return 0;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/AnnotatedLinkEditCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/AnnotatedLinkEditCommand.java
index b3bdb092270..fd8e14800dc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/AnnotatedLinkEditCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/AnnotatedLinkEditCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -49,7 +49,7 @@ public class AnnotatedLinkEditCommand extends AbstractTransactionalCommand {
/**
* Constructor.
- *
+ *
* @param domain
* @param label
* @param affectedFiles
@@ -60,18 +60,18 @@ public class AnnotatedLinkEditCommand extends AbstractTransactionalCommand {
@Override
public boolean canExecute() {
- if(newSourceElement != null) {
- if(!(newSourceElement instanceof Comment || newSourceElement instanceof Observation || newSourceElement instanceof Constraint)) {
+ if (newSourceElement != null) {
+ if (!(newSourceElement instanceof Comment || newSourceElement instanceof Observation || newSourceElement instanceof Constraint)) {
return false;
}
- if(newSourceElement == newTargetElement || newSourceElement == oldTargetElement) {
+ if (newSourceElement == newTargetElement || newSourceElement == oldTargetElement) {
return false;
}
- } else if(oldSourceElement != null) {
- if(!(oldSourceElement instanceof Comment || oldSourceElement instanceof Observation || oldSourceElement instanceof Constraint)) {
+ } else if (oldSourceElement != null) {
+ if (!(oldSourceElement instanceof Comment || oldSourceElement instanceof Observation || oldSourceElement instanceof Constraint)) {
return false;
}
- if(oldSourceElement == newTargetElement || oldSourceElement == newTargetElement) {
+ if (oldSourceElement == newTargetElement || oldSourceElement == newTargetElement) {
return false;
}
}
@@ -86,19 +86,18 @@ public class AnnotatedLinkEditCommand extends AbstractTransactionalCommand {
* 2. Create constraint for each Element.
*/
private boolean checkTargetType(Element sourceElement, Element targetElement) {
- if(sourceElement == null || targetElement == null) {
+ if (sourceElement == null || targetElement == null) {
return false;
}
- if(sourceElement instanceof DurationObservation || sourceElement instanceof TimeObservation) {
+ if (sourceElement instanceof DurationObservation || sourceElement instanceof TimeObservation) {
return targetElement instanceof NamedElement;
}
return true;
}
/**
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.core.runtime.IAdaptable)
- *
+ * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+ *
* @param monitor
* @param info
* @return
@@ -106,46 +105,46 @@ public class AnnotatedLinkEditCommand extends AbstractTransactionalCommand {
*/
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
return CommandResult.newErrorCommandResult("Unable to create annotated link");
}
Element targetElement = newTargetElement == null ? oldTargetElement : newTargetElement;
Element sourceElement = newSourceElement == null ? oldSourceElement : newSourceElement;
- if(targetElement == null || sourceElement == null) {
+ if (targetElement == null || sourceElement == null) {
return CommandResult.newErrorCommandResult("Unable to create annotated link");
}
- if(oldSourceElement != null) {
- if(oldSourceElement instanceof Comment) {
- ((Comment)oldSourceElement).getAnnotatedElements().remove(oldTargetElement);
- } else if(oldSourceElement instanceof DurationObservation) {
- ((DurationObservation)oldSourceElement).getEvents().remove(oldTargetElement);
- } else if(oldSourceElement instanceof TimeObservation) {
- ((TimeObservation)oldSourceElement).setEvent(null);
- } else if(oldSourceElement instanceof Constraint) {
- ((Constraint)oldSourceElement).getConstrainedElements().remove(oldTargetElement);
+ if (oldSourceElement != null) {
+ if (oldSourceElement instanceof Comment) {
+ ((Comment) oldSourceElement).getAnnotatedElements().remove(oldTargetElement);
+ } else if (oldSourceElement instanceof DurationObservation) {
+ ((DurationObservation) oldSourceElement).getEvents().remove(oldTargetElement);
+ } else if (oldSourceElement instanceof TimeObservation) {
+ ((TimeObservation) oldSourceElement).setEvent(null);
+ } else if (oldSourceElement instanceof Constraint) {
+ ((Constraint) oldSourceElement).getConstrainedElements().remove(oldTargetElement);
}
}
- if(sourceElement instanceof Comment) {
- ((Comment)sourceElement).getAnnotatedElements().add(targetElement);
- } else if(sourceElement instanceof DurationObservation && targetElement instanceof NamedElement) {
- ((DurationObservation)sourceElement).getEvents().add((NamedElement)targetElement);
- } else if(sourceElement instanceof TimeObservation && targetElement instanceof NamedElement) {
- ((TimeObservation)sourceElement).setEvent((NamedElement)targetElement);
- } else if(sourceElement instanceof Constraint) {
- ((Constraint)sourceElement).getConstrainedElements().add(targetElement);
+ if (sourceElement instanceof Comment) {
+ ((Comment) sourceElement).getAnnotatedElements().add(targetElement);
+ } else if (sourceElement instanceof DurationObservation && targetElement instanceof NamedElement) {
+ ((DurationObservation) sourceElement).getEvents().add((NamedElement) targetElement);
+ } else if (sourceElement instanceof TimeObservation && targetElement instanceof NamedElement) {
+ ((TimeObservation) sourceElement).setEvent((NamedElement) targetElement);
+ } else if (sourceElement instanceof Constraint) {
+ ((Constraint) sourceElement).getConstrainedElements().add(targetElement);
}
return CommandResult.newOKCommandResult(sourceElement);
}
private Element resolveElement(EditPart editPart) {
- if(editPart == null) {
+ if (editPart == null) {
return null;
}
Object model = editPart.getModel();
- if(model instanceof View) {
- EObject element = ViewUtil.resolveSemanticElement((View)model);
- if(element instanceof Element) {
- return (Element)element;
+ if (model instanceof View) {
+ EObject element = ViewUtil.resolveSemanticElement((View) model);
+ if (element instanceof Element) {
+ return (Element) element;
}
}
return null;
@@ -153,7 +152,7 @@ public class AnnotatedLinkEditCommand extends AbstractTransactionalCommand {
/**
* @param source
- * the source to set
+ * the source to set
*/
public void setSource(EditPart source) {
newSourceElement = resolveElement(source);
@@ -161,7 +160,7 @@ public class AnnotatedLinkEditCommand extends AbstractTransactionalCommand {
/**
* @param target
- * the target to set
+ * the target to set
*/
public void setTarget(EditPart target) {
newTargetElement = resolveElement(target);
@@ -176,11 +175,11 @@ public class AnnotatedLinkEditCommand extends AbstractTransactionalCommand {
/**
* @param annotatedLink
- * the annotatedLink to set
+ * the annotatedLink to set
*/
public void setAnnotatedLink(AnnotatedLinkEditPart annotatedLink) {
this.annotatedLink = annotatedLink;
- if(annotatedLink != null) {
+ if (annotatedLink != null) {
oldSourceElement = resolveElement(annotatedLink.getSource());
oldTargetElement = resolveElement(annotatedLink.getTarget());
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/ChangeEdgeTargetCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/ChangeEdgeTargetCommand.java
index 1a8187e55c5..05c2fbbf7a6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/ChangeEdgeTargetCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/ChangeEdgeTargetCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -40,9 +40,9 @@ import org.eclipse.uml2.uml.MessageSort;
/**
* Command used to change the target of an edge.
* It create an IdentityAnchor to attach the edge.
- *
+ *
* @author Mathieu Velten
- *
+ *
*/
public class ChangeEdgeTargetCommand extends AbstractTransactionalCommand {
@@ -53,15 +53,15 @@ public class ChangeEdgeTargetCommand extends AbstractTransactionalCommand {
protected String anchorId;
/**
- *
+ *
* @param editingDomain
- * the editing domain.
+ * the editing domain.
* @param createElementAndNodeCommand
- * used to retrieve the target new node of the edge.
+ * used to retrieve the target new node of the edge.
* @param descriptor
- * used to retrieve the edge.
+ * used to retrieve the edge.
* @param anchorId
- * the identity of the anchor which will be created to attach the edge.
+ * the identity of the anchor which will be created to attach the edge.
*/
public ChangeEdgeTargetCommand(TransactionalEditingDomain editingDomain, CreateElementAndNodeCommand createElementAndNodeCommand, ConnectionViewDescriptor descriptor, String anchorId) {
super(editingDomain, "Change message graphical target", null);
@@ -74,36 +74,36 @@ public class ChangeEdgeTargetCommand extends AbstractTransactionalCommand {
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
// retrieve the edge from the descriptor
Object obj = descriptor.getAdapter(Edge.class);
- if(obj instanceof Edge) {
- Edge edge = (Edge)obj;
+ if (obj instanceof Edge) {
+ Edge edge = (Edge) obj;
View newTarget = createElementAndNodeCommand.getCreatedView();
edge.setTarget(newTarget);
IdentityAnchor anchor = NotationFactory.eINSTANCE.createIdentityAnchor();
anchor.setId(anchorId);
edge.setTargetAnchor(anchor);
- //reset bendpoints to target
+ // reset bendpoints to target
Bendpoints bendpoints = edge.getBendpoints();
- if(bendpoints instanceof RelativeBendpoints) {
- List points = ((RelativeBendpoints)bendpoints).getPoints();
- if(!points.isEmpty()) {
+ if (bendpoints instanceof RelativeBendpoints) {
+ List points = ((RelativeBendpoints) bendpoints).getPoints();
+ if (!points.isEmpty()) {
List<RelativeBendpoint> newPoints = new ArrayList<RelativeBendpoint>();
- RelativeBendpoint first = (RelativeBendpoint)points.get(0);
- RelativeBendpoint last = (RelativeBendpoint)points.get(1);
+ RelativeBendpoint first = (RelativeBendpoint) points.get(0);
+ RelativeBendpoint last = (RelativeBendpoint) points.get(1);
RelativeBendpoint rb1 = new RelativeBendpoint(first.getSourceX(), first.getSourceY(), first.getTargetX() - 8, first.getTargetY());
RelativeBendpoint rb2 = new RelativeBendpoint(last.getSourceX() + 8, last.getSourceY(), last.getTargetX(), 0);
newPoints.add(rb1);
- for(int i = 1; i < points.size() - 1; i++) {
- newPoints.add((RelativeBendpoint)points.get(i));
+ for (int i = 1; i < points.size() - 1; i++) {
+ newPoints.add((RelativeBendpoint) points.get(i));
}
newPoints.add(rb2);
- ((RelativeBendpoints)bendpoints).setPoints(newPoints);
+ ((RelativeBendpoints) bendpoints).setPoints(newPoints);
}
}
- //Reset message end to target ExecutionSpecification, See https://bugs.eclipse.org/bugs/show_bug.cgi?id=402975
+ // Reset message end to target ExecutionSpecification, See https://bugs.eclipse.org/bugs/show_bug.cgi?id=402975
EObject edgeElement = ViewUtil.resolveSemanticElement(edge);
EObject targetElement = ViewUtil.resolveSemanticElement(newTarget);
- if(edgeElement instanceof Message && MessageSort.SYNCH_CALL_LITERAL == ((Message)edgeElement).getMessageSort() && targetElement instanceof ExecutionSpecification) {
- OccurrenceSpecificationHelper.resetExecutionStart((ExecutionSpecification)targetElement, ((Message)edgeElement).getReceiveEvent());
+ if (edgeElement instanceof Message && MessageSort.SYNCH_CALL_LITERAL == ((Message) edgeElement).getMessageSort() && targetElement instanceof ExecutionSpecification) {
+ OccurrenceSpecificationHelper.resetExecutionStart((ExecutionSpecification) targetElement, ((Message) edgeElement).getReceiveEvent());
}
}
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CreateElementAndNodeCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CreateElementAndNodeCommand.java
index 9f7d511f91b..5100f3c3642 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CreateElementAndNodeCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CreateElementAndNodeCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -38,9 +38,9 @@ import org.eclipse.gmf.runtime.notation.View;
/**
* Command to create an element and its associated view.
- *
+ *
* @author Mathieu Velten
- *
+ *
*/
public class CreateElementAndNodeCommand extends AbstractTransactionalCommand {
@@ -65,17 +65,17 @@ public class CreateElementAndNodeCommand extends AbstractTransactionalCommand {
private List affectedFiles;
/**
- *
+ *
* @param editingDomain
- * editingDomain the editing domain.
+ * editingDomain the editing domain.
* @param nodeEditPart
- * the editpart of the graphical parent of the node to create.
+ * the editpart of the graphical parent of the node to create.
* @param parent
- * the parent of the element to create.
+ * the parent of the element to create.
* @param elementType
- * the GMF type of the element which will be created.
+ * the GMF type of the element which will be created.
* @param location
- * the location where to create the element figure.
+ * the location where to create the element figure.
*/
public CreateElementAndNodeCommand(TransactionalEditingDomain editingDomain, ShapeNodeEditPart nodeEditPart, EObject parent, IHintedType elementType, Point location) {
super(editingDomain, "Create element and node command", null);
@@ -88,8 +88,8 @@ public class CreateElementAndNodeCommand extends AbstractTransactionalCommand {
@Override
public List getAffectedFiles() {
- if(affectedFiles == null) {
- if(getCreatedView() != null) {
+ if (affectedFiles == null) {
+ if (getCreatedView() != null) {
affectedFiles = getWorkspaceFiles(getCreatedView());
} else {
affectedFiles = super.getAffectedFiles();
@@ -100,7 +100,7 @@ public class CreateElementAndNodeCommand extends AbstractTransactionalCommand {
/**
* put a parameter which will be add to the parameters of the element creation request.
- *
+ *
* @param key
* @param value
*/
@@ -110,41 +110,41 @@ public class CreateElementAndNodeCommand extends AbstractTransactionalCommand {
/**
* retrieve the view associated with the created execution specification
- *
+ *
* @return the view or null if not created/founded
*/
public View getCreatedView() {
- if(createViewRequest != null) {
- List l = (List)createViewRequest.getNewObject();
- if(!l.isEmpty() && l.get(0) instanceof ViewDescriptor) {
- return (View)((ViewDescriptor)l.get(0)).getAdapter(View.class);
+ if (createViewRequest != null) {
+ List l = (List) createViewRequest.getNewObject();
+ if (!l.isEmpty() && l.get(0) instanceof ViewDescriptor) {
+ return (View) ((ViewDescriptor) l.get(0)).getAdapter(View.class);
}
}
return null;
}
public void undo() {
- if(nodeCreationCommand != null && nodeCreationCommand.canUndo()) {
+ if (nodeCreationCommand != null && nodeCreationCommand.canUndo()) {
nodeCreationCommand.undo();
}
- if(elementCreationCommand != null && elementCreationCommand.canUndo()) {
+ if (elementCreationCommand != null && elementCreationCommand.canUndo()) {
elementCreationCommand.undo();
}
}
/**
* Create the element in the model.
- *
+ *
* @return the element.
*/
protected EObject createModelElement() {
CreateElementRequest req = new CreateElementRequest(editingDomain, parent, elementType);
req.addParameters(createElementRequestParameters);
elementCreationCommand = nodeEditPart.getCommand(new EditCommandRequestWrapper(req));
- if(elementCreationCommand != null) {
+ if (elementCreationCommand != null) {
elementCreationCommand.execute();
EObject result = req.getNewElement();
- if(result instanceof EObject) {
+ if (result instanceof EObject) {
return result;
}
}
@@ -156,14 +156,14 @@ public class CreateElementAndNodeCommand extends AbstractTransactionalCommand {
* The element needs to be created first using createModelElement.
*/
protected void createElementView() {
- if(nodeEditPart != null) {
+ if (nodeEditPart != null) {
// check if execution specification is already drawn
- if(getCreatedView() == null) {
+ if (getCreatedView() == null) {
ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(new EObjectAdapter(element), Node.class, elementType.getSemanticHint(), nodeEditPart.getDiagramPreferencesHint());
createViewRequest = new CreateViewRequest(descriptor);
createViewRequest.setLocation(location);
nodeCreationCommand = nodeEditPart.getCommand(createViewRequest);
- if(nodeCreationCommand != null && nodeCreationCommand.canExecute()) {
+ if (nodeCreationCommand != null && nodeCreationCommand.canExecute()) {
nodeCreationCommand.execute();
}
}
@@ -174,7 +174,7 @@ public class CreateElementAndNodeCommand extends AbstractTransactionalCommand {
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
element = createModelElement();
// create the view for the execution specification
- if(element != null) {
+ if (element != null) {
createElementView();
}
return CommandResult.newOKCommandResult();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CreateGateElementAndViewCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CreateGateElementAndViewCommand.java
index 1a98f5249c7..729a6726ead 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CreateGateElementAndViewCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CreateGateElementAndViewCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -38,7 +38,7 @@ public class CreateGateElementAndViewCommand extends CreateGateViewCommand {
/**
* Constructor.
- *
+ *
* @param domain
* @param location
* @param label
@@ -49,9 +49,8 @@ public class CreateGateElementAndViewCommand extends CreateGateViewCommand {
}
/**
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecute(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.core.runtime.IAdaptable)
- *
+ * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+ *
* @param monitor
* @param info
* @return
@@ -59,9 +58,9 @@ public class CreateGateElementAndViewCommand extends CreateGateViewCommand {
*/
@Override
protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- Gate gate = GateHelper.createGate((Element)getParentElement(), isCreateInnerCFGate());
- ((ObjectAdapter)getGateAdapter()).setObject(gate);
- if(isVolatiled()) {
+ Gate gate = GateHelper.createGate((Element) getParentElement(), isCreateInnerCFGate());
+ ((ObjectAdapter) getGateAdapter()).setObject(gate);
+ if (isVolatiled()) {
GateHelper.setVolatile(gate, true);
}
return super.doExecute(monitor, info);
@@ -76,7 +75,7 @@ public class CreateGateElementAndViewCommand extends CreateGateViewCommand {
/**
* @param createInnerCFGate
- * the createInnerGateForCombinedFragment to set
+ * the createInnerGateForCombinedFragment to set
*/
public void setCreateInnerCFGate(boolean createInnerCFGate) {
this.createInnerCFGate = createInnerCFGate;
@@ -91,7 +90,7 @@ public class CreateGateElementAndViewCommand extends CreateGateViewCommand {
/**
* @param volatiled
- * the volatiled to set
+ * the volatiled to set
*/
public void setVolatiled(boolean volatiled) {
this.volatiled = volatiled;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CreateGateViewCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CreateGateViewCommand.java
index d727f216596..f03e6855950 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CreateGateViewCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CreateGateViewCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -63,7 +63,7 @@ public class CreateGateViewCommand extends AbstractTransactionalCommand {
/**
* Constructor.
- *
+ *
* @param domain
* @param location
* @param label
@@ -74,17 +74,18 @@ public class CreateGateViewCommand extends AbstractTransactionalCommand {
this.containerViewAdapter = containerViewAdapter;
this.location = location;
this.gateAdapter = gateAdapter;
- //Set result adapter earlier.
+ // Set result adapter earlier.
setResult(CommandResult.newOKCommandResult(resultAdapter));
}
+ @Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public List getAffectedFiles() {
View containerView = getContainerView();
- if(containerView != null) {
+ if (containerView != null) {
List result = new ArrayList();
IFile file = WorkspaceSynchronizer.getFile(containerView.eResource());
- if(file != null) {
+ if (file != null) {
result.add(file);
}
return result;
@@ -93,29 +94,28 @@ public class CreateGateViewCommand extends AbstractTransactionalCommand {
}
protected View getContainerView() {
- if(containerViewAdapter != null) {
- return (View)containerViewAdapter.getAdapter(View.class);
+ if (containerViewAdapter != null) {
+ return (View) containerViewAdapter.getAdapter(View.class);
}
return null;
}
/**
* @see org.eclipse.core.commands.operations.AbstractOperation#canExecute()
- *
+ *
* @return
*/
@Override
public boolean canExecute() {
- if(getContainerView() == null) {
+ if (getContainerView() == null) {
return false;
}
return getGateAdapter() != null;
}
/**
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.core.runtime.IAdaptable)
- *
+ * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+ *
* @param monitor
* @param info
* @return
@@ -123,51 +123,51 @@ public class CreateGateViewCommand extends AbstractTransactionalCommand {
*/
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
return CommandResult.newCancelledCommandResult();
}
EObject parentElement = getParentElement();
- //Gate
+ // Gate
Gate gate = getGate();
- if(gate == null) {
+ if (gate == null) {
return CommandResult.newCancelledCommandResult();
}
View containerView = getContainerView();
- //View
+ // View
View view = GateHelper.createView(containerView, gate);
- if(view != null) {
+ if (view != null) {
resultAdapter.setObject(view);
} else {
return CommandResult.newErrorCommandResult("Unnable to create Gate.");
}
- if(location != null) {
+ if (location != null) {
ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getLocation_X(), Integer.valueOf(location.x));
ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getLocation_Y(), Integer.valueOf(location.y));
}
- //create inner gate for CombinedFragment.
- if(parentElement instanceof CombinedFragment) {
+ // create inner gate for CombinedFragment.
+ if (parentElement instanceof CombinedFragment) {
Gate innerGate = GateHelper.getInnerCFGate(gate);
- if(innerGate != null) {
+ if (innerGate != null) {
View innerGateView = GateHelper.createView(containerView, innerGate);
- if(location != null) {
+ if (location != null) {
ViewUtil.setStructuralFeatureValue(innerGateView, NotationPackage.eINSTANCE.getLocation_X(), Integer.valueOf(location.x));
ViewUtil.setStructuralFeatureValue(innerGateView, NotationPackage.eINSTANCE.getLocation_Y(), Integer.valueOf(location.y + GateEditPart.DEFAULT_SIZE.height + 2));
}
}
}
- //For InteractionUse
- if(parentElement instanceof InteractionUse) {
- InteractionUse interactionUse = (InteractionUse)parentElement;
+ // For InteractionUse
+ if (parentElement instanceof InteractionUse) {
+ InteractionUse interactionUse = (InteractionUse) parentElement;
Interaction refersTo = interactionUse.getRefersTo();
- if(refersTo != null) {
+ if (refersTo != null) {
View interactionView = findView(containerView.eResource(), refersTo);
- if(interactionView != null) {
+ if (interactionView != null) {
Gate formalGate = refersTo.getFormalGate(gate.getName());
- if(formalGate != null) {
+ if (formalGate != null) {
View formalGateView = GateHelper.createView(interactionView, formalGate);
- if(formalGateView != null) {
+ if (formalGateView != null) {
boolean onRightSide = false;
- if(location != null) {
+ if (location != null) {
Rectangle bounds = getBounds(containerView);
onRightSide = location.x > bounds.getCenter().x;
}
@@ -182,33 +182,33 @@ public class CreateGateViewCommand extends AbstractTransactionalCommand {
private Gate getGate() {
IAdaptable gateAdapter = getGateAdapter();
- if(gateAdapter != null) {
- return (Gate)gateAdapter.getAdapter(Gate.class);
+ if (gateAdapter != null) {
+ return (Gate) gateAdapter.getAdapter(Gate.class);
}
return null;
}
protected EObject getParentElement() {
View containerView = getContainerView();
- if(containerView == null) {
+ if (containerView == null) {
return null;
}
return ViewUtil.resolveSemanticElement(containerView);
}
private Rectangle getBounds(View view) {
- int width = ((Integer)getStructuralFeatureValue(view, NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(view, NotationPackage.eINSTANCE.getSize_Height())).intValue();
- int x = ((Integer)getStructuralFeatureValue(view, NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(view, NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(view, NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(view, NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(view, NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(view, NotationPackage.eINSTANCE.getLocation_Y())).intValue();
String prefElementId = ViewUtil.resolveSemanticElement(view).eClass().getName();
IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(view, prefElementId, PreferencesConstantsHelper.WIDTH);
String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(view, prefElementId, PreferencesConstantsHelper.HEIGHT);
- if(width <= 0) {
+ if (width <= 0) {
width = store.getInt(preferenceConstantWitdh);
}
- if(height <= 0) {
+ if (height <= 0) {
height = store.getInt(preferenceConstantHeight);
}
return new Rectangle(x, y, width, height);
@@ -219,7 +219,7 @@ public class CreateGateViewCommand extends AbstractTransactionalCommand {
Point location = bounds.getLocation();
int index = interaction.getFormalGates().indexOf(formalGate);
location.y = GateEditPart.DEFAULT_SIZE.height * 2 * (index + 1);
- if(onRightSide) {
+ if (onRightSide) {
location.x = bounds.right();
}
ViewUtil.setStructuralFeatureValue(formalGateView, NotationPackage.eINSTANCE.getLocation_X(), Integer.valueOf(location.x));
@@ -232,13 +232,13 @@ public class CreateGateViewCommand extends AbstractTransactionalCommand {
private View findView(Resource eResource, Interaction interaction) {
TreeIterator<Object> allContents = eResource.getResourceSet() != null ? EcoreUtil.getAllContents(eResource.getResourceSet(), true) : EcoreUtil.getAllContents(eResource, true);
- while(allContents != null && allContents.hasNext()) {
+ while (allContents != null && allContents.hasNext()) {
Object next = allContents.next();
- if(!(next instanceof Shape)) {
+ if (!(next instanceof Shape)) {
continue;
}
- View view = (View)next;
- if(interaction == ViewUtil.resolveSemanticElement(view)) {
+ View view = (View) next;
+ if (interaction == ViewUtil.resolveSemanticElement(view)) {
return view;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CreateLocatedConnectionViewCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CreateLocatedConnectionViewCommand.java
index eb48cfb5666..0c864965f72 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CreateLocatedConnectionViewCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CreateLocatedConnectionViewCommand.java
@@ -35,7 +35,7 @@ import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceUtil;
/**
* This class is used to create a connection view which source and target locations are defined. This is useful for connections linked to an
* Occurrence Specification, which is located at a particular predefined point.
- *
+ *
* @author vhemery
*/
public class CreateLocatedConnectionViewCommand extends CommonDeferredCreateConnectionViewCommand {
@@ -49,7 +49,8 @@ public class CreateLocatedConnectionViewCommand extends CommonDeferredCreateConn
/**
* {@inheritDoc}
*/
- public CreateLocatedConnectionViewCommand(TransactionalEditingDomain editingDomain, String semanticHint, IAdaptable sourceViewAdapter, IAdaptable targetViewAdapter, EditPartViewer viewer, PreferencesHint preferencesHint, ConnectionViewDescriptor viewDescriptor, ICommand command) {
+ public CreateLocatedConnectionViewCommand(TransactionalEditingDomain editingDomain, String semanticHint, IAdaptable sourceViewAdapter, IAdaptable targetViewAdapter, EditPartViewer viewer, PreferencesHint preferencesHint,
+ ConnectionViewDescriptor viewDescriptor, ICommand command) {
super(editingDomain, semanticHint, sourceViewAdapter, targetViewAdapter, viewer, preferencesHint, viewDescriptor, command);
}
@@ -62,7 +63,7 @@ public class CreateLocatedConnectionViewCommand extends CommonDeferredCreateConn
/**
* Creates a connection view between the source and target.
- *
+ *
* @throws ExecutionException
*/
@Override
@@ -75,10 +76,10 @@ public class CreateLocatedConnectionViewCommand extends CommonDeferredCreateConn
// modification in order to fix the bug
CreateConnectionViewRequest createRequest = new CreateConnectionViewRequest(viewDescriptor);
createConnectionCmd = getCreateCommand(createRequest, sourceEditPart, targetEditPart);
- if(createConnectionCmd != null && createConnectionCmd.canExecute()) {
+ if (createConnectionCmd != null && createConnectionCmd.canExecute()) {
createConnectionCmd.execute();
- if(element != null) {
- ((View)(createRequest.getConnectionViewDescriptor().getAdapter(View.class))).setElement(element);
+ if (element != null) {
+ ((View) (createRequest.getConnectionViewDescriptor().getAdapter(View.class))).setElement(element);
}
} else {
// connection can not be created
@@ -92,25 +93,25 @@ public class CreateLocatedConnectionViewCommand extends CommonDeferredCreateConn
* Method getCreateCommand Gets the command given a request, source and target edit parts. (No semantic element required.)
* This method is similar to {@link CreateConnectionViewRequest#getCreateCommand(CreateConnectionViewRequest, EditPart, EditPart)}, except it
* fixes source and target locations
- *
+ *
* @param request
- * creation request
+ * creation request
* @param sourceEditPart
- * source edit part
+ * source edit part
* @param targetEditPart
- * target edit part
+ * target edit part
* @return <code>Command</code> to create the connection at appropriate locations
*/
protected Command getCreateCommand(CreateConnectionViewRequest request, EditPart sourceEditPart, EditPart targetEditPart) {
EditPart newSourceEditPart = sourceEditPart;
// set appropriated source edit part
- if(sourceEditPart instanceof LifelineEditPart && sourceLocation != null) {
- newSourceEditPart = SequenceUtil.findPartToReconnectTo((LifelineEditPart)sourceEditPart, sourceLocation);
+ if (sourceEditPart instanceof LifelineEditPart && sourceLocation != null) {
+ newSourceEditPart = SequenceUtil.findPartToReconnectTo((LifelineEditPart) sourceEditPart, sourceLocation);
}
EditPart newTargetEditPart = targetEditPart;
// set appropriated target edit part
- if(targetEditPart instanceof LifelineEditPart && targetLocation != null) {
- newTargetEditPart = SequenceUtil.findPartToReconnectTo((LifelineEditPart)targetEditPart, targetLocation);
+ if (targetEditPart instanceof LifelineEditPart && targetLocation != null) {
+ newTargetEditPart = SequenceUtil.findPartToReconnectTo((LifelineEditPart) targetEditPart, targetLocation);
}
Assert.isNotNull(request);
Assert.isNotNull(sourceEditPart);
@@ -118,7 +119,7 @@ public class CreateLocatedConnectionViewCommand extends CommonDeferredCreateConn
Assert.isNotNull(newSourceEditPart);
Assert.isNotNull(newTargetEditPart);
request.setSourceEditPart(sourceEditPart);
- //We need the same source and target at beginning of connection.
+ // We need the same source and target at beginning of connection.
request.setTargetEditPart(sourceEditPart);
request.setType(RequestConstants.REQ_CONNECTION_START);
// set source location
@@ -133,11 +134,11 @@ public class CreateLocatedConnectionViewCommand extends CommonDeferredCreateConn
/**
* Set the locations where source and target points must be drawn.
- *
+ *
* @param sourcePoint
- * point where to draw source or null
+ * point where to draw source or null
* @param targetPoint
- * point where to draw target or null
+ * point where to draw target or null
*/
public void setLocations(Point sourcePoint, Point targetPoint) {
sourceLocation = sourcePoint;
@@ -146,19 +147,19 @@ public class CreateLocatedConnectionViewCommand extends CommonDeferredCreateConn
/**
* Handle the failure by reporting an adequate error message
- *
+ *
* @param createRequest
- * the creation request that didn't success
+ * the creation request that didn't success
* @param sourceEditPart
- * the link source edit part
+ * the link source edit part
* @param targetEditPart
- * the target source edit part
+ * the target source edit part
*/
private void handleErrorMessage(CreateConnectionViewRequest createRequest, IGraphicalEditPart sourceEditPart, IGraphicalEditPart targetEditPart) {
String hint = createRequest.getConnectionViewDescriptor().getSemanticHint();
boolean isMessage = isMessageHint(hint);
boolean uphill = sourceLocation != null && targetLocation != null && sourceLocation.y > targetLocation.y;
- if(isMessage && uphill) {
+ if (isMessage && uphill) {
reportCanNotDropUphillMessage(sourceLocation.y - targetLocation.y, sourceEditPart, targetEditPart);
} else {
reportDefaultMessage(sourceEditPart, targetEditPart);
@@ -167,46 +168,46 @@ public class CreateLocatedConnectionViewCommand extends CommonDeferredCreateConn
/**
* Test if hint is for a message creation
- *
+ *
* @param hint
- * hint to test
+ * hint to test
* @return true if message hint
*/
private boolean isMessageHint(String hint) {
List<String> messageHints = new ArrayList<String>(7);
- String messageHint = ((IHintedType)UMLElementTypes.Message_4003).getSemanticHint();
+ String messageHint = ((IHintedType) UMLElementTypes.Message_4003).getSemanticHint();
messageHints.add(messageHint);
- messageHint = ((IHintedType)UMLElementTypes.Message_4004).getSemanticHint();
+ messageHint = ((IHintedType) UMLElementTypes.Message_4004).getSemanticHint();
messageHints.add(messageHint);
- messageHint = ((IHintedType)UMLElementTypes.Message_4005).getSemanticHint();
+ messageHint = ((IHintedType) UMLElementTypes.Message_4005).getSemanticHint();
messageHints.add(messageHint);
- messageHint = ((IHintedType)UMLElementTypes.Message_4006).getSemanticHint();
+ messageHint = ((IHintedType) UMLElementTypes.Message_4006).getSemanticHint();
messageHints.add(messageHint);
- messageHint = ((IHintedType)UMLElementTypes.Message_4007).getSemanticHint();
+ messageHint = ((IHintedType) UMLElementTypes.Message_4007).getSemanticHint();
messageHints.add(messageHint);
- messageHint = ((IHintedType)UMLElementTypes.Message_4008).getSemanticHint();
+ messageHint = ((IHintedType) UMLElementTypes.Message_4008).getSemanticHint();
messageHints.add(messageHint);
- messageHint = ((IHintedType)UMLElementTypes.Message_4009).getSemanticHint();
+ messageHint = ((IHintedType) UMLElementTypes.Message_4009).getSemanticHint();
messageHints.add(messageHint);
return messageHints.contains(hint);
}
/**
* Report a message telling that the message can not be dropped because it goes uphill.
- *
+ *
* @param delta
- * the missing delta between the two lifelines
+ * the missing delta between the two lifelines
* @param sourceEditPart
- * the source of the message
+ * the source of the message
* @param targetEditPart
- * the target of the message
+ * the target of the message
*/
private void reportCanNotDropUphillMessage(int delta, IGraphicalEditPart sourceEditPart, IGraphicalEditPart targetEditPart) {
EObject source = sourceEditPart.resolveSemanticElement();
String sourceText = EMFCoreUtil.getQualifiedName(source, true);
EObject target = targetEditPart.resolveSemanticElement();
String targetText = EMFCoreUtil.getQualifiedName(target, true);
- String txt = NLS.bind(CustomMessages.DropError_UphillMessageTxt, new Object[]{ sourceText, targetText, delta });
+ String txt = NLS.bind(CustomMessages.DropError_UphillMessageTxt, new Object[] { sourceText, targetText, delta });
NotificationBuilder notif = NotificationBuilder.createAsyncPopup(CustomMessages.DropError_UphillMessageTitle, txt);
notif.setType(Type.WARNING);
notif.run();
@@ -214,11 +215,11 @@ public class CreateLocatedConnectionViewCommand extends CommonDeferredCreateConn
/**
* Report a message telling that the link drop unexpectedly failed.
- *
+ *
* @param sourceEditPart
- * the source of the link
+ * the source of the link
* @param targetEditPart
- * the target of the link
+ * the target of the link
*/
private void reportDefaultMessage(IGraphicalEditPart sourceEditPart, IGraphicalEditPart targetEditPart) {
EObject source = sourceEditPart.resolveSemanticElement();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomActionExecutionSpecificationCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomActionExecutionSpecificationCreateCommand.java
index 0fa6f7c087a..d79cb54eb86 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomActionExecutionSpecificationCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomActionExecutionSpecificationCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -34,7 +34,7 @@ public class CustomActionExecutionSpecificationCreateCommand extends ActionExecu
/**
* Constructor.
- *
+ *
* @param req
* @param eObject
*/
@@ -44,7 +44,7 @@ public class CustomActionExecutionSpecificationCreateCommand extends ActionExecu
/**
* Constructor.
- *
+ *
* @param req
*/
public CustomActionExecutionSpecificationCreateCommand(CreateElementRequest req, Diagram diagram) {
@@ -53,18 +53,18 @@ public class CustomActionExecutionSpecificationCreateCommand extends ActionExecu
/**
* To add the lifeline to the attribute covered of the AES
- *
+ *
* @Override
*/
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
// Get the model container
- Object modelContainer = ((CreateElementRequest)getRequest()).getParameters().get(SequenceRequestConstant.INTERACTIONFRAGMENT_CONTAINER);
+ Object modelContainer = ((CreateElementRequest) getRequest()).getParameters().get(SequenceRequestConstant.INTERACTIONFRAGMENT_CONTAINER);
// Create the action execution specification
- ActionExecutionSpecification aes = (ActionExecutionSpecification)CommandHelper.doCreateExecutionSpecification(UMLFactory.eINSTANCE.createActionExecutionSpecification(), (Lifeline)getElementToEdit(), modelContainer);
- //TODO : add the corresponding action
+ ActionExecutionSpecification aes = (ActionExecutionSpecification) CommandHelper.doCreateExecutionSpecification(UMLFactory.eINSTANCE.createActionExecutionSpecification(), (Lifeline) getElementToEdit(), modelContainer);
+ // TODO : add the corresponding action
doConfigure(aes, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(aes);
+ ((CreateElementRequest) getRequest()).setNewElement(aes);
return CommandResult.newOKCommandResult(aes);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomBehaviorExecutionSpecificationCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomBehaviorExecutionSpecificationCreateCommand.java
index 73095cc1c9f..550c91e9cbf 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomBehaviorExecutionSpecificationCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomBehaviorExecutionSpecificationCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -34,7 +34,7 @@ public class CustomBehaviorExecutionSpecificationCreateCommand extends BehaviorE
/**
* Constructor.
- *
+ *
* @param req
* @param eObject
*/
@@ -44,7 +44,7 @@ public class CustomBehaviorExecutionSpecificationCreateCommand extends BehaviorE
/**
* Constructor.
- *
+ *
* @param req
*/
public CustomBehaviorExecutionSpecificationCreateCommand(CreateElementRequest req, Diagram diagram) {
@@ -53,17 +53,17 @@ public class CustomBehaviorExecutionSpecificationCreateCommand extends BehaviorE
/**
* To add the lifeline to the attribute covered of the AES
- *
+ *
* @Override
*/
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
// Get the model container
- Object modelContainer = ((CreateElementRequest)getRequest()).getParameters().get(SequenceRequestConstant.INTERACTIONFRAGMENT_CONTAINER);
+ Object modelContainer = ((CreateElementRequest) getRequest()).getParameters().get(SequenceRequestConstant.INTERACTIONFRAGMENT_CONTAINER);
// Configure the BehaviorExecutionSpecification
- BehaviorExecutionSpecification bes = (BehaviorExecutionSpecification)CommandHelper.doCreateExecutionSpecification(UMLFactory.eINSTANCE.createBehaviorExecutionSpecification(), (Lifeline)getElementToEdit(), modelContainer);
+ BehaviorExecutionSpecification bes = (BehaviorExecutionSpecification) CommandHelper.doCreateExecutionSpecification(UMLFactory.eINSTANCE.createBehaviorExecutionSpecification(), (Lifeline) getElementToEdit(), modelContainer);
doConfigure(bes, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(bes);
+ ((CreateElementRequest) getRequest()).setNewElement(bes);
return CommandResult.newOKCommandResult(bes);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomCombinedFragment2CreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomCombinedFragment2CreateCommand.java
index 97b5e9d1e6f..1bbdcaa4c78 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomCombinedFragment2CreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomCombinedFragment2CreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -33,7 +33,7 @@ public class CustomCombinedFragment2CreateCommand extends CombinedFragment2Creat
/**
* Constructor.
- *
+ *
* @param req
* @param eObject
*/
@@ -43,7 +43,7 @@ public class CustomCombinedFragment2CreateCommand extends CombinedFragment2Creat
/**
* Constructor.
- *
+ *
* @param req
*/
public CustomCombinedFragment2CreateCommand(CreateElementRequest req, Diagram diagram) {
@@ -54,17 +54,17 @@ public class CustomCombinedFragment2CreateCommand extends CombinedFragment2Creat
* Create a CoRegion :
* - creates two operands
* - set the Interaction Operator to parallel
- *
+ *
* @Override
*/
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
// Get the model container
- Object modelContainer = ((CreateElementRequest)getRequest()).getParameters().get(SequenceRequestConstant.INTERACTIONFRAGMENT_CONTAINER);
- CombinedFragment combinedFragment = CommandHelper.doCreateCoRegion(modelContainer, (Lifeline)getElementToEdit());
- if(combinedFragment != null) {
+ Object modelContainer = ((CreateElementRequest) getRequest()).getParameters().get(SequenceRequestConstant.INTERACTIONFRAGMENT_CONTAINER);
+ CombinedFragment combinedFragment = CommandHelper.doCreateCoRegion(modelContainer, (Lifeline) getElementToEdit());
+ if (combinedFragment != null) {
doConfigure(combinedFragment, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(combinedFragment);
+ ((CreateElementRequest) getRequest()).setNewElement(combinedFragment);
return CommandResult.newOKCommandResult(combinedFragment);
}
return CommandResult.newErrorCommandResult("");
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomCombinedFragmentCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomCombinedFragmentCreateCommand.java
index 41320d8ee3f..61cd5933ad4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomCombinedFragmentCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomCombinedFragmentCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -38,7 +38,7 @@ public class CustomCombinedFragmentCreateCommand extends CombinedFragmentCreateC
/**
* Constructor.
- *
+ *
* @param req
* @param eObject
*/
@@ -48,7 +48,7 @@ public class CustomCombinedFragmentCreateCommand extends CombinedFragmentCreateC
/**
* Constructor.
- *
+ *
* @param req
*/
public CustomCombinedFragmentCreateCommand(CreateElementRequest req, Diagram diagram) {
@@ -57,7 +57,7 @@ public class CustomCombinedFragmentCreateCommand extends CombinedFragmentCreateC
/**
* The creation command can only be executed if the elementToEdit (i.e the container) is an Interaction or an InteractionOperand
- *
+ *
* @Override
*/
@Override
@@ -67,7 +67,7 @@ public class CustomCombinedFragmentCreateCommand extends CombinedFragmentCreateC
/**
* Handle creation on InteractionOperand
- *
+ *
* @Override
*/
@Override
@@ -76,16 +76,16 @@ public class CustomCombinedFragmentCreateCommand extends CombinedFragmentCreateC
CombinedFragment newElement = UMLFactory.eINSTANCE.createCombinedFragment();
// START GENERATED NOT CODE
EObject elementToEdit = getElementToEdit();
- if(elementToEdit instanceof InteractionOperand) {
- ((InteractionOperand)elementToEdit).getFragments().add(newElement);
- } else if(elementToEdit instanceof Interaction) {
- ((Interaction)elementToEdit).getFragments().add(newElement);
+ if (elementToEdit instanceof InteractionOperand) {
+ ((InteractionOperand) elementToEdit).getFragments().add(newElement);
+ } else if (elementToEdit instanceof Interaction) {
+ ((Interaction) elementToEdit).getFragments().add(newElement);
}
ElementInitializers.getInstance().init_CombinedFragment_3004(newElement);
- Set<InteractionFragment> coveredInteractionFragments = (Set<InteractionFragment>)getRequest().getParameters().get(SequenceRequestConstant.COVERED_INTERACTIONFRAGMENTS);
+ Set<InteractionFragment> coveredInteractionFragments = (Set<InteractionFragment>) getRequest().getParameters().get(SequenceRequestConstant.COVERED_INTERACTIONFRAGMENTS);
CustomInteractionOperandCreateCommand.createInteractionOperand(newElement, coveredInteractionFragments);
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomCommentAnnotatedElementReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomCommentAnnotatedElementReorientCommand.java
index 1a297495cc7..856974d23dc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomCommentAnnotatedElementReorientCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomCommentAnnotatedElementReorientCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -27,7 +27,7 @@ public class CustomCommentAnnotatedElementReorientCommand extends CommentAnnotat
/**
* Constructor.
- *
+ *
* @param request
*/
public CustomCommentAnnotatedElementReorientCommand(ReorientReferenceRelationshipRequest request) {
@@ -41,11 +41,11 @@ public class CustomCommentAnnotatedElementReorientCommand extends CommentAnnotat
protected CommandResult reorientTarget() throws ExecutionException {
getOldSource().getAnnotatedElements().remove(getOldTarget());
getOldSource().getAnnotatedElements().add(getNewTarget());
- if(getOldTarget() instanceof MessageEnd) {
- MessageEndHelper.removeConnectionSourceFromMessageEnd((MessageEnd)getOldTarget(), getOldSource());
+ if (getOldTarget() instanceof MessageEnd) {
+ MessageEndHelper.removeConnectionSourceFromMessageEnd((MessageEnd) getOldTarget(), getOldSource());
}
- if(getNewTarget() instanceof MessageEnd) {
- MessageEndHelper.addConnectionSourceToMessageEnd((MessageEnd)getNewTarget(), getOldSource());
+ if (getNewTarget() instanceof MessageEnd) {
+ MessageEndHelper.addConnectionSourceToMessageEnd((MessageEnd) getNewTarget(), getOldSource());
}
return CommandResult.newOKCommandResult(getOldSource());
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomConsiderIgnoreFragmentCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomConsiderIgnoreFragmentCreateCommand.java
index c7cfa87305d..3723053c131 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomConsiderIgnoreFragmentCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomConsiderIgnoreFragmentCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -39,7 +39,7 @@ public class CustomConsiderIgnoreFragmentCreateCommand extends ConsiderIgnoreFra
/**
* Constructor.
- *
+ *
* @param req
* @param eObject
*/
@@ -49,7 +49,7 @@ public class CustomConsiderIgnoreFragmentCreateCommand extends ConsiderIgnoreFra
/**
* Constructor.
- *
+ *
* @param req
*/
public CustomConsiderIgnoreFragmentCreateCommand(CreateElementRequest req, Diagram diagram) {
@@ -58,7 +58,7 @@ public class CustomConsiderIgnoreFragmentCreateCommand extends ConsiderIgnoreFra
/**
* The creation command can only be executed if the elementToEdit (i.e the container) is an Interaction or an InteractionOperand
- *
+ *
* @Override
*/
@Override
@@ -68,7 +68,7 @@ public class CustomConsiderIgnoreFragmentCreateCommand extends ConsiderIgnoreFra
/**
* Handle creation on InteractionOperand
- *
+ *
* @Override
*/
@Override
@@ -79,12 +79,12 @@ public class CustomConsiderIgnoreFragmentCreateCommand extends ConsiderIgnoreFra
// START GENERATED NOT CODE
EObject elementToEdit = getElementToEdit();
InteractionFragment owner = null;
- if(elementToEdit instanceof InteractionOperand) {
- InteractionOperand io = (InteractionOperand)elementToEdit;
+ if (elementToEdit instanceof InteractionOperand) {
+ InteractionOperand io = (InteractionOperand) elementToEdit;
owner = io;
io.getFragments().add(newElement);
} else {
- Interaction i = (Interaction)elementToEdit;
+ Interaction i = (Interaction) elementToEdit;
owner = i;
i.getFragments().add(newElement);
}
@@ -92,13 +92,13 @@ public class CustomConsiderIgnoreFragmentCreateCommand extends ConsiderIgnoreFra
// Create an interaction operand with the ConsiderIgnoreFragment (multiplicy 1...*)
InteractionOperand createInteractionOperand = UMLFactory.eINSTANCE.createInteractionOperand();
newElement.getOperands().add(createInteractionOperand);
- Set<InteractionFragment> coveredInteractionFragments = (Set<InteractionFragment>)getRequest().getParameters().get(SequenceRequestConstant.COVERED_INTERACTIONFRAGMENTS);
- if(coveredInteractionFragments != null) {
+ Set<InteractionFragment> coveredInteractionFragments = (Set<InteractionFragment>) getRequest().getParameters().get(SequenceRequestConstant.COVERED_INTERACTIONFRAGMENTS);
+ if (coveredInteractionFragments != null) {
// set the enclosing operand to the newly created one if the current enclosing interaction is the enclosing interaction
// of the new operand.
// => the interaction fragment that are inside an other container (like an enclosed CF) are not modified
- for(InteractionFragment ift : coveredInteractionFragments) {
- if(owner.equals(ift.getEnclosingOperand()) || owner.equals(ift.getEnclosingInteraction())) {
+ for (InteractionFragment ift : coveredInteractionFragments) {
+ if (owner.equals(ift.getEnclosingOperand()) || owner.equals(ift.getEnclosingInteraction())) {
ift.setEnclosingInteraction(null);
ift.setEnclosingOperand(createInteractionOperand);
}
@@ -106,7 +106,7 @@ public class CustomConsiderIgnoreFragmentCreateCommand extends ConsiderIgnoreFra
}
// END GENERATED NOT CODE
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomConstraintConstrainedElementReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomConstraintConstrainedElementReorientCommand.java
index d1aaee8fe33..20b627b77d2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomConstraintConstrainedElementReorientCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomConstraintConstrainedElementReorientCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -27,7 +27,7 @@ public class CustomConstraintConstrainedElementReorientCommand extends Constrain
/**
* Constructor.
- *
+ *
* @param request
*/
public CustomConstraintConstrainedElementReorientCommand(ReorientReferenceRelationshipRequest request) {
@@ -41,11 +41,11 @@ public class CustomConstraintConstrainedElementReorientCommand extends Constrain
protected CommandResult reorientTarget() throws ExecutionException {
getOldSource().getConstrainedElements().remove(getOldTarget());
getOldSource().getConstrainedElements().add(getNewTarget());
- if(getOldTarget() instanceof MessageEnd) {
- MessageEndHelper.removeConnectionSourceFromMessageEnd((MessageEnd)getOldTarget(), getOldSource());
+ if (getOldTarget() instanceof MessageEnd) {
+ MessageEndHelper.removeConnectionSourceFromMessageEnd((MessageEnd) getOldTarget(), getOldSource());
}
- if(getNewTarget() instanceof MessageEnd) {
- MessageEndHelper.addConnectionSourceToMessageEnd((MessageEnd)getNewTarget(), getOldSource());
+ if (getNewTarget() instanceof MessageEnd) {
+ MessageEndHelper.addConnectionSourceToMessageEnd((MessageEnd) getNewTarget(), getOldSource());
}
return CommandResult.newOKCommandResult(getOldSource());
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomConstraintCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomConstraintCreateCommand.java
index 89182ed481c..03066cf4a64 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomConstraintCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomConstraintCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -30,7 +30,7 @@ public class CustomConstraintCreateCommand extends ConstraintCreateCommand {
/**
* Constructor.
- *
+ *
* @param req
* @param eObject
*/
@@ -41,19 +41,20 @@ public class CustomConstraintCreateCommand extends ConstraintCreateCommand {
/**
* Constructor.
- *
+ *
* @param req
*/
public CustomConstraintCreateCommand(CreateElementRequest req, Diagram diagram) {
super(req, diagram);
}
+ @Override
protected EObject getElementToEdit() {
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
+ EObject container = ((CreateElementRequest) getRequest()).getContainer();
+ if (container instanceof View) {
+ container = ((View) container).getElement();
}
- if(container != null) {
+ if (container != null) {
return getNamespace(container);
}
return getNamespace(eObject);
@@ -68,11 +69,11 @@ public class CustomConstraintCreateCommand extends ConstraintCreateCommand {
}
protected Namespace getNamespace(EObject element) {
- if(element instanceof Namespace) {
- return (Namespace)element;
+ if (element instanceof Namespace) {
+ return (Namespace) element;
}
- if(element instanceof Lifeline) {
- return ((Lifeline)element).getInteraction();
+ if (element instanceof Lifeline) {
+ return ((Lifeline) element).getInteraction();
}
return null;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomContextLinkCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomContextLinkCreateCommand.java
index 7dd82efc51f..ffccac19251 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomContextLinkCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomContextLinkCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -24,15 +24,13 @@ import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ContextLinkCreateCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContextLinkEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
import org.eclipse.uml2.common.util.CacheAdapter;
import org.eclipse.uml2.uml.Constraint;
import org.eclipse.uml2.uml.Namespace;
-import org.eclipse.uml2.uml.UMLPackage;
/**
* use to construct the instance specification link between two instance
- *
+ *
*/
public class CustomContextLinkCreateCommand extends ContextLinkCreateCommand {
@@ -41,14 +39,14 @@ public class CustomContextLinkCreateCommand extends ContextLinkCreateCommand {
}
private View findView(EObject element) {
- if(element == null) {
+ if (element == null) {
return null;
}
Collection<Setting> settings = CacheAdapter.getInstance().getNonNavigableInverseReferences(element);
- for(Setting ref : settings) {
- if(NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
- View view = (View)ref.getEObject();
- if(view != null) {
+ for (Setting ref : settings) {
+ if (NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
+ View view = (View) ref.getEObject();
+ if (view != null) {
return view;
}
}
@@ -58,38 +56,40 @@ public class CustomContextLinkCreateCommand extends ContextLinkCreateCommand {
@Override
public boolean canExecute() {
- if(source == null && target == null) {
+ if (source == null && target == null) {
return false;
}
- if(source != null && false == source instanceof Constraint) {
+ if (source != null && false == source instanceof Constraint) {
return false;
}
- if(target != null && false == target instanceof Namespace) {
+ if (target != null && false == target instanceof Namespace) {
return false;
}
- if(getSource() == null) {
+ if (getSource() == null) {
return true; // link creation is in progress; source is not defined yet
}
- if(getSource() != null) {
- if(getSource().getContext() != null && target != null) {
- if(getSource() instanceof Constraint) {
- View viewConstraint = findView((Constraint)getSource());
- List sourceConnections = ViewUtil.getSourceConnections(viewConstraint); //get all outgoing connections from constraint view
- for(Object connector : sourceConnections) {
- if(!(connector instanceof Edge)) {
+ if (getSource() != null) {
+ if (getSource().getContext() != null && target != null) {
+ if (getSource() instanceof Constraint) {
+ View viewConstraint = findView(getSource());
+ List sourceConnections = ViewUtil.getSourceConnections(viewConstraint); // get all outgoing connections from constraint view
+ for (Object connector : sourceConnections) {
+ if (!(connector instanceof Edge)) {
continue;
}
- Edge edge = (Edge)connector;
+ Edge edge = (Edge) connector;
EObject targetElem = edge.getTarget().getElement();
- if(targetElem instanceof Namespace) {
- if(("" + ContextLinkEditPart.VISUAL_ID).equals(edge.getType()))
- return false; //case of the connector representing a context link
+ if (targetElem instanceof Namespace) {
+ if (("" + ContextLinkEditPart.VISUAL_ID).equals(edge.getType()))
+ {
+ return false; // case of the connector representing a context link
+ }
}
}
}
}
}
- if(getTarget() != null && (getTarget().getOwnedRules().contains(getTarget()))) {
+ if (getTarget() != null && (getTarget().getOwnedRules().contains(getTarget()))) {
return false;
}
return true;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomContinuationCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomContinuationCreateCommand.java
index 8c312db57e5..0a2fb47a3ab 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomContinuationCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomContinuationCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -36,7 +36,7 @@ public class CustomContinuationCreateCommand extends ContinuationCreateCommand {
/**
* Constructor.
- *
+ *
* @param req
* @param eObject
*/
@@ -46,7 +46,7 @@ public class CustomContinuationCreateCommand extends ContinuationCreateCommand {
/**
* Constructor.
- *
+ *
* @param req
*/
public CustomContinuationCreateCommand(CreateElementRequest req, Diagram diagram) {
@@ -58,11 +58,11 @@ public class CustomContinuationCreateCommand extends ContinuationCreateCommand {
*/
@Override
public boolean canExecute() {
- if(getElementToEdit() instanceof InteractionOperand) {
- InteractionOperand interactionOperand = (InteractionOperand)getElementToEdit();
+ if (getElementToEdit() instanceof InteractionOperand) {
+ InteractionOperand interactionOperand = (InteractionOperand) getElementToEdit();
CombinedFragment combinedFragment = getEnclosingCombinedFragment(interactionOperand);
- if(combinedFragment != null) {
- if(combinedFragment.getInteractionOperator() == InteractionOperatorKind.ALT_LITERAL) {
+ if (combinedFragment != null) {
+ if (combinedFragment.getInteractionOperator() == InteractionOperatorKind.ALT_LITERAL) {
return true;
}
}
@@ -71,30 +71,30 @@ public class CustomContinuationCreateCommand extends ContinuationCreateCommand {
}
private CombinedFragment getEnclosingCombinedFragment(InteractionFragment interactionFragment) {
- if(interactionFragment.eContainer() instanceof CombinedFragment) {
- return (CombinedFragment)interactionFragment.eContainer();
- } else if(interactionFragment.eContainer() instanceof InteractionFragment) {
- return getEnclosingCombinedFragment((InteractionFragment)interactionFragment.eContainer());
+ if (interactionFragment.eContainer() instanceof CombinedFragment) {
+ return (CombinedFragment) interactionFragment.eContainer();
+ } else if (interactionFragment.eContainer() instanceof InteractionFragment) {
+ return getEnclosingCombinedFragment((InteractionFragment) interactionFragment.eContainer());
}
return null;
}
/**
* Generated not to handle the constraint on covered lifelines.
- *
+ *
* @Override
*/
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
Continuation newElement = UMLFactory.eINSTANCE.createContinuation();
- InteractionOperand owner = (InteractionOperand)getElementToEdit();
+ InteractionOperand owner = (InteractionOperand) getElementToEdit();
owner.getFragments().add(newElement);
- // Continuations are always global in the enclosing InteractionFragment
- //(e.g., it always covers all Lifelines covered by the enclosing InteractionFragment)
+ // Continuations are always global in the enclosing InteractionFragment
+ // (e.g., it always covers all Lifelines covered by the enclosing InteractionFragment)
newElement.getCovereds().addAll(owner.getCovereds());
ElementInitializers.getInstance().init_Continuation_3016(newElement);
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomDestructionOccurrenceSpecificationCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomDestructionOccurrenceSpecificationCreateCommand.java
index 80de7c7c4d6..33b7351f343 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomDestructionOccurrenceSpecificationCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomDestructionOccurrenceSpecificationCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -35,7 +35,7 @@ public class CustomDestructionOccurrenceSpecificationCreateCommand extends Destr
/**
* Constructor.
- *
+ *
* @param req
* @param eObject
*/
@@ -45,7 +45,7 @@ public class CustomDestructionOccurrenceSpecificationCreateCommand extends Destr
/**
* Constructor.
- *
+ *
* @param req
*/
public CustomDestructionOccurrenceSpecificationCreateCommand(CreateElementRequest req, Diagram diagram) {
@@ -54,15 +54,15 @@ public class CustomDestructionOccurrenceSpecificationCreateCommand extends Destr
/**
* A DestructionEvent on a lifeline can only be created if it doesn't exist yet a destructionEvent on that lifeline.
- *
+ *
* @Override
*/
@Override
public boolean canExecute() {
// Get the lifeline
- Lifeline lifeline = (Lifeline)getElementToEdit();
- for(InteractionFragment ift : lifeline.getCoveredBys()) {
- if(ift instanceof DestructionOccurrenceSpecification) {
+ Lifeline lifeline = (Lifeline) getElementToEdit();
+ for (InteractionFragment ift : lifeline.getCoveredBys()) {
+ if (ift instanceof DestructionOccurrenceSpecification) {
// For each occurenceSpecification which covered the lifeline, check the associated event.
return false;
}
@@ -70,13 +70,14 @@ public class CustomDestructionOccurrenceSpecificationCreateCommand extends Destr
return true;
}
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
// Get the model container
- Object modelContainer = ((CreateElementRequest)getRequest()).getParameters().get(SequenceRequestConstant.INTERACTIONFRAGMENT_CONTAINER);
- DestructionOccurrenceSpecification destructionSpecification = (DestructionOccurrenceSpecification)CommandHelper.doCreateDestructionOccurrenceSpecification((Lifeline)getElementToEdit(), modelContainer);
+ Object modelContainer = ((CreateElementRequest) getRequest()).getParameters().get(SequenceRequestConstant.INTERACTIONFRAGMENT_CONTAINER);
+ DestructionOccurrenceSpecification destructionSpecification = CommandHelper.doCreateDestructionOccurrenceSpecification((Lifeline) getElementToEdit(), modelContainer);
ElementInitializers.getInstance().init_DestructionOccurrenceSpecification_3022(destructionSpecification);
doConfigure(destructionSpecification, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(destructionSpecification);
+ ((CreateElementRequest) getRequest()).setNewElement(destructionSpecification);
return CommandResult.newOKCommandResult(destructionSpecification);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomDurationConstraintCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomDurationConstraintCreateCommand.java
index ad9124326a7..0d310853b58 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomDurationConstraintCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomDurationConstraintCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -39,7 +39,7 @@ public class CustomDurationConstraintCreateCommand extends DurationConstraintCre
/**
* Constructor.
- *
+ *
* @param req
* @param eObject
*/
@@ -49,7 +49,7 @@ public class CustomDurationConstraintCreateCommand extends DurationConstraintCre
/**
* Constructor.
- *
+ *
* @param req
*/
public CustomDurationConstraintCreateCommand(CreateElementRequest req, Diagram diagram) {
@@ -113,21 +113,21 @@ public class CustomDurationConstraintCreateCommand extends DurationConstraintCre
Object paramOccurrence2 = getRequest().getParameter(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2);
List<OccurrenceSpecification> occ2List = SequenceUtil.getAsOccSpecList(paramOccurrence2);
OccurrenceSpecification[] pair = SequenceUtil.getPairOfCorrespondingOccSpec(occ1List, occ2List);
- if(pair != null && pair.length > 1) {
+ if (pair != null && pair.length > 1) {
newElement.getConstrainedElements().add(pair[0]);
newElement.getConstrainedElements().add(pair[1]);
}
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
protected Namespace getNamespace(EObject element) {
- if(element instanceof Namespace) {
- return (Namespace)element;
+ if (element instanceof Namespace) {
+ return (Namespace) element;
}
- if(element instanceof CombinedFragment) {
- return ((CombinedFragment)element).getNamespace();
+ if (element instanceof CombinedFragment) {
+ return ((CombinedFragment) element).getNamespace();
}
return getNamespace(element.eContainer());
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomDurationConstraintInMessageCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomDurationConstraintInMessageCreateCommand.java
index 0c86a091340..ee75fcfb4e6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomDurationConstraintInMessageCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomDurationConstraintInMessageCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -25,7 +25,7 @@ public class CustomDurationConstraintInMessageCreateCommand extends DurationCons
/**
* Constructor.
- *
+ *
* @param req
* @param eObject
*/
@@ -35,7 +35,7 @@ public class CustomDurationConstraintInMessageCreateCommand extends DurationCons
/**
* Constructor.
- *
+ *
* @param req
*/
public CustomDurationConstraintInMessageCreateCommand(CreateElementRequest req, Diagram diagram) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomDurationObservationCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomDurationObservationCreateCommand.java
index 335a4892e7d..1fc9e83bd14 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomDurationObservationCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomDurationObservationCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -38,7 +38,7 @@ public class CustomDurationObservationCreateCommand extends DurationObservationC
/**
* Constructor.
- *
+ *
* @param req
* @param eObject
*/
@@ -48,7 +48,7 @@ public class CustomDurationObservationCreateCommand extends DurationObservationC
/**
* Constructor.
- *
+ *
* @param req
*/
public CustomDurationObservationCreateCommand(CreateElementRequest req, Diagram diagram) {
@@ -60,46 +60,46 @@ public class CustomDurationObservationCreateCommand extends DurationObservationC
*/
@Override
public boolean canExecute() {
- //Fix https://bugs.eclipse.org/bugs/show_bug.cgi?id=364826
+ // Fix https://bugs.eclipse.org/bugs/show_bug.cgi?id=364826
return true;
- // // check first occurrence specification
- // if(!getRequest().getParameters().containsKey(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION)) {
- // return true; // duration creation is in progress; source is not defined yet
- // }
- // Object paramOccurrence1 = getRequest().getParameter(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION);
- // List<OccurrenceSpecification> occ1List = SequenceUtil.getAsOccSpecList(paramOccurrence1);
- // if(occ1List.isEmpty()) {
- // return false;
- // }
- // // check second occurrence specification
- // if(!getRequest().getParameters().containsKey(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2)) {
- // // duration creation is in progress; target is not defined yet
- // // enable duration observation only on a message
- // for(OccurrenceSpecification occurrence : occ1List) {
- // if(occurrence instanceof MessageOccurrenceSpecification) {
- // Message mess = ((MessageOccurrenceSpecification)occurrence).getMessage();
- // if(mess != null) {
- // return true;
- // }
- // }
- // }
- // return false;
- // }
- // Object paramOccurrence2 = getRequest().getParameter(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2);
- // List<OccurrenceSpecification> occ2List = SequenceUtil.getAsOccSpecList(paramOccurrence2);
- // if(occ2List.isEmpty()) {
- // return false;
- // }
- // // disable duration observation on a same event
- // if(!Collections.disjoint(occ1List, occ2List)) {
- // return false;
- // }
- // // enable duration observation only on a message
- // OccurrenceSpecification[] pair = SequenceUtil.getPairOfCorrespondingOccSpec(occ1List, occ2List);
- // if(pair != null && pair.length > 1) {
- // return DurationObservationHelper.endsOfSameMessage(pair[0], pair[1]);
- // }
- // return false;
+ // // check first occurrence specification
+ // if(!getRequest().getParameters().containsKey(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION)) {
+ // return true; // duration creation is in progress; source is not defined yet
+ // }
+ // Object paramOccurrence1 = getRequest().getParameter(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION);
+ // List<OccurrenceSpecification> occ1List = SequenceUtil.getAsOccSpecList(paramOccurrence1);
+ // if(occ1List.isEmpty()) {
+ // return false;
+ // }
+ // // check second occurrence specification
+ // if(!getRequest().getParameters().containsKey(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2)) {
+ // // duration creation is in progress; target is not defined yet
+ // // enable duration observation only on a message
+ // for(OccurrenceSpecification occurrence : occ1List) {
+ // if(occurrence instanceof MessageOccurrenceSpecification) {
+ // Message mess = ((MessageOccurrenceSpecification)occurrence).getMessage();
+ // if(mess != null) {
+ // return true;
+ // }
+ // }
+ // }
+ // return false;
+ // }
+ // Object paramOccurrence2 = getRequest().getParameter(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2);
+ // List<OccurrenceSpecification> occ2List = SequenceUtil.getAsOccSpecList(paramOccurrence2);
+ // if(occ2List.isEmpty()) {
+ // return false;
+ // }
+ // // disable duration observation on a same event
+ // if(!Collections.disjoint(occ1List, occ2List)) {
+ // return false;
+ // }
+ // // enable duration observation only on a message
+ // OccurrenceSpecification[] pair = SequenceUtil.getPairOfCorrespondingOccSpec(occ1List, occ2List);
+ // if(pair != null && pair.length > 1) {
+ // return DurationObservationHelper.endsOfSameMessage(pair[0], pair[1]);
+ // }
+ // return false;
}
/**
@@ -110,13 +110,13 @@ public class CustomDurationObservationCreateCommand extends DurationObservationC
DurationObservation newElement = UMLFactory.eINSTANCE.createDurationObservation();
// get the parent package as owner
EObject container = getElementToEdit();
- while(container != null && !(container instanceof Package)) {
+ while (container != null && !(container instanceof Package)) {
container = container.eContainer();
}
- if(container == null) {
+ if (container == null) {
return CommandResult.newCancelledCommandResult();
}
- Package owner = (Package)container;
+ Package owner = (Package) container;
owner.getPackagedElements().add(newElement);
ElementInitializers.getInstance().init_DurationObservation_3024(newElement);
// assign the occurrence specification
@@ -125,12 +125,12 @@ public class CustomDurationObservationCreateCommand extends DurationObservationC
Object paramOcc2 = getRequest().getParameter(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2);
List<OccurrenceSpecification> occ2List = SequenceUtil.getAsOccSpecList(paramOcc2);
OccurrenceSpecification[] pair = SequenceUtil.getPairOfCorrespondingOccSpec(occ1List, occ2List);
- if(pair != null && pair.length > 1) {
+ if (pair != null && pair.length > 1) {
newElement.getEvents().add(pair[0]);
newElement.getEvents().add(pair[1]);
}
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomGeneralOrderingCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomGeneralOrderingCreateCommand.java
index 3f8883e7748..080adaa8d06 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomGeneralOrderingCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomGeneralOrderingCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -38,32 +38,32 @@ public class CustomGeneralOrderingCreateCommand extends GeneralOrderingCreateCom
/**
* Non generated, completely redefined to find correct ends and correct container
- *
+ *
* @Override find source and target events and container
*/
public CustomGeneralOrderingCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
super(request, source, target);
// check source occurrence specification
List<OccurrenceSpecification> possibleSourceOcc = null;
- if(getRequest().getParameters().containsKey(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION)) {
+ if (getRequest().getParameters().containsKey(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION)) {
Object paramOccurrence1 = getRequest().getParameter(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION);
List<OccurrenceSpecification> occ1List = SequenceUtil.getAsOccSpecList(paramOccurrence1);
possibleSourceOcc = occ1List;
}
// check target occurrence specification
List<OccurrenceSpecification> possibleTargetOcc = null;
- if(getRequest().getParameters().containsKey(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2)) {
+ if (getRequest().getParameters().containsKey(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2)) {
Object paramOccurrence2 = getRequest().getParameter(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2);
List<OccurrenceSpecification> occ2List = SequenceUtil.getAsOccSpecList(paramOccurrence2);
possibleTargetOcc = occ2List;
}
// disable duration constraint on a same event
- if(possibleSourceOcc != null && !possibleSourceOcc.isEmpty()) {
+ if (possibleSourceOcc != null && !possibleSourceOcc.isEmpty()) {
this.source = possibleSourceOcc.get(0);
} else {
this.source = null;
}
- if(possibleTargetOcc != null && !possibleTargetOcc.isEmpty() && Collections.disjoint(possibleSourceOcc, possibleTargetOcc)) {
+ if (possibleTargetOcc != null && !possibleTargetOcc.isEmpty() && Collections.disjoint(possibleSourceOcc, possibleTargetOcc)) {
this.target = possibleTargetOcc.get(0);
} else {
// set invalid target to disable it (or null to enable in case second end is not defined)
@@ -72,34 +72,38 @@ public class CustomGeneralOrderingCreateCommand extends GeneralOrderingCreateCom
container = deduceContainer(source, target);
}
+ @Override
public boolean canExecute() {
- if(source == null && target == null) {
+ if (source == null && target == null) {
return false;
}
- if(source != null && false == source instanceof OccurrenceSpecification) {
+ if (source != null && false == source instanceof OccurrenceSpecification) {
return false;
}
- if(target != null && false == target instanceof OccurrenceSpecification) {
+ if (target != null && false == target instanceof OccurrenceSpecification) {
return false;
}
- if(getSource() == null) {
+ if (getSource() == null) {
return true; // link creation is in progress; source is not defined yet
}
// target may be null here but it's possible to check constraint
- if(getContainer() == null) {
+ if (getContainer() == null) {
return false;
}
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateGeneralOrdering_4012(getContainer(), getSource(), getTarget());
}
+ @Override
protected OccurrenceSpecification getSource() {
- return (OccurrenceSpecification)source;
+ return (OccurrenceSpecification) source;
}
+ @Override
protected OccurrenceSpecification getTarget() {
- return (OccurrenceSpecification)target;
+ return (OccurrenceSpecification) target;
}
+ @Override
public InteractionFragment getContainer() {
return container;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomInteractionCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomInteractionCreateCommand.java
index 5550e5c2e5c..c8d4080cf63 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomInteractionCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomInteractionCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -34,7 +34,7 @@ public class CustomInteractionCreateCommand extends InteractionCreateCommand {
/**
* Constructor.
- *
+ *
* @param req
* @param eObject
*/
@@ -44,7 +44,7 @@ public class CustomInteractionCreateCommand extends InteractionCreateCommand {
/**
* Constructor.
- *
+ *
* @param req
*/
public CustomInteractionCreateCommand(CreateElementRequest req, Diagram diagram) {
@@ -58,17 +58,17 @@ public class CustomInteractionCreateCommand extends InteractionCreateCommand {
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
Interaction newElement = UMLFactory.eINSTANCE.createInteraction();
EObject elementToEdit = getElementToEdit();
- if(elementToEdit instanceof Package) {
- if(((Package)elementToEdit).getPackagedElements() != null) {
- ((Package)elementToEdit).getPackagedElements().add(newElement);
+ if (elementToEdit instanceof Package) {
+ if (((Package) elementToEdit).getPackagedElements() != null) {
+ ((Package) elementToEdit).getPackagedElements().add(newElement);
}
// the interaction will be created in a behavioredClassifier
- } else if(elementToEdit instanceof BehavioredClassifier) {
- ((BehavioredClassifier)elementToEdit).setClassifierBehavior(newElement);
+ } else if (elementToEdit instanceof BehavioredClassifier) {
+ ((BehavioredClassifier) elementToEdit).setClassifierBehavior(newElement);
}
ElementInitializers.getInstance().init_Interaction_2001(newElement);
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomInteractionOperandCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomInteractionOperandCreateCommand.java
index 3e0a3f65f80..e779402b8ce 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomInteractionOperandCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomInteractionOperandCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -40,7 +40,7 @@ public class CustomInteractionOperandCreateCommand extends InteractionOperandCre
/**
* Constructor.
- *
+ *
* @param req
* @param eObject
*/
@@ -50,7 +50,7 @@ public class CustomInteractionOperandCreateCommand extends InteractionOperandCre
/**
* Constructor.
- *
+ *
* @param req
*/
public CustomInteractionOperandCreateCommand(CreateElementRequest req, Diagram diagram) {
@@ -59,17 +59,17 @@ public class CustomInteractionOperandCreateCommand extends InteractionOperandCre
/**
* Generated not for add combined fragment's covered lifelines on interaction operand
- *
+ *
* @Override
*/
@Override
@SuppressWarnings({ "unchecked" })
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- CombinedFragment owner = (CombinedFragment)getElementToEdit();
- Set<InteractionFragment> coveredInteractionFragments = (Set<InteractionFragment>)getRequest().getParameters().get(SequenceRequestConstant.COVERED_INTERACTIONFRAGMENTS);
+ CombinedFragment owner = (CombinedFragment) getElementToEdit();
+ Set<InteractionFragment> coveredInteractionFragments = (Set<InteractionFragment>) getRequest().getParameters().get(SequenceRequestConstant.COVERED_INTERACTIONFRAGMENTS);
InteractionOperand newElement = createInteractionOperand(owner, coveredInteractionFragments);
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -82,7 +82,7 @@ public class CustomInteractionOperandCreateCommand extends InteractionOperandCre
String name = ElementInitializers.getNextNumberedName(cf.getOperands(), base);
newIO.setName(name);
// Add all combined fragment's covered lifelines on interaction operand
- for(InteractionOperand operand : cf.getOperands()) {
+ for (InteractionOperand operand : cf.getOperands()) {
operand.getCovereds().addAll(cf.getCovereds());
}
// create guard
@@ -97,19 +97,19 @@ public class CustomInteractionOperandCreateCommand extends InteractionOperandCre
LiteralInteger max = UMLFactory.eINSTANCE.createLiteralInteger();
max.setValue(1);
guard.setMaxint(max);
- if(coveredInteractionFragments != null) {
+ if (coveredInteractionFragments != null) {
InteractionFragment cfOwner = null;
- if(cf.getEnclosingOperand() != null) {
+ if (cf.getEnclosingOperand() != null) {
cfOwner = cf.getEnclosingOperand();
- } else if(cf.getEnclosingInteraction() != null) {
+ } else if (cf.getEnclosingInteraction() != null) {
cfOwner = cf.getEnclosingInteraction();
}
- if(cfOwner != null) {
+ if (cfOwner != null) {
// set the enclosing operand to the newly created one if the current enclosing interaction is the enclosing interaction
// of the new operand.
// => the interaction fragment that are inside an other container (like an enclosed CF) are not modified
- for(InteractionFragment ift : coveredInteractionFragments) {
- if(cfOwner.equals(ift.getEnclosingOperand()) || cfOwner.equals(ift.getEnclosingInteraction())) {
+ for (InteractionFragment ift : coveredInteractionFragments) {
+ if (cfOwner.equals(ift.getEnclosingOperand()) || cfOwner.equals(ift.getEnclosingInteraction())) {
ift.setEnclosingInteraction(null);
ift.setEnclosingOperand(newIO);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomInteractionUseCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomInteractionUseCreateCommand.java
index dd326bf19aa..2413463d9ae 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomInteractionUseCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomInteractionUseCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -34,7 +34,7 @@ public class CustomInteractionUseCreateCommand extends InteractionUseCreateComma
/**
* Constructor.
- *
+ *
* @param req
* @param eObject
*/
@@ -44,7 +44,7 @@ public class CustomInteractionUseCreateCommand extends InteractionUseCreateComma
/**
* Constructor.
- *
+ *
* @param req
*/
public CustomInteractionUseCreateCommand(CreateElementRequest req, Diagram diagram) {
@@ -53,7 +53,7 @@ public class CustomInteractionUseCreateCommand extends InteractionUseCreateComma
/**
* The creation command can only be executed if the elementToEdit (i.e the container) is an Interaction or an InteractionOperand
- *
+ *
* @Override
*/
@Override
@@ -63,23 +63,23 @@ public class CustomInteractionUseCreateCommand extends InteractionUseCreateComma
/**
* Handle creation on InteractionOperand
- *
+ *
* @Override
*/
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
InteractionUse newElement = UMLFactory.eINSTANCE.createInteractionUse();
EObject elementToEdit = getElementToEdit();
- if(elementToEdit instanceof InteractionOperand) {
- InteractionOperand owner = (InteractionOperand)elementToEdit;
+ if (elementToEdit instanceof InteractionOperand) {
+ InteractionOperand owner = (InteractionOperand) elementToEdit;
owner.getFragments().add(newElement);
} else {
- Interaction owner = (Interaction)elementToEdit;
+ Interaction owner = (Interaction) elementToEdit;
owner.getFragments().add(newElement);
}
ElementInitializers.getInstance().init_InteractionUse_3002(newElement);
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomLifelineCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomLifelineCreateCommand.java
index 741c0379f14..735f9fa8361 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomLifelineCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomLifelineCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -50,7 +50,7 @@ public class CustomLifelineCreateCommand extends LifelineCreateCommand {
/**
* Constructor.
- *
+ *
* @param req
* @param eObject
*/
@@ -60,7 +60,7 @@ public class CustomLifelineCreateCommand extends LifelineCreateCommand {
/**
* Constructor.
- *
+ *
* @param req
*/
public CustomLifelineCreateCommand(CreateElementRequest req, Diagram diagram) {
@@ -69,7 +69,7 @@ public class CustomLifelineCreateCommand extends LifelineCreateCommand {
/**
* Add generated NOT to constrain the creation of a lifeline
- *
+ *
* @Override
*/
@Override
@@ -79,7 +79,7 @@ public class CustomLifelineCreateCommand extends LifelineCreateCommand {
/**
* Generated not for add lifelines on lifeline
- *
+ *
* @Override
*/
@Override
@@ -88,17 +88,17 @@ public class CustomLifelineCreateCommand extends LifelineCreateCommand {
Interaction interactionOwner = null;
Property property = null;
Lifeline newElement = UMLFactory.eINSTANCE.createLifeline();
- if(object instanceof Lifeline) {
- Lifeline parentLifeline = (Lifeline)object;
+ if (object instanceof Lifeline) {
+ Lifeline parentLifeline = (Lifeline) object;
property = CommandHelper.getProperties(availableProperties);
- if(property == null) {
+ if (property == null) {
return CommandResult.newCancelledCommandResult();
}
newElement.setRepresents(property);
interactionOwner = parentLifeline.getInteraction();
// create or retrieve a PartDecomposition
PartDecomposition partDecomposition = parentLifeline.getDecomposedAs();
- if(partDecomposition == null) {
+ if (partDecomposition == null) {
List<InteractionFragment> ifts = interactionOwner.getFragments();
partDecomposition = UMLFactory.eINSTANCE.createPartDecomposition();
partDecomposition.setName(ElementInitializers.getNextNumberedName(ifts, partDecomposition.eClass().getName()));
@@ -107,12 +107,12 @@ public class CustomLifelineCreateCommand extends LifelineCreateCommand {
}
partDecomposition.getCovereds().add(newElement);
} else {
- interactionOwner = (Interaction)getElementToEdit();
+ interactionOwner = (Interaction) getElementToEdit();
}
interactionOwner.getLifelines().add(newElement);
ElementInitializers.getInstance().init_Lifeline_3001(newElement);
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -121,26 +121,26 @@ public class CustomLifelineCreateCommand extends LifelineCreateCommand {
*/
@Override
protected void doConfigure(Lifeline newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
- // fix bug 364696(https://bugs.eclipse.org/bugs/show_bug.cgi?id=364696)
+ // fix bug 364696(https://bugs.eclipse.org/bugs/show_bug.cgi?id=364696)
Object object = getRequest().getParameters().get(SequenceRequestConstant.CONNECTABLE_ELEMENT);
- if(object instanceof ConnectableElement) {
- newElement.setRepresents((ConnectableElement)object);
+ if (object instanceof ConnectableElement) {
+ newElement.setRepresents((ConnectableElement) object);
}
ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
+ if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
/**
* Set available property
- *
+ *
* @param availableProperties
- * The available properties
+ * The available properties
*/
public void setAvailableProperties(List<Property> availableProperties) {
this.availableProperties = availableProperties;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage2CreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage2CreateCommand.java
index 86d7193e171..d49d985cb29 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage2CreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage2CreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -50,7 +50,7 @@ public class CustomMessage2CreateCommand extends Message2CreateCommand {
/**
* Constructor.
- *
+ *
* @param request
* @param source
* @param target
@@ -61,33 +61,33 @@ public class CustomMessage2CreateCommand extends Message2CreateCommand {
/**
* Add a condition on the MOS container
- *
+ *
* @Override
*/
@Override
public boolean canExecute() {
- if(source == null && target == null) {
+ if (source == null && target == null) {
return false;
}
- if(source != null && false == source instanceof Element) {
+ if (source != null && false == source instanceof Element) {
return false;
}
- if(target != null && false == target instanceof Element) {
+ if (target != null && false == target instanceof Element) {
return false;
}
- if(getSource() == null) {
+ if (getSource() == null) {
return true; // link creation is in progress; source is not defined yet
}
// target may be null here but it's possible to check constraint
- if(getContainer() == null) {
+ if (getContainer() == null) {
return false;
}
- if(getSource() != null && getTarget() != null) {
- if(!CommandHelper.hasValidContainer(getRequest())) {
+ if (getSource() != null && getTarget() != null) {
+ if (!CommandHelper.hasValidContainer(getRequest())) {
return false;
}
}
- if(!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateMessage_4004(getContainer(), getSource(), getTarget())) {
+ if (!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateMessage_4004(getContainer(), getSource(), getTarget())) {
return false;
}
return MessageConnectionHelper.canExist(MessageSort.ASYNCH_CALL_LITERAL, getSource(), getTarget());
@@ -95,36 +95,36 @@ public class CustomMessage2CreateCommand extends Message2CreateCommand {
/**
* added code to create the gate , message occurence and event when a Async message is created.
- *
+ *
* @Override
*/
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException(CREATE_LINK_ERROR_MSG);
}
Map<Object, Object> parameters = getRequest().getParameters();
Message message = CommandHelper.doCreateMessage(container, null, getSource(), getTarget(), parameters);
- //Fixed bug about creating message, if created failed, return error result.
- if(message == null || message.getSendEvent() == null || message.getReceiveEvent() == null) {
+ // Fixed bug about creating message, if created failed, return error result.
+ if (message == null || message.getSendEvent() == null || message.getReceiveEvent() == null) {
return CommandResult.newErrorCommandResult("Failed to create message");
}
- if(message != null) {
- //Do reset message end to target ExecutionSpecification. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=402975
- if(getTarget() instanceof ExecutionOccurrenceSpecification) {
- ExecutionSpecification execution = ((ExecutionOccurrenceSpecification)getTarget()).getExecution();
- if(execution != null) {
+ if (message != null) {
+ // Do reset message end to target ExecutionSpecification. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=402975
+ if (getTarget() instanceof ExecutionOccurrenceSpecification) {
+ ExecutionSpecification execution = ((ExecutionOccurrenceSpecification) getTarget()).getExecution();
+ if (execution != null) {
OccurrenceSpecificationHelper.resetExecutionStart(execution, message.getReceiveEvent());
}
}
- if(getSource() instanceof ExecutionOccurrenceSpecification) {
- ExecutionSpecification execution = ((ExecutionOccurrenceSpecification)getSource()).getExecution();
- if(execution != null) {
+ if (getSource() instanceof ExecutionOccurrenceSpecification) {
+ ExecutionSpecification execution = ((ExecutionOccurrenceSpecification) getSource()).getExecution();
+ if (execution != null) {
OccurrenceSpecificationHelper.resetExecutionStart(execution, message.getSendEvent());
}
}
doConfigure(message, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(message);
+ ((CreateElementRequest) getRequest()).setNewElement(message);
return CommandResult.newOKCommandResult(message);
}
return CommandResult.newErrorCommandResult(NO_CONTAINER_ERROR_MSG);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage2ReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage2ReorientCommand.java
index 404d0e8ae70..5617e381136 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage2ReorientCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage2ReorientCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -30,7 +30,7 @@ public class CustomMessage2ReorientCommand extends Message2ReorientCommand {
/**
* Constructor.
- *
+ *
* @param request
*/
public CustomMessage2ReorientCommand(ReorientRelationshipRequest request) {
@@ -42,14 +42,14 @@ public class CustomMessage2ReorientCommand extends Message2ReorientCommand {
*/
@Override
protected boolean canReorientSource() {
- if(!(getOldSource() instanceof Element && getNewSource() instanceof Element)) {
+ if (!(getOldSource() instanceof Element && getNewSource() instanceof Element)) {
return false;
}
- if(!(getLink().eContainer() instanceof Interaction)) {
+ if (!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- Interaction container = (Interaction)getLink().eContainer();
- if(!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4004(container, getLink(), getNewSource(), getOldTarget())) {
+ Interaction container = (Interaction) getLink().eContainer();
+ if (!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4004(container, getLink(), getNewSource(), getOldTarget())) {
return false;
}
return MessageConnectionHelper.canReorientSource(getLink(), getNewSource());
@@ -60,15 +60,15 @@ public class CustomMessage2ReorientCommand extends Message2ReorientCommand {
*/
@Override
protected boolean canReorientTarget() {
- if(!(getOldTarget() instanceof Element && getNewTarget() instanceof Element)) {
+ if (!(getOldTarget() instanceof Element && getNewTarget() instanceof Element)) {
return false;
}
Element source = getLink().getOwner();
- if(!(getLink().eContainer() instanceof Interaction)) {
+ if (!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- Interaction container = (Interaction)getLink().eContainer();
- if(!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4004(container, getLink(), source, getNewTarget())) {
+ Interaction container = (Interaction) getLink().eContainer();
+ if (!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4004(container, getLink(), source, getNewTarget())) {
return false;
}
return MessageConnectionHelper.canReorientTarget(getLink(), getNewTarget());
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage3CreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage3CreateCommand.java
index 75f10806899..a4b651237bc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage3CreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage3CreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -39,7 +39,7 @@ public class CustomMessage3CreateCommand extends Message3CreateCommand {
/**
* Constructor.
- *
+ *
* @param request
* @param source
* @param target
@@ -50,33 +50,33 @@ public class CustomMessage3CreateCommand extends Message3CreateCommand {
/**
* Add a condition on the MOS container
- *
+ *
* @Override
*/
@Override
public boolean canExecute() {
- if(source == null && target == null) {
+ if (source == null && target == null) {
return false;
}
- if(source != null && false == source instanceof Element) {
+ if (source != null && false == source instanceof Element) {
return false;
}
- if(target != null && false == target instanceof Element) {
+ if (target != null && false == target instanceof Element) {
return false;
}
- if(getSource() == null) {
+ if (getSource() == null) {
return true; // link creation is in progress; source is not defined yet
}
// target may be null here but it's possible to check constraint
- if(getContainer() == null) {
+ if (getContainer() == null) {
return false;
}
- if(getSource() != null && getTarget() != null) {
- if(!CommandHelper.hasValidContainer(getRequest())) {
+ if (getSource() != null && getTarget() != null) {
+ if (!CommandHelper.hasValidContainer(getRequest())) {
return false;
}
}
- if(!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateMessage_4005(getContainer(), getSource(), getTarget())) {
+ if (!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateMessage_4005(getContainer(), getSource(), getTarget())) {
return false;
}
return MessageConnectionHelper.canExist(MessageSort.REPLY_LITERAL, getSource(), getTarget());
@@ -84,24 +84,24 @@ public class CustomMessage3CreateCommand extends Message3CreateCommand {
/**
* Create a MessageOccurenceSpecification and the call event when a message is created
- *
+ *
* @Override
*/
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
}
- InteractionFragment sourceContainer = (InteractionFragment)getRequest().getParameters().get(SequenceRequestConstant.SOURCE_MODEL_CONTAINER);
- InteractionFragment targetContainer = (InteractionFragment)getRequest().getParameters().get(SequenceRequestConstant.TARGET_MODEL_CONTAINER);
+ InteractionFragment sourceContainer = (InteractionFragment) getRequest().getParameters().get(SequenceRequestConstant.SOURCE_MODEL_CONTAINER);
+ InteractionFragment targetContainer = (InteractionFragment) getRequest().getParameters().get(SequenceRequestConstant.TARGET_MODEL_CONTAINER);
Message message = CommandHelper.doCreateMessage(container, MessageSort.REPLY_LITERAL, getSource(), getTarget(), sourceContainer, targetContainer);
- if(message != null) {
- //Reset the finish of target ExecutionSpecification to message end. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=402975F
- if(getSource() instanceof ExecutionSpecification) {
- OccurrenceSpecificationHelper.resetExecutionFinish((ExecutionSpecification)getSource(), message.getSendEvent());
+ if (message != null) {
+ // Reset the finish of target ExecutionSpecification to message end. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=402975F
+ if (getSource() instanceof ExecutionSpecification) {
+ OccurrenceSpecificationHelper.resetExecutionFinish((ExecutionSpecification) getSource(), message.getSendEvent());
}
doConfigure(message, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(message);
+ ((CreateElementRequest) getRequest()).setNewElement(message);
return CommandResult.newOKCommandResult(message);
}
return CommandResult.newErrorCommandResult("There is now valid container for events"); //$NON-NLS-1$
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage3ReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage3ReorientCommand.java
index 2ff033830db..d8259885e63 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage3ReorientCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage3ReorientCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -33,7 +33,7 @@ public class CustomMessage3ReorientCommand extends Message3ReorientCommand {
/**
* Constructor.
- *
+ *
* @param request
*/
public CustomMessage3ReorientCommand(ReorientRelationshipRequest request) {
@@ -45,14 +45,14 @@ public class CustomMessage3ReorientCommand extends Message3ReorientCommand {
*/
@Override
protected boolean canReorientSource() {
- if(!(getOldSource() instanceof Element && getNewSource() instanceof Element)) {
+ if (!(getOldSource() instanceof Element && getNewSource() instanceof Element)) {
return false;
}
- if(!(getLink().eContainer() instanceof Interaction)) {
+ if (!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- Interaction container = (Interaction)getLink().eContainer();
- if(!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4005(container, getLink(), getNewSource(), getOldTarget())) {
+ Interaction container = (Interaction) getLink().eContainer();
+ if (!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4005(container, getLink(), getNewSource(), getOldTarget())) {
return false;
}
return MessageConnectionHelper.canReorientSource(getLink(), getNewSource());
@@ -63,15 +63,15 @@ public class CustomMessage3ReorientCommand extends Message3ReorientCommand {
*/
@Override
protected boolean canReorientTarget() {
- if(!(getOldTarget() instanceof Element && getNewTarget() instanceof Element)) {
+ if (!(getOldTarget() instanceof Element && getNewTarget() instanceof Element)) {
return false;
}
Element source = getLink().getOwner();
- if(!(getLink().eContainer() instanceof Interaction)) {
+ if (!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- Interaction container = (Interaction)getLink().eContainer();
- if(!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4005(container, getLink(), source, getNewTarget())) {
+ Interaction container = (Interaction) getLink().eContainer();
+ if (!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4005(container, getLink(), source, getNewTarget())) {
return false;
}
return MessageConnectionHelper.canReorientTarget(getLink(), getNewTarget());
@@ -83,12 +83,12 @@ public class CustomMessage3ReorientCommand extends Message3ReorientCommand {
@Override
protected CommandResult reorientSource() throws ExecutionException {
ReconnectMessageHelper.updateMessageEnd(getLink().getSendEvent(), getOldSource(), getNewSource());
- //Update Execution Ends after reconncted, https://bugs.eclipse.org/bugs/show_bug.cgi?id=402975
- if(getOldSource() instanceof ExecutionSpecification) {
- OccurrenceSpecificationHelper.resetExecutionFinish((ExecutionSpecification)getNewSource(), UMLFactory.eINSTANCE.createExecutionOccurrenceSpecification());
+ // Update Execution Ends after reconncted, https://bugs.eclipse.org/bugs/show_bug.cgi?id=402975
+ if (getOldSource() instanceof ExecutionSpecification) {
+ OccurrenceSpecificationHelper.resetExecutionFinish((ExecutionSpecification) getNewSource(), UMLFactory.eINSTANCE.createExecutionOccurrenceSpecification());
}
- if(getNewSource() instanceof ExecutionSpecification) {
- OccurrenceSpecificationHelper.resetExecutionFinish((ExecutionSpecification)getNewSource(), getLink().getSendEvent());
+ if (getNewSource() instanceof ExecutionSpecification) {
+ OccurrenceSpecificationHelper.resetExecutionFinish((ExecutionSpecification) getNewSource(), getLink().getSendEvent());
}
return CommandResult.newOKCommandResult(getLink());
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage4CreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage4CreateCommand.java
index b2c57bd1ad4..133f497f541 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage4CreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage4CreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -37,7 +37,7 @@ public class CustomMessage4CreateCommand extends Message4CreateCommand {
/**
* Constructor.
- *
+ *
* @param request
* @param source
* @param target
@@ -48,33 +48,33 @@ public class CustomMessage4CreateCommand extends Message4CreateCommand {
/**
* Add a condition on the MOS container
- *
+ *
* @Override
*/
@Override
public boolean canExecute() {
- if(source == null && target == null) {
+ if (source == null && target == null) {
return false;
}
- if(source != null && false == source instanceof Element) {
+ if (source != null && false == source instanceof Element) {
return false;
}
- if(target != null && false == target instanceof Element) {
+ if (target != null && false == target instanceof Element) {
return false;
}
- if(getSource() == null) {
+ if (getSource() == null) {
return true; // link creation is in progress; source is not defined yet
}
// target may be null here but it's possible to check constraint
- if(getContainer() == null) {
+ if (getContainer() == null) {
return false;
}
- if(getSource() != null && getTarget() != null) {
- if(!CommandHelper.hasValidContainer(getRequest())) {
+ if (getSource() != null && getTarget() != null) {
+ if (!CommandHelper.hasValidContainer(getRequest())) {
return false;
}
}
- if(!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateMessage_4006(getContainer(), getSource(), getTarget())) {
+ if (!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateMessage_4006(getContainer(), getSource(), getTarget())) {
return false;
}
return MessageConnectionHelper.canExist(MessageSort.CREATE_MESSAGE_LITERAL, getSource(), getTarget());
@@ -82,20 +82,20 @@ public class CustomMessage4CreateCommand extends Message4CreateCommand {
/**
* Create a MessageOccurenceSpecification and the call event when a message is created
- *
+ *
* @Override
*/
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
}
- InteractionFragment sourceContainer = (InteractionFragment)getRequest().getParameters().get(SequenceRequestConstant.SOURCE_MODEL_CONTAINER);
- InteractionFragment targetContainer = (InteractionFragment)getRequest().getParameters().get(SequenceRequestConstant.TARGET_MODEL_CONTAINER);
+ InteractionFragment sourceContainer = (InteractionFragment) getRequest().getParameters().get(SequenceRequestConstant.SOURCE_MODEL_CONTAINER);
+ InteractionFragment targetContainer = (InteractionFragment) getRequest().getParameters().get(SequenceRequestConstant.TARGET_MODEL_CONTAINER);
Message message = CommandHelper.doCreateMessage(container, MessageSort.CREATE_MESSAGE_LITERAL, getSource(), getTarget(), sourceContainer, targetContainer);
- if(message != null) {
+ if (message != null) {
doConfigure(message, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(message);
+ ((CreateElementRequest) getRequest()).setNewElement(message);
return CommandResult.newOKCommandResult(message);
}
return CommandResult.newErrorCommandResult("There is now valid container for events"); //$NON-NLS-1$
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage4ReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage4ReorientCommand.java
index 29659e978d2..6a14e17f3fc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage4ReorientCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage4ReorientCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -30,7 +30,7 @@ public class CustomMessage4ReorientCommand extends Message4ReorientCommand {
/**
* Constructor.
- *
+ *
* @param request
*/
public CustomMessage4ReorientCommand(ReorientRelationshipRequest request) {
@@ -42,14 +42,14 @@ public class CustomMessage4ReorientCommand extends Message4ReorientCommand {
*/
@Override
protected boolean canReorientSource() {
- if(!(getOldSource() instanceof Element && getNewSource() instanceof Element)) {
+ if (!(getOldSource() instanceof Element && getNewSource() instanceof Element)) {
return false;
}
- if(!(getLink().eContainer() instanceof Interaction)) {
+ if (!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- Interaction container = (Interaction)getLink().eContainer();
- if(!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4006(container, getLink(), getNewSource(), getOldTarget())) {
+ Interaction container = (Interaction) getLink().eContainer();
+ if (!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4006(container, getLink(), getNewSource(), getOldTarget())) {
return false;
}
return MessageConnectionHelper.canReorientSource(getLink(), getNewSource());
@@ -60,15 +60,15 @@ public class CustomMessage4ReorientCommand extends Message4ReorientCommand {
*/
@Override
protected boolean canReorientTarget() {
- if(!(getOldTarget() instanceof Element && getNewTarget() instanceof Element)) {
+ if (!(getOldTarget() instanceof Element && getNewTarget() instanceof Element)) {
return false;
}
Element source = getLink().getOwner();
- if(!(getLink().eContainer() instanceof Interaction)) {
+ if (!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- Interaction container = (Interaction)getLink().eContainer();
- if(!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4006(container, getLink(), source, getNewTarget())) {
+ Interaction container = (Interaction) getLink().eContainer();
+ if (!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4006(container, getLink(), source, getNewTarget())) {
return false;
}
return MessageConnectionHelper.canReorientTarget(getLink(), getNewTarget());
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage5CreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage5CreateCommand.java
index a364b1fb8e2..b7fe141721f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage5CreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage5CreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -48,7 +48,7 @@ public class CustomMessage5CreateCommand extends Message5CreateCommand {
/**
* Constructor.
- *
+ *
* @param request
* @param source
* @param target
@@ -59,33 +59,33 @@ public class CustomMessage5CreateCommand extends Message5CreateCommand {
/**
* Add a condition on the MOS container
- *
+ *
* @Override
*/
@Override
public boolean canExecute() {
- if(source == null && target == null) {
+ if (source == null && target == null) {
return false;
}
- if(source != null && false == source instanceof Element) {
+ if (source != null && false == source instanceof Element) {
return false;
}
- if(target != null && false == target instanceof Element) {
+ if (target != null && false == target instanceof Element) {
return false;
}
- if(getSource() == null) {
+ if (getSource() == null) {
return true; // link creation is in progress; source is not defined yet
}
// target may be null here but it's possible to check constraint
- if(getContainer() == null) {
+ if (getContainer() == null) {
return false;
}
- if(getSource() != null && getTarget() != null) {
- if(!CommandHelper.hasValidContainer(getRequest())) {
+ if (getSource() != null && getTarget() != null) {
+ if (!CommandHelper.hasValidContainer(getRequest())) {
return false;
}
}
- if(!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateMessage_4007(getContainer(), getSource(), getTarget())) {
+ if (!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateMessage_4007(getContainer(), getSource(), getTarget())) {
return false;
}
return MessageConnectionHelper.canExist(MessageSort.DELETE_MESSAGE_LITERAL, getSource(), getTarget());
@@ -93,34 +93,34 @@ public class CustomMessage5CreateCommand extends Message5CreateCommand {
/**
* Create a MessageOccurenceSpecification and the call event when a message is created
- *
+ *
* @Override
*/
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
}
- InteractionFragment sourceContainer = (InteractionFragment)getRequest().getParameters().get(SequenceRequestConstant.SOURCE_MODEL_CONTAINER);
- InteractionFragment targetContainer = (InteractionFragment)getRequest().getParameters().get(SequenceRequestConstant.TARGET_MODEL_CONTAINER);
+ InteractionFragment sourceContainer = (InteractionFragment) getRequest().getParameters().get(SequenceRequestConstant.SOURCE_MODEL_CONTAINER);
+ InteractionFragment targetContainer = (InteractionFragment) getRequest().getParameters().get(SequenceRequestConstant.TARGET_MODEL_CONTAINER);
Lifeline lifeline = null;
// the Receive Message End
MessageOccurrenceSpecification receiveMessageEnd = null;
- if(getTarget() instanceof DestructionOccurrenceSpecification) {
+ if (getTarget() instanceof DestructionOccurrenceSpecification) {
receiveMessageEnd = getReceiveMessageEnd();
- if(receiveMessageEnd != null) {
+ if (receiveMessageEnd != null) {
lifeline = receiveMessageEnd.getCovereds().get(0);
} else {
- lifeline = ((DestructionOccurrenceSpecification)getTarget()).getCovereds().get(0);
+ lifeline = ((DestructionOccurrenceSpecification) getTarget()).getCovereds().get(0);
}
} else {
- lifeline = (Lifeline)getTarget();
+ lifeline = (Lifeline) getTarget();
}
// Create the message
Message message = CommandHelper.doCreateMessage(container, MessageSort.DELETE_MESSAGE_LITERAL, getSource(), lifeline, sourceContainer, targetContainer, null, receiveMessageEnd);
- if(message != null) {
+ if (message != null) {
doConfigure(message, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(message);
+ ((CreateElementRequest) getRequest()).setNewElement(message);
return CommandResult.newOKCommandResult(message);
}
return CommandResult.newErrorCommandResult("There is now valid container for events"); //$NON-NLS-1$
@@ -130,7 +130,7 @@ public class CustomMessage5CreateCommand extends Message5CreateCommand {
* Get a messageOccurrenceSpecification associated with the existing DestructionEvent :
* -> Retrieve the associated occurrenceSpecification
* -> Transform it into a mos
- *
+ *
* @return the mos
* @throws ExecutionException
*/
@@ -139,21 +139,21 @@ public class CustomMessage5CreateCommand extends Message5CreateCommand {
OccurrenceSpecification os = null;
// Get the occurrence specification associated with the destructionEvent
Collection<Setting> settings = UML2Util.getInverseReferences(getTarget());
- for(Setting setting : settings) {
- if(setting.getEObject() instanceof OccurrenceSpecification) {
- os = (OccurrenceSpecification)setting.getEObject();
+ for (Setting setting : settings) {
+ if (setting.getEObject() instanceof OccurrenceSpecification) {
+ os = (OccurrenceSpecification) setting.getEObject();
}
}
- if(os != null) {
+ if (os != null) {
// Transform the occurrenceSpecification into a mos (conserving its properties).
EObjectInheritanceCopyCommand cmd = new EObjectInheritanceCopyCommand(os, UMLPackage.eINSTANCE.getMessageOccurrenceSpecification(), getEditingDomain());
- if(cmd.canExecute()) {
+ if (cmd.canExecute()) {
IStatus status = cmd.execute(null, null);
- if(status.isOK()) {
+ if (status.isOK()) {
// Destroy the old os
os.destroy();
// Get the result MessageOccurrenceSpecification
- mosResult = (MessageOccurrenceSpecification)cmd.getResultEobject();
+ mosResult = (MessageOccurrenceSpecification) cmd.getResultEobject();
}
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage5ReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage5ReorientCommand.java
index 39c6084f365..4e7d36125b9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage5ReorientCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage5ReorientCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -30,7 +30,7 @@ public class CustomMessage5ReorientCommand extends Message5ReorientCommand {
/**
* Constructor.
- *
+ *
* @param request
*/
public CustomMessage5ReorientCommand(ReorientRelationshipRequest request) {
@@ -42,14 +42,14 @@ public class CustomMessage5ReorientCommand extends Message5ReorientCommand {
*/
@Override
protected boolean canReorientSource() {
- if(!(getOldSource() instanceof Element && getNewSource() instanceof Element)) {
+ if (!(getOldSource() instanceof Element && getNewSource() instanceof Element)) {
return false;
}
- if(!(getLink().eContainer() instanceof Interaction)) {
+ if (!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- Interaction container = (Interaction)getLink().eContainer();
- if(!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4007(container, getLink(), getNewSource(), getOldTarget())) {
+ Interaction container = (Interaction) getLink().eContainer();
+ if (!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4007(container, getLink(), getNewSource(), getOldTarget())) {
return false;
}
return MessageConnectionHelper.canReorientSource(getLink(), getNewSource());
@@ -60,15 +60,15 @@ public class CustomMessage5ReorientCommand extends Message5ReorientCommand {
*/
@Override
protected boolean canReorientTarget() {
- if(!(getOldTarget() instanceof Element && getNewTarget() instanceof Element)) {
+ if (!(getOldTarget() instanceof Element && getNewTarget() instanceof Element)) {
return false;
}
Element source = getLink().getOwner();
- if(!(getLink().eContainer() instanceof Interaction)) {
+ if (!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- Interaction container = (Interaction)getLink().eContainer();
- if(!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4007(container, getLink(), source, getNewTarget())) {
+ Interaction container = (Interaction) getLink().eContainer();
+ if (!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4007(container, getLink(), source, getNewTarget())) {
return false;
}
return MessageConnectionHelper.canReorientTarget(getLink(), getNewTarget());
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage6CreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage6CreateCommand.java
index 2a774513967..7b9a6cd47c7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage6CreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage6CreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -35,7 +35,7 @@ public class CustomMessage6CreateCommand extends Message6CreateCommand {
/**
* Constructor.
- *
+ *
* @param request
* @param source
* @param target
@@ -46,16 +46,16 @@ public class CustomMessage6CreateCommand extends Message6CreateCommand {
/**
* Add a condition on the MOS container
- *
+ *
* @Override
*/
@Override
public boolean canExecute() {
- if(!super.canExecute()) {
+ if (!super.canExecute()) {
return false;
}
- if(getSource() != null && getTarget() != null) {
- if(!CommandHelper.hasValidContainer(getRequest())) {
+ if (getSource() != null && getTarget() != null) {
+ if (!CommandHelper.hasValidContainer(getRequest())) {
return false;
}
}
@@ -64,20 +64,20 @@ public class CustomMessage6CreateCommand extends Message6CreateCommand {
/**
* Create a MessageOccurenceSpecification and the call event when a message is created
- *
+ *
* @Override
*/
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
}
- InteractionFragment sourceContainer = (InteractionFragment)getRequest().getParameters().get(SequenceRequestConstant.SOURCE_MODEL_CONTAINER);
- InteractionFragment targetContainer = (InteractionFragment)getRequest().getParameters().get(SequenceRequestConstant.TARGET_MODEL_CONTAINER);
+ InteractionFragment sourceContainer = (InteractionFragment) getRequest().getParameters().get(SequenceRequestConstant.SOURCE_MODEL_CONTAINER);
+ InteractionFragment targetContainer = (InteractionFragment) getRequest().getParameters().get(SequenceRequestConstant.TARGET_MODEL_CONTAINER);
Message message = CommandHelper.doCreateMessage(container, MessageSort.ASYNCH_SIGNAL_LITERAL, getSource(), null, sourceContainer, targetContainer);
- if(message != null) {
+ if (message != null) {
doConfigure(message, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(message);
+ ((CreateElementRequest) getRequest()).setNewElement(message);
return CommandResult.newOKCommandResult(message);
}
return CommandResult.newErrorCommandResult("There is now valid container for events"); //$NON-NLS-1$
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage6ReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage6ReorientCommand.java
index 96fe36d8ff0..1ac7a74cce6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage6ReorientCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage6ReorientCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -27,7 +27,7 @@ public class CustomMessage6ReorientCommand extends Message6ReorientCommand {
/**
* Constructor.
- *
+ *
* @param request
*/
public CustomMessage6ReorientCommand(ReorientRelationshipRequest request) {
@@ -39,18 +39,18 @@ public class CustomMessage6ReorientCommand extends Message6ReorientCommand {
*/
@Override
protected boolean canReorientSource() {
- if(!(getOldSource() instanceof Element && getNewSource() instanceof Element)) {
+ if (!(getOldSource() instanceof Element && getNewSource() instanceof Element)) {
return false;
}
- if(getLink().getOwnedElements().size() != 1) {
+ if (getLink().getOwnedElements().size() != 1) {
return false;
}
Element target = getLink().getOwnedElements().get(0);
- if(!(getLink().eContainer() instanceof Interaction)) {
+ if (!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- Interaction container = (Interaction)getLink().eContainer();
- if(!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4008(container, getLink(), getNewSource(), target)) {
+ Interaction container = (Interaction) getLink().eContainer();
+ if (!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4008(container, getLink(), getNewSource(), target)) {
return false;
}
return MessageConnectionHelper.canReorientSource(getLink(), getNewSource());
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage7CreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage7CreateCommand.java
index f09c90c0d25..deea9551273 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage7CreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage7CreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -35,7 +35,7 @@ public class CustomMessage7CreateCommand extends Message7CreateCommand {
/**
* Constructor.
- *
+ *
* @param request
* @param source
* @param target
@@ -46,16 +46,16 @@ public class CustomMessage7CreateCommand extends Message7CreateCommand {
/**
* Add a condition on the MOS container
- *
+ *
* @Override
*/
@Override
public boolean canExecute() {
- if(!super.canExecute()) {
+ if (!super.canExecute()) {
return false;
}
- if(getSource() != null && getTarget() != null) {
- if(!CommandHelper.hasValidContainer(getRequest())) {
+ if (getSource() != null && getTarget() != null) {
+ if (!CommandHelper.hasValidContainer(getRequest())) {
return false;
}
}
@@ -64,20 +64,20 @@ public class CustomMessage7CreateCommand extends Message7CreateCommand {
/**
* Create a MessageOccurenceSpecification and the call event when a message is created
- *
+ *
* @Override
*/
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
}
- InteractionFragment sourceContainer = (InteractionFragment)getRequest().getParameters().get(SequenceRequestConstant.SOURCE_MODEL_CONTAINER);
- InteractionFragment targetContainer = (InteractionFragment)getRequest().getParameters().get(SequenceRequestConstant.TARGET_MODEL_CONTAINER);
+ InteractionFragment sourceContainer = (InteractionFragment) getRequest().getParameters().get(SequenceRequestConstant.SOURCE_MODEL_CONTAINER);
+ InteractionFragment targetContainer = (InteractionFragment) getRequest().getParameters().get(SequenceRequestConstant.TARGET_MODEL_CONTAINER);
Message message = CommandHelper.doCreateMessage(container, MessageSort.ASYNCH_SIGNAL_LITERAL, null, getTarget(), sourceContainer, targetContainer);
- if(message != null) {
+ if (message != null) {
doConfigure(message, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(message);
+ ((CreateElementRequest) getRequest()).setNewElement(message);
return CommandResult.newOKCommandResult(message);
}
return CommandResult.newErrorCommandResult("There is now valid container for events"); //$NON-NLS-1$
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage7ReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage7ReorientCommand.java
index d0a64f00688..b17e722c26d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage7ReorientCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessage7ReorientCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -26,7 +26,7 @@ public class CustomMessage7ReorientCommand extends Message7ReorientCommand {
/**
* Constructor.
- *
+ *
* @param request
*/
public CustomMessage7ReorientCommand(ReorientRelationshipRequest request) {
@@ -38,18 +38,18 @@ public class CustomMessage7ReorientCommand extends Message7ReorientCommand {
*/
@Override
protected boolean canReorientSource() {
- // if(!(getOldSource() instanceof Element && getNewSource() instanceof Element)) {
- // return false;
- // }
- // if(getLink().getOwnedElements().size() != 1) {
- // return false;
- // }
- // Element target = getLink().getOwnedElements().get(0);
- // if(!(getLink().eContainer() instanceof Interaction)) {
- // return false;
- // }
- // Interaction container = (Interaction)getLink().eContainer();
- // return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4009(container, getLink(), getNewSource(), target);
+ // if(!(getOldSource() instanceof Element && getNewSource() instanceof Element)) {
+ // return false;
+ // }
+ // if(getLink().getOwnedElements().size() != 1) {
+ // return false;
+ // }
+ // Element target = getLink().getOwnedElements().get(0);
+ // if(!(getLink().eContainer() instanceof Interaction)) {
+ // return false;
+ // }
+ // Interaction container = (Interaction)getLink().eContainer();
+ // return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4009(container, getLink(), getNewSource(), target);
return false;
}
@@ -58,20 +58,20 @@ public class CustomMessage7ReorientCommand extends Message7ReorientCommand {
*/
@Override
protected boolean canReorientTarget() {
- if(!(getOldTarget() instanceof Element && getNewTarget() instanceof Element)) {
+ if (!(getOldTarget() instanceof Element && getNewTarget() instanceof Element)) {
return false;
}
Element source = getLink().getOwner();
- if(!(getLink().eContainer() instanceof Interaction)) {
+ if (!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- Interaction container = (Interaction)getLink().eContainer();
- //Fixed bug about message reconnection.
- if(!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4009(container, getLink(), source, getNewTarget())) {
+ Interaction container = (Interaction) getLink().eContainer();
+ // Fixed bug about message reconnection.
+ if (!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4009(container, getLink(), source, getNewTarget())) {
return false;
}
- //FIXME: Please complete reorientTarget() firstly.
+ // FIXME: Please complete reorientTarget() firstly.
return false;
- // return MessageConnectionHelper.canReorientTarget(getLink(), getNewTarget());
+ // return MessageConnectionHelper.canReorientTarget(getLink(), getNewTarget());
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessageCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessageCreateCommand.java
index 6a050f685e4..c6695cf7c09 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessageCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessageCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -40,7 +40,7 @@ public class CustomMessageCreateCommand extends MessageCreateCommand {
/**
* Constructor.
- *
+ *
* @param request
* @param source
* @param target
@@ -51,68 +51,68 @@ public class CustomMessageCreateCommand extends MessageCreateCommand {
/**
* Add a condition on the MOS container
- *
+ *
* @Override
*/
@Override
public boolean canExecute() {
- if(source == null && target == null) {
+ if (source == null && target == null) {
return false;
}
- if(source != null && false == source instanceof Element) {
+ if (source != null && false == source instanceof Element) {
return false;
}
- if(target != null && false == target instanceof Element) {
+ if (target != null && false == target instanceof Element) {
return false;
}
- if(getSource() == null) {
+ if (getSource() == null) {
return true; // link creation is in progress; source is not defined yet
}
// target may be null here but it's possible to check constraint
- if(getContainer() == null) {
+ if (getContainer() == null) {
return false;
}
- if(getSource() != null && getTarget() != null) {
- if(!CommandHelper.hasValidContainer(getRequest())) {
+ if (getSource() != null && getTarget() != null) {
+ if (!CommandHelper.hasValidContainer(getRequest())) {
return false;
}
}
- if(!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateMessage_4003(getContainer(), getSource(), getTarget())) {
+ if (!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateMessage_4003(getContainer(), getSource(), getTarget())) {
return false;
}
- return MessageConnectionHelper.canExist(MessageSort.SYNCH_CALL_LITERAL, (Element)source, (Element)target);
+ return MessageConnectionHelper.canExist(MessageSort.SYNCH_CALL_LITERAL, (Element) source, (Element) target);
}
/**
* Create a MessageOccurenceSpecification and the call event when a message is created
- *
+ *
* @Override
*/
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
}
- InteractionFragment sourceContainer = (InteractionFragment)getRequest().getParameters().get(SequenceRequestConstant.SOURCE_MODEL_CONTAINER);
- InteractionFragment targetContainer = (InteractionFragment)getRequest().getParameters().get(SequenceRequestConstant.TARGET_MODEL_CONTAINER);
+ InteractionFragment sourceContainer = (InteractionFragment) getRequest().getParameters().get(SequenceRequestConstant.SOURCE_MODEL_CONTAINER);
+ InteractionFragment targetContainer = (InteractionFragment) getRequest().getParameters().get(SequenceRequestConstant.TARGET_MODEL_CONTAINER);
Element source = getSource();
- if(source instanceof ExecutionOccurrenceSpecification) {
- source = ((ExecutionOccurrenceSpecification)source).getExecution();
+ if (source instanceof ExecutionOccurrenceSpecification) {
+ source = ((ExecutionOccurrenceSpecification) source).getExecution();
}
Message message = CommandHelper.doCreateMessage(container, MessageSort.SYNCH_CALL_LITERAL, source, getTarget(), sourceContainer, targetContainer);
- if(message != null) {
- //Do reset message end to target ExecutionSpecification. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=402975
- if(getTarget() instanceof ExecutionSpecification) {
- OccurrenceSpecificationHelper.resetExecutionStart((ExecutionSpecification)getTarget(), message.getReceiveEvent());
+ if (message != null) {
+ // Do reset message end to target ExecutionSpecification. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=402975
+ if (getTarget() instanceof ExecutionSpecification) {
+ OccurrenceSpecificationHelper.resetExecutionStart((ExecutionSpecification) getTarget(), message.getReceiveEvent());
}
- if(getSource() instanceof ExecutionOccurrenceSpecification) {
- ExecutionSpecification execution = ((ExecutionOccurrenceSpecification)getSource()).getExecution();
- if(execution != null) {
+ if (getSource() instanceof ExecutionOccurrenceSpecification) {
+ ExecutionSpecification execution = ((ExecutionOccurrenceSpecification) getSource()).getExecution();
+ if (execution != null) {
OccurrenceSpecificationHelper.resetExecutionStart(execution, message.getSendEvent());
}
}
doConfigure(message, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(message);
+ ((CreateElementRequest) getRequest()).setNewElement(message);
return CommandResult.newOKCommandResult(message);
}
return CommandResult.newErrorCommandResult("There is now valid container for events"); //$NON-NLS-1$
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessageReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessageReorientCommand.java
index ded3e5f6f6d..97c1dd4303b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessageReorientCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomMessageReorientCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -35,7 +35,7 @@ public class CustomMessageReorientCommand extends MessageReorientCommand {
/**
* Constructor.
- *
+ *
* @param request
*/
public CustomMessageReorientCommand(ReorientRelationshipRequest request) {
@@ -47,19 +47,19 @@ public class CustomMessageReorientCommand extends MessageReorientCommand {
*/
@Override
protected boolean canReorientSource() {
- if(!(getOldSource() instanceof Element && getNewSource() instanceof Element)) {
+ if (!(getOldSource() instanceof Element && getNewSource() instanceof Element)) {
return false;
}
- if(!(getLink().eContainer() instanceof Interaction)) {
+ if (!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- Interaction container = (Interaction)getLink().eContainer();
+ Interaction container = (Interaction) getLink().eContainer();
boolean canExistMessage = UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4003(container, getLink(), getNewSource(), getOldTarget());
- if(!canExistMessage) {
+ if (!canExistMessage) {
return false;
}
- //Fixed bug about reconnect messages.
- if(!(getNewSource() instanceof ExecutionSpecification)) {
+ // Fixed bug about reconnect messages.
+ if (!(getNewSource() instanceof ExecutionSpecification)) {
return false;
}
return MessageConnectionHelper.canReorientSource(getLink(), getNewSource());
@@ -70,19 +70,19 @@ public class CustomMessageReorientCommand extends MessageReorientCommand {
*/
@Override
protected boolean canReorientTarget() {
- if(!(getOldTarget() instanceof Element && getNewTarget() instanceof Element)) {
+ if (!(getOldTarget() instanceof Element && getNewTarget() instanceof Element)) {
return false;
}
Element source = getLink().getOwner();
- if(!(getLink().eContainer() instanceof Interaction)) {
+ if (!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- Interaction container = (Interaction)getLink().eContainer();
- if(!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4003(container, getLink(), source, getNewTarget())) {
+ Interaction container = (Interaction) getLink().eContainer();
+ if (!UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4003(container, getLink(), source, getNewTarget())) {
return false;
}
- //Fixed bug about reconnect messages.
- if(!(getNewTarget() instanceof ExecutionSpecification)) {
+ // Fixed bug about reconnect messages.
+ if (!(getNewTarget() instanceof ExecutionSpecification)) {
return false;
}
return MessageConnectionHelper.canReorientTarget(getLink(), getNewTarget());
@@ -95,9 +95,9 @@ public class CustomMessageReorientCommand extends MessageReorientCommand {
protected CommandResult reorientSource() throws ExecutionException {
MessageEnd sendEvent = getLink().getSendEvent();
ReconnectMessageHelper.updateMessageEnd(sendEvent, getOldSource(), getNewSource());
- //Update Execution Ends after message reconnecte, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=402975
- if(getOldSource() instanceof ExecutionSpecification && sendEvent == (((ExecutionSpecification)getOldSource()).getStart())) {
- OccurrenceSpecificationHelper.resetExecutionStart((ExecutionSpecification)getOldSource(), UMLFactory.eINSTANCE.createExecutionOccurrenceSpecification());
+ // Update Execution Ends after message reconnecte, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=402975
+ if (getOldSource() instanceof ExecutionSpecification && sendEvent == (((ExecutionSpecification) getOldSource()).getStart())) {
+ OccurrenceSpecificationHelper.resetExecutionStart((ExecutionSpecification) getOldSource(), UMLFactory.eINSTANCE.createExecutionOccurrenceSpecification());
}
return CommandResult.newOKCommandResult(getLink());
}
@@ -110,12 +110,12 @@ public class CustomMessageReorientCommand extends MessageReorientCommand {
MessageEnd receiveEvent = getLink().getReceiveEvent();
ReconnectMessageHelper.updateMessageEnd(receiveEvent, getOldTarget(), getNewTarget());
ReconnectMessageHelper.updateMessage(getLink());
- //Update Execution Ends after message reconnecte, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=402975
- if(getOldTarget() instanceof ExecutionSpecification && receiveEvent == (((ExecutionSpecification)getOldTarget()).getStart())) {
- OccurrenceSpecificationHelper.resetExecutionStart((ExecutionSpecification)getOldTarget(), UMLFactory.eINSTANCE.createExecutionOccurrenceSpecification());
+ // Update Execution Ends after message reconnecte, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=402975
+ if (getOldTarget() instanceof ExecutionSpecification && receiveEvent == (((ExecutionSpecification) getOldTarget()).getStart())) {
+ OccurrenceSpecificationHelper.resetExecutionStart((ExecutionSpecification) getOldTarget(), UMLFactory.eINSTANCE.createExecutionOccurrenceSpecification());
}
- if(getNewTarget() instanceof ExecutionSpecification && receiveEvent instanceof MessageOccurrenceSpecification) {
- OccurrenceSpecificationHelper.resetExecutionStart((ExecutionSpecification)getNewTarget(), receiveEvent);
+ if (getNewTarget() instanceof ExecutionSpecification && receiveEvent instanceof MessageOccurrenceSpecification) {
+ OccurrenceSpecificationHelper.resetExecutionStart((ExecutionSpecification) getNewTarget(), receiveEvent);
}
return CommandResult.newOKCommandResult(getLink());
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomStateInvariantCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomStateInvariantCreateCommand.java
index a8a1a438871..28fd228bd04 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomStateInvariantCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomStateInvariantCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -33,7 +33,7 @@ public class CustomStateInvariantCreateCommand extends StateInvariantCreateComma
/**
* Constructor.
- *
+ *
* @param req
* @param eObject
*/
@@ -43,7 +43,7 @@ public class CustomStateInvariantCreateCommand extends StateInvariantCreateComma
/**
* Constructor.
- *
+ *
* @param req
*/
public CustomStateInvariantCreateCommand(CreateElementRequest req, Diagram diagram) {
@@ -52,17 +52,17 @@ public class CustomStateInvariantCreateCommand extends StateInvariantCreateComma
/**
* The StateInvariant is created on the lifeline and not on its container
- *
+ *
* @Override
*/
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
// Get the model container
- Object modelContainer = ((CreateElementRequest)getRequest()).getParameters().get(SequenceRequestConstant.INTERACTIONFRAGMENT_CONTAINER);
+ Object modelContainer = ((CreateElementRequest) getRequest()).getParameters().get(SequenceRequestConstant.INTERACTIONFRAGMENT_CONTAINER);
// Create the stateInvariant
- StateInvariant stateInvariant = CommandHelper.doCreateStateInvariant((Lifeline)getElementToEdit(), modelContainer);
+ StateInvariant stateInvariant = CommandHelper.doCreateStateInvariant((Lifeline) getElementToEdit(), modelContainer);
doConfigure(stateInvariant, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(stateInvariant);
+ ((CreateElementRequest) getRequest()).setNewElement(stateInvariant);
return CommandResult.newOKCommandResult(stateInvariant);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomTimeConstraintCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomTimeConstraintCreateCommand.java
index 491384be237..754870ec156 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomTimeConstraintCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomTimeConstraintCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -41,7 +41,7 @@ public class CustomTimeConstraintCreateCommand extends TimeConstraintCreateComma
/**
* Constructor.
- *
+ *
* @param req
* @param eObject
*/
@@ -51,7 +51,7 @@ public class CustomTimeConstraintCreateCommand extends TimeConstraintCreateComma
/**
* Constructor.
- *
+ *
* @param req
*/
public CustomTimeConstraintCreateCommand(CreateElementRequest req, Diagram diagram) {
@@ -65,11 +65,11 @@ public class CustomTimeConstraintCreateCommand extends TimeConstraintCreateComma
public boolean canExecute() {
Object paramOccurrence = getRequest().getParameter(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION);
List<OccurrenceSpecification> occList = SequenceUtil.getAsOccSpecList(paramOccurrence);
- if(!occList.isEmpty()) {
- for(OccurrenceSpecification occurrence : occList) {
- if(occurrence instanceof MessageOccurrenceSpecification) {
- Message mess = ((MessageOccurrenceSpecification)occurrence).getMessage();
- if(mess != null && occurrence.equals(mess.getReceiveEvent()) && MessageSort.SYNCH_CALL_LITERAL.equals(mess.getMessageSort())) {
+ if (!occList.isEmpty()) {
+ for (OccurrenceSpecification occurrence : occList) {
+ if (occurrence instanceof MessageOccurrenceSpecification) {
+ Message mess = ((MessageOccurrenceSpecification) occurrence).getMessage();
+ if (mess != null && occurrence.equals(mess.getReceiveEvent()) && MessageSort.SYNCH_CALL_LITERAL.equals(mess.getMessageSort())) {
// filter receive event, we prefer the corresponding start event at the same location
continue;
}
@@ -87,17 +87,17 @@ public class CustomTimeConstraintCreateCommand extends TimeConstraintCreateComma
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
TimeConstraint newElement = UMLFactory.eINSTANCE.createTimeConstraint();
// get the Lifeline parent as owner
- Namespace owner = (Namespace)getElementToEdit().eContainer();
+ Namespace owner = (Namespace) getElementToEdit().eContainer();
owner.getOwnedRules().add(newElement);
ElementInitializers.getInstance().init_TimeConstraint_3019(newElement);
// assign the occurrence specification
Object paramOccurrence = getRequest().getParameter(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION);
List<OccurrenceSpecification> occList = SequenceUtil.getAsOccSpecList(paramOccurrence);
- if(!occList.isEmpty()) {
- for(OccurrenceSpecification occurrence : occList) {
- if(occurrence instanceof MessageOccurrenceSpecification) {
- Message mess = ((MessageOccurrenceSpecification)occurrence).getMessage();
- if(mess != null && occurrence.equals(mess.getReceiveEvent()) && MessageSort.SYNCH_CALL_LITERAL.equals(mess.getMessageSort())) {
+ if (!occList.isEmpty()) {
+ for (OccurrenceSpecification occurrence : occList) {
+ if (occurrence instanceof MessageOccurrenceSpecification) {
+ Message mess = ((MessageOccurrenceSpecification) occurrence).getMessage();
+ if (mess != null && occurrence.equals(mess.getReceiveEvent()) && MessageSort.SYNCH_CALL_LITERAL.equals(mess.getMessageSort())) {
// filter receive event, we prefer the corresponding start event at the same location
continue;
}
@@ -108,7 +108,7 @@ public class CustomTimeConstraintCreateCommand extends TimeConstraintCreateComma
}
}
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomTimeObservationCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomTimeObservationCreateCommand.java
index 1c1308ffa00..7b589289ba2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomTimeObservationCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomTimeObservationCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -32,7 +32,7 @@ import org.eclipse.uml2.uml.UMLFactory;
/**
* Command for creating time observation element
- *
+ *
*/
public class CustomTimeObservationCreateCommand extends EditElementCommand {
@@ -56,11 +56,11 @@ public class CustomTimeObservationCreateCommand extends EditElementCommand {
@Override
protected EObject getElementToEdit() {
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
+ EObject container = ((CreateElementRequest) getRequest()).getContainer();
+ if (container instanceof View) {
+ container = ((View) container).getElement();
}
- if(container != null) {
+ if (container != null) {
return container;
}
return eObject;
@@ -76,27 +76,27 @@ public class CustomTimeObservationCreateCommand extends EditElementCommand {
TimeObservation newElement = UMLFactory.eINSTANCE.createTimeObservation();
// get the parent package as owner
EObject container = getElementToEdit();
- while(container != null && !(container instanceof Package)) {
+ while (container != null && !(container instanceof Package)) {
container = container.eContainer();
}
- if(container == null) {
+ if (container == null) {
return CommandResult.newCancelledCommandResult();
}
- Package owner = (Package)container;
+ Package owner = (Package) container;
owner.getPackagedElements().add(newElement);
ElementInitializers.getInstance().init_TimeObservation_3020(newElement);
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
protected void doConfigure(TimeObservation newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
+ if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomZOrderCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomZOrderCommand.java
index c9cace8f179..c0fccddd6b8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomZOrderCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomZOrderCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -35,7 +35,7 @@ public class CustomZOrderCommand extends AbstractTransactionalCommand {
/**
* @param editingDomain
- * the editing domain through which model changes are made
+ * the editing domain through which model changes are made
* @param label
* @param view
*/
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/ExecutionOccurrenceSpecificationMessageCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/ExecutionOccurrenceSpecificationMessageCreateCommand.java
index e1cedfc3fd3..2ce21c3ad7b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/ExecutionOccurrenceSpecificationMessageCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/ExecutionOccurrenceSpecificationMessageCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -49,7 +49,7 @@ public class ExecutionOccurrenceSpecificationMessageCreateCommand extends EditEl
/**
* Constructor.
- *
+ *
* @param label
* @param elementToEdit
* @param request
@@ -60,91 +60,94 @@ public class ExecutionOccurrenceSpecificationMessageCreateCommand extends EditEl
target = request.getTarget();
}
+ @Override
protected CreateRelationshipRequest getRequest() {
- return (CreateRelationshipRequest)super.getRequest();
+ return (CreateRelationshipRequest) super.getRequest();
}
+ @Override
public boolean canExecute() {
- if(source != null && target != null) {
- if(source == target) {
+ if (source != null && target != null) {
+ if (source == target) {
return false;
}
}
return super.canExecute();
}
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
IElementType elementType = getRequest().getElementType();
MessageSort messageSort = null;
- if(UMLElementTypes.Message_4003 == elementType) {
+ if (UMLElementTypes.Message_4003 == elementType) {
messageSort = MessageSort.SYNCH_CALL_LITERAL;
- } else if(UMLElementTypes.Message_4004 == elementType) {
+ } else if (UMLElementTypes.Message_4004 == elementType) {
messageSort = MessageSort.ASYNCH_CALL_LITERAL;
- } else if(UMLElementTypes.Message_4005 == elementType) {
+ } else if (UMLElementTypes.Message_4005 == elementType) {
messageSort = MessageSort.REPLY_LITERAL;
} else {
return CommandResult.newCancelledCommandResult();
}
Lifeline sourceLifeline = deduceLifeline(source);
Lifeline targetLifeline = deduceLifeline(target);
- InteractionFragment sourceContainer = (InteractionFragment)getRequest().getParameters().get(SequenceRequestConstant.SOURCE_MODEL_CONTAINER);
- InteractionFragment targetContainer = (InteractionFragment)getRequest().getParameters().get(SequenceRequestConstant.TARGET_MODEL_CONTAINER);
+ InteractionFragment sourceContainer = (InteractionFragment) getRequest().getParameters().get(SequenceRequestConstant.SOURCE_MODEL_CONTAINER);
+ InteractionFragment targetContainer = (InteractionFragment) getRequest().getParameters().get(SequenceRequestConstant.TARGET_MODEL_CONTAINER);
Message message = CommandHelper.doCreateMessage(deduceContainer(source, target), messageSort, sourceLifeline, targetLifeline, sourceContainer, targetContainer);
- if(message != null) {
- //Reset the finish of target ExecutionSpecification to message end. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=402975F
- if(source instanceof ExecutionOccurrenceSpecification && ((ExecutionOccurrenceSpecification)source).getExecution() != null) {
- ExecutionSpecification execution = ((ExecutionOccurrenceSpecification)source).getExecution();
- if(source == execution.getStart()) {
+ if (message != null) {
+ // Reset the finish of target ExecutionSpecification to message end. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=402975F
+ if (source instanceof ExecutionOccurrenceSpecification && ((ExecutionOccurrenceSpecification) source).getExecution() != null) {
+ ExecutionSpecification execution = ((ExecutionOccurrenceSpecification) source).getExecution();
+ if (source == execution.getStart()) {
OccurrenceSpecificationHelper.resetExecutionStart(execution, message.getSendEvent());
- } else if(source == execution.getFinish()) {
+ } else if (source == execution.getFinish()) {
OccurrenceSpecificationHelper.resetExecutionFinish(execution, message.getSendEvent());
}
}
- if(target instanceof ExecutionOccurrenceSpecification && ((ExecutionOccurrenceSpecification)target).getExecution() != null) {
- ExecutionSpecification execution = ((ExecutionOccurrenceSpecification)target).getExecution();
- if(target == execution.getStart()) {
+ if (target instanceof ExecutionOccurrenceSpecification && ((ExecutionOccurrenceSpecification) target).getExecution() != null) {
+ ExecutionSpecification execution = ((ExecutionOccurrenceSpecification) target).getExecution();
+ if (target == execution.getStart()) {
OccurrenceSpecificationHelper.resetExecutionStart(execution, message.getReceiveEvent());
- } else if(target == execution.getFinish()) {
+ } else if (target == execution.getFinish()) {
OccurrenceSpecificationHelper.resetExecutionFinish(execution, message.getReceiveEvent());
}
}
doConfigure(message, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(message);
+ ((CreateElementRequest) getRequest()).setNewElement(message);
return CommandResult.newOKCommandResult(message);
}
return CommandResult.newErrorCommandResult("There is now valid container for events"); //$NON-NLS-1$
}
protected void doConfigure(Message newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
configureRequest.setParameter(CreateRelationshipRequest.SOURCE, deduceLifeline(source));
configureRequest.setParameter(CreateRelationshipRequest.TARGET, deduceLifeline(target));
ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
+ if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
private Lifeline deduceLifeline(EObject eObject) {
- if(eObject instanceof Lifeline) {
- return (Lifeline)eObject;
- } else if(eObject instanceof ExecutionSpecification) {
- ExecutionSpecification execution = (ExecutionSpecification)eObject;
- if(execution.getStart() != null) {
+ if (eObject instanceof Lifeline) {
+ return (Lifeline) eObject;
+ } else if (eObject instanceof ExecutionSpecification) {
+ ExecutionSpecification execution = (ExecutionSpecification) eObject;
+ if (execution.getStart() != null) {
return deduceLifeline(execution.getStart());
- } else if(execution.getFinish() != null) {
+ } else if (execution.getFinish() != null) {
return deduceLifeline(execution.getFinish());
}
- } else if(eObject instanceof OccurrenceSpecification) {
- OccurrenceSpecification occ = (OccurrenceSpecification)eObject;
+ } else if (eObject instanceof OccurrenceSpecification) {
+ OccurrenceSpecification occ = (OccurrenceSpecification) eObject;
return occ.getCovered();
}
- if(eObject instanceof InteractionFragment) {
- EList<Lifeline> covereds = ((InteractionFragment)eObject).getCovereds();
- if(!covereds.isEmpty()) {
+ if (eObject instanceof InteractionFragment) {
+ EList<Lifeline> covereds = ((InteractionFragment) eObject).getCovereds();
+ if (!covereds.isEmpty()) {
return covereds.get(0);
}
}
@@ -155,9 +158,9 @@ public class ExecutionOccurrenceSpecificationMessageCreateCommand extends EditEl
// Find container element for the new link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null; element = element.eContainer()) {
- if(element instanceof Interaction) {
- return (Interaction)element;
+ for (EObject element = source; element != null; element = element.eContainer()) {
+ if (element instanceof Interaction) {
+ return (Interaction) element;
}
}
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/ExecutionOccurrenceSpecificationMessageReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/ExecutionOccurrenceSpecificationMessageReorientCommand.java
index 7003296702e..d5615f25a8e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/ExecutionOccurrenceSpecificationMessageReorientCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/ExecutionOccurrenceSpecificationMessageReorientCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -20,6 +20,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
import org.eclipse.papyrus.uml.diagram.sequence.util.OccurrenceSpecificationHelper;
import org.eclipse.papyrus.uml.diagram.sequence.util.ReconnectMessageHelper;
import org.eclipse.uml2.uml.Element;
@@ -42,7 +43,7 @@ public class ExecutionOccurrenceSpecificationMessageReorientCommand extends Edit
/**
* Constructor.
- *
+ *
* @param label
* @param elementToEdit
* @param request
@@ -55,13 +56,13 @@ public class ExecutionOccurrenceSpecificationMessageReorientCommand extends Edit
/**
* @see org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand#canExecute()
- *
+ *
* @return
*/
@Override
public boolean canExecute() {
Message link = getLink();
- if(link == null) {
+ if (link == null) {
return false;
}
MessageSort messageSort = link.getMessageSort();
@@ -69,70 +70,71 @@ public class ExecutionOccurrenceSpecificationMessageReorientCommand extends Edit
}
protected Message getLink() {
- return (Message)getRequest().getRelationship();
+ return (Message) getRequest().getRelationship();
}
@Override
protected ReorientRelationshipRequest getRequest() {
- return (ReorientRelationshipRequest)super.getRequest();
+ return (ReorientRelationshipRequest) super.getRequest();
}
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
int direction = getRequest().getDirection();
- if(ReorientRelationshipRequest.REORIENT_SOURCE == direction) {
+ if (ReorientRequest.REORIENT_SOURCE == direction) {
return reorientSource();
- } else if(ReorientRelationshipRequest.REORIENT_TARGET == direction) {
+ } else if (ReorientRequest.REORIENT_TARGET == direction) {
return reorientTarget();
}
throw new IllegalStateException();
}
protected Element getOldSource() {
- return (Element)oldEnd;
+ return (Element) oldEnd;
}
protected Element getNewSource() {
- return (Element)newEnd;
+ return (Element) newEnd;
}
protected Element getOldTarget() {
- return (Element)oldEnd;
+ return (Element) oldEnd;
}
protected Element getNewTarget() {
- return (Element)newEnd;
+ return (Element) newEnd;
}
protected ExecutionSpecification getExecution(Element element, boolean isSource) {
- if(element instanceof ExecutionSpecification) {
- return (ExecutionSpecification)element;
- } else if(element instanceof OccurrenceSpecification) {
- return OccurrenceSpecificationHelper.findExecutionWith((OccurrenceSpecification)element, isSource);
+ if (element instanceof ExecutionSpecification) {
+ return (ExecutionSpecification) element;
+ } else if (element instanceof OccurrenceSpecification) {
+ return OccurrenceSpecificationHelper.findExecutionWith((OccurrenceSpecification) element, isSource);
}
return null;
}
protected CommandResult reorientTarget() {
- //Same target, ignore it.
+ // Same target, ignore it.
MessageEnd receiveEvent = getLink().getReceiveEvent();
- if(receiveEvent != null && receiveEvent == getNewTarget()) {
+ if (receiveEvent != null && receiveEvent == getNewTarget()) {
return CommandResult.newOKCommandResult();
}
ExecutionSpecification oldExecution = getExecution(getOldTarget(), false);
ExecutionSpecification newExecution = getExecution(getNewTarget(), false);
ReconnectMessageHelper.updateMessageEnd(receiveEvent, oldExecution, newExecution);
ReconnectMessageHelper.updateMessage(getLink());
- if(oldExecution != null && receiveEvent != null) {
- if(receiveEvent == oldExecution.getStart()) {
+ if (oldExecution != null && receiveEvent != null) {
+ if (receiveEvent == oldExecution.getStart()) {
OccurrenceSpecificationHelper.resetExecutionStart(oldExecution, UMLFactory.eINSTANCE.createExecutionOccurrenceSpecification());
- } else if(receiveEvent == oldExecution.getFinish()) {
+ } else if (receiveEvent == oldExecution.getFinish()) {
OccurrenceSpecificationHelper.resetExecutionFinish(oldExecution, UMLFactory.eINSTANCE.createExecutionOccurrenceSpecification());
}
}
- if(newExecution != null && receiveEvent instanceof MessageOccurrenceSpecification) {
- if(getNewTarget() == newExecution.getStart()) {
+ if (newExecution != null && receiveEvent instanceof MessageOccurrenceSpecification) {
+ if (getNewTarget() == newExecution.getStart()) {
OccurrenceSpecificationHelper.resetExecutionStart(newExecution, receiveEvent);
- } else if(getNewTarget() == newExecution.getFinish()) {
+ } else if (getNewTarget() == newExecution.getFinish()) {
OccurrenceSpecificationHelper.resetExecutionFinish(newExecution, receiveEvent);
}
}
@@ -141,24 +143,24 @@ public class ExecutionOccurrenceSpecificationMessageReorientCommand extends Edit
protected CommandResult reorientSource() {
MessageEnd sendEvent = getLink().getSendEvent();
- if(sendEvent != null && sendEvent == getNewTarget()) {
+ if (sendEvent != null && sendEvent == getNewTarget()) {
return CommandResult.newOKCommandResult();
}
ExecutionSpecification oldExecution = getExecution(getOldTarget(), false);
ExecutionSpecification newExecution = getExecution(getNewTarget(), false);
ReconnectMessageHelper.updateMessageEnd(sendEvent, oldExecution, newExecution);
- if(oldExecution != null && sendEvent instanceof MessageOccurrenceSpecification) {
- if(sendEvent == oldExecution.getStart()) {
+ if (oldExecution != null && sendEvent instanceof MessageOccurrenceSpecification) {
+ if (sendEvent == oldExecution.getStart()) {
OccurrenceSpecificationHelper.resetExecutionStart(oldExecution, UMLFactory.eINSTANCE.createExecutionOccurrenceSpecification());
- } else if(sendEvent == oldExecution.getFinish()) {
+ } else if (sendEvent == oldExecution.getFinish()) {
OccurrenceSpecificationHelper.resetExecutionFinish(oldExecution, UMLFactory.eINSTANCE.createExecutionOccurrenceSpecification());
}
}
- if(newExecution != null && sendEvent instanceof MessageOccurrenceSpecification) {
- if(getNewTarget() == newExecution.getStart()) {
+ if (newExecution != null && sendEvent instanceof MessageOccurrenceSpecification) {
+ if (getNewTarget() == newExecution.getStart()) {
OccurrenceSpecificationHelper.resetExecutionStart(newExecution, sendEvent);
- } else if(getNewTarget() == newExecution.getFinish()) {
+ } else if (getNewTarget() == newExecution.getFinish()) {
OccurrenceSpecificationHelper.resetExecutionFinish(newExecution, sendEvent);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/PromptCreateElementAndNodeCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/PromptCreateElementAndNodeCommand.java
index a34f1cbe1d0..7ea1eb4d55e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/PromptCreateElementAndNodeCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/PromptCreateElementAndNodeCommand.java
@@ -59,7 +59,8 @@ public class PromptCreateElementAndNodeCommand extends CreateOrSelectElementComm
private EditPart sourceEP;
- public PromptCreateElementAndNodeCommand(Command createCommand, TransactionalEditingDomain editingDomain, ConnectionViewDescriptor descriptor, ShapeNodeEditPart targetEP, EObject target, EditPart sourceEP, CreateConnectionRequest request, InteractionFragment container) {
+ public PromptCreateElementAndNodeCommand(Command createCommand, TransactionalEditingDomain editingDomain, ConnectionViewDescriptor descriptor, ShapeNodeEditPart targetEP, EObject target, EditPart sourceEP, CreateConnectionRequest request,
+ InteractionFragment container) {
super(Display.getCurrent().getActiveShell(), executionTypes);
this.editingDomain = editingDomain;
this.descriptor = descriptor;
@@ -72,7 +73,7 @@ public class PromptCreateElementAndNodeCommand extends CreateOrSelectElementComm
command = new CompoundCommand();
command.add(createCommand);
- //Repair the location of Popup menu.
+ // Repair the location of Popup menu.
setPopupMenu(new PopupMenu(executionTypes, getLabelProvider()) {
@Override
@@ -82,19 +83,20 @@ public class PromptCreateElementAndNodeCommand extends CreateOrSelectElementComm
menu.setVisible(true);
org.eclipse.swt.graphics.Point loc = getMenuLocation();
- if(loc != null) {
+ if (loc != null) {
menu.setLocation(loc);
}
Display display = menu.getDisplay();
- while(!menu.isDisposed() && menu.isVisible()) {
- if(!display.readAndDispatch())
+ while (!menu.isDisposed() && menu.isVisible()) {
+ if (!display.readAndDispatch()) {
display.sleep();
+ }
}
- if(!menu.isDisposed()) {
+ if (!menu.isDisposed()) {
menu.dispose();
- if(getResult() != null) {
+ if (getResult() != null) {
return true;
}
}
@@ -104,7 +106,7 @@ public class PromptCreateElementAndNodeCommand extends CreateOrSelectElementComm
}
protected org.eclipse.swt.graphics.Point getMenuLocation() {
- if(location == null || sourceEP == null || sourceEP.getViewer() == null) {
+ if (location == null || sourceEP == null || sourceEP.getViewer() == null) {
return null;
}
Control control = sourceEP.getViewer().getControl();
@@ -112,19 +114,20 @@ public class PromptCreateElementAndNodeCommand extends CreateOrSelectElementComm
return control.toDisplay(menuLoc);
}
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
sourceEP.eraseSourceFeedback(request);
targetEP.eraseSourceFeedback(request);
CommandResult cmdResult = super.doExecuteWithResult(progressMonitor, info);
- if(!cmdResult.getStatus().isOK()) {
+ if (!cmdResult.getStatus().isOK()) {
return cmdResult;
}
Object returnValue = cmdResult.getReturnValue();
- if(!(returnValue instanceof IHintedType)) {
+ if (!(returnValue instanceof IHintedType)) {
return cmdResult;
}
- IHintedType connectionType = (IHintedType)returnValue;
- CreateElementAndNodeCommand createExecutionSpecificationCommand = new CreateElementAndNodeCommand(editingDomain, (ShapeNodeEditPart)targetEP, target, connectionType, location);
+ IHintedType connectionType = (IHintedType) returnValue;
+ CreateElementAndNodeCommand createExecutionSpecificationCommand = new CreateElementAndNodeCommand(editingDomain, targetEP, target, connectionType, location);
createExecutionSpecificationCommand.putCreateElementRequestParameter(SequenceRequestConstant.INTERACTIONFRAGMENT_CONTAINER, container);
command.add(new ICommandProxy(createExecutionSpecificationCommand));
// put the anchor at the top of the figure
@@ -134,32 +137,36 @@ public class PromptCreateElementAndNodeCommand extends CreateOrSelectElementComm
return CommandResult.newOKCommandResult(descriptor);
}
+ @Override
public boolean canUndo() {
return command != null && command.canUndo();
}
+ @Override
protected CommandResult doRedoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- if(command != null) {
+ if (command != null) {
command.redo();
}
return super.doRedoWithResult(progressMonitor, info);
}
+ @Override
protected CommandResult doUndoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- if(command != null) {
+ if (command != null) {
command.undo();
}
return super.doUndoWithResult(progressMonitor, info);
}
+ @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())) {
+ if (object instanceof IHintedType) {
+ IHintedType elementType = (IHintedType) object;
+ switch (UMLVisualIDRegistry.getVisualID(elementType.getSemanticHint())) {
case ActionExecutionSpecificationEditPart.VISUAL_ID:
return Messages.createActionExecutionSpecification2CreationTool_title;
case BehaviorExecutionSpecificationEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/ReconnectToGateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/ReconnectToGateCommand.java
index cf9f1c289f8..7282e46c311 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/ReconnectToGateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/ReconnectToGateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -50,7 +50,7 @@ public class ReconnectToGateCommand extends AbstractTransactionalCommand {
/**
* Constructor.
- *
+ *
* @param domain
* @param label
* @param affectedFiles
@@ -64,7 +64,7 @@ public class ReconnectToGateCommand extends AbstractTransactionalCommand {
/**
* @see org.eclipse.core.commands.operations.AbstractOperation#canExecute()
- *
+ *
* @return
*/
@Override
@@ -72,14 +72,15 @@ public class ReconnectToGateCommand extends AbstractTransactionalCommand {
return editPartViewer != null && newEndAdapter != null && reconnectRequest != null;
}
+ @Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public List getAffectedFiles() {
- if(newEndAdapter != null) {
- View view = (View)newEndAdapter.getAdapter(View.class);
- if(view != null) {
+ if (newEndAdapter != null) {
+ View view = (View) newEndAdapter.getAdapter(View.class);
+ if (view != null) {
List result = new ArrayList();
IFile file = WorkspaceSynchronizer.getFile(view.eResource());
- if(file != null) {
+ if (file != null) {
result.add(file);
}
return result;
@@ -89,9 +90,8 @@ public class ReconnectToGateCommand extends AbstractTransactionalCommand {
}
/**
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.core.runtime.IAdaptable)
- *
+ * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+ *
* @param monitor
* @param info
* @return
@@ -99,26 +99,26 @@ public class ReconnectToGateCommand extends AbstractTransactionalCommand {
*/
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- View view = (View)newEndAdapter.getAdapter(View.class);
- EditPart target = (EditPart)editPartViewer.getEditPartRegistry().get(view);
+ View view = (View) newEndAdapter.getAdapter(View.class);
+ EditPart target = (EditPart) editPartViewer.getEditPartRegistry().get(view);
boolean redirected = false;
EditPart oldTarget = reconnectRequest.getTarget();
Point location = reconnectRequest.getLocation();
- if(target != null) {
+ if (target != null) {
reconnectRequest.setTargetEditPart(target);
- reconnectRequest.setLocation(SequenceUtil.getAbsoluteBounds((IGraphicalEditPart)target).getCenter());
+ reconnectRequest.setLocation(SequenceUtil.getAbsoluteBounds((IGraphicalEditPart) target).getCenter());
command = target.getCommand(reconnectRequest);
- if(command != null && command.canExecute()) {
+ if (command != null && command.canExecute()) {
command.execute();
redirected = true;
}
}
- if(!redirected) {
+ if (!redirected) {
reconnectRequest.setTargetEditPart(oldTarget);
reconnectRequest.setLocation(location);
reconnectRequest.getExtendedData().put(REDIRECT_GATE_FAILED, Boolean.TRUE);
command = oldTarget.getCommand(reconnectRequest);
- if(command != null && command.canExecute()) {
+ if (command != null && command.canExecute()) {
command.execute();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/RestoreDurationConstraintLinkCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/RestoreDurationConstraintLinkCommand.java
index 75f0d948d60..17ca63cfabc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/RestoreDurationConstraintLinkCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/RestoreDurationConstraintLinkCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -54,7 +54,7 @@ public class RestoreDurationConstraintLinkCommand extends AbstractTransactionalC
/**
* Constructor.
- *
+ *
* @param domain
* @param label
* @param affectedFiles
@@ -70,21 +70,20 @@ public class RestoreDurationConstraintLinkCommand extends AbstractTransactionalC
/**
* @see org.eclipse.core.commands.operations.AbstractOperation#canExecute()
- *
+ *
* @return
*/
@Override
public boolean canExecute() {
- if(dcViewAdapter == null || viewer == null || targetLocation == null) {
+ if (dcViewAdapter == null || viewer == null || targetLocation == null) {
return false;
}
return super.canExecute();
}
/**
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.core.runtime.IAdaptable)
- *
+ * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+ *
* @param monitor
* @param info
* @return
@@ -92,22 +91,22 @@ public class RestoreDurationConstraintLinkCommand extends AbstractTransactionalC
*/
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
return CommandResult.newCancelledCommandResult();
}
- View view = (View)dcViewAdapter.getAdapter(View.class);
- if(view == null) {
+ View view = (View) dcViewAdapter.getAdapter(View.class);
+ if (view == null) {
return CommandResult.newErrorCommandResult("No view found");
}
- EditPart sourceEditPart = (EditPart)viewer.getEditPartRegistry().get(view);
- if(sourceEditPart == null) {
+ EditPart sourceEditPart = (EditPart) viewer.getEditPartRegistry().get(view);
+ if (sourceEditPart == null) {
return CommandResult.newCancelledCommandResult();
}
- Rectangle bounds = SequenceUtil.getAbsoluteBounds((IGraphicalEditPart)sourceEditPart);
+ Rectangle bounds = SequenceUtil.getAbsoluteBounds((IGraphicalEditPart) sourceEditPart);
Point sourceLocation = null;
- if(isOnTop != null) {
+ if (isOnTop != null) {
sourceLocation = isOnTop.booleanValue() ? bounds.getTop() : bounds.getBottom();
- } else if(targetLocation.y >= bounds.getCenter().y) {
+ } else if (targetLocation.y >= bounds.getCenter().y) {
sourceLocation = bounds.getBottom();
} else {
sourceLocation = bounds.getTop();
@@ -119,13 +118,13 @@ public class RestoreDurationConstraintLinkCommand extends AbstractTransactionalC
request.setSourceEditPart(sourceEditPart);
request.setTargetEditPart(sourceEditPart);
Command command = sourceEditPart.getCommand(request);
- //connect...
+ // connect...
request.setLocation(targetLocation);
request.setType(AnnotatedLinkEndEditPolicy.REQ_ANNOTATED_LINK_END);
targetEditPart = sourceEditPart.getViewer().findObjectAtExcluding(targetLocation, Collections.emptySet(), getTargetingConditional(request));
request.setTargetEditPart(targetEditPart);
command = targetEditPart.getCommand(request);
- if(command != null && command.canExecute()) {
+ if (command != null && command.canExecute()) {
command.execute();
}
return CommandResult.newOKCommandResult();
@@ -134,6 +133,7 @@ public class RestoreDurationConstraintLinkCommand extends AbstractTransactionalC
protected EditPartViewer.Conditional getTargetingConditional(final Request req) {
return new EditPartViewer.Conditional() {
+ @Override
public boolean evaluate(EditPart editpart) {
return editpart.getTargetEditPart(req) != null;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/draw2d/routers/DurationConstraintAutomaticRouter.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/draw2d/routers/DurationConstraintAutomaticRouter.java
index bb5d2afd806..e3caf08f8a3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/draw2d/routers/DurationConstraintAutomaticRouter.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/draw2d/routers/DurationConstraintAutomaticRouter.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -27,8 +27,9 @@ public class DurationConstraintAutomaticRouter extends ObliqueRouter {
super();
}
+ @Override
protected void resetEndPointsToEdge(Connection conn, PointList newLine) {
- if(newLine.size() < 2) {
+ if (newLine.size() < 2) {
/*
* Connection must have at least 2 points in the list: the source
* and target anchor points. Otherwise it's invalid connection.
@@ -42,7 +43,7 @@ public class DurationConstraintAutomaticRouter extends ObliqueRouter {
}
PrecisionPoint sourceAnchorPoint = null, targetAnchorPoint = null;
- while(newLine.size() != 2) {
+ while (newLine.size() != 2) {
newLine.removePoint(1);
}
PrecisionPoint sourceReference = getAnchorReference(conn.getTargetAnchor());
@@ -70,7 +71,7 @@ public class DurationConstraintAutomaticRouter extends ObliqueRouter {
}
private double computeOffset(double x, double x2) {
- if(Math.abs(x - x2) > 20) {
+ if (Math.abs(x - x2) > 20) {
return 20 * Math.signum(x - x2);
} else {
return (x - x2) * 0.5;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/draw2d/routers/MessageRouter.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/draw2d/routers/MessageRouter.java
index 75942e3f090..75468bd1c0b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/draw2d/routers/MessageRouter.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/draw2d/routers/MessageRouter.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -40,7 +40,7 @@ import org.eclipse.papyrus.uml.diagram.sequence.figures.MessageCreate;
* A multi behavior router which enable to draw message.
* It can behave as an oblique router (with no bendpoint), or as an horizontal router (with no bendpoint),
* or as a rectilinear router with 2 bendpoints.
- *
+ *
* @author mvelten and vhemery
*/
@SuppressWarnings({ "restriction", "deprecation" })
@@ -52,17 +52,17 @@ public class MessageRouter extends ObliqueRouter {
HORIZONTAL, OBLIQUE, SELF;
public static RouterKind getKind(Connection conn, PointList newLine) {
- if(isSelfConnection(conn)) {
+ if (isSelfConnection(conn)) {
return SELF;
}
- if(isHorizontalConnection(conn, newLine)) {
+ if (isHorizontalConnection(conn, newLine)) {
return HORIZONTAL;
}
return OBLIQUE;
}
private static boolean isHorizontalConnection(Connection conn, PointList newLine) {
- if(!(conn instanceof MessageAsync)) {
+ if (!(conn instanceof MessageAsync)) {
return false;
}
Point sourcePoint = newLine.getFirstPoint();
@@ -74,15 +74,15 @@ public class MessageRouter extends ObliqueRouter {
* It is self if the parent lifeline is the same.
*/
private static boolean isSelfConnection(Connection conn) {
- if(conn == null || conn.getSourceAnchor() == null || conn.getTargetAnchor() == null) {
+ if (conn == null || conn.getSourceAnchor() == null || conn.getTargetAnchor() == null) {
return false;
}
IFigure sourceLifeline = conn.getSourceAnchor().getOwner();
- while(sourceLifeline != null && !(sourceLifeline instanceof LifelineFigure)) {
+ while (sourceLifeline != null && !(sourceLifeline instanceof LifelineFigure)) {
sourceLifeline = sourceLifeline.getParent();
}
IFigure targetLifeline = conn.getTargetAnchor().getOwner();
- while(targetLifeline != null && !(targetLifeline instanceof LifelineFigure)) {
+ while (targetLifeline != null && !(targetLifeline instanceof LifelineFigure)) {
targetLifeline = targetLifeline.getParent();
}
return sourceLifeline != null && sourceLifeline.equals(targetLifeline);
@@ -92,7 +92,7 @@ public class MessageRouter extends ObliqueRouter {
@Override
public void routeLine(Connection conn, int nestedRoutingDepth, PointList newLine) {
Point sourcePoint, targetPoint;
- switch(RouterKind.getKind(conn, newLine)) {
+ switch (RouterKind.getKind(conn, newLine)) {
case HORIZONTAL:
originalRectilinearRouteLine(conn, nestedRoutingDepth, newLine);
// force 2 bendpoints on the same Y coordinate
@@ -107,7 +107,7 @@ public class MessageRouter extends ObliqueRouter {
super.routeLine(conn, nestedRoutingDepth, newLine);
adjustCreateEndpoint(conn, newLine);
// force 2 bendpoints only
- if(newLine.size() > 2) {
+ if (newLine.size() > 2) {
sourcePoint = newLine.getFirstPoint();
targetPoint = newLine.getLastPoint();
newLine.removeAllPoints();
@@ -117,9 +117,10 @@ public class MessageRouter extends ObliqueRouter {
break;
case SELF:
// Handle special routing: self connections and intersecting shapes connections
- if(checkSelfRelConnection(conn, newLine)) {
+ if (checkSelfRelConnection(conn, newLine)) {
super.resetEndPointsToEdge(conn, newLine);
- OrthogonalRouterUtilities.transformToOrthogonalPointList(newLine, getOffShapeDirection(getAnchorOffRectangleDirection(newLine.getFirstPoint(), sourceBoundsRelativeToConnection(conn))), getOffShapeDirection(getAnchorOffRectangleDirection(newLine.getLastPoint(), targetBoundsRelativeToConnection(conn))));
+ OrthogonalRouterUtilities.transformToOrthogonalPointList(newLine, getOffShapeDirection(getAnchorOffRectangleDirection(newLine.getFirstPoint(), sourceBoundsRelativeToConnection(conn))),
+ getOffShapeDirection(getAnchorOffRectangleDirection(newLine.getLastPoint(), targetBoundsRelativeToConnection(conn))));
removeRedundantPoints(newLine);
return;
}
@@ -127,23 +128,24 @@ public class MessageRouter extends ObliqueRouter {
}
}
+ @Override
protected boolean checkShapesIntersect(Connection conn, PointList newLine) {
- //Fixed bug about MessageLost and MessageFound.
- if(conn.getSourceAnchor() instanceof AnchorHelper.InnerPointAnchor || conn.getTargetAnchor() instanceof AnchorHelper.InnerPointAnchor) {
+ // Fixed bug about MessageLost and MessageFound.
+ if (conn.getSourceAnchor() instanceof AnchorHelper.InnerPointAnchor || conn.getTargetAnchor() instanceof AnchorHelper.InnerPointAnchor) {
return false;
}
- if(conn.getTargetAnchor().getOwner() instanceof AnchorHelper.CombinedFragmentNodeFigure) {
+ if (conn.getTargetAnchor().getOwner() instanceof AnchorHelper.CombinedFragmentNodeFigure) {
return false;
}
return super.checkShapesIntersect(conn, newLine);
}
protected void adjustCreateEndpoint(Connection conn, PointList newLine) {
- if(conn instanceof MessageCreate) {
- if(newLine.size() >= 2) {
+ if (conn instanceof MessageCreate) {
+ if (newLine.size() >= 2) {
Point start = newLine.getFirstPoint();
Point end = newLine.getLastPoint();
- if(start.y != end.y) {
+ if (start.y != end.y) {
start.y = end.y;
newLine.setPoint(start, 0);
}
@@ -153,7 +155,7 @@ public class MessageRouter extends ObliqueRouter {
@Override
protected void getSelfRelVertices(Connection conn, PointList newLine) {
- //Copy the points calculated from Bendpoints.
+ // Copy the points calculated from Bendpoints.
PointList oldLine = newLine.getCopy();
rectilinearResetEndPointsToEdge(conn, newLine);
IFigure owner = conn.getSourceAnchor().getOwner();
@@ -178,7 +180,7 @@ public class MessageRouter extends ObliqueRouter {
newLine.removeAllPoints();
newLine.addPoint(ptS1);
// Fixed bug about custom self message. If there are 4 points, insert middle two ones for supporting bendpoints.
- if(oldLine.size() == 4) {
+ if (oldLine.size() == 4) {
Point p2 = oldLine.getPoint(1);
Point p3 = oldLine.getPoint(2);
int x = Math.min(p2.x, p3.x);
@@ -187,13 +189,13 @@ public class MessageRouter extends ObliqueRouter {
} else {
// insert two points
Point extraPoint1 = ptS2.getTranslated(ptE2).scale(0.5);
- if(isOnRightHand(conn, owner, middle)) {
+ if (isOnRightHand(conn, owner, middle)) {
extraPoint1.translate(SELFRELSIZEINIT, 0);
} else {
extraPoint1.translate(-SELFRELSIZEINIT, 0);
}
Point extraPoint2 = extraPoint1.getCopy();
- if(isFeedback(conn)) {
+ if (isFeedback(conn)) {
extraPoint1.y = ptS2.y;
extraPoint2.y = ptE2.y;
} else {
@@ -208,20 +210,21 @@ public class MessageRouter extends ObliqueRouter {
protected boolean isOnRightHand(Connection conn, IFigure owner, Point middle) {
boolean right = true;
- if(conn.getTargetAnchor() instanceof AnchorHelper.SideAnchor) {
- AnchorHelper.SideAnchor anchor = (AnchorHelper.SideAnchor)conn.getTargetAnchor();
+ if (conn.getTargetAnchor() instanceof AnchorHelper.SideAnchor) {
+ AnchorHelper.SideAnchor anchor = (AnchorHelper.SideAnchor) conn.getTargetAnchor();
right = anchor.isRight();
} else {
PointList list = conn.getPoints();
- if(list.getPoint(0).x > list.getPoint(1).x)
+ if (list.getPoint(0).x > list.getPoint(1).x) {
right = false;
+ }
}
return right;
}
@Override
protected boolean checkSelfRelConnection(Connection conn, PointList newLine) {
- if(RouterKind.getKind(conn, newLine).equals(RouterKind.SELF)) {
+ if (RouterKind.getKind(conn, newLine).equals(RouterKind.SELF)) {
getSelfRelVertices(conn, newLine);
return true;
}
@@ -230,14 +233,14 @@ public class MessageRouter extends ObliqueRouter {
/**
* All the code after this comment is copied from RectilinearRouter and RouterHelper
- *
+ *
* Copyright (c) 2002, 2010 IBM Corporation and others.
*/
private void originalRectilinearRouteLine(Connection conn, int nestedRoutingDepth, PointList newLine) {
boolean skipNormalization = (routerFlags & ROUTER_FLAG_SKIPNORMALIZATION) != 0;
// if we are reorienting, then just default to the super class implementation and
// don't try to do rectilinear routing.
- if(isReorienting(conn)) {
+ if (isReorienting(conn)) {
super.routeLine(conn, nestedRoutingDepth, newLine);
return;
}
@@ -251,7 +254,7 @@ public class MessageRouter extends ObliqueRouter {
/*
* Check if connection is rectilinear and if not make it rectilinear
*/
- if(!OrthogonalRouterUtilities.isRectilinear(newLine)) {
+ if (!OrthogonalRouterUtilities.isRectilinear(newLine)) {
OrthogonalRouterUtilities.transformToOrthogonalPointList(newLine, PositionConstants.NONE, PositionConstants.NONE);
}
removeRedundantPoints(newLine);
@@ -261,14 +264,15 @@ public class MessageRouter extends ObliqueRouter {
*/
removePointsInViews(conn, newLine, lastStartAnchor, lastEndAnchor);
Dimension tolerance = new Dimension(3, 0);
- if(!isFeedback(conn))
- tolerance = (Dimension)MapModeUtil.getMapMode(conn).DPtoLP(tolerance);
+ if (!isFeedback(conn)) {
+ tolerance = (Dimension) MapModeUtil.getMapMode(conn).DPtoLP(tolerance);
+ }
/*
* Normalize polyline to eliminate extra segments. (This makes 3 segments collapsing into
* one, while line segments are moved)
*/
- if(!skipNormalization) {
- if(PointListUtilities.normalizeSegments(newLine, tolerance.width)) {
+ if (!skipNormalization) {
+ if (PointListUtilities.normalizeSegments(newLine, tolerance.width)) {
/*
* Normalization can make our polyline not rectilinear. Hence, we need to normalize
* segments of polyline to straight line tolerance.
@@ -281,9 +285,9 @@ public class MessageRouter extends ObliqueRouter {
* If distance between start and end (which are the only points in a polyline) points
* is too short we'll remove one of the points
*/
- if(newLine.size() == 2) {
+ if (newLine.size() == 2) {
Ray middleSeg = new Ray(newLine.getFirstPoint(), newLine.getLastPoint());
- if(middleSeg.length() <= tolerance.width) {
+ if (middleSeg.length() <= tolerance.width) {
newLine.removePoint(0);
}
}
@@ -292,7 +296,7 @@ public class MessageRouter extends ObliqueRouter {
* the connection rectilinear if anchor points make it not rectilinear.
*/
rectilinearResetEndPointsToEdge(conn, newLine);
- if(nestedRoutingDepth < 1 && !isValidRectilinearLine(conn, newLine)) {
+ if (nestedRoutingDepth < 1 && !isValidRectilinearLine(conn, newLine)) {
routeLine(conn, ++nestedRoutingDepth, newLine);
}
}
@@ -303,35 +307,35 @@ public class MessageRouter extends ObliqueRouter {
* 2. Last bend point is within the target
* 3. First bend point and source anchor are on different sides of the source shape
* 4. Last bend point and target anchor are on different sides of the target shape
- *
+ *
* @param conn
- * connection
+ * connection
* @param line
- * rectilinear polyline
+ * rectilinear polyline
* @return <code>true</code> if the line is valid
*/
private boolean isValidRectilinearLine(Connection conn, PointList line) {
- if(!(conn.getSourceAnchor().getOwner() instanceof Connection)) {
+ if (!(conn.getSourceAnchor().getOwner() instanceof Connection)) {
Rectangle source = new PrecisionRectangle(FigureUtilities.getAnchorableFigureBounds(conn.getSourceAnchor().getOwner()));
conn.getSourceAnchor().getOwner().translateToAbsolute(source);
conn.translateToRelative(source);
- if(source.contains(line.getPoint(1))) {
+ if (source.contains(line.getPoint(1))) {
return false;
}
int firstSegmentOrientation = line.getFirstPoint().x == line.getPoint(1).x ? PositionConstants.VERTICAL : PositionConstants.HORIZONTAL;
- if(getOutisePointOffRectanglePosition(line.getPoint(1), source) != getAnchorLocationBasedOnSegmentOrientation(line.getFirstPoint(), source, firstSegmentOrientation)) {
+ if (getOutisePointOffRectanglePosition(line.getPoint(1), source) != getAnchorLocationBasedOnSegmentOrientation(line.getFirstPoint(), source, firstSegmentOrientation)) {
return false;
}
}
- if(!(conn.getTargetAnchor().getOwner() instanceof Connection)) {
+ if (!(conn.getTargetAnchor().getOwner() instanceof Connection)) {
Rectangle target = new PrecisionRectangle(FigureUtilities.getAnchorableFigureBounds(conn.getTargetAnchor().getOwner()));
conn.getTargetAnchor().getOwner().translateToAbsolute(target);
conn.translateToRelative(target);
- if(target.contains(line.getPoint(line.size() - 2))) {
+ if (target.contains(line.getPoint(line.size() - 2))) {
return false;
}
int lastSegmentOrientation = line.getLastPoint().x == line.getPoint(line.size() - 2).x ? PositionConstants.VERTICAL : PositionConstants.HORIZONTAL;
- if(getOutisePointOffRectanglePosition(line.getPoint(line.size() - 2), target) != getAnchorLocationBasedOnSegmentOrientation(line.getLastPoint(), target, lastSegmentOrientation)) {
+ if (getOutisePointOffRectanglePosition(line.getPoint(line.size() - 2), target) != getAnchorLocationBasedOnSegmentOrientation(line.getLastPoint(), target, lastSegmentOrientation)) {
return false;
}
}
@@ -341,23 +345,23 @@ public class MessageRouter extends ObliqueRouter {
/**
* Calculates geographic position of a point located outside the given rectangle relative
* to the rectangle
- *
+ *
* @param p
- * point outside of rectangle
+ * point outside of rectangle
* @param r
- * the rectangle
+ * the rectangle
* @return geographic position of the point relative to the recatangle
*/
private int getOutisePointOffRectanglePosition(Point p, Rectangle r) {
int position = PositionConstants.NONE;
- if(r.x > p.x) {
+ if (r.x > p.x) {
position |= PositionConstants.WEST;
- } else if(r.x + r.width < p.x) {
+ } else if (r.x + r.width < p.x) {
position |= PositionConstants.EAST;
}
- if(r.y > p.y) {
+ if (r.y > p.y) {
position |= PositionConstants.NORTH;
- } else if(r.y + r.height < p.y) {
+ } else if (r.y + r.height < p.y) {
position |= PositionConstants.SOUTH;
}
return position;
@@ -368,24 +372,24 @@ public class MessageRouter extends ObliqueRouter {
* orientation of the first rectilinear connection segment that comes out from the anchor
* point the method detemines on which geographic side of the rectangle the anchor point
* is located on.
- *
+ *
* @param anchorPoint
- * coordinates of the anchor point
+ * coordinates of the anchor point
* @param rectangle
- * the shape's bounding rectangle
+ * the shape's bounding rectangle
* @param segmentOrientation
- * orinetation of the segment coming out from the anchor point
+ * orinetation of the segment coming out from the anchor point
* @return geographic position of the anchor point relative to the rectangle
*/
private int getAnchorLocationBasedOnSegmentOrientation(Point anchorPoint, Rectangle rectangle, int segmentOrientation) {
- if(segmentOrientation == PositionConstants.VERTICAL) {
- if(Math.abs(anchorPoint.y - rectangle.y) < Math.abs(anchorPoint.y - rectangle.y - rectangle.height)) {
+ if (segmentOrientation == PositionConstants.VERTICAL) {
+ if (Math.abs(anchorPoint.y - rectangle.y) < Math.abs(anchorPoint.y - rectangle.y - rectangle.height)) {
return PositionConstants.NORTH;
} else {
return PositionConstants.SOUTH;
}
- } else if(segmentOrientation == PositionConstants.HORIZONTAL) {
- if(Math.abs(anchorPoint.x - rectangle.x) < Math.abs(anchorPoint.x - rectangle.x - rectangle.width)) {
+ } else if (segmentOrientation == PositionConstants.HORIZONTAL) {
+ if (Math.abs(anchorPoint.x - rectangle.x) < Math.abs(anchorPoint.x - rectangle.x - rectangle.width)) {
return PositionConstants.WEST;
} else {
return PositionConstants.EAST;
@@ -397,19 +401,19 @@ public class MessageRouter extends ObliqueRouter {
/**
* Goes through line segments of a polyline and makes strict straight segments
* from nearly straight segments.
- *
+ *
* @param line
- * polyline
+ * polyline
* @param tolerance
- * tolerance value specifying nearly straight lines.
+ * tolerance value specifying nearly straight lines.
*/
private void normalizeToStraightLineTolerance(PointList line, int tolerance) {
- for(int i = 0; i < line.size() - 1; i++) {
+ for (int i = 0; i < line.size() - 1; i++) {
Point pt1 = line.getPoint(i);
Point pt2 = line.getPoint(i + 1);
- if(Math.abs(pt1.x - pt2.x) < tolerance) {
+ if (Math.abs(pt1.x - pt2.x) < tolerance) {
line.setPoint(new Point(pt1.x, pt2.y), i + 1);
- } else if(Math.abs(pt1.y - pt2.y) < tolerance) {
+ } else if (Math.abs(pt1.y - pt2.y) < tolerance) {
line.setPoint(new Point(pt2.x, pt1.y), i + 1);
}
}
@@ -419,15 +423,15 @@ public class MessageRouter extends ObliqueRouter {
* Removes consecutive points contained within the source shape and removes consecutive
* points contained within the target shape. If all points have been removed an extra point
* outside source and target shapes will be added.
- *
+ *
* @param conn
- * connection
+ * connection
* @param newLine
- * polyline of the connection (routed connection)
+ * polyline of the connection (routed connection)
* @param start
- * old start anchor point
+ * old start anchor point
* @param end
- * old end anchor point
+ * old end anchor point
*/
private void removePointsInViews(Connection conn, PointList newLine, Point start, Point end) {
/*
@@ -436,11 +440,11 @@ public class MessageRouter extends ObliqueRouter {
*/
PrecisionRectangle source = conn.getSourceAnchor().getOwner() != null ? new PrecisionRectangle(FigureUtilities.getAnchorableFigureBounds(conn.getSourceAnchor().getOwner())) : null;
PrecisionRectangle target = conn.getTargetAnchor().getOwner() != null ? new PrecisionRectangle(FigureUtilities.getAnchorableFigureBounds(conn.getTargetAnchor().getOwner())) : null;
- if(source != null) {
+ if (source != null) {
conn.getSourceAnchor().getOwner().translateToAbsolute(source);
conn.translateToRelative(source);
}
- if(target != null) {
+ if (target != null) {
conn.getTargetAnchor().getOwner().translateToAbsolute(target);
conn.translateToRelative(target);
}
@@ -452,9 +456,9 @@ public class MessageRouter extends ObliqueRouter {
* Remember the point that was removed from the source shape last for a possible
* case of all points removed from polyline.
*/
- if(!(conn.getSourceAnchor().getOwner() instanceof Connection) && newLine.size() != 0 && source.contains(new PrecisionPoint(newLine.getFirstPoint()))) {
+ if (!(conn.getSourceAnchor().getOwner() instanceof Connection) && newLine.size() != 0 && source.contains(new PrecisionPoint(newLine.getFirstPoint()))) {
lastRemovedFromSource = newLine.removePoint(0);
- for(int i = 0; i < newLine.size() && source.contains(new PrecisionPoint(newLine.getPoint(i))); i++) {
+ for (int i = 0; i < newLine.size() && source.contains(new PrecisionPoint(newLine.getPoint(i))); i++) {
lastRemovedFromSource = newLine.removePoint(i--);
}
}
@@ -464,24 +468,25 @@ public class MessageRouter extends ObliqueRouter {
* Remember the point that was removed from the target shape last for a possible
* case of all points removed from polyline.
*/
- if(!(conn.getTargetAnchor().getOwner() instanceof Connection) && newLine.size() != 0 && target.contains(new PrecisionPoint(newLine.getLastPoint()))) {
+ if (!(conn.getTargetAnchor().getOwner() instanceof Connection) && newLine.size() != 0 && target.contains(new PrecisionPoint(newLine.getLastPoint()))) {
lastRemovedFromTarget = newLine.removePoint(newLine.size() - 1);
- for(int i = newLine.size(); i > 0 && target.contains(new PrecisionPoint(newLine.getPoint(i - 1))); i--) {
+ for (int i = newLine.size(); i > 0 && target.contains(new PrecisionPoint(newLine.getPoint(i - 1))); i--) {
lastRemovedFromTarget = newLine.removePoint(i - 1);
}
}
/*
* Handle the special case of all points removed from polyline.
*/
- if(newLine.size() == 0) {
+ if (newLine.size() == 0) {
Dimension tolerance = new Dimension(1, 0);
- if(!isFeedback(conn))
- tolerance = (Dimension)MapModeUtil.getMapMode(conn).DPtoLP(tolerance);
+ if (!isFeedback(conn)) {
+ tolerance = (Dimension) MapModeUtil.getMapMode(conn).DPtoLP(tolerance);
+ }
int toleranceValue = tolerance.width;
- if(lastRemovedFromSource == null) {
+ if (lastRemovedFromSource == null) {
lastRemovedFromSource = start;
}
- if(lastRemovedFromTarget == null) {
+ if (lastRemovedFromTarget == null) {
lastRemovedFromTarget = end;
}
/*
@@ -492,43 +497,44 @@ public class MessageRouter extends ObliqueRouter {
* bend point location extracted from RelativeBendpoint can have precision errors due
* to non-integer weight factors.
*/
- if(Math.abs(lastRemovedFromSource.x - lastRemovedFromTarget.x) < toleranceValue) {
+ if (Math.abs(lastRemovedFromSource.x - lastRemovedFromTarget.x) < toleranceValue) {
// Vertical
- if(source.preciseY < target.preciseY) {
+ if (source.preciseY < target.preciseY) {
newLine.addPoint(lastRemovedFromSource.x, (source.getBottom().y + target.getTop().y) / 2);
} else {
newLine.addPoint(lastRemovedFromSource.x, (source.getTop().y + target.getBottom().y) / 2);
}
- } else if(Math.abs(lastRemovedFromSource.y - lastRemovedFromTarget.y) < toleranceValue) {
+ } else if (Math.abs(lastRemovedFromSource.y - lastRemovedFromTarget.y) < toleranceValue) {
// Horizontal
- if(source.preciseX < target.preciseX) {
+ if (source.preciseX < target.preciseX) {
newLine.addPoint((source.getRight().x + target.getLeft().x) / 2, lastRemovedFromSource.y);
} else {
newLine.addPoint((source.getLeft().x + target.getRight().x) / 2, lastRemovedFromSource.y);
}
- } else if((conn.getSourceAnchor() instanceof BaseSlidableAnchor && StringStatics.BLANK.equals(((BaseSlidableAnchor)conn.getSourceAnchor()).getTerminal()) && (conn.getTargetAnchor() instanceof BaseSlidableAnchor && StringStatics.BLANK.equals(((BaseSlidableAnchor)conn.getTargetAnchor()).getTerminal())))) {
+ } else if ((conn.getSourceAnchor() instanceof BaseSlidableAnchor && StringStatics.BLANK.equals(((BaseSlidableAnchor) conn.getSourceAnchor()).getTerminal()) && (conn.getTargetAnchor() instanceof BaseSlidableAnchor && StringStatics.BLANK
+ .equals(((BaseSlidableAnchor) conn.getTargetAnchor()).getTerminal())))) {
/*
* This a special case for old diagrams with rectilinear connections routed by
* the old router to look good with the new router
*/
- if(lastRemovedFromSource != null && lastRemovedFromTarget != null) {
+ if (lastRemovedFromSource != null && lastRemovedFromTarget != null) {
newLine.addPoint((lastRemovedFromSource.x + lastRemovedFromTarget.x) / 2, (lastRemovedFromSource.y + lastRemovedFromTarget.y) / 2);
} else {
double startX = Math.max(source.preciseX, target.preciseX);
double endX = Math.min(source.preciseX + source.preciseWidth, target.preciseX + target.preciseWidth);
double startY = Math.max(source.preciseY, target.preciseY);
double endY = Math.min(source.preciseY + source.preciseHeight, target.preciseY + target.preciseHeight);
- if(startX < endX) {
- if(source.preciseY < target.preciseY) {
- newLine.addPoint((int)Math.round((startX + endX) / 2.0), (source.getBottom().y + target.getTop().y) / 2);
+ if (startX < endX) {
+ if (source.preciseY < target.preciseY) {
+ newLine.addPoint((int) Math.round((startX + endX) / 2.0), (source.getBottom().y + target.getTop().y) / 2);
} else {
- newLine.addPoint((int)Math.round((startX + endX) / 2.0), (source.getTop().y + target.getBottom().y) / 2);
+ newLine.addPoint((int) Math.round((startX + endX) / 2.0), (source.getTop().y + target.getBottom().y) / 2);
}
- } else if(startY < endY) {
- if(source.preciseX < target.preciseX) {
- newLine.addPoint((source.getRight().x + target.getLeft().x) / 2, (int)Math.round((startY + endY) / 2.0));
+ } else if (startY < endY) {
+ if (source.preciseX < target.preciseX) {
+ newLine.addPoint((source.getRight().x + target.getLeft().x) / 2, (int) Math.round((startY + endY) / 2.0));
} else {
- newLine.addPoint((source.getLeft().x + target.getRight().x) / 2, (int)Math.round((startY + endY) / 2.0));
+ newLine.addPoint((source.getLeft().x + target.getRight().x) / 2, (int) Math.round((startY + endY) / 2.0));
}
}
}
@@ -537,7 +543,7 @@ public class MessageRouter extends ObliqueRouter {
}
protected void rectilinearResetEndPointsToEdge(Connection conn, PointList line) {
- if(isReorienting(conn)) {
+ if (isReorienting(conn)) {
/*
* If the connection doesn't have a shape as a source or target we'll
* let the oblique router to do the work. The connection doesn't need to
@@ -553,7 +559,7 @@ public class MessageRouter extends ObliqueRouter {
int offTargetDirection = PositionConstants.NONE;
int sourceAnchorRelativeLocation = PositionConstants.NONE;
int targetAnchorRelativeLocation = PositionConstants.NONE;
- if(line.size() == 0) {
+ if (line.size() == 0) {
/*
* If there are no valid bend points, we'll use the oblique connection anchor points
* and just convert the polyline from oblique to rectilinear.
@@ -581,7 +587,7 @@ public class MessageRouter extends ObliqueRouter {
} else {
Point start = line.getFirstPoint();
Point end = line.getLastPoint();
- if(conn.getSourceAnchor() instanceof OrthogonalConnectionAnchor) {
+ if (conn.getSourceAnchor() instanceof OrthogonalConnectionAnchor) {
line.insertPoint(OrthogonalRouterUtilities.getOrthogonalLineSegToAnchorLoc(conn, conn.getSourceAnchor(), start).getOrigin(), 0);
} else {
/*
@@ -594,7 +600,7 @@ public class MessageRouter extends ObliqueRouter {
conn.translateToRelative(anchorLocation);
line.insertPoint(anchorLocation, 0);
}
- if(conn.getTargetAnchor() instanceof OrthogonalConnectionAnchor) {
+ if (conn.getTargetAnchor() instanceof OrthogonalConnectionAnchor) {
line.addPoint(OrthogonalRouterUtilities.getOrthogonalLineSegToAnchorLoc(conn, conn.getTargetAnchor(), end).getOrigin());
} else {
/*
@@ -624,24 +630,24 @@ public class MessageRouter extends ObliqueRouter {
* Returns a translation dimension for the anchor point. Translation dimension
* translates the anchor point off the shape. The off shape direction
* is specified by the relative to the shape geographic position of the anchor
- *
+ *
* @param position
- * relative to the shape geographic position of the anchor
+ * relative to the shape geographic position of the anchor
* @param xFactorValue
- * translation value along x-axis
+ * translation value along x-axis
* @param yFactorValue
- * translation value along y-axis
+ * translation value along y-axis
* @return
*/
private Dimension getTranslationValue(int position, int xFactorValue, int yFactorValue) {
Dimension translationDimension = new Dimension();
- if(position == PositionConstants.EAST) {
+ if (position == PositionConstants.EAST) {
translationDimension.width = xFactorValue;
- } else if(position == PositionConstants.SOUTH) {
+ } else if (position == PositionConstants.SOUTH) {
translationDimension.height = yFactorValue;
- } else if(position == PositionConstants.WEST) {
+ } else if (position == PositionConstants.WEST) {
translationDimension.width = -xFactorValue;
- } else if(position == PositionConstants.NORTH) {
+ } else if (position == PositionConstants.NORTH) {
translationDimension.height = -yFactorValue;
}
return translationDimension;
@@ -649,9 +655,9 @@ public class MessageRouter extends ObliqueRouter {
/**
* Target bounding rectangle relative to connection figure coordinates
- *
+ *
* @param conn
- * connection
+ * connection
* @return <code>PrecisionRectangle</code> target bounds relative to connection's coordinate
* system
*/
@@ -665,24 +671,24 @@ public class MessageRouter extends ObliqueRouter {
/**
* Iterates through points of a polyline and does the following:
* if 3 points lie on the same line the middle point is removed
- *
+ *
* @param line
- * polyline's points
+ * polyline's points
*/
private boolean removeRedundantPoints(PointList line) {
int initialNumberOfPoints = line.size();
- if(line.size() > 2) {
+ if (line.size() > 2) {
PointList newLine = new PointList(line.size());
newLine.addPoint(line.removePoint(0));
- while(line.size() >= 2) {
+ while (line.size() >= 2) {
Point p0 = newLine.getLastPoint();
Point p1 = line.getPoint(0);
Point p2 = line.getPoint(1);
- if(p0.x == p1.x && p0.x == p2.x) {
+ if (p0.x == p1.x && p0.x == p2.x) {
// Have two vertical segments in a row
// get rid of the point between
line.removePoint(0);
- } else if(p0.y == p1.y && p0.y == p2.y) {
+ } else if (p0.y == p1.y && p0.y == p2.y) {
// Have two horizontal segments in a row
// get rid of the point between
line.removePoint(0);
@@ -690,7 +696,7 @@ public class MessageRouter extends ObliqueRouter {
newLine.addPoint(line.removePoint(0));
}
}
- while(line.size() > 0) {
+ while (line.size() > 0) {
newLine.addPoint(line.removePoint(0));
}
line.removeAllPoints();
@@ -702,14 +708,14 @@ public class MessageRouter extends ObliqueRouter {
/**
* Determines whether the rectilinear line segment coming out of the shape should be
* horizontal or vertical based on the anchor geographic position relative to the shape
- *
+ *
* @param anchorRelativeLocation
* @return
*/
private int getOffShapeDirection(int anchorRelativeLocation) {
- if(anchorRelativeLocation == PositionConstants.EAST || anchorRelativeLocation == PositionConstants.WEST) {
+ if (anchorRelativeLocation == PositionConstants.EAST || anchorRelativeLocation == PositionConstants.WEST) {
return PositionConstants.HORIZONTAL;
- } else if(anchorRelativeLocation == PositionConstants.NORTH || anchorRelativeLocation == PositionConstants.SOUTH) {
+ } else if (anchorRelativeLocation == PositionConstants.NORTH || anchorRelativeLocation == PositionConstants.SOUTH) {
return PositionConstants.VERTICAL;
}
return PositionConstants.NONE;
@@ -717,9 +723,9 @@ public class MessageRouter extends ObliqueRouter {
/**
* Source bounding rectangle relative to connection figure coordinates
- *
+ *
* @param conn
- * connection
+ * connection
* @return <code>PrecisionRectangle</code> source bounds relative to connection's coordinate
* system
*/
@@ -737,28 +743,28 @@ public class MessageRouter extends ObliqueRouter {
* Method used to determine which side of shape's bounding rectangle is closer
* to connection's anchor point.
* All geometric quantities must be in the same coordinate system.
- *
+ *
* @param anchorPoint
- * location of the anchor point
+ * location of the anchor point
* @param rect
- * bounding rectangle of the shape
+ * bounding rectangle of the shape
* @return
*/
private int getAnchorOffRectangleDirection(Point anchorPoint, Rectangle rect) {
int position = PositionConstants.NORTH;
int criteriaValue = Math.abs(anchorPoint.y - rect.y);
int tempCriteria = Math.abs(anchorPoint.y - rect.y - rect.height);
- if(tempCriteria < criteriaValue) {
+ if (tempCriteria < criteriaValue) {
criteriaValue = tempCriteria;
position = PositionConstants.SOUTH;
}
tempCriteria = Math.abs(anchorPoint.x - rect.x);
- if(tempCriteria < criteriaValue) {
+ if (tempCriteria < criteriaValue) {
criteriaValue = tempCriteria;
position = PositionConstants.WEST;
}
tempCriteria = Math.abs(anchorPoint.x - rect.x - rect.width);
- if(tempCriteria < criteriaValue) {
+ if (tempCriteria < criteriaValue) {
criteriaValue = tempCriteria;
position = PositionConstants.EAST;
}
@@ -767,8 +773,8 @@ public class MessageRouter extends ObliqueRouter {
/**
* @param conn
- * the <code>Connection</code> that is to be check if it is a feedback
- * connection or not.
+ * the <code>Connection</code> that is to be check if it is a feedback
+ * connection or not.
* @return <code>true</code> is it is a feedback connection, <code>false</code> otherwise.
*/
private static boolean isFeedback(Connection conn) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/AnchorHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/AnchorHelper.java
index 007dadd0125..fa1de4c84a4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/AnchorHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/AnchorHelper.java
@@ -27,21 +27,25 @@ import org.eclipse.gmf.runtime.notation.IdentityAnchor;
public class AnchorHelper {
public static String getAnchorId(TransactionalEditingDomain domain, ConnectionEditPart connEditPart, final boolean isSource) {
- final org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart connection = (org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart)connEditPart;
+ final org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart connection = (org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart) connEditPart;
String t = ""; //$NON-NLS-1$
try {
- t = (String)domain.runExclusive(new RunnableWithResult.Impl() {
+ t = (String) domain.runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
Anchor a = null;
- if(isSource)
- a = ((Edge)connection.getModel()).getSourceAnchor();
- else
- a = ((Edge)connection.getModel()).getTargetAnchor();
- if(a instanceof IdentityAnchor)
- setResult(((IdentityAnchor)a).getId());
- else
+ if (isSource) {
+ a = ((Edge) connection.getModel()).getSourceAnchor();
+ } else {
+ a = ((Edge) connection.getModel()).getTargetAnchor();
+ }
+ if (a instanceof IdentityAnchor) {
+ setResult(((IdentityAnchor) a).getId());
+ }
+ else {
setResult(""); //$NON-NLS-1$
+ }
}
});
} catch (InterruptedException e) {
@@ -51,13 +55,13 @@ public class AnchorHelper {
}
public static Point getRequestLocation(Request request) {
- if(request instanceof ReconnectRequest) {
- if(((DropRequest)request).getLocation() != null) {
- Point pt = ((DropRequest)request).getLocation().getCopy();
+ if (request instanceof ReconnectRequest) {
+ if (((DropRequest) request).getLocation() != null) {
+ Point pt = ((DropRequest) request).getLocation().getCopy();
return pt;
}
- } else if(request instanceof DropRequest) {
- return ((DropRequest)request).getLocation();
+ } else if (request instanceof DropRequest) {
+ return ((DropRequest) request).getLocation();
}
return null;
}
@@ -68,11 +72,13 @@ public class AnchorHelper {
super(width, height);
}
+ @Override
protected ConnectionAnchor createAnchor(PrecisionPoint p) {
- if(p == null)
+ if (p == null) {
// If the old terminal for the connection anchor cannot be resolved (by SlidableAnchor) a null
// PrecisionPoint will passed in - this is handled here
return createDefaultAnchor();
+ }
return new CombinedFragmentAnchor(this, p);
}
}
@@ -80,7 +86,7 @@ public class AnchorHelper {
/**
* Fixed bug about Connect to/from outside elements, we should use default
* features to avoid interactions.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public static class CombinedFragmentAnchor extends SlidableAnchor {
@@ -89,21 +95,22 @@ public class AnchorHelper {
super(fig, p);
}
+ @Override
protected Point getLocation(Point ownReference, Point foreignReference) {
Rectangle rect = getOwner().getBounds().getCopy();
getOwner().translateToAbsolute(rect);
- if(!rect.contains(foreignReference)) {
+ if (!rect.contains(foreignReference)) {
return super.getLocation(ownReference, foreignReference);
}
PointList intersections = getIntersectionPoints(ownReference, foreignReference);
- if(intersections != null && intersections.size() > 0) {
+ if (intersections != null && intersections.size() > 0) {
int size = intersections.size();
Point near = intersections.getPoint(0);
double dist = ownReference.getDistance(near);
- for(int i = 1; i < size; i++) {
+ for (int i = 1; i < size; i++) {
Point loc = intersections.getPoint(i);
double d = ownReference.getDistance(loc);
- if(d < dist) {
+ if (d < dist) {
dist = d;
near = loc;
}
@@ -124,16 +131,17 @@ public class AnchorHelper {
super(fig);
}
+ @Override
protected Point getLocation(Point ownReference, Point foreignReference) {
PointList intersections = getIntersectionPoints(ownReference, foreignReference);
- if(intersections != null && intersections.size() > 0) {
+ if (intersections != null && intersections.size() > 0) {
int size = intersections.size();
Point near = intersections.getPoint(0);
double dist = ownReference.getDistance(near);
- for(int i = 1; i < size; i++) {
+ for (int i = 1; i < size; i++) {
Point loc = intersections.getPoint(i);
double d = ownReference.getDistance(loc);
- if(d < dist) {
+ if (d < dist) {
dist = d;
near = loc;
}
@@ -142,17 +150,17 @@ public class AnchorHelper {
}
return null;
}
- // private boolean isInOrder(Point start, Point end, double dist, Point loc) {
- // double total = loc.getDistance(start);
- // double dist2 = loc.getDistance(end);
- // if(total < dist || total < dist2)
- // return false;
- //
- // if(Math.abs(total - dist - dist2) < 0.01)
- // return true;
- //
- // return false;
- // }
+ // private boolean isInOrder(Point start, Point end, double dist, Point loc) {
+ // double total = loc.getDistance(start);
+ // double dist2 = loc.getDistance(end);
+ // if(total < dist || total < dist2)
+ // return false;
+ //
+ // if(Math.abs(total - dist - dist2) < 0.01)
+ // return true;
+ //
+ // return false;
+ // }
}
public static class FixedAnchorEx extends SlidableAnchor {
@@ -164,19 +172,22 @@ public class AnchorHelper {
this.position = location;
}
+ @Override
public Point getLocation(Point reference) {
- if(position == PositionConstants.TOP) {
+ if (position == PositionConstants.TOP) {
Point topLeft = getBox().getTopLeft();
- if(reference.x < topLeft.x)
+ if (reference.x < topLeft.x) {
return topLeft;
- else
+ } else {
return getBox().getTopRight();
- } else if(position == PositionConstants.BOTTOM) {
+ }
+ } else if (position == PositionConstants.BOTTOM) {
Point bottomLeft = getBox().getBottomLeft();
- if(reference.x < bottomLeft.x)
+ if (reference.x < bottomLeft.x) {
return bottomLeft;
- else
+ } else {
return getBox().getBottomRight();
+ }
}
return super.getLocation(reference);
}
@@ -191,12 +202,12 @@ public class AnchorHelper {
}
public static int parsePosition(String terminal) {
- if(terminal == null) {
+ if (terminal == null) {
return -1;
}
int start = terminal.indexOf("{");
int end = terminal.indexOf("}");
- if(start != -1 && end != -1 && end > (start + 1)) {
+ if (start != -1 && end != -1 && end > (start + 1)) {
String v = terminal.substring(start + 1, end);
try {
return Integer.parseInt(v);
@@ -220,6 +231,7 @@ public class AnchorHelper {
return isRight;
}
+ @Override
public String getTerminal() {
String side = isRight ? "R" : "L";
return super.getTerminal() + "{" + side + "}";
@@ -228,12 +240,12 @@ public class AnchorHelper {
/**
* Changed by Jin Liu.
- *
+ *
* Since the Interaction figure would be always resized to show all children, which has a minimum size calculated by all children.
* The size of it would be changed automatically, the real location of the anchor would be get wrong.
- *
+ *
* Now, we use the location directly to avoid preserve position when the size of referenced figure changes.
- *
+ *
*/
public static class InnerPointAnchor extends SlidableAnchor {
@@ -249,16 +261,17 @@ public class AnchorHelper {
public static InnerPointAnchor createAnchorAtLocation(IFigure fig, PrecisionPoint loc) {
PrecisionPoint p = loc.getPreciseCopy();
- // Rectangle b = fig.getBounds().getCopy();
- // fig.translateToAbsolute(b);
- // Dimension d = p.getDifference(b.getTopLeft());
- // PrecisionPoint per = new PrecisionPoint(d.preciseWidth() / b.width, d.preciseHeight() / b.height);
+ // Rectangle b = fig.getBounds().getCopy();
+ // fig.translateToAbsolute(b);
+ // Dimension d = p.getDifference(b.getTopLeft());
+ // PrecisionPoint per = new PrecisionPoint(d.preciseWidth() / b.width, d.preciseHeight() / b.height);
fig.translateToRelative(p);
return new InnerPointAnchor(fig, p);
}
+ @Override
protected Point getLocation(Point ownReference, Point foreignReference) {
- if((percent.preciseX() < 1 && percent.preciseX() > 0) || (percent.preciseY() > 0 && percent.preciseY() < 1)) {
+ if ((percent.preciseX() < 1 && percent.preciseX() > 0) || (percent.preciseY() > 0 && percent.preciseY() < 1)) {
PrecisionRectangle bounds = new PrecisionRectangle(figure.getBounds());
bounds.setPreciseWidth((bounds.width * percent.preciseX()));
bounds.setPreciseHeight((bounds.height * percent.preciseY()));
@@ -271,7 +284,7 @@ public class AnchorHelper {
@Override
public Point getReferencePoint() {
- if((percent.preciseX() < 1 && percent.preciseX() > 0) || (percent.preciseY() > 0 && percent.preciseY() < 1)) {
+ if ((percent.preciseX() < 1 && percent.preciseX() > 0) || (percent.preciseY() > 0 && percent.preciseY() < 1)) {
return super.getReferencePoint();
}
Point copy = percent.getCopy();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/MessageLabelHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/MessageLabelHelper.java
index 590f7f801dd..442ed70be38 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/MessageLabelHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/MessageLabelHelper.java
@@ -57,7 +57,7 @@ public class MessageLabelHelper extends StereotypedElementLabelHelper {
* @return the singleton instance.
*/
public static MessageLabelHelper getInstance() {
- if(labelHelper == null) {
+ if (labelHelper == null) {
labelHelper = new MessageLabelHelper();
}
return labelHelper;
@@ -65,33 +65,33 @@ public class MessageLabelHelper extends StereotypedElementLabelHelper {
@Override
public Message getUMLElement(GraphicalEditPart editPart) {
- EObject e = ((View)editPart.getModel()).getElement();
- if(e instanceof Message) {
- return ((Message)e);
+ EObject e = ((View) editPart.getModel()).getElement();
+ if (e instanceof Message) {
+ return ((Message) e);
}
return null;
}
@Override
protected String elementLabel(GraphicalEditPart editPart) {
- if(editPart instanceof LabelEditPart) {
- editPart = (GraphicalEditPart)editPart.getParent();
+ if (editPart instanceof LabelEditPart) {
+ editPart = (GraphicalEditPart) editPart.getParent();
}
Collection<String> displayValue = DEFAULT_LABEL_DISPLAY;
- IMaskManagedLabelEditPolicy policy = (IMaskManagedLabelEditPolicy)editPart.getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(policy != null) {
+ IMaskManagedLabelEditPolicy policy = (IMaskManagedLabelEditPolicy) editPart.getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if (policy != null) {
displayValue = policy.getCurrentDisplayValue();
}
Message e = getUMLElement(editPart);
- if(e == null) {
+ if (e == null) {
return null;
}
NamedElement signature = e.getSignature();
- if(signature instanceof Operation) {
- return OperationUtil.getCustomLabel(e, (Operation)signature, displayValue);
- } else if(signature instanceof Signal) {
- return SignalUtil.getCustomLabel(e, (Signal)signature, displayValue);
- } else if(signature != null) {
+ if (signature instanceof Operation) {
+ return OperationUtil.getCustomLabel(e, (Operation) signature, displayValue);
+ } else if (signature instanceof Signal) {
+ return SignalUtil.getCustomLabel(e, (Signal) signature, displayValue);
+ } else if (signature != null) {
return signature.getName();
}
// signature is null
@@ -103,35 +103,35 @@ public class MessageLabelHelper extends StereotypedElementLabelHelper {
buffer.append(message.getName());
// parameters : '(' parameter-list ')'
EList<ValueSpecification> arguments = message.getArguments();
- if(arguments.size() > 0 && (displayValue.contains(ICustomAppearance.DISP_PARAMETER_NAME) || displayValue.contains(ICustomAppearance.DISP_DERIVE))) {
+ if (arguments.size() > 0 && (displayValue.contains(ICustomAppearance.DISP_PARAMETER_NAME) || displayValue.contains(ICustomAppearance.DISP_DERIVE))) {
buffer.append("(");
- for(int i = 0; i < arguments.size(); i++) {
- if(i > 0) {
+ for (int i = 0; i < arguments.size(); i++) {
+ if (i > 0) {
buffer.append(", ");
}
ValueSpecification arg = arguments.get(i);
- //type
- if(displayValue.contains(ICustomAppearance.DISP_PARAMETER_TYPE)) {
+ // type
+ if (displayValue.contains(ICustomAppearance.DISP_PARAMETER_TYPE)) {
String type = TypedElementUtil.getTypeAsString(arg);
- if(type != null) {
+ if (type != null) {
buffer.append(type);
}
}
boolean showEqualMark = false;
// name
- if(displayValue.contains(ICustomAppearance.DISP_PARAMETER_NAME)) {
+ if (displayValue.contains(ICustomAppearance.DISP_PARAMETER_NAME)) {
buffer.append(" ");
String name = StringHelper.trimToEmpty(arg.getName());
buffer.append(name);
- if(name.trim().length() > 0) {
+ if (name.trim().length() > 0) {
showEqualMark = true;
}
}
// value
- if(displayValue.contains(ICustomAppearance.DISP_DERIVE)) {
+ if (displayValue.contains(ICustomAppearance.DISP_DERIVE)) {
String value = ValueSpecificationUtil.getSpecificationValue(arg);
- if(value != null) {
- if(showEqualMark) {
+ if (value != null) {
+ if (showEqualMark) {
buffer.append(" = ");
}
buffer.append(value);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/advice/ConstraintHelperAdvice.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/advice/ConstraintHelperAdvice.java
index b0d95770ba0..ad3f5faae9b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/advice/ConstraintHelperAdvice.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/advice/ConstraintHelperAdvice.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* 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
@@ -53,46 +53,46 @@ public class ConstraintHelperAdvice extends AbstractEditHelperAdvice {
protected ICommand getAfterSetCommand(SetRequest request) {
EObject element = request.getElementToEdit();
View view = findView(element);
- if(view != null) {
- if(element instanceof Constraint) {
+ if (view != null) {
+ if (element instanceof Constraint) {
EStructuralFeature feature = request.getFeature();
final Object value = request.getValue();
Vector<Edge> edgesToDestroy = new Vector<Edge>();
Element targetContextElement = null;
- if(UMLPackage.eINSTANCE.getConstraint_Context().equals(feature)) {
- Namespace constraintContext = ((Constraint)element).getContext();
- if(constraintContext == value) {
+ if (UMLPackage.eINSTANCE.getConstraint_Context().equals(feature)) {
+ Namespace constraintContext = ((Constraint) element).getContext();
+ if (constraintContext == value) {
// if the new value to set is the already context value
// then do noting
return null;
}
targetContextElement = constraintContext;
- if(targetContextElement != null) {
+ if (targetContextElement != null) {
View target = findView(targetContextElement);
List sourceConnections = ViewUtil.getSourceConnections(view);
- for(Object connector : sourceConnections) {
- if(!(connector instanceof Connector)) {
+ for (Object connector : sourceConnections) {
+ if (!(connector instanceof Connector)) {
continue;
}
- Edge edge = (Edge)connector;
- if(("" + ContextLinkEditPart.VISUAL_ID).equals(edge.getType())) {
- if(target.getElement() == edge.getTarget().getElement()) {
+ Edge edge = (Edge) connector;
+ if (("" + ContextLinkEditPart.VISUAL_ID).equals(edge.getType())) {
+ if (target.getElement() == edge.getTarget().getElement()) {
edgesToDestroy.add(edge);
}
}
}
}
- if(!edgesToDestroy.isEmpty()) {
+ if (!edgesToDestroy.isEmpty()) {
CompositeCommand command = new CompositeCommand("Clear context links");
- for(Iterator iterator = edgesToDestroy.iterator(); iterator.hasNext();) {
- Edge edgeToDestroy = (Edge)iterator.next();
+ for (Iterator iterator = edgesToDestroy.iterator(); iterator.hasNext();) {
+ Edge edgeToDestroy = (Edge) iterator.next();
TransactionalEditingDomain editingDomain = request.getEditingDomain();
DestroyElementRequest destroy = new DestroyElementRequest(editingDomain, edgeToDestroy, false);
Object eHelperContext = destroy.getEditHelperContext();
IElementType context = ElementTypeRegistry.getInstance().getElementType(eHelperContext);
- if(context != null) {
+ if (context != null) {
ICommand result = context.getEditCommand(destroy);
- if(result != null) {
+ if (result != null) {
command.add(result);
}
}
@@ -106,14 +106,14 @@ public class ConstraintHelperAdvice extends AbstractEditHelperAdvice {
}
private View findView(EObject element) {
- if(element == null) {
+ if (element == null) {
return null;
}
Collection<Setting> settings = CacheAdapter.getInstance().getNonNavigableInverseReferences(element);
- for(Setting ref : settings) {
- if(NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
- View view = (View)ref.getEObject();
- if(view != null) {
+ for (Setting ref : settings) {
+ if (NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
+ View view = (View) ref.getEObject();
+ if (view != null) {
return view;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/advice/NamespaceHelperAdvice.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/advice/NamespaceHelperAdvice.java
index 7966a4c362e..b1752c1038f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/advice/NamespaceHelperAdvice.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/advice/NamespaceHelperAdvice.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* 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
@@ -48,24 +48,24 @@ public class NamespaceHelperAdvice extends AbstractEditHelperAdvice {
@Override
protected ICommand getAfterMoveCommand(MoveRequest request) {
EObject element = request.getTargetContainer();
- if(element instanceof Namespace) {
+ if (element instanceof Namespace) {
// EStructuralFeature feature = request.getTargetFeature(element);
Map elemsToMove = request.getElementsToMove();
Edge edgeToDestroy = null;
- for(Iterator value = elemsToMove.keySet().iterator(); value.hasNext();) {
- Object object = (Object)value.next();
- if(object instanceof Constraint) {
- if(UMLPackage.eINSTANCE.getNamespace_OwnedRule().equals(elemsToMove.get(object))) {
- View viewConstraint = findView((Constraint)object);
+ for (Iterator value = elemsToMove.keySet().iterator(); value.hasNext();) {
+ Object object = value.next();
+ if (object instanceof Constraint) {
+ if (UMLPackage.eINSTANCE.getNamespace_OwnedRule().equals(elemsToMove.get(object))) {
+ View viewConstraint = findView((Constraint) object);
List sourceConnections = ViewUtil.getSourceConnections(viewConstraint);
- for(Object connector : sourceConnections) {
- if(!(connector instanceof Edge)) {
+ for (Object connector : sourceConnections) {
+ if (!(connector instanceof Edge)) {
continue;
}
- Edge edge = (Edge)connector;
+ Edge edge = (Edge) connector;
EObject targetElem = edge.getTarget().getElement();
- if(targetElem instanceof Namespace) {
- if(((Namespace)targetElem).getOwnedRules().contains((Constraint)object)) {
+ if (targetElem instanceof Namespace) {
+ if (((Namespace) targetElem).getOwnedRules().contains(object)) {
edgeToDestroy = edge;
break;
}
@@ -74,15 +74,15 @@ public class NamespaceHelperAdvice extends AbstractEditHelperAdvice {
}
}
}
- if(edgeToDestroy != null) {
+ if (edgeToDestroy != null) {
TransactionalEditingDomain editingDomain = request.getEditingDomain();
CompositeCommand command = new CompositeCommand("Clear owned rule link");
DestroyElementRequest destroy = new DestroyElementRequest(editingDomain, edgeToDestroy, false);
Object eHelperContext = destroy.getEditHelperContext();
IElementType context = ElementTypeRegistry.getInstance().getElementType(eHelperContext);
- if(context != null) {
+ if (context != null) {
ICommand result = context.getEditCommand(destroy);
- if(result != null) {
+ if (result != null) {
command.add(result);
}
}
@@ -93,14 +93,14 @@ public class NamespaceHelperAdvice extends AbstractEditHelperAdvice {
}
private View findView(EObject element) {
- if(element == null) {
+ if (element == null) {
return null;
}
Collection<Setting> settings = CacheAdapter.getInstance().getNonNavigableInverseReferences(element);
- for(Setting ref : settings) {
- if(NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
- View view = (View)ref.getEObject();
- if(view != null) {
+ for (Setting ref : settings) {
+ if (NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
+ View view = (View) ref.getEObject();
+ if (view != null) {
return view;
}
}
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 ecaf1e9602c..e5a8094652d 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
@@ -67,7 +67,7 @@ import org.eclipse.uml2.uml.UMLPackage;
/**
* Add implementing IPapyrusEditPart to displaying Stereotypes.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public abstract class AbstractExecutionSpecificationEditPart extends ShapeNodeEditPart implements IPapyrusEditPart {
@@ -82,7 +82,7 @@ public abstract class AbstractExecutionSpecificationEditPart extends ShapeNodeEd
@Override
public List getChildren() {
- if(executionSpecificationEndParts == null) {
+ if (executionSpecificationEndParts == null) {
initExecutionSpecificationEndEditPart();
}
return super.getChildren();
@@ -90,16 +90,16 @@ public abstract class AbstractExecutionSpecificationEditPart extends ShapeNodeEd
protected void initExecutionSpecificationEndEditPart() {
EObject element = this.resolveSemanticElement();
- if(!(element instanceof ExecutionSpecification)) {
+ if (!(element instanceof ExecutionSpecification)) {
return;
}
executionSpecificationEndParts = new ArrayList<ExecutionSpecificationEndEditPart>();
- ExecutionSpecification execution = (ExecutionSpecification)element;
+ ExecutionSpecification execution = (ExecutionSpecification) element;
final ExecutionSpecificationEndEditPart startPart = new ExecutionSpecificationEndEditPart(execution.getStart(), this, new RelativeLocator(getFigure(), PositionConstants.NORTH));
executionSpecificationEndParts.add(startPart);
final ExecutionSpecificationEndEditPart finishPart = new ExecutionSpecificationEndEditPart(execution.getFinish(), this, new RelativeLocator(getFigure(), PositionConstants.SOUTH));
executionSpecificationEndParts.add(finishPart);
- Diagram diagram = ((View)this.getModel()).getDiagram();
+ Diagram diagram = ((View) this.getModel()).getDiagram();
startPart.rebuildLinks(diagram);
finishPart.rebuildLinks(diagram);
addChild(startPart, -1);
@@ -108,6 +108,7 @@ public abstract class AbstractExecutionSpecificationEditPart extends ShapeNodeEd
static class FillParentLocator implements Locator {
+ @Override
public void relocate(IFigure target) {
target.setBounds(target.getParent().getBounds());
}
@@ -116,7 +117,7 @@ public abstract class AbstractExecutionSpecificationEditPart extends ShapeNodeEd
/**
* Overrides to disable the defaultAnchorArea. The edge is now more stuck with the middle of the
* figure.
- *
+ *
*/
protected NodeFigure createNodePlate() {
DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(16, 60) {
@@ -140,21 +141,21 @@ public abstract class AbstractExecutionSpecificationEditPart extends ShapeNodeEd
@Override
protected Command getResizeCommand(ChangeBoundsRequest request) {
- // Bugfix: Avoid resize ES with the child size is little than parent one.
+ // Bugfix: Avoid resize ES with the child size is little than parent one.
EditPart host = getHost();
- List<ShapeNodeEditPart> movedChildrenParts = LifelineXYLayoutEditPolicy.getAffixedExecutionSpecificationEditParts((ShapeNodeEditPart)host);
+ List<ShapeNodeEditPart> movedChildrenParts = LifelineXYLayoutEditPolicy.getAffixedExecutionSpecificationEditParts((ShapeNodeEditPart) host);
Rectangle r = getInitialFeedbackBounds().getCopy();
getHostFigure().translateToAbsolute(r);
r.translate(0, request.getMoveDelta().y);
r.resize(0, request.getSizeDelta().height);
- for(ShapeNodeEditPart child : movedChildrenParts) {
+ for (ShapeNodeEditPart child : movedChildrenParts) {
IFigure figure = child.getFigure();
Rectangle rect = figure.getBounds().getCopy();
- if(figure instanceof HandleBounds) {
- rect = ((HandleBounds)figure).getBounds().getCopy();
+ if (figure instanceof HandleBounds) {
+ rect = ((HandleBounds) figure).getBounds().getCopy();
}
figure.translateToAbsolute(rect);
- if(rect.y < (r.y) || r.bottom() < (rect.y)) {
+ if (rect.y < (r.y) || r.bottom() < (rect.y)) {
return UnexecutableCommand.INSTANCE;
}
}
@@ -178,29 +179,29 @@ public abstract class AbstractExecutionSpecificationEditPart extends ShapeNodeEd
Rectangle originalBounds = rect.getCopy();
rect.translate(request.getMoveDelta());
rect.resize(request.getSizeDelta());
- if(min.width > rect.width) {
+ if (min.width > rect.width) {
rect.width = min.width;
- } else if(max.width < rect.width) {
+ } else if (max.width < rect.width) {
rect.width = max.width;
}
- if(min.height > rect.height) {
+ if (min.height > rect.height) {
rect.height = min.height;
- } else if(max.height < rect.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
+ 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
+ if (request.getSizeDelta().height == 0) { // moving
EditPart parentBar = moveExecutionSpecificationFeedback(request, AbstractExecutionSpecificationEditPart.this, rect);
- if(parentBar == null) {
+ if (parentBar == null) {
parentBar = getParent();
}
- //Highlight the parentBar when perform moving.
+ // Highlight the parentBar when perform moving.
HighlightUtil.unhighlight();
HighlightUtil.highlight(parentBar);
}
@@ -214,19 +215,19 @@ public abstract class AbstractExecutionSpecificationEditPart extends ShapeNodeEd
HighlightUtil.unhighlight();
}
});
- //install a editpolicy to display stereotypes
+ // install a editpolicy to display stereotypes
installEditPolicy(AppliedStereotypeCommentCreationEditPolicy.APPLIED_STEREOTYPE_COMMENT, new AppliedStereotypeCommentCreationEditPolicyEx());
}
@Override
protected void setLineWidth(int width) {
- if(getPrimaryShape() instanceof NodeFigure) {
- ((NodeFigure)getPrimaryShape()).setLineWidth(width);
+ if (getPrimaryShape() instanceof NodeFigure) {
+ ((NodeFigure) getPrimaryShape()).setLineWidth(width);
}
}
protected final void refreshShadow() {
- getPrimaryShape().setShadow(AppearanceHelper.showShadow((View)getModel()));
+ getPrimaryShape().setShadow(AppearanceHelper.showShadow((View) getModel()));
}
/**
@@ -239,9 +240,9 @@ public abstract class AbstractExecutionSpecificationEditPart extends ShapeNodeEd
/**
* sets the back ground color of this edit part
- *
+ *
* @param color
- * the new value of the back ground color
+ * the new value of the back ground color
*/
@Override
protected void setBackgroundColor(Color color) {
@@ -256,8 +257,8 @@ public abstract class AbstractExecutionSpecificationEditPart extends ShapeNodeEd
@Override
protected void setGradient(GradientData gradient) {
IPapyrusNodeFigure fig = getPrimaryShape();
- FillStyle style = (FillStyle)getPrimaryView().getStyle(NotationPackage.Literals.FILL_STYLE);
- if(gradient != null) {
+ FillStyle style = (FillStyle) getPrimaryView().getStyle(NotationPackage.Literals.FILL_STYLE);
+ if (gradient != null) {
fig.setIsUsingGradient(true);
fig.setGradientData(style.getFillColor(), gradient.getGradientColor1(), gradient.getGradientStyle());
} else {
@@ -274,18 +275,19 @@ public abstract class AbstractExecutionSpecificationEditPart extends ShapeNodeEd
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)) {
+ if ((getModel() != null) && (getModel() == event.getNotifier())) {
+ if (NotationPackage.eINSTANCE.getLineStyle_LineWidth().equals(feature)) {
refreshLineWidth();
- } else if(NotationPackage.eINSTANCE.getLineTypeStyle_LineType().equals(feature)) {
+ } 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)) {
+ } 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((EditPart)child);
+ } 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;
@@ -295,7 +297,7 @@ public abstract class AbstractExecutionSpecificationEditPart extends ShapeNodeEd
refreshShadow();
}
- public class ExecutionSpecificationRectangleFigure extends PapyrusNodeFigure { //RectangleFigure {
+ public class ExecutionSpecificationRectangleFigure extends PapyrusNodeFigure { // RectangleFigure {
public ExecutionSpecificationRectangleFigure() {
this.setPreferredSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(60)));
@@ -306,13 +308,13 @@ public abstract class AbstractExecutionSpecificationEditPart extends ShapeNodeEd
public IFigure findMouseEventTargetAt(int x, int y) {
// check children first instead of self
IFigure f = findMouseEventTargetInDescendantsAt(x, y);
- if(f != null) {
+ if (f != null) {
return f;
}
- if(!containsPoint(x, y)) {
+ if (!containsPoint(x, y)) {
return null;
}
- if(isMouseEventTarget()) {
+ if (isMouseEventTarget()) {
return this;
}
return null;
@@ -320,28 +322,29 @@ public abstract class AbstractExecutionSpecificationEditPart extends ShapeNodeEd
@Override
public IFigure findFigureAt(int x, int y, TreeSearch search) {
- if(search.prune(this)) {
+ if (search.prune(this)) {
return null;
}
IFigure child = findDescendantAtExcluding(x, y, search);
- if(child != null) {
+ if (child != null) {
return child;
}
- if(!containsPoint(x, y)) {
+ if (!containsPoint(x, y)) {
return null;
}
- if(search.accept(this)) {
+ if (search.accept(this)) {
return this;
}
return null;
}
}
+ @Override
public abstract ExecutionSpecificationRectangleFigure getPrimaryShape();
- //see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=385604
+ // 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();
+ CustomLifelineEditPart lifelineEP = (CustomLifelineEditPart) movedPart.getParent();
Rectangle copy = rect.getCopy();
lifelineEP.getPrimaryShape().translateToRelative(copy);
List<ShapeNodeEditPart> executionSpecificationList = LifelineEditPartUtil.getChildShapeNodeEditPart(lifelineEP);
@@ -351,14 +354,14 @@ public abstract class AbstractExecutionSpecificationEditPart extends ShapeNodeEd
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
+ 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()) {
+ 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
@@ -368,7 +371,7 @@ public abstract class AbstractExecutionSpecificationEditPart extends ShapeNodeEd
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) {
+ if (part == parentBar) {
break;
} else {
// if overlaps, go on moving the bar to next x position
@@ -384,7 +387,7 @@ public abstract class AbstractExecutionSpecificationEditPart extends ShapeNodeEd
*/
@Override
public Command getCommand(Request request) {
- if(request instanceof CreateUnspecifiedTypeRequest) {
+ if (request instanceof CreateUnspecifiedTypeRequest) {
return getParent().getCommand(request);
}
return super.getCommand(request);
@@ -395,7 +398,7 @@ public abstract class AbstractExecutionSpecificationEditPart extends ShapeNodeEd
*/
@Override
public void showSourceFeedback(Request request) {
- if(request instanceof CreateUnspecifiedTypeRequest) {
+ if (request instanceof CreateUnspecifiedTypeRequest) {
getParent().showSourceFeedback(request);
}
super.showSourceFeedback(request);
@@ -406,7 +409,7 @@ public abstract class AbstractExecutionSpecificationEditPart extends ShapeNodeEd
*/
@Override
public void eraseSourceFeedback(Request request) {
- if(request instanceof CreateUnspecifiedTypeRequest) {
+ if (request instanceof CreateUnspecifiedTypeRequest) {
getParent().eraseSourceFeedback(request);
}
super.eraseSourceFeedback(request);
@@ -414,7 +417,7 @@ public abstract class AbstractExecutionSpecificationEditPart extends ShapeNodeEd
@Override
public void showTargetFeedback(Request request) {
- if(request instanceof CreateUnspecifiedTypeRequest) {
+ if (request instanceof CreateUnspecifiedTypeRequest) {
getParent().showTargetFeedback(request);
}
super.showTargetFeedback(request);
@@ -422,7 +425,7 @@ public abstract class AbstractExecutionSpecificationEditPart extends ShapeNodeEd
@Override
public void eraseTargetFeedback(Request request) {
- if(request instanceof CreateUnspecifiedTypeRequest) {
+ if (request instanceof CreateUnspecifiedTypeRequest) {
getParent().eraseTargetFeedback(request);
}
super.eraseTargetFeedback(request);
@@ -434,36 +437,36 @@ public abstract class AbstractExecutionSpecificationEditPart extends ShapeNodeEd
@Override
public ConnectionAnchor getTargetConnectionAnchor(Request request) {
Object fixPos = request.getExtendedData().get(EXECUTION_FIX_ANCHOR_POSITION);
- if(fixPos != null && (fixPos.equals(PositionConstants.TOP) || fixPos.equals(PositionConstants.BOTTOM))) {
- return new AnchorHelper.FixedAnchorEx(getFigure(), (Integer)fixPos);
+ if (fixPos != null && (fixPos.equals(PositionConstants.TOP) || fixPos.equals(PositionConstants.BOTTOM))) {
+ return new AnchorHelper.FixedAnchorEx(getFigure(), (Integer) fixPos);
}
- if(request instanceof CreateUnspecifiedTypeConnectionRequest) {
- CreateUnspecifiedTypeConnectionRequest createRequest = (CreateUnspecifiedTypeConnectionRequest)request;
+ if (request instanceof CreateUnspecifiedTypeConnectionRequest) {
+ CreateUnspecifiedTypeConnectionRequest createRequest = (CreateUnspecifiedTypeConnectionRequest) request;
List<?> relationshipTypes = createRequest.getElementTypes();
- for(Object obj : relationshipTypes) {
- if(UMLElementTypes.Message_4003.equals(obj)) {
+ for (Object obj : relationshipTypes) {
+ if (UMLElementTypes.Message_4003.equals(obj)) {
// Sync Message
- if(!createRequest.getTargetEditPart().equals(createRequest.getSourceEditPart())) {
+ if (!createRequest.getTargetEditPart().equals(createRequest.getSourceEditPart())) {
return new AnchorHelper.FixedAnchorEx(getFigure(), PositionConstants.TOP);
}
// otherwise, this is a recursive call, let destination free
}
}
- } else if(request instanceof ReconnectRequest) {
- ReconnectRequest reconnectRequest = (ReconnectRequest)request;
+ } else if (request instanceof ReconnectRequest) {
+ ReconnectRequest reconnectRequest = (ReconnectRequest) request;
ConnectionEditPart connectionEditPart = reconnectRequest.getConnectionEditPart();
- if(connectionEditPart instanceof MessageEditPart) {
+ if (connectionEditPart instanceof MessageEditPart) {
// Sync Message
return new AnchorHelper.FixedAnchorEx(getFigure(), PositionConstants.TOP);
}
}
- //Fixed bug about computing target anchor when creating message sync.
- else if(request instanceof CreateConnectionViewRequest) {
- CreateConnectionViewRequest createRequest = (CreateConnectionViewRequest)request;
- ConnectionViewDescriptor viewDesc = ((CreateConnectionViewRequest)request).getConnectionViewDescriptor();
- if(((IHintedType)UMLElementTypes.Message_4003).getSemanticHint().equals(viewDesc.getSemanticHint())) {
+ // Fixed bug about computing target anchor when creating message sync.
+ else if (request instanceof CreateConnectionViewRequest) {
+ CreateConnectionViewRequest createRequest = (CreateConnectionViewRequest) request;
+ ConnectionViewDescriptor viewDesc = ((CreateConnectionViewRequest) request).getConnectionViewDescriptor();
+ if (((IHintedType) UMLElementTypes.Message_4003).getSemanticHint().equals(viewDesc.getSemanticHint())) {
// Sync Message
- if(!createRequest.getTargetEditPart().equals(createRequest.getSourceEditPart())) {
+ if (!createRequest.getTargetEditPart().equals(createRequest.getSourceEditPart())) {
return new AnchorHelper.FixedAnchorEx(getFigure(), PositionConstants.TOP);
}
}
@@ -473,37 +476,40 @@ public abstract class AbstractExecutionSpecificationEditPart extends ShapeNodeEd
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart#getTargetConnectionAnchor(org.eclipse.gef.ConnectionEditPart)
- *
+ *
* @param connEditPart
- * The connection edit part.
+ * The connection edit part.
* @return The anchor.
*/
@Override
public ConnectionAnchor getTargetConnectionAnchor(ConnectionEditPart connEditPart) {
- if(connEditPart instanceof MessageEditPart) {
+ if (connEditPart instanceof MessageEditPart) {
// Sync Message
return new AnchorHelper.FixedAnchorEx(getFigure(), PositionConstants.TOP);
}
- final org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart connection = (org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart)connEditPart;
- String t = null; //$NON-NLS-1$
+ final org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart connection = (org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart) connEditPart;
+ String t = null;
try {
- t = (String)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ t = (String) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- Anchor a = ((Edge)connection.getModel()).getTargetAnchor();
- if(a instanceof IdentityAnchor)
- setResult(((IdentityAnchor)a).getId());
- else
+ Anchor a = ((Edge) connection.getModel()).getTargetAnchor();
+ if (a instanceof IdentityAnchor) {
+ setResult(((IdentityAnchor) a).getId());
+ }
+ else {
setResult(""); //$NON-NLS-1$
+ }
}
});
} catch (InterruptedException e) {
Trace.catching(DiagramUIPlugin.getInstance(), DiagramUIDebugOptions.EXCEPTIONS_CATCHING, getClass(), "getTargetConnectionAnchor", e); //$NON-NLS-1$
Log.error(DiagramUIPlugin.getInstance(), DiagramUIStatusCodes.IGNORED_EXCEPTION_WARNING, "getTargetConnectionAnchor", e); //$NON-NLS-1$
}
- if(t != null && !"".equals(t)) {
+ if (t != null && !"".equals(t)) {
int position = AnchorHelper.FixedAnchorEx.parsePosition(t);
- if(position != -1) {
+ if (position != -1) {
return new AnchorHelper.FixedAnchorEx(getFigure(), position);
}
}
@@ -512,30 +518,30 @@ public abstract class AbstractExecutionSpecificationEditPart extends ShapeNodeEd
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart#getSourceConnectionAnchor(org.eclipse.gef.Request)
- *
+ *
* @param request
- * The request
+ * The request
* @return The anchor
*/
@Override
public ConnectionAnchor getSourceConnectionAnchor(Request request) {
Object fixPos = request.getExtendedData().get(EXECUTION_FIX_ANCHOR_POSITION);
- if(fixPos != null && (fixPos.equals(PositionConstants.TOP) || fixPos.equals(PositionConstants.BOTTOM))) {
- return new AnchorHelper.FixedAnchorEx(getFigure(), (Integer)fixPos);
+ if (fixPos != null && (fixPos.equals(PositionConstants.TOP) || fixPos.equals(PositionConstants.BOTTOM))) {
+ return new AnchorHelper.FixedAnchorEx(getFigure(), (Integer) fixPos);
}
- if(request instanceof CreateUnspecifiedTypeConnectionRequest) {
- CreateUnspecifiedTypeConnectionRequest createRequest = (CreateUnspecifiedTypeConnectionRequest)request;
+ if (request instanceof CreateUnspecifiedTypeConnectionRequest) {
+ CreateUnspecifiedTypeConnectionRequest createRequest = (CreateUnspecifiedTypeConnectionRequest) request;
List<?> relationshipTypes = createRequest.getElementTypes();
- for(Object obj : relationshipTypes) {
- if(UMLElementTypes.Message_4005.equals(obj)) {
+ for (Object obj : relationshipTypes) {
+ if (UMLElementTypes.Message_4005.equals(obj)) {
// Reply Message
return new AnchorHelper.FixedAnchorEx(getFigure(), PositionConstants.BOTTOM);
}
}
- } else if(request instanceof ReconnectRequest) {
- ReconnectRequest reconnectRequest = (ReconnectRequest)request;
+ } else if (request instanceof ReconnectRequest) {
+ ReconnectRequest reconnectRequest = (ReconnectRequest) request;
ConnectionEditPart connectionEditPart = reconnectRequest.getConnectionEditPart();
- if(connectionEditPart instanceof Message3EditPart) {
+ if (connectionEditPart instanceof Message3EditPart) {
// Reply Message
return new AnchorHelper.FixedAnchorEx(getFigure(), PositionConstants.BOTTOM);
}
@@ -545,37 +551,40 @@ public abstract class AbstractExecutionSpecificationEditPart extends ShapeNodeEd
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart#getSourceConnectionAnchor(org.eclipse.gef.ConnectionEditPart)
- *
+ *
* @param connEditPart
- * The connection edit part.
+ * The connection edit part.
* @return The anchor.
*/
@Override
public ConnectionAnchor getSourceConnectionAnchor(ConnectionEditPart connEditPart) {
- if(connEditPart instanceof Message3EditPart) {
+ if (connEditPart instanceof Message3EditPart) {
// Reply Message
return new AnchorHelper.FixedAnchorEx(getFigure(), PositionConstants.BOTTOM);
}
- final org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart connection = (org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart)connEditPart;
- String t = null; //$NON-NLS-1$
+ final org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart connection = (org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart) connEditPart;
+ String t = null;
try {
- t = (String)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ t = (String) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- Anchor a = ((Edge)connection.getModel()).getSourceAnchor();
- if(a instanceof IdentityAnchor)
- setResult(((IdentityAnchor)a).getId());
- else
+ Anchor a = ((Edge) connection.getModel()).getSourceAnchor();
+ if (a instanceof IdentityAnchor) {
+ setResult(((IdentityAnchor) a).getId());
+ }
+ else {
setResult(""); //$NON-NLS-1$
+ }
}
});
} catch (InterruptedException e) {
Trace.catching(DiagramUIPlugin.getInstance(), DiagramUIDebugOptions.EXCEPTIONS_CATCHING, getClass(), "getSourceConnectionAnchor", e); //$NON-NLS-1$
Log.error(DiagramUIPlugin.getInstance(), DiagramUIStatusCodes.IGNORED_EXCEPTION_WARNING, "getSourceConnectionAnchor", e); //$NON-NLS-1$
}
- if(t != null && !"".equals(t)) {
+ if (t != null && !"".equals(t)) {
int position = AnchorHelper.FixedAnchorEx.parsePosition(t);
- if(position != -1) {
+ if (position != -1) {
return new AnchorHelper.FixedAnchorEx(getFigure(), position);
}
}
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 d7364f86e59..dd7614ca5dd 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
@@ -58,9 +58,10 @@ public abstract class AbstractMessageEditPart extends UMLConnectionNodeEditPart
@Override
public void activate() {
super.activate();
- if(getTarget() == null || getSource() == null) {
+ if (getTarget() == null || getSource() == null) {
getViewer().getControl().getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
hookGraphicalViewer();
}
@@ -71,9 +72,10 @@ public abstract class AbstractMessageEditPart extends UMLConnectionNodeEditPart
}
private void hookGraphicalViewer() {
- if(SelfMessageHelper.isSelfLink(this)) {
+ if (SelfMessageHelper.isSelfLink(this)) {
getViewer().getControl().addMouseMoveListener(mouseMoveListener = new MouseMoveListener() {
+ @Override
public void mouseMove(org.eclipse.swt.events.MouseEvent e) {
handleMouseMoved(e.x, e.y);
}
@@ -86,35 +88,35 @@ public abstract class AbstractMessageEditPart extends UMLConnectionNodeEditPart
*/
protected void handleMouseMoved(int x, int y) {
myCursor = null;
- if(defaultCursor != null) {
+ if (defaultCursor != null) {
getViewer().setCursor(Cursors.ARROW);
defaultCursor = null;
}
- if(!SelfMessageHelper.isSelfLink(this)) {
+ if (!SelfMessageHelper.isSelfLink(this)) {
return;
}
UMLEdgeFigure primaryShape = getPrimaryShape();
Point p = new Point(x, y);
primaryShape.translateToRelative(p);
- if(!primaryShape.containsPoint(p.x, p.y)) {
+ if (!primaryShape.containsPoint(p.x, p.y)) {
return;
}
PointList points = primaryShape.getPoints();
- if(points.size() <= 1) {
+ if (points.size() <= 1) {
return;
}
List lineSegments = PointListUtilities.getLineSegments(points);
LineSeg nearestSegment = PointListUtilities.getNearestSegment(lineSegments, p.x, p.y);
- if(points.size() > 3 && (p.getDistance(points.getPoint(1)) < 5 || p.getDistance(points.getPoint(2)) < 5)) {
+ if (points.size() > 3 && (p.getDistance(points.getPoint(1)) < 5 || p.getDistance(points.getPoint(2)) < 5)) {
myCursor = Cursors.SIZEALL;
- } else if(nearestSegment.isHorizontal()) {
+ } else if (nearestSegment.isHorizontal()) {
myCursor = Cursors.SIZENS;
} else {
myCursor = Cursors.SIZEWE;
}
defaultCursor = getViewer().getControl().getCursor();
getViewer().setCursor(myCursor);
- if(SelfMessageHelper.isSelfLink(this)) {
+ if (SelfMessageHelper.isSelfLink(this)) {
getPrimaryShape().setCustomCursor(myCursor);
} else {
getPrimaryShape().setCustomCursor(null);
@@ -123,7 +125,7 @@ public abstract class AbstractMessageEditPart extends UMLConnectionNodeEditPart
/**
* @see org.eclipse.papyrus.uml.diagram.common.editparts.UMLConnectionNodeEditPart#getPrimaryShape()
- *
+ *
* @return
*/
@Override
@@ -131,14 +133,14 @@ public abstract class AbstractMessageEditPart extends UMLConnectionNodeEditPart
@Override
public void deactivate() {
- if(mouseMoveListener != null) {
+ if (mouseMoveListener != null) {
getViewer().getControl().removeMouseMoveListener(mouseMoveListener);
}
super.deactivate();
}
private Cursor getCustomCursor() {
- if(!SelfMessageHelper.isSelfLink(this)) {
+ if (!SelfMessageHelper.isSelfLink(this)) {
return null;
}
return myCursor;
@@ -154,20 +156,20 @@ public abstract class AbstractMessageEditPart extends UMLConnectionNodeEditPart
protected void fireSelectionChanged() {
super.fireSelectionChanged();
UMLEdgeFigure primaryShape = getPrimaryShape();
- if(primaryShape instanceof MessageFigure) {
- ((MessageFigure)primaryShape).setSelection(getSelected() != SELECTED_NONE);
+ if (primaryShape instanceof MessageFigure) {
+ ((MessageFigure) primaryShape).setSelection(getSelected() != SELECTED_NONE);
}
}
public View findChildByModel(EObject model) {
List list = getModelChildren();
- if(list != null && list.size() > 0) {
- for(Object o : list) {
- if(!(o instanceof View)) {
+ if (list != null && list.size() > 0) {
+ for (Object o : list) {
+ if (!(o instanceof View)) {
continue;
}
- View view = (View)o;
- if(view.getElement() == model) {
+ View view = (View) o;
+ if (view.getElement() == model) {
return view;
}
}
@@ -177,7 +179,7 @@ public abstract class AbstractMessageEditPart extends UMLConnectionNodeEditPart
@Override
public List getChildren() {
- if(messageEventParts == null) {
+ if (messageEventParts == null) {
initMessageEventPart();
}
return super.getChildren();
@@ -188,27 +190,30 @@ public abstract class AbstractMessageEditPart extends UMLConnectionNodeEditPart
String id = String.valueOf(MessageEndEditPart.VISUAL_ID);
List list = this.getModelChildren();
- for(Object o : list)
- if(o instanceof Shape) {
- Shape s = (Shape)o;
- if(s.getType().equals(id))
+ for (Object o : list) {
+ if (o instanceof Shape) {
+ Shape s = (Shape) o;
+ if (s.getType().equals(id))
+ {
return; // if the model already persist, do not create it again
+ }
}
+ }
EObject element = this.resolveSemanticElement();
- if(!(element instanceof Message)) {
+ if (!(element instanceof Message)) {
return;
}
- Message message = (Message)element;
- UMLEdgeFigure edgeFigure = (UMLEdgeFigure)this.getFigure();
- Diagram diagram = ((View)this.getModel()).getDiagram();
- if(!(message.getSendEvent() instanceof Gate)) {
+ Message message = (Message) element;
+ UMLEdgeFigure edgeFigure = (UMLEdgeFigure) this.getFigure();
+ Diagram diagram = ((View) this.getModel()).getDiagram();
+ if (!(message.getSendEvent() instanceof Gate)) {
final MessageEndEditPart sendEventPart = new MessageEndEditPart(message.getSendEvent(), this, new ConnectionLocator(edgeFigure, ConnectionLocator.SOURCE));
messageEventParts.add(sendEventPart);
sendEventPart.rebuildLinks(diagram);
addChild(sendEventPart, -1);
}
- if(!(message.getReceiveEvent() instanceof Gate)) {
+ if (!(message.getReceiveEvent() instanceof Gate)) {
final MessageEndEditPart receiveEventPart = new MessageEndEditPart(message.getReceiveEvent(), this, new ConnectionLocator(edgeFigure, ConnectionLocator.TARGET));
messageEventParts.add(receiveEventPart);
receiveEventPart.rebuildLinks(diagram);
@@ -220,20 +225,20 @@ public abstract class AbstractMessageEditPart extends UMLConnectionNodeEditPart
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY, new MessageLabelEditPolicy());
- //Ordering Message Occurrence Specification. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=403233
+ // Ordering Message Occurrence Specification. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=403233
installEditPolicy(InteractionFragmentsOrderingEditPolicy.ORDERING_ROLE, new InteractionFragmentsOrderingEditPolicy());
}
@Override
public EditPart getTargetEditPart(Request request) {
- if(request instanceof CreateUnspecifiedTypeConnectionRequest) {
- List types = ((CreateUnspecifiedTypeConnectionRequest)request).getElementTypes();
- if(types.contains(UMLElementTypes.Message_4009) || types.contains(UMLElementTypes.Message_4008)) {
+ if (request instanceof CreateUnspecifiedTypeConnectionRequest) {
+ List types = ((CreateUnspecifiedTypeConnectionRequest) request).getElementTypes();
+ if (types.contains(UMLElementTypes.Message_4009) || types.contains(UMLElementTypes.Message_4008)) {
return null;
}
- } else if(request instanceof ReconnectRequest) {
- ConnectionEditPart con = ((ReconnectRequest)request).getConnectionEditPart();
- if(con instanceof Message7EditPart || con instanceof Message6EditPart) {
+ } else if (request instanceof ReconnectRequest) {
+ ConnectionEditPart con = ((ReconnectRequest) request).getConnectionEditPart();
+ if (con instanceof Message7EditPart || con instanceof Message6EditPart) {
return null;
}
}
@@ -245,36 +250,38 @@ public abstract class AbstractMessageEditPart extends UMLConnectionNodeEditPart
super.handleNotificationEvent(notification);
Object feature = notification.getFeature();
MessageLabelEditPart labelPart = getMessageLabelEditPart();
- if(labelPart == null) {
+ if (labelPart == null) {
return;
}
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
labelPart.refreshFontColor();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
labelPart.refreshFont();
}
}
public MessageLabelEditPart getMessageLabelEditPart() {
- for(Object c : this.getChildren()) {
- if(c instanceof MessageLabelEditPart) {
- return (MessageLabelEditPart)c;
+ for (Object c : this.getChildren()) {
+ if (c instanceof MessageLabelEditPart) {
+ return (MessageLabelEditPart) c;
}
}
return null;
}
- //public abstract IFigure getPrimaryShape() ;
+ // public abstract IFigure getPrimaryShape() ;
@Override
public void setLineWidth(int width) {
- if(getPrimaryShape() instanceof MessageFigure) {
- MessageFigure edge = (MessageFigure)getPrimaryShape();
+ if (getPrimaryShape() instanceof MessageFigure) {
+ MessageFigure edge = getPrimaryShape();
edge.setLineWidth(width);
}
}
+ @Override
public void showSourceFeedback(Request request) {
- if(request instanceof CreateUnspecifiedTypeRequest) {
+ if (request instanceof CreateUnspecifiedTypeRequest) {
getSource().showSourceFeedback(request);
getTarget().showSourceFeedback(request);
}
@@ -286,7 +293,7 @@ public abstract class AbstractMessageEditPart extends UMLConnectionNodeEditPart
*/
@Override
public void eraseSourceFeedback(Request request) {
- if(request instanceof CreateUnspecifiedTypeRequest) {
+ if (request instanceof CreateUnspecifiedTypeRequest) {
getSource().eraseSourceFeedback(request);
getTarget().eraseSourceFeedback(request);
}
@@ -295,7 +302,7 @@ public abstract class AbstractMessageEditPart extends UMLConnectionNodeEditPart
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart#installRouter()
- *
+ *
*/
@Override
protected void installRouter() {
@@ -307,79 +314,80 @@ public abstract class AbstractMessageEditPart extends UMLConnectionNodeEditPart
/**
* Ignore routing style since we are using a custom router and a custom ConnectionBendpointEditPolicy.
*/
+ @Override
protected void refreshRoutingStyles() {
}
- // public static class MessageFigure extends UMLEdgeFigure {
+ // public static class MessageFigure extends UMLEdgeFigure {
//
- // private boolean selection;
+ // private boolean selection;
//
- // /**
- // * Constructor.
- // *
- // */
- // public MessageFigure() {
- // }
+ // /**
+ // * Constructor.
+ // *
+ // */
+ // public MessageFigure() {
+ // }
//
- // @Override
- // public void setLineWidth(int w) {
- // if(selection) {
- // w = AbstractMessageEditPart.this.getLineWidth() * 2;
- // }
- // super.setLineWidth(w);
- // if(getSourceDecoration() instanceof Shape) {
- // ((Shape)getSourceDecoration()).setLineWidth(w);
- // }
- // if(getTargetDecoration() instanceof Shape) {
- // ((Shape)getTargetDecoration()).setLineWidth(w);
- // }
- // }
+ // @Override
+ // public void setLineWidth(int w) {
+ // if(selection) {
+ // w = AbstractMessageEditPart.this.getLineWidth() * 2;
+ // }
+ // super.setLineWidth(w);
+ // if(getSourceDecoration() instanceof Shape) {
+ // ((Shape)getSourceDecoration()).setLineWidth(w);
+ // }
+ // if(getTargetDecoration() instanceof Shape) {
+ // ((Shape)getTargetDecoration()).setLineWidth(w);
+ // }
+ // }
//
- // @Override
- // public void setForegroundColor(Color c) {
- // super.setForegroundColor(c);
- // if(getSourceDecoration() instanceof Shape) {
- // ((Shape)getSourceDecoration()).setForegroundColor(c);
- // ((Shape)getSourceDecoration()).setBackgroundColor(c);
- // }
- // if(getTargetDecoration() instanceof Shape) {
- // ((Shape)getTargetDecoration()).setForegroundColor(c);
- // ((Shape)getTargetDecoration()).setBackgroundColor(c);
- // }
- // }
+ // @Override
+ // public void setForegroundColor(Color c) {
+ // super.setForegroundColor(c);
+ // if(getSourceDecoration() instanceof Shape) {
+ // ((Shape)getSourceDecoration()).setForegroundColor(c);
+ // ((Shape)getSourceDecoration()).setBackgroundColor(c);
+ // }
+ // if(getTargetDecoration() instanceof Shape) {
+ // ((Shape)getTargetDecoration()).setForegroundColor(c);
+ // ((Shape)getTargetDecoration()).setBackgroundColor(c);
+ // }
+ // }
//
- // @Override
- // public Cursor getCursor() {
- // Cursor customCursor = getCustomCursor();
- // if(customCursor != null) {
- // return customCursor;
- // }
- // return super.getCursor();
- // }
+ // @Override
+ // public Cursor getCursor() {
+ // Cursor customCursor = getCustomCursor();
+ // if(customCursor != null) {
+ // return customCursor;
+ // }
+ // return super.getCursor();
+ // }
//
- // /**
- // * @return the selection
- // */
- // public boolean getSelection() {
- // return selection;
- // }
+ // /**
+ // * @return the selection
+ // */
+ // public boolean getSelection() {
+ // return selection;
+ // }
//
- // /**
- // * @param selection
- // * the selection to set
- // */
- // public void setSelection(boolean selection) {
- // this.selection = selection;
- // if(!selection) {
- // setLineWidth(AbstractMessageEditPart.this.getLineWidth());
- // }
- // repaint();
- // }
+ // /**
+ // * @param selection
+ // * the selection to set
+ // */
+ // public void setSelection(boolean selection) {
+ // this.selection = selection;
+ // if(!selection) {
+ // setLineWidth(AbstractMessageEditPart.this.getLineWidth());
+ // }
+ // repaint();
+ // }
//
- // protected IMapMode getMapMode() {
- // return AbstractMessageEditPart.this.getMapMode();
- // }
- // }
+ // protected IMapMode getMapMode() {
+ // return AbstractMessageEditPart.this.getMapMode();
+ // }
+ // }
static abstract class MessageLabelEditPart extends LabelEditPart {
public MessageLabelEditPart(View view) {
@@ -389,7 +397,7 @@ public abstract class AbstractMessageEditPart extends UMLConnectionNodeEditPart
@Override
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getLineStyle_LineColor().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getLineStyle_LineColor().equals(feature)) {
refreshFontColor();
} else {
super.handleNotificationEvent(notification);
@@ -398,8 +406,8 @@ public abstract class AbstractMessageEditPart extends UMLConnectionNodeEditPart
@Override
public void refreshFontColor() {
- FontStyle style = (FontStyle)((org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart)getParent()).getPrimaryView().getStyle(NotationPackage.Literals.FONT_STYLE);
- if(style != null) {
+ FontStyle style = (FontStyle) ((org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart) getParent()).getPrimaryView().getStyle(NotationPackage.Literals.FONT_STYLE);
+ if (style != null) {
setFontColor(DiagramColorRegistry.getInstance().getColor(Integer.valueOf(style.getFontColor())));
}
}
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 2dae3d2b0c6..41b7f538dbb 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -33,14 +33,14 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.AnnotatedLinkEndpo
/**
* Abstract link class for connections with Comment, Constraint and Observations.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public abstract class AnnotatedLinkEditPart extends ConnectionNodeEditPart implements ITreeBranchEditPart {
/**
* Constructor.
- *
+ *
* @param view
*/
public AnnotatedLinkEditPart(View view) {
@@ -53,14 +53,14 @@ public abstract class AnnotatedLinkEditPart extends ConnectionNodeEditPart imple
}
public AnnotatedLinkDescriptor getPrimaryShape() {
- return (AnnotatedLinkDescriptor)getFigure();
+ return (AnnotatedLinkDescriptor) getFigure();
}
@Override
protected void handleNotificationEvent(Notification notification) {
super.handleNotificationEvent(notification);
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getLineStyle_LineWidth().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getLineStyle_LineWidth().equals(feature)) {
refreshLineWidth();
}
}
@@ -68,16 +68,16 @@ public abstract class AnnotatedLinkEditPart extends ConnectionNodeEditPart imple
@Override
public EditPart getTargetEditPart(Request request) {
EditPart ep = super.getTargetEditPart(request);
- if(ep != null && ep instanceof org.eclipse.gef.ConnectionEditPart) {
- if(request instanceof ReconnectRequest) {
- ReconnectRequest rRequest = (ReconnectRequest)request;
+ if (ep != null && ep instanceof org.eclipse.gef.ConnectionEditPart) {
+ if (request instanceof ReconnectRequest) {
+ ReconnectRequest rRequest = (ReconnectRequest) request;
// If this is just moving an anchor point on the same target or
- // source, then it is fine. See bugzilla# 208408.
- if(rRequest.isMovingStartAnchor()) {
- if(rRequest.getConnectionEditPart().getSource() == ep) {
+ // source, then it is fine. See bugzilla# 208408.
+ if (rRequest.isMovingStartAnchor()) {
+ if (rRequest.getConnectionEditPart().getSource() == ep) {
return ep;
}
- } else if(rRequest.getConnectionEditPart().getTarget() == ep) {
+ } else if (rRequest.getConnectionEditPart().getTarget() == ep) {
return ep;
}
// If source anchor is moved, the connection's source edit part
@@ -85,8 +85,8 @@ public abstract class AnnotatedLinkEditPart extends ConnectionNodeEditPart imple
// check so as to avoid false checks. Same goes for the target
// anchor. See bugzilla# 155243 -- we do not want to target a
// connection that is already connected to us so that we do not
- // introduce a cyclic connection
- if(isCyclicConnectionRequest((org.eclipse.gef.ConnectionEditPart)ep, rRequest.getConnectionEditPart(), false, rRequest.isMovingStartAnchor())) {
+ // introduce a cyclic connection
+ if (isCyclicConnectionRequest((org.eclipse.gef.ConnectionEditPart) ep, rRequest.getConnectionEditPart(), false, rRequest.isMovingStartAnchor())) {
return null;
}
}
@@ -95,33 +95,33 @@ public abstract class AnnotatedLinkEditPart extends ConnectionNodeEditPart imple
}
private boolean isCyclicConnectionRequest(org.eclipse.gef.ConnectionEditPart targetCEP, org.eclipse.gef.ConnectionEditPart sourceCEP, boolean checkSourceAndTargetEditParts, boolean doNotCheckSourceEditPart) {
- if(targetCEP == null || sourceCEP == null) {
+ if (targetCEP == null || sourceCEP == null) {
return false;
}
- if(sourceCEP == targetCEP) {
+ if (sourceCEP == targetCEP) {
return true;
}
- // first, do a cyclic check on source and target connections
+ // first, do a cyclic check on source and target connections
// of the source connection itself.
// (as every connection is also a node).
HashSet set = new HashSet();
getSourceAndTargetConnections(set, sourceCEP);
- if(set.contains(targetCEP.getFigure())) {
+ if (set.contains(targetCEP.getFigure())) {
return true;
}
- // now do the cyclic check on the source and target of the source connection...
+ // now do the cyclic check on the source and target of the source connection...
EditPart sourceEP = sourceCEP.getSource(), targetEP = sourceCEP.getTarget();
- if((sourceEP == targetCEP) || (targetEP == targetCEP)) {
+ if ((sourceEP == targetCEP) || (targetEP == targetCEP)) {
return true;
} else {
- if(!checkSourceAndTargetEditParts && doNotCheckSourceEditPart) {
+ if (!checkSourceAndTargetEditParts && doNotCheckSourceEditPart) {
// .
- } else if(sourceEP instanceof org.eclipse.gef.ConnectionEditPart && isCyclicConnectionRequest(targetCEP, (org.eclipse.gef.ConnectionEditPart)sourceEP, true, doNotCheckSourceEditPart)) {
+ } else if (sourceEP instanceof org.eclipse.gef.ConnectionEditPart && isCyclicConnectionRequest(targetCEP, (org.eclipse.gef.ConnectionEditPart) sourceEP, true, doNotCheckSourceEditPart)) {
return true;
}
- if(!checkSourceAndTargetEditParts && !doNotCheckSourceEditPart) {
+ if (!checkSourceAndTargetEditParts && !doNotCheckSourceEditPart) {
// .
- } else if(targetEP instanceof org.eclipse.gef.ConnectionEditPart && isCyclicConnectionRequest(targetCEP, (org.eclipse.gef.ConnectionEditPart)targetEP, true, doNotCheckSourceEditPart)) {
+ } else if (targetEP instanceof org.eclipse.gef.ConnectionEditPart && isCyclicConnectionRequest(targetCEP, (org.eclipse.gef.ConnectionEditPart) targetEP, true, doNotCheckSourceEditPart)) {
return true;
}
}
@@ -130,44 +130,44 @@ public abstract class AnnotatedLinkEditPart extends ConnectionNodeEditPart imple
/**
* Retrieve the list of all source and target connections for the connection.
- *
+ *
* @param set
- * HashSet to add the connections to.
+ * HashSet to add the connections to.
* @param connectionEditPart
- * the connection edit part.
+ * the connection edit part.
*/
private void getSourceAndTargetConnections(HashSet set, org.eclipse.gef.ConnectionEditPart connectionEditPart) {
- if(connectionEditPart == null || set == null) {
+ if (connectionEditPart == null || set == null) {
return;
}
- for(Iterator i = connectionEditPart.getSourceConnections().iterator(); i.hasNext();) {
- org.eclipse.gef.ConnectionEditPart next = (org.eclipse.gef.ConnectionEditPart)i.next();
- Connection sourceConnection = (Connection)next.getFigure();
+ for (Iterator i = connectionEditPart.getSourceConnections().iterator(); i.hasNext();) {
+ org.eclipse.gef.ConnectionEditPart next = (org.eclipse.gef.ConnectionEditPart) i.next();
+ Connection sourceConnection = (Connection) next.getFigure();
set.add(sourceConnection);
getSourceAndTargetConnections(set, next);
}
- for(Iterator i = connectionEditPart.getTargetConnections().iterator(); i.hasNext();) {
- org.eclipse.gef.ConnectionEditPart next = (org.eclipse.gef.ConnectionEditPart)i.next();
- Connection targetConnection = (Connection)next.getFigure();
+ for (Iterator i = connectionEditPart.getTargetConnections().iterator(); i.hasNext();) {
+ org.eclipse.gef.ConnectionEditPart next = (org.eclipse.gef.ConnectionEditPart) i.next();
+ Connection targetConnection = (Connection) next.getFigure();
set.add(targetConnection);
getSourceAndTargetConnections(set, next);
}
- //For message edit part, we need to collect all connections from message ends.
- if(connectionEditPart instanceof AbstractMessageEditPart) {
- List children = ((AbstractMessageEditPart)connectionEditPart).getChildren();
- for(Object object : children) {
- if(!(object instanceof MessageEndEditPart)) {
+ // For message edit part, we need to collect all connections from message ends.
+ if (connectionEditPart instanceof AbstractMessageEditPart) {
+ List children = ((AbstractMessageEditPart) connectionEditPart).getChildren();
+ for (Object object : children) {
+ if (!(object instanceof MessageEndEditPart)) {
continue;
}
- for(Iterator i = ((MessageEndEditPart)object).getSourceConnections().iterator(); i.hasNext();) {
- org.eclipse.gef.ConnectionEditPart next = (org.eclipse.gef.ConnectionEditPart)i.next();
- Connection sourceConnection = (Connection)next.getFigure();
+ for (Iterator i = ((MessageEndEditPart) object).getSourceConnections().iterator(); i.hasNext();) {
+ org.eclipse.gef.ConnectionEditPart next = (org.eclipse.gef.ConnectionEditPart) i.next();
+ Connection sourceConnection = (Connection) next.getFigure();
set.add(sourceConnection);
getSourceAndTargetConnections(set, next);
}
- for(Iterator i = ((MessageEndEditPart)object).getTargetConnections().iterator(); i.hasNext();) {
- org.eclipse.gef.ConnectionEditPart next = (org.eclipse.gef.ConnectionEditPart)i.next();
- Connection targetConnection = (Connection)next.getFigure();
+ for (Iterator i = ((MessageEndEditPart) object).getTargetConnections().iterator(); i.hasNext();) {
+ org.eclipse.gef.ConnectionEditPart next = (org.eclipse.gef.ConnectionEditPart) i.next();
+ Connection targetConnection = (Connection) next.getFigure();
set.add(targetConnection);
getSourceAndTargetConnections(set, next);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/BehaviorExecutionSpecificationBehaviorEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/BehaviorExecutionSpecificationBehaviorEditPart.java
index d3f54dbec54..3ff1f4b17d8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/BehaviorExecutionSpecificationBehaviorEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/BehaviorExecutionSpecificationBehaviorEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -36,7 +36,7 @@ import org.eclipse.uml2.uml.UMLPackage;
/**
* Add new Label EditPart for display behavior of an
* BehaviorExecutionSpecification.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class BehaviorExecutionSpecificationBehaviorEditPart extends
@@ -49,7 +49,7 @@ public class BehaviorExecutionSpecificationBehaviorEditPart extends
/**
* Constructor.
- *
+ *
* @param view
*/
public BehaviorExecutionSpecificationBehaviorEditPart(View view) {
@@ -68,7 +68,7 @@ public class BehaviorExecutionSpecificationBehaviorEditPart extends
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.BorderItemLabelEditPart#createFigurePrim()
- *
+ *
* @return
*/
@@ -86,7 +86,7 @@ public class BehaviorExecutionSpecificationBehaviorEditPart extends
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.BorderItemLabelEditPart#createParser()
- *
+ *
* @return
*/
@Override
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 b81d47bceb0..17a9676a8de 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -83,7 +83,7 @@ import org.eclipse.uml2.uml.Feature;
/**
* Abstract LabelEditPart which should be located around of BorderedNodeFigure.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public abstract class BorderItemLabelEditPart extends LabelEditPart implements ITextAwareEditPart, IBorderItemEditPart {
@@ -102,106 +102,111 @@ public abstract class BorderItemLabelEditPart extends LabelEditPart implements I
/**
* Constructor.
- *
+ *
* @param view
*/
public BorderItemLabelEditPart(View view) {
super(view);
}
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new BorderItemSelectionEditPolicy() {
+ @Override
protected List createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
});
}
+ @Override
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
+ @Override
public void refreshBounds() {
Point location = getLocation();
- if(location == null) {
+ if (location == null) {
location = new Point();
}
Dimension size = getSize();
- if(size == null) {
+ if (size == null) {
size = new Dimension();
}
IBorderItemLocator borderItemLocator = getBorderItemLocator();
- if(borderItemLocator != null) {
+ if (borderItemLocator != null) {
borderItemLocator.setConstraint(new Rectangle(location, size));
}
}
protected Point getLocation() {
Point point = new Point();
- point.x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- point.y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ point.x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ point.y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
return point;
}
protected Dimension getSize() {
Dimension size = new Dimension();
- size.width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- size.height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ size.width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ size.height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
return size;
}
+ @Override
public int getKeyPoint() {
return ConnectionLocator.MIDDLE;
}
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -213,10 +218,12 @@ public abstract class BorderItemLabelEditPart extends LabelEditPart implements I
refreshVisuals();
}
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -232,29 +239,31 @@ public abstract class BorderItemLabelEditPart extends LabelEditPart implements I
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
}
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -264,21 +273,24 @@ public abstract class BorderItemLabelEditPart extends LabelEditPart implements I
return getParser() != null;
}
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -289,19 +301,22 @@ public abstract class BorderItemLabelEditPart extends LabelEditPart implements I
};
}
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
}
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
+ @Override
public final IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = createParser();
}
return parser;
@@ -310,7 +325,7 @@ public abstract class BorderItemLabelEditPart extends LabelEditPart implements I
protected abstract IParser createParser();
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -325,54 +340,55 @@ public abstract class BorderItemLabelEditPart extends LabelEditPart implements I
}
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
}
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -384,13 +400,14 @@ public abstract class BorderItemLabelEditPart extends LabelEditPart implements I
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -407,6 +424,7 @@ public abstract class BorderItemLabelEditPart extends LabelEditPart implements I
}
}
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -418,69 +436,73 @@ public abstract class BorderItemLabelEditPart extends LabelEditPart implements I
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
refreshBounds();
}
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
}
}
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -488,10 +510,12 @@ public abstract class BorderItemLabelEditPart extends LabelEditPart implements I
}
}
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -501,15 +525,15 @@ public abstract class BorderItemLabelEditPart extends LabelEditPart implements I
}
private View getFontStyleOwnerView() {
- return (View)getModel();
+ return (View) getModel();
}
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
// not a named element. no specific editor => do nothing
@@ -517,7 +541,7 @@ public abstract class BorderItemLabelEditPart extends LabelEditPart implements I
}
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -528,9 +552,9 @@ public abstract class BorderItemLabelEditPart extends LabelEditPart implements I
}
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -540,9 +564,9 @@ public abstract class BorderItemLabelEditPart extends LabelEditPart implements I
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
@@ -552,13 +576,14 @@ public abstract class BorderItemLabelEditPart extends LabelEditPart implements I
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -571,26 +596,28 @@ public abstract class BorderItemLabelEditPart extends LabelEditPart implements I
}
}
+ @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -600,6 +627,7 @@ public abstract class BorderItemLabelEditPart extends LabelEditPart implements I
super.handleNotificationEvent(event);
}
+ @Override
protected IFigure createFigure() {
final IFigure label = createFigurePrim();
defaultText = getLabelTextHelper(label);
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 72a2920075b..f014383ffdf 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -35,7 +35,7 @@ public class CustomActionExecutionSpecificationEditPart extends ActionExecutionS
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomActionExecutionSpecificationEditPart(View view) {
@@ -49,7 +49,7 @@ public class CustomActionExecutionSpecificationEditPart extends ActionExecutionS
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomActionExecutionSpecificationItemSemanticEditPolicy());
- //Fixed bug about reconnect message when the ends of execution were MessageOccurrenceSpecification.
+ // Fixed bug about reconnect message when the ends of execution were MessageOccurrenceSpecification.
removeEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE);
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new ExecutionGraphicalNodeEditPolicy());
}
@@ -57,7 +57,7 @@ public class CustomActionExecutionSpecificationEditPart extends ActionExecutionS
/**
* Overrides to disable the defaultAnchorArea. The edge is now more stuck with the middle of the
* figure.
- *
+ *
* @Override
*/
@Override
@@ -74,10 +74,10 @@ public class CustomActionExecutionSpecificationEditPart extends ActionExecutionS
@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) {
+ // 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) {
+ if (PositionConstants.TOP == position || PositionConstants.BOTTOM == position) {
return new AnchorHelper.FixedAnchorEx(this, position);
}
}
@@ -90,17 +90,17 @@ public class CustomActionExecutionSpecificationEditPart extends ActionExecutionS
/**
* 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.
- *
+ *
* @Override
*/
@Override
protected NodeFigure createNodeFigure() {
final NodeFigure figure = createNodePlate();
figure.setLayoutManager(new DelegatingLayout());
- //figure.setLayoutManager(new StackLayout());
+ // figure.setLayoutManager(new StackLayout());
IFigure shape = createNodeShape();
figure.add(shape, new FillParentLocator());
contentPane = setupContentPane(shape);
@@ -109,11 +109,11 @@ public class CustomActionExecutionSpecificationEditPart extends ActionExecutionS
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ActionExecutionSpecificationEditPart#setLineWidth(int)
- *
+ *
* @param width
*/
@Override
protected void setLineWidth(int width) {
- // super.setLineWidth(width);
+ // super.setLineWidth(width);
}
}
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/CustomBehaviorExecutionSpecificationEditPart.java
index f5c914673e8..c2eaae2c82c 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/CustomBehaviorExecutionSpecificationEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -73,11 +73,11 @@ import org.eclipse.uml2.uml.UMLPackage;
/**
* Fixed bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=417376. Display the behavior of an BehaviorExecutionSpecification as a Label.
- *
+ *
* IMPORTANT, the new behavior label was added to the BorderedNodeFigure of Interaction, it seems there are some problems about moving when it was
* added
* on the BorderedNodeFigure of current BehaviorExecutionSpecification EditPart.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class CustomBehaviorExecutionSpecificationEditPart extends BehaviorExecutionSpecificationEditPart {
@@ -98,7 +98,7 @@ public class CustomBehaviorExecutionSpecificationEditPart extends BehaviorExecut
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomBehaviorExecutionSpecificationEditPart(View view) {
@@ -112,7 +112,7 @@ public class CustomBehaviorExecutionSpecificationEditPart extends BehaviorExecut
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomBehaviorExecutionSpecificationItemSemanticEditPolicy());
- //Fixed bug about reconnect message when the ends of execution were MessageOccurrenceSpecification.
+ // Fixed bug about reconnect message when the ends of execution were MessageOccurrenceSpecification.
removeEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE);
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new ExecutionGraphicalNodeEditPolicy());
}
@@ -121,30 +121,33 @@ public class CustomBehaviorExecutionSpecificationEditPart extends BehaviorExecut
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) {
- if(child instanceof BehaviorExecutionSpecificationBehaviorEditPart) {
+ if (child instanceof BehaviorExecutionSpecificationBehaviorEditPart) {
return new BorderItemSelectionEditPolicy() {
+ @Override
protected List createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
+ @Override
protected Command getMoveCommand(ChangeBoundsRequest request) {
- IBorderItemEditPart borderItemEP = (IBorderItemEditPart)getHost();
+ IBorderItemEditPart borderItemEP = (IBorderItemEditPart) getHost();
IBorderItemLocator borderItemLocator = borderItemEP.getBorderItemLocator();
- if(borderItemLocator != null) {
- LayoutConstraint layout = ((Node)getHost().getModel()).getLayoutConstraint();
+ if (borderItemLocator != null) {
+ LayoutConstraint layout = ((Node) getHost().getModel()).getLayoutConstraint();
Point location = new Point();
- if(layout instanceof Location) {
- location.x = ((Location)layout).getX();
- location.y = ((Location)layout).getY();
+ if (layout instanceof Location) {
+ location.x = ((Location) layout).getX();
+ location.y = ((Location) layout).getY();
}
location.translate(request.getMoveDelta());
- ICommand moveCommand = new SetBoundsCommand(borderItemEP.getEditingDomain(), DiagramUIMessages.Commands_MoveElement, new EObjectAdapter((View)getHost().getModel()), location);
+ ICommand moveCommand = new SetBoundsCommand(borderItemEP.getEditingDomain(), DiagramUIMessages.Commands_MoveElement, new EObjectAdapter((View) getHost().getModel()), location);
return new ICommandProxy(moveCommand);
}
return null;
@@ -154,16 +157,18 @@ public class CustomBehaviorExecutionSpecificationEditPart extends BehaviorExecut
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
}
+ @Override
protected Command getMoveChildrenCommand(Request request) {
return null;
}
+ @Override
protected Command getCreateCommand(CreateRequest request) {
return null;
}
@@ -174,7 +179,7 @@ public class CustomBehaviorExecutionSpecificationEditPart extends BehaviorExecut
/**
* Overrides to disable the defaultAnchorArea. The edge is no more stuck with the middle of the
* figure.
- *
+ *
* @Override
*/
@Override
@@ -191,10 +196,10 @@ public class CustomBehaviorExecutionSpecificationEditPart extends BehaviorExecut
@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) {
+ // 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) {
+ if (PositionConstants.TOP == position || PositionConstants.BOTTOM == position) {
return new AnchorHelper.FixedAnchorEx(this, position);
}
}
@@ -207,16 +212,16 @@ public class CustomBehaviorExecutionSpecificationEditPart extends BehaviorExecut
/**
* 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.
- *
+ *
* @Override
*/
@Override
protected NodeFigure createNodeFigure() {
NodeFigure figure = createNodePlate();
- //figure.setLayoutManager(new StackLayout());
+ // figure.setLayoutManager(new StackLayout());
figure.setLayoutManager(new DelegatingLayout());
IFigure shape = createNodeShape();
figure.add(shape, new FillParentLocator());
@@ -226,28 +231,28 @@ public class CustomBehaviorExecutionSpecificationEditPart extends BehaviorExecut
/**
* We did NOT use a BorderedNodeFigure in current EditPart. There are some problems about moving external labels.
- *
+ *
* We just find and use the root(Interaction) BorderedNodeFigure.
*/
private BorderedNodeFigure getBorderedFigure() {
EditPart parent = getParent();
- while(parent != null && !(parent instanceof CustomInteractionEditPart)) {
+ while (parent != null && !(parent instanceof CustomInteractionEditPart)) {
parent = parent.getParent();
}
- if(parent != null) {
- return ((CustomInteractionEditPart)parent).getBorderedFigure();
+ if (parent != null) {
+ return ((CustomInteractionEditPart) parent).getBorderedFigure();
}
return null;
}
@Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(childEditPart instanceof BehaviorExecutionSpecificationBehaviorEditPart) {
- IFigure childFigure = ((BehaviorExecutionSpecificationBehaviorEditPart)childEditPart).getFigure();
+ if (childEditPart instanceof BehaviorExecutionSpecificationBehaviorEditPart) {
+ IFigure childFigure = ((BehaviorExecutionSpecificationBehaviorEditPart) childEditPart).getFigure();
BorderedNodeFigure borderedFigure = getBorderedFigure();
final IFigure figure = getFigure();
BehaviorLabelLocator locator = new BehaviorLabelLocator(figure);
- if(borderedFigure != null) {
+ if (borderedFigure != null) {
borderedFigure.getBorderItemContainer().add(childFigure, locator);
}
return;
@@ -257,10 +262,10 @@ public class CustomBehaviorExecutionSpecificationEditPart extends BehaviorExecut
@Override
protected void removeChildVisual(EditPart childEditPart) {
- if(childEditPart instanceof BehaviorExecutionSpecificationBehaviorEditPart) {
- IFigure childFigure = ((BehaviorExecutionSpecificationBehaviorEditPart)childEditPart).getFigure();
+ if (childEditPart instanceof BehaviorExecutionSpecificationBehaviorEditPart) {
+ IFigure childFigure = ((BehaviorExecutionSpecificationBehaviorEditPart) childEditPart).getFigure();
BorderedNodeFigure borderedFigure = getBorderedFigure();
- if(borderedFigure != null) {
+ if (borderedFigure != null) {
borderedFigure.getBorderItemContainer().remove(childFigure);
}
return;
@@ -270,12 +275,12 @@ public class CustomBehaviorExecutionSpecificationEditPart extends BehaviorExecut
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart#setLineWidth(int)
- *
+ *
* @param width
*/
@Override
protected void setLineWidth(int width) {
- // super.setLineWidth(width);
+ // super.setLineWidth(width);
}
@Override
@@ -291,13 +296,13 @@ public class CustomBehaviorExecutionSpecificationEditPart extends BehaviorExecut
}
protected void refreshBehavior() {
- if(!BehaviorDisplayHelper.shouldDisplayBehavior(getNotationView())) {
+ if (!BehaviorDisplayHelper.shouldDisplayBehavior(getNotationView())) {
return;
}
List children = getChildren();
- for(Object child : children) {
- if(child instanceof BehaviorExecutionSpecificationBehaviorEditPart) {
- ((BehaviorExecutionSpecificationBehaviorEditPart)child).refresh();
+ for (Object child : children) {
+ if (child instanceof BehaviorExecutionSpecificationBehaviorEditPart) {
+ ((BehaviorExecutionSpecificationBehaviorEditPart) child).refresh();
}
}
}
@@ -306,9 +311,9 @@ public class CustomBehaviorExecutionSpecificationEditPart extends BehaviorExecut
public void activate() {
super.activate();
EObject elt = resolveSemanticElement();
- if(elt instanceof BehaviorExecutionSpecification) {
- Behavior behavior = ((BehaviorExecutionSpecification)elt).getBehavior();
- if(behavior != null) {
+ if (elt instanceof BehaviorExecutionSpecification) {
+ Behavior behavior = ((BehaviorExecutionSpecification) elt).getBehavior();
+ if (behavior != null) {
helper.listenObject(behavior);
}
}
@@ -316,28 +321,28 @@ public class CustomBehaviorExecutionSpecificationEditPart extends BehaviorExecut
}
private void addSelfRemovingListener(EditPart editPart) {
- if(editPart == null || editPart instanceof RootEditPart) {
+ if (editPart == null || editPart instanceof RootEditPart) {
return;
}
- if(selfRemovingListener == null) {
+ if (selfRemovingListener == null) {
selfRemovingListener = new EditPartListener.Stub() {
@Override
public void removingChild(EditPart child, int index) {
boolean removeBehavior = false;
EditPart editPart = CustomBehaviorExecutionSpecificationEditPart.this;
- while(editPart != null && !(editPart instanceof RootEditPart)) {
- if(editPart == child) {
+ while (editPart != null && !(editPart instanceof RootEditPart)) {
+ if (editPart == child) {
removeBehavior = true;
break;
}
editPart = editPart.getParent();
}
- if(removeBehavior) {
+ if (removeBehavior) {
List children = new ArrayList(getChildren());
- for(Object object : children) {
- if(object instanceof BehaviorExecutionSpecificationBehaviorEditPart) {
- removeChild((EditPart)object);
+ for (Object object : children) {
+ if (object instanceof BehaviorExecutionSpecificationBehaviorEditPart) {
+ removeChild((EditPart) object);
break;
}
}
@@ -345,7 +350,7 @@ public class CustomBehaviorExecutionSpecificationEditPart extends BehaviorExecut
}
};
}
- if(editPart != null) {
+ if (editPart != null) {
editPart.removeEditPartListener(selfRemovingListener);
editPart.addEditPartListener(selfRemovingListener);
addSelfRemovingListener(editPart.getParent());
@@ -353,10 +358,10 @@ public class CustomBehaviorExecutionSpecificationEditPart extends BehaviorExecut
}
private void removeSelfRemovingListener(EditPart editPart) {
- if(editPart == null || editPart instanceof RootEditPart || selfRemovingListener == null) {
+ if (editPart == null || editPart instanceof RootEditPart || selfRemovingListener == null) {
return;
}
- if(editPart != null) {
+ if (editPart != null) {
editPart.removeEditPartListener(selfRemovingListener);
removeSelfRemovingListener(editPart.getParent());
}
@@ -374,17 +379,17 @@ public class CustomBehaviorExecutionSpecificationEditPart extends BehaviorExecut
super.handleNotificationEvent(event);
Object feature = event.getFeature();
Object notifier = event.getNotifier();
- if(UMLPackage.eINSTANCE.getBehaviorExecutionSpecification_Behavior() == feature) {
- helper.unlistenObject((Notifier)event.getOldValue());
- helper.listenObject((Notifier)event.getNewValue());
+ if (UMLPackage.eINSTANCE.getBehaviorExecutionSpecification_Behavior() == feature) {
+ helper.unlistenObject((Notifier) event.getOldValue());
+ helper.listenObject((Notifier) event.getNewValue());
refreshBehavior();
- } else if(notifier != null) {
+ } else if (notifier != null) {
EObject elt = resolveSemanticElement();
- if(elt instanceof BehaviorExecutionSpecification && notifier == ((BehaviorExecutionSpecification)elt).getBehavior()) {
+ if (elt instanceof BehaviorExecutionSpecification && notifier == ((BehaviorExecutionSpecification) elt).getBehavior()) {
refreshBehavior();
}
}
- if(BehaviorDisplayHelper.isDisplayBehaviorChanged(event)) {
+ if (BehaviorDisplayHelper.isDisplayBehaviorChanged(event)) {
refreshChildren();
}
}
@@ -393,19 +398,19 @@ public class CustomBehaviorExecutionSpecificationEditPart extends BehaviorExecut
protected List getModelChildren() {
List modelChildren = new ArrayList(super.getModelChildren());
boolean displayBehavior = BehaviorDisplayHelper.shouldDisplayBehavior(getNotationView());
- //Lazy check and create behavior label model.
+ // Lazy check and create behavior label model.
boolean hasBehaviorLabel = false;
final View view = getNotationView();
- for(Object object : view.getChildren()) {
- if(object instanceof View && BehaviorExecutionSpecificationBehaviorEditPart.BEHAVIOR_TYPE.equals(((View)object).getType())) {
+ for (Object object : view.getChildren()) {
+ if (object instanceof View && BehaviorExecutionSpecificationBehaviorEditPart.BEHAVIOR_TYPE.equals(((View) object).getType())) {
hasBehaviorLabel = true;
- if(!displayBehavior) {
+ if (!displayBehavior) {
modelChildren.remove(object);
}
break;
}
}
- if(!hasBehaviorLabel && displayBehavior) {
+ if (!hasBehaviorLabel && displayBehavior) {
final DecorationNode behaviorLabel = NotationFactory.eINSTANCE.createDecorationNode();
Location location = NotationFactory.eINSTANCE.createLocation();
location.setX(16);
@@ -433,7 +438,7 @@ public class CustomBehaviorExecutionSpecificationEditPart extends BehaviorExecut
/**
* Constructor.
- *
+ *
*/
public BehaviorLabelLocator(IFigure referenceFigure) {
this.referenceFigure = referenceFigure;
@@ -441,43 +446,46 @@ public class CustomBehaviorExecutionSpecificationEditPart extends BehaviorExecut
/**
* @see org.eclipse.gmf.runtime.draw2d.ui.figures.IBorderItemLocator#setConstraint(org.eclipse.draw2d.geometry.Rectangle)
- *
+ *
* @param constraint
*/
+ @Override
public void setConstraint(Rectangle constraint) {
this.constraint = constraint;
}
/**
- * @see org.eclipse.gmf.runtime.draw2d.ui.figures.IBorderItemLocator#getValidLocation(org.eclipse.draw2d.geometry.Rectangle,
- * org.eclipse.draw2d.IFigure)
- *
+ * @see org.eclipse.gmf.runtime.draw2d.ui.figures.IBorderItemLocator#getValidLocation(org.eclipse.draw2d.geometry.Rectangle, org.eclipse.draw2d.IFigure)
+ *
* @param proposedLocation
* @param borderItem
* @return
*/
+ @Override
public Rectangle getValidLocation(Rectangle proposedLocation, IFigure borderItem) {
return new Rectangle(proposedLocation);
}
/**
* @see org.eclipse.gmf.runtime.draw2d.ui.figures.IBorderItemLocator#getCurrentSideOfParent()
- *
+ *
* @return
*/
+ @Override
public int getCurrentSideOfParent() {
return 0;
}
/**
* @see org.eclipse.draw2d.Locator#relocate(org.eclipse.draw2d.IFigure)
- *
+ *
* @param target
*/
+ @Override
public void relocate(IFigure target) {
Rectangle ref = referenceFigure.getBounds().getCopy();
referenceFigure.translateToAbsolute(ref);
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 cbfe3a016c4..1e1a9dca710 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -30,7 +30,7 @@ public class CustomCombinedFragment2EditPart extends CombinedFragment2EditPart {
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomCombinedFragment2EditPart(View view) {
@@ -53,22 +53,22 @@ public class CustomCombinedFragment2EditPart extends CombinedFragment2EditPart {
@Override
protected NodeFigure getNodeFigure() {
NodeFigure centerFigure = null;
- if(getContentPane() instanceof CoRegionCombinedFragmentFigure) {
- centerFigure = ((CoRegionCombinedFragmentFigure)getContentPane()).getCentralVerticalLine();
+ if (getContentPane() instanceof CoRegionCombinedFragmentFigure) {
+ centerFigure = ((CoRegionCombinedFragmentFigure) getContentPane()).getCentralVerticalLine();
}
return centerFigure;
}
/**
* Get the lifeline element where the CoRegion is drawn
- *
+ *
* @return the attached lifeline
*/
public Lifeline getAttachedLifeline() {
Lifeline attachedLifeline = null;
EditPart editPartParent = getParent();
- if(editPartParent instanceof LifelineEditPart) {
- attachedLifeline = (Lifeline)((LifelineEditPart)editPartParent).resolveSemanticElement();
+ if (editPartParent instanceof LifelineEditPart) {
+ attachedLifeline = (Lifeline) ((LifelineEditPart) editPartParent).resolveSemanticElement();
}
return attachedLifeline;
}
@@ -77,8 +77,8 @@ public class CustomCombinedFragment2EditPart extends CombinedFragment2EditPart {
protected void handleNotificationEvent(Notification notification) {
super.handleNotificationEvent(notification);
Object feature = notification.getFeature();
- if((getModel() != null) && (getModel() == notification.getNotifier())) {
- if(NotationPackage.eINSTANCE.getLineStyle_LineWidth().equals(feature)) {
+ if ((getModel() != null) && (getModel() == notification.getNotifier())) {
+ if (NotationPackage.eINSTANCE.getLineStyle_LineWidth().equals(feature)) {
refreshLineWidth();
}
}
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 c40e7c63981..07980edeb5e 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -55,7 +55,7 @@ public class CustomCombinedFragmentCombinedFragmentCompartmentEditPart extends C
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomCombinedFragmentCombinedFragmentCompartmentEditPart(View view) {
@@ -64,33 +64,33 @@ public class CustomCombinedFragmentCombinedFragmentCompartmentEditPart extends C
/**
* Not generated for delete borders add stretch children figures.
- *
+ *
* @Override
*/
@Override
public IFigure createFigure() {
- ResizableCompartmentFigure result = (ResizableCompartmentFigure)super.createFigure();
+ ResizableCompartmentFigure result = (ResizableCompartmentFigure) super.createFigure();
result.getScrollPane().setVerticalScrollBarVisibility(ScrollPane.NEVER);
result.setTitleVisibility(false);
result.setBorder(null);
IFigure contentPane = result.getContentPane();
- if(contentPane != null) {
+ if (contentPane != null) {
contentPane.setBorder(null);
- //fix Scroll bars(https://bugs.eclipse.org/bugs/show_bug.cgi?id=364697)
+ // fix Scroll bars(https://bugs.eclipse.org/bugs/show_bug.cgi?id=364697)
contentPane.setLayoutManager(new XYLayout());
- // LayoutManager layout = contentPane.getLayoutManager();
- // if(layout instanceof ConstrainedToolbarLayout) {
- // ConstrainedToolbarLayout constrainedToolbarLayout = (ConstrainedToolbarLayout)layout;
- // constrainedToolbarLayout.setStretchMajorAxis(true);
- // constrainedToolbarLayout.setStretchMinorAxis(true);
- // }
+ // LayoutManager layout = contentPane.getLayoutManager();
+ // if(layout instanceof ConstrainedToolbarLayout) {
+ // ConstrainedToolbarLayout constrainedToolbarLayout = (ConstrainedToolbarLayout)layout;
+ // constrainedToolbarLayout.setStretchMajorAxis(true);
+ // constrainedToolbarLayout.setStretchMinorAxis(true);
+ // }
}
return result;
}
/**
* Add RemoveOrphanView role
- *
+ *
* @Override
*/
@Override
@@ -107,40 +107,40 @@ public class CustomCombinedFragmentCombinedFragmentCompartmentEditPart extends C
@Override
protected Command getCreateElementAndViewCommand(CreateViewAndElementRequest request) {
- //THIS WAS ALREADY DID IN getCreateCommand(), WHY AGAIN?
- // Command createCommand = super.getCreateElementAndViewCommand(request);
- // if (createCommand == null || !createCommand.canExecute()){
- // return createCommand;
- // }
- // ICommandProxy commandProxy = (ICommandProxy)createCommand;
- // CompositeCommand command = (CompositeCommand)commandProxy.getICommand();
- //
- // IHintedType type = (IHintedType)UMLElementTypes.InteractionOperand_3005;
- // if(type.getSemanticHint().equals(request.getViewAndElementDescriptor().getSemanticHint())) {
- // //fix Scroll bars(https://bugs.eclipse.org/bugs/show_bug.cgi?id=364697), note that we use XYLayout
- // //to relocate both its bounds and combined fragment bounds when operand is added to combined fragment
- // OperandBoundsComputeHelper.addUpdateBoundsForIOCreationCommand(CombinedFragmentCombinedFragmentCompartmentEditPart.this, request.getViewAndElementDescriptor(), command);
- // }
- // return commandProxy;
+ // THIS WAS ALREADY DID IN getCreateCommand(), WHY AGAIN?
+ // Command createCommand = super.getCreateElementAndViewCommand(request);
+ // if (createCommand == null || !createCommand.canExecute()){
+ // return createCommand;
+ // }
+ // ICommandProxy commandProxy = (ICommandProxy)createCommand;
+ // CompositeCommand command = (CompositeCommand)commandProxy.getICommand();
+ //
+ // IHintedType type = (IHintedType)UMLElementTypes.InteractionOperand_3005;
+ // if(type.getSemanticHint().equals(request.getViewAndElementDescriptor().getSemanticHint())) {
+ // //fix Scroll bars(https://bugs.eclipse.org/bugs/show_bug.cgi?id=364697), note that we use XYLayout
+ // //to relocate both its bounds and combined fragment bounds when operand is added to combined fragment
+ // OperandBoundsComputeHelper.addUpdateBoundsForIOCreationCommand(CombinedFragmentCombinedFragmentCompartmentEditPart.this, request.getViewAndElementDescriptor(), command);
+ // }
+ // return commandProxy;
return super.getCreateElementAndViewCommand(request);
}
@Override
protected Command getCreateCommand(CreateViewRequest request) {
- ICommandProxy commandProxy = (ICommandProxy)super.getCreateCommand(request);
+ ICommandProxy commandProxy = (ICommandProxy) super.getCreateCommand(request);
ICommand command = commandProxy.getICommand();
CompositeCommand compositeCommand = null;
- if(command instanceof CompositeCommand) {
- compositeCommand = (CompositeCommand)command;
+ if (command instanceof CompositeCommand) {
+ compositeCommand = (CompositeCommand) command;
} else {
compositeCommand = new CompositeCommand(commandProxy.getLabel());
compositeCommand.add(command);
}
- for(ViewDescriptor viewDescriptor : request.getViewDescriptors()) {
- IHintedType type = (IHintedType)UMLElementTypes.InteractionOperand_3005;
- if(type.getSemanticHint().equals(viewDescriptor.getSemanticHint())) {
- //fix Scroll bars(https://bugs.eclipse.org/bugs/show_bug.cgi?id=364697), note that we use XYLayout
- //to relocate both its bounds and combined fragment bounds when operand is added to combined fragment
+ for (ViewDescriptor viewDescriptor : request.getViewDescriptors()) {
+ IHintedType type = (IHintedType) UMLElementTypes.InteractionOperand_3005;
+ if (type.getSemanticHint().equals(viewDescriptor.getSemanticHint())) {
+ // fix Scroll bars(https://bugs.eclipse.org/bugs/show_bug.cgi?id=364697), note that we use XYLayout
+ // to relocate both its bounds and combined fragment bounds when operand is added to combined fragment
OperandBoundsComputeHelper.addUpdateBoundsForIOCreationCommand(CustomCombinedFragmentCombinedFragmentCompartmentEditPart.this, viewDescriptor, compositeCommand);
}
}
@@ -151,13 +151,13 @@ public class CustomCombinedFragmentCombinedFragmentCompartmentEditPart extends C
/**
* Not generated for handle the first InteractionOperand case (no LineSeparator) {@inheritDoc}
- *
+ *
*/
@Override
protected EditPart createChild(Object model) {
EditPart child = super.createChild(model);
- if(getChildren() == null || getChildren().isEmpty() && child instanceof CustomInteractionOperandEditPart) {
- ((CustomInteractionOperandEditPart)child).setFirstOperand(true);
+ if (getChildren() == null || getChildren().isEmpty() && child instanceof CustomInteractionOperandEditPart) {
+ ((CustomInteractionOperandEditPart) child).setFirstOperand(true);
}
return child;
}
@@ -168,19 +168,19 @@ public class CustomCombinedFragmentCombinedFragmentCompartmentEditPart extends C
@Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(feature instanceof EStructuralFeature) {
- EStructuralFeature ref = (EStructuralFeature)feature;
+ if (feature instanceof EStructuralFeature) {
+ EStructuralFeature ref = (EStructuralFeature) feature;
String typeName = ref.getName();
- if(CHILDREN_TYPE.equals(typeName)) {
- if(event.getEventType() == Notification.UNSET || event.getEventType() == Notification.REMOVE) {
+ if (CHILDREN_TYPE.equals(typeName)) {
+ if (event.getEventType() == Notification.UNSET || event.getEventType() == Notification.REMOVE) {
List<?> children = getChildren();
- if(children != null && children.size() > 1) {
+ if (children != null && children.size() > 1) {
Object firstChild = children.get(0);
- if(firstChild instanceof CustomInteractionOperandEditPart) {
- CustomInteractionOperandEditPart firstOperandChild = (CustomInteractionOperandEditPart)firstChild;
+ if (firstChild instanceof CustomInteractionOperandEditPart) {
+ CustomInteractionOperandEditPart firstOperandChild = (CustomInteractionOperandEditPart) firstChild;
Object firstChildModel = firstOperandChild.getModel();
- if(firstChildModel != null && firstChildModel.equals(event.getOldValue()) && children.get(1) instanceof CustomInteractionOperandEditPart) {
- CustomInteractionOperandEditPart secondOperandChild = (CustomInteractionOperandEditPart)children.get(1);
+ if (firstChildModel != null && firstChildModel.equals(event.getOldValue()) && children.get(1) instanceof CustomInteractionOperandEditPart) {
+ CustomInteractionOperandEditPart secondOperandChild = (CustomInteractionOperandEditPart) children.get(1);
secondOperandChild.setFirstOperand(true);
}
}
@@ -192,11 +192,11 @@ public class CustomCombinedFragmentCombinedFragmentCompartmentEditPart extends C
}
public boolean ignoreRequest(Request request) {
- if(request instanceof ChangeBoundsRequest && (request.getType().equals(org.eclipse.gef.RequestConstants.REQ_ADD) || request.getType().equals(RequestConstants.REQ_DROP))) {
- List parts = ((ChangeBoundsRequest)request).getEditParts();
- if(parts != null) {
- for(Object obj : parts) {
- if(obj instanceof CommentEditPart || obj instanceof ConstraintEditPart || obj instanceof TimeObservationEditPart) {
+ if (request instanceof ChangeBoundsRequest && (request.getType().equals(org.eclipse.gef.RequestConstants.REQ_ADD) || request.getType().equals(RequestConstants.REQ_DROP))) {
+ List parts = ((ChangeBoundsRequest) request).getEditParts();
+ if (parts != null) {
+ for (Object obj : parts) {
+ if (obj instanceof CommentEditPart || obj instanceof ConstraintEditPart || obj instanceof TimeObservationEditPart) {
return true;
}
}
@@ -207,7 +207,7 @@ public class CustomCombinedFragmentCombinedFragmentCompartmentEditPart extends C
@Override
public void showTargetFeedback(Request request) {
- if(ignoreRequest(request)) {
+ if (ignoreRequest(request)) {
return;
}
super.showTargetFeedback(request);
@@ -215,7 +215,7 @@ public class CustomCombinedFragmentCombinedFragmentCompartmentEditPart extends C
@Override
public Command getCommand(Request request) {
- if(ignoreRequest(request)) {
+ if (ignoreRequest(request)) {
return null;
}
return super.getCommand(request);
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/CustomCombinedFragmentEditPart.java
index b3cce07e821..aff07686d2c 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/CustomCombinedFragmentEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -121,7 +121,7 @@ import org.eclipse.uml2.uml.UMLPackage;
/**
* Add implementing IPapyrusEditPart to displaying Stereotypes.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart implements ITextAwareEditPart, IPapyrusEditPart {
@@ -154,7 +154,7 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomCombinedFragmentEditPart(View view) {
@@ -170,18 +170,18 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
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
+ // Fixed bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=389531
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new GatesHolderGraphicalNodeEditPolicy());
installEditPolicy("Gate Creation Edit Policy", new GateCreationEditPolicy());
- //install a editpolicy to display stereotypes
+ // install a editpolicy to display stereotypes
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
- //ignore impact layout when head changed.
+ // ignore impact layout when head changed.
installEditPolicy(AbstractHeadImpactLayoutEditPolicy.HEAD_IMPACT_LAYOUT_POLICY, new CombinedFragmentHeadImpactLayoutEditPolicy());
}
/**
* Generated not for handle operator kind
- *
+ *
* @Override
*/
@Override
@@ -199,15 +199,16 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
return new BorderedNodeFigure(super.createNodeFigure());
}
+ @Override
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
}
public final BorderedNodeFigure getBorderedFigure() {
- return (BorderedNodeFigure)getFigure();
+ return (BorderedNodeFigure) getFigure();
}
@Override
@@ -225,8 +226,8 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
*/
@Override
protected void setLineWidth(int width) {
- if(primaryShape instanceof NodeFigure) {
- ((NodeFigure)primaryShape).setLineWidth(width);
+ if (primaryShape instanceof NodeFigure) {
+ ((NodeFigure) primaryShape).setLineWidth(width);
} else {
super.setLineWidth(width);
}
@@ -234,13 +235,13 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
@Override
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CombinedFragmentCombinedFragmentCompartmentEditPart) {
+ if (childEditPart instanceof CombinedFragmentCombinedFragmentCompartmentEditPart) {
IFigure pane = getPrimaryShape().getCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.remove(((CombinedFragmentCombinedFragmentCompartmentEditPart)childEditPart).getFigure());
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.remove(((CombinedFragmentCombinedFragmentCompartmentEditPart) childEditPart).getFigure());
return true;
- } else if(childEditPart instanceof GateEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((GateEditPart)childEditPart).getFigure());
+ } else if (childEditPart instanceof GateEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((GateEditPart) childEditPart).getFigure());
return true;
}
return false;
@@ -248,14 +249,14 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentEditPart#addFixedChild(org.eclipse.gef.EditPart)
- *
+ *
* @param childEditPart
* @return
*/
@Override
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof GateEditPart) {
- getBorderedFigure().getBorderItemContainer().add(((GateEditPart)childEditPart).getFigure(), new GateLocator((GateEditPart)childEditPart, getFigure()));
+ if (childEditPart instanceof GateEditPart) {
+ getBorderedFigure().getBorderItemContainer().add(((GateEditPart) childEditPart).getFigure(), new GateLocator((GateEditPart) childEditPart, getFigure()));
return true;
}
return super.addFixedChild(childEditPart);
@@ -264,10 +265,10 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
public List<CustomInteractionOperandEditPart> getOperandChildrenEditParts() {
List<CustomInteractionOperandEditPart> children = new LinkedList<CustomInteractionOperandEditPart>();
IGraphicalEditPart compartment = getChildBySemanticHint(String.valueOf(CombinedFragmentCombinedFragmentCompartmentEditPart.VISUAL_ID));
- if(compartment instanceof CombinedFragmentCombinedFragmentCompartmentEditPart) {
- for(Object ep : compartment.getChildren()) {
- if(ep instanceof CustomInteractionOperandEditPart) {
- children.add((CustomInteractionOperandEditPart)ep);
+ if (compartment instanceof CombinedFragmentCombinedFragmentCompartmentEditPart) {
+ for (Object ep : compartment.getChildren()) {
+ if (ep instanceof CustomInteractionOperandEditPart) {
+ children.add((CustomInteractionOperandEditPart) ep);
}
}
}
@@ -280,23 +281,23 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
@Override
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(UMLPackage.eINSTANCE.getCombinedFragment_InteractionOperator().equals(feature)) {
- CombinedFragment combinedFragment = (CombinedFragment)resolveSemanticElement();
+ if (UMLPackage.eINSTANCE.getCombinedFragment_InteractionOperator().equals(feature)) {
+ CombinedFragment combinedFragment = (CombinedFragment) resolveSemanticElement();
String newStringValue = notification.getNewStringValue();
- if(notification.getOldValue() instanceof InteractionOperatorKind && !isAllowedInteractionOperator(newStringValue)) {
+ if (notification.getOldValue() instanceof InteractionOperatorKind && !isAllowedInteractionOperator(newStringValue)) {
MessageDialog.openError(Display.getCurrent().getActiveShell(), FORBIDDEN_ACTION, FORBIDEN_OPERATOR_MODIFICATION_MSG);
CommandHelper.executeCommandWithoutHistory(getEditingDomain(), SetCommand.create(getEditingDomain(), combinedFragment, feature, notification.getOldValue()), true);
return;
}
EList<InteractionOperand> operands = combinedFragment.getOperands();
- if(operands == null || operands.size() <= 1) {
+ if (operands == null || operands.size() <= 1) {
// If CombinedFragment have no operand, we can change the
// OperatorKind
updateHeaderLabel();
} else {
- if(notification.getOldValue() instanceof InteractionOperatorKind) {
- InteractionOperatorKind newValue = (InteractionOperatorKind)notification.getNewValue();
- if(!InteractionOperatorKindCompatibleMapping.supportMultiOperand(newValue)) {
+ if (notification.getOldValue() instanceof InteractionOperatorKind) {
+ InteractionOperatorKind newValue = (InteractionOperatorKind) notification.getNewValue();
+ if (!InteractionOperatorKindCompatibleMapping.supportMultiOperand(newValue)) {
MessageDialog.openError(Display.getCurrent().getActiveShell(), FORBIDDEN_ACTION, BLOCK_OPERATOR_MODIFICATION_MSG);
CommandHelper.executeCommandWithoutHistory(getEditingDomain(), SetCommand.create(getEditingDomain(), combinedFragment, feature, notification.getOldValue()), true);
} else {
@@ -314,18 +315,19 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
* }
*/
// update guards on enclosed operands
- for(CustomInteractionOperandEditPart ioep : getOperandChildrenEditParts()) {
+ for (CustomInteractionOperandEditPart ioep : getOperandChildrenEditParts()) {
ioep.updateConstraintLabel();
}
- } else if(UMLPackage.eINSTANCE.getCombinedFragment_Operand().equals(feature)) {
+ } else if (UMLPackage.eINSTANCE.getCombinedFragment_Operand().equals(feature)) {
// Case only call by the model explorer
- CombinedFragment combinedFragment = (CombinedFragment)resolveSemanticElement();
+ CombinedFragment combinedFragment = (CombinedFragment) resolveSemanticElement();
InteractionOperatorKind interactionOperator = combinedFragment.getInteractionOperator();
Object newValue = notification.getNewValue();
- if(interactionOperator != null && newValue != null) {
- if(InteractionOperatorKind.OPT_LITERAL.equals(interactionOperator) || InteractionOperatorKind.LOOP_LITERAL.equals(interactionOperator) || InteractionOperatorKind.BREAK_LITERAL.equals(interactionOperator) || InteractionOperatorKind.NEG_LITERAL.equals(interactionOperator)) {
+ if (interactionOperator != null && newValue != null) {
+ if (InteractionOperatorKind.OPT_LITERAL.equals(interactionOperator) || InteractionOperatorKind.LOOP_LITERAL.equals(interactionOperator) || InteractionOperatorKind.BREAK_LITERAL.equals(interactionOperator)
+ || InteractionOperatorKind.NEG_LITERAL.equals(interactionOperator)) {
EList<InteractionOperand> operands = combinedFragment.getOperands();
- if(operands != null && operands.size() > 1) {
+ if (operands != null && operands.size() > 1) {
// Case of there is already an operand on opt, loop, break and neg
// CombinedFragment type
MessageDialog.openError(Display.getCurrent().getActiveShell(), FORBIDDEN_ACTION, BLOCK_OPERAND_ADDITION_MSG);
@@ -334,43 +336,44 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
}
}
}
- } else if(UMLPackage.eINSTANCE.getInteractionFragment_Covered().equals(feature)) {
- if(notification.getNotifier() instanceof CombinedFragment) {
+ } else if (UMLPackage.eINSTANCE.getInteractionFragment_Covered().equals(feature)) {
+ if (notification.getNotifier() instanceof CombinedFragment) {
// Synchronize operands' covered lifelines with combined fragment's covered lifelines
- CombinedFragment combinedFragment = (CombinedFragment)notification.getNotifier();
+ CombinedFragment combinedFragment = (CombinedFragment) notification.getNotifier();
EList<Lifeline> combinedFragmentCoveredLifelines = combinedFragment.getCovereds();
- for(InteractionOperand operand : combinedFragment.getOperands()) {
+ for (InteractionOperand operand : combinedFragment.getOperands()) {
EList<Lifeline> operandCoveredLifelines = operand.getCovereds();
- if(!operandCoveredLifelines.equals(combinedFragmentCoveredLifelines)) {
+ if (!operandCoveredLifelines.equals(combinedFragmentCoveredLifelines)) {
// Add new covered lifelines (not already covered)
List<Lifeline> coveredLifelinesToAdd = new ArrayList<Lifeline>(combinedFragmentCoveredLifelines);
coveredLifelinesToAdd.removeAll(operandCoveredLifelines);
- if(!coveredLifelinesToAdd.isEmpty()) {
+ if (!coveredLifelinesToAdd.isEmpty()) {
CommandHelper.executeCommandWithoutHistory(getEditingDomain(), AddCommand.create(getEditingDomain(), operand, UMLPackage.eINSTANCE.getInteractionFragment_Covered(), coveredLifelinesToAdd), true);
}
// Delete old covered lifelines (not covered anymore)
List<Lifeline> coveredLifelinesToRemove = new ArrayList<Lifeline>(operandCoveredLifelines);
coveredLifelinesToRemove.removeAll(combinedFragmentCoveredLifelines);
- if(!coveredLifelinesToRemove.isEmpty()) {
+ if (!coveredLifelinesToRemove.isEmpty()) {
CommandHelper.executeCommandWithoutHistory(getEditingDomain(), RemoveCommand.create(getEditingDomain(), operand, UMLPackage.eINSTANCE.getInteractionFragment_Covered(), coveredLifelinesToRemove), true);
}
}
}
}
- } else if(UMLPackage.eINSTANCE.getNamedElement_Name().equals(feature)) {
- if(notification.getNotifier() instanceof CombinedFragment) {
+ } else if (UMLPackage.eINSTANCE.getNamedElement_Name().equals(feature)) {
+ if (notification.getNotifier() instanceof CombinedFragment) {
refreshLabel();
}
}
- if(notification.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.QUALIFIED_NAME.equals(((EAnnotation)notification.getNewValue()).getSource())) {
+ if (notification.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.QUALIFIED_NAME.equals(((EAnnotation) notification.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(notification);
- //fixed bug (id=364711) when bounds changed update coveredBys with the figure's bounds.
- if(notification.getNotifier() instanceof Bounds) {
- if(notification.getNotifier() instanceof Bounds) {
+ // fixed bug (id=364711) when bounds changed update coveredBys with the figure's bounds.
+ if (notification.getNotifier() instanceof Bounds) {
+ if (notification.getNotifier() instanceof Bounds) {
Display.getDefault().asyncExec(new Runnable() {
+ @Override
public void run() {
LifelineCoveredByUpdater updater = new LifelineCoveredByUpdater();
updater.update(CustomCombinedFragmentEditPart.this);
@@ -378,21 +381,21 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
});
}
}
- if((getModel() != null) && (getModel() == notification.getNotifier())) {
- if(NotationPackage.eINSTANCE.getLineStyle_LineWidth().equals(feature)) {
+ if ((getModel() != null) && (getModel() == notification.getNotifier())) {
+ if (NotationPackage.eINSTANCE.getLineStyle_LineWidth().equals(feature)) {
refreshLineWidth();
}
}
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
refreshShadow();
}
- if(ElementIconUtil.isIconNotification(notification)) {
+ if (ElementIconUtil.isIconNotification(notification)) {
refreshLabelIcon();
}
}
protected void refreshShadow() {
- getPrimaryShape().setShadow(ShadowFigureHelper.getShadowFigureValue((View)getModel()));
+ getPrimaryShape().setShadow(ShadowFigureHelper.getShadowFigureValue((View) getModel()));
}
/**
@@ -409,9 +412,10 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
@Override
protected void setGradient(GradientData gradient) {
IPapyrusNodeFigure fig = getPrimaryShape();
- FillStyle style = (FillStyle)getPrimaryView().getStyle(NotationPackage.Literals.FILL_STYLE);
- if(gradient != null) {
- fig.setIsUsingGradient(true);;
+ FillStyle style = (FillStyle) getPrimaryView().getStyle(NotationPackage.Literals.FILL_STYLE);
+ if (gradient != null) {
+ fig.setIsUsingGradient(true);
+ ;
fig.setGradientData(style.getFillColor(), gradient.getGradientColor1(), gradient.getGradientStyle());
} else {
fig.setIsUsingGradient(false);
@@ -436,8 +440,8 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
*/
protected void updateHeaderLabel() {
Object element = resolveSemanticElement();
- if(element instanceof CombinedFragment) {
- CombinedFragment combinedFragment = (CombinedFragment)element;
+ if (element instanceof CombinedFragment) {
+ CombinedFragment combinedFragment = (CombinedFragment) element;
String operatorKind = combinedFragment.getInteractionOperator().getName();
getPrimaryShape().getHeaderLabel().setText(operatorKind);
}
@@ -445,9 +449,9 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
/**
* Return true if the InteractionOperatorKind is allowed
- *
+ *
* @param interactionOperatorLiteral
- * The InteractionOperator to test
+ * The InteractionOperator to test
* @return true if allowed
*/
protected boolean isAllowedInteractionOperator(String interactionOperatorLiteral) {
@@ -457,9 +461,10 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
@Override
protected void addNotationalListeners() {
super.addNotationalListeners();
- if(this.propertyListener == null) {
+ if (this.propertyListener == null) {
this.propertyListener = new IEclipsePreferences.IPreferenceChangeListener() {
+ @Override
public void preferenceChange(PreferenceChangeEvent event) {
handlePreferenceChange(event);
}
@@ -469,11 +474,11 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
}
protected void handlePreferenceChange(PreferenceChangeEvent event) {
- if(getParent() == null) {
+ if (getParent() == null) {
return;
}
String key = event.getKey();
- if(key.equals(getTitlePreferenceKey())) {
+ if (key.equals(getTitlePreferenceKey())) {
refreshLabel();
}
}
@@ -501,11 +506,11 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
// update label visibility and text
private void refreshLabel() {
Object element = resolveSemanticElement();
- if(element instanceof CombinedFragment) {
- CombinedFragment combinedFragment = (CombinedFragment)element;
+ if (element instanceof CombinedFragment) {
+ CombinedFragment combinedFragment = (CombinedFragment) element;
String name = combinedFragment.getName();
int depth = AppearanceHelper.getQualifiedNameDepth(this.getNotationView());
- if(depth == 0) { // full qualified
+ if (depth == 0) { // full qualified
name = combinedFragment.getQualifiedName();
}
WrappingLabel label = getPrimaryShape().getTitleLabel();
@@ -517,28 +522,28 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
}
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
WrappingLabel label = this.getPrimaryShape().getTitleLabel();
manager = new TextDirectEditManager(this, TextCellEditorEx.class, new TextCellEditorLocator(label) {
@Override
public void relocate(CellEditor celleditor) {
- Text text = (Text)celleditor.getControl();
+ Text text = (Text) celleditor.getControl();
Rectangle rect = getWrapLabel().getBounds().getCopy();
getWrapLabel().translateToAbsolute(rect);
Point right = rect.getRight();
- if(!text.getFont().isDisposed()) {
- if(getWrapLabel().isTextWrapOn() && getWrapLabel().getText().length() > 0) {
+ if (!text.getFont().isDisposed()) {
+ if (getWrapLabel().isTextWrapOn() && getWrapLabel().getText().length() > 0) {
rect.setSize(new Dimension(text.computeSize(rect.width, SWT.DEFAULT)));
} else {
int avr = org.eclipse.draw2d.FigureUtilities.getFontMetrics(text.getFont()).getAverageCharWidth();
rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT, SWT.DEFAULT)).expand(avr * 2, 0));
}
- if(rect.getRight().x > right.x) { // should not exceed right border
+ if (rect.getRight().x > right.x) { // should not exceed right border
rect.translate(right.x - rect.getRight().x, 0);
}
}
- if(!rect.equals(new Rectangle(text.getBounds()))) {
+ if (!rect.equals(new Rectangle(text.getBounds()))) {
text.setBounds(rect.x, rect.y, rect.width, rect.height);
}
}
@@ -549,11 +554,11 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
@Override
protected void performDirectEditRequest(Request request) {
- if(request instanceof DirectEditRequest) {
+ if (request instanceof DirectEditRequest) {
WrappingLabel label = getPrimaryShape().getTitleLabel();
- Point location = ((DirectEditRequest)request).getLocation().getCopy();
- label.translateToRelative(location); // convert request location to relative
- if(label.containsPoint(location)) {
+ Point location = ((DirectEditRequest) request).getLocation().getCopy();
+ label.translateToRelative(location); // convert request location to relative
+ if (label.containsPoint(location)) {
getManager().show();
}
}
@@ -563,49 +568,57 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
return resolveSemanticElement();
}
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = new CombinedFragmentTitleParser();
}
return parser;
}
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
}
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
}
+ @Override
public void setLabelText(String text) {
WrappingLabel label = this.getPrimaryShape().getTitleLabel();
label.setText(text);
}
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
- if(element != null && parser != null) {
+ if (element != null && parser != null) {
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -628,23 +641,23 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
@Override
protected Command getDirectEditCommand(DirectEditRequest edit) {
- String labelText = (String)edit.getCellEditor().getValue();
- //for CellEditor, null is always returned for invalid values
- if(labelText == null) {
+ String labelText = (String) edit.getCellEditor().getValue();
+ // for CellEditor, null is always returned for invalid values
+ if (labelText == null) {
return null;
}
- ITextAwareEditPart compartment = (ITextAwareEditPart)getHost();
- EObject model = (EObject)compartment.getModel();
+ ITextAwareEditPart compartment = (ITextAwareEditPart) getHost();
+ EObject model = (EObject) compartment.getModel();
EObjectAdapter elementAdapter = null;
- if(model instanceof View) {
- View view = (View)model;
+ if (model instanceof View) {
+ View view = (View) model;
elementAdapter = new EObjectAdapterEx(ViewUtil.resolveSemanticElement(view), view);
} else {
elementAdapter = new EObjectAdapterEx(model, null);
}
String prevText = compartment.getParser().getEditString(elementAdapter, compartment.getParserOptions().intValue());
// check to make sure an edit has occurred before returning a command.
- if(!prevText.equals(labelText)) {
+ if (!prevText.equals(labelText)) {
ICommand iCommand = compartment.getParser().getParseCommand(elementAdapter, labelText, 0);
return new ICommandProxy(iCommand);
}
@@ -653,7 +666,7 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
@Override
protected void showCurrentEditValue(DirectEditRequest request) {
- String value = (String)request.getCellEditor().getValue();
+ String value = (String) request.getCellEditor().getValue();
WrappingLabel label = getPrimaryShape().getTitleLabel();
label.setText(value);
}
@@ -662,18 +675,20 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
static class CombinedFragmentTitleParser extends MessageFormatParser implements ISemanticParser {
public CombinedFragmentTitleParser() {
- super(new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() });
+ super(new EAttribute[] { UMLPackage.eINSTANCE.getNamedElement_Name() });
}
+ @Override
public List getSemanticElementsBeingParsed(EObject element) {
List<Element> semanticElementsBeingParsed = new ArrayList<Element>();
- if(element instanceof CombinedFragment) {
- CombinedFragment cf = (CombinedFragment)element;
+ if (element instanceof CombinedFragment) {
+ CombinedFragment cf = (CombinedFragment) element;
semanticElementsBeingParsed.add(cf);
}
return semanticElementsBeingParsed;
}
+ @Override
public boolean areSemanticElementsAffected(EObject listener, Object notification) {
EStructuralFeature feature = getEStructuralFeature(notification);
return isValidFeature(feature);
@@ -688,8 +703,8 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
@Override
public String getPrintString(IAdaptable element, int flags) {
Object adapter = element.getAdapter(EObject.class);
- if(adapter instanceof CombinedFragment) {
- CombinedFragment cf = (CombinedFragment)adapter;
+ if (adapter instanceof CombinedFragment) {
+ CombinedFragment cf = (CombinedFragment) adapter;
return cf.getName();
}
return "";
@@ -702,9 +717,9 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
@Override
public ICommand getParseCommand(IAdaptable adapter, String newString, int flags) {
- EObject element = (EObject)adapter.getAdapter(EObject.class);
+ EObject element = (EObject) adapter.getAdapter(EObject.class);
TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(element);
- if(editingDomain == null || !(element instanceof CombinedFragment)) {
+ if (editingDomain == null || !(element instanceof CombinedFragment)) {
return UnexecutableCommand.INSTANCE;
}
SetRequest request = new SetRequest(element, UMLPackage.eINSTANCE.getNamedElement_Name(), newString);
@@ -714,8 +729,8 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
@Override
public String getEditString(IAdaptable element, int flags) {
Object adapter = element.getAdapter(EObject.class);
- if(adapter instanceof CombinedFragment) {
- CombinedFragment cf = (CombinedFragment)adapter;
+ if (adapter instanceof CombinedFragment) {
+ CombinedFragment cf = (CombinedFragment) adapter;
return cf.getName();
}
return "";
@@ -723,10 +738,10 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
protected EStructuralFeature getEStructuralFeature(Object notification) {
EStructuralFeature featureImpl = null;
- if(notification instanceof Notification) {
- Object feature = ((Notification)notification).getFeature();
- if(feature instanceof EStructuralFeature) {
- featureImpl = (EStructuralFeature)feature;
+ if (notification instanceof Notification) {
+ Object feature = ((Notification) notification).getFeature();
+ if (feature instanceof EStructuralFeature) {
+ featureImpl = (EStructuralFeature) feature;
}
}
return featureImpl;
@@ -743,11 +758,11 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
/**
* constructor
- *
+ *
* @param element
- * element to be wrapped
+ * element to be wrapped
* @param view
- * view to be wrapped
+ * view to be wrapped
*/
public EObjectAdapterEx(EObject element, View view) {
super(element);
@@ -757,10 +772,10 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
@Override
public Object getAdapter(Class adapter) {
Object o = super.getAdapter(adapter);
- if(o != null) {
+ if (o != null) {
return o;
}
- if(adapter.equals(View.class)) {
+ if (adapter.equals(View.class)) {
return view;
}
return null;
@@ -785,22 +800,22 @@ public class CustomCombinedFragmentEditPart extends CombinedFragmentEditPart imp
min.width = mmode.LPtoDP(min.width);
max.height = mmode.LPtoDP(max.height);
max.width = mmode.LPtoDP(max.width);
- if(min.width > rect.width) {
+ if (min.width > rect.width) {
rect.width = min.width;
- if(request.getMoveDelta().x > 0 && request.getSizeDelta().width < 0) { // shrinking from left
+ if (request.getMoveDelta().x > 0 && request.getSizeDelta().width < 0) { // shrinking from left
rect.x = old.getRight().x - min.width;
request.getMoveDelta().x = rect.x - old.getLeft().x;
}
- } else if(max.width < rect.width) {
+ } else if (max.width < rect.width) {
rect.width = max.width;
}
- if(min.height > rect.height) {
+ if (min.height > rect.height) {
rect.height = min.height;
- if(request.getMoveDelta().y > 0 && request.getSizeDelta().height < 0) { // shrinking from upper
+ if (request.getMoveDelta().y > 0 && request.getSizeDelta().height < 0) { // shrinking from upper
rect.y = old.getBottom().y - min.height;
request.getMoveDelta().y = rect.y - old.getTop().y;
}
- } else if(max.height < rect.height) {
+ } else if (max.height < rect.height) {
rect.height = max.height;
}
feedback.translateToRelative(rect);
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 1f1c3569a00..a204f1bd36c 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -38,7 +38,7 @@ public class CustomCommentAnnotatedElementEditPart extends CommentAnnotatedEleme
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomCommentAnnotatedElementEditPart(View view) {
@@ -54,9 +54,10 @@ public class CustomCommentAnnotatedElementEditPart extends CommentAnnotatedEleme
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomCommentAnnotatedElementItemSemanticEditPolicy());
}
+ @Override
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
- if(LinkRouteModelElementFactory.isRoutingNotification(event)) {
+ if (LinkRouteModelElementFactory.isRoutingNotification(event)) {
installRouter();
}
}
@@ -65,14 +66,14 @@ public class CustomCommentAnnotatedElementEditPart extends CommentAnnotatedEleme
@Override
protected void installRouter() {
- if(this.getSource() instanceof CustomDurationConstraintEditPart) {
- ConnectionLayer cLayer = (ConnectionLayer)getLayer(LayerConstants.CONNECTION_LAYER);
- RoutingStyle style = (RoutingStyle)((View)getModel()).getStyle(NotationPackage.Literals.ROUTING_STYLE);
- if(style != null && cLayer instanceof ConnectionLayerEx) {
- ConnectionLayerEx cLayerEx = (ConnectionLayerEx)cLayer;
- if(LinkRouteModelElementFactory.isAutomaticRouting(this.getNotationView())) {
- CustomDurationConstraintEditPart customDurationConstraintEditPart = (CustomDurationConstraintEditPart)this.getSource();
- if(customRouter == null) {
+ if (this.getSource() instanceof CustomDurationConstraintEditPart) {
+ ConnectionLayer cLayer = (ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER);
+ RoutingStyle style = (RoutingStyle) ((View) getModel()).getStyle(NotationPackage.Literals.ROUTING_STYLE);
+ if (style != null && cLayer instanceof ConnectionLayerEx) {
+ ConnectionLayerEx cLayerEx = (ConnectionLayerEx) cLayer;
+ if (LinkRouteModelElementFactory.isAutomaticRouting(this.getNotationView())) {
+ CustomDurationConstraintEditPart customDurationConstraintEditPart = (CustomDurationConstraintEditPart) this.getSource();
+ if (customRouter == null) {
FanRouter router = new FanRouter();
router.setNextRouter(new DurationConstraintAutomaticRouter(this.getNotationView()));
customRouter = router;
@@ -91,12 +92,13 @@ public class CustomCommentAnnotatedElementEditPart extends CommentAnnotatedEleme
@Override
public void setSource(EditPart editPart) {
super.setSource(editPart);
- //Fixed bug about duration constraint links' automatic router.
- if(editPart instanceof CustomDurationConstraintEditPart) {
+ // Fixed bug about duration constraint links' automatic router.
+ if (editPart instanceof CustomDurationConstraintEditPart) {
installRouter();
}
}
+ @Override
public DragTracker getDragTracker(final Request req) {
return new SelectConnectionEditPartTrackerEx(this);
}
@@ -107,8 +109,9 @@ public class CustomCommentAnnotatedElementEditPart extends CommentAnnotatedEleme
super(owner);
}
+ @Override
protected boolean handleDragInProgress() {
- if(isInState(STATE_DRAG_IN_PROGRESS) && shouldAllowDrag()) {
+ if (isInState(STATE_DRAG_IN_PROGRESS) && shouldAllowDrag()) {
LinkRouteModelElementFactory.switchToManualRouting(getEdge());
super.handleDragInProgress();
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCommentBodyEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCommentBodyEditPart.java
index 25bc7205f3b..7deb5c7facd 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCommentBodyEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomCommentBodyEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -26,7 +26,7 @@ public class CustomCommentBodyEditPart extends CommentBodyEditPart {
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomCommentBodyEditPart(View view) {
@@ -35,8 +35,8 @@ public class CustomCommentBodyEditPart extends CommentBodyEditPart {
@Override
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof HTMLCornerBentFigure) {
- ((HTMLCornerBentFigure)figure).setAppliedStereotypeIcon(icon);
+ if (figure instanceof HTMLCornerBentFigure) {
+ ((HTMLCornerBentFigure) figure).setAppliedStereotypeIcon(icon);
} else {
super.setLabelIconHelper(figure, icon);
}
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 092025e6c96..7b638e11935 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -27,7 +27,7 @@ public class CustomCommentEditPart extends CommentEditPart {
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomCommentEditPart(View view) {
@@ -45,8 +45,8 @@ public class CustomCommentEditPart extends CommentEditPart {
@Override
protected void setLineWidth(int width) {
- if(primaryShape instanceof NodeFigure) {
- ((NodeFigure)primaryShape).setLineWidth(width);
+ if (primaryShape instanceof NodeFigure) {
+ ((NodeFigure) primaryShape).setLineWidth(width);
}
super.setLineWidth(width);
}
@@ -59,8 +59,8 @@ public class CustomCommentEditPart extends CommentEditPart {
@Override
protected void refreshTransparency() {
- FillStyle style = (FillStyle)getPrimaryView().getStyle(NotationPackage.Literals.FILL_STYLE);
- if(style != null) {
+ FillStyle style = (FillStyle) getPrimaryView().getStyle(NotationPackage.Literals.FILL_STYLE);
+ if (style != null) {
setTransparency(style.getTransparency());
}
}
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 deef5bb44b2..f81964bf6b6 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -50,7 +50,7 @@ public class CustomConsiderIgnoreFragmentEditPart extends CustomCombinedFragment
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomConsiderIgnoreFragmentEditPart(View view) {
@@ -61,11 +61,11 @@ public class CustomConsiderIgnoreFragmentEditPart extends CustomCombinedFragment
* Try to use the notifier from super class, if not exist, create new one.
*/
protected NotificationHelper getNotifier() {
- if(notifier == null) {
+ if (notifier == null) {
try {
Field f = ConsiderIgnoreFragmentEditPart.class.getDeclaredField("notifier");
f.setAccessible(true);
- notifier = (NotificationHelper)f.get(this);
+ notifier = (NotificationHelper) f.get(this);
} catch (Exception e) {
notifier = new NotificationHelper(new UIAdapterImpl() {
@@ -105,19 +105,19 @@ public class CustomConsiderIgnoreFragmentEditPart extends CustomCombinedFragment
protected void handleNotificationEvent(Notification notification) {
final NotificationHelper notifier = getNotifier();
Object feature = notification.getFeature();
- if(UMLPackage.eINSTANCE.getConsiderIgnoreFragment_Message().equals(feature)) {
+ if (UMLPackage.eINSTANCE.getConsiderIgnoreFragment_Message().equals(feature)) {
// Handle message creation
Object newValue = notification.getNewValue();
// TODO Filter NamedElements type for message on higher level
- if(newValue == null || newValue instanceof Operation || newValue instanceof Reception || newValue instanceof Signal) {
+ if (newValue == null || newValue instanceof Operation || newValue instanceof Reception || newValue instanceof Signal) {
updateHeaderLabel();
- notifier.unlistenObject((Notifier)notification.getOldValue());
- notifier.listenObject((Notifier)notification.getNewValue());
+ notifier.unlistenObject((Notifier) notification.getOldValue());
+ notifier.listenObject((Notifier) notification.getNewValue());
} else {
- ConsiderIgnoreFragment considerIgnoreFragment = (ConsiderIgnoreFragment)resolveSemanticElement();
+ ConsiderIgnoreFragment considerIgnoreFragment = (ConsiderIgnoreFragment) resolveSemanticElement();
considerIgnoreFragment.getMessages().remove(newValue);
}
- } else if(UMLPackage.eINSTANCE.getNamedElement_Name().equals(feature)) {
+ } else if (UMLPackage.eINSTANCE.getNamedElement_Name().equals(feature)) {
// Handle message modification
updateHeaderLabel();
}
@@ -127,20 +127,21 @@ public class CustomConsiderIgnoreFragmentEditPart extends CustomCombinedFragment
/**
* Update operator kind
*/
+ @Override
protected void updateHeaderLabel() {
- ConsiderIgnoreFragment considerIgnoreFragment = (ConsiderIgnoreFragment)resolveSemanticElement();
+ ConsiderIgnoreFragment considerIgnoreFragment = (ConsiderIgnoreFragment) resolveSemanticElement();
StringBuilder operatorKind = new StringBuilder();
operatorKind.append(considerIgnoreFragment.getInteractionOperator().getName());
EList<NamedElement> messages = considerIgnoreFragment.getMessages();
- if(messages != null && messages.size() > 0) {
+ if (messages != null && messages.size() > 0) {
StringBuilder sb = new StringBuilder();
- for(int i = 0; i < messages.size(); i++) {
+ for (int i = 0; i < messages.size(); i++) {
String name = messages.get(i).getName();
- if(name != null) {
+ if (name != null) {
sb.append(name).append(",");
}
}
- if(sb.length() > 0) {
+ if (sb.length() > 0) {
operatorKind.append(" {").append(sb.deleteCharAt(sb.length() - 1).toString()).append("}");
}
}
@@ -149,11 +150,12 @@ public class CustomConsiderIgnoreFragmentEditPart extends CustomCombinedFragment
/**
* Return true if the InteractionOperatorKind is allowed
- *
+ *
* @param interactionOperatorLiteral
- * The InteractionOperator to test
+ * The InteractionOperator to test
* @return true if allowed
*/
+ @Override
protected boolean isAllowedInteractionOperator(String interactionOperatorLiteral) {
return InteractionOperatorKind.CONSIDER_LITERAL.getLiteral().equals(interactionOperatorLiteral) || InteractionOperatorKind.IGNORE_LITERAL.getLiteral().equals(interactionOperatorLiteral);
}
@@ -165,8 +167,8 @@ public class CustomConsiderIgnoreFragmentEditPart extends CustomCombinedFragment
public void activate() {
super.activate();
final NotificationHelper notifier = getNotifier();
- ConsiderIgnoreFragment considerIgnoreFragment = (ConsiderIgnoreFragment)resolveSemanticElement();
- for(NamedElement message : considerIgnoreFragment.getMessages()) {
+ ConsiderIgnoreFragment considerIgnoreFragment = (ConsiderIgnoreFragment) resolveSemanticElement();
+ for (NamedElement message : considerIgnoreFragment.getMessages()) {
notifier.listenObject(message);
}
}
@@ -178,7 +180,7 @@ public class CustomConsiderIgnoreFragmentEditPart extends CustomCombinedFragment
@Override
public void deactivate() {
super.deactivate();
- if(notifier != null) {
+ if (notifier != null) {
notifier.unlistenAll();
}
}
@@ -188,12 +190,13 @@ public class CustomConsiderIgnoreFragmentEditPart extends CustomCombinedFragment
*/
@Override
public void removeNotify() {
- if(notifier != null) {
+ if (notifier != null) {
notifier.unlistenAll();
}
super.removeNotify();
}
+ @Override
public String getTitlePreferenceKey() {
return "ELEMENT_PapyrusUMLSequenceDiagram_ConsiderIgnoreFragment_CombinedFragmentCompartment.compartment_name.visibility";
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomConstraint2EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomConstraint2EditPart.java
index c0216bd98fe..eca796176cf 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomConstraint2EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomConstraint2EditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -26,7 +26,7 @@ public class CustomConstraint2EditPart extends Constraint2EditPart {
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomConstraint2EditPart(View view) {
@@ -35,8 +35,8 @@ public class CustomConstraint2EditPart extends Constraint2EditPart {
@Override
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof ConstraintFigure) {
- ((ConstraintFigure)figure).setAppliedStereotypeIcon(icon);
+ if (figure instanceof ConstraintFigure) {
+ ((ConstraintFigure) figure).setAppliedStereotypeIcon(icon);
}
super.setLabelIconHelper(figure, icon);
}
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
index 8f086b5ee67..bf0b096cf4b 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -24,7 +24,7 @@ public class CustomConstraintConstrainedElementEditPart extends ConstraintConstr
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomConstraintConstrainedElementEditPart(View view) {
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 73643dd8870..4053f9766f5 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -34,7 +34,7 @@ public class CustomConstraintEditPart extends ConstraintEditPart {
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomConstraintEditPart(View view) {
@@ -61,13 +61,13 @@ public class CustomConstraintEditPart extends ConstraintEditPart {
@Override
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
- if(event.getFeature() instanceof EReference) {
- EReference ref = (EReference)event.getFeature();
- if("specification".equals(ref.getName())) {
+ if (event.getFeature() instanceof EReference) {
+ EReference ref = (EReference) event.getFeature();
+ if ("specification".equals(ref.getName())) {
List parts = getChildren();
- for(Object p : parts) {
- if(p instanceof Constraint2EditPart) {
- ((Constraint2EditPart)p).handleNotificationEvent(event);
+ for (Object p : parts) {
+ if (p instanceof Constraint2EditPart) {
+ ((Constraint2EditPart) p).handleNotificationEvent(event);
}
}
}
@@ -76,17 +76,17 @@ public class CustomConstraintEditPart extends ConstraintEditPart {
@Override
protected void setLineWidth(int width) {
- if(primaryShape instanceof NodeFigure) {
- ((NodeFigure)primaryShape).setLineWidth(width);
+ if (primaryShape instanceof NodeFigure) {
+ ((NodeFigure) primaryShape).setLineWidth(width);
}
super.setLineWidth(width);
}
protected void refreshLabel() {
List parts = getChildren();
- for(Object p : parts) {
- if(p instanceof Constraint2EditPart) {
- ((Constraint2EditPart)p).refreshLabel();
+ for (Object p : parts) {
+ if (p instanceof Constraint2EditPart) {
+ ((Constraint2EditPart) p).refreshLabel();
}
}
}
@@ -100,12 +100,12 @@ public class CustomConstraintEditPart extends ConstraintEditPart {
@Override
protected void refreshTransparency() {
- FillStyle style = (FillStyle)getPrimaryView().getStyle(NotationPackage.Literals.FILL_STYLE);
- if(style != null) {
+ FillStyle style = (FillStyle) getPrimaryView().getStyle(NotationPackage.Literals.FILL_STYLE);
+ if (style != null) {
setTransparency(style.getTransparency());
}
}
-
+
@Override
protected IElementType elementTypeOfToolAfterCreation() {
return UMLElementTypes.ConstraintContext_8500;
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 96e64ae5f27..ae8965ab67d 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -33,7 +33,7 @@ public class CustomContinuationEditPart extends ContinuationEditPart implements
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomContinuationEditPart(View view) {
@@ -54,19 +54,19 @@ public class CustomContinuationEditPart extends ContinuationEditPart implements
*/
@Override
protected void handleNotificationEvent(Notification notification) {
- if(UMLPackage.eINSTANCE.getContinuation_Setting().equals(notification.getFeature())) {
+ if (UMLPackage.eINSTANCE.getContinuation_Setting().equals(notification.getFeature())) {
IBorderItemLocator borderItemLocator = getBorderItemLocator();
- int newValue = (Boolean)notification.getNewValue() ? PositionConstants.SOUTH : PositionConstants.NORTH;
- if(borderItemLocator instanceof ContinuationLocator) {
- ((ContinuationLocator)borderItemLocator).setPreferredSideOfParent(newValue);
+ int newValue = (Boolean) notification.getNewValue() ? PositionConstants.SOUTH : PositionConstants.NORTH;
+ if (borderItemLocator instanceof ContinuationLocator) {
+ ((ContinuationLocator) borderItemLocator).setPreferredSideOfParent(newValue);
// Refresh the position of the figure
borderItemLocator.relocate(this.getFigure());
}
}
super.handleNotificationEvent(notification);
Object feature = notification.getFeature();
- if((getModel() != null) && (getModel() == notification.getNotifier())) {
- if(NotationPackage.eINSTANCE.getLineStyle_LineWidth().equals(feature)) {
+ if ((getModel() != null) && (getModel() == notification.getNotifier())) {
+ if (NotationPackage.eINSTANCE.getLineStyle_LineWidth().equals(feature)) {
refreshLineWidth();
}
}
@@ -79,13 +79,14 @@ public class CustomContinuationEditPart extends ContinuationEditPart implements
refreshTransparency();
}
+ @Override
protected void setTransparency(int transp) {
getPrimaryShape().setTransparency(transp);
}
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContinuationEditPart#createNodeShape()
- *
+ *
* @return
*/
@Override
@@ -95,16 +96,17 @@ public class CustomContinuationEditPart extends ContinuationEditPart implements
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContinuationEditPart#getPrimaryShape()
- *
+ *
* @return
*/
@Override
public CustomContinuationFigure getPrimaryShape() {
- return (CustomContinuationFigure)primaryShape;
+ return (CustomContinuationFigure) primaryShape;
}
public class CustomContinuationFigure extends ContinuationFigure {
+ @Override
protected void fillShape(Graphics graphics) {
graphics.pushState();
applyTransparency(graphics);
@@ -120,7 +122,7 @@ public class CustomContinuationEditPart extends ContinuationEditPart implements
/**
* Returns transparency value (belongs to [0, 100] interval)
- *
+ *
* @return transparency
* @since 1.2
*/
@@ -130,13 +132,13 @@ public class CustomContinuationEditPart extends ContinuationEditPart implements
/**
* Sets the transparency if the given parameter is in [0, 100] range
- *
+ *
* @param transparency
- * The transparency to set
+ * The transparency to set
* @since 1.2
*/
public void setTransparency(int transparency) {
- if(transparency != this.transparency && transparency >= 0 && transparency <= 100) {
+ if (transparency != this.transparency && transparency >= 0 && transparency <= 100) {
this.transparency = transparency;
repaint();
}
@@ -146,9 +148,9 @@ public class CustomContinuationEditPart extends ContinuationEditPart implements
* Converts transparency value from percent range [0, 100] to alpha range
* [0, 255] and applies converted value. 0% corresponds to alpha 255 and
* 100% corresponds to alpha 0.
- *
+ *
* @param g
- * The Graphics used to paint
+ * The Graphics used to paint
* @since 1.2
*/
protected void applyTransparency(Graphics g) {
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 f8041885ab1..dc6f7ad9422 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -27,14 +27,14 @@ import org.eclipse.papyrus.uml.diagram.stereotype.edition.editpolicies.AppliedSt
/**
* Add implementing interface IPapyrusEditPart to displaying Stereotypes.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class CustomDestructionOccurrenceSpecificationEditPart extends DestructionOccurrenceSpecificationEditPart implements IPapyrusEditPart {
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomDestructionOccurrenceSpecificationEditPart(View view) {
@@ -48,20 +48,20 @@ public class CustomDestructionOccurrenceSpecificationEditPart extends Destructio
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomDestructionOccurrenceSpecificationItemSemanticEditPolicy());
- //install a editpolicy to display stereotypes
+ // install a editpolicy to display stereotypes
installEditPolicy(AppliedStereotypeCommentCreationEditPolicy.APPLIED_STEREOTYPE_COMMENT, new AppliedStereotypeCommentCreationEditPolicyEx());
}
@Override
protected void refreshBounds() {
- if(getBorderItemLocator() != null) {
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ if (getBorderItemLocator() != null) {
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- if(width != -1 && height != -1) {
+ if (width != -1 && height != -1) {
getFigure().setBounds(new Rectangle(loc, size));
}
getBorderItemLocator().setConstraint(new Rectangle(loc, size));
@@ -74,8 +74,8 @@ public class CustomDestructionOccurrenceSpecificationEditPart extends Destructio
protected void handleNotificationEvent(Notification notification) {
super.handleNotificationEvent(notification);
Object feature = notification.getFeature();
- if((getModel() != null) && (getModel() == notification.getNotifier())) {
- if(NotationPackage.eINSTANCE.getLineStyle_LineWidth().equals(feature)) {
+ if ((getModel() != null) && (getModel() == notification.getNotifier())) {
+ if (NotationPackage.eINSTANCE.getLineStyle_LineWidth().equals(feature)) {
refreshLineWidth();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationConstraintAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationConstraintAppliedStereotypeEditPart.java
index 962151a6bab..165ac89864e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationConstraintAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationConstraintAppliedStereotypeEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -29,7 +29,7 @@ public class CustomDurationConstraintAppliedStereotypeEditPart extends DurationC
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomDurationConstraintAppliedStereotypeEditPart(View view) {
@@ -39,19 +39,21 @@ public class CustomDurationConstraintAppliedStereotypeEditPart extends DurationC
/**
* @Override
*/
+ @Override
public IFigure getPrimaryShape() {
return getFigure();
}
+ @Override
protected void refreshLabel() {
- //We do NOT want to update label with the Parser.
+ // We do NOT want to update label with the Parser.
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
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 fb7fec07ed0..76a1fd84b42 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -83,7 +83,7 @@ import org.eclipse.uml2.uml.MessageOccurrenceSpecification;
/**
* Add implementing IPapyrusEditPart to displaying Stereotypes.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class CustomDurationConstraintEditPart extends DurationConstraintEditPart implements IPapyrusEditPart {
@@ -98,7 +98,7 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomDurationConstraintEditPart(View view) {
@@ -112,29 +112,29 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomDurationConstraintItemSemanticEditPolicy());
- //install a editpolicy to display stereotypes, there's a bug on super class.
+ // install a editpolicy to display stereotypes, there's a bug on super class.
installEditPolicy(AppliedStereotypeCommentCreationEditPolicy.APPLIED_STEREOTYPE_COMMENT, new AppliedStereotypeCommentCreationEditPolicyEx());
}
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart#getSourceConnectionAnchor(org.eclipse.gef.Request)
- *
+ *
* @param request
- * The request
+ * The request
* @return The anchor
*/
@Override
public ConnectionAnchor getSourceConnectionAnchor(Request request) {
- IHintedType type = (IHintedType)UMLElementTypes.CommentAnnotatedElement_4010;
- if(request instanceof CreateConnectionViewRequest) {
- String hint = ((CreateConnectionViewRequest)request).getConnectionViewDescriptor().getSemanticHint();
- if(hint.equals(type.getSemanticHint())) {
- return new RotateAnchor(getFigure(), computeAnchorLocation(((CreateConnectionViewRequest)request).getLocation()));
+ IHintedType type = (IHintedType) UMLElementTypes.CommentAnnotatedElement_4010;
+ if (request instanceof CreateConnectionViewRequest) {
+ String hint = ((CreateConnectionViewRequest) request).getConnectionViewDescriptor().getSemanticHint();
+ if (hint.equals(type.getSemanticHint())) {
+ return new RotateAnchor(getFigure(), computeAnchorLocation(((CreateConnectionViewRequest) request).getLocation()));
}
- } else if(request instanceof ReconnectRequest) {
- ConnectionEditPart linkPart = ((ReconnectRequest)request).getConnectionEditPart();
- if(linkPart instanceof CommentAnnotatedElementEditPart) {
- return new RotateAnchor(getFigure(), computeAnchorLocation(((ReconnectRequest)request).getLocation()));
+ } else if (request instanceof ReconnectRequest) {
+ ConnectionEditPart linkPart = ((ReconnectRequest) request).getConnectionEditPart();
+ if (linkPart instanceof CommentAnnotatedElementEditPart) {
+ return new RotateAnchor(getFigure(), computeAnchorLocation(((ReconnectRequest) request).getLocation()));
}
}
return super.getSourceConnectionAnchor(request);
@@ -142,64 +142,70 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
protected int computeAnchorLocation(Point location) {
Rectangle box = getBox();
- if(isArrowVertical()) {
- if(location.getDistance2(box.getTop()) > location.getDistance2(box.getBottom()))
+ if (isArrowVertical()) {
+ if (location.getDistance2(box.getTop()) > location.getDistance2(box.getBottom())) {
return PositionConstants.BOTTOM;
+ }
return PositionConstants.TOP;
} else {
- if(location.getDistance2(box.getLeft()) > location.getDistance2(box.getRight()))
+ if (location.getDistance2(box.getLeft()) > location.getDistance2(box.getRight())) {
return PositionConstants.RIGHT;
+ }
return PositionConstants.LEFT;
}
}
protected Rectangle getBox() {
- Rectangle rBox = getFigure() instanceof HandleBounds ? new PrecisionRectangle(((HandleBounds)getFigure()).getHandleBounds()) : new PrecisionRectangle(getFigure().getBounds());
+ Rectangle rBox = getFigure() instanceof HandleBounds ? new PrecisionRectangle(((HandleBounds) getFigure()).getHandleBounds()) : new PrecisionRectangle(getFigure().getBounds());
getFigure().translateToAbsolute(rBox);
return rBox;
}
public boolean canCreateLink(Point point) {
- DurationConstraint dc = (DurationConstraint)this.resolveSemanticElement();
+ DurationConstraint dc = (DurationConstraint) this.resolveSemanticElement();
int count = 0; // link counts
List list = this.getSourceConnections();
- for(Object o : list)
- if(o instanceof CustomCommentAnnotatedElementEditPart) {
+ for (Object o : list) {
+ if (o instanceof CustomCommentAnnotatedElementEditPart) {
count++;
}
- if(count >= 2)
+ }
+ if (count >= 2) {
return false;
+ }
- if(count < 1)
+ if (count < 1) {
return true;
+ }
int targetPosition = computeAnchorLocation(point);
- if(findLinkAtPosition(targetPosition))
+ if (findLinkAtPosition(targetPosition)) {
return false;
+ }
return true;
}
- // protected void refreshSourceConnections() {
- // super.refreshSourceConnections();
- // Display.getDefault().asyncExec(new Runnable(){
- // public void run() {
- // refreshBorder();
- // }
- // });
- // }
- //
- // public void refresh(){
- // super.refresh();
- // refreshBorder();
- // }
+ // protected void refreshSourceConnections() {
+ // super.refreshSourceConnections();
+ // Display.getDefault().asyncExec(new Runnable(){
+ // public void run() {
+ // refreshBorder();
+ // }
+ // });
+ // }
+ //
+ // public void refresh(){
+ // super.refresh();
+ // refreshBorder();
+ // }
//
- // private void refreshBorder() {
- // if(getPrimaryShape() instanceof CustomDurationConstraintFigure){
- // CustomDurationConstraintFigure fig = (CustomDurationConstraintFigure)getPrimaryShape();
- // fig.setBorderVisible(hasTopLink(), hasBottomLink());
- // }
- // }
+ // private void refreshBorder() {
+ // if(getPrimaryShape() instanceof CustomDurationConstraintFigure){
+ // CustomDurationConstraintFigure fig = (CustomDurationConstraintFigure)getPrimaryShape();
+ // fig.setBorderVisible(hasTopLink(), hasBottomLink());
+ // }
+ // }
public boolean hasTopLink() {
return findLinkAtPosition(PositionConstants.TOP);
@@ -211,28 +217,30 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
protected boolean findLinkAtPosition(int targetPos) {
List list = this.getSourceConnections();
- for(Object o : list)
- if(o instanceof CustomCommentAnnotatedElementEditPart) {
- CustomCommentAnnotatedElementEditPart connPart = (CustomCommentAnnotatedElementEditPart)o;
- if((targetPos & getSourceAnchorPosition(connPart)) > 0)
+ for (Object o : list) {
+ if (o instanceof CustomCommentAnnotatedElementEditPart) {
+ CustomCommentAnnotatedElementEditPart connPart = (CustomCommentAnnotatedElementEditPart) o;
+ if ((targetPos & getSourceAnchorPosition(connPart)) > 0) {
return true;
+ }
}
+ }
return false;
}
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart#getSourceConnectionAnchor(org.eclipse.gef.ConnectionEditPart)
- *
+ *
* @param connEditPart
- * The connection edit part.
+ * The connection edit part.
* @return The anchor.
*/
@Override
public ConnectionAnchor getSourceConnectionAnchor(ConnectionEditPart connEditPart) {
ConnectionAnchor anchor = null;
- if(connEditPart instanceof CommentAnnotatedElementEditPart) {
- anchor = new RotateAnchor(getFigure(), getSourceAnchorPosition((CommentAnnotatedElementEditPart)connEditPart));
+ if (connEditPart instanceof CommentAnnotatedElementEditPart) {
+ anchor = new RotateAnchor(getFigure(), getSourceAnchorPosition((CommentAnnotatedElementEditPart) connEditPart));
} else {
anchor = super.getSourceConnectionAnchor(connEditPart);
}
@@ -242,7 +250,7 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
private int getSourceAnchorPosition(CommentAnnotatedElementEditPart connEditPart) {
String terminal = AnchorHelper.getAnchorId(getEditingDomain(), connEditPart, true);
- if(terminal.length() > 0) {
+ if (terminal.length() > 0) {
return parseLocation(terminal);
}
return PositionConstants.TOP;
@@ -252,22 +260,24 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
protected void refreshBounds() {
super.refreshBounds();
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
// restore to default size
- if(width == -1)
+ if (width == -1) {
width = getFigure().getPreferredSize().width;
- if(height == -1)
+ }
+ if (height == -1) {
height = getFigure().getPreferredSize().height;
+ }
- if(width != -1 && height != -1) {
+ if (width != -1 && height != -1) {
Dimension size = primaryShape.getBounds().getSize();
- //if(size.width != width || size.height != height) { // if resize bounds
+ // if(size.width != width || size.height != height) { // if resize bounds
primaryShape.setBounds(new Rectangle(primaryShape.getBounds().getLocation(), new Dimension(width, height)));
- //}
+ // }
}
- //fix combined fragment move
+ // fix combined fragment move
this.getFigure().getParent().getLayoutManager().layout(this.getFigure().getParent());
relocateLabelEditPart();
}
@@ -279,9 +289,9 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
/**
* This method creates a specific edit policy for time realted elements
- *
+ *
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderItemEditPart#getPrimaryDragEditPolicy()
- *
+ *
* @return <code>EditPolicy</code>
* @Override
*/
@@ -290,6 +300,7 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
EditPolicy policy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
return policy != null ? policy : new ResizableShapeEditPolicy() {
+ @Override
protected Command getResizeCommand(ChangeBoundsRequest request) {
ChangeBoundsRequest req = new ChangeBoundsRequest(REQ_RESIZE_CHILDREN);
req.setEditParts(getHost());
@@ -301,6 +312,7 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
return getHost().getParent().getCommand(req);
}
+ @Override
protected void showChangeBoundsFeedback(ChangeBoundsRequest request) {
IFigure feedback = getDragSourceFeedbackFigure();
@@ -316,11 +328,13 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
max.width = mmode.LPtoDP(max.width);
// no minimal size
- if(max.width < rect.width)
+ if (max.width < rect.width) {
rect.width = max.width;
+ }
- if(max.height < rect.height)
+ if (max.height < rect.height) {
rect.height = max.height;
+ }
feedback.translateToRelative(rect);
feedback.setBounds(rect);
@@ -337,15 +351,15 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case DurationConstraintLabelEditPart.VISUAL_ID:
case DurationConstraintAppliedStereotypeEditPart.VISUAL_ID:
// use ExternalLabelPrimaryDragRoleEditPolicy
return new ExternalLabelPrimaryDragRoleEditPolicy();
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -369,12 +383,12 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
*/
@Override
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof DurationConstraintLabelEditPart) {
+ if (borderItemEditPart instanceof DurationConstraintLabelEditPart) {
DurationConstraintLabelLocator locator = new DurationConstraintLabelLocator(getMainFigure());
locator.setParentEditPart(this);
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
- } else if(borderItemEditPart instanceof DurationConstraintAppliedStereotypeEditPart) {
- //use ExternalLabelPositionLocator
+ } else if (borderItemEditPart instanceof DurationConstraintAppliedStereotypeEditPart) {
+ // use ExternalLabelPositionLocator
IBorderItemLocator locator = new ExternalLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -387,7 +401,7 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
*/
@Override
public Command getCommand(Request request) {
- if(request instanceof CreateUnspecifiedTypeRequest) {
+ if (request instanceof CreateUnspecifiedTypeRequest) {
return getParent().getCommand(request);
}
return super.getCommand(request);
@@ -398,7 +412,7 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
*/
@Override
public void showSourceFeedback(Request request) {
- if(request instanceof CreateUnspecifiedTypeRequest) {
+ if (request instanceof CreateUnspecifiedTypeRequest) {
getParent().showSourceFeedback(request);
}
super.showSourceFeedback(request);
@@ -409,7 +423,7 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
*/
@Override
public void eraseSourceFeedback(Request request) {
- if(request instanceof CreateUnspecifiedTypeRequest) {
+ if (request instanceof CreateUnspecifiedTypeRequest) {
getParent().eraseSourceFeedback(request);
}
super.eraseSourceFeedback(request);
@@ -419,16 +433,16 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
protected void handleNotificationEvent(Notification notification) {
super.handleNotificationEvent(notification);
Object feature = notification.getFeature();
- if((getModel() != null) && (getModel() == notification.getNotifier())) {
- if(NotationPackage.eINSTANCE.getLineStyle_LineWidth().equals(feature)) {
+ if ((getModel() != null) && (getModel() == notification.getNotifier())) {
+ if (NotationPackage.eINSTANCE.getLineStyle_LineWidth().equals(feature)) {
refreshLineWidth();
}
}
- if(notification.getNewValue() instanceof EAnnotation && ARROW.equals(((EAnnotation)notification.getNewValue()).getSource())) {
- refreshArrowDirection((EAnnotation)notification.getNewValue());
- } else if(notification.getNotifier() instanceof EAnnotation && ARROW.equals(((EAnnotation)notification.getNotifier()).getSource())) {
- refreshArrowDirection((EAnnotation)notification.getNotifier()); //notification.getEventType() ==
+ if (notification.getNewValue() instanceof EAnnotation && ARROW.equals(((EAnnotation) notification.getNewValue()).getSource())) {
+ refreshArrowDirection((EAnnotation) notification.getNewValue());
+ } else if (notification.getNotifier() instanceof EAnnotation && ARROW.equals(((EAnnotation) notification.getNotifier()).getSource())) {
+ refreshArrowDirection((EAnnotation) notification.getNotifier()); // notification.getEventType() ==
}
}
@@ -441,10 +455,10 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
private void relocateLabelEditPart() {
List list = this.getChildren();
- for(Object o : list) {
- if(o instanceof DurationConstraintLabelEditPart) {
- DurationConstraintLabelEditPart label = (DurationConstraintLabelEditPart)o;
- if(label.getBorderItemLocator() != null) {
+ for (Object o : list) {
+ if (o instanceof DurationConstraintLabelEditPart) {
+ DurationConstraintLabelEditPart label = (DurationConstraintLabelEditPart) o;
+ if (label.getBorderItemLocator() != null) {
IBorderItemLocator loc = label.getBorderItemLocator();
loc.relocate(label.getFigure());
}
@@ -453,7 +467,7 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
}
public Rectangle updateMoveBounds(Rectangle newBounds) {
- if(getCurrentSideOfParent() == PositionConstants.WEST) {
+ if (getCurrentSideOfParent() == PositionConstants.WEST) {
Rectangle bounds = this.getFigure().getBounds();
return newBounds.translate(-bounds.width, 0); // keep bounds in left side
}
@@ -462,7 +476,7 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
public int getCurrentSideOfParent() {
IBorderItemLocator locator = this.getBorderItemLocator();
- if(locator != null) {
+ if (locator != null) {
return locator.getCurrentSideOfParent();
}
return PositionConstants.EAST;
@@ -472,13 +486,13 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
/**
* Height of the arrow end
- *
+ *
*/
private static final int ARROW_HEIGHT = 8;
/**
* Width of the half of the arrow end
- *
+ *
*/
private static final int ARROW_SEMI_WIDTH = 7;
@@ -509,18 +523,18 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
tempRect.y += halfWidthInLP;
tempRect.height -= getWidth();
- if((getPositions() & PositionConstants.TOP) > 0) {
- //graphics.drawLine(tempRect.getTopLeft(), tempRect.getTopRight());
+ if ((getPositions() & PositionConstants.TOP) > 0) {
+ // graphics.drawLine(tempRect.getTopLeft(), tempRect.getTopRight());
graphics.drawLine(new Point(tempRect.getTopLeft().x(), tempRect.getTopLeft().y() + 1), new Point(tempRect.getTopRight().x(), tempRect.getTopRight().y() + 1));
}
- if((getPositions() & PositionConstants.LEFT) > 0) {
- //graphics.drawLine(tempRect.getTopLeft(), tempRect.getBottomLeft());
+ if ((getPositions() & PositionConstants.LEFT) > 0) {
+ // graphics.drawLine(tempRect.getTopLeft(), tempRect.getBottomLeft());
graphics.drawLine(new Point(tempRect.getTopLeft().x() + 1, tempRect.getTopLeft().y()), new Point(tempRect.getBottomLeft().x() + 1, tempRect.getBottomLeft().y()));
}
- if((getPositions() & PositionConstants.BOTTOM) > 0) {
+ if ((getPositions() & PositionConstants.BOTTOM) > 0) {
graphics.drawLine(tempRect.getBottomLeft(), tempRect.getBottomRight());
}
- if((getPositions() & PositionConstants.RIGHT) > 0) {
+ if ((getPositions() & PositionConstants.RIGHT) > 0) {
graphics.drawLine(tempRect.getTopRight(), tempRect.getBottomRight());
}
}
@@ -530,52 +544,54 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
}
protected void setDashBorder() {
- if(this.getBorder() instanceof LinesBorder) {
- LinesBorder lb = (LinesBorder)this.getBorder();
+ if (this.getBorder() instanceof LinesBorder) {
+ LinesBorder lb = (LinesBorder) this.getBorder();
lb.setStyle(Graphics.LINE_DASH);
- if(vertical)
+ if (vertical) {
lb.setSides(PositionConstants.TOP | PositionConstants.BOTTOM);
- else
+ } else {
lb.setSides(PositionConstants.LEFT | PositionConstants.RIGHT);
+ }
}
}
@Override
public Insets getInsets() {
- if(getBorder() != null)
+ if (getBorder() != null) {
return getBorder().getInsets(this);
+ }
return NO_INSETS;
}
public void setVertical(boolean val) {
- if(val != vertical) {
+ if (val != vertical) {
vertical = val;
setDashBorder();
revalidate();
}
}
- // public void setBorderVisible(boolean top, boolean bottom){
- // if(this.getBorder() instanceof LinesBorder){
- // LinesBorder lb = (LinesBorder) this.getBorder();
- // if(top){
- // int value = bottom ? PositionConstants.TOP | PositionConstants.BOTTOM : PositionConstants.TOP;
- // lb.setSides(value);
- // }else{
- // int value = bottom ? PositionConstants.BOTTOM : PositionConstants.NONE;
- // lb.setSides(value);
- // }
- // this.repaint();
- // }
- // }
+ // public void setBorderVisible(boolean top, boolean bottom){
+ // if(this.getBorder() instanceof LinesBorder){
+ // LinesBorder lb = (LinesBorder) this.getBorder();
+ // if(top){
+ // int value = bottom ? PositionConstants.TOP | PositionConstants.BOTTOM : PositionConstants.TOP;
+ // lb.setSides(value);
+ // }else{
+ // int value = bottom ? PositionConstants.BOTTOM : PositionConstants.NONE;
+ // lb.setSides(value);
+ // }
+ // this.repaint();
+ // }
+ // }
/**
* Sets the bounds of this Figure to the Rectangle <i>rect</i>.
* This also updates sub-figures.
- *
+ *
* @see Figure#setBounds(Rectangle)
* @param rect
- * The new bounds
+ * The new bounds
*/
@Override
public void setBounds(Rectangle rect) {
@@ -589,19 +605,19 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
/**
* Update the arrow polyline taking in account new figure's size
- *
+ *
* @param figureWidth
- * the new figure width
+ * the new figure width
* @param figureHeight
- * the new figure height
+ * the new figure height
*/
public void updateArrow(int figureWidth, int figureHeight) {
// handle insets to avoid figure growing indefinitely
figureWidth -= getInsets().left + getInsets().right;
figureHeight -= getInsets().top + getInsets().bottom;
- if(getDurationArrow() != null) {
+ if (getDurationArrow() != null) {
int halfLineWidth = getLineWidth() / 2;
- if(vertical) {
+ if (vertical) {
PointList points = new PointList(8);
int centerX = figureWidth / 2;
points.addPoint(centerX - ARROW_SEMI_WIDTH, halfLineWidth + ARROW_HEIGHT);
@@ -638,17 +654,18 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
@Override
public boolean containsPoint(int x, int y) {
boolean containsPoint = super.containsPoint(x, y);
- if(!containsPoint) {
+ if (!containsPoint) {
return false;
}
PolylineShape durationArrow = getDurationArrow();
- if(durationArrow != null) {
+ if (durationArrow != null) {
return PointListUtilities.containsPoint(durationArrow.getPoints(), new Point(x, y));
- // return fDurationArrow.containsPoint(x, y);
+ // return fDurationArrow.containsPoint(x, y);
}
return containsPoint;
}
+ @Override
public void paintFigure(Graphics graphics) {
graphics.setLineWidth(lineWidth);
super.paintFigure(graphics);
@@ -656,7 +673,7 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
@Override
public void setLineWidth(int w) {
- LinesBorder lb = (LinesBorder)getBorder();
+ LinesBorder lb = (LinesBorder) getBorder();
lb.setWidth(w);
getDurationArrow().setLineWidth(w);
super.setLineWidth(w);
@@ -666,24 +683,24 @@ 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 oc2 = getFirstElement(cvr.getExtendedData().get(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2));
- if(oc1 != null && oc2 != null && (oc1 instanceof MessageOccurrenceSpecification || oc2 instanceof MessageOccurrenceSpecification)) {
+ if (oc1 != null && oc2 != null && (oc1 instanceof MessageOccurrenceSpecification || oc2 instanceof MessageOccurrenceSpecification)) {
Point start = null, end = null;
Rectangle bounds = null;
- if(oc1 instanceof InteractionFragment) {
- start = SequenceUtil.findLocationOfEvent(host, (InteractionFragment)oc1, true);
+ if (oc1 instanceof InteractionFragment) {
+ start = SequenceUtil.findLocationOfEvent(host, (InteractionFragment) oc1, true);
}
- if(oc2 instanceof InteractionFragment) {
- end = SequenceUtil.findLocationOfEvent(host, (InteractionFragment)oc2, true);
+ if (oc2 instanceof InteractionFragment) {
+ end = SequenceUtil.findLocationOfEvent(host, (InteractionFragment) oc2, true);
}
- if(start != null && end != null) {
+ if (start != null && end != null) {
bounds = (start.y < end.y) ? new Rectangle(start, end) : new Rectangle(end, start);
}
- if(bounds != null) {
+ if (bounds != null) {
IFigure parentFigure = host.getFigure();
Point parentFigDelta = parentFigure.getBounds().getLocation().getCopy().negate();
parentFigure.translateToRelative(bounds);
bounds.translate(parentFigDelta);
- if(bounds.y != newBounds.y || newBounds.height != bounds.height) {
+ if (bounds.y != newBounds.y || newBounds.height != bounds.height) {
newBounds.y = bounds.y;
newBounds.height = bounds.height;
}
@@ -706,23 +723,24 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
@Override
public void relocate(IFigure target) {
- if(constraint.y == 0) {
- if(durationConstraintEditPart.getCurrentSideOfParent() == PositionConstants.WEST) {
+ if (constraint.y == 0) {
+ if (durationConstraintEditPart.getCurrentSideOfParent() == PositionConstants.WEST) {
Point r = parentFigure.getBounds().getLeft().translate(-20, -5);
target.setBounds(new Rectangle(r, target.getPreferredSize()));
} else {
Point r = parentFigure.getBounds().getRight().translate(5, -5);
target.setBounds(new Rectangle(r, target.getPreferredSize()));
}
- } else
+ } else {
super.relocate(target);
+ }
}
}
static Object getFirstElement(Object obj) {
- if(obj != null && obj instanceof List) {
- List list = (List)obj;
- if(list.size() > 0) {
+ if (obj != null && obj instanceof List) {
+ List list = (List) obj;
+ if (list.size() > 0) {
return list.get(0);
}
}
@@ -731,18 +749,19 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
protected void refreshArrowDirection(EAnnotation newValue) {
- CustomDurationConstraintFigure dc = (CustomDurationConstraintFigure)getPrimaryShape();
+ CustomDurationConstraintFigure dc = (CustomDurationConstraintFigure) getPrimaryShape();
dc.setVertical(isArrowVertical());
refreshBounds();
}
public void setArrowDirection(String dir) {
View view = this.getNotationView();
- if(view == null)
+ if (view == null) {
return;
+ }
EAnnotation ea = view.getEAnnotation(ARROW);
- if(ea == null) {
+ if (ea == null) {
ea = EcoreFactory.eINSTANCE.createEAnnotation();
ea.setSource(ARROW);
ea.getDetails().put(DIRECTION, dir);
@@ -755,12 +774,13 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
public String getArrowDirection() {
View view = this.getNotationView();
- if(view == null)
+ if (view == null) {
return "";
+ }
EAnnotation ea = view.getEAnnotation(ARROW);
- if(ea != null) {
+ if (ea != null) {
String pos = ea.getDetails().get(DIRECTION);
- if(pos != null) {
+ if (pos != null) {
return pos;
}
}
@@ -772,7 +792,7 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
}
public void rotateArrow() {
- if(isArrowVertical()) {
+ if (isArrowVertical()) {
setArrowDirection(HORIZONTAL);
} else {
setArrowDirection(VERTICAL);
@@ -785,18 +805,18 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
public Rectangle getBounds() {
View view = this.getNotationView();
- int width = ((Integer)getStructuralFeatureValue(view, NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(view, NotationPackage.eINSTANCE.getSize_Height())).intValue();
- int x = ((Integer)getStructuralFeatureValue(view, NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(view, NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(view, NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(view, NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(view, NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(view, NotationPackage.eINSTANCE.getLocation_Y())).intValue();
String prefElementId = ViewUtil.resolveSemanticElement(view).eClass().getName();
IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(view, prefElementId, PreferencesConstantsHelper.WIDTH);
String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(view, prefElementId, PreferencesConstantsHelper.HEIGHT);
- if(width <= 0) {
+ if (width <= 0) {
width = store.getInt(preferenceConstantWitdh);
}
- if(height <= 0) {
+ if (height <= 0) {
height = store.getInt(preferenceConstantHeight);
}
return new Rectangle(x, y, width, height);
@@ -814,7 +834,7 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
@Override
protected void doExecute() {
List list = part.getSourceConnections();
- if(part.isArrowVertical()) {
+ if (part.isArrowVertical()) {
part.setArrowDirection(HORIZONTAL);
} else {
part.setArrowDirection(VERTICAL);
@@ -828,26 +848,27 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
super(f, location);
}
+ @Override
public Point getLocation(Point reference) {
double zoom = 0;
- if(CustomDurationConstraintEditPart.this.getRoot() instanceof RenderedDiagramRootEditPart) {
- RenderedDiagramRootEditPart render = (RenderedDiagramRootEditPart)CustomDurationConstraintEditPart.this.getRoot();
+ if (CustomDurationConstraintEditPart.this.getRoot() instanceof RenderedDiagramRootEditPart) {
+ RenderedDiagramRootEditPart render = (RenderedDiagramRootEditPart) CustomDurationConstraintEditPart.this.getRoot();
zoom = render.getZoomManager().getZoom();
}
- if(position == PositionConstants.TOP) {
+ if (position == PositionConstants.TOP) {
return new PrecisionPoint(getBox().getTop().preciseX(), getBox().getTop().preciseY() + 1 * zoom);
- } else if(position == PositionConstants.BOTTOM) {
- if(zoom > 1) {
+ } else if (position == PositionConstants.BOTTOM) {
+ if (zoom > 1) {
zoom = zoom - 1;
}
return new PrecisionPoint(getBox().getBottom().preciseX(), getBox().getBottom().preciseY() - 1 * zoom);
- } else if(position == PositionConstants.LEFT) {
- if(zoom > 1) {
+ } else if (position == PositionConstants.LEFT) {
+ if (zoom > 1) {
zoom = zoom - 1;
}
return new PrecisionPoint(getBox().getLeft().preciseX(), getBox().getLeft().preciseY() + 1 * zoom);
- } else if(position == PositionConstants.RIGHT) {
- if(zoom > 1) {
+ } else if (position == PositionConstants.RIGHT) {
+ if (zoom > 1) {
zoom = zoom - 1;
}
return new PrecisionPoint(getBox().getRight().preciseX(), getBox().getRight().preciseY() + 1 * zoom);
@@ -855,16 +876,18 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
return super.getLocation(reference);
}
+ @Override
public String getTerminal() {
- if(isDefaultAnchor())
+ if (isDefaultAnchor()) {
return StringStatics.BLANK;
- if(position == PositionConstants.TOP) {
+ }
+ if (position == PositionConstants.TOP) {
return "(0.5,0){T}";
- } else if(position == PositionConstants.BOTTOM) {
+ } else if (position == PositionConstants.BOTTOM) {
return "(0.5,1){D}";
- } else if(position == PositionConstants.LEFT) {
+ } else if (position == PositionConstants.LEFT) {
return "(0,0.5){L}";
- } else if(position == PositionConstants.RIGHT) {
+ } else if (position == PositionConstants.RIGHT) {
return "(1,0.5){R}";
}
return "(0.5,0){T}";
@@ -873,11 +896,11 @@ public class CustomDurationConstraintEditPart extends DurationConstraintEditPart
}
private int parseLocation(String terminal) {
- if(terminal.length() > 0) {
+ if (terminal.length() > 0) {
int start = terminal.indexOf("{") + 1;
- if(start > 0) {
+ if (start > 0) {
char ch = Character.toUpperCase(terminal.charAt(start));
- switch(ch) {
+ switch (ch) {
case 'L':
return PositionConstants.LEFT;
case 'R':
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationConstraintInMessageAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationConstraintInMessageAppliedStereotypeEditPart.java
index 5d6181bb36e..e0ea1e280ea 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationConstraintInMessageAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationConstraintInMessageAppliedStereotypeEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -24,7 +24,7 @@ public class CustomDurationConstraintInMessageAppliedStereotypeEditPart extends
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomDurationConstraintInMessageAppliedStereotypeEditPart(View view) {
@@ -34,6 +34,7 @@ public class CustomDurationConstraintInMessageAppliedStereotypeEditPart extends
/**
* @Override
*/
+ @Override
public IFigure getPrimaryShape() {
return getFigure();
}
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 5d082f9483a..018094f8e74 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -46,7 +46,7 @@ public class CustomDurationConstraintInMessageEditPart extends DurationConstrain
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomDurationConstraintInMessageEditPart(View view) {
@@ -64,7 +64,7 @@ public class CustomDurationConstraintInMessageEditPart extends DurationConstrain
/**
* Make sure bounds are also refreshed.
- *
+ *
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart#refresh()
* @Override
*/
@@ -76,16 +76,16 @@ public class CustomDurationConstraintInMessageEditPart extends DurationConstrain
/**
* Handles refresh bounds the same way as for a non resizable label
- *
+ *
* @Override
*/
@Override
protected void refreshBounds() {
- int dx = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int dy = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int dx = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int dy = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point offset = new Point(dx, dy);
- if(getParent() instanceof AbstractConnectionEditPart) {
- ((AbstractGraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new LabelLocator(((AbstractConnectionEditPart)getParent()).getConnectionFigure(), offset, ConnectionLocator.MIDDLE));
+ if (getParent() instanceof AbstractConnectionEditPart) {
+ ((AbstractGraphicalEditPart) getParent()).setLayoutConstraint(this, getFigure(), new LabelLocator(((AbstractConnectionEditPart) getParent()).getConnectionFigure(), offset, ConnectionLocator.MIDDLE));
} else {
getFigure().getParent().setConstraint(getFigure(), new LabelLocator(getFigure().getParent(), offset, ConnectionLocator.MIDDLE));
}
@@ -100,14 +100,14 @@ public class CustomDurationConstraintInMessageEditPart extends DurationConstrain
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case DurationConstraintInMessageAppliedStereotypeEditPart.VISUAL_ID:
// use ExternalLabelPrimaryDragRoleEditPolicy
return new ExternalLabelPrimaryDragRoleEditPolicy();
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -131,8 +131,8 @@ public class CustomDurationConstraintInMessageEditPart extends DurationConstrain
*/
@Override
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof DurationConstraintInMessageAppliedStereotypeEditPart) {
- //use ExternalLabelPositionLocator
+ if (borderItemEditPart instanceof DurationConstraintInMessageAppliedStereotypeEditPart) {
+ // use ExternalLabelPositionLocator
IBorderItemLocator locator = new ExternalLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -152,11 +152,11 @@ public class CustomDurationConstraintInMessageEditPart extends DurationConstrain
protected NodeFigure createNodePlate() {
// use correct minimum size
DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(-1, -1);
- //String prefElementId = "DurationConstraint";
- //IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- //String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferencesConstantsHelper.WIDTH);
- //String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferencesConstantsHelper.HEIGHT);
- //DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
+ // String prefElementId = "DurationConstraint";
+ // IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
+ // String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferencesConstantsHelper.WIDTH);
+ // String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferencesConstantsHelper.HEIGHT);
+ // DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
return result;
}
@@ -164,7 +164,7 @@ public class CustomDurationConstraintInMessageEditPart extends DurationConstrain
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintInMessageEditPart.DurationObservationConstraint#getDurationLabel()
- *
+ *
* @return
*/
@Override
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationObservationAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationObservationAppliedStereotypeEditPart.java
index b5c2de0742c..2614b347d29 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationObservationAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomDurationObservationAppliedStereotypeEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -29,7 +29,7 @@ public class CustomDurationObservationAppliedStereotypeEditPart extends Duration
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomDurationObservationAppliedStereotypeEditPart(View view) {
@@ -39,19 +39,21 @@ public class CustomDurationObservationAppliedStereotypeEditPart extends Duration
/**
* @Override
*/
+ @Override
public IFigure getPrimaryShape() {
return getFigure();
}
+ @Override
protected void refreshLabel() {
- //We do NOT want to update label with the Parser.
+ // We do NOT want to update label with the Parser.
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -61,8 +63,8 @@ public class CustomDurationObservationAppliedStereotypeEditPart extends Duration
removeEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY);
View view = getPrimaryView();
View stereotypeChangedView = view;
- if(view != null) {
- // stereotypeChangedView = ViewUtil.getChildBySemanticHint(view, UMLVisualIDRegistry.getType(DurationObservationLabelEditPart.VISUAL_ID));
+ if (view != null) {
+ // stereotypeChangedView = ViewUtil.getChildBySemanticHint(view, UMLVisualIDRegistry.getType(DurationObservationLabelEditPart.VISUAL_ID));
}
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeExternalNodeLabelEditPolicy(stereotypeChangedView));
}
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 d0853941b52..4a6bfe7d30d 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -43,7 +43,7 @@ public class CustomDurationObservationEditPart extends DurationObservationEditPa
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomDurationObservationEditPart(View view) {
@@ -64,7 +64,7 @@ public class CustomDurationObservationEditPart extends DurationObservationEditPa
/**
* Make sure bounds are also refreshed.
- *
+ *
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart#refresh()
* @Override
*/
@@ -83,14 +83,14 @@ public class CustomDurationObservationEditPart extends DurationObservationEditPa
@Override
protected org.eclipse.gef.EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case DurationObservationAppliedStereotypeEditPart.VISUAL_ID:
// use ExternalLabelPrimaryDragRoleEditPolicy
return new CustomExternalLabelPrimaryDragRoleEditPolicy();
}
org.eclipse.gef.EditPolicy result = child.getEditPolicy(org.eclipse.gef.EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -114,8 +114,8 @@ public class CustomDurationObservationEditPart extends DurationObservationEditPa
*/
@Override
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof DurationObservationAppliedStereotypeEditPart) {
- //use ExternalLabelPositionLocator
+ if (borderItemEditPart instanceof DurationObservationAppliedStereotypeEditPart) {
+ // use ExternalLabelPositionLocator
IBorderItemLocator locator = new ExternalLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -130,11 +130,11 @@ public class CustomDurationObservationEditPart extends DurationObservationEditPa
protected NodeFigure createNodePlate() {
// use correct minimum size
DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(-1, -1);
- //String prefElementId = "DurationObservation";
- //IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- //String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferencesConstantsHelper.WIDTH);
- //String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferencesConstantsHelper.HEIGHT);
- //DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
+ // String prefElementId = "DurationObservation";
+ // IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
+ // String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferencesConstantsHelper.WIDTH);
+ // String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferencesConstantsHelper.HEIGHT);
+ // DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
return result;
}
@@ -147,7 +147,7 @@ public class CustomDurationObservationEditPart extends DurationObservationEditPa
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationObservationEditPart.DurationObservationConstraint#getDurationLabel()
- *
+ *
* @return
*/
@Override
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 2951db1885d..44c16c778bc 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -48,7 +48,7 @@ public class CustomGeneralOrderingEditPart extends GeneralOrderingEditPart imple
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomGeneralOrderingEditPart(View view) {
@@ -68,7 +68,7 @@ public class CustomGeneralOrderingEditPart extends GeneralOrderingEditPart imple
protected void handleNotificationEvent(Notification notification) {
super.handleNotificationEvent(notification);
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getLineStyle_LineWidth().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getLineStyle_LineWidth().equals(feature)) {
refreshLineWidth();
}
}
@@ -80,7 +80,7 @@ public class CustomGeneralOrderingEditPart extends GeneralOrderingEditPart imple
@Override
public CustomGeneralOrderingDescriptor getPrimaryShape() {
- return (CustomGeneralOrderingDescriptor)getFigure();
+ return (CustomGeneralOrderingDescriptor) getFigure();
}
@Override
@@ -91,17 +91,17 @@ public class CustomGeneralOrderingEditPart extends GeneralOrderingEditPart imple
@Override
public EditPart getTargetEditPart(Request request) {
EditPart ep = super.getTargetEditPart(request);
- if(ep != null && ep instanceof org.eclipse.gef.ConnectionEditPart) {
- if(request instanceof ReconnectRequest) {
- ReconnectRequest rRequest = (ReconnectRequest)request;
+ if (ep != null && ep instanceof org.eclipse.gef.ConnectionEditPart) {
+ if (request instanceof ReconnectRequest) {
+ ReconnectRequest rRequest = (ReconnectRequest) request;
// If source anchor is moved, the connection's source edit part
// should not be taken into account for a cyclic dependency
// check so as to avoid false checks. Same goes for the target
// anchor. See bugzilla# 417373 -- we do not want to target a
// connection that is already connected to us so that we do not
- // introduce a cyclic connection
- if(isCyclicConnectionRequest((org.eclipse.gef.ConnectionEditPart)ep, rRequest.getConnectionEditPart())) {
+ // introduce a cyclic connection
+ if (isCyclicConnectionRequest((org.eclipse.gef.ConnectionEditPart) ep, rRequest.getConnectionEditPart())) {
return null;
}
}
@@ -112,21 +112,21 @@ public class CustomGeneralOrderingEditPart extends GeneralOrderingEditPart imple
/**
* Fixed bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=417373
- *
+ *
* The ends of GeneralOrderingEditPart are MessageEndEditParts which parent are Message*EditParts, once we move the ends of the messages, we
* should IGNORE to move current GeneralOrdering, otherwise cyclic dependency occur.
- *
+ *
*/
private boolean isCyclicConnectionRequest(ConnectionEditPart currentConn, ConnectionEditPart reqConn) {
- if(currentConn == null || reqConn == null) {
+ if (currentConn == null || reqConn == null) {
return false;
}
EditPart source = currentConn.getSource();
EditPart target = currentConn.getTarget();
- if(reqConn == source || reqConn == target) {
+ if (reqConn == source || reqConn == target) {
return true;
}
- if(reqConn == source.getParent() || reqConn == target.getParent()) {
+ if (reqConn == source.getParent() || reqConn == target.getParent()) {
return true;
}
return false;
@@ -141,8 +141,8 @@ public class CustomGeneralOrderingEditPart extends GeneralOrderingEditPart imple
/**
* Decoration to place in the middle of the connection
- *
- *
+ *
+ *
*/
private RotatableDecoration middleDecoration;
@@ -202,7 +202,7 @@ public class CustomGeneralOrderingEditPart extends GeneralOrderingEditPart imple
/**
* Get the decoration of the middle
- *
+ *
* @return the middle decoration - possibly null
*/
protected RotatableDecoration getMiddleDecoration() {
@@ -211,13 +211,13 @@ public class CustomGeneralOrderingEditPart extends GeneralOrderingEditPart imple
/**
* Set the foreground background
- *
+ *
* @see org.eclipse.draw2d.IFigure#setForegroundColor(org.eclipse.swt.graphics.Color)
*/
@Override
public void setForegroundColor(Color fg) {
super.setForegroundColor(fg);
- if(getMiddleDecoration() != null) {
+ if (getMiddleDecoration() != null) {
getMiddleDecoration().setForegroundColor(fg);
getMiddleDecoration().setBackgroundColor(fg);
}
@@ -226,38 +226,38 @@ public class CustomGeneralOrderingEditPart extends GeneralOrderingEditPart imple
@Override
public void setLineWidth(int w) {
super.setLineWidth(w);
- if(getMiddleDecoration() instanceof Shape) {
- ((Shape)getMiddleDecoration()).setLineWidth(w);
+ if (getMiddleDecoration() instanceof Shape) {
+ ((Shape) getMiddleDecoration()).setLineWidth(w);
}
}
/**
* Set the middle decoration
- *
+ *
* @see org.eclipse.draw2d.PolylineConnection#setTargetDecoration(org.eclipse.draw2d.RotatableDecoration)
* @generated NOT
*/
public void setMiddleDecoration(RotatableDecoration dec) {
- if(getMiddleDecoration() != null) {
+ if (getMiddleDecoration() != null) {
remove(getMiddleDecoration());
}
middleDecoration = dec;
- if(dec != null) {
+ if (dec != null) {
add(dec, new ArrowLocator(this, ConnectionLocator.MIDDLE) {
/**
* Relocates the passed in figure (which must be a {@link RotatableDecoration}) at the middle of the connection.
- *
+ *
* @param target
- * The RotatableDecoration to relocate
+ * The RotatableDecoration to relocate
*/
@Override
public void relocate(IFigure target) {
PointList points = getConnection().getPoints();
- RotatableDecoration arrow = (RotatableDecoration)target;
+ RotatableDecoration arrow = (RotatableDecoration) target;
arrow.setLocation(getLocation(points));
Point refPoint;
- if(points.size() % 2 == 0) {
+ if (points.size() % 2 == 0) {
int i = points.size() / 2;
refPoint = points.getPoint(i - 1);
} else {
@@ -270,9 +270,10 @@ public class CustomGeneralOrderingEditPart extends GeneralOrderingEditPart imple
}
}
+ @Override
public void setStereotypeDisplay(String stereotypes, Image image) {
// Set stereotype text on figure
- if(!"".equals(stereotypes)) {
+ if (!"".equals(stereotypes)) {
fAppliedStereotypeLabel.setText(stereotypes);
} else {
fAppliedStereotypeLabel.setText("");
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/CustomInteractionEditPart.java
index 006aaace21d..75e78ca1492 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/CustomInteractionEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -80,7 +80,7 @@ import org.eclipse.uml2.uml.UMLPackage;
/**
* Add implementing IPapyrusEditPart to displaying Stereotypes.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class CustomInteractionEditPart extends InteractionEditPart implements IPapyrusEditPart {
@@ -92,7 +92,7 @@ public class CustomInteractionEditPart extends InteractionEditPart implements IP
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomInteractionEditPart(View view) {
@@ -103,11 +103,11 @@ public class CustomInteractionEditPart extends InteractionEditPart implements IP
* Try to use the notifier from super class, if not exist, create new one.
*/
protected NotificationHelper getNotifier() {
- if(notifier == null) {
+ if (notifier == null) {
try {
Field f = InteractionEditPart.class.getDeclaredField("notifier");
f.setAccessible(true);
- notifier = (NotificationHelper)f.get(this);
+ notifier = (NotificationHelper) f.get(this);
} catch (Exception e) {
notifier = new NotificationHelper(new UIAdapterImpl() {
@@ -128,13 +128,13 @@ public class CustomInteractionEditPart extends InteractionEditPart implements IP
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
+ // 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
+ // Create gate: https://bugs.eclipse.org/bugs/show_bug.cgi?id=389531
installEditPolicy("Gate Creation Edit Policy", new GateCreationEditPolicy());
- //Ordering fragments after creation, See https://bugs.eclipse.org/bugs/show_bug.cgi?id=403233
+ // Ordering fragments after creation, See https://bugs.eclipse.org/bugs/show_bug.cgi?id=403233
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new InteractionFragmentsCreationEditPolicy());
- //Install custom PrimaryDragEditPolicy to preserve anchors for lost and found.
+ // Install custom PrimaryDragEditPolicy to preserve anchors for lost and found.
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ResizableShapeEditPolicy() {
@Override
@@ -144,21 +144,21 @@ public class CustomInteractionEditPart extends InteractionEditPart implements IP
newBounds.width += sizeDelta.width;
newBounds.height += sizeDelta.height;
Dimension minimumSize = getFigure().getMinimumSize();
- //Avoid to update model when the new size is less than the minimum one.
- if(newBounds.width < minimumSize.width || newBounds.height < minimumSize.height) {
+ // Avoid to update model when the new size is less than the minimum one.
+ if (newBounds.width < minimumSize.width || newBounds.height < minimumSize.height) {
return UnexecutableCommand.INSTANCE;
}
Command command = super.getResizeCommand(request);
/** Anchors for Lost/Found message were updated, there's no need to preserve positions after resize. */
- //if(command != null && command.canExecute()) {
- //if(newBounds.width >= minimumSize.width && newBounds.height >= minimumSize.height) {
- //command = command.chain(new ICommandProxy(new PreserveAnchorsPositionCommand(CustomInteractionEditPart.this, sizeDelta, PreserveAnchorsPositionCommand.PRESERVE_XY)));
- //}
- //}
+ // if(command != null && command.canExecute()) {
+ // if(newBounds.width >= minimumSize.width && newBounds.height >= minimumSize.height) {
+ // command = command.chain(new ICommandProxy(new PreserveAnchorsPositionCommand(CustomInteractionEditPart.this, sizeDelta, PreserveAnchorsPositionCommand.PRESERVE_XY)));
+ // }
+ // }
return command;
}
});
- //install a editpolicy to display stereotypes
+ // install a editpolicy to display stereotypes
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
installEditPolicy(AbstractHeadImpactLayoutEditPolicy.HEAD_IMPACT_LAYOUT_POLICY, new InteractionHeadImpactLayoutEditPolicy());
}
@@ -173,11 +173,11 @@ 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()) {
- if(child instanceof InteractionInteractionCompartmentEditPart) {
- InteractionInteractionCompartmentEditPart childEditPart = (InteractionInteractionCompartmentEditPart)child;
- for(Object grandChild : childEditPart.getChildren()) {
- GraphicalEditPart editPart = (GraphicalEditPart)grandChild;
+ for (Object child : CustomInteractionEditPart.this.getChildren()) {
+ if (child instanceof InteractionInteractionCompartmentEditPart) {
+ InteractionInteractionCompartmentEditPart childEditPart = (InteractionInteractionCompartmentEditPart) child;
+ for (Object grandChild : childEditPart.getChildren()) {
+ GraphicalEditPart editPart = (GraphicalEditPart) grandChild;
IFigure figure = editPart.getFigure();
bounds.union(figure.getBounds());
}
@@ -200,16 +200,16 @@ public class CustomInteractionEditPart extends InteractionEditPart implements IP
* The changement in the background color of the Container must set the forground color of the
* ContainerCompartiment to avoid the separation line betewen the Compartiment and the
* ContainerLablel.
- *
+ *
* @Override-not
*/
@Override
protected void setBackgroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setBackgroundColor(color);
- if(primaryShape instanceof InteractionRectangleFigure) {
- InteractionRectangleFigure irf = (InteractionRectangleFigure)primaryShape;
- if(irf.getCompartmentFigure() != null) {
+ if (primaryShape instanceof InteractionRectangleFigure) {
+ InteractionRectangleFigure irf = (InteractionRectangleFigure) primaryShape;
+ if (irf.getCompartmentFigure() != null) {
irf.getCompartmentFigure().setForegroundColor(color);
}
}
@@ -229,19 +229,19 @@ public class CustomInteractionEditPart extends InteractionEditPart implements IP
protected void handleNotificationEvent(Notification notification) {
final NotificationHelper notifier = getNotifier();
Object feature = notification.getFeature();
- if(UMLPackage.eINSTANCE.getInteraction_FormalGate().equals(feature)) {
+ if (UMLPackage.eINSTANCE.getInteraction_FormalGate().equals(feature)) {
// Handle formal gate
- notifier.unlistenObject((Notifier)notification.getOldValue());
- notifier.listenObject((Notifier)notification.getNewValue());
- } else if(UMLPackage.eINSTANCE.getNamedElement_Name().equals(feature) && notification.getNotifier() instanceof Gate) {
+ notifier.unlistenObject((Notifier) notification.getOldValue());
+ notifier.listenObject((Notifier) notification.getNewValue());
+ } else if (UMLPackage.eINSTANCE.getNamedElement_Name().equals(feature) && notification.getNotifier() instanceof Gate) {
// Handle modification of formal gate's name
- Gate gate = (Gate)notification.getNotifier();
+ Gate gate = (Gate) notification.getNotifier();
String oldStringValue = notification.getOldStringValue();
String newStringValue = notification.getNewStringValue();
- if(oldStringValue != null && newStringValue != null) {
+ if (oldStringValue != null && newStringValue != null) {
String oldPrefix = oldStringValue.split("_")[0];
String newPrefix = newStringValue.split("_")[0];
- if(!oldPrefix.equals(newPrefix) && (oldPrefix.equals(MessageDirection.IN.getName()) || oldPrefix.equals(MessageDirection.OUT.getName()))) {
+ if (!oldPrefix.equals(newPrefix) && (oldPrefix.equals(MessageDirection.IN.getName()) || oldPrefix.equals(MessageDirection.OUT.getName()))) {
notifier.unlistenObject(gate);
gate.setName(oldPrefix + "_" + gate.getName());
notifier.listenObject(gate);
@@ -249,22 +249,23 @@ public class CustomInteractionEditPart extends InteractionEditPart implements IP
}
}
super.handleNotificationEvent(notification);
- if(!notification.isTouch()) {
+ if (!notification.isTouch()) {
synchronizeSize();
}
}
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeEditPart#refreshBounds()
- *
+ *
*/
@Override
protected void refreshBounds() {
super.refreshBounds();
- //Add size updater at the beginning of showing this edit part.
+ // Add size updater at the beginning of showing this edit part.
getViewer().getControl().getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
synchronizeSize();
}
@@ -280,38 +281,42 @@ public class CustomInteractionEditPart extends InteractionEditPart implements IP
*/
private void synchronizeSize() {
View view = getNotationView();
- if(view instanceof Shape) {
- LayoutConstraint c = ((Shape)view).getLayoutConstraint();
- if(c instanceof Size) {
- final Size size = (Size)c;
+ if (view instanceof Shape) {
+ LayoutConstraint c = ((Shape) view).getLayoutConstraint();
+ if (c instanceof Size) {
+ final Size size = (Size) c;
Dimension realSize = getFigure().getMinimumSize();
final Dimension sizeDelta = new Dimension();
- if(size.getWidth() != -1 && realSize.width > size.getWidth()) {
+ if (size.getWidth() != -1 && realSize.width > size.getWidth()) {
sizeDelta.width = realSize.width;
}
- if(size.getHeight() != -1 && realSize.height > size.getHeight()) {
+ if (size.getHeight() != -1 && realSize.height > size.getHeight()) {
sizeDelta.height = realSize.height;
}
- if(sizeDelta.width != 0 || sizeDelta.height != 0) {
+ if (sizeDelta.width != 0 || sizeDelta.height != 0) {
AbstractCommand cmd = new AbstractCommand() {
+ @Override
public boolean canExecute() {
return true;
}
+ @Override
public boolean canUndo() {
return false;
}
+ @Override
public void execute() {
- if(sizeDelta.width != 0) {
+ if (sizeDelta.width != 0) {
size.setWidth(sizeDelta.width);
}
- if(sizeDelta.height != 0) {
+ if (sizeDelta.height != 0) {
size.setHeight(sizeDelta.height);
}
}
+ @Override
public void redo() {
execute();
}
@@ -329,9 +334,9 @@ public class CustomInteractionEditPart extends InteractionEditPart implements IP
public void activate() {
super.activate();
final NotificationHelper notifier = getNotifier();
- Interaction interaction = (Interaction)resolveSemanticElement();
- if(interaction != null) {
- for(Gate formalGate : interaction.getFormalGates()) {
+ Interaction interaction = (Interaction) resolveSemanticElement();
+ if (interaction != null) {
+ for (Gate formalGate : interaction.getFormalGates()) {
notifier.listenObject(formalGate);
}
}
@@ -344,7 +349,7 @@ public class CustomInteractionEditPart extends InteractionEditPart implements IP
@Override
public void deactivate() {
super.deactivate();
- if(notifier != null) {
+ if (notifier != null) {
notifier.unlistenAll();
}
}
@@ -354,7 +359,7 @@ public class CustomInteractionEditPart extends InteractionEditPart implements IP
*/
@Override
public void removeNotify() {
- if(notifier != null) {
+ if (notifier != null) {
notifier.unlistenAll();
}
super.removeNotify();
@@ -366,7 +371,7 @@ public class CustomInteractionEditPart extends InteractionEditPart implements IP
@Override
public ConnectionAnchor getSourceConnectionAnchor(Request request) {
ConnectionAnchor sourceAnchor = createAnchor(request, UMLElementTypes.Message_4009, Message7EditPart.VISUAL_ID, Message7EditPart.class);
- if(sourceAnchor == null) {
+ if (sourceAnchor == null) {
sourceAnchor = super.getSourceConnectionAnchor(request);
}
return sourceAnchor;
@@ -377,18 +382,18 @@ public class CustomInteractionEditPart extends InteractionEditPart implements IP
*/
@Override
public ConnectionAnchor getSourceConnectionAnchor(ConnectionEditPart connEditPart) {
- if(connEditPart instanceof Message7EditPart) {
+ if (connEditPart instanceof Message7EditPart) {
String terminal = AnchorHelper.getAnchorId(getEditingDomain(), connEditPart, true);
- if(terminal.length() > 0) {
+ if (terminal.length() > 0) {
PrecisionPoint pt = BaseSlidableAnchor.parseTerminalString(terminal);
return new AnchorHelper.InnerPointAnchor(getFigure(), pt);
}
}
ConnectionAnchor sourceConnectionAnchor = super.getSourceConnectionAnchor(connEditPart);
- // Point referencePoint = sourceConnectionAnchor.getReferencePoint();
- // if(connEditPart instanceof Message7EditPart && referencePoint.x != 0 && referencePoint.y != 0) {
- // sourceConnectionAnchor = new XYAnchor(referencePoint);
- // }
+ // Point referencePoint = sourceConnectionAnchor.getReferencePoint();
+ // if(connEditPart instanceof Message7EditPart && referencePoint.x != 0 && referencePoint.y != 0) {
+ // sourceConnectionAnchor = new XYAnchor(referencePoint);
+ // }
return sourceConnectionAnchor;
}
@@ -398,12 +403,12 @@ public class CustomInteractionEditPart extends InteractionEditPart implements IP
@Override
public ConnectionAnchor getTargetConnectionAnchor(Request request) {
ConnectionAnchor targetAnchor = createAnchor(request, UMLElementTypes.Message_4008, Message6EditPart.VISUAL_ID, Message6EditPart.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
+ 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, UMLElementTypes.Message_4006, Message4EditPart.VISUAL_ID, Message4EditPart.class);
}
- if(targetAnchor == null) {
+ if (targetAnchor == null) {
targetAnchor = super.getTargetConnectionAnchor(request);
}
return targetAnchor;
@@ -414,59 +419,59 @@ public class CustomInteractionEditPart extends InteractionEditPart implements IP
*/
@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 Message6EditPart || connEditPart instanceof Message4EditPart) {
+ // 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 Message6EditPart || connEditPart instanceof Message4EditPart) {
String terminal = AnchorHelper.getAnchorId(getEditingDomain(), connEditPart, false);
- if(terminal.length() > 0) {
+ if (terminal.length() > 0) {
PrecisionPoint pt = BaseSlidableAnchor.parseTerminalString(terminal);
return new AnchorHelper.InnerPointAnchor(getFigure(), pt);
}
}
ConnectionAnchor targetConnectionAnchor = super.getTargetConnectionAnchor(connEditPart);
- // Point referencePoint = targetConnectionAnchor.getReferencePoint();
- // if(connEditPart instanceof Message6EditPart && referencePoint.x != 0 && referencePoint.y != 0) {
- // targetConnectionAnchor = new XYAnchor(referencePoint);
- // }
+ // Point referencePoint = targetConnectionAnchor.getReferencePoint();
+ // if(connEditPart instanceof Message6EditPart && referencePoint.x != 0 && referencePoint.y != 0) {
+ // targetConnectionAnchor = new XYAnchor(referencePoint);
+ // }
return targetConnectionAnchor;
}
/**
* Create Anchor
- *
+ *
* @param request
- * The request
+ * The request
* @param elementType
- * The element type of the message
+ * The element type of the message
* @param visualId
- * The visual ID of the message
+ * The visual ID of the message
* @param messageType
- * The type of the message
+ * The type of the message
* @return The connection anchor
*/
private ConnectionAnchor createAnchor(Request request, IElementType elementType, int visualId, Class<?> messageType) {
- if(request instanceof CreateUnspecifiedTypeConnectionRequest) {
- CreateUnspecifiedTypeConnectionRequest createRequest = (CreateUnspecifiedTypeConnectionRequest)request;
+ if (request instanceof CreateUnspecifiedTypeConnectionRequest) {
+ CreateUnspecifiedTypeConnectionRequest createRequest = (CreateUnspecifiedTypeConnectionRequest) request;
List<?> relationshipTypes = createRequest.getElementTypes();
- for(Object obj : relationshipTypes) {
- if(elementType.equals(obj)) {
+ for (Object obj : relationshipTypes) {
+ if (elementType.equals(obj)) {
return createAnchor(createRequest.getLocation().getCopy());
}
}
- } else if(request instanceof CreateConnectionViewRequest) {
- CreateConnectionViewRequest createRequest = (CreateConnectionViewRequest)request;
+ } else if (request instanceof CreateConnectionViewRequest) {
+ CreateConnectionViewRequest createRequest = (CreateConnectionViewRequest) request;
ConnectionViewDescriptor connectionViewDescriptor = createRequest.getConnectionViewDescriptor();
- if(connectionViewDescriptor != null) {
- if(String.valueOf(visualId).equals(connectionViewDescriptor.getSemanticHint())) {
+ if (connectionViewDescriptor != null) {
+ if (String.valueOf(visualId).equals(connectionViewDescriptor.getSemanticHint())) {
return createAnchor(createRequest.getLocation().getCopy());
}
}
- } else if(request instanceof ReconnectRequest) {
- ReconnectRequest reconnectRequest = (ReconnectRequest)request;
+ } 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());
+ // Fixed bug creating anchors for MessageLost and MessageFound.
+ if (messageType.isInstance(connectionEditPart) && request instanceof LocationRequest) {
+ return createAnchor(((LocationRequest) request).getLocation().getCopy());
}
}
return null;
@@ -474,28 +479,28 @@ public class CustomInteractionEditPart extends InteractionEditPart implements IP
/**
* Create Anchor
- *
+ *
* @param location
- * The location
+ * The location
* @return The connection anchor
*/
private ConnectionAnchor createAnchor(Point location) {
- //return new SlidableAnchor(getFigure(), BaseSlidableAnchor.getAnchorRelativeLocation(location, getFigure().getBounds()));
+ // return new SlidableAnchor(getFigure(), BaseSlidableAnchor.getAnchorRelativeLocation(location, getFigure().getBounds()));
return AnchorHelper.InnerPointAnchor.createAnchorAtLocation(getFigure(), new PrecisionPoint(location));
}
@Override
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof InteractionNameEditPart) {
+ if (childEditPart instanceof InteractionNameEditPart) {
return true;
}
- if(childEditPart instanceof InteractionInteractionCompartmentEditPart) {
+ if (childEditPart instanceof InteractionInteractionCompartmentEditPart) {
IFigure pane = getPrimaryShape().getCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.remove(((InteractionInteractionCompartmentEditPart)childEditPart).getFigure());
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.remove(((InteractionInteractionCompartmentEditPart) childEditPart).getFigure());
return true;
- } else if(childEditPart instanceof GateEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((GateEditPart)childEditPart).getFigure());
+ } else if (childEditPart instanceof GateEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((GateEditPart) childEditPart).getFigure());
return true;
}
return false;
@@ -504,24 +509,27 @@ public class CustomInteractionEditPart extends InteractionEditPart implements IP
/**
* Create a BorderedNodeFigure for holding Gates.
*/
+ @Override
protected NodeFigure createNodeFigure() {
return new BorderedNodeFigure(super.createNodeFigure());
}
+ @Override
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
}
public final BorderedNodeFigure getBorderedFigure() {
- return (BorderedNodeFigure)getFigure();
+ return (BorderedNodeFigure) getFigure();
}
+ @Override
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof GateEditPart) {
- getBorderedFigure().getBorderItemContainer().add(((GateEditPart)childEditPart).getFigure(), new GateLocator((GateEditPart)childEditPart, getFigure()));
+ if (childEditPart instanceof GateEditPart) {
+ getBorderedFigure().getBorderItemContainer().add(((GateEditPart) childEditPart).getFigure(), new GateLocator((GateEditPart) childEditPart, getFigure()));
return true;
}
return super.addFixedChild(childEditPart);
@@ -537,7 +545,7 @@ public class CustomInteractionEditPart extends InteractionEditPart implements IP
@Override
protected ConnectionAnchor createAnchor(PrecisionPoint p) {
- if(p == null) {
+ if (p == null) {
// If the old terminal for the connection anchor cannot be resolved (by SlidableAnchor) a null
// PrecisionPoint will passed in - this is handled here
return createDefaultAnchor();
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 e80899222a4..d1afa9309e0 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -29,7 +29,7 @@ public class CustomInteractionInteractionCompartmentEditPart extends Interaction
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomInteractionInteractionCompartmentEditPart(View view) {
@@ -53,7 +53,7 @@ public class CustomInteractionInteractionCompartmentEditPart extends Interaction
// TODO Use transparency instead of send to back method
@Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(childEditPart instanceof CombinedFragmentEditPart || childEditPart instanceof ConsiderIgnoreFragmentEditPart || childEditPart instanceof InteractionUseEditPart) {
+ if (childEditPart instanceof CombinedFragmentEditPart || childEditPart instanceof ConsiderIgnoreFragmentEditPart || childEditPart instanceof InteractionUseEditPart) {
index = 0;
}
super.addChildVisual(childEditPart, index);
@@ -67,15 +67,15 @@ public class CustomInteractionInteractionCompartmentEditPart extends Interaction
*/
@Override
public void showTargetFeedback(Request request) {
- if(!isEditModeEnabled() || !isActive()) {
+ if (!isEditModeEnabled() || !isActive()) {
return;
}
// Avoid default drop feedback by setting background, just highlight it
// with bold border.
EditPolicyIterator i = getEditPolicyIterator();
- while(i.hasNext()) {
+ while (i.hasNext()) {
EditPolicy next = i.next();
- if(REQ_CREATE.equals(request.getType()) && next.getClass().getName().equals("org.eclipse.papyrus.infra.gmfdiag.dnd.policy.CustomizableDropEditPolicy")) {
+ if (REQ_CREATE.equals(request.getType()) && next.getClass().getName().equals("org.eclipse.papyrus.infra.gmfdiag.dnd.policy.CustomizableDropEditPolicy")) {
HighlightUtil.highlight(this);
} else {
next.showTargetFeedback(request);
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 8dc1c0716a2..d3bcd9ba40f 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -26,7 +26,7 @@ public class CustomInteractionNameEditPart extends InteractionNameEditPart {
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomInteractionNameEditPart(View view) {
@@ -40,10 +40,10 @@ public class CustomInteractionNameEditPart extends InteractionNameEditPart {
protected void refreshLabelContainer() {
Object p = getParent();
- if(p instanceof InteractionEditPart) {
- InteractionEditPart iep = (InteractionEditPart)p;
+ if (p instanceof InteractionEditPart) {
+ InteractionEditPart iep = (InteractionEditPart) p;
IFigure container = iep.getPrimaryShape().getHeaderLabel().getParent();
- if(container != null) {
+ if (container != null) {
container.revalidate();
container.repaint();
}
@@ -52,13 +52,13 @@ public class CustomInteractionNameEditPart extends InteractionNameEditPart {
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionNameEditPart#handleNotificationEvent(org.eclipse.emf.common.notify.Notification)
- *
+ *
* @param event
*/
@Override
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
- if(ElementIconUtil.isIconNotification(event)) {
+ if (ElementIconUtil.isIconNotification(event)) {
refreshLabelContainer();
}
}
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 22ea6502b1b..88d64a46da4 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -128,7 +128,7 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomInteractionOperandEditPart(View view) {
@@ -139,11 +139,11 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
* Try to use the notifier from super class, if not exist, create new one.
*/
protected NotificationHelper getNotifierHelper() {
- if(notifierHelper == null) {
+ if (notifierHelper == null) {
try {
Field f = InteractionOperandEditPart.class.getDeclaredField("notifier");
f.setAccessible(true);
- notifierHelper = (NotificationHelper)f.get(this);
+ notifierHelper = (NotificationHelper) f.get(this);
} catch (Exception e) {
notifierHelper = new NotificationHelper(new UIAdapterImpl() {
@@ -159,8 +159,8 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
@Override
protected void setLineWidth(int width) {
- if(primaryShape instanceof NodeFigure) {
- ((NodeFigure)primaryShape).setLineWidth(width);
+ if (primaryShape instanceof NodeFigure) {
+ ((NodeFigure) primaryShape).setLineWidth(width);
}
super.setLineWidth(width);
}
@@ -169,7 +169,7 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
* Remove EditPolicyRoles.DRAG_DROP_ROLE and EditPolicy.PRIMARY_DRAG_ROLE :
* - adding elements to an interactionOperand doesn't anymore resize the enclosing CF
* - interactionOperand are no longer dNd
- *
+ *
* @Override
*/
@Override
@@ -186,12 +186,12 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
/**
* Overrides to return the contentPane instead of the main figure in case the editPart is not a IBorderItemEditPart.
* (non-Javadoc)
- *
+ *
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart#getContentPaneFor(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart)
*/
@Override
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
} else {
return getContentPane();
@@ -200,13 +200,12 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
/**
* Overrides to add a specific locator on the ContinuationEditPart
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderedShapeEditPart#addBorderItem(org.eclipse.draw2d.IFigure,
- * org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart)
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderedShapeEditPart#addBorderItem(org.eclipse.draw2d.IFigure, org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart)
*/
@Override
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof ContinuationEditPart) {
+ if (borderItemEditPart instanceof ContinuationEditPart) {
borderItemContainer.add(borderItemEditPart.getFigure(), new ContinuationLocator(getMainFigure(), getContinuationPosition(borderItemEditPart)));
return;
}
@@ -215,31 +214,31 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
/**
* Get the initial position of the continuation
- *
+ *
* @param borderItemEditPart
- * the borderItemEditPart
+ * the borderItemEditPart
* @return the initial position. ContinuationLocator.BOTTOM if none found
*/
private int getContinuationPosition(IBorderItemEditPart borderItemEditPart) {
Object model = borderItemEditPart.getModel();
- if(model instanceof org.eclipse.gmf.runtime.notation.Shape) {
- org.eclipse.gmf.runtime.notation.Shape shape = (org.eclipse.gmf.runtime.notation.Shape)model;
+ if (model instanceof org.eclipse.gmf.runtime.notation.Shape) {
+ org.eclipse.gmf.runtime.notation.Shape shape = (org.eclipse.gmf.runtime.notation.Shape) model;
EObject eObject = shape.getElement();
- if(eObject instanceof Continuation) {
- return ((Continuation)eObject).isSetting() ? PositionConstants.SOUTH : PositionConstants.NORTH;
+ if (eObject instanceof Continuation) {
+ return ((Continuation) eObject).isSetting() ? PositionConstants.SOUTH : PositionConstants.NORTH;
}
}
return PositionConstants.NORTH;
}
static String getGuardLabelText(InteractionOperand interactionOperand, boolean edit) {
- CombinedFragment enclosingCF = (CombinedFragment)interactionOperand.getOwner();
+ CombinedFragment enclosingCF = (CombinedFragment) interactionOperand.getOwner();
InteractionOperatorKind cfOperator = enclosingCF.getInteractionOperator();
InteractionConstraint guard = interactionOperand.getGuard();
String specValue = null;
- if(guard != null) {
+ if (guard != null) {
ValueSpecification specification = guard.getSpecification();
- if(specification != null) {
+ if (specification != null) {
try {
specValue = specification.stringValue();
} catch (Exception e) {
@@ -247,24 +246,24 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
}
}
StringBuilder sb = new StringBuilder("");
- if(InteractionOperatorKind.LOOP_LITERAL.equals(cfOperator)) {
+ if (InteractionOperatorKind.LOOP_LITERAL.equals(cfOperator)) {
String condition = LoopOperatorUtil.getLoopCondition(guard);
- if(condition != null) {
+ if (condition != null) {
sb.append(condition);
}
}
- if(specValue == null) {
+ if (specValue == null) {
EList<InteractionOperand> operands = enclosingCF.getOperands();
- if(InteractionOperatorKind.ALT_LITERAL.equals(cfOperator) && interactionOperand.equals(operands.get(operands.size() - 1))) {
+ if (InteractionOperatorKind.ALT_LITERAL.equals(cfOperator) && interactionOperand.equals(operands.get(operands.size() - 1))) {
specValue = "else";
}
}
- if(specValue != null) {
- if(!edit) {
+ if (specValue != null) {
+ if (!edit) {
sb.append('[');
}
sb.append(specValue);
- if(!edit) {
+ if (!edit) {
sb.append(']');
}
}
@@ -280,76 +279,76 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
final NotificationHelper notifierHelper = getNotifierHelper();
Object feature = notification.getFeature();
Object newValue = notification.getNewValue();
- if(UMLPackage.eINSTANCE.getInteractionOperand_Guard().equals(feature)) {
+ if (UMLPackage.eINSTANCE.getInteractionOperand_Guard().equals(feature)) {
// Case of add, change or delete guard
- if(notification.getOldValue() instanceof InteractionConstraint) {
- InteractionConstraint constraint = (InteractionConstraint)notification.getOldValue();
+ if (notification.getOldValue() instanceof InteractionConstraint) {
+ InteractionConstraint constraint = (InteractionConstraint) notification.getOldValue();
notifierHelper.unlistenObject(constraint);
notifierHelper.unlistenObject(constraint.getSpecification());
notifierHelper.unlistenObject(constraint.getMaxint());
notifierHelper.unlistenObject(constraint.getMinint());
}
- if(newValue instanceof InteractionConstraint) {
- InteractionConstraint constraint = (InteractionConstraint)newValue;
+ if (newValue instanceof InteractionConstraint) {
+ InteractionConstraint constraint = (InteractionConstraint) newValue;
notifierHelper.listenObject(constraint);
notifierHelper.listenObject(constraint.getSpecification());
notifierHelper.listenObject(constraint.getMaxint());
notifierHelper.listenObject(constraint.getMinint());
}
- } else if(UMLPackage.eINSTANCE.getConstraint_Specification().equals(feature)) {
+ } else if (UMLPackage.eINSTANCE.getConstraint_Specification().equals(feature)) {
// Case of add, change or delete Specification
- if(notification.getOldValue() instanceof ValueSpecification) {
- notifierHelper.unlistenObject((ValueSpecification)notification.getOldValue());
+ if (notification.getOldValue() instanceof ValueSpecification) {
+ notifierHelper.unlistenObject((ValueSpecification) notification.getOldValue());
}
- if(newValue instanceof ValueSpecification) {
- ValueSpecification newStringValue = (ValueSpecification)newValue;
+ if (newValue instanceof ValueSpecification) {
+ ValueSpecification newStringValue = (ValueSpecification) newValue;
notifierHelper.listenObject(newStringValue);
}
- } else if(UMLPackage.eINSTANCE.getInteractionConstraint_Minint().equals(feature)) {
+ } else if (UMLPackage.eINSTANCE.getInteractionConstraint_Minint().equals(feature)) {
// Case of add, change or delete Minint
- if(notification.getOldValue() instanceof LiteralInteger) {
- notifierHelper.unlistenObject((LiteralInteger)notification.getOldValue());
+ if (notification.getOldValue() instanceof LiteralInteger) {
+ notifierHelper.unlistenObject((LiteralInteger) notification.getOldValue());
}
- if(newValue instanceof LiteralInteger) {
- LiteralInteger newIntegerValue = (LiteralInteger)newValue;
+ if (newValue instanceof LiteralInteger) {
+ LiteralInteger newIntegerValue = (LiteralInteger) newValue;
notifierHelper.listenObject(newIntegerValue);
}
- } else if(UMLPackage.eINSTANCE.getInteractionConstraint_Maxint().equals(feature)) {
+ } else if (UMLPackage.eINSTANCE.getInteractionConstraint_Maxint().equals(feature)) {
// Case of add, change or delete Maxint
- if(notification.getOldValue() instanceof LiteralInteger) {
- notifierHelper.unlistenObject((LiteralInteger)notification.getOldValue());
+ if (notification.getOldValue() instanceof LiteralInteger) {
+ notifierHelper.unlistenObject((LiteralInteger) notification.getOldValue());
}
- if(newValue instanceof LiteralInteger) {
- LiteralInteger newIntegerValue = (LiteralInteger)newValue;
+ if (newValue instanceof LiteralInteger) {
+ LiteralInteger newIntegerValue = (LiteralInteger) newValue;
notifierHelper.listenObject(newIntegerValue);
}
}
// handle modification of minint et maxint to match constraints min <= max and min >= 0
- if(notification.getNotifier() instanceof LiteralInteger && InteractionOperatorKind.LOOP_LITERAL.equals(getInteractionOperator())) {
- LiteralInteger literalIntNotifier = (LiteralInteger)notification.getNotifier();
+ if (notification.getNotifier() instanceof LiteralInteger && InteractionOperatorKind.LOOP_LITERAL.equals(getInteractionOperator())) {
+ LiteralInteger literalIntNotifier = (LiteralInteger) notification.getNotifier();
EStructuralFeature containingFeature = literalIntNotifier.eContainingFeature();
- if(UMLPackage.eINSTANCE.getInteractionConstraint_Minint().equals(containingFeature)) {
- InteractionConstraint constraint = (InteractionConstraint)literalIntNotifier.getOwner();
- if(newValue instanceof Integer) {
- Integer newMin = (Integer)newValue;
- if(newMin < 0) {
+ if (UMLPackage.eINSTANCE.getInteractionConstraint_Minint().equals(containingFeature)) {
+ InteractionConstraint constraint = (InteractionConstraint) literalIntNotifier.getOwner();
+ if (newValue instanceof Integer) {
+ Integer newMin = (Integer) newValue;
+ if (newMin < 0) {
literalIntNotifier.setValue(0);
}
- if(constraint.getMaxint() instanceof LiteralInteger) {
- int max = ((LiteralInteger)constraint.getMaxint()).getValue();
- if(max != -1 && newMin > max) {
+ if (constraint.getMaxint() instanceof LiteralInteger) {
+ int max = ((LiteralInteger) constraint.getMaxint()).getValue();
+ if (max != -1 && newMin > max) {
literalIntNotifier.setValue(max);
}
}
}
- } else if(UMLPackage.eINSTANCE.getInteractionConstraint_Maxint().equals(containingFeature)) {
- InteractionConstraint constraint = (InteractionConstraint)literalIntNotifier.getOwner();
- if(newValue instanceof Integer) {
- Integer newMax = (Integer)newValue;
+ } else if (UMLPackage.eINSTANCE.getInteractionConstraint_Maxint().equals(containingFeature)) {
+ InteractionConstraint constraint = (InteractionConstraint) literalIntNotifier.getOwner();
+ if (newValue instanceof Integer) {
+ Integer newMax = (Integer) newValue;
int min = 0;
- if(constraint.getMinint() instanceof LiteralInteger) {
- min = ((LiteralInteger)constraint.getMinint()).getValue();
- if(newMax != -1 && newMax < min) {
+ if (constraint.getMinint() instanceof LiteralInteger) {
+ min = ((LiteralInteger) constraint.getMinint()).getValue();
+ if (newMax != -1 && newMax < min) {
literalIntNotifier.setValue(min);
}
}
@@ -358,27 +357,27 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
}
updateConstraintLabel();
// Manage Continuation constraint on covered lifeline :
- // Continuations are always global in the enclosing InteractionFragment
- //(e.g., it always covers all Lifelines covered by the enclosing InteractionFragment)
- if(UMLPackage.eINSTANCE.getInteractionFragment_Covered().equals(feature)) {
+ // Continuations are always global in the enclosing InteractionFragment
+ // (e.g., it always covers all Lifelines covered by the enclosing InteractionFragment)
+ if (UMLPackage.eINSTANCE.getInteractionFragment_Covered().equals(feature)) {
// In case we are in an alternative combined fragment, this interaction operand may have continuation which need to be updated.
- if(InteractionOperatorKind.ALT_LITERAL.equals(getInteractionOperator())) {
- InteractionOperand interactionOperand = (InteractionOperand)notification.getNotifier();
+ if (InteractionOperatorKind.ALT_LITERAL.equals(getInteractionOperator())) {
+ InteractionOperand interactionOperand = (InteractionOperand) notification.getNotifier();
EList<Lifeline> currentlyCoveredLifeline = interactionOperand.getCovereds();
- for(InteractionFragment interactionFragment : interactionOperand.getFragments()) {
- if(interactionFragment instanceof Continuation) {
+ for (InteractionFragment interactionFragment : interactionOperand.getFragments()) {
+ if (interactionFragment instanceof Continuation) {
EList<Lifeline> continuationCoveredLifelines = interactionFragment.getCovereds();
- if(!continuationCoveredLifelines.equals(currentlyCoveredLifeline)) {
+ if (!continuationCoveredLifelines.equals(currentlyCoveredLifeline)) {
// Add new covered lifelines (not already covered)
List<Lifeline> coveredLifelinesToAdd = new ArrayList<Lifeline>(currentlyCoveredLifeline);
coveredLifelinesToAdd.removeAll(continuationCoveredLifelines);
- if(!coveredLifelinesToAdd.isEmpty()) {
+ if (!coveredLifelinesToAdd.isEmpty()) {
CommandHelper.executeCommandWithoutHistory(getEditingDomain(), AddCommand.create(getEditingDomain(), interactionFragment, UMLPackage.eINSTANCE.getInteractionFragment_Covered(), coveredLifelinesToAdd), true);
}
// Delete old covered lifelines (not covered anymore)
List<Lifeline> coveredLifelinesToRemove = new ArrayList<Lifeline>(continuationCoveredLifelines);
coveredLifelinesToRemove.removeAll(currentlyCoveredLifeline);
- if(!coveredLifelinesToRemove.isEmpty()) {
+ if (!coveredLifelinesToRemove.isEmpty()) {
CommandHelper.executeCommandWithoutHistory(getEditingDomain(), RemoveCommand.create(getEditingDomain(), interactionFragment, UMLPackage.eINSTANCE.getInteractionFragment_Covered(), coveredLifelinesToRemove), true);
}
}
@@ -387,15 +386,15 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
}
}
super.handleNotificationEvent(notification);
- if((getModel() != null) && (getModel() == notification.getNotifier())) {
- if(NotationPackage.eINSTANCE.getLineStyle_LineWidth().equals(feature)) {
+ if ((getModel() != null) && (getModel() == notification.getNotifier())) {
+ if (NotationPackage.eINSTANCE.getLineStyle_LineWidth().equals(feature)) {
refreshLineWidth();
}
}
- if(ElementIconUtil.isIconNotification(notification)) {
+ if (ElementIconUtil.isIconNotification(notification)) {
refreshLabelIcon();
}
- if(InteractionOperandModelElementFactory.isGuardVisibilityChanged(notification)) {
+ if (InteractionOperandModelElementFactory.isGuardVisibilityChanged(notification)) {
refreshChildren();
refreshGuard();
}
@@ -403,17 +402,17 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart#getModelChildren()
- *
+ *
* @return
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
protected List getModelChildren() {
List modelChildren = new ArrayList(super.getModelChildren());
- if(!isGuardVisible()) {
+ if (!isGuardVisible()) {
List result = new ArrayList();
- for(Object object : modelChildren) {
- if(object instanceof View && InteractionOperandGuardEditPart.GUARD_TYPE.equals(((View)object).getType())) {
+ for (Object object : modelChildren) {
+ if (object instanceof View && InteractionOperandGuardEditPart.GUARD_TYPE.equals(((View) object).getType())) {
continue;
}
result.add(object);
@@ -421,13 +420,13 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
return result;
} else {
boolean hasGuardChild = false;
- for(Object object : modelChildren) {
- if(object instanceof View && InteractionOperandGuardEditPart.GUARD_TYPE.equals(((View)object).getType())) {
+ for (Object object : modelChildren) {
+ if (object instanceof View && InteractionOperandGuardEditPart.GUARD_TYPE.equals(((View) object).getType())) {
hasGuardChild = true;
break;
}
}
- if(!hasGuardChild) {
+ if (!hasGuardChild) {
final View view = getNotationView();
final DecorationNode guardNode = NotationFactory.eINSTANCE.createDecorationNode();
Bounds b = NotationFactory.eINSTANCE.createBounds();
@@ -435,8 +434,8 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
b.setY(5);
guardNode.setLayoutConstraint(b);
guardNode.setType(InteractionOperandGuardEditPart.GUARD_TYPE);
- if(view.getElement() instanceof InteractionOperand) {
- guardNode.setElement(((InteractionOperand)view.getElement()).getGuard());
+ if (view.getElement() instanceof InteractionOperand) {
+ guardNode.setElement(((InteractionOperand) view.getElement()).getGuard());
}
CommandHelper.executeCommandWithoutHistory(getEditingDomain(), new DummyCommand() {
@@ -469,12 +468,12 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
*/
public WrappingLabel getInteractionConstraintLabel() {
IGraphicalEditPart child = getChildBySemanticHint(InteractionOperandGuardEditPart.GUARD_TYPE);
- if(child instanceof InteractionOperandGuardEditPart) {
- IFigure figure = ((InteractionOperandGuardEditPart)child).getFigure();
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure);
- } else if(figure instanceof GuardFigure) {
- return ((GuardFigure)figure).getPrimaryLabel();
+ if (child instanceof InteractionOperandGuardEditPart) {
+ IFigure figure = ((InteractionOperandGuardEditPart) child).getFigure();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure);
+ } else if (figure instanceof GuardFigure) {
+ return ((GuardFigure) figure).getPrimaryLabel();
}
}
return getPrimaryShape().getInteractionConstraintLabel();
@@ -493,23 +492,23 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
*/
protected void refreshGuard() {
IGraphicalEditPart guard = getChildBySemanticHint(InteractionOperandGuardEditPart.GUARD_TYPE);
- if(!(guard instanceof InteractionOperandGuardEditPart)) {
+ if (!(guard instanceof InteractionOperandGuardEditPart)) {
return;
}
- ((InteractionOperandGuardEditPart)guard).refreshLabel();
+ ((InteractionOperandGuardEditPart) guard).refreshLabel();
// Refresh Stereotypes.
EditPolicy editPolicy = getEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY);
- if(editPolicy instanceof AppliedStereotypeLabelDisplayEditPolicy) {
- ((AppliedStereotypeLabelDisplayEditPolicy)editPolicy).refreshDisplay();
+ if (editPolicy instanceof AppliedStereotypeLabelDisplayEditPolicy) {
+ ((AppliedStereotypeLabelDisplayEditPolicy) editPolicy).refreshDisplay();
}
}
@Override
protected void refreshBackgroundColor() {
- FillStyle style = (FillStyle)getPrimaryView().getStyle(NotationPackage.Literals.FILL_STYLE);
- if(style != null) {
- if((style.getGradient() == null || !supportsGradient())) {
- if(16777215 == style.getFillColor()) { // default color
+ FillStyle style = (FillStyle) getPrimaryView().getStyle(NotationPackage.Literals.FILL_STYLE);
+ if (style != null) {
+ if ((style.getGradient() == null || !supportsGradient())) {
+ if (16777215 == style.getFillColor()) { // default color
getPrimaryShape().setTransparency(100);
getPrimaryShape().setIsUsingGradient(true);
getPrimaryShape().setGradientData(style.getFillColor(), style.getFillColor(), 0);
@@ -535,8 +534,8 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
@Override
protected void setGradient(GradientData gradient) {
IPapyrusNodeFigure fig = getPrimaryShape();
- FillStyle style = (FillStyle)getPrimaryView().getStyle(NotationPackage.Literals.FILL_STYLE);
- if(gradient != null) {
+ FillStyle style = (FillStyle) getPrimaryView().getStyle(NotationPackage.Literals.FILL_STYLE);
+ if (gradient != null) {
setTransparency(0);
fig.setIsUsingGradient(true);
fig.setGradientData(style.getFillColor(), gradient.getGradientColor1(), gradient.getGradientStyle());
@@ -560,18 +559,18 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
/**
* Get the InteractionOperator of the CombinedFragment.
- *
+ *
* @return The InteractionOperator
*/
private InteractionOperatorKind getInteractionOperator() {
InteractionOperatorKind interactionOperatorKind = null;
EditPart parent = getParent();
- if(parent instanceof CombinedFragmentCombinedFragmentCompartmentEditPart) {
+ if (parent instanceof CombinedFragmentCombinedFragmentCompartmentEditPart) {
parent = parent.getParent();
- if(parent instanceof CombinedFragmentEditPart) {
- EObject element = ((CombinedFragmentEditPart)parent).resolveSemanticElement();
- if(element instanceof CombinedFragment) {
- interactionOperatorKind = ((CombinedFragment)element).getInteractionOperator();
+ if (parent instanceof CombinedFragmentEditPart) {
+ EObject element = ((CombinedFragmentEditPart) parent).resolveSemanticElement();
+ if (element instanceof CombinedFragment) {
+ interactionOperatorKind = ((CombinedFragment) element).getInteractionOperator();
}
}
}
@@ -583,7 +582,7 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
*/
public void setFirstOperand(boolean firstOperand) {
this.firstOperand = firstOperand;
- if(primaryShape != null) {
+ if (primaryShape != null) {
getPrimaryShape().setLineSeparator(!firstOperand);
}
}
@@ -602,7 +601,7 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
*/
@Override
public void deactivate() {
- if(notifierHelper != null) {
+ if (notifierHelper != null) {
notifierHelper.unlistenAll();
}
super.deactivate();
@@ -613,7 +612,7 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
*/
@Override
public void removeNotify() {
- if(notifierHelper != null) {
+ if (notifierHelper != null) {
notifierHelper.unlistenAll();
}
super.removeNotify();
@@ -625,10 +624,10 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
private void addListeners() {
final NotificationHelper notifierHelper = getNotifierHelper();
EObject eObject = resolveSemanticElement();
- if(eObject instanceof InteractionOperand) {
- InteractionOperand interactionOperand = (InteractionOperand)eObject;
+ if (eObject instanceof InteractionOperand) {
+ InteractionOperand interactionOperand = (InteractionOperand) eObject;
InteractionConstraint guard = interactionOperand.getGuard();
- if(guard != null) {
+ if (guard != null) {
notifierHelper.listenObject(guard);
notifierHelper.listenObject(guard.getSpecification());
notifierHelper.listenObject(guard.getMaxint());
@@ -638,7 +637,7 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
}
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
WrappingLabel label = getInteractionConstraintLabel();
manager = new TextDirectEditManager(this, WrapTextCellEditor.class, new TextCellEditorLocator(label));
}
@@ -647,15 +646,15 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
@Override
protected void performDirectEditRequest(Request request) {
- if(request instanceof DirectEditRequest) {
- //Show or Hide Guard: https://bugs.eclipse.org/bugs/show_bug.cgi?id=402966
- if(!isGuardVisible()) {
+ if (request instanceof DirectEditRequest) {
+ // Show or Hide Guard: https://bugs.eclipse.org/bugs/show_bug.cgi?id=402966
+ if (!isGuardVisible()) {
return;
}
WrappingLabel label = getPrimaryShape().getInteractionConstraintLabel();
- Point location = ((DirectEditRequest)request).getLocation().getCopy();
- label.translateToRelative(location); // convert request location to relative
- if(label.containsPoint(location)) {
+ Point location = ((DirectEditRequest) request).getLocation().getCopy();
+ label.translateToRelative(location); // convert request location to relative
+ if (label.containsPoint(location)) {
getManager().show();
}
}
@@ -665,49 +664,57 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
return resolveSemanticElement();
}
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = new GuardConditionParser();
}
return parser;
}
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
}
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
}
+ @Override
public void setLabelText(String text) {
WrappingLabel label = this.getPrimaryShape().getInteractionConstraintLabel();
label.setText(text);
}
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
- if(element != null && parser != null) {
+ if (element != null && parser != null) {
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -721,11 +728,11 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
}
public boolean ignoreRequest(Request request) {
- if(request instanceof ChangeBoundsRequest && (request.getType().equals(org.eclipse.gef.RequestConstants.REQ_ADD) || request.getType().equals(RequestConstants.REQ_DROP))) {
- List parts = ((ChangeBoundsRequest)request).getEditParts();
- if(parts != null) {
- for(Object obj : parts) {
- if(obj instanceof CommentEditPart || obj instanceof ConstraintEditPart || obj instanceof TimeObservationEditPart) {
+ if (request instanceof ChangeBoundsRequest && (request.getType().equals(org.eclipse.gef.RequestConstants.REQ_ADD) || request.getType().equals(RequestConstants.REQ_DROP))) {
+ List parts = ((ChangeBoundsRequest) request).getEditParts();
+ if (parts != null) {
+ for (Object obj : parts) {
+ if (obj instanceof CommentEditPart || obj instanceof ConstraintEditPart || obj instanceof TimeObservationEditPart) {
return true;
}
}
@@ -736,7 +743,7 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
@Override
public void showTargetFeedback(Request request) {
- if(ignoreRequest(request)) {
+ if (ignoreRequest(request)) {
return;
}
super.showTargetFeedback(request);
@@ -744,13 +751,13 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
@Override
public Command getCommand(Request request) {
- if(ignoreRequest(request)) {
+ if (ignoreRequest(request)) {
return null;
}
- if(request instanceof ReconnectRequest) {
- if(REQ_RECONNECT_SOURCE.equals(request.getType()) && ((ReconnectRequest)request).getConnectionEditPart().getSource() instanceof GateEditPart) {
+ if (request instanceof ReconnectRequest) {
+ if (REQ_RECONNECT_SOURCE.equals(request.getType()) && ((ReconnectRequest) request).getConnectionEditPart().getSource() instanceof GateEditPart) {
return getParent().getParent().getCommand(request);
- } else if(REQ_RECONNECT_TARGET.equals(request.getType()) && ((ReconnectRequest)request).getConnectionEditPart().getTarget() instanceof GateEditPart) {
+ } else if (REQ_RECONNECT_TARGET.equals(request.getType()) && ((ReconnectRequest) request).getConnectionEditPart().getTarget() instanceof GateEditPart) {
return getParent().getParent().getCommand(request);
}
}
@@ -759,15 +766,15 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
@Override
protected void refreshTransparency() {
- FillStyle style = (FillStyle)getPrimaryView().getStyle(NotationPackage.Literals.FILL_STYLE);
- if(style != null) {
+ FillStyle style = (FillStyle) getPrimaryView().getStyle(NotationPackage.Literals.FILL_STYLE);
+ if (style != null) {
setTransparency(style.getTransparency());
}
}
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionOperandEditPart#createNodeShape()
- *
+ *
* @return
*/
@Override
@@ -777,12 +784,12 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionOperandEditPart#getPrimaryShape()
- *
+ *
* @return
*/
@Override
public CustomCustomInteractionOperandFigure getPrimaryShape() {
- return (CustomCustomInteractionOperandFigure)primaryShape;
+ return (CustomCustomInteractionOperandFigure) primaryShape;
}
/**
@@ -790,7 +797,7 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
*/
public void updateConstraintLabel() {
IGraphicalEditPart child = getChildBySemanticHint(InteractionOperandGuardEditPart.GUARD_TYPE);
- if(child instanceof InteractionOperandGuardEditPart) {
+ if (child instanceof InteractionOperandGuardEditPart) {
child.refresh();
}
}
@@ -799,19 +806,19 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
/**
* Constructor.
- *
+ *
*/
public CustomCustomInteractionOperandFigure() {
super();
this.setLineWidth(2);
setLineSeparator(!firstOperand);
- //Make the label as a child now, see InteractionOperandGuardEditPart.
+ // Make the label as a child now, see InteractionOperandGuardEditPart.
getInteractionConstraintLabel().setVisible(false);
}
/**
* @see org.eclipse.draw2d.Figure#useLocalCoordinates()
- *
+ *
* @return
*/
@Override
@@ -819,6 +826,7 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
return true;
}
+ @Override
protected void paintBackground(Graphics graphics, Rectangle rectangle) {
graphics.pushState();
super.paintBackground(graphics, rectangle);
@@ -827,18 +835,18 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
/**
* Update the interaction constraint value
- *
+ *
* @param interactionOperand
- * The UML Interaction Operand
+ * The UML Interaction Operand
*/
protected void updateConstraintLabel() {
- //Show or Hide Guard: https://bugs.eclipse.org/bugs/show_bug.cgi?id=402966
- if(!isGuardVisible()) {
+ // Show or Hide Guard: https://bugs.eclipse.org/bugs/show_bug.cgi?id=402966
+ if (!isGuardVisible()) {
getInteractionConstraintLabel().setText("");
} else {
String text = "";
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
getInteractionConstraintLabel().setText(text);
@@ -850,33 +858,34 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
@Override
protected Command getDirectEditCommand(DirectEditRequest edit) {
- String labelText = (String)edit.getCellEditor().getValue();
- //for CellEditor, null is always returned for invalid values
- if(labelText == null) {
+ String labelText = (String) edit.getCellEditor().getValue();
+ // for CellEditor, null is always returned for invalid values
+ if (labelText == null) {
return null;
}
- ITextAwareEditPart compartment = (ITextAwareEditPart)getHost();
- EObject model = (EObject)compartment.getModel();
+ ITextAwareEditPart compartment = (ITextAwareEditPart) getHost();
+ EObject model = (EObject) compartment.getModel();
EObjectAdapter elementAdapter = null;
- if(model instanceof View) {
- View view = (View)model;
+ if (model instanceof View) {
+ View view = (View) model;
elementAdapter = new EObjectAdapterEx(ViewUtil.resolveSemanticElement(view), view);
- } else
+ } else {
elementAdapter = new EObjectAdapterEx(model, null);
+ }
String prevText = compartment.getParser().getEditString(elementAdapter, compartment.getParserOptions().intValue());
// check to make sure an edit has occurred before returning a command.
- if(!prevText.equals(labelText)) {
+ if (!prevText.equals(labelText)) {
ICommand iCommand = compartment.getParser().getParseCommand(elementAdapter, labelText, 0);
return new ICommandProxy(iCommand);
}
- // refresh label again
+ // refresh label again
getPrimaryShape().updateConstraintLabel();
return null;
}
@Override
protected void showCurrentEditValue(DirectEditRequest request) {
- String value = (String)request.getCellEditor().getValue();
+ String value = (String) request.getCellEditor().getValue();
WrappingLabel label = getPrimaryShape().getInteractionConstraintLabel();
label.setText(value);
}
@@ -899,33 +908,36 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- CombinedFragment enclosingCF = (CombinedFragment)interactionOperand.getOwner();
+ CombinedFragment enclosingCF = (CombinedFragment) interactionOperand.getOwner();
InteractionOperatorKind cfOperator = enclosingCF.getInteractionOperator();
- if(InteractionOperatorKind.LOOP_LITERAL.equals(cfOperator)) {
- if(text.contains("]") && text.contains("[")) {
+ if (InteractionOperatorKind.LOOP_LITERAL.equals(cfOperator)) {
+ if (text.contains("]") && text.contains("[")) {
String[] parts = text.split("]");
String[] nums = parts[0].replaceAll("\\[", "").split(",");
int min = 0, max = -1;
min = parseInt(nums[0], 0);
max = nums.length > 1 ? parseInt(nums[1], -1) : min;
- if(guard.getMinint() != null)
+ if (guard.getMinint() != null) {
setIntValue(guard.getMinint(), min);
- else
+ } else {
guard.setMinint(createLiteralInteger(min));
- if(guard.getMaxint() != null)
+ }
+ if (guard.getMaxint() != null) {
setIntValue(guard.getMaxint(), max);
- else
+ } else {
guard.setMaxint(createLiteralInteger(max));
- if(parts.length > 1)
+ }
+ if (parts.length > 1) {
text = parts[1] == null ? "" : parts[1].trim();
- else
+ } else {
text = "";
+ }
} else {
guard.setMinint(null);
guard.setMaxint(null);
}
}
- if(guard.getSpecification() != null || text.length() > 0) {
+ if (guard.getSpecification() != null || text.length() > 0) {
LiteralString literalString = UMLFactory.eINSTANCE.createLiteralString();
literalString.setValue(text);
guard.setSpecification(literalString);
@@ -940,8 +952,8 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
}
private void setIntValue(ValueSpecification spec, int val) {
- if(spec instanceof LiteralInteger) {
- ((LiteralInteger)spec).setValue(val);
+ if (spec instanceof LiteralInteger) {
+ ((LiteralInteger) spec).setValue(val);
}
}
@@ -957,33 +969,37 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
private static class GuardConditionParser extends MessageFormatParser implements ISemanticParser {
public GuardConditionParser() {
- super(new EAttribute[]{ UMLPackage.eINSTANCE.getLiteralInteger_Value(), UMLPackage.eINSTANCE.getLiteralString_Value() });
+ super(new EAttribute[] { UMLPackage.eINSTANCE.getLiteralInteger_Value(), UMLPackage.eINSTANCE.getLiteralString_Value() });
}
+ @Override
public List getSemanticElementsBeingParsed(EObject element) {
List<Element> semanticElementsBeingParsed = new ArrayList<Element>();
- if(element instanceof InteractionOperand) {
- InteractionOperand op = (InteractionOperand)element;
+ if (element instanceof InteractionOperand) {
+ InteractionOperand op = (InteractionOperand) element;
semanticElementsBeingParsed.add(op);
semanticElementsBeingParsed.add(op.getGuard());
}
return semanticElementsBeingParsed;
}
+ @Override
public boolean areSemanticElementsAffected(EObject listener, Object notification) {
EStructuralFeature feature = getEStructuralFeature(notification);
return isValidFeature(feature);
}
+ @Override
public boolean isAffectingEvent(Object event, int flags) {
EStructuralFeature feature = getEStructuralFeature(event);
return isValidFeature(feature);
}
+ @Override
public String getPrintString(IAdaptable element, int flags) {
Object adapter = element.getAdapter(EObject.class);
- if(adapter instanceof InteractionOperand) {
- InteractionOperand interactionOperand = (InteractionOperand)adapter;
+ if (adapter instanceof InteractionOperand) {
+ InteractionOperand interactionOperand = (InteractionOperand) adapter;
return getGuardLabelText(interactionOperand, false);
}
return "";
@@ -996,12 +1012,12 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
@Override
public ICommand getParseCommand(IAdaptable adapter, String newString, int flags) {
- EObject element = (EObject)adapter.getAdapter(EObject.class);
+ EObject element = (EObject) adapter.getAdapter(EObject.class);
TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(element);
- if(editingDomain == null || !(element instanceof InteractionOperand)) {
+ if (editingDomain == null || !(element instanceof InteractionOperand)) {
return UnexecutableCommand.INSTANCE;
}
- InteractionOperand interactionOperand = (InteractionOperand)element;
+ InteractionOperand interactionOperand = (InteractionOperand) element;
InteractionConstraint guard = interactionOperand.getGuard();
CompositeTransactionalCommand command = new CompositeTransactionalCommand(editingDomain, "Set Values"); //$NON-NLS-1$
command.compose(new UpdateGuardConditionCommand(editingDomain, interactionOperand, guard, newString));
@@ -1011,8 +1027,8 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
@Override
public String getEditString(IAdaptable element, int flags) {
Object adapter = element.getAdapter(EObject.class);
- if(adapter instanceof InteractionOperand) {
- InteractionOperand interactionOperand = (InteractionOperand)adapter;
+ if (adapter instanceof InteractionOperand) {
+ InteractionOperand interactionOperand = (InteractionOperand) adapter;
return getGuardLabelText(interactionOperand, true);
}
return "";
@@ -1020,10 +1036,10 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
protected EStructuralFeature getEStructuralFeature(Object notification) {
EStructuralFeature featureImpl = null;
- if(notification instanceof Notification) {
- Object feature = ((Notification)notification).getFeature();
- if(feature instanceof EStructuralFeature) {
- featureImpl = (EStructuralFeature)feature;
+ if (notification instanceof Notification) {
+ Object feature = ((Notification) notification).getFeature();
+ if (feature instanceof EStructuralFeature) {
+ featureImpl = (EStructuralFeature) feature;
}
}
return featureImpl;
@@ -1040,22 +1056,24 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
/**
* constructor
- *
+ *
* @param element
- * element to be wrapped
+ * element to be wrapped
* @param view
- * view to be wrapped
+ * view to be wrapped
*/
public EObjectAdapterEx(EObject element, View view) {
super(element);
this.view = view;
}
+ @Override
public Object getAdapter(Class adapter) {
Object o = super.getAdapter(adapter);
- if(o != null)
+ if (o != null) {
return o;
- if(adapter.equals(View.class)) {
+ }
+ if (adapter.equals(View.class)) {
return view;
}
return null;
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 2e4b6788d40..b7ec48b73ea 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -59,7 +59,7 @@ import org.eclipse.uml2.uml.UMLPackage;
/**
* Add implementing IPapyrusEditPart to displaying Stereotypes.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class CustomInteractionUseEditPart extends InteractionUseEditPart implements IPapyrusEditPart {
@@ -91,7 +91,7 @@ public class CustomInteractionUseEditPart extends InteractionUseEditPart impleme
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomInteractionUseEditPart(View view) {
@@ -102,11 +102,11 @@ public class CustomInteractionUseEditPart extends InteractionUseEditPart impleme
* Try to use the notifier from super class, if not exist, create new one.
*/
protected NotificationHelper getNotifier() {
- if(notifier == null) {
+ if (notifier == null) {
try {
Field f = InteractionUseEditPart.class.getDeclaredField("notifier");
f.setAccessible(true);
- notifier = (NotificationHelper)f.get(this);
+ notifier = (NotificationHelper) f.get(this);
} catch (Exception e) {
notifier = new NotificationHelper(new UIAdapterImpl() {
@@ -122,12 +122,13 @@ public class CustomInteractionUseEditPart extends InteractionUseEditPart impleme
@Override
protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineWidth(width);
}
super.setLineWidth(width);
}
+ @Override
protected IFigure createNodeShape() {
primaryShape = new InteractionUseRectangleFigure();
getPrimaryShape().setShadow(false);
@@ -141,11 +142,11 @@ public class CustomInteractionUseEditPart extends InteractionUseEditPart impleme
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 SequenceGraphicalNodeEditPolicy());
+ // Fixed bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=389531
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new GatesHolderGraphicalNodeEditPolicy());
installEditPolicy("Gate Creation Edit Policy", new GateCreationEditPolicy());
- //install a editpolicy to display stereotypes
+ // install a editpolicy to display stereotypes
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
}
@@ -157,21 +158,22 @@ public class CustomInteractionUseEditPart extends InteractionUseEditPart impleme
return new BorderedNodeFigure(super.createNodeFigure());
}
+ @Override
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
}
public final BorderedNodeFigure getBorderedFigure() {
- return (BorderedNodeFigure)getFigure();
+ return (BorderedNodeFigure) getFigure();
}
@Override
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof GateEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((GateEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof GateEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((GateEditPart) childEditPart).getFigure());
return true;
}
return super.removeFixedChild(childEditPart);
@@ -179,21 +181,21 @@ public class CustomInteractionUseEditPart extends InteractionUseEditPart impleme
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionUseEditPart#addFixedChild(org.eclipse.gef.EditPart)
- *
+ *
* @param childEditPart
* @return
*/
@Override
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof GateEditPart) {
- getBorderedFigure().getBorderItemContainer().add(((GateEditPart)childEditPart).getFigure(), new GateLocator((GateEditPart)childEditPart, getFigure()));
+ if (childEditPart instanceof GateEditPart) {
+ getBorderedFigure().getBorderItemContainer().add(((GateEditPart) childEditPart).getFigure(), new GateLocator((GateEditPart) childEditPart, getFigure()));
return true;
}
return super.addFixedChild(childEditPart);
}
protected void refreshShadow() {
- getPrimaryShape().setShadow(AppearanceHelper.showShadow((View)getModel()));
+ getPrimaryShape().setShadow(AppearanceHelper.showShadow((View) getModel()));
}
/**
@@ -206,9 +208,9 @@ public class CustomInteractionUseEditPart extends InteractionUseEditPart impleme
/**
* sets the back ground color of this edit part
- *
+ *
* @param color
- * the new value of the back ground color
+ * the new value of the back ground color
*/
@Override
protected void setBackgroundColor(Color color) {
@@ -223,9 +225,10 @@ public class CustomInteractionUseEditPart extends InteractionUseEditPart impleme
@Override
protected void setGradient(GradientData gradient) {
IPapyrusNodeFigure fig = getPrimaryShape();
- FillStyle style = (FillStyle)getPrimaryView().getStyle(NotationPackage.Literals.FILL_STYLE);
- if(gradient != null) {
- fig.setIsUsingGradient(true);;
+ FillStyle style = (FillStyle) getPrimaryView().getStyle(NotationPackage.Literals.FILL_STYLE);
+ if (gradient != null) {
+ fig.setIsUsingGradient(true);
+ ;
fig.setGradientData(style.getFillColor(), gradient.getGradientColor1(), gradient.getGradientStyle());
} else {
fig.setIsUsingGradient(false);
@@ -244,97 +247,97 @@ public class CustomInteractionUseEditPart extends InteractionUseEditPart impleme
protected void handleNotificationEvent(Notification notification) {
final NotificationHelper notifier = getNotifier();
Object feature = notification.getFeature();
- if(UMLPackage.eINSTANCE.getInteractionUse_RefersTo().equals(feature)) {
- if(notification.getOldValue() instanceof Interaction) {
+ if (UMLPackage.eINSTANCE.getInteractionUse_RefersTo().equals(feature)) {
+ if (notification.getOldValue() instanceof Interaction) {
notifier.unlistenAll();
// notifier.unlistenObject((Interaction) notification.getOldValue());
}
- InteractionUse interactionUse = (InteractionUse)resolveSemanticElement();
+ InteractionUse interactionUse = (InteractionUse) resolveSemanticElement();
CommandHelper.executeCommandWithoutHistory(getEditingDomain(), RemoveCommand.create(getEditingDomain(), interactionUse, UMLPackage.eINSTANCE.getInteractionUse_ActualGate(), interactionUse.getActualGates()), true);
- if(notification.getNewValue() instanceof Interaction) {
- Interaction interaction = (Interaction)notification.getNewValue();
+ if (notification.getNewValue() instanceof Interaction) {
+ Interaction interaction = (Interaction) notification.getNewValue();
notifier.listenObject(interaction);
interactionUse.getActualGates();
List<Gate> formalGates = interaction.getFormalGates();
- for(Gate formalGate : formalGates) {
- Gate newActualGate = (Gate)EcoreUtil.create(UMLPackage.Literals.GATE);
+ for (Gate formalGate : formalGates) {
+ Gate newActualGate = (Gate) EcoreUtil.create(UMLPackage.Literals.GATE);
newActualGate.setName(formalGate.getName());
CommandHelper.executeCommandWithoutHistory(getEditingDomain(), AddCommand.create(getEditingDomain(), resolveSemanticElement(), UMLPackage.eINSTANCE.getInteractionUse_ActualGate(), newActualGate), true);
notifier.listenObject(formalGate);
notifier.listenObject(newActualGate);
}
}
- } else if(UMLPackage.eINSTANCE.getInteractionFragment_Covered().equals(feature)) {
+ } else if (UMLPackage.eINSTANCE.getInteractionFragment_Covered().equals(feature)) {
activate();
resizeInteractionFragmentFigure();
- } else if(UMLPackage.eINSTANCE.getInteraction_FormalGate().equals(feature)) {
+ } else if (UMLPackage.eINSTANCE.getInteraction_FormalGate().equals(feature)) {
// Handle formal gate
- InteractionUse interactionUse = (InteractionUse)resolveSemanticElement();
+ InteractionUse interactionUse = (InteractionUse) resolveSemanticElement();
Object oldValue = notification.getOldValue();
- if(oldValue instanceof Gate) {
- notifier.unlistenObject((Gate)oldValue);
+ if (oldValue instanceof Gate) {
+ notifier.unlistenObject((Gate) oldValue);
List<Gate> actualGates = interactionUse.getActualGates();
- for(int i = actualGates.size() - 1; i >= 0; i--) {
+ for (int i = actualGates.size() - 1; i >= 0; i--) {
Gate element = actualGates.get(i);
- if(((Gate)oldValue).getName().equals(element.getName())) {
+ if (((Gate) oldValue).getName().equals(element.getName())) {
notifier.unlistenObject(element);
CommandHelper.executeCommandWithoutHistory(getEditingDomain(), RemoveCommand.create(getEditingDomain(), interactionUse, UMLPackage.eINSTANCE.getInteractionUse_ActualGate(), element), true);
}
}
}
Object newValue = notification.getNewValue();
- if(newValue instanceof Gate) {
- Gate actualGate = interactionUse.createActualGate(((Gate)newValue).getName());
- notifier.listenObject((Gate)newValue);
+ if (newValue instanceof Gate) {
+ Gate actualGate = interactionUse.createActualGate(((Gate) newValue).getName());
+ notifier.listenObject((Gate) newValue);
notifier.listenObject(actualGate);
}
- } else if(UMLPackage.eINSTANCE.getInteractionUse_ActualGate().equals(feature)) {
- if(notification.getEventType() == Notification.ADD) {
+ } else if (UMLPackage.eINSTANCE.getInteractionUse_ActualGate().equals(feature)) {
+ if (notification.getEventType() == Notification.ADD) {
// Block manual creation of actual gate
- // if(notification.getNewValue() instanceof Gate) {
- // Gate newActualGate = (Gate)notification.getNewValue();
- // if(!checkActualGateExistence(newActualGate)) {
- // MessageDialog.openError(Display.getCurrent().getActiveShell(), NO_ACTUAL_GATE_MANUAL_CREATION_DLG_TITLE, NO_ACTUAL_GATE_MANUAL_CREATION_DLG_MSG);
- // CommandHelper.executeCommandWithoutHistory(getEditingDomain(), RemoveCommand.create(getEditingDomain(), resolveSemanticElement(), UMLPackage.eINSTANCE.getInteractionUse_ActualGate(), newActualGate), true);
- // }
- // }
- } else if(notification.getEventType() == Notification.REMOVE) {
+ // if(notification.getNewValue() instanceof Gate) {
+ // Gate newActualGate = (Gate)notification.getNewValue();
+ // if(!checkActualGateExistence(newActualGate)) {
+ // MessageDialog.openError(Display.getCurrent().getActiveShell(), NO_ACTUAL_GATE_MANUAL_CREATION_DLG_TITLE, NO_ACTUAL_GATE_MANUAL_CREATION_DLG_MSG);
+ // CommandHelper.executeCommandWithoutHistory(getEditingDomain(), RemoveCommand.create(getEditingDomain(), resolveSemanticElement(), UMLPackage.eINSTANCE.getInteractionUse_ActualGate(), newActualGate), true);
+ // }
+ // }
+ } else if (notification.getEventType() == Notification.REMOVE) {
// Block manual deletion of actual gate
- // if(notification.getOldValue() instanceof Gate) {
- // Gate oldActualGate = (Gate)notification.getOldValue();
- // //There are some issues in redo progress, check if there is other one with same time firstly.
- // InteractionUse interactionUse = (InteractionUse)notification.getNotifier();
- // Gate otherOne = interactionUse.getActualGate(oldActualGate.getName());
- // if(otherOne == null && checkActualGateExistence(oldActualGate)) {
- // MessageDialog.openError(Display.getCurrent().getActiveShell(), NO_ACTUAL_GATE_MANUAL_DELETION_DLG_TITLE, NO_ACTUAL_GATE_MANUAL_DELETION_DLG_MSG);
- // CommandHelper.executeCommandWithoutHistory(getEditingDomain(), AddCommand.create(getEditingDomain(), resolveSemanticElement(), UMLPackage.eINSTANCE.getInteractionUse_ActualGate(), oldActualGate), true);
- // }
- // }
+ // if(notification.getOldValue() instanceof Gate) {
+ // Gate oldActualGate = (Gate)notification.getOldValue();
+ // //There are some issues in redo progress, check if there is other one with same time firstly.
+ // InteractionUse interactionUse = (InteractionUse)notification.getNotifier();
+ // Gate otherOne = interactionUse.getActualGate(oldActualGate.getName());
+ // if(otherOne == null && checkActualGateExistence(oldActualGate)) {
+ // MessageDialog.openError(Display.getCurrent().getActiveShell(), NO_ACTUAL_GATE_MANUAL_DELETION_DLG_TITLE, NO_ACTUAL_GATE_MANUAL_DELETION_DLG_MSG);
+ // CommandHelper.executeCommandWithoutHistory(getEditingDomain(), AddCommand.create(getEditingDomain(), resolveSemanticElement(), UMLPackage.eINSTANCE.getInteractionUse_ActualGate(), oldActualGate), true);
+ // }
+ // }
}
- } else if(UMLPackage.eINSTANCE.getNamedElement_Name().equals(feature) && notification.getNotifier() instanceof Gate) {
- Gate gate = (Gate)notification.getNotifier();
- if(gate.eContainer() instanceof Interaction) {
+ } else if (UMLPackage.eINSTANCE.getNamedElement_Name().equals(feature) && notification.getNotifier() instanceof Gate) {
+ Gate gate = (Gate) notification.getNotifier();
+ if (gate.eContainer() instanceof Interaction) {
// Handle modification of formal gate's name
- InteractionUse interactionUse = (InteractionUse)resolveSemanticElement();
+ InteractionUse interactionUse = (InteractionUse) resolveSemanticElement();
List<Gate> actualGates = interactionUse.getActualGates();
String oldValue = notification.getOldStringValue();
String newValue = notification.getNewStringValue();
- for(Gate actualGate : actualGates) {
- if(oldValue == null && actualGate.getName() == null || oldValue != null && oldValue.equals(actualGate.getName())) {
+ for (Gate actualGate : actualGates) {
+ if (oldValue == null && actualGate.getName() == null || oldValue != null && oldValue.equals(actualGate.getName())) {
notifier.unlistenObject(actualGate); // Delete listener on gate
actualGate.setName(newValue);
notifier.listenObject(actualGate); // Add listener on gate
}
}
- } else if(gate.eContainer() instanceof InteractionUse) {
+ } else if (gate.eContainer() instanceof InteractionUse) {
// Block modification of actual gate's name
notifier.unlistenObject(gate); // Delete listener on gate
gate.setName(notification.getOldStringValue());
notifier.listenObject(gate); // Add listener on gate
}
}
- if((getModel() != null) && (getModel() == notification.getNotifier())) {
- if(NotationPackage.eINSTANCE.getLineStyle_LineWidth().equals(feature)) {
+ if ((getModel() != null) && (getModel() == notification.getNotifier())) {
+ if (NotationPackage.eINSTANCE.getLineStyle_LineWidth().equals(feature)) {
refreshLineWidth();
}
}
@@ -344,16 +347,16 @@ public class CustomInteractionUseEditPart extends InteractionUseEditPart impleme
/**
* Check if actual gate is attached to a formal gate
- *
+ *
* @return true if there is a formal gate corresponding to the actual gate
*/
private boolean checkActualGateExistence(Gate actualGate) {
- InteractionUse interactionUse = (InteractionUse)resolveSemanticElement();
+ InteractionUse interactionUse = (InteractionUse) resolveSemanticElement();
Interaction interaction = interactionUse.getRefersTo();
- if(interaction != null) {
+ if (interaction != null) {
// Find if the corresponding formal gate exists
- for(Gate formalGate : interaction.getFormalGates()) {
- if(formalGate.getName().equals(actualGate.getName())) {
+ for (Gate formalGate : interaction.getFormalGates()) {
+ if (formalGate.getName().equals(actualGate.getName())) {
return true;
}
}
@@ -368,17 +371,17 @@ public class CustomInteractionUseEditPart extends InteractionUseEditPart impleme
public void activate() {
super.activate();
final NotificationHelper notifier = getNotifier();
- if(resolveSemanticElement() instanceof InteractionUse) {
- InteractionUse interactionUse = (InteractionUse)resolveSemanticElement();
+ if (resolveSemanticElement() instanceof InteractionUse) {
+ InteractionUse interactionUse = (InteractionUse) resolveSemanticElement();
Interaction interaction = interactionUse.getRefersTo();
- if(interaction != null) {
+ if (interaction != null) {
// activate the listener on the referred interaction
notifier.listenObject(interaction);
- for(Gate formalGate : interaction.getFormalGates()) {
+ for (Gate formalGate : interaction.getFormalGates()) {
notifier.listenObject(formalGate);
}
}
- for(Gate actualGate : interactionUse.getActualGates()) {
+ for (Gate actualGate : interactionUse.getActualGates()) {
notifier.listenObject(actualGate);
}
}
@@ -391,7 +394,7 @@ public class CustomInteractionUseEditPart extends InteractionUseEditPart impleme
@Override
public void deactivate() {
super.deactivate();
- if(notifier != null) {
+ if (notifier != null) {
notifier.unlistenAll();
}
}
@@ -401,7 +404,7 @@ public class CustomInteractionUseEditPart extends InteractionUseEditPart impleme
*/
@Override
public void removeNotify() {
- if(notifier != null) {
+ if (notifier != null) {
notifier.unlistenAll();
}
super.removeNotify();
@@ -409,15 +412,15 @@ public class CustomInteractionUseEditPart extends InteractionUseEditPart impleme
@Override
public void performRequest(Request request) {
- if(request.getType().equals(REQ_OPEN)) {
- InteractionUse interactionUse = (InteractionUse)resolveSemanticElement();
+ if (request.getType().equals(REQ_OPEN)) {
+ InteractionUse interactionUse = (InteractionUse) resolveSemanticElement();
Interaction interaction = interactionUse.getRefersTo();
- if(interaction == null) {
+ if (interaction == null) {
MessageDialog.openWarning(Display.getCurrent().getActiveShell(), "Warning", "There is no referenced interaction!");
return;
}
Diagram diagram = InteractionUseUtil.findDiagram(getNotationView(), interaction);
- if(diagram == null) {
+ if (diagram == null) {
MessageDialog.openWarning(Display.getCurrent().getActiveShell(), "Warning", "Cannot find diagram of the referenced interaction!");
} else {
InteractionUseUtil.openDiagram(diagram);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionUseName2EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionUseName2EditPart.java
index 28f5c00661c..1adad837633 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionUseName2EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionUseName2EditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -23,7 +23,7 @@ public class CustomInteractionUseName2EditPart extends InteractionUseName2EditPa
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomInteractionUseName2EditPart(View view) {
@@ -32,7 +32,7 @@ public class CustomInteractionUseName2EditPart extends InteractionUseName2EditPa
@Override
public void performRequest(Request request) {
- if(request.getType().equals(REQ_OPEN)) {
+ if (request.getType().equals(REQ_OPEN)) {
getParent().performRequest(request);
return;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionUseNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionUseNameEditPart.java
index 717e0c15746..2eaa9d67828 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionUseNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionUseNameEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -24,13 +24,14 @@ public class CustomInteractionUseNameEditPart extends InteractionUseNameEditPart
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomInteractionUseNameEditPart(View view) {
super(view);
}
+ @Override
protected Image getLabelIcon() {
return ElementIconUtil.getLabelIcon(this);
}
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/CustomLifelineEditPart.java
index 83c30388b71..b5642a73a4e 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/CustomLifelineEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -134,7 +134,7 @@ public class CustomLifelineEditPart extends LifelineEditPart {
/**
* Constructor.
- *
+ *
*/
public CustomLifelineFigure() {
}
@@ -144,23 +144,25 @@ public class CustomLifelineEditPart extends LifelineEditPart {
return CustomLifelineEditPart.this.getMapMode();
}
+ @Override
public boolean containsPoint(int x, int y) {
boolean contains = super.containsPoint(x, y);
- if(!contains) {
+ if (!contains) {
return false;
}
- //Fixed bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=395462
- //If is inline mode, just return true, otherwise the child lifeline cannot be moved.
- if(isInlineMode()) {
- //return true;
+ // Fixed bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=395462
+ // If is inline mode, just return true, otherwise the child lifeline cannot be moved.
+ if (isInlineMode()) {
+ // return true;
}
- if(fFigureLifelineNameContainerFigure != null && fFigureLifelineNameContainerFigure.containsPoint(x, y)) {
+ if (fFigureLifelineNameContainerFigure != null && fFigureLifelineNameContainerFigure.containsPoint(x, y)) {
return true;
- } else if(!isInlineMode() && fFigureLifelineDotLineFigure != null) {
+ } else if (!isInlineMode() && fFigureLifelineDotLineFigure != null) {
Rectangle bounds = fFigureLifelineDotLineFigure.getDashLineRectangle().getBounds().getCopy();
bounds.expand(4, 0);
- if(bounds.contains(x, y))
+ if (bounds.contains(x, y)) {
return true;
+ }
}
return containsChildFigure(this, x, y);
}
@@ -168,53 +170,54 @@ public class CustomLifelineEditPart extends LifelineEditPart {
@Override
public IFigure findFigureAt(int x, int y, TreeSearch search) {
IFigure figure = super.findFigureAt(x, y, search);
- if(figure == null) {
+ if (figure == null) {
return null;
}
// 1. First check if the location is enter the Title.
- if(fFigureLifelineNameContainerFigure != null && fFigureLifelineNameContainerFigure.containsPoint(x, y)) {
+ if (fFigureLifelineNameContainerFigure != null && fFigureLifelineNameContainerFigure.containsPoint(x, y)) {
// Return label figure for supporting direct edit.
- EditPart editPart = (EditPart)getViewer().getVisualPartMap().get(figure);
- while(editPart == null) {
+ EditPart editPart = (EditPart) getViewer().getVisualPartMap().get(figure);
+ while (editPart == null) {
figure = figure.getParent();
- if(figure == null) {
+ if (figure == null) {
break;
}
- editPart = (EditPart)getViewer().getVisualPartMap().get(figure);
+ editPart = (EditPart) getViewer().getVisualPartMap().get(figure);
}
return figure == null ? this : figure;
}
- //2. Check children, maybe contain the Label figure, but we process it before.
+ // 2. Check children, maybe contain the Label figure, but we process it before.
IFigure child = findChildFigure(this, x, y);
- if(child != null) {
+ if (child != null) {
return child;
}
- //3. Finally check the line.
- if(!isInlineMode() && fFigureLifelineDotLineFigure != null) {
+ // 3. Finally check the line.
+ if (!isInlineMode() && fFigureLifelineDotLineFigure != null) {
Rectangle bounds = fFigureLifelineDotLineFigure.getDashLineRectangle().getBounds().getCopy();
bounds.expand(4, 0);
- if(bounds.contains(x, y))
+ if (bounds.contains(x, y)) {
return this;
+ }
}
return null;
}
@Override
public Dimension getMinimumSize(int wHint, int hHint) {
- if(minSize != null && minSize.height < 0) {
- //Make sure Lifeline can be expanded vertically by itself.
+ if (minSize != null && minSize.height < 0) {
+ // Make sure Lifeline can be expanded vertically by itself.
int height = minSize.height;
- //Introduce a minimum width for PartDecomposition.
+ // Introduce a minimum width for PartDecomposition.
int width = minSize.width;
- if(getLayoutManager() != null) {
+ if (getLayoutManager() != null) {
Dimension d = getLayoutManager().getMinimumSize(this, wHint, hHint);
- if(d != null) {
+ if (d != null) {
height = Math.max(height, d.height);
width = Math.max(width, d.width);
}
} else {
Dimension d = getPreferredSize(wHint, hHint);
- if(d != null) {
+ if (d != null) {
height = Math.max(height, d.height);
width = Math.max(width, d.height);
}
@@ -240,29 +243,30 @@ public class CustomLifelineEditPart extends LifelineEditPart {
String res = super.getNewIdStr(anchor);
String id = anchor.getId();
int start = id.indexOf('{');
- if(start > 0)
+ if (start > 0) {
res = res + id.substring(start);
+ }
return res;
}
}
/**
* Return the inner ConnectableElements of the lifeline
- *
+ *
* @param lifeline
- * The lifeline
+ * The lifeline
* @return inner ConnectableElements
*/
// TODO Extract in a helper
public static List<Property> getProperties(Lifeline lifeline) {
- if(lifeline != null) {
+ if (lifeline != null) {
ConnectableElement represents = lifeline.getRepresents();
- if(represents != null) {
+ if (represents != null) {
Type type = represents.getType();
- if(type instanceof StructuredClassifier) {
- StructuredClassifier structuredClassifier = (StructuredClassifier)type;
- if(!structuredClassifier.getAllAttributes().isEmpty()) {
- return new ArrayList<Property>(((StructuredClassifier)type).getAllAttributes());
+ if (type instanceof StructuredClassifier) {
+ StructuredClassifier structuredClassifier = (StructuredClassifier) type;
+ if (!structuredClassifier.getAllAttributes().isEmpty()) {
+ return new ArrayList<Property>(((StructuredClassifier) type).getAllAttributes());
}
}
}
@@ -299,7 +303,7 @@ public class CustomLifelineEditPart extends LifelineEditPart {
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomLifelineEditPart(View view) {
@@ -311,7 +315,7 @@ public class CustomLifelineEditPart extends LifelineEditPart {
*/
@Override
public void activate() {
- //updateCrossEnd();
+ // updateCrossEnd();
super.activate();
}
@@ -320,31 +324,31 @@ public class CustomLifelineEditPart extends LifelineEditPart {
*/
@Override
protected boolean addFixedChild(EditPart childEditPart) {
- //Affixed locator for Lifelines to place element with a time bar
- if(childEditPart instanceof TimeConstraintEditPart) {
+ // Affixed locator for Lifelines to place element with a time bar
+ if (childEditPart instanceof TimeConstraintEditPart) {
// update the locator with edit part reference
TimeMarkElementPositionLocator locator = new TimeMarkElementPositionLocator(getMainFigure(), PositionConstants.NONE);
locator.setEditPart(childEditPart);
- getBorderedFigure().getBorderItemContainer().add(((TimeConstraintEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((TimeConstraintEditPart) childEditPart).getFigure(), locator);
return true;
}
- if(childEditPart instanceof TimeObservationEditPart) {
+ if (childEditPart instanceof TimeObservationEditPart) {
// update the locator with edit part reference
TimeMarkElementPositionLocator locator = new TimeMarkElementPositionLocator(getMainFigure(), PositionConstants.NONE);
locator.setEditPart(childEditPart);
- getBorderedFigure().getBorderItemContainer().add(((TimeObservationEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((TimeObservationEditPart) childEditPart).getFigure(), locator);
return true;
}
- if(childEditPart instanceof DurationConstraintEditPart) {
+ if (childEditPart instanceof DurationConstraintEditPart) {
// update the locator with edit part reference
TimeMarkElementPositionLocator locator = new TimeMarkElementPositionLocator(getMainFigure(), PositionConstants.NONE);
locator.setEditPart(childEditPart);
- getBorderedFigure().getBorderItemContainer().add(((DurationConstraintEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((DurationConstraintEditPart) childEditPart).getFigure(), locator);
return true;
}
- if(childEditPart instanceof StateInvariantEditPart) {
+ if (childEditPart instanceof StateInvariantEditPart) {
IBorderItemLocator locator = new StateInvariantLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((StateInvariantEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((StateInvariantEditPart) childEditPart).getFigure(), locator);
return true;
}
return super.addFixedChild(childEditPart);
@@ -352,22 +356,22 @@ public class CustomLifelineEditPart extends LifelineEditPart {
/**
* Configure the lifeline
- *
+ *
* @param inlineMode
- * True if the lifeline is in inline mode
+ * True if the lifeline is in inline mode
*/
private void configure(boolean inlineMode, boolean refresh) {
(getPrimaryShape().getFigureLifelineDotLineFigure()).configure(inlineMode, LifelineEditPartUtil.getInnerConnectableElementList(this).size());
- if(this.inlineMode != inlineMode) {
+ if (this.inlineMode != inlineMode) {
this.inlineMode = inlineMode;
- if(inlineMode) {
+ if (inlineMode) {
installEditPolicy(EditPolicy.LAYOUT_ROLE, inlineModeLayoutRole);
removeEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE);
} else {
installEditPolicy(EditPolicy.LAYOUT_ROLE, normalModeLayoutRole);
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, dragDropEditPolicy);
}
- if(refresh) {
+ if (refresh) {
refreshVisuals();
}
}
@@ -375,7 +379,7 @@ public class CustomLifelineEditPart extends LifelineEditPart {
/**
* Check if the IFigure contains point, only check visible figures.
- *
+ *
* @param parent
* @param x
* @param y
@@ -383,7 +387,7 @@ public class CustomLifelineEditPart extends LifelineEditPart {
*/
@SuppressWarnings("rawtypes")
private boolean containsChildFigure(IFigure parent, int x, int y) {
- if(parent == null) {
+ if (parent == null) {
return false;
}
Map visualPartMap = getViewer().getVisualPartMap();
@@ -391,22 +395,22 @@ public class CustomLifelineEditPart extends LifelineEditPart {
Point pt = new Point(x, y);
parent.translateFromParent(pt);
IFigure child;
- for(int i = figures.size(); i > 0;) {
+ for (int i = figures.size(); i > 0;) {
i--;
- child = (IFigure)figures.get(i);
- if(!child.isVisible()) {
+ child = (IFigure) figures.get(i);
+ if (!child.isVisible()) {
continue;
}
- if(containsChildFigure(child, pt.x, pt.y)) {
+ if (containsChildFigure(child, pt.x, pt.y)) {
return true;
}
- if(visualPartMap.containsKey(child)) {
+ if (visualPartMap.containsKey(child)) {
Object object = visualPartMap.get(child);
- if(object instanceof LifelineEditPart) {
- if(((LifelineEditPart)object).getPrimaryShape().containsPoint(pt)) {
+ if (object instanceof LifelineEditPart) {
+ if (((LifelineEditPart) object).getPrimaryShape().containsPoint(pt)) {
return true;
}
- } else if(child.containsPoint(pt)) {
+ } else if (child.containsPoint(pt)) {
return true;
}
}
@@ -421,7 +425,7 @@ public class CustomLifelineEditPart extends LifelineEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomLifelineItemSemanticEditPolicy());
- //Fixed bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=364608
+ // 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());
// custom label, fix bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=383722
@@ -429,12 +433,14 @@ public class CustomLifelineEditPart extends LifelineEditPart {
installEditPolicy(AbstractHeadImpactLayoutEditPolicy.HEAD_IMPACT_LAYOUT_POLICY, new LifelineHeadImpactLayoutEditPolicy());
}
+ @Override
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) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case StateInvariantEditPart.VISUAL_ID:
case TimeConstraintEditPart.VISUAL_ID:
case TimeObservationEditPart.VISUAL_ID:
@@ -443,39 +449,44 @@ public class CustomLifelineEditPart extends LifelineEditPart {
return new BorderItemResizableEditPolicy();
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
}
+ @Override
public Command getCommand(Request request) {
Command command = null;
- if(REQ_MOVE_CHILDREN.equals(request.getType()))
+ if (REQ_MOVE_CHILDREN.equals(request.getType())) {
command = getMoveChildrenCommand(request);
- if(REQ_RESIZE_CHILDREN.equals(request.getType()) && request instanceof ChangeBoundsRequest)
- command = getMoveResizeCommand((ChangeBoundsRequest)request);
- if(command != null)
+ }
+ if (REQ_RESIZE_CHILDREN.equals(request.getType()) && request instanceof ChangeBoundsRequest) {
+ command = getMoveResizeCommand((ChangeBoundsRequest) request);
+ }
+ if (command != null) {
return command;
+ }
return super.getCommand(request);
}
@Override
protected Command getOrphanChildrenCommand(Request request) {
- //Disable orphan children command.
- //Fixed bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=395462
+ // Disable orphan children command.
+ // Fixed bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=395462
return UnexecutableCommand.INSTANCE;
}
+ @Override
protected Command getCreateCommand(CreateRequest request) {
- //only allow Lifeline creation for PartDecomposition.
- if(request instanceof CreateViewRequest) {
- CreateViewRequest req = (CreateViewRequest)request;
+ // only allow Lifeline creation for PartDecomposition.
+ if (request instanceof CreateViewRequest) {
+ CreateViewRequest req = (CreateViewRequest) request;
Iterator iter = req.getViewDescriptors().iterator();
- while(iter.hasNext()) {
- CreateViewRequest.ViewDescriptor viewDescriptor = (CreateViewRequest.ViewDescriptor)iter.next();
+ while (iter.hasNext()) {
+ CreateViewRequest.ViewDescriptor viewDescriptor = (CreateViewRequest.ViewDescriptor) iter.next();
String semanticHint = viewDescriptor.getSemanticHint();
- if(!UMLVisualIDRegistry.getType(VISUAL_ID).equals(semanticHint)) {
+ if (!UMLVisualIDRegistry.getType(VISUAL_ID).equals(semanticHint)) {
return UnexecutableCommand.INSTANCE;
}
}
@@ -485,54 +496,55 @@ public class CustomLifelineEditPart extends LifelineEditPart {
@Override
protected Command getMoveChildrenCommand(Request request) {
- if(request instanceof ChangeBoundsRequest)
- return getMoveResizeCommand((ChangeBoundsRequest)request);
+ if (request instanceof ChangeBoundsRequest) {
+ return getMoveResizeCommand((ChangeBoundsRequest) request);
+ }
return null;
}
private Command getMoveResizeCommand(ChangeBoundsRequest request) {
List changeEditParts = request.getEditParts();
- if(changeEditParts != null && changeEditParts.size() > 0) {
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ if (changeEditParts != null && changeEditParts.size() > 0) {
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
CompositeTransactionalCommand composite = new CompositeTransactionalCommand(editingDomain, null);
- LifelineEditPart parent = (LifelineEditPart)this.getHost();
- LifelineDotLineCustomFigure parentFig = (LifelineDotLineCustomFigure)parent.getContentPane();
+ LifelineEditPart parent = (LifelineEditPart) this.getHost();
+ LifelineDotLineCustomFigure parentFig = (LifelineDotLineCustomFigure) parent.getContentPane();
Rectangle parentBounds = parentFig.getBounds();
- for(Object o : changeEditParts) {
- if(o instanceof LifelineEditPart) {
- LifelineEditPart child = (LifelineEditPart)o;
+ for (Object o : changeEditParts) {
+ if (o instanceof LifelineEditPart) {
+ LifelineEditPart child = (LifelineEditPart) o;
IFigure childFig = child.getFigure();
Rectangle newBounds = childFig.getBounds().getCopy();
- Rectangle childConstraint = (Rectangle)parentFig.getLayoutManager().getConstraint(childFig);
+ Rectangle childConstraint = (Rectangle) parentFig.getLayoutManager().getConstraint(childFig);
newBounds.setLocation(childConstraint.getLocation().getCopy());
newBounds.translate(request.getMoveDelta());
- if(!request.getType().equals(RequestConstants.REQ_MOVE_CHILDREN)) {
+ if (!request.getType().equals(org.eclipse.gef.RequestConstants.REQ_MOVE_CHILDREN)) {
newBounds.resize(request.getSizeDelta());
}
// do not excceed parent
- if(newBounds.x < 0) {
+ if (newBounds.x < 0) {
newBounds.width += newBounds.x;
newBounds.x = 0;
}
- if(newBounds.x + newBounds.width > parentBounds.width) {
+ if (newBounds.x + newBounds.width > parentBounds.width) {
newBounds.width = parentBounds.width - newBounds.x;
}
- ICommand boundsCommand = new SetBoundsCommand(editingDomain, DiagramUIMessages.SetLocationCommand_Label_Resize, new EObjectAdapter((View)child.getModel()), newBounds);
+ ICommand boundsCommand = new SetBoundsCommand(editingDomain, DiagramUIMessages.SetLocationCommand_Label_Resize, new EObjectAdapter((View) child.getModel()), newBounds);
composite.add(boundsCommand);
- composite.add(LifelineResizeHelper.createManualLabelSizeCommand((LifelineEditPart)child));
- //Move ExecutionSpecifications
- //Fixed bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=395462
- if(!request.getType().equals(REQ_MOVE_CHILDREN)) {
+ composite.add(LifelineResizeHelper.createManualLabelSizeCommand(child));
+ // Move ExecutionSpecifications
+ // Fixed bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=395462
+ if (!request.getType().equals(REQ_MOVE_CHILDREN)) {
CompoundCommand resizeChildrenCommand = new CompoundCommand();
InteractionCompartmentXYLayoutEditPolicy.addLifelineResizeChildrenCommand(resizeChildrenCommand, request, child, 1);
- //If no child, just ignore it. Fixed bug about Resizing child lifeline:
+ // If no child, just ignore it. Fixed bug about Resizing child lifeline:
Command cmd = resizeChildrenCommand.isEmpty() ? null : resizeChildrenCommand.unwrap();
- if(cmd != null) {
+ if (cmd != null) {
composite.add(new CommandProxy(cmd));
}
- if(request.getSizeDelta().height != 0) {
- //Update message anchors.
- composite.add(new PreserveAnchorsPositionCommandEx(child, request.getSizeDelta(), PreserveAnchorsPositionCommandEx.PRESERVE_Y, child.getBorderedFigure(), request.getResizeDirection()));
+ if (request.getSizeDelta().height != 0) {
+ // Update message anchors.
+ composite.add(new PreserveAnchorsPositionCommandEx(child, request.getSizeDelta(), PreserveAnchorsPositionCommand.PRESERVE_Y, child.getBorderedFigure(), request.getResizeDirection()));
}
}
}
@@ -551,7 +563,7 @@ public class CustomLifelineEditPart extends LifelineEditPart {
@Override
public boolean containsPoint(int x, int y) {
- if(getBounds().contains(x, y)) {
+ if (getBounds().contains(x, y)) {
return true;
}
return super.containsPoint(x, y);
@@ -562,11 +574,11 @@ public class CustomLifelineEditPart extends LifelineEditPart {
*/
@Override
public IFigure findFigureAt(int x, int y, TreeSearch search) {
- if(search.prune(this)) {
+ if (search.prune(this)) {
return null;
}
IFigure mainFigure = getMainFigure().findFigureAt(x, y, search);
- if(mainFigure != null) {
+ if (mainFigure != null) {
return mainFigure;
}
return getBorderItemContainer().findFigureAt(x, y, search);
@@ -574,15 +586,15 @@ public class CustomLifelineEditPart extends LifelineEditPart {
@Override
public void setBackgroundColor(Color bg) {
- // if (getPrimaryShape() != null) {
- // NodeFigure dashLineRectangle = getPrimaryShape().getFigureLifelineDotLineFigure().getDashLineRectangle();
- // dashLineRectangle.setBackgroundColor(bg);
- // }
+ // if (getPrimaryShape() != null) {
+ // NodeFigure dashLineRectangle = getPrimaryShape().getFigureLifelineDotLineFigure().getDashLineRectangle();
+ // dashLineRectangle.setBackgroundColor(bg);
+ // }
}
@Override
public void setOpaque(boolean opaque) {
- if(getPrimaryShape() != null) {
+ if (getPrimaryShape() != null) {
NodeFigure dashLineRectangle = getPrimaryShape().getFigureLifelineDotLineFigure().getDashLineRectangle();
dashLineRectangle.setOpaque(opaque);
}
@@ -593,7 +605,7 @@ public class CustomLifelineEditPart extends LifelineEditPart {
/**
* Overrides to disable the defaultAnchorArea. The edge is now more stuck with the middle of the
* figure.
- *
+ *
* @Override
*/
@Override
@@ -602,7 +614,7 @@ public class CustomLifelineEditPart extends LifelineEditPart {
@Override
public boolean containsPoint(int x, int y) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
return primaryShape.containsPoint(x, y);
}
return super.containsPoint(x, y);
@@ -621,7 +633,7 @@ public class CustomLifelineEditPart extends LifelineEditPart {
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart#createNodeShape()
- *
+ *
* @return
*/
@Override
@@ -632,14 +644,14 @@ public class CustomLifelineEditPart extends LifelineEditPart {
protected ConnectionAnchor createSideAnchor(Request request, SlidableAnchor sa) {
Point loc = AnchorHelper.getRequestLocation(request);
PrecisionPoint pt = BaseSlidableAnchor.parseTerminalString(sa.getTerminal());
- if(loc == null || pt == null) {
+ if (loc == null || pt == null) {
return sa;
}
IFigure fig = this.getDashLineFigure();
Rectangle bounds = fig.getBounds().getCopy();
fig.translateToAbsolute(bounds);
boolean rightHand = true;
- if(loc.x < bounds.getCenter().x) {
+ if (loc.x < bounds.getCenter().x) {
rightHand = false;
}
return new AnchorHelper.SideAnchor(getNodeFigure(), pt, rightHand);
@@ -651,7 +663,7 @@ public class CustomLifelineEditPart extends LifelineEditPart {
*/
@Override
public void deactivate() {
- if(notifier != null) {
+ if (notifier != null) {
notifier.unlistenAll();
}
super.deactivate();
@@ -663,7 +675,7 @@ public class CustomLifelineEditPart extends LifelineEditPart {
*/
@SuppressWarnings("rawtypes")
private IFigure findChildFigure(IFigure parent, int x, int y) {
- if(parent == null) {
+ if (parent == null) {
return null;
}
Map visualPartMap = getViewer().getVisualPartMap();
@@ -671,23 +683,23 @@ public class CustomLifelineEditPart extends LifelineEditPart {
Point pt = new Point(x, y);
parent.translateFromParent(pt);
IFigure child;
- for(int i = figures.size(); i > 0;) {
+ for (int i = figures.size(); i > 0;) {
i--;
- child = (IFigure)figures.get(i);
- if(!child.isVisible()) {
+ child = (IFigure) figures.get(i);
+ if (!child.isVisible()) {
continue;
}
IFigure fig = findChildFigure(child, pt.x, pt.y);
- if(fig != null) {
+ if (fig != null) {
return fig;
}
- if(visualPartMap.containsKey(child)) {
+ if (visualPartMap.containsKey(child)) {
Object object = visualPartMap.get(child);
- if(object instanceof LifelineEditPart) {
- if(((LifelineEditPart)object).getPrimaryShape().containsPoint(pt)) {
+ if (object instanceof LifelineEditPart) {
+ if (((LifelineEditPart) object).getPrimaryShape().containsPoint(pt)) {
return child;
}
- } else if(child.containsPoint(pt)) {
+ } else if (child.containsPoint(pt)) {
return child;
}
}
@@ -697,17 +709,17 @@ public class CustomLifelineEditPart extends LifelineEditPart {
/**
* Get available properties
- *
+ *
* @return Only not already used properties
*/
public List<Property> getAvailableProperties() {
List<Property> properties = getProperties();
- if(properties != null) {
- for(EditPart editPart : (List<EditPart>)getChildren()) {
- if(editPart instanceof LifelineEditPart) {
- Lifeline lifeline = (Lifeline)((LifelineEditPart)editPart).resolveSemanticElement();
+ if (properties != null) {
+ for (EditPart editPart : (List<EditPart>) getChildren()) {
+ if (editPart instanceof LifelineEditPart) {
+ Lifeline lifeline = (Lifeline) ((LifelineEditPart) editPart).resolveSemanticElement();
ConnectableElement represents = lifeline.getRepresents();
- if(properties.contains(represents)) {
+ if (properties.contains(represents)) {
properties.remove(represents);
}
}
@@ -717,10 +729,10 @@ public class CustomLifelineEditPart extends LifelineEditPart {
}
private Bounds getBounds() {
- if(getModel() instanceof Node) {
- Node node = (Node)getModel();
- if(node.getLayoutConstraint() instanceof Bounds) {
- return (Bounds)node.getLayoutConstraint();
+ if (getModel() instanceof Node) {
+ Node node = (Node) getModel();
+ if (node.getLayoutConstraint() instanceof Bounds) {
+ return (Bounds) node.getLayoutConstraint();
}
}
return null;
@@ -729,37 +741,38 @@ public class CustomLifelineEditPart extends LifelineEditPart {
/**
* Handle message creation for execution specification
*/
+ @Override
public Command getCommand(Request request) {
- if(ignoreRequest(request)) {
+ if (ignoreRequest(request)) {
return null;
}
- if(request instanceof DropObjectsRequest) { // drop from model explorer
- DropObjectsRequest dropRequest = (DropObjectsRequest)request;
- if(dropRequest.getObjects().size() > 0) {
+ if (request instanceof DropObjectsRequest) { // drop from model explorer
+ DropObjectsRequest dropRequest = (DropObjectsRequest) request;
+ if (dropRequest.getObjects().size() > 0) {
Object obj = dropRequest.getObjects().get(0);
- if(obj instanceof Comment || obj instanceof Constraint || obj instanceof TimeObservation) {
+ if (obj instanceof Comment || obj instanceof Constraint || obj instanceof TimeObservation) {
InteractionInteractionCompartmentEditPart part = getParentInteractionCompartmentEditPart();
- if(part != null) {
+ if (part != null) {
return part.getCommand(request);
}
}
}
}
- if(request instanceof CreateConnectionRequest) {
- CreateConnectionRequest createConnectionRequest = (CreateConnectionRequest)request;
+ if (request instanceof CreateConnectionRequest) {
+ CreateConnectionRequest createConnectionRequest = (CreateConnectionRequest) request;
EditPart target = createConnectionRequest.getTargetEditPart();
- if(target instanceof CustomLifelineEditPart) {
- CustomLifelineEditPart lifelineEditPart = (CustomLifelineEditPart)target;
+ if (target instanceof CustomLifelineEditPart) {
+ CustomLifelineEditPart lifelineEditPart = (CustomLifelineEditPart) target;
Rectangle lifelineBounds = lifelineEditPart.getContentPane().getBounds();
- for(ShapeNodeEditPart executionSpecificationEditPart : LifelineEditPartUtil.getChildShapeNodeEditPart(lifelineEditPart)) {
+ for (ShapeNodeEditPart executionSpecificationEditPart : LifelineEditPartUtil.getChildShapeNodeEditPart(lifelineEditPart)) {
IFigure executionSpecificationFigure = executionSpecificationEditPart.getFigure();
Rectangle esBounds = executionSpecificationFigure.getBounds().getCopy();
esBounds.x = lifelineBounds.x;
esBounds.width = lifelineBounds.width;
- if(createConnectionRequest.getLocation() != null) {
+ if (createConnectionRequest.getLocation() != null) {
Point location = createConnectionRequest.getLocation().getCopy();
executionSpecificationFigure.translateToRelative(location);
- if(esBounds.contains(location)) {
+ if (esBounds.contains(location)) {
createConnectionRequest.setTargetEditPart(executionSpecificationEditPart);
return executionSpecificationEditPart.getCommand(request);
}
@@ -774,13 +787,13 @@ public class CustomLifelineEditPart extends LifelineEditPart {
/**
* {@inheritDoc}
- *
+ *
* @Override Execution specification handling
*/
@Override
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
// Execution specification handling
- if(editPart instanceof AbstractExecutionSpecificationEditPart || editPart instanceof CombinedFragment2EditPart) {
+ if (editPart instanceof AbstractExecutionSpecificationEditPart || editPart instanceof CombinedFragment2EditPart) {
return getPrimaryShape().getFigureLifelineDotLineFigure();
}
return super.getContentPaneFor(editPart);
@@ -791,8 +804,8 @@ public class CustomLifelineEditPart extends LifelineEditPart {
*/
private NodeFigure getDashLineFigure() {
NodeFigure centerFigure = null;
- if(getContentPane() instanceof LifelineDotLineCustomFigure) {
- centerFigure = ((LifelineDotLineCustomFigure)getContentPane()).getDashLineRectangle();
+ if (getContentPane() instanceof LifelineDotLineCustomFigure) {
+ centerFigure = ((LifelineDotLineCustomFigure) getContentPane()).getDashLineRectangle();
}
return centerFigure;
}
@@ -800,21 +813,21 @@ public class CustomLifelineEditPart extends LifelineEditPart {
private int getMinimumHeight(int heightHint) {
Rectangle rect = getFigure().getBounds().getCopy();
getFigure().translateToAbsolute(rect);
- Lifeline lifeline = (Lifeline)resolveSemanticElement();
+ Lifeline lifeline = (Lifeline) resolveSemanticElement();
EList<InteractionFragment> coveredBys = lifeline.getCoveredBys();
int bottom = 0;
- for(InteractionFragment interactionFragment : coveredBys) {
+ for (InteractionFragment interactionFragment : coveredBys) {
Collection<Setting> settings = CacheAdapter.getInstance().getNonNavigableInverseReferences(interactionFragment);
- for(Setting ref : settings) {
- if(!NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
+ for (Setting ref : settings) {
+ if (!NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
continue;
}
- View view = (View)ref.getEObject();
+ View view = (View) ref.getEObject();
EditPart part = DiagramEditPartsUtil.getEditPartFromView(view, this);
- if(!(part instanceof GraphicalEditPart)) {
+ if (!(part instanceof GraphicalEditPart)) {
continue;
}
- GraphicalEditPart ep = (GraphicalEditPart)part;
+ GraphicalEditPart ep = (GraphicalEditPart) part;
Rectangle r = ep.getFigure().getBounds().getCopy();
getFigure().translateToAbsolute(r);
bottom = Math.max(bottom, r.bottom());
@@ -826,7 +839,7 @@ public class CustomLifelineEditPart extends LifelineEditPart {
/**
* Overrides to return the DashLineFigure instead of this figure. This is necessary for the
* connections anchor.
- *
+ *
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart#getNodeFigure()
*/
@Override
@@ -838,11 +851,11 @@ public class CustomLifelineEditPart extends LifelineEditPart {
* Try to use the notifier from super class, if not exist, create new one.
*/
protected NotificationHelper getNotifier() {
- if(notifier == null) {
+ if (notifier == null) {
try {
Field f = LifelineEditPart.class.getDeclaredField("notifier");
f.setAccessible(true);
- notifier = (NotificationHelper)f.get(this);
+ notifier = (NotificationHelper) f.get(this);
} catch (Exception e) {
notifier = new NotificationHelper(new UIAdapterImpl() {
@@ -860,27 +873,27 @@ public class CustomLifelineEditPart extends LifelineEditPart {
EditPart part = this;
do {
part = part.getParent();
- } while(part != null && !(part instanceof InteractionInteractionCompartmentEditPart));
- return (InteractionInteractionCompartmentEditPart)part;
+ } while (part != null && !(part instanceof InteractionInteractionCompartmentEditPart));
+ return (InteractionInteractionCompartmentEditPart) part;
}
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart#getPrimaryShape()
- *
+ *
* @return
*/
@Override
public CustomLifelineFigure getPrimaryShape() {
- return (CustomLifelineFigure)primaryShape;
+ return (CustomLifelineFigure) primaryShape;
}
/**
* Return the inner ConnectableElements of the lifeline
- *
+ *
* @return inner ConnectableElements
*/
public List<Property> getProperties() {
- Lifeline lifeline = (Lifeline)resolveSemanticElement();
+ Lifeline lifeline = (Lifeline) resolveSemanticElement();
return getProperties(lifeline);
}
@@ -889,24 +902,24 @@ public class CustomLifelineEditPart extends LifelineEditPart {
*/
@Override
public ConnectionAnchor getTargetConnectionAnchor(ConnectionEditPart connEditPart) {
- if(connEditPart instanceof Message4EditPart) {
+ if (connEditPart instanceof Message4EditPart) {
// Create message
return new LifelineAnchor(getPrimaryShape().getFigureLifelineNameContainerFigure());
}
- if(connEditPart instanceof Message2EditPart) {
+ if (connEditPart instanceof Message2EditPart) {
String terminal = AnchorHelper.getAnchorId(getEditingDomain(), connEditPart, false);
- if(terminal.length() > 0) {
+ if (terminal.length() > 0) {
int start = terminal.indexOf("{") + 1;
PrecisionPoint pt = BaseSlidableAnchor.parseTerminalString(terminal);
boolean rightHand = true;
- if(start > 0) {
- if(terminal.charAt(start) == 'L') {
+ if (start > 0) {
+ if (terminal.charAt(start) == 'L') {
rightHand = false;
}
} else {
- Connection c = (Connection)connEditPart.getFigure();
+ Connection c = (Connection) connEditPart.getFigure();
PointList list = c.getPoints();
- if(list.getPoint(0).x > list.getPoint(1).x) {
+ if (list.getPoint(0).x > list.getPoint(1).x) {
rightHand = false;
}
}
@@ -921,100 +934,101 @@ public class CustomLifelineEditPart extends LifelineEditPart {
*/
@Override
public ConnectionAnchor getTargetConnectionAnchor(Request request) {
- if(request instanceof CreateUnspecifiedTypeConnectionRequest) {
- CreateUnspecifiedTypeConnectionRequest createRequest = (CreateUnspecifiedTypeConnectionRequest)request;
+ if (request instanceof CreateUnspecifiedTypeConnectionRequest) {
+ CreateUnspecifiedTypeConnectionRequest createRequest = (CreateUnspecifiedTypeConnectionRequest) request;
List<?> relationshipTypes = createRequest.getElementTypes();
- for(Object obj : relationshipTypes) {
- if(UMLElementTypes.Message_4006.equals(obj)) {
- return LifelineMessageCreateHelper.getCreateMessageAnchor(this, request, ((CreateUnspecifiedTypeConnectionRequest)request).getLocation().getCopy());
+ for (Object obj : relationshipTypes) {
+ if (UMLElementTypes.Message_4006.equals(obj)) {
+ return LifelineMessageCreateHelper.getCreateMessageAnchor(this, request, ((CreateUnspecifiedTypeConnectionRequest) request).getLocation().getCopy());
}
}
- } else if(request instanceof ReconnectRequest) {
- ReconnectRequest reconnectRequest = (ReconnectRequest)request;
+ } else if (request instanceof ReconnectRequest) {
+ ReconnectRequest reconnectRequest = (ReconnectRequest) request;
ConnectionEditPart connectionEditPart = reconnectRequest.getConnectionEditPart();
- if(connectionEditPart instanceof Message4EditPart) {
- return LifelineMessageCreateHelper.getCreateMessageAnchor(this, request, ((ReconnectRequest)request).getLocation().getCopy());
+ if (connectionEditPart instanceof Message4EditPart) {
+ return LifelineMessageCreateHelper.getCreateMessageAnchor(this, request, ((ReconnectRequest) request).getLocation().getCopy());
}
}
ConnectionAnchor anchor = super.getTargetConnectionAnchor(request);
- if(anchor instanceof SlidableAnchor) {
- return createSideAnchor(request, (SlidableAnchor)anchor);
+ if (anchor instanceof SlidableAnchor) {
+ return createSideAnchor(request, (SlidableAnchor) anchor);
}
return anchor;
}
/**
* Handle lifeline covered by and destruction event
- *
+ *
*/
@Override
protected void handleNotificationEvent(Notification notification) {
final NotificationHelper notifier = getNotifier();
Object feature = notification.getFeature();
- if(ElementIconUtil.isIconNotification(notification)) {
+ if (ElementIconUtil.isIconNotification(notification)) {
updateLifelinePosition();
}
EObject element = resolveSemanticElement();
TransactionalEditingDomain editingDomain = getEditingDomain();
- if(element instanceof Lifeline && !((Lifeline)element).getCoveredBys().isEmpty()) {
- Lifeline lifeline = (Lifeline)element;
+ if (element instanceof Lifeline && !((Lifeline) element).getCoveredBys().isEmpty()) {
+ Lifeline lifeline = (Lifeline) element;
EList<InteractionFragment> coveredBys = lifeline.getCoveredBys();
- //if the coveredBy was removed from resource, then make sure them removed from lifeline model.
- if(Notification.REMOVE == notification.getEventType()) {
+ // if the coveredBy was removed from resource, then make sure them removed from lifeline model.
+ if (Notification.REMOVE == notification.getEventType()) {
Object oldValue = notification.getOldValue();
- if(coveredBys.contains(oldValue)) {
+ if (coveredBys.contains(oldValue)) {
CommandHelper.executeCommandWithoutHistory(editingDomain, RemoveCommand.create(editingDomain, lifeline, UMLPackage.eINSTANCE.getLifeline_CoveredBy(), oldValue), true);
}
- } else if(Notification.REMOVE_MANY == notification.getEventType()) {
- List oldValue = (List)notification.getOldValue();
- for(Object object : oldValue) {
- if(coveredBys.contains(object)) {
+ } else if (Notification.REMOVE_MANY == notification.getEventType()) {
+ List oldValue = (List) notification.getOldValue();
+ for (Object object : oldValue) {
+ if (coveredBys.contains(object)) {
CommandHelper.executeCommandWithoutHistory(editingDomain, RemoveCommand.create(editingDomain, lifeline, UMLPackage.eINSTANCE.getLifeline_CoveredBy(), object), true);
}
}
}
}
- if(UMLPackage.eINSTANCE.getLifeline_CoveredBy().equals(feature)) {
+ if (UMLPackage.eINSTANCE.getLifeline_CoveredBy().equals(feature)) {
// Handle coveredBy attribute
Object newValue = notification.getNewValue();
- if(notification.getOldValue() instanceof MessageOccurrenceSpecification) {
- notifier.unlistenObject((Notifier)notification.getOldValue());
- if(newValue == null) {
- //updateCrossEnd();
+ if (notification.getOldValue() instanceof MessageOccurrenceSpecification) {
+ notifier.unlistenObject((Notifier) notification.getOldValue());
+ if (newValue == null) {
+ // updateCrossEnd();
}
}
- if(newValue instanceof MessageOccurrenceSpecification) {
- MessageOccurrenceSpecification newMessageOccurrenceSpecification = (MessageOccurrenceSpecification)newValue;
+ if (newValue instanceof MessageOccurrenceSpecification) {
+ MessageOccurrenceSpecification newMessageOccurrenceSpecification = (MessageOccurrenceSpecification) newValue;
notifier.listenObject(newMessageOccurrenceSpecification);
- // if(newMessageOccurrenceSpecification.getEvent() instanceof DestructionEvent) {
- // getPrimaryShape().getFigureLifelineDotLineFigure().setCrossAtEnd(true);
- // getPrimaryShape().repaint();
- // }
+ // if(newMessageOccurrenceSpecification.getEvent() instanceof DestructionEvent) {
+ // getPrimaryShape().getFigureLifelineDotLineFigure().setCrossAtEnd(true);
+ // getPrimaryShape().repaint();
+ // }
}
- // Handle removing the coveredBys.
- if(newValue instanceof InteractionFragment) {
- EObject eContainer = ((InteractionFragment)newValue).eContainer();
- if(eContainer != null) {
+ // Handle removing the coveredBys.
+ if (newValue instanceof InteractionFragment) {
+ EObject eContainer = ((InteractionFragment) newValue).eContainer();
+ if (eContainer != null) {
notifier.listenObject(eContainer);
}
}
- } else if(UMLPackage.eINSTANCE.getOccurrenceSpecification().equals(feature)) {
- // // Handle destruction event
- // Object newValue = notification.getNewValue();
- // if(notification.getOldValue() instanceof DestructionEvent && newValue instanceof DestructionEvent == false) {
- // //updateCrossEnd();
- // }
- // if(newValue instanceof DestructionEvent) {
- // getPrimaryShape().getFigureLifelineDotLineFigure().setCrossAtEnd(true);
- // getPrimaryShape().repaint();
- // }
+ } else if (UMLPackage.eINSTANCE.getOccurrenceSpecification().equals(feature)) {
+ // // Handle destruction event
+ // Object newValue = notification.getNewValue();
+ // if(notification.getOldValue() instanceof DestructionEvent && newValue instanceof DestructionEvent == false) {
+ // //updateCrossEnd();
+ // }
+ // if(newValue instanceof DestructionEvent) {
+ // getPrimaryShape().getFigureLifelineDotLineFigure().setCrossAtEnd(true);
+ // getPrimaryShape().repaint();
+ // }
}
super.handleNotificationEvent(notification);
// fixed bug (id=364711) when bounds changed update coveredBys with the
// figure's bounds.
- if(notification.getNotifier() instanceof Bounds) {
+ if (notification.getNotifier() instanceof Bounds) {
Display.getDefault().asyncExec(new Runnable() {
+ @Override
public void run() {
LifelineCoveredByUpdater updater = new LifelineCoveredByUpdater();
updater.update(CustomLifelineEditPart.this);
@@ -1024,11 +1038,11 @@ public class CustomLifelineEditPart extends LifelineEditPart {
}
public boolean ignoreRequest(Request request) { // moving editpart causing to add child
- if(request instanceof ChangeBoundsRequest && (request.getType().equals(org.eclipse.gef.RequestConstants.REQ_ADD) || request.getType().equals(RequestConstants.REQ_DROP))) {
- List parts = ((ChangeBoundsRequest)request).getEditParts();
- if(parts != null) {
- for(Object obj : parts) {
- if(obj instanceof CommentEditPart || obj instanceof ConstraintEditPart || obj instanceof TimeObservationEditPart || obj instanceof CombinedFragmentEditPart) {
+ if (request instanceof ChangeBoundsRequest && (request.getType().equals(org.eclipse.gef.RequestConstants.REQ_ADD) || request.getType().equals(RequestConstants.REQ_DROP))) {
+ List parts = ((ChangeBoundsRequest) request).getEditParts();
+ if (parts != null) {
+ for (Object obj : parts) {
+ if (obj instanceof CommentEditPart || obj instanceof ConstraintEditPart || obj instanceof TimeObservationEditPart || obj instanceof CombinedFragmentEditPart) {
return true;
}
}
@@ -1039,12 +1053,12 @@ public class CustomLifelineEditPart extends LifelineEditPart {
/**
* Determine inline capability
- *
+ *
* @return True if inline mode is possible
*/
public boolean isInlineCapability() {
List<Property> properties = getAvailableProperties();
- if(properties != null && !properties.isEmpty()) {
+ if (properties != null && !properties.isEmpty()) {
return inlineMode || getChildren().size() < 2;
}
return false;
@@ -1052,20 +1066,20 @@ public class CustomLifelineEditPart extends LifelineEditPart {
/**
* Get the inline mode
- *
+ *
* @return True if the lifeline is in inline mode and if there are properties, else false
*/
public boolean isInlineMode() {
- // for(Object o : getChildren()) {
- // if(o instanceof LifelineEditPart) {
- // return true;
- // }
- // }
+ // for(Object o : getChildren()) {
+ // if(o instanceof LifelineEditPart) {
+ // return true;
+ // }
+ // }
List models = super.getModelChildren();
- for(Object o : models) {
- if(o instanceof View) {
- View view = (View)o;
- if(UMLVisualIDRegistry.getVisualID(view.getType()) == LifelineEditPart.VISUAL_ID && view.getElement() instanceof Lifeline) {
+ for (Object o : models) {
+ if (o instanceof View) {
+ View view = (View) o;
+ if (UMLVisualIDRegistry.getVisualID(view.getType()) == LifelineEditPart.VISUAL_ID && view.getElement() instanceof Lifeline) {
return true;
}
}
@@ -1077,20 +1091,20 @@ public class CustomLifelineEditPart extends LifelineEditPart {
{
Rectangle leftMostExecution = null;
List<ShapeNodeEditPart> childShapeNodeEditPart = LifelineEditPartUtil.getChildShapeNodeEditPart(this);
- for(ShapeNodeEditPart executionSpecificationEP : childShapeNodeEditPart) {
- if(executionSpecificationEP.resolveSemanticElement() instanceof ExecutionSpecification) {
+ for (ShapeNodeEditPart executionSpecificationEP : childShapeNodeEditPart) {
+ if (executionSpecificationEP.resolveSemanticElement() instanceof ExecutionSpecification) {
Rectangle bounds = executionSpecificationEP.getFigure().getBounds();
Point point = bounds.getLocation();
- if(leftMostExecution == null || leftMostExecution.x > point.x) {
+ if (leftMostExecution == null || leftMostExecution.x > point.x) {
leftMostExecution = bounds;
}
}
}
- if(leftMostExecution == null) {
+ if (leftMostExecution == null) {
return;
}
Rectangle dotLineBounds = this.getPrimaryShape().getFigureLifelineDotLineFigure().getBounds();
- int targetX = (int)(dotLineBounds.x + Math.round((dotLineBounds.width - leftMostExecution.width) / 2.0));
+ int targetX = (int) (dotLineBounds.x + Math.round((dotLineBounds.width - leftMostExecution.width) / 2.0));
sizeDelta.width += (targetX - leftMostExecution.x); // adjust width to keep execution in center line
}
{ // move all executions
@@ -1105,7 +1119,7 @@ public class CustomLifelineEditPart extends LifelineEditPart {
CompoundCommand compoundCmd = new CompoundCommand();
compoundCmd.setLabel("Move or Resize");
InteractionCompartmentXYLayoutEditPolicy.addLifelineResizeChildrenCommand(compoundCmd, request, this, 1);
- if(compoundCmd.canExecute()) {
+ if (compoundCmd.canExecute()) {
CommandHelper.executeCommandWithoutHistory(getEditingDomain(), new GEFtoEMFCommandWrapper(compoundCmd.unwrap()), true);
}
}
@@ -1120,9 +1134,9 @@ public class CustomLifelineEditPart extends LifelineEditPart {
@Override
protected void refreshBounds() {
super.refreshBounds();
- if(LifelineResizeHelper.isManualSize(this)) {
+ if (LifelineResizeHelper.isManualSize(this)) {
LifelineFigure primaryShape = getPrimaryShape();
- //Once the minimum size is set, the main figure will not be expanded by itself.
+ // Once the minimum size is set, the main figure will not be expanded by itself.
primaryShape.setMinimumSize(new Dimension(1, -1));
}
}
@@ -1138,19 +1152,19 @@ public class CustomLifelineEditPart extends LifelineEditPart {
IFigure parent = getContentPane();
List visualChildren = parent.getChildren();
int index = 0;
- //Fixed bug about z-order of Execution Specifications: reorder figures if needed.
+ // Fixed bug about z-order of Execution Specifications: reorder figures if needed.
Map editPartRegistry = getViewer().getEditPartRegistry();
- for(int i = 0; i < modelChildren.size(); i++) {
+ for (int i = 0; i < modelChildren.size(); i++) {
Object child = editPartRegistry.get(modelChildren.get(i));
- if(!(child instanceof GraphicalEditPart)) {
+ if (!(child instanceof GraphicalEditPart)) {
continue;
}
- IFigure figure = ((GraphicalEditPart)child).getFigure();
+ IFigure figure = ((GraphicalEditPart) child).getFigure();
int currentIndex = visualChildren.indexOf(figure);
- if(currentIndex == -1) {
+ if (currentIndex == -1) {
continue;
}
- if(currentIndex != index) {
+ if (currentIndex != index) {
visualChildren.remove(figure);
visualChildren.add(index, figure);
}
@@ -1170,7 +1184,7 @@ public class CustomLifelineEditPart extends LifelineEditPart {
*/
@Override
public void removeNotify() {
- if(notifier != null) {
+ if (notifier != null) {
notifier.unlistenAll();
}
super.removeNotify();
@@ -1178,7 +1192,7 @@ public class CustomLifelineEditPart extends LifelineEditPart {
/**
* Overrides because getNodeFigure() doesn't return the getFigure() anymore.
- *
+ *
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart#setBackgroundColor(org.eclipse.swt.graphics.Color)
*/
@Override
@@ -1195,8 +1209,8 @@ public class CustomLifelineEditPart extends LifelineEditPart {
@Override
protected void setLineWidth(int width) {
- if(getPrimaryShape() instanceof NodeFigure) {
- ((NodeFigure)getPrimaryShape()).setLineWidth(width);
+ if (getPrimaryShape() instanceof NodeFigure) {
+ ((NodeFigure) getPrimaryShape()).setLineWidth(width);
}
super.setLineWidth(width);
}
@@ -1204,23 +1218,24 @@ public class CustomLifelineEditPart extends LifelineEditPart {
/**
* Default implementation treats passed figure as content pane. Respects layout one may have set
* for generated figure.
- *
+ *
* @param nodeShape
- * instance of generated figure class
+ * instance of generated figure class
* @Override Execution specification handling
*/
@Override
protected IFigure setupContentPane(IFigure nodeShape) {
// Execution specification handling
- if(nodeShape instanceof LifelineFigure) {
- LifelineFigure lFigure = (LifelineFigure)nodeShape;
+ if (nodeShape instanceof LifelineFigure) {
+ LifelineFigure lFigure = (LifelineFigure) nodeShape;
return lFigure.getFigureLifelineDotLineFigure();
}
return setupContentPane(nodeShape);
}
+ @Override
public void showTargetFeedback(Request request) {
- if(ignoreRequest(request)) {
+ if (ignoreRequest(request)) {
return;
}
super.showTargetFeedback(request);
@@ -1228,13 +1243,13 @@ public class CustomLifelineEditPart extends LifelineEditPart {
/**
* set the bounds of the lifeline.
- *
+ *
* @param rect
- * the rectangle corresponding to the bounds.
+ * the rectangle corresponding to the bounds.
*/
public void updateLifelineBounds(final Rectangle rect) {
final Bounds bounds = getBounds();
- if(bounds != null) {
+ if (bounds != null) {
AbstractCommand cmd = new AbstractCommand() {
/**
@@ -1256,6 +1271,7 @@ public class CustomLifelineEditPart extends LifelineEditPart {
/**
* {@inheritDoc}
*/
+ @Override
public void execute() {
bounds.setX(rect.x);
bounds.setY(rect.y);
@@ -1266,6 +1282,7 @@ public class CustomLifelineEditPart extends LifelineEditPart {
/**
* {@inheritDoc}
*/
+ @Override
public void redo() {
execute();
}
@@ -1280,7 +1297,7 @@ public class CustomLifelineEditPart extends LifelineEditPart {
*/
public void updateLifelinePosition() {
Bounds bounds = getBounds();
- if(bounds != null) {
+ if (bounds != null) {
Rectangle rect = new Rectangle(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight());
// retrieve the real bounds in updatedRect because we need the real width
Rectangle updatedRect = rect.getCopy();
@@ -1308,8 +1325,8 @@ public class CustomLifelineEditPart extends LifelineEditPart {
* }
*/
Dimension size = getPrimaryShape().getFigureLifelineNameContainerFigure().getPreferredSize(-1, oldNameContainerHeight);
- if(!LifelineResizeHelper.isManualSize(this)) {
- if(size.width != rect.width) {
+ if (!LifelineResizeHelper.isManualSize(this)) {
+ if (size.width != rect.width) {
moveExecutionParts(new Dimension(size.width - rect.width, 0));
rect.width = size.width;
updateLifelineBounds(rect);
@@ -1322,29 +1339,29 @@ public class CustomLifelineEditPart extends LifelineEditPart {
* Update the rectangle bounds.
* In case of a creation, the lifeline width and height will be 0. Get the preferred size
* In case of a move, when the lifeline has not be resize, the width or height may be set to -1. Get the according figure bounds.
- *
+ *
* @param rect
- * the rectangle to update
+ * the rectangle to update
*/
private void updateRectangleBounds(Rectangle rect) {
// When moving the lifeline
- if(rect.width == -1) {
+ if (rect.width == -1) {
rect.width = getFigure().getBounds().width;
}
- if(rect.height == -1) {
+ if (rect.height == -1) {
rect.height = getFigure().getBounds().height;
}
- if(rect.x == -1) {
+ if (rect.x == -1) {
rect.x = getFigure().getBounds().x;
}
- if(rect.y == -1) {
+ if (rect.y == -1) {
rect.y = getFigure().getBounds().y;
}
// When creating the lifeline
- if(rect.width == 0) {
+ if (rect.width == 0) {
rect.width = getFigure().getPreferredSize().width;
}
- if(rect.height == 0) {
+ if (rect.height == 0) {
rect.height = getFigure().getPreferredSize().height;
}
}
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 8f8a96aafda..d6e01d435e0 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -44,7 +44,7 @@ public class CustomLifelineNameEditPart extends LifelineNameEditPart {
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomLifelineNameEditPart(View view) {
@@ -53,7 +53,7 @@ public class CustomLifelineNameEditPart extends LifelineNameEditPart {
@Override
public void setLabel(WrappingLabel figure) {
- figure.setTextWrap(false); // If the width is too small, the text will be displayed in part and suffixed by "..."
+ figure.setTextWrap(false); // If the width is too small, the text will be displayed in part and suffixed by "..."
super.setLabel(figure);
}
@@ -61,8 +61,8 @@ public class CustomLifelineNameEditPart extends LifelineNameEditPart {
* @Override
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -71,31 +71,31 @@ public class CustomLifelineNameEditPart extends LifelineNameEditPart {
/**
* This methods is no more generated to handle the case of editing the name of a lifeline
* with a directEdition when its properties represents and decomposedAs are null
- *
+ *
* @Override
*/
@Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- Lifeline lifeline = (Lifeline)resolveSemanticElement();
- if(lifeline.getRepresents() != null || lifeline.getDecomposedAs() != null) {
+ Lifeline lifeline = (Lifeline) resolveSemanticElement();
+ if (lifeline.getRepresents() != null || lifeline.getDecomposedAs() != null) {
directEditionMode = IDirectEdition.NO_DIRECT_EDITION;
}
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@@ -113,13 +113,14 @@ public class CustomLifelineNameEditPart extends LifelineNameEditPart {
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -142,17 +143,17 @@ public class CustomLifelineNameEditPart extends LifelineNameEditPart {
@Override
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getParent().getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
}
setLabelIconHelper(getFigure(), getLabelIcon());
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -161,17 +162,18 @@ public class CustomLifelineNameEditPart extends LifelineNameEditPart {
*/
@Override
protected void handleNotificationEvent(Notification event) {
- if(getParent() instanceof CustomLifelineEditPart) {
+ if (getParent() instanceof CustomLifelineEditPart) {
Object feature = event.getFeature();
Object notifier = event.getNotifier();
- Lifeline lifeline = (Lifeline)this.resolveSemanticElement();
+ Lifeline lifeline = (Lifeline) this.resolveSemanticElement();
// handle possible change in the name container size
// In AutoSize mode, the width should be resized if the content of the text gets changed. see https://bugs.eclipse.org/bugs/show_bug.cgi?id=383723
- if(notifier.equals(lifeline.getRepresents()) || 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();
+ if (notifier.equals(lifeline.getRepresents()) || 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();
}
- if(notifier instanceof EAnnotation && ((EAnnotation)notifier).getSource().equals(VisualInformationPapyrusConstants.CUSTOM_APPEARENCE_ANNOTATION)) {
- ((CustomLifelineEditPart)getParent()).updateLifelinePosition();
+ if (notifier instanceof EAnnotation && ((EAnnotation) notifier).getSource().equals(VisualInformationPapyrusConstants.CUSTOM_APPEARENCE_ANNOTATION)) {
+ ((CustomLifelineEditPart) 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/CustomMessage2EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessage2EditPart.java
index c2f4bc07e68..445dd09473c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessage2EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessage2EditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -30,7 +30,7 @@ public class CustomMessage2EditPart extends Message2EditPart {
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomMessage2EditPart(View view) {
@@ -51,13 +51,13 @@ public class CustomMessage2EditPart extends Message2EditPart {
*/
@Override
protected void handleNotificationEvent(Notification notification) {
- SequenceUtil.handleMessageSortChange(getEditingDomain(), notification, (Message)resolveSemanticElement(), MessageSort.ASYNCH_CALL_LITERAL);
+ SequenceUtil.handleMessageSortChange(getEditingDomain(), notification, (Message) resolveSemanticElement(), MessageSort.ASYNCH_CALL_LITERAL);
super.handleNotificationEvent(notification);
}
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Message2EditPart#createConnectionFigure()
- *
+ *
* @return
*/
@Override
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessage3EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessage3EditPart.java
index 7cee4bd4f99..b6a703eae7e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessage3EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessage3EditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -30,7 +30,7 @@ public class CustomMessage3EditPart extends Message3EditPart {
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomMessage3EditPart(View view) {
@@ -51,13 +51,13 @@ public class CustomMessage3EditPart extends Message3EditPart {
*/
@Override
protected void handleNotificationEvent(Notification notification) {
- SequenceUtil.handleMessageSortChange(getEditingDomain(), notification, (Message)resolveSemanticElement(), MessageSort.ASYNCH_CALL_LITERAL);
+ SequenceUtil.handleMessageSortChange(getEditingDomain(), notification, (Message) resolveSemanticElement(), MessageSort.ASYNCH_CALL_LITERAL);
super.handleNotificationEvent(notification);
}
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Message3EditPart#createConnectionFigure()
- *
+ *
* @return
*/
@Override
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessage4EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessage4EditPart.java
index 2f0bad7a24b..0cc074b97ff 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessage4EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessage4EditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -30,7 +30,7 @@ public class CustomMessage4EditPart extends Message4EditPart {
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomMessage4EditPart(View view) {
@@ -51,13 +51,13 @@ public class CustomMessage4EditPart extends Message4EditPart {
*/
@Override
protected void handleNotificationEvent(Notification notification) {
- SequenceUtil.handleMessageSortChange(getEditingDomain(), notification, (Message)resolveSemanticElement(), MessageSort.ASYNCH_CALL_LITERAL);
+ SequenceUtil.handleMessageSortChange(getEditingDomain(), notification, (Message) resolveSemanticElement(), MessageSort.ASYNCH_CALL_LITERAL);
super.handleNotificationEvent(notification);
}
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Message4EditPart#createConnectionFigure()
- *
+ *
* @return
*/
@Override
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessage5EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessage5EditPart.java
index 04e2390068f..93e2af9ca03 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessage5EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessage5EditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -30,7 +30,7 @@ public class CustomMessage5EditPart extends Message5EditPart {
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomMessage5EditPart(View view) {
@@ -51,13 +51,13 @@ public class CustomMessage5EditPart extends Message5EditPart {
*/
@Override
protected void handleNotificationEvent(Notification notification) {
- SequenceUtil.handleMessageSortChange(getEditingDomain(), notification, (Message)resolveSemanticElement(), MessageSort.ASYNCH_CALL_LITERAL);
+ SequenceUtil.handleMessageSortChange(getEditingDomain(), notification, (Message) resolveSemanticElement(), MessageSort.ASYNCH_CALL_LITERAL);
super.handleNotificationEvent(notification);
}
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Message5EditPart#createConnectionFigure()
- *
+ *
* @return
*/
@Override
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessage6EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessage6EditPart.java
index e0bc5105102..a6dc91b23d3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessage6EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessage6EditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -30,7 +30,7 @@ public class CustomMessage6EditPart extends Message6EditPart {
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomMessage6EditPart(View view) {
@@ -51,13 +51,13 @@ public class CustomMessage6EditPart extends Message6EditPart {
*/
@Override
protected void handleNotificationEvent(Notification notification) {
- SequenceUtil.handleMessageSortChange(getEditingDomain(), notification, (Message)resolveSemanticElement(), MessageSort.ASYNCH_CALL_LITERAL);
+ SequenceUtil.handleMessageSortChange(getEditingDomain(), notification, (Message) resolveSemanticElement(), MessageSort.ASYNCH_CALL_LITERAL);
super.handleNotificationEvent(notification);
}
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Message6EditPart#createConnectionFigure()
- *
+ *
* @return
*/
@Override
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessage7EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessage7EditPart.java
index 9b80425ecf7..5bffdcbffc9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessage7EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessage7EditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -30,7 +30,7 @@ public class CustomMessage7EditPart extends Message7EditPart {
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomMessage7EditPart(View view) {
@@ -51,13 +51,13 @@ public class CustomMessage7EditPart extends Message7EditPart {
*/
@Override
protected void handleNotificationEvent(Notification notification) {
- SequenceUtil.handleMessageSortChange(getEditingDomain(), notification, (Message)resolveSemanticElement(), MessageSort.ASYNCH_CALL_LITERAL);
+ SequenceUtil.handleMessageSortChange(getEditingDomain(), notification, (Message) resolveSemanticElement(), MessageSort.ASYNCH_CALL_LITERAL);
super.handleNotificationEvent(notification);
}
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Message7EditPart#createConnectionFigure()
- *
+ *
* @return
*/
@Override
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageEditPart.java
index 44bb2b40c6d..f6dfbc3719c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -30,7 +30,7 @@ public class CustomMessageEditPart extends MessageEditPart {
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomMessageEditPart(View view) {
@@ -51,13 +51,13 @@ public class CustomMessageEditPart extends MessageEditPart {
*/
@Override
protected void handleNotificationEvent(Notification notification) {
- SequenceUtil.handleMessageSortChange(getEditingDomain(), notification, (Message)resolveSemanticElement(), MessageSort.ASYNCH_CALL_LITERAL);
+ SequenceUtil.handleMessageSortChange(getEditingDomain(), notification, (Message) resolveSemanticElement(), MessageSort.ASYNCH_CALL_LITERAL);
super.handleNotificationEvent(notification);
}
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageEditPart#createConnectionFigure()
- *
+ *
* @return
*/
@Override
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName2EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName2EditPart.java
index 784b6046493..f31bdb8a94c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName2EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName2EditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -52,7 +52,7 @@ public class CustomMessageName2EditPart extends MessageName2EditPart implements
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomMessageName2EditPart(View view) {
@@ -61,7 +61,7 @@ public class CustomMessageName2EditPart extends MessageName2EditPart implements
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart#deactivate()
- *
+ *
*/
@Override
public void deactivate() {
@@ -71,21 +71,21 @@ public class CustomMessageName2EditPart extends MessageName2EditPart implements
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart#activate()
- *
+ *
*/
@Override
public void activate() {
super.activate();
Message outerCFMessage = getOuterCFMessage();
- if(outerCFMessage != null) {
+ if (outerCFMessage != null) {
notifier.listenObject(outerCFMessage);
}
}
private Message getOuterCFMessage() {
EObject element = resolveSemanticElement();
- if(element instanceof Message) {
- return GateHelper.getOuterCFMessage((Message)element);
+ if (element instanceof Message) {
+ return GateHelper.getOuterCFMessage((Message) element);
}
return null;
}
@@ -93,9 +93,9 @@ public class CustomMessageName2EditPart extends MessageName2EditPart implements
@Override
public void refreshBounds() {
super.refreshBounds();
- Message2EditPart parent = (Message2EditPart)getParent();
- //Update location of label for self linked message.
- if(SelfMessageHelper.isSelfLink(parent)) {
+ Message2EditPart parent = (Message2EditPart) getParent();
+ // Update location of label for self linked message.
+ if (SelfMessageHelper.isSelfLink(parent)) {
SelfMessageHelper.updateLabelLocation(this);
}
}
@@ -103,59 +103,59 @@ public class CustomMessageName2EditPart extends MessageName2EditPart implements
@Override
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getParent().getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@Override
public void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
private View getFontStyleOwnerView() {
- return (View)getParent().getModel();
+ return (View) getParent().getModel();
}
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageName2EditPart#performDirectEditRequest(org.eclipse.gef.Request)
- *
+ *
* @param request
*/
@Override
protected void performDirectEditRequest(Request request) {
Object data = request.getExtendedData().get(SequenceRequestConstant.DIRECT_EDIT_AFTER_CREATION);
- if(data != null && "true".equals(data.toString())) {
+ if (data != null && "true".equals(data.toString())) {
EObject element = resolveSemanticElement();
- if(element instanceof Message) {
- //By using suggestion name for message in CombinedFragment.
- MessageEnd sendEvent = ((Message)element).getSendEvent();
- if(sendEvent instanceof Gate && GateHelper.isInnerCFGate((Gate)sendEvent)) {
+ if (element instanceof Message) {
+ // By using suggestion name for message in CombinedFragment.
+ MessageEnd sendEvent = ((Message) element).getSendEvent();
+ if (sendEvent instanceof Gate && GateHelper.isInnerCFGate((Gate) sendEvent)) {
return;
}
- MessageEnd receiveEvent = ((Message)element).getReceiveEvent();
- if(receiveEvent instanceof Gate && GateHelper.isInnerCFGate((Gate)receiveEvent)) {
+ MessageEnd receiveEvent = ((Message) element).getReceiveEvent();
+ if (receiveEvent instanceof Gate && GateHelper.isInnerCFGate((Gate) receiveEvent)) {
return;
}
- final Message message = (Message)element;
+ final Message message = (Message) element;
firstDirectEditListener = new NotificationHelper(new UIAdapterImpl() {
@Override
protected void safeNotifyChanged(Notification msg) {
- if(message == msg.getNotifier() && UMLPackage.eINSTANCE.getNamedElement_Name() == msg.getFeature()) {
+ if (message == msg.getNotifier() && UMLPackage.eINSTANCE.getNamedElement_Name() == msg.getFeature()) {
postFirstTimeDirectEdit(message);
firstDirectEditListener.unlistenAll();
firstDirectEditListener = null;
@@ -170,7 +170,7 @@ public class CustomMessageName2EditPart extends MessageName2EditPart implements
/**
* This method would be called once after first direct edit at the end of creation.
- *
+ *
* Update name of Gate to suggested name with the linked nessage.
*/
protected void postFirstTimeDirectEdit(Message message) {
@@ -179,15 +179,15 @@ public class CustomMessageName2EditPart extends MessageName2EditPart implements
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageName2EditPart#handleNotificationEvent(org.eclipse.emf.common.notify.Notification)
- *
+ *
* @param event
*/
@Override
protected void handleNotificationEvent(Notification event) {
- // if(event.getNotifier() == getOuterCFMessage() && UMLPackage.eINSTANCE.getNamedElement_Name() == event.getFeature()) {
- // Message message = (Message)resolveSemanticElement();
- // message.setName(getOuterCFMessage().getName());
- // }
+ // if(event.getNotifier() == getOuterCFMessage() && UMLPackage.eINSTANCE.getNamedElement_Name() == event.getFeature()) {
+ // Message message = (Message)resolveSemanticElement();
+ // message.setName(getOuterCFMessage().getName());
+ // }
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/CustomMessageName3EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName3EditPart.java
index b702615bd0b..67fceab62ca 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName3EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName3EditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -30,7 +30,7 @@ public class CustomMessageName3EditPart extends MessageName3EditPart implements
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomMessageName3EditPart(View view) {
@@ -40,30 +40,30 @@ public class CustomMessageName3EditPart extends MessageName3EditPart implements
@Override
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getParent().getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@Override
public void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
private View getFontStyleOwnerView() {
- return (View)getParent().getModel();
+ return (View) getParent().getModel();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName4EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName4EditPart.java
index 1857520fee4..c1f679da090 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName4EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName4EditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -30,7 +30,7 @@ public class CustomMessageName4EditPart extends MessageName4EditPart implements
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomMessageName4EditPart(View view) {
@@ -40,30 +40,30 @@ public class CustomMessageName4EditPart extends MessageName4EditPart implements
@Override
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getParent().getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@Override
public void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
private View getFontStyleOwnerView() {
- return (View)getParent().getModel();
+ return (View) getParent().getModel();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName5EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName5EditPart.java
index 5d8c995984d..79c4c74e3b2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName5EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName5EditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -30,7 +30,7 @@ public class CustomMessageName5EditPart extends MessageName5EditPart implements
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomMessageName5EditPart(View view) {
@@ -40,30 +40,30 @@ public class CustomMessageName5EditPart extends MessageName5EditPart implements
@Override
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getParent().getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@Override
public void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
private View getFontStyleOwnerView() {
- return (View)getParent().getModel();
+ return (View) getParent().getModel();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName6EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName6EditPart.java
index e7ce1cb6f79..f8a3056c14c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName6EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName6EditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -30,7 +30,7 @@ public class CustomMessageName6EditPart extends MessageName6EditPart implements
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomMessageName6EditPart(View view) {
@@ -40,30 +40,30 @@ public class CustomMessageName6EditPart extends MessageName6EditPart implements
@Override
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getParent().getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@Override
public void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
private View getFontStyleOwnerView() {
- return (View)getParent().getModel();
+ return (View) getParent().getModel();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName7EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName7EditPart.java
index e5f9cc0a47f..cdf650f28b1 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName7EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName7EditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -30,7 +30,7 @@ public class CustomMessageName7EditPart extends MessageName7EditPart implements
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomMessageName7EditPart(View view) {
@@ -40,30 +40,30 @@ public class CustomMessageName7EditPart extends MessageName7EditPart implements
@Override
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getParent().getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@Override
public void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
private View getFontStyleOwnerView() {
- return (View)getParent().getModel();
+ return (View) getParent().getModel();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageNameEditPart.java
index 964b7f6f2bd..babeb39b171 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageNameEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -31,7 +31,7 @@ public class CustomMessageNameEditPart extends MessageNameEditPart implements IC
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomMessageNameEditPart(View view) {
@@ -41,9 +41,9 @@ public class CustomMessageNameEditPart extends MessageNameEditPart implements IC
@Override
public void refreshBounds() {
super.refreshBounds();
- MessageEditPart parent = (MessageEditPart)getParent();
- //Update location of label for self linked message.
- if(SelfMessageHelper.isSelfLink(parent)) {
+ MessageEditPart parent = (MessageEditPart) getParent();
+ // Update location of label for self linked message.
+ if (SelfMessageHelper.isSelfLink(parent)) {
SelfMessageHelper.updateLabelLocation(this);
}
}
@@ -51,30 +51,30 @@ public class CustomMessageNameEditPart extends MessageNameEditPart implements IC
@Override
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getParent().getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@Override
public void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
private View getFontStyleOwnerView() {
- return (View)getParent().getModel();
+ return (View) getParent().getModel();
}
}
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/CustomPackageEditPart.java
index 26e976ed9ac..d9341042b04 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/CustomPackageEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -37,7 +37,7 @@ public class CustomPackageEditPart extends PackageEditPart {
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomPackageEditPart(View view) {
@@ -46,7 +46,7 @@ public class CustomPackageEditPart extends PackageEditPart {
/**
* Remove the two policies dealing with the popup menu
- *
+ *
* @Override
*/
@Override
@@ -55,7 +55,7 @@ public class CustomPackageEditPart extends PackageEditPart {
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
+ // fix https://bugs.eclipse.org/bugs/show_bug.cgi?id=364688
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
// do not handle connection event
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new ContainerNodeEditPolicy() {
@@ -72,8 +72,8 @@ public class CustomPackageEditPart extends PackageEditPart {
@Override
protected Command createAddCommand(EditPart child, Object constraint) {
- if(child instanceof LifelineEditPart) {
- if(!SequenceUtil.isCreateMessageEndLifeline((LifelineEditPart)child)) {
+ if (child instanceof LifelineEditPart) {
+ if (!SequenceUtil.isCreateMessageEndLifeline((LifelineEditPart) child)) {
return null;
}
}
@@ -85,10 +85,10 @@ public class CustomPackageEditPart extends PackageEditPart {
@Override
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
- if(event.getNotifier() instanceof EAnnotation) {
- EAnnotation eAnnotation = (EAnnotation)event.getNotifier();
- if(eAnnotation.getSource() != null && eAnnotation.getSource().equals(MDTUtil.FilterViewAndLabelsSource)) {
- //modification form MOSKitt approach, canonical policies are not called
+ if (event.getNotifier() instanceof EAnnotation) {
+ EAnnotation eAnnotation = (EAnnotation) event.getNotifier();
+ if (eAnnotation.getSource() != null && eAnnotation.getSource().equals(MDTUtil.FilterViewAndLabelsSource)) {
+ // modification form MOSKitt approach, canonical policies are not called
MDTUtil.filterDiagramViews(this.getDiagramView());
}
}
@@ -96,7 +96,7 @@ public class CustomPackageEditPart extends PackageEditPart {
@Override
public Object getAdapter(Class adapter) {
- if(adapter != null && adapter.equals(ViewInfo.class)) {
+ if (adapter != null && adapter.equals(ViewInfo.class)) {
return getDiagramViewInfo();
}
return super.getAdapter(adapter);
@@ -105,7 +105,7 @@ public class CustomPackageEditPart extends PackageEditPart {
private static ViewInfo diagramViewInfo = null;
public static ViewInfo getDiagramViewInfo() {
- if(diagramViewInfo == null) {
+ if (diagramViewInfo == null) {
diagramViewInfo = getPackage_1000ViewInfo();
}
return diagramViewInfo;
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 aa82e7e3e95..bf239e1540d 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -89,7 +89,7 @@ public class CustomStateInvariantEditPart extends StateInvariantEditPart impleme
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomStateInvariantEditPart(View view) {
@@ -100,16 +100,16 @@ public class CustomStateInvariantEditPart extends StateInvariantEditPart impleme
public void activate() {
super.activate();
EObject element = resolveSemanticElement();
- if(element instanceof StateInvariant && ((StateInvariant)element).getInvariant() != null) {
- notifierHelper.listenObject(((StateInvariant)element).getInvariant());
+ if (element instanceof StateInvariant && ((StateInvariant) element).getInvariant() != null) {
+ notifierHelper.listenObject(((StateInvariant) element).getInvariant());
}
}
@Override
public void deactivate() {
EObject element = resolveSemanticElement();
- if(element instanceof StateInvariant && ((StateInvariant)element).getInvariant() != null) {
- notifierHelper.unlistenObject(((StateInvariant)element).getInvariant());
+ if (element instanceof StateInvariant && ((StateInvariant) element).getInvariant() != null) {
+ notifierHelper.unlistenObject(((StateInvariant) element).getInvariant());
}
super.deactivate();
}
@@ -121,7 +121,7 @@ public class CustomStateInvariantEditPart extends StateInvariantEditPart impleme
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomStateInvariantItemSemanticEditPolicy());
- //install a editpolicy to display stereotypes
+ // install a editpolicy to display stereotypes
installEditPolicy(AppliedStereotypeCommentCreationEditPolicy.APPLIED_STEREOTYPE_COMMENT, new AppliedStereotypeCommentCreationEditPolicyEx());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
}
@@ -131,19 +131,19 @@ public class CustomStateInvariantEditPart extends StateInvariantEditPart impleme
super.handleNotificationEvent(notification);
Object feature = notification.getFeature();
Object notifier = notification.getNotifier();
- if((getModel() != null) && (getModel() == notifier)) {
- if(NotationPackage.eINSTANCE.getLineStyle_LineWidth().equals(feature)) {
+ if ((getModel() != null) && (getModel() == notifier)) {
+ if (NotationPackage.eINSTANCE.getLineStyle_LineWidth().equals(feature)) {
refreshLineWidth();
}
- } else if(UMLPackage.eINSTANCE.getStateInvariant_Invariant() == feature) {
- if(Notification.SET == notification.getEventType() || Notification.UNSET == notification.getEventType()) {
- notifierHelper.unlistenObject((Notifier)notification.getOldValue());
- notifierHelper.listenObject((Notifier)notification.getNewValue());
+ } else if (UMLPackage.eINSTANCE.getStateInvariant_Invariant() == feature) {
+ if (Notification.SET == notification.getEventType() || Notification.UNSET == notification.getEventType()) {
+ notifierHelper.unlistenObject((Notifier) notification.getOldValue());
+ notifierHelper.listenObject((Notifier) notification.getNewValue());
}
refreshLabels();
- } else if(notifier != null) {
+ } else if (notifier != null) {
EObject element = resolveSemanticElement();
- if(element instanceof StateInvariant && notifier == ((StateInvariant)element).getInvariant()) {
+ if (element instanceof StateInvariant && notifier == ((StateInvariant) element).getInvariant()) {
refreshLabels();
}
}
@@ -151,20 +151,20 @@ public class CustomStateInvariantEditPart extends StateInvariantEditPart impleme
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart#getModelChildren()
- *
+ *
* @return
*/
@Override
protected List getModelChildren() {
List<Object> modelChildren = new ArrayList<Object>(super.getModelChildren());
boolean hasInvariantView = false;
- for(Object object : modelChildren) {
- if(object instanceof View && UMLVisualIDRegistry.getType(StateInvariantLabelEditPart.VISUAL_ID).equals(((View)object).getType())) {
+ for (Object object : modelChildren) {
+ if (object instanceof View && UMLVisualIDRegistry.getType(StateInvariantLabelEditPart.VISUAL_ID).equals(((View) object).getType())) {
hasInvariantView = true;
break;
}
}
- if(!hasInvariantView) {
+ if (!hasInvariantView) {
final View view = getNotationView();
final DecorationNode guardNode = NotationFactory.eINSTANCE.createDecorationNode();
guardNode.setType(UMLVisualIDRegistry.getType(StateInvariantLabelEditPart.VISUAL_ID));
@@ -184,7 +184,7 @@ public class CustomStateInvariantEditPart extends StateInvariantEditPart impleme
protected void setFontColor(Color color) {
super.setFontColor(color);
StateInvariantFigure primaryShape = getPrimaryShape();
- if(primaryShape != null && primaryShape.getConstraintContentContainer() != null) {
+ if (primaryShape != null && primaryShape.getConstraintContentContainer() != null) {
primaryShape.getConstraintContentContainer().setForegroundColor(color);
}
}
@@ -202,9 +202,9 @@ public class CustomStateInvariantEditPart extends StateInvariantEditPart impleme
*/
protected void refreshLabels() {
List parts = getChildren();
- for(Object p : parts) {
- if(p instanceof CustomStateInvariantLabelEditPart) {
- ((CustomStateInvariantLabelEditPart)p).refreshLabel();
+ for (Object p : parts) {
+ if (p instanceof CustomStateInvariantLabelEditPart) {
+ ((CustomStateInvariantLabelEditPart) p).refreshLabel();
}
}
}
@@ -216,12 +216,12 @@ public class CustomStateInvariantEditPart extends StateInvariantEditPart impleme
@Override
protected void refreshBounds() {
- if(getBorderItemLocator() != null) {
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ if (getBorderItemLocator() != null) {
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
// fix size
getFigure().setBounds(new Rectangle(loc, size));
@@ -233,24 +233,24 @@ public class CustomStateInvariantEditPart extends StateInvariantEditPart impleme
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.StateInvariantEditPart#getPrimaryShape()
- *
+ *
* @return
*/
@Override
public StateInvariantFigure getPrimaryShape() {
- return (StateInvariantFigure)primaryShape;
+ return (StateInvariantFigure) primaryShape;
}
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.StateInvariantEditPart#addFixedChild(org.eclipse.gef.EditPart)
- *
+ *
* @param childEditPart
* @return
*/
@Override
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CustomStateInvariantLabelEditPart) {
- ((CustomStateInvariantLabelEditPart)childEditPart).setLabel(getPrimaryShape().getInvariantFigure());
+ if (childEditPart instanceof CustomStateInvariantLabelEditPart) {
+ ((CustomStateInvariantLabelEditPart) childEditPart).setLabel(getPrimaryShape().getInvariantFigure());
return true;
}
return super.addFixedChild(childEditPart);
@@ -258,13 +258,13 @@ public class CustomStateInvariantEditPart extends StateInvariantEditPart impleme
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.StateInvariantEditPart#removeFixedChild(org.eclipse.gef.EditPart)
- *
+ *
* @param childEditPart
* @return
*/
@Override
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CustomStateInvariantLabelEditPart) {
+ if (childEditPart instanceof CustomStateInvariantLabelEditPart) {
return true;
}
return super.removeFixedChild(childEditPart);
@@ -272,7 +272,7 @@ public class CustomStateInvariantEditPart extends StateInvariantEditPart impleme
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.StateInvariantEditPart#createNodeShape()
- *
+ *
* @return
*/
@Override
@@ -306,7 +306,7 @@ public class CustomStateInvariantEditPart extends StateInvariantEditPart impleme
/**
* Constructor.
- *
+ *
*/
public StateInvariantFigure() {
super();
@@ -316,11 +316,11 @@ public class CustomStateInvariantEditPart extends StateInvariantEditPart impleme
contents.setCornerDimensions(new Dimension(getMapMode().DPtoLP(50), getMapMode().DPtoLP(50)));
contents.setOutline(false);
this.add(contents);
- //Name figure
+ // Name figure
fFigureContinuationNameLabel = new CenteredWrappedLabel();
contents.add(fFigureContinuationNameLabel);
- //Invariant figure
+ // Invariant figure
constraintContentContainer = new FlowPage();
constraintContentContainer.setOpaque(false);
constraintContentContainer.setHorizontalAligment(PositionConstants.CENTER);
@@ -328,7 +328,7 @@ public class CustomStateInvariantEditPart extends StateInvariantEditPart impleme
constraintContentContainer.add(constraintContent);
contents.add(constraintContentContainer);
- //Contents layout.
+ // Contents layout.
ToolbarLayout layout = new ToolbarLayout(false);
layout.setStretchMinorAxis(true);
layout.setMinorAlignment(OrderedLayout.ALIGN_CENTER);
@@ -345,10 +345,12 @@ public class CustomStateInvariantEditPart extends StateInvariantEditPart impleme
return fFigureContinuationNameLabel;
}
+ @Override
public IFigure getInvariantFigure() {
return this;
}
+ @Override
protected void fillShape(Graphics graphics) {
graphics.pushState();
applyTransparency(graphics);
@@ -358,7 +360,7 @@ public class CustomStateInvariantEditPart extends StateInvariantEditPart impleme
/**
* Returns transparency value (belongs to [0, 100] interval)
- *
+ *
* @return transparency
* @since 1.2
*/
@@ -368,13 +370,13 @@ public class CustomStateInvariantEditPart extends StateInvariantEditPart impleme
/**
* Sets the transparency if the given parameter is in [0, 100] range
- *
+ *
* @param transparency
- * The transparency to set
+ * The transparency to set
* @since 1.2
*/
public void setTransparency(int transparency) {
- if(transparency != this.transparency && transparency >= 0 && transparency <= 100) {
+ if (transparency != this.transparency && transparency >= 0 && transparency <= 100) {
this.transparency = transparency;
repaint();
}
@@ -384,59 +386,64 @@ public class CustomStateInvariantEditPart extends StateInvariantEditPart impleme
* Converts transparency value from percent range [0, 100] to alpha range
* [0, 255] and applies converted value. 0% corresponds to alpha 255 and
* 100% corresponds to alpha 0.
- *
+ *
* @param g
- * The Graphics used to paint
+ * The Graphics used to paint
* @since 1.2
*/
protected void applyTransparency(Graphics g) {
g.setAlpha(255 - transparency * 255 / 100);
}
+ @Override
public void setText(String text) {
- if(constraintContent != null) {
+ if (constraintContent != null) {
constraintContent.setText(LEFT_BRACE + text + RIGHT_BRACE);
}
}
+ @Override
public String getText() {
- if(constraintContent != null) {
+ if (constraintContent != null) {
return constraintContent.getText();
}
return null;
}
+ @Override
public void setIcon(Image icon) {
}
+ @Override
public Image getIcon() {
return null;
}
+ @Override
public Point getEditionLocation() {
- if(constraintContentContainer != null) {
+ if (constraintContentContainer != null) {
return constraintContentContainer.getLocation();
}
return null;
}
/**
- * @see org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusUMLElementFigure#setStereotypeDisplay(java.lang.String,
- * org.eclipse.swt.graphics.Image)
- *
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusUMLElementFigure#setStereotypeDisplay(java.lang.String, org.eclipse.swt.graphics.Image)
+ *
* @param stereotypes
* @param image
*/
+ @Override
public void setStereotypeDisplay(String stereotypes, Image image) {
- if(stereotypes == null || stereotypes.trim().equals("")) {
- if(stereotypesLabel != null) {
+ if (stereotypes == null || stereotypes.trim().equals("")) {
+ if (stereotypesLabel != null) {
labelContainer.remove(stereotypesLabel);
}
stereotypesLabel = null;
} else {
- if(stereotypesLabel == null) {
+ if (stereotypesLabel == null) {
stereotypesLabel = new Label(stereotypes, image);
labelContainer.add(stereotypesLabel, 0);
} else {
@@ -448,18 +455,19 @@ public class CustomStateInvariantEditPart extends StateInvariantEditPart impleme
/**
* @see org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeUMLElementFigure#setStereotypePropertiesInBrace(java.lang.String)
- *
+ *
* @param stereotypeProperties
*/
+ @Override
public void setStereotypePropertiesInBrace(String stereotypeProperties) {
- if(stereotypeProperties == null || stereotypeProperties.trim().equals("")) {
- if(stereotypePropertiesLabel != null) {
+ if (stereotypeProperties == null || stereotypeProperties.trim().equals("")) {
+ if (stereotypePropertiesLabel != null) {
labelContainer.remove(stereotypePropertiesLabel);
}
stereotypePropertiesLabel = null;
} else {
- if(stereotypePropertiesLabel == null) {
+ if (stereotypePropertiesLabel == null) {
stereotypePropertiesLabel = new Label();
int index = labelContainer.getChildren().indexOf(stereotypesLabel);
labelContainer.add(stereotypePropertiesLabel, index + 1);
@@ -470,20 +478,22 @@ public class CustomStateInvariantEditPart extends StateInvariantEditPart impleme
/**
* @see org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeUMLElementFigure#setStereotypePropertiesInCompartment(java.lang.String)
- *
+ *
* @param stereotypeProperties
*/
+ @Override
public void setStereotypePropertiesInCompartment(String stereotypeProperties) {
}
/**
* @see org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeUMLElementFigure#getStereotypesLabel()
- *
+ *
* @return
*/
+ @Override
public Label getStereotypesLabel() {
return stereotypesLabel;
}
@@ -495,6 +505,7 @@ public class CustomStateInvariantEditPart extends StateInvariantEditPart impleme
super(parentFigure, location);
}
+ @Override
public void relocate(IFigure borderItem) {
Point constraintLocation = getConstraint().getLocation();
Dimension size = getSize(borderItem);
@@ -502,6 +513,7 @@ public class CustomStateInvariantEditPart extends StateInvariantEditPart impleme
borderItem.setBounds(new Rectangle(ptNewLocation, size));
}
+ @Override
public Rectangle getValidLocation(Rectangle proposedLocation, IFigure borderItem) {
Rectangle realLocation = new Rectangle(proposedLocation);
Point point = new Point(getParentBorder().getCenter().x - realLocation.getSize().width / 2, realLocation.y);
@@ -512,38 +524,42 @@ public class CustomStateInvariantEditPart extends StateInvariantEditPart impleme
public static class StateInvariantResizableEditPolicy extends BorderItemResizableEditPolicy {
+ @Override
protected Command getResizeCommand(ChangeBoundsRequest request) {
- IBorderItemEditPart borderItemEP = (IBorderItemEditPart)getHost();
+ IBorderItemEditPart borderItemEP = (IBorderItemEditPart) getHost();
IBorderItemLocator borderItemLocator = borderItemEP.getBorderItemLocator();
- if(borderItemLocator != null) {
+ if (borderItemLocator != null) {
PrecisionRectangle rect = new PrecisionRectangle(getInitialFeedbackBounds().getCopy());
getHostFigure().translateToAbsolute(rect);
rect.translate(request.getMoveDelta());
rect.resize(request.getSizeDelta());
getHostFigure().translateToRelative(rect);
Rectangle realLocation = borderItemLocator.getValidLocation(rect.getCopy(), borderItemEP.getFigure());
- if(borderItemEP.getParent() instanceof LifelineEditPart && !restrictInParentBounds((LifelineEditPart)borderItemEP.getParent(), borderItemEP, realLocation.getCopy()))
+ if (borderItemEP.getParent() instanceof LifelineEditPart && !restrictInParentBounds((LifelineEditPart) borderItemEP.getParent(), borderItemEP, realLocation.getCopy())) {
return null;
- ICommand moveCommand = new SetBoundsCommand(borderItemEP.getEditingDomain(), DiagramUIMessages.Commands_MoveElement, new EObjectAdapter((View)getHost().getModel()), realLocation);
+ }
+ ICommand moveCommand = new SetBoundsCommand(borderItemEP.getEditingDomain(), DiagramUIMessages.Commands_MoveElement, new EObjectAdapter((View) getHost().getModel()), realLocation);
return new ICommandProxy(moveCommand);
}
return null;
}
+ @Override
protected Command getMoveCommand(ChangeBoundsRequest request) {
- IBorderItemEditPart borderItemEP = (IBorderItemEditPart)getHost();
+ IBorderItemEditPart borderItemEP = (IBorderItemEditPart) getHost();
IBorderItemLocator borderItemLocator = borderItemEP.getBorderItemLocator();
- if(borderItemLocator != null) {
+ if (borderItemLocator != null) {
PrecisionRectangle rect = new PrecisionRectangle(getInitialFeedbackBounds().getCopy());
getHostFigure().translateToAbsolute(rect);
rect.translate(request.getMoveDelta());
rect.resize(request.getSizeDelta());
getHostFigure().translateToRelative(rect);
Rectangle realLocation = borderItemLocator.getValidLocation(rect.getCopy(), borderItemEP.getFigure());
- if(borderItemEP.getParent() instanceof LifelineEditPart && !restrictInParentBounds((LifelineEditPart)borderItemEP.getParent(), borderItemEP, realLocation.getCopy()))
+ if (borderItemEP.getParent() instanceof LifelineEditPart && !restrictInParentBounds((LifelineEditPart) borderItemEP.getParent(), borderItemEP, realLocation.getCopy())) {
return null;
+ }
Point location = realLocation.getTopLeft();
- ICommand moveCommand = new SetBoundsCommand(borderItemEP.getEditingDomain(), DiagramUIMessages.Commands_MoveElement, new EObjectAdapter((View)getHost().getModel()), location);
+ ICommand moveCommand = new SetBoundsCommand(borderItemEP.getEditingDomain(), DiagramUIMessages.Commands_MoveElement, new EObjectAdapter((View) getHost().getModel()), location);
return new ICommandProxy(moveCommand);
}
return null;
@@ -554,10 +570,12 @@ public class CustomStateInvariantEditPart extends StateInvariantEditPart impleme
Rectangle bounds = ep.getPrimaryShape().getBounds().getCopy();
ep.getPrimaryShape().translateToAbsolute(bounds);
int nameHeight = ep.getPrimaryShape().getFigureLifelineNameContainerFigure().getBounds().height;
- if(realLocation.y - nameHeight < bounds.y)
+ if (realLocation.y - nameHeight < bounds.y) {
return false;
- if(realLocation.getBottom().y > bounds.getBottom().y)
+ }
+ 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/CustomStateInvariantLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomStateInvariantLabelEditPart.java
index 394aaffd597..8f4a56b5b46 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomStateInvariantLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomStateInvariantLabelEditPart.java
@@ -15,10 +15,11 @@ public class CustomStateInvariantLabelEditPart extends StateInvariantLabelEditPa
super(view);
}
+ @Override
protected EObject getParserElement() {
EObject element = resolveSemanticElement();
- if(element instanceof StateInvariant) {
- return ((StateInvariant)element).getInvariant();
+ if (element instanceof StateInvariant) {
+ return ((StateInvariant) element).getInvariant();
}
return element;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeConstraintAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeConstraintAppliedStereotypeEditPart.java
index bf59a12f4cf..5d6dc66464a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeConstraintAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeConstraintAppliedStereotypeEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -31,7 +31,7 @@ public class CustomTimeConstraintAppliedStereotypeEditPart extends TimeConstrain
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomTimeConstraintAppliedStereotypeEditPart(View view) {
@@ -41,19 +41,21 @@ public class CustomTimeConstraintAppliedStereotypeEditPart extends TimeConstrain
/**
* @Override
*/
+ @Override
public IFigure getPrimaryShape() {
return getFigure();
}
+ @Override
protected void refreshLabel() {
- //We do NOT want to update label with the Parser.
+ // We do NOT want to update label with the Parser.
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -63,7 +65,7 @@ public class CustomTimeConstraintAppliedStereotypeEditPart extends TimeConstrain
removeEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY);
View stereotypeChangedView = null;
View view = getPrimaryView();
- if(view != null) {
+ if (view != null) {
stereotypeChangedView = ViewUtil.getChildBySemanticHint(view, UMLVisualIDRegistry.getType(TimeConstraintLabelEditPart.VISUAL_ID));
}
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeExternalNodeLabelEditPolicy(stereotypeChangedView));
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 d15bf1efc50..a70c4f77f64 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -57,7 +57,7 @@ public class CustomTimeConstraintEditPart extends TimeConstraintEditPart {
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomTimeConstraintEditPart(View view) {
@@ -82,15 +82,15 @@ public class CustomTimeConstraintEditPart extends TimeConstraintEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case TimeConstraintLabelEditPart.VISUAL_ID:
case TimeConstraintAppliedStereotypeEditPart.VISUAL_ID:
// use ExternalLabelPrimaryDragRoleEditPolicy
return new ExternalLabelPrimaryDragRoleEditPolicy();
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -111,9 +111,9 @@ public class CustomTimeConstraintEditPart extends TimeConstraintEditPart {
/**
* This method creates a specific edit policy for time realted elements
- *
+ *
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderItemEditPart#getPrimaryDragEditPolicy()
- *
+ *
* @return <code>EditPolicy</code>
* @Override
*/
@@ -127,8 +127,8 @@ public class CustomTimeConstraintEditPart extends TimeConstraintEditPart {
*/
@Override
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof TimeConstraintLabelEditPart || borderItemEditPart instanceof TimeConstraintAppliedStereotypeEditPart) {
- //use ExternalLabelPositionLocator
+ if (borderItemEditPart instanceof TimeConstraintLabelEditPart || borderItemEditPart instanceof TimeConstraintAppliedStereotypeEditPart) {
+ // use ExternalLabelPositionLocator
IBorderItemLocator locator = new ExternalLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -147,12 +147,12 @@ public class CustomTimeConstraintEditPart extends TimeConstraintEditPart {
* Instead, we shall use the correct default size.
*/
DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(TimeConstraintFigure.TIME_MARK_LENGTH, 1);
- //String prefElementId = "TimeConstraint";
- //IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- //String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferencesConstantsHelper.WIDTH);
- //String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferencesConstantsHelper.HEIGHT);
- //DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
- //FIXME: workaround for #154536
+ // String prefElementId = "TimeConstraint";
+ // IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
+ // String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferencesConstantsHelper.WIDTH);
+ // String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferencesConstantsHelper.HEIGHT);
+ // DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
+ // FIXME: workaround for #154536
result.getBounds().setSize(result.getPreferredSize());
return result;
}
@@ -162,7 +162,7 @@ public class CustomTimeConstraintEditPart extends TimeConstraintEditPart {
*/
@Override
public Command getCommand(Request request) {
- if(request instanceof CreateUnspecifiedTypeRequest) {
+ if (request instanceof CreateUnspecifiedTypeRequest) {
return getParent().getCommand(request);
}
return super.getCommand(request);
@@ -173,7 +173,7 @@ public class CustomTimeConstraintEditPart extends TimeConstraintEditPart {
*/
@Override
public void showSourceFeedback(Request request) {
- if(request instanceof CreateUnspecifiedTypeRequest) {
+ if (request instanceof CreateUnspecifiedTypeRequest) {
getParent().showSourceFeedback(request);
}
super.showSourceFeedback(request);
@@ -184,7 +184,7 @@ public class CustomTimeConstraintEditPart extends TimeConstraintEditPart {
*/
@Override
public void eraseSourceFeedback(Request request) {
- if(request instanceof CreateUnspecifiedTypeRequest) {
+ if (request instanceof CreateUnspecifiedTypeRequest) {
getParent().eraseSourceFeedback(request);
}
super.eraseSourceFeedback(request);
@@ -192,7 +192,7 @@ public class CustomTimeConstraintEditPart extends TimeConstraintEditPart {
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeConstraintEditPart#createNodeShape()
- *
+ *
* @return
*/
@Override
@@ -202,54 +202,54 @@ public class CustomTimeConstraintEditPart extends TimeConstraintEditPart {
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeConstraintEditPart#getPrimaryShape()
- *
+ *
* @return
*/
@Override
public TimeConstraintFigure getPrimaryShape() {
- return (TimeConstraintFigure)primaryShape;
+ return (TimeConstraintFigure) primaryShape;
}
public class TimeConstraintFigure extends TimeMarkElementFigure {
/**
* the length of the time mark
- *
+ *
*/
private static final int TIME_MARK_LENGTH = 20;
/**
* The side where the figure currently is
- *
+ *
*/
private int sideOfFigure = PositionConstants.NONE;
/**
* Update the side of the lifeline where the figure lies
- *
+ *
* @param side
- * side where the figure must be
+ * side where the figure must be
* @param newLocation
- * the new location rectangle
+ * the new location rectangle
* @generated NOT
*/
public void setCurrentSideOfFigure(int side, Rectangle newLocation) {
// no effect if side has not changed
- if(sideOfFigure != side && !(PositionConstants.NONE == sideOfFigure && side == PositionConstants.EAST)) {
+ if (sideOfFigure != side && !(PositionConstants.NONE == sideOfFigure && side == PositionConstants.EAST)) {
// mirror the label too
IGraphicalEditPart labelChild = getChildBySemanticHint(UMLVisualIDRegistry.getType(TimeConstraintLabelEditPart.VISUAL_ID));
- if(labelChild instanceof TimeConstraintLabelEditPart) {
- TimeConstraintLabelEditPart label = (TimeConstraintLabelEditPart)labelChild;
+ if (labelChild instanceof TimeConstraintLabelEditPart) {
+ TimeConstraintLabelEditPart label = (TimeConstraintLabelEditPart) labelChild;
int labelWidth = label.getFigure().getMinimumSize().width;
- if(label.getNotationView() instanceof Node) {
- LayoutConstraint constraint = ((Node)label.getNotationView()).getLayoutConstraint();
+ if (label.getNotationView() instanceof Node) {
+ LayoutConstraint constraint = ((Node) label.getNotationView()).getLayoutConstraint();
// update model location constraint for persisting the mirror effect
- if(constraint instanceof Location) {
- int xLocation = ((Location)constraint).getX();
+ if (constraint instanceof Location) {
+ int xLocation = ((Location) constraint).getX();
int mirroredLocation = -xLocation - labelWidth;
TransactionalEditingDomain dom = getEditingDomain();
org.eclipse.emf.common.command.Command setCmd = SetCommand.create(dom, constraint, NotationPackage.eINSTANCE.getLocation_X(), mirroredLocation);
- TransactionalCommandStack stack = (TransactionalCommandStack)dom.getCommandStack();
+ TransactionalCommandStack stack = (TransactionalCommandStack) dom.getCommandStack();
Map<String, Boolean> options = new HashMap<String, Boolean>();
options.put(Transaction.OPTION_NO_NOTIFICATIONS, true);
options.put(Transaction.OPTION_NO_UNDO, true);
@@ -258,7 +258,7 @@ public class CustomTimeConstraintEditPart extends TimeConstraintEditPart {
stack.execute(setCmd, options);
// then, update graphically for short time effect
IBorderItemLocator locator = label.getBorderItemLocator();
- Rectangle constrRect = ((ExternalLabelPositionLocator)locator).getConstraint();
+ Rectangle constrRect = ((ExternalLabelPositionLocator) locator).getConstraint();
constrRect.x = mirroredLocation;
locator.relocate(label.getFigure());
} catch (InterruptedException e) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeConstraintLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeConstraintLabelEditPart.java
index 1814d0e4c88..484155c1e76 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeConstraintLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeConstraintLabelEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -24,14 +24,14 @@ import org.eclipse.papyrus.uml.diagram.stereotype.edition.editpolicies.AppliedSt
/**
* Support displaying Stereotype as a Comment Node for TimeConstraint.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class CustomTimeConstraintLabelEditPart extends TimeConstraintLabelEditPart implements IPapyrusEditPart {
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomTimeConstraintLabelEditPart(View view) {
@@ -40,10 +40,11 @@ public class CustomTimeConstraintLabelEditPart extends TimeConstraintLabelEditPa
/**
* @see org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart#getPrimaryShape()
- *
+ *
* @return
*/
+ @Override
public IFigure getPrimaryShape() {
return getFigure();
}
@@ -52,7 +53,7 @@ public class CustomTimeConstraintLabelEditPart extends TimeConstraintLabelEditPa
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.CONNECTION_HANDLES_ROLE, new CustomConnectionHandleEditPolicy());
- //install a editpolicy to display stereotypes
+ // install a editpolicy to display stereotypes
installEditPolicy(AppliedStereotypeCommentCreationEditPolicy.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/CustomTimeObservationAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeObservationAppliedStereotypeEditPart.java
index 7efe246c372..db4261ea3bb 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeObservationAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeObservationAppliedStereotypeEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -32,7 +32,7 @@ public class CustomTimeObservationAppliedStereotypeEditPart extends TimeObservat
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomTimeObservationAppliedStereotypeEditPart(View view) {
@@ -42,6 +42,7 @@ public class CustomTimeObservationAppliedStereotypeEditPart extends TimeObservat
/**
* @Override
*/
+ @Override
public IFigure getPrimaryShape() {
return getFigure();
}
@@ -51,15 +52,16 @@ public class CustomTimeObservationAppliedStereotypeEditPart extends TimeObservat
return null;
}
+ @Override
protected void refreshLabel() {
- //We do NOT want to update label with the Parser.
+ // We do NOT want to update label with the Parser.
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -69,7 +71,7 @@ public class CustomTimeObservationAppliedStereotypeEditPart extends TimeObservat
removeEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY);
View stereotypeChangedView = null;
View view = getPrimaryView();
- if(view != null) {
+ if (view != null) {
stereotypeChangedView = ViewUtil.getChildBySemanticHint(view, UMLVisualIDRegistry.getType(TimeObservationLabelEditPart.VISUAL_ID));
}
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeExternalNodeLabelEditPolicy(stereotypeChangedView));
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 57a7cd2c064..055057f1c8f 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -57,7 +57,7 @@ public class CustomTimeObservationEditPart extends TimeObservationEditPart {
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomTimeObservationEditPart(View view) {
@@ -77,9 +77,9 @@ public class CustomTimeObservationEditPart extends TimeObservationEditPart {
/**
* This method creates a specific edit policy for time realted elements
- *
+ *
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderItemEditPart#getPrimaryDragEditPolicy()
- *
+ *
* @return <code>EditPolicy</code>
* @Override
*/
@@ -97,15 +97,15 @@ public class CustomTimeObservationEditPart extends TimeObservationEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case TimeObservationLabelEditPart.VISUAL_ID:
case TimeObservationAppliedStereotypeEditPart.VISUAL_ID:
// use ExternalLabelPrimaryDragRoleEditPolicy
return new CustomExternalLabelPrimaryDragRoleEditPolicy();
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -129,8 +129,8 @@ public class CustomTimeObservationEditPart extends TimeObservationEditPart {
*/
@Override
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof TimeObservationLabelEditPart || borderItemEditPart instanceof TimeObservationAppliedStereotypeEditPart) {
- //use ExternalLabelPositionLocator
+ if (borderItemEditPart instanceof TimeObservationLabelEditPart || borderItemEditPart instanceof TimeObservationAppliedStereotypeEditPart) {
+ // use ExternalLabelPositionLocator
IBorderItemLocator locator = new ExternalLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -148,14 +148,14 @@ public class CustomTimeObservationEditPart extends TimeObservationEditPart {
* Bypass the preference mechanism which finally returns an incoherent constant hard written in NodePreferencePage.xpt templates.
* Instead, we shall use the correct default size.
*/
- //DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(TimeMarkElementFigure.TIME_MARK_LENGTH, 1);
- //String prefElementId = "TimeObservation";
- //IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- //String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferencesConstantsHelper.WIDTH);
- //String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferencesConstantsHelper.HEIGHT);
- //DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
- //FIXME: workaround for #154536
- //result.getBounds().setSize(result.getPreferredSize());
+ // DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(TimeMarkElementFigure.TIME_MARK_LENGTH, 1);
+ // String prefElementId = "TimeObservation";
+ // IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
+ // String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferencesConstantsHelper.WIDTH);
+ // String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferencesConstantsHelper.HEIGHT);
+ // DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
+ // FIXME: workaround for #154536
+ // result.getBounds().setSize(result.getPreferredSize());
NodeFigure result = new NodeFigure();
return result;
}
@@ -165,7 +165,7 @@ public class CustomTimeObservationEditPart extends TimeObservationEditPart {
*/
@Override
public Command getCommand(Request request) {
- if(request instanceof CreateUnspecifiedTypeRequest) {
+ if (request instanceof CreateUnspecifiedTypeRequest) {
return getParent().getCommand(request);
}
return super.getCommand(request);
@@ -176,7 +176,7 @@ public class CustomTimeObservationEditPart extends TimeObservationEditPart {
*/
@Override
public void showSourceFeedback(Request request) {
- if(request instanceof CreateUnspecifiedTypeRequest) {
+ if (request instanceof CreateUnspecifiedTypeRequest) {
getParent().showSourceFeedback(request);
}
super.showSourceFeedback(request);
@@ -187,7 +187,7 @@ public class CustomTimeObservationEditPart extends TimeObservationEditPart {
*/
@Override
public void eraseSourceFeedback(Request request) {
- if(request instanceof CreateUnspecifiedTypeRequest) {
+ if (request instanceof CreateUnspecifiedTypeRequest) {
getParent().eraseSourceFeedback(request);
}
super.eraseSourceFeedback(request);
@@ -195,7 +195,7 @@ public class CustomTimeObservationEditPart extends TimeObservationEditPart {
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeObservationEditPart#createNodeShape()
- *
+ *
* @return
*/
@Override
@@ -205,31 +205,31 @@ public class CustomTimeObservationEditPart extends TimeObservationEditPart {
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeObservationEditPart#getPrimaryShape()
- *
+ *
* @return
*/
@Override
public TimeObservationFigure getPrimaryShape() {
- return (TimeObservationFigure)primaryShape;
+ return (TimeObservationFigure) primaryShape;
}
public class TimeObservationFigure extends TimeMarkElementFigure {
/**
* the length of the time mark
- *
+ *
*/
private static final int TIME_MARK_LENGTH = 20;
/**
* The side where the figure currently is
- *
+ *
*/
private int sideOfFigure = PositionConstants.NONE;
/**
* Constructor.
- *
+ *
*/
public TimeObservationFigure() {
removeAllPoints();
@@ -237,30 +237,30 @@ public class CustomTimeObservationEditPart extends TimeObservationEditPart {
/**
* Update the side of the lifeline where the figure lies
- *
+ *
* @param side
- * side where the figure must be
+ * side where the figure must be
* @param newLocation
- * the new location rectangle
+ * the new location rectangle
* @generated NOT
*/
public void setCurrentSideOfFigure(int side, Rectangle newLocation) {
// no effect if side has not changed or side is set to default one
- if(sideOfFigure != side && !(PositionConstants.NONE == sideOfFigure && side == PositionConstants.EAST)) {
+ if (sideOfFigure != side && !(PositionConstants.NONE == sideOfFigure && side == PositionConstants.EAST)) {
// mirror the label too
IGraphicalEditPart labelChild = getChildBySemanticHint(UMLVisualIDRegistry.getType(TimeObservationLabelEditPart.VISUAL_ID));
- if(labelChild instanceof TimeObservationLabelEditPart) {
- TimeObservationLabelEditPart label = (TimeObservationLabelEditPart)labelChild;
+ if (labelChild instanceof TimeObservationLabelEditPart) {
+ TimeObservationLabelEditPart label = (TimeObservationLabelEditPart) labelChild;
int labelWidth = label.getFigure().getMinimumSize().width;
- if(label.getNotationView() instanceof Node) {
- LayoutConstraint constraint = ((Node)label.getNotationView()).getLayoutConstraint();
+ if (label.getNotationView() instanceof Node) {
+ LayoutConstraint constraint = ((Node) label.getNotationView()).getLayoutConstraint();
// update model location constraint for persisting the mirror effect
- if(constraint instanceof Location) {
- int xLocation = ((Location)constraint).getX();
+ if (constraint instanceof Location) {
+ int xLocation = ((Location) constraint).getX();
int mirroredLocation = -xLocation - labelWidth;
TransactionalEditingDomain dom = getEditingDomain();
org.eclipse.emf.common.command.Command setCmd = SetCommand.create(dom, constraint, NotationPackage.eINSTANCE.getLocation_X(), mirroredLocation);
- TransactionalCommandStack stack = (TransactionalCommandStack)dom.getCommandStack();
+ TransactionalCommandStack stack = (TransactionalCommandStack) dom.getCommandStack();
Map<String, Boolean> options = new HashMap<String, Boolean>();
options.put(Transaction.OPTION_NO_NOTIFICATIONS, true);
options.put(Transaction.OPTION_NO_UNDO, true);
@@ -269,7 +269,7 @@ public class CustomTimeObservationEditPart extends TimeObservationEditPart {
stack.execute(setCmd, options);
// then, update graphically for short time effect
IBorderItemLocator locator = label.getBorderItemLocator();
- Rectangle constrRect = ((ExternalLabelPositionLocator)locator).getConstraint();
+ Rectangle constrRect = ((ExternalLabelPositionLocator) locator).getConstraint();
constrRect.x = mirroredLocation;
locator.relocate(label.getFigure());
} catch (InterruptedException e) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeObservationLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeObservationLabelEditPart.java
index e91e09df835..29a702f428b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeObservationLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeObservationLabelEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -53,14 +53,14 @@ import org.eclipse.swt.graphics.Image;
/**
* Add implementing IPapyrusEditPart to support displaying Stereotype as a Comment, because the label is always selected when a TimeObservation is
* selected.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class CustomTimeObservationLabelEditPart extends TimeObservationLabelEditPart implements INodeEditPart, IPapyrusEditPart {
/**
* Constructor.
- *
+ *
* @param view
*/
public CustomTimeObservationLabelEditPart(View view) {
@@ -74,7 +74,7 @@ public class CustomTimeObservationLabelEditPart extends TimeObservationLabelEdit
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.CONNECTION_HANDLES_ROLE, new CustomConnectionHandleEditPolicy());
- //install a editpolicy to display stereotypes
+ // install a editpolicy to display stereotypes
installEditPolicy(AppliedStereotypeCommentCreationEditPolicy.APPLIED_STEREOTYPE_COMMENT, new AppliedStereotypeCommentCreationEditPolicyEx());
}
@@ -83,7 +83,7 @@ public class CustomTimeObservationLabelEditPart extends TimeObservationLabelEdit
*/
@Override
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof NodeFigure && getWrappingLabel(figure) != null) {
+ if (figure instanceof NodeFigure && getWrappingLabel(figure) != null) {
return getWrappingLabel(figure).getText();
}
return super.getLabelTextHelper(figure);
@@ -94,7 +94,7 @@ public class CustomTimeObservationLabelEditPart extends TimeObservationLabelEdit
*/
@Override
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof NodeFigure && getWrappingLabel(figure) != null) {
+ if (figure instanceof NodeFigure && getWrappingLabel(figure) != null) {
getWrappingLabel(figure).setText(text);
} else {
super.setLabelTextHelper(figure, text);
@@ -106,7 +106,7 @@ public class CustomTimeObservationLabelEditPart extends TimeObservationLabelEdit
*/
@Override
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof NodeFigure && getWrappingLabel(figure) != null) {
+ if (figure instanceof NodeFigure && getWrappingLabel(figure) != null) {
return getWrappingLabel(figure).getIcon();
} else {
return super.getLabelIconHelper(figure);
@@ -118,7 +118,7 @@ public class CustomTimeObservationLabelEditPart extends TimeObservationLabelEdit
*/
@Override
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof NodeFigure && getWrappingLabel(figure) != null) {
+ if (figure instanceof NodeFigure && getWrappingLabel(figure) != null) {
getWrappingLabel(figure).setIcon(icon);
} else {
super.setLabelIconHelper(figure, icon);
@@ -131,12 +131,12 @@ public class CustomTimeObservationLabelEditPart extends TimeObservationLabelEdit
@Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getView_SourceEdges().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getView_SourceEdges().equals(feature)) {
refreshSourceConnections();
- } else if(NotationPackage.eINSTANCE.getView_TargetEdges().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getView_TargetEdges().equals(feature)) {
refreshTargetConnections();
}
- if(ElementIconUtil.isIconNotification(event)) {
+ if (ElementIconUtil.isIconNotification(event)) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -162,47 +162,50 @@ public class CustomTimeObservationLabelEditPart extends TimeObservationLabelEdit
}
protected WrappingLabel getWrappingLabel(IFigure nodeFigure) {
- if(nodeFigure instanceof NodeFigure) {
- return ((WrappingLabel)(nodeFigure.getChildren().get(0)));
+ if (nodeFigure instanceof NodeFigure) {
+ return ((WrappingLabel) (nodeFigure.getChildren().get(0)));
}
return null;
}
- //Fix https://bugs.eclipse.org/bugs/show_bug.cgi?id=364826
+ // Fix https://bugs.eclipse.org/bugs/show_bug.cgi?id=364826
@Override
protected List getModelSourceConnections() {
- return ViewUtil.getSourceConnectionsConnectingVisibleViews((View)getModel());
+ return ViewUtil.getSourceConnectionsConnectingVisibleViews((View) getModel());
}
@Override
protected List getModelTargetConnections() {
- List list = ViewUtil.getTargetConnectionsConnectingVisibleViews((View)getModel());
+ List list = ViewUtil.getTargetConnectionsConnectingVisibleViews((View) getModel());
return list;
}
+ @Override
public ConnectionAnchor getSourceConnectionAnchor(Request request) {
- if(request instanceof ReconnectRequest) {
- if(((DropRequest)request).getLocation() == null) {
- return ((NodeFigure)getFigure()).getSourceConnectionAnchorAt(null);
+ if (request instanceof ReconnectRequest) {
+ if (((DropRequest) request).getLocation() == null) {
+ return ((NodeFigure) getFigure()).getSourceConnectionAnchorAt(null);
}
- Point pt = ((DropRequest)request).getLocation().getCopy();
- return ((NodeFigure)getFigure()).getSourceConnectionAnchorAt(pt);
- } else if(request instanceof DropRequest) {
- return ((NodeFigure)getFigure()).getSourceConnectionAnchorAt(((DropRequest)request).getLocation());
+ Point pt = ((DropRequest) request).getLocation().getCopy();
+ return ((NodeFigure) getFigure()).getSourceConnectionAnchorAt(pt);
+ } else if (request instanceof DropRequest) {
+ return ((NodeFigure) getFigure()).getSourceConnectionAnchorAt(((DropRequest) request).getLocation());
}
- return ((NodeFigure)getFigure()).getSourceConnectionAnchorAt(null);
+ return ((NodeFigure) getFigure()).getSourceConnectionAnchorAt(null);
}
+ @Override
public ConnectionAnchor getSourceConnectionAnchor(ConnectionEditPart connEditPart) {
- final org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart connection = (org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart)connEditPart;
+ final org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart connection = (org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart) connEditPart;
String t = ""; //$NON-NLS-1$
try {
- t = (String)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ t = (String) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- Anchor a = ((Edge)connection.getModel()).getSourceAnchor();
- if(a instanceof IdentityAnchor) {
- setResult(((IdentityAnchor)a).getId());
+ Anchor a = ((Edge) connection.getModel()).getSourceAnchor();
+ if (a instanceof IdentityAnchor) {
+ setResult(((IdentityAnchor) a).getId());
} else {
setResult(""); //$NON-NLS-1$
}
@@ -212,19 +215,21 @@ public class CustomTimeObservationLabelEditPart extends TimeObservationLabelEdit
Trace.catching(DiagramUIPlugin.getInstance(), DiagramUIDebugOptions.EXCEPTIONS_CATCHING, getClass(), "getSourceConnectionAnchor", e); //$NON-NLS-1$
Log.error(DiagramUIPlugin.getInstance(), DiagramUIStatusCodes.IGNORED_EXCEPTION_WARNING, "getSourceConnectionAnchor", e); //$NON-NLS-1$
}
- return ((NodeFigure)getFigure()).getConnectionAnchor(t);
+ return ((NodeFigure) getFigure()).getConnectionAnchor(t);
}
+ @Override
public ConnectionAnchor getTargetConnectionAnchor(ConnectionEditPart connEditPart) {
- final org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart connection = (org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart)connEditPart;
+ final org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart connection = (org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart) connEditPart;
String t = ""; //$NON-NLS-1$
try {
- t = (String)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ t = (String) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- Anchor a = ((Edge)connection.getModel()).getTargetAnchor();
- if(a instanceof IdentityAnchor) {
- setResult(((IdentityAnchor)a).getId());
+ Anchor a = ((Edge) connection.getModel()).getTargetAnchor();
+ if (a instanceof IdentityAnchor) {
+ setResult(((IdentityAnchor) a).getId());
} else {
setResult(""); //$NON-NLS-1$
}
@@ -234,37 +239,41 @@ public class CustomTimeObservationLabelEditPart extends TimeObservationLabelEdit
Trace.catching(DiagramUIPlugin.getInstance(), DiagramUIDebugOptions.EXCEPTIONS_CATCHING, getClass(), "getTargetConnectionAnchor", e); //$NON-NLS-1$
Log.error(DiagramUIPlugin.getInstance(), DiagramUIStatusCodes.IGNORED_EXCEPTION_WARNING, "getTargetConnectionAnchor", e); //$NON-NLS-1$
}
- return ((NodeFigure)getFigure()).getConnectionAnchor(t);
+ return ((NodeFigure) getFigure()).getConnectionAnchor(t);
}
+ @Override
public ConnectionAnchor getTargetConnectionAnchor(Request request) {
- if(request instanceof ReconnectRequest) {
- if(((DropRequest)request).getLocation() == null) {
- return ((NodeFigure)getFigure()).getTargetConnectionAnchorAt(null);
+ if (request instanceof ReconnectRequest) {
+ if (((DropRequest) request).getLocation() == null) {
+ return ((NodeFigure) getFigure()).getTargetConnectionAnchorAt(null);
}
- Point pt = ((DropRequest)request).getLocation().getCopy();
- return ((NodeFigure)getFigure()).getTargetConnectionAnchorAt(pt);
- } else if(request instanceof DropRequest) {
- return ((NodeFigure)getFigure()).getTargetConnectionAnchorAt(((DropRequest)request).getLocation());
+ Point pt = ((DropRequest) request).getLocation().getCopy();
+ return ((NodeFigure) getFigure()).getTargetConnectionAnchorAt(pt);
+ } else if (request instanceof DropRequest) {
+ return ((NodeFigure) getFigure()).getTargetConnectionAnchorAt(((DropRequest) request).getLocation());
}
- return ((NodeFigure)getFigure()).getTargetConnectionAnchorAt(null);
+ return ((NodeFigure) getFigure()).getTargetConnectionAnchorAt(null);
}
+ @Override
public String mapConnectionAnchorToTerminal(ConnectionAnchor c) {
- return ((NodeFigure)getFigure()).getConnectionAnchorTerminal(c);
+ return ((NodeFigure) getFigure()).getConnectionAnchorTerminal(c);
}
+ @Override
public ConnectionAnchor mapTerminalToConnectionAnchor(String terminal) {
- return ((NodeFigure)getFigure()).getConnectionAnchor(terminal);
+ return ((NodeFigure) getFigure()).getConnectionAnchor(terminal);
}
+ @Override
public boolean canAttachNote() {
return true;
}
@Override
protected Image getLabelIcon() {
- if(AppearanceHelper.showElementIcon(getNotationView())) {
+ if (AppearanceHelper.showElementIcon(getNotationView())) {
return UMLElementTypes.getImage(resolveSemanticElement().eClass());
}
return null;
@@ -273,13 +282,14 @@ public class CustomTimeObservationLabelEditPart extends TimeObservationLabelEdit
@Override
public void refreshBounds() {
super.refreshBounds();
- //Update location manually.
+ // Update location manually.
IBorderItemLocator locator = getBorderItemLocator();
- if(locator != null) {
+ if (locator != null) {
locator.relocate(getFigure());
}
}
+ @Override
public IFigure getPrimaryShape() {
return getFigure();
}
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 8bb338715d7..4d94ccf4fb3 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
@@ -105,10 +105,12 @@ public class ExecutionSpecificationEndEditPart extends GraphicalEditPart impleme
public ExecutionSpecificationEndEditPart(View view) {
super(view);
- if(view.getElement() instanceof OccurrenceSpecification)
- this.executionSpecificationEnd = (OccurrenceSpecification)view.getElement();
+ if (view.getElement() instanceof OccurrenceSpecification) {
+ this.executionSpecificationEnd = (OccurrenceSpecification) view.getElement();
+ }
}
+ @Override
public void setParent(EditPart parent) {
super.setParent(parent);
initLocator();
@@ -131,9 +133,9 @@ public class ExecutionSpecificationEndEditPart extends GraphicalEditPart impleme
@Override
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getView_SourceEdges().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getView_SourceEdges().equals(feature)) {
refreshSourceConnections();
- } else if(NotationPackage.eINSTANCE.getView_TargetEdges().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getView_TargetEdges().equals(feature)) {
refreshTargetConnections();
} else {
super.handleNotificationEvent(notification);
@@ -142,16 +144,18 @@ public class ExecutionSpecificationEndEditPart extends GraphicalEditPart impleme
@Override
protected void addNotationalListeners() {
- if(hasNotationView()) {
- addListenerFilter("View", this, (View)getModel());
+ if (hasNotationView()) {
+ addListenerFilter("View", this, (View) getModel());
}
}
static class DummyCommand extends org.eclipse.emf.common.command.AbstractCommand {
+ @Override
public void execute() {
}
+ @Override
public void redo() {
}
@@ -179,7 +183,7 @@ public class ExecutionSpecificationEndEditPart extends GraphicalEditPart impleme
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.
+ // 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() {
@@ -198,26 +202,27 @@ public class ExecutionSpecificationEndEditPart extends GraphicalEditPart impleme
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.
+ // 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);
}
public void rebuildLinks(Diagram diagram) {
helper.collectViews(diagram);
- if(executionSpecificationEnd == null)
+ if (executionSpecificationEnd == null) {
return;
+ }
EAnnotation annotation = executionSpecificationEnd.getEAnnotation("Connections");
- if(annotation != null) {
- for(EObject eo : annotation.getReferences()) {
+ 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();
- for(Object o : edges) {
- if(o instanceof Edge) {
- if(needRestoreLink((Edge)o)) {
- restoreEdgeTarget((Edge)o);
+ for (Object o : edges) {
+ if (o instanceof Edge) {
+ if (needRestoreLink((Edge) o)) {
+ restoreEdgeTarget((Edge) o);
break;
}
}
@@ -232,21 +237,22 @@ public class ExecutionSpecificationEndEditPart extends GraphicalEditPart impleme
@Override
public void execute() {
View view = getNotationView();
- ViewUtil.destroy(view);;
+ ViewUtil.destroy(view);
+ ;
}
}, true);
}
private boolean needRestoreLink(Edge e) {
- if(e.getTarget() == null) {
+ if (e.getTarget() == null) {
return true;
}
EObject model = e.getTarget().getElement();
- if(!(model instanceof OccurrenceSpecification)) {
+ if (!(model instanceof OccurrenceSpecification)) {
return false;
}
- if(model == this.resolveSemanticElement()) {
- if(!this.getNotationView().equals(e.getTarget())) {
+ if (model == this.resolveSemanticElement()) {
+ if (!this.getNotationView().equals(e.getTarget())) {
return true;
}
}
@@ -258,7 +264,7 @@ public class ExecutionSpecificationEndEditPart extends GraphicalEditPart impleme
@Override
public void execute() {
- edge.setTarget((View)ExecutionSpecificationEndEditPart.this.getModel());
+ edge.setTarget((View) ExecutionSpecificationEndEditPart.this.getModel());
}
}, true);
}
@@ -278,13 +284,13 @@ public class ExecutionSpecificationEndEditPart extends GraphicalEditPart impleme
}
void collectViews(Diagram d) {
- if(diagram != d) { // compare pointer ref
+ if (diagram != d) { // compare pointer ref
diagram = d;
allViews.clear();
viewMaps.clear();
getAllNestedViews(diagram, allViews);
- for(View v : allViews) {
- if(v instanceof DecorationNode) {
+ for (View v : allViews) {
+ if (v instanceof DecorationNode) {
continue;
}
viewMaps.put(v.getElement(), v);
@@ -293,7 +299,7 @@ public class ExecutionSpecificationEndEditPart extends GraphicalEditPart impleme
}
static private void getAllNestedViews(View view, Set<View> allViews) {
- for(View childView : (List<View>)view.getChildren()) {
+ for (View childView : (List<View>) view.getChildren()) {
getAllNestedViews(childView, allViews);
allViews.add(childView);
}
@@ -317,23 +323,23 @@ public class ExecutionSpecificationEndEditPart extends GraphicalEditPart impleme
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
// adding new end
- if(request.getNewRelationshipEnd() instanceof OccurrenceSpecification) {
- ExecutionSpecificationEndHelper.addConnectionSourceToExecutionSpecificationEnd((OccurrenceSpecification)request.getNewRelationshipEnd(), request.getReferenceOwner());
+ if (request.getNewRelationshipEnd() instanceof OccurrenceSpecification) {
+ ExecutionSpecificationEndHelper.addConnectionSourceToExecutionSpecificationEnd((OccurrenceSpecification) request.getNewRelationshipEnd(), request.getReferenceOwner());
// update uml model reference
- if(request.getReferenceOwner() instanceof Constraint) {
- ((Constraint)request.getReferenceOwner()).getConstrainedElements().add((OccurrenceSpecification)request.getNewRelationshipEnd());
- } else if(request.getReferenceOwner() instanceof Comment) {
- ((Comment)request.getReferenceOwner()).getAnnotatedElements().add((OccurrenceSpecification)request.getNewRelationshipEnd());
+ if (request.getReferenceOwner() instanceof Constraint) {
+ ((Constraint) request.getReferenceOwner()).getConstrainedElements().add((OccurrenceSpecification) request.getNewRelationshipEnd());
+ } else if (request.getReferenceOwner() instanceof Comment) {
+ ((Comment) request.getReferenceOwner()).getAnnotatedElements().add((OccurrenceSpecification) request.getNewRelationshipEnd());
}
}
// removing old end
- if(request.getOldRelationshipEnd() instanceof OccurrenceSpecification) {
- ExecutionSpecificationEndHelper.removeConnectionSourceFromExecutionSpecificationEnd((OccurrenceSpecification)request.getOldRelationshipEnd(), request.getReferenceOwner());
+ if (request.getOldRelationshipEnd() instanceof OccurrenceSpecification) {
+ ExecutionSpecificationEndHelper.removeConnectionSourceFromExecutionSpecificationEnd((OccurrenceSpecification) request.getOldRelationshipEnd(), request.getReferenceOwner());
// update uml model reference
- if(request.getReferenceOwner() instanceof Constraint) {
- ((Constraint)request.getReferenceOwner()).getConstrainedElements().remove(request.getOldRelationshipEnd());
- } else if(request.getReferenceOwner() instanceof Comment) {
- ((Comment)request.getReferenceOwner()).getAnnotatedElements().remove(request.getOldRelationshipEnd());
+ if (request.getReferenceOwner() instanceof Constraint) {
+ ((Constraint) request.getReferenceOwner()).getConstrainedElements().remove(request.getOldRelationshipEnd());
+ } else if (request.getReferenceOwner() instanceof Comment) {
+ ((Comment) request.getReferenceOwner()).getAnnotatedElements().remove(request.getOldRelationshipEnd());
}
}
return CommandResult.newOKCommandResult();
@@ -344,32 +350,32 @@ public class ExecutionSpecificationEndEditPart extends GraphicalEditPart impleme
@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));
+ 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.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommandEx(req, req.getSource(), req.getTarget()));
- } else if(UMLElementTypes.Message_4003 == req.getElementType() || UMLElementTypes.Message_4004 == req.getElementType() || UMLElementTypes.Message_4005 == req.getElementType()) {
+ } else if (UMLElementTypes.Message_4003 == req.getElementType() || UMLElementTypes.Message_4004 == req.getElementType() || UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new ExecutionOccurrenceSpecificationMessageCreateCommand(req));
}
return null;
}
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommandEx(req, req.getSource(), req.getTarget()));
- } else if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ } else if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return getGEFWrapper(new CommentAnnotatedElementCreateCommandEx(req, req.getSource(), req.getTarget()));
- } else if(UMLElementTypes.Message_4003 == req.getElementType() || UMLElementTypes.Message_4004 == req.getElementType() || UMLElementTypes.Message_4005 == req.getElementType()) {
+ } else if (UMLElementTypes.Message_4003 == req.getElementType() || UMLElementTypes.Message_4004 == req.getElementType() || UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new ExecutionOccurrenceSpecificationMessageCreateCommand(req));
}
return null;
@@ -389,19 +395,19 @@ public class ExecutionSpecificationEndEditPart extends GraphicalEditPart impleme
public static void removeConnectionSourceFromExecutionSpecificationEnd(OccurrenceSpecification executionOccurrence, EObject connectionSource) {
EAnnotation annotation = executionOccurrence.getEAnnotation("Connections");
- if(annotation != null) {
+ if (annotation != null) {
annotation.getReferences().remove(connectionSource);
}
}
public static void addConnectionSourceToExecutionSpecificationEnd(OccurrenceSpecification executionOccurrence, EObject connectionSource) {
EAnnotation annotation = executionOccurrence.getEAnnotation("Connections");
- if(annotation == null) {
+ if (annotation == null) {
annotation = EcoreFactory.eINSTANCE.createEAnnotation();
annotation.setSource("Connections"); //$NON-NLS-1$
executionOccurrence.getEAnnotations().add(annotation);
}
- if(!annotation.getReferences().contains(connectionSource)) {
+ if (!annotation.getReferences().contains(connectionSource)) {
annotation.getReferences().add(connectionSource);
}
}
@@ -416,8 +422,8 @@ public class ExecutionSpecificationEndEditPart extends GraphicalEditPart impleme
@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());
+ if (getTarget() instanceof OccurrenceSpecification) {
+ ExecutionSpecificationEndHelper.addConnectionSourceToExecutionSpecificationEnd((OccurrenceSpecification) getTarget(), getSource());
}
return res;
}
@@ -432,8 +438,8 @@ public class ExecutionSpecificationEndEditPart extends GraphicalEditPart impleme
@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());
+ if (getTarget() instanceof OccurrenceSpecification) {
+ ExecutionSpecificationEndHelper.addConnectionSourceToExecutionSpecificationEnd((OccurrenceSpecification) getTarget(), getSource());
}
return res;
}
@@ -447,11 +453,11 @@ public class ExecutionSpecificationEndEditPart extends GraphicalEditPart impleme
protected IFigure createFigure() {
IFigure fig = new ExecutionSpecificationEndFigure();
fig.setForegroundColor(ColorConstants.black);
- // Rectangle b = fig.getBounds();
- // final ExecutionOccurrenceSpecification model = (ExecutionOccurrenceSpecification) this.resolveSemanticElement();
- // Label tooltip = new Label();
- // tooltip.setText(model.getName());
- // fig.setToolTip(tooltip);
+ // Rectangle b = fig.getBounds();
+ // final ExecutionOccurrenceSpecification model = (ExecutionOccurrenceSpecification) this.resolveSemanticElement();
+ // Label tooltip = new Label();
+ // tooltip.setText(model.getName());
+ // fig.setToolTip(tooltip);
fig.setOpaque(false);
return fig;
}
@@ -461,20 +467,23 @@ public class ExecutionSpecificationEndEditPart extends GraphicalEditPart impleme
return true;
}
+ @Override
public ConnectionAnchor getSourceConnectionAnchor(ConnectionEditPart connection) {
return null;
}
+ @Override
public ConnectionAnchor getTargetConnectionAnchor(ConnectionEditPart connEditPart) {
- final ConnectionNodeEditPart connection = (ConnectionNodeEditPart)connEditPart;
+ final ConnectionNodeEditPart connection = (ConnectionNodeEditPart) connEditPart;
String t = ""; //$NON-NLS-1$
try {
- t = (String)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ t = (String) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- Anchor a = ((Edge)connection.getModel()).getTargetAnchor();
- if(a instanceof IdentityAnchor) {
- setResult(((IdentityAnchor)a).getId());
+ Anchor a = ((Edge) connection.getModel()).getTargetAnchor();
+ if (a instanceof IdentityAnchor) {
+ setResult(((IdentityAnchor) a).getId());
} else {
setResult(""); //$NON-NLS-1$
}
@@ -484,86 +493,91 @@ public class ExecutionSpecificationEndEditPart extends GraphicalEditPart impleme
Trace.catching(DiagramUIPlugin.getInstance(), DiagramUIDebugOptions.EXCEPTIONS_CATCHING, getClass(), "getTargetConnectionAnchor", e); //$NON-NLS-1$
Log.error(DiagramUIPlugin.getInstance(), DiagramUIStatusCodes.IGNORED_EXCEPTION_WARNING, "getTargetConnectionAnchor", e); //$NON-NLS-1$
}
- IAnchorableFigure fig = ((IAnchorableFigure)getFigure());
+ IAnchorableFigure fig = ((IAnchorableFigure) getFigure());
ConnectionAnchor a = fig.getConnectionAnchor(t);
return a;
}
+ @Override
public ConnectionAnchor getTargetConnectionAnchor(Request request) {
Point center = getFigure().getBounds().getCenter();
getFigure().translateToAbsolute(center);
- Point pt = ((DropRequest)request).getLocation() == null ? center : new Point(((DropRequest)request).getLocation());
- if(request instanceof CreateRequest) {
+ Point pt = ((DropRequest) request).getLocation() == null ? center : new Point(((DropRequest) request).getLocation());
+ if (request instanceof CreateRequest) {
getFigure().translateToRelative(pt);
}
- ConnectionAnchor a = ((IAnchorableFigure)getFigure()).getTargetConnectionAnchorAt(pt);
+ ConnectionAnchor a = ((IAnchorableFigure) getFigure()).getTargetConnectionAnchorAt(pt);
return a;
}
+ @Override
public ConnectionAnchor getSourceConnectionAnchor(Request request) {
Point location = getFigure().getBounds().getCenter();
getFigure().translateToAbsolute(location);
- if(!(request instanceof CreateRequest)) {
+ if (!(request instanceof CreateRequest)) {
getFigure().translateToRelative(location);
}
- return ((IAnchorableFigure)getFigure()).getSourceConnectionAnchorAt(location);
+ return ((IAnchorableFigure) getFigure()).getSourceConnectionAnchorAt(location);
}
+ @Override
public boolean canAttachNote() {
return true;
}
+ @Override
public String mapConnectionAnchorToTerminal(ConnectionAnchor c) {
- return ((IAnchorableFigure)getFigure()).getConnectionAnchorTerminal(c);
+ return ((IAnchorableFigure) getFigure()).getConnectionAnchorTerminal(c);
}
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.INodeEditPart#mapTerminalToConnectionAnchor(String)
*/
+ @Override
public ConnectionAnchor mapTerminalToConnectionAnchor(String terminal) {
- //redirect to use the anchor of parent Execution.
- if(terminal != null && terminal.indexOf("{") != -1 && terminal.indexOf("}") != -1) {
+ // redirect to use the anchor of parent Execution.
+ if (terminal != null && terminal.indexOf("{") != -1 && terminal.indexOf("}") != -1) {
int location = AnchorHelper.FixedAnchorEx.parsePosition(terminal);
- if(PositionConstants.TOP == location || PositionConstants.BOTTOM == location) {
- IFigure parentFigure = ((AbstractExecutionSpecificationEditPart)getParent()).getFigure();
+ if (PositionConstants.TOP == location || PositionConstants.BOTTOM == location) {
+ IFigure parentFigure = ((AbstractExecutionSpecificationEditPart) getParent()).getFigure();
return new AnchorHelper.FixedAnchorEx(parentFigure, location);
}
}
- return ((IAnchorableFigure)getFigure()).getConnectionAnchor(terminal);
+ return ((IAnchorableFigure) getFigure()).getConnectionAnchor(terminal);
}
@Override
protected List getModelSourceConnections() {
- return ViewUtil.getSourceConnectionsConnectingVisibleViews((View)getModel());
+ return ViewUtil.getSourceConnectionsConnectingVisibleViews((View) getModel());
}
@Override
protected List getModelTargetConnections() {
- List list = ViewUtil.getTargetConnectionsConnectingVisibleViews((View)getModel());
+ List list = ViewUtil.getTargetConnectionsConnectingVisibleViews((View) getModel());
return list;
}
@Override
public EditPart getTargetEditPart(Request request) {
EditPart targetEditPart = super.getTargetEditPart(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())) {
+ 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())) {
return targetEditPart;
}
- if(AnnotatedLinkEndEditPolicy.REQ_ANNOTATED_LINK_END.equals(request.getType()) || AnnotatedLinkEndEditPolicy.REQ_ANNOTATED_LINK_REORIENT_END.equals(request.getType())) {
+ if (AnnotatedLinkEndEditPolicy.REQ_ANNOTATED_LINK_END.equals(request.getType()) || AnnotatedLinkEndEditPolicy.REQ_ANNOTATED_LINK_REORIENT_END.equals(request.getType())) {
return targetEditPart;
}
- if(request instanceof CreateUnspecifiedTypeConnectionRequest) {
- List types = ((CreateUnspecifiedTypeConnectionRequest)request).getElementTypes();
- if(types.contains(UMLElementTypes.CommentAnnotatedElement_4010) || types.contains(UMLElementTypes.ConstraintConstrainedElement_4011)) {
+ if (request instanceof CreateUnspecifiedTypeConnectionRequest) {
+ List types = ((CreateUnspecifiedTypeConnectionRequest) request).getElementTypes();
+ if (types.contains(UMLElementTypes.CommentAnnotatedElement_4010) || types.contains(UMLElementTypes.ConstraintConstrainedElement_4011)) {
return targetEditPart;
}
- } else if(request instanceof ReconnectRequest) {
- ConnectionEditPart con = ((ReconnectRequest)request).getConnectionEditPart();
- if(con instanceof CommentAnnotatedElementEditPart || con instanceof ConstraintConstrainedElementEditPart) {
+ } else if (request instanceof ReconnectRequest) {
+ ConnectionEditPart con = ((ReconnectRequest) request).getConnectionEditPart();
+ if (con instanceof CommentAnnotatedElementEditPart || con instanceof ConstraintConstrainedElementEditPart) {
return targetEditPart;
}
}
- if(RequestConstants.REQ_SELECTION == request.getType() && isSelectable()) {
+ if (RequestConstants.REQ_SELECTION == request.getType() && isSelectable()) {
return this;
}
return getParent().getTargetEditPart(request);
@@ -597,13 +611,13 @@ public class ExecutionSpecificationEndEditPart extends GraphicalEditPart impleme
r.setBounds(getBounds());
r.width--;
r.height--;
- // Hide
- //g.drawOval(r);
+ // Hide
+ // g.drawOval(r);
}
@Override
protected ConnectionAnchor createAnchor(PrecisionPoint p) {
- if(p == null) {
+ if (p == null) {
return createDefaultAnchor();
}
return new ExecutionSpecificationEndAnchor(this, p);
@@ -631,19 +645,23 @@ public class ExecutionSpecificationEndEditPart extends GraphicalEditPart impleme
}
private void initLocator() {
- if(locator == null && executionSpecificationEnd instanceof ExecutionOccurrenceSpecification) {
- ExecutionSpecification es = ((ExecutionOccurrenceSpecification)executionSpecificationEnd).getExecution();
- if(es.getStart() == executionSpecificationEnd)
- locator = new RelativeLocator(((org.eclipse.gef.GraphicalEditPart)getParent()).getFigure(), PositionConstants.NORTH);
- else
- locator = new RelativeLocator(((org.eclipse.gef.GraphicalEditPart)getParent()).getFigure(), PositionConstants.SOUTH);
+ if (locator == null && executionSpecificationEnd instanceof ExecutionOccurrenceSpecification) {
+ ExecutionSpecification es = ((ExecutionOccurrenceSpecification) executionSpecificationEnd).getExecution();
+ if (es.getStart() == executionSpecificationEnd) {
+ locator = new RelativeLocator(((org.eclipse.gef.GraphicalEditPart) getParent()).getFigure(), PositionConstants.NORTH);
+ } else {
+ locator = new RelativeLocator(((org.eclipse.gef.GraphicalEditPart) getParent()).getFigure(), PositionConstants.SOUTH);
+ }
}
}
public void relocateFigure(ExecutionSpecificationEndFigure fig) {
- if(locator == null)
+ if (locator == null) {
initLocator();
- if(locator != null)
- locator.relocate(fig); //place figure at north or south, ignore layout manager
+ }
+ 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/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 58156f7078c..d32b1e90482 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -90,7 +90,7 @@ public class GateEditPart extends AbstractBorderEditPart implements IBorderItemE
/**
* Constructor.
- *
+ *
* @param view
*/
public GateEditPart(View view) {
@@ -99,7 +99,7 @@ public class GateEditPart extends AbstractBorderEditPart implements IBorderItemE
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart#activate()
- *
+ *
*/
@Override
public void activate() {
@@ -113,42 +113,43 @@ public class GateEditPart extends AbstractBorderEditPart implements IBorderItemE
*/
protected void hookExternalGates() {
EObject resolveSemanticElement = resolveSemanticElement();
- if(!(resolveSemanticElement instanceof Gate)) {
+ if (!(resolveSemanticElement instanceof Gate)) {
return;
}
- Gate gate = (Gate)resolveSemanticElement;
- if(gate.eContainer() instanceof CombinedFragment) {
- if(!GateHelper.isInnerCFGate(gate)) {
+ Gate gate = (Gate) resolveSemanticElement;
+ if (gate.eContainer() instanceof CombinedFragment) {
+ if (!GateHelper.isInnerCFGate(gate)) {
Message message = gate.getMessage();
- if(message != null) {
+ if (message != null) {
notifier.listenObject(message);
}
} else {
- //For CombinedFragment
+ // For CombinedFragment
Gate outerGate = GateHelper.getOuterCFGate(gate);
- if(outerGate != null) {
+ if (outerGate != null) {
notifier.listenObject(outerGate);
Message message = outerGate.getMessage();
- if(message != null) {
+ if (message != null) {
notifier.listenObject(message);
}
}
}
- } else if(gate.eContainer() instanceof Interaction) {
- //For gate on interaction
+ } else if (gate.eContainer() instanceof Interaction) {
+ // For gate on interaction
Gate actualGate = GateHelper.getActualGate(gate);
- if(actualGate != null) {
+ if (actualGate != null) {
notifier.listenObject(actualGate);
Message message = actualGate.getMessage();
- if(message != null) {
+ if (message != null) {
notifier.listenObject(message);
}
}
}
}
+ @Override
public void deactivate() {
- if(notifier != null) {
+ if (notifier != null) {
notifier.unlistenAll();
}
super.deactivate();
@@ -156,7 +157,7 @@ public class GateEditPart extends AbstractBorderEditPart implements IBorderItemE
/**
* @see org.eclipse.papyrus.uml.diagram.common.editparts.BorderUMLNodeEditPart#createDefaultEditPolicies()
- *
+ *
*/
@Override
protected void createDefaultEditPolicies() {
@@ -167,13 +168,15 @@ public class GateEditPart extends AbstractBorderEditPart implements IBorderItemE
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new GateGraphicalNodeEditPolicy());
}
+ @Override
public EditPolicy getPrimaryDragEditPolicy() {
return new BorderItemSelectionEditPolicy() {
+ @Override
protected Command getMoveCommand(ChangeBoundsRequest request) {
- IBorderItemEditPart borderItemEP = (IBorderItemEditPart)getHost();
+ IBorderItemEditPart borderItemEP = (IBorderItemEditPart) getHost();
IBorderItemLocator borderItemLocator = borderItemEP.getBorderItemLocator();
- if(borderItemLocator != null) {
+ if (borderItemLocator != null) {
PrecisionRectangle rect = new PrecisionRectangle(getInitialFeedbackBounds().getCopy());
getHostFigure().translateToAbsolute(rect);
rect.translate(request.getMoveDelta());
@@ -181,7 +184,7 @@ public class GateEditPart extends AbstractBorderEditPart implements IBorderItemE
getHostFigure().translateToRelative(rect);
Rectangle realLocation = borderItemLocator.getValidLocation(rect.getCopy(), borderItemEP.getFigure());
Point location = realLocation.getLocation();
- ICommand moveCommand = new SetBoundsCommand(borderItemEP.getEditingDomain(), DiagramUIMessages.Commands_MoveElement, new EObjectAdapter((View)getHost().getModel()), location);
+ ICommand moveCommand = new SetBoundsCommand(borderItemEP.getEditingDomain(), DiagramUIMessages.Commands_MoveElement, new EObjectAdapter((View) getHost().getModel()), location);
return new ICommandProxy(moveCommand);
}
return null;
@@ -192,28 +195,32 @@ public class GateEditPart extends AbstractBorderEditPart implements IBorderItemE
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) {
- if(child instanceof GateNameEditPart) {
+ if (child instanceof GateNameEditPart) {
return new BorderItemSelectionEditPolicy() {
+ @Override
protected List createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
}
+ @Override
protected Command getMoveChildrenCommand(Request request) {
return null;
}
+ @Override
protected Command getCreateCommand(CreateRequest request) {
return null;
}
@@ -223,7 +230,7 @@ public class GateEditPart extends AbstractBorderEditPart implements IBorderItemE
/**
* @see org.eclipse.papyrus.uml.diagram.common.editparts.BorderNodeEditPart#createMainFigure()
- *
+ *
* @return
*/
@Override
@@ -233,17 +240,17 @@ public class GateEditPart extends AbstractBorderEditPart implements IBorderItemE
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.BorderedBorderItemEditPart#addChildVisual(org.eclipse.gef.EditPart, int)
- *
+ *
* @param childEditPart
* @param index
*/
@Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(childEditPart instanceof GateNameEditPart) {
- // BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
- // locator.setBorderItemOffset(new Dimension(-20, 0));
+ if (childEditPart instanceof GateNameEditPart) {
+ // BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
+ // locator.setBorderItemOffset(new Dimension(-20, 0));
ExternalLabelPositionLocator locator = new ExternalLabelPositionLocator(getMainFigure());
- getContentPaneFor((GateNameEditPart)childEditPart).add(((GateNameEditPart)childEditPart).getFigure(), locator);
+ getContentPaneFor((GateNameEditPart) childEditPart).add(((GateNameEditPart) childEditPart).getFigure(), locator);
return;
}
super.addChildVisual(childEditPart, index);
@@ -251,7 +258,7 @@ public class GateEditPart extends AbstractBorderEditPart implements IBorderItemE
/**
* @see org.eclipse.papyrus.uml.diagram.common.editparts.BorderNodeEditPart#getPrimaryShape()
- *
+ *
* @return
*/
@Override
@@ -261,13 +268,13 @@ public class GateEditPart extends AbstractBorderEditPart implements IBorderItemE
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.BorderedBorderItemEditPart#removeChildVisual(org.eclipse.gef.EditPart)
- *
+ *
* @param child
*/
@Override
protected void removeChildVisual(EditPart child) {
- if(child instanceof GateNameEditPart) {
- getContentPaneFor((GateNameEditPart)child).remove(((GateNameEditPart)child).getFigure());
+ if (child instanceof GateNameEditPart) {
+ getContentPaneFor((GateNameEditPart) child).remove(((GateNameEditPart) child).getFigure());
return;
}
super.removeChildVisual(child);
@@ -275,17 +282,17 @@ public class GateEditPart extends AbstractBorderEditPart implements IBorderItemE
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderItemEditPart#refreshBounds()
- *
+ *
*/
@Override
protected void refreshBounds() {
- if(getBorderItemLocator() != null) {
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ if (getBorderItemLocator() != null) {
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
getBorderItemLocator().setConstraint(new Rectangle(loc, DEFAULT_SIZE));
GateNameEditPart labelEditPart = getLabelEditPart();
- if(labelEditPart != null) {
+ if (labelEditPart != null) {
labelEditPart.refreshBounds();
}
}
@@ -293,39 +300,39 @@ public class GateEditPart extends AbstractBorderEditPart implements IBorderItemE
/**
* @see org.eclipse.papyrus.uml.diagram.common.editparts.AbstractBorderEditPart#handleNotificationEvent(org.eclipse.emf.common.notify.Notification)
- *
+ *
* @param event
*/
@Override
protected void handleNotificationEvent(Notification event) {
- if(event.isTouch()) {
+ if (event.isTouch()) {
return;
}
- if(GateModelElementFactory.isShowNameChanged(event)) {
- //refresh name child.
+ if (GateModelElementFactory.isShowNameChanged(event)) {
+ // refresh name child.
refreshChildren();
return;
}
hookExternalGates();
- if(UMLPackage.eINSTANCE.getNamedElement_Name().equals(event.getFeature())) {
- //Update gate name when the name of message is changed.
+ if (UMLPackage.eINSTANCE.getNamedElement_Name().equals(event.getFeature())) {
+ // Update gate name when the name of message is changed.
EObject element = resolveSemanticElement();
- if(element instanceof Gate && event.getNotifier() instanceof Message) {
- // Gate gate = (Gate)element;
- // String gateLabel = GateHelper.getGateLabel(gate);
- // if(gateLabel != null && !gateLabel.equals(gate.getName())) {
- // gate.setName(gateLabel);
- // Gate innerCFGate = GateHelper.getInnerCFGate(gate);
- // if(innerCFGate != null && !gateLabel.equals(innerCFGate.getName())) {
- // innerCFGate.setName(gateLabel);
- // }
- // }
+ if (element instanceof Gate && event.getNotifier() instanceof Message) {
+ // Gate gate = (Gate)element;
+ // String gateLabel = GateHelper.getGateLabel(gate);
+ // if(gateLabel != null && !gateLabel.equals(gate.getName())) {
+ // gate.setName(gateLabel);
+ // Gate innerCFGate = GateHelper.getInnerCFGate(gate);
+ // if(innerCFGate != null && !gateLabel.equals(innerCFGate.getName())) {
+ // innerCFGate.setName(gateLabel);
+ // }
+ // }
} else {
refreshGateLabel();
}
- } else if(UMLPackage.eINSTANCE.getMessageEnd_Message().equals(event.getFeature())) {
- notifier.unlistenObject((Notifier)event.getOldValue());
- notifier.listenObject((Notifier)event.getNewValue());
+ } else if (UMLPackage.eINSTANCE.getMessageEnd_Message().equals(event.getFeature())) {
+ notifier.unlistenObject((Notifier) event.getOldValue());
+ notifier.listenObject((Notifier) event.getNewValue());
refreshGateLabel();
}
super.handleNotificationEvent(event);
@@ -333,20 +340,20 @@ public class GateEditPart extends AbstractBorderEditPart implements IBorderItemE
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart#getModelChildren()
- *
+ *
* @return
*/
@Override
protected List getModelChildren() {
- if(GateModelElementFactory.isShowName(getPrimaryView())) {
+ if (GateModelElementFactory.isShowName(getPrimaryView())) {
return super.getModelChildren();
} else {
- //Hide name with property changes.
+ // Hide name with property changes.
List modelChildren = new ArrayList(super.getModelChildren());
Iterator iterator = modelChildren.iterator();
- while(iterator.hasNext()) {
- View next = (View)iterator.next();
- if(GateNameEditPart.GATE_NAME_TYPE.equals(next.getType())) {
+ while (iterator.hasNext()) {
+ View next = (View) iterator.next();
+ if (GateNameEditPart.GATE_NAME_TYPE.equals(next.getType())) {
iterator.remove();
break;
}
@@ -360,41 +367,41 @@ public class GateEditPart extends AbstractBorderEditPart implements IBorderItemE
*/
protected void refreshGateLabel() {
GateNameEditPart labelEditPart = getLabelEditPart();
- if(labelEditPart != null) {
+ if (labelEditPart != null) {
labelEditPart.refreshLabel();
}
}
/**
* @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#refreshSourceConnections()
- *
+ *
*/
@Override
protected void refreshSourceConnections() {
super.refreshSourceConnections();
GateNameEditPart labelEditPart = getLabelEditPart();
- if(labelEditPart != null) {
+ if (labelEditPart != null) {
labelEditPart.refreshBounds();
}
}
/**
* @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#refreshTargetConnections()
- *
+ *
*/
@Override
protected void refreshTargetConnections() {
super.refreshTargetConnections();
GateNameEditPart labelEditPart = getLabelEditPart();
- if(labelEditPart != null) {
+ if (labelEditPart != null) {
labelEditPart.refreshBounds();
}
}
public GateNameEditPart getLabelEditPart() {
IGraphicalEditPart labelEditPart = getChildBySemanticHint(GateNameEditPart.GATE_NAME_TYPE);
- if(labelEditPart instanceof GateNameEditPart) {
- return (GateNameEditPart)labelEditPart;
+ if (labelEditPart instanceof GateNameEditPart) {
+ return (GateNameEditPart) labelEditPart;
}
return null;
}
@@ -403,20 +410,21 @@ public class GateEditPart extends AbstractBorderEditPart implements IBorderItemE
/**
* Constructor.
- *
+ *
*/
public GateFigure() {
setBorder(new LineBorder(ColorConstants.black));
setPreferredSize(DEFAULT_SIZE);
}
+ @Override
protected ConnectionAnchor createDefaultAnchor() {
return new SlidableAnchor(this) {
@Override
public Point getLocation(Point reference) {
Point location = getLocation(new PrecisionPoint(getBox().getCenter()), reference);
- if(location == null) {
+ if (location == null) {
location = getBox().getCenter();
}
return location;
@@ -424,16 +432,18 @@ public class GateEditPart extends AbstractBorderEditPart implements IBorderItemE
};
}
+ @Override
protected ConnectionAnchor createAnchor(PrecisionPoint p) {
- if(p == null) {
+ if (p == null) {
return createDefaultAnchor();
}
return new SlidableAnchor(this, p) {
+ @Override
public Point getLocation(Point reference) {
Rectangle box = getBox();
Point location = getLocation(new PrecisionPoint(box.getCenter()), reference);
- if(location == null) {
+ if (location == null) {
location = getBox().getCenter();
}
return location;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GateNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GateNameEditPart.java
index 82fd63ed8b6..c6cb2e180bc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GateNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GateNameEditPart.java
@@ -47,7 +47,7 @@ import org.eclipse.uml2.uml.UMLPackage;
/**
* 1. Refactoring with a BorderItemLabelEditPart.
* 2. Add displaying stereotypes.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class GateNameEditPart extends BorderItemLabelEditPart implements IPapyrusEditPart {
@@ -60,30 +60,33 @@ public class GateNameEditPart extends BorderItemLabelEditPart implements IPapyru
/**
* Constructor.
- *
+ *
* @param view
*/
public GateNameEditPart(View view) {
super(view);
}
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- //Display stereotype on name figure.
+ // Display stereotype on name figure.
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeExternalNodeLabelEditPolicy());
}
+ @Override
public IFigure getPrimaryShape() {
return getFigure();
}
+ @Override
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -91,41 +94,41 @@ public class GateNameEditPart extends BorderItemLabelEditPart implements IPapyru
@Override
protected Point getLocation() {
Point location = super.getLocation();
- if(location.x == 0 && location.y == 0) {
+ if (location.x == 0 && location.y == 0) {
Dimension size = getSize();
EditPart parent = getParent();
- if(parent instanceof GateEditPart) {
- GateEditPart gateEditPart = ((GateEditPart)parent);
+ if (parent instanceof GateEditPart) {
+ GateEditPart gateEditPart = ((GateEditPart) parent);
EObject elt = gateEditPart.resolveSemanticElement();
Dimension preferredSize = getFigure().getPreferredSize(size.width, size.height);
IBorderItemLocator locator = gateEditPart.getBorderItemLocator();
- if(locator instanceof GateLocator) {
- int alignment = ((GateLocator)locator).getAlignment(((GateLocator)locator).getConstraint());
- if(PositionConstants.LEFT == alignment) {
- if(gateEditPart.getTargetConnections().isEmpty()) {
+ if (locator instanceof GateLocator) {
+ int alignment = ((GateLocator) locator).getAlignment(((GateLocator) locator).getConstraint());
+ if (PositionConstants.LEFT == alignment) {
+ if (gateEditPart.getTargetConnections().isEmpty()) {
location.x = -preferredSize.width - 1;
} else {
location.x = GateEditPart.DEFAULT_SIZE.width + 1;
}
- if(elt instanceof Gate && GateHelper.isInnerCFGate((Gate)elt)) {
- location.y = GateEditPart.DEFAULT_SIZE.height - 2;//move fown
+ if (elt instanceof Gate && GateHelper.isInnerCFGate((Gate) elt)) {
+ location.y = GateEditPart.DEFAULT_SIZE.height - 2;// move fown
} else {
- location.y = -GateEditPart.DEFAULT_SIZE.height + 2;//move up
+ location.y = -GateEditPart.DEFAULT_SIZE.height + 2;// move up
}
- } else if(PositionConstants.RIGHT == alignment) {
- if(gateEditPart.getSourceConnections().isEmpty()) {
+ } else if (PositionConstants.RIGHT == alignment) {
+ if (gateEditPart.getSourceConnections().isEmpty()) {
location.x = GateEditPart.DEFAULT_SIZE.width + 1;
} else {
location.x = -preferredSize.width - 1;
}
- if(elt instanceof Gate && GateHelper.isInnerCFGate((Gate)elt)) {
- location.y = GateEditPart.DEFAULT_SIZE.height - 2;//move fown
+ if (elt instanceof Gate && GateHelper.isInnerCFGate((Gate) elt)) {
+ location.y = GateEditPart.DEFAULT_SIZE.height - 2;// move fown
} else {
- location.y = -GateEditPart.DEFAULT_SIZE.height + 2;//move up
+ location.y = -GateEditPart.DEFAULT_SIZE.height + 2;// move up
}
- } else if(PositionConstants.TOP == alignment) {
+ } else if (PositionConstants.TOP == alignment) {
location.y = -GateEditPart.DEFAULT_SIZE.height - 1;
- } else if(PositionConstants.BOTTOM == alignment) {
+ } else if (PositionConstants.BOTTOM == alignment) {
location.y = GateEditPart.DEFAULT_SIZE.height + 1;
}
}
@@ -148,41 +151,41 @@ public class GateNameEditPart extends BorderItemLabelEditPart implements IPapyru
/**
* Constructor.
- *
+ *
* @param features
*/
public GateNameParser() {
- super(new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() });
+ super(new EAttribute[] { UMLPackage.eINSTANCE.getNamedElement_Name() });
}
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.parsers.MessageFormatParser#getPrintString(org.eclipse.core.runtime.IAdaptable, int)
- *
+ *
* @param adapter
* @param flags
* @return
*/
@Override
public String getPrintString(IAdaptable adapter, int flags) {
- // Object element = adapter.getAdapter(EObject.class);
- // if(element instanceof Gate) {
- // Gate gate = (Gate)element;
- // if(gate.eContainer() instanceof CombinedFragment) {
- // Gate outerGate = GateHelper.getOuterCFGate(gate);
- // if(outerGate != null) {
- // gate = outerGate;
- // }
- // } else if(gate.eContainer() instanceof Interaction) {
- // Gate actualGate = GateHelper.getActualGate(gate);
- // if(actualGate != null) {
- // gate = actualGate;
- // }
- // }
- // String printString = getPrintString(gate);
- // if(printString != null) {
- // return printString;
- // }
- // }
+ // Object element = adapter.getAdapter(EObject.class);
+ // if(element instanceof Gate) {
+ // Gate gate = (Gate)element;
+ // if(gate.eContainer() instanceof CombinedFragment) {
+ // Gate outerGate = GateHelper.getOuterCFGate(gate);
+ // if(outerGate != null) {
+ // gate = outerGate;
+ // }
+ // } else if(gate.eContainer() instanceof Interaction) {
+ // Gate actualGate = GateHelper.getActualGate(gate);
+ // if(actualGate != null) {
+ // gate = actualGate;
+ // }
+ // }
+ // String printString = getPrintString(gate);
+ // if(printString != null) {
+ // return printString;
+ // }
+ // }
return super.getPrintString(adapter, flags);
}
@@ -191,39 +194,39 @@ public class GateNameEditPart extends BorderItemLabelEditPart implements IPapyru
*/
protected String getPrintString(Gate gate) {
Message message = gate.getMessage();
- if(message != null) {
+ if (message != null) {
MessageDirection direction = null;
EObject parent = gate.eContainer();
- if(parent instanceof CombinedFragment) {
- CombinedFragment cf = ((CombinedFragment)parent);
- if(gate == message.getSendEvent()) {
+ if (parent instanceof CombinedFragment) {
+ CombinedFragment cf = ((CombinedFragment) parent);
+ if (gate == message.getSendEvent()) {
MessageEnd receiveEvent = message.getReceiveEvent();
Lifeline lifeline = getCoveredBy(receiveEvent);
- if(!cf.getCovereds().contains(lifeline)) {
+ if (!cf.getCovereds().contains(lifeline)) {
direction = MessageDirection.OUT;
}
} else {
MessageEnd sendEvent = message.getSendEvent();
Lifeline coveredBy = getCoveredBy(sendEvent);
- if(!cf.getCovereds().contains(coveredBy)) {
+ if (!cf.getCovereds().contains(coveredBy)) {
direction = MessageDirection.IN;
}
}
- } else if(parent instanceof Interaction) {
- if(gate == message.getSendEvent()) {
+ } else if (parent instanceof Interaction) {
+ if (gate == message.getSendEvent()) {
direction = MessageDirection.IN;
- } else if(gate == message.getReceiveEvent()) {
+ } else if (gate == message.getReceiveEvent()) {
direction = MessageDirection.OUT;
}
}
- if(direction == null) {
- if(gate == message.getSendEvent()) {
+ if (direction == null) {
+ if (gate == message.getSendEvent()) {
direction = MessageDirection.OUT;
- } else if(gate == message.getReceiveEvent()) {
+ } else if (gate == message.getReceiveEvent()) {
direction = MessageDirection.IN;
}
}
- if(direction != null) {
+ if (direction != null) {
StringBuffer buf = new StringBuffer();
buf.append(direction.getName() + "_");
buf.append(message.getName());
@@ -234,21 +237,21 @@ public class GateNameEditPart extends BorderItemLabelEditPart implements IPapyru
}
private Lifeline getCoveredBy(MessageEnd messageEnd) {
- if(messageEnd == null) {
+ if (messageEnd == null) {
return null;
}
- if(messageEnd instanceof OccurrenceSpecification) {
- return ((OccurrenceSpecification)messageEnd).getCovered();
+ if (messageEnd instanceof OccurrenceSpecification) {
+ return ((OccurrenceSpecification) messageEnd).getCovered();
}
return null;
}
protected EStructuralFeature getEStructuralFeature(Object notification) {
EStructuralFeature featureImpl = null;
- if(notification instanceof Notification) {
- Object feature = ((Notification)notification).getFeature();
- if(feature instanceof EStructuralFeature) {
- featureImpl = (EStructuralFeature)feature;
+ if (notification instanceof Notification) {
+ Object feature = ((Notification) notification).getFeature();
+ if (feature instanceof EStructuralFeature) {
+ featureImpl = (EStructuralFeature) feature;
}
}
return featureImpl;
@@ -260,25 +263,26 @@ public class GateNameEditPart extends BorderItemLabelEditPart implements IPapyru
/**
* @see org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser#getSemanticElementsBeingParsed(org.eclipse.emf.ecore.EObject)
- *
+ *
* @param element
* @return
*/
+ @Override
public List getSemanticElementsBeingParsed(EObject element) {
- if(element instanceof Gate) {
+ if (element instanceof Gate) {
return Collections.singletonList(element);
}
return Collections.emptyList();
}
/**
- * @see org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser#areSemanticElementsAffected(org.eclipse.emf.ecore.EObject,
- * java.lang.Object)
- *
+ * @see org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser#areSemanticElementsAffected(org.eclipse.emf.ecore.EObject, java.lang.Object)
+ *
* @param listener
* @param notification
* @return
*/
+ @Override
public boolean areSemanticElementsAffected(EObject listener, Object notification) {
EStructuralFeature feature = getEStructuralFeature(notification);
return isValidFeature(feature);
@@ -299,7 +303,7 @@ public class GateNameEditPart extends BorderItemLabelEditPart implements IPapyru
/**
* Constructor.
- *
+ *
*/
public GateNameFigure() {
setBorder(new MarginBorder(2));
@@ -316,14 +320,15 @@ public class GateNameEditPart extends BorderItemLabelEditPart implements IPapyru
add(namedLabel);
}
+ @Override
public void setStereotypeDisplay(String stereotypes, Image image) {
- if(stereotypes == null || stereotypes.trim().equals("")) {
- if(stereotypesLabel != null) {
+ if (stereotypes == null || stereotypes.trim().equals("")) {
+ if (stereotypesLabel != null) {
this.remove(stereotypesLabel);
}
stereotypesLabel = null;
} else {
- if(stereotypesLabel == null) {
+ if (stereotypesLabel == null) {
stereotypesLabel = new Label(stereotypes, image);
this.add(stereotypesLabel, 0);
} else {
@@ -334,14 +339,15 @@ public class GateNameEditPart extends BorderItemLabelEditPart implements IPapyru
}
+ @Override
public void setStereotypePropertiesInBrace(String stereotypeProperties) {
- if(stereotypeProperties == null || stereotypeProperties.trim().equals("")) {
- if(stereotypePropertiesLabel != null) {
+ if (stereotypeProperties == null || stereotypeProperties.trim().equals("")) {
+ if (stereotypePropertiesLabel != null) {
this.remove(stereotypePropertiesLabel);
}
stereotypePropertiesLabel = null;
} else {
- if(stereotypePropertiesLabel == null) {
+ if (stereotypePropertiesLabel == null) {
stereotypePropertiesLabel = new Label();
int index = this.getChildren().indexOf(stereotypesLabel);
this.add(stereotypePropertiesLabel, index + 1);
@@ -351,31 +357,37 @@ public class GateNameEditPart extends BorderItemLabelEditPart implements IPapyru
}
+ @Override
public void setStereotypePropertiesInCompartment(String stereotypeProperties) {
}
+ @Override
public Label getStereotypesLabel() {
return stereotypesLabel;
}
+ @Override
public void setText(String text) {
namedLabel.setText(text);
}
+ @Override
public String getText() {
return namedLabel.getText();
}
+ @Override
public void setIcon(Image icon) {
namedLabel.setIcon(icon);
}
+ @Override
public Image getIcon() {
return namedLabel.getIcon();
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GatesHolderEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GatesHolderEditPart.java
index c8bf77d0228..98fd67aedaa 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GatesHolderEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GatesHolderEditPart.java
@@ -1,7 +1,7 @@
///*****************************************************************************
// * 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
@@ -28,14 +28,14 @@
///**
// * Support Graphical presentation of Gate.
// * https://bugs.eclipse.org/bugs/show_bug.cgi?id=389531
-// *
+// *
// * @author Jin Liu (jin.liu@soyatec.com)
// */
//public abstract class GatesHolderEditPart extends InteractionFragmentEditPart {
//
// /**
// * Constructor.
-// *
+// *
// * @param view
// */
// public GatesHolderEditPart(View view) {
@@ -100,4 +100,4 @@
// }
// return false;
// }
-//}
+// }
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionFragmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionFragmentEditPart.java
index e24cc3d3550..fb1888825d8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionFragmentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionFragmentEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -48,43 +48,43 @@ public abstract class InteractionFragmentEditPart extends ShapeNodeEditPart {
*/
public void resizeInteractionFragmentFigure() {
Object obj = getModel();
- if(obj instanceof Shape) {
+ if (obj instanceof Shape) {
// we get the element linked to this editpart
- EObject element = ((Shape)obj).getElement();
- if(element instanceof InteractionFragment) {
+ EObject element = ((Shape) obj).getElement();
+ if (element instanceof InteractionFragment) {
// we get the list of the covered lifelinnes by the InteractionUse
- List<Lifeline> lifelineCoveredList = ((InteractionFragment)element).getCovereds();
- if(lifelineCoveredList != null && getParent() != null) {
+ List<Lifeline> lifelineCoveredList = ((InteractionFragment) element).getCovereds();
+ if (lifelineCoveredList != null && getParent() != null) {
// we get the interactionCompartimentEditPart to have access to all lifelines
// EditParts
List<EditPart> childrenEditPart = getParent().getChildren();
- if(childrenEditPart != null) {
+ if (childrenEditPart != null) {
// The max value guarantee that the first figure will set the minX value
int minX = Integer.MAX_VALUE;
int maxX = -Integer.MAX_VALUE;
int maxR = -Integer.MAX_VALUE;
- for(EditPart childEditPart : childrenEditPart) {
+ for (EditPart childEditPart : childrenEditPart) {
// we check all the EditParts to select only the lifelineEditParts
- if(childEditPart instanceof LifelineEditPart) {
+ if (childEditPart instanceof LifelineEditPart) {
Object childModel = childEditPart.getModel();
- if(childModel instanceof Shape) {
+ if (childModel instanceof Shape) {
// we get the object Lifeline linked the selected
// lifelineEditPart
- EObject childElement = ((Shape)childModel).getElement();
- if(childElement instanceof Lifeline) {
- Lifeline lifeline = (Lifeline)childElement;
- for(Lifeline lfn : lifelineCoveredList) {
+ EObject childElement = ((Shape) childModel).getElement();
+ if (childElement instanceof Lifeline) {
+ Lifeline lifeline = (Lifeline) childElement;
+ for (Lifeline lfn : lifelineCoveredList) {
// we check if the lifeLine in the intreactionUse's
// parent Interaction is a covered Lifeline
- if(lifeline.equals(lfn)) {
- LifelineEditPart liflelineEditPart = (LifelineEditPart)childEditPart;
- if(liflelineEditPart.getFigure().getBounds().x > maxX) {
+ if (lifeline.equals(lfn)) {
+ LifelineEditPart liflelineEditPart = (LifelineEditPart) childEditPart;
+ if (liflelineEditPart.getFigure().getBounds().x > maxX) {
maxX = liflelineEditPart.getFigure().getBounds().x;
// the maxR will represent the futur value of
// the rectangle right value.
maxR = liflelineEditPart.getFigure().getBounds().right();
}
- if(liflelineEditPart.getFigure().getBounds().x < minX) {
+ if (liflelineEditPart.getFigure().getBounds().x < minX) {
// the min value will represent the rectangle x
// value.
minX = liflelineEditPart.getFigure().getBounds().x;
@@ -95,7 +95,7 @@ public abstract class InteractionFragmentEditPart extends ShapeNodeEditPart {
}
}
}
- if(minX != Integer.MAX_VALUE || maxR != -Integer.MAX_VALUE) {
+ if (minX != Integer.MAX_VALUE || maxR != -Integer.MAX_VALUE) {
// after this loop we have the coordinate of two lifeline figure ,
// even if we have more than two covered Lifelne we choose the
// extremities.
@@ -109,70 +109,70 @@ public abstract class InteractionFragmentEditPart extends ShapeNodeEditPart {
/**
* resize the interactinUse figure
- *
+ *
* @param min
- * the min x position of a covered lifline
+ * the min x position of a covered lifline
* @param max
- * the max x position of a coverd lifeline
- *
+ * the max x position of a coverd lifeline
+ *
*/
private void getNewSize(int min, int max) {
int h = getFigure().getBounds().height;
int y = getFigure().getBounds().y;
Dimension size = new Dimension(max - min, h);
Point loc = new Point(min, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
}
/**
* Update covered lifelines of a Interaction fragment
- *
+ *
* @param newBounds
*/
public void updateCoveredLifelines(Bounds newBounds) {
Rectangle newBound = new Rectangle(newBounds.getX(), newBounds.getY(), newBounds.getWidth(), newBounds.getHeight());
- InteractionFragment combinedFragment = (InteractionFragment)resolveSemanticElement();
+ InteractionFragment combinedFragment = (InteractionFragment) resolveSemanticElement();
EList<Lifeline> coveredLifelines = combinedFragment.getCovereds();
List<Lifeline> coveredLifelinesToAdd = new ArrayList<Lifeline>();
List<Lifeline> coveredLifelinesToRemove = new ArrayList<Lifeline>();
EditPart interactionCompartment = getInteractionCompartment();
- if(interactionCompartment != null) {
+ if (interactionCompartment != null) {
this.getFigure().translateToAbsolute(newBound);
- for(Object child : interactionCompartment.getChildren()) {
- if(child instanceof LifelineEditPart) {
- LifelineEditPart lifelineEditPart = (LifelineEditPart)child;
+ for (Object child : interactionCompartment.getChildren()) {
+ if (child instanceof LifelineEditPart) {
+ LifelineEditPart lifelineEditPart = (LifelineEditPart) child;
updateCoveredLifelines(lifelineEditPart, newBound, coveredLifelinesToAdd, coveredLifelinesToRemove, coveredLifelines);
}
}
}
- if(!coveredLifelinesToAdd.isEmpty()) {
+ if (!coveredLifelinesToAdd.isEmpty()) {
CommandHelper.executeCommandWithoutHistory(getEditingDomain(), AddCommand.create(getEditingDomain(), combinedFragment, UMLPackage.eINSTANCE.getInteractionFragment_Covered(), coveredLifelinesToAdd), true);
}
- if(!coveredLifelinesToRemove.isEmpty()) {
+ if (!coveredLifelinesToRemove.isEmpty()) {
CommandHelper.executeCommandWithoutHistory(getEditingDomain(), RemoveCommand.create(getEditingDomain(), combinedFragment, UMLPackage.eINSTANCE.getInteractionFragment_Covered(), coveredLifelinesToRemove), true);
}
}
// check lifelines in PartDecomposition, see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=364813
private void updateCoveredLifelines(LifelineEditPart lifelineEditPart, Rectangle newBound, List<Lifeline> coveredLifelinesToAdd, List<Lifeline> coveredLifelinesToRemove, EList<Lifeline> coveredLifelines) {
- Lifeline lifeline = (Lifeline)lifelineEditPart.resolveSemanticElement();
+ Lifeline lifeline = (Lifeline) lifelineEditPart.resolveSemanticElement();
LifelineDotLineCustomFigure dotLineFigure = lifelineEditPart.getPrimaryShape().getFigureLifelineDotLineFigure();
Rectangle dotLineBounds = dotLineFigure.getBounds().getCopy();
Rectangle centralLineBounds = new Rectangle(dotLineBounds.x() + dotLineBounds.width() / 2, dotLineBounds.y(), 1, dotLineBounds.height());
dotLineFigure.translateToAbsolute(centralLineBounds);
- if(newBound.intersects(centralLineBounds)) {
- if(!coveredLifelines.contains(lifeline)) {
+ if (newBound.intersects(centralLineBounds)) {
+ if (!coveredLifelines.contains(lifeline)) {
coveredLifelinesToAdd.add(lifeline);
}
- } else if(coveredLifelines.contains(lifeline)) {
+ } else if (coveredLifelines.contains(lifeline)) {
coveredLifelinesToRemove.add(lifeline);
}
PartDecomposition partDecomposition = lifeline.getDecomposedAs();
- if(partDecomposition != null) {
+ if (partDecomposition != null) {
List subLifelines = lifelineEditPart.getChildren();
- for(Object child : subLifelines) {
- if(child instanceof LifelineEditPart) {
- updateCoveredLifelines((LifelineEditPart)child, newBound, coveredLifelinesToAdd, coveredLifelinesToRemove, coveredLifelines);
+ for (Object child : subLifelines) {
+ if (child instanceof LifelineEditPart) {
+ updateCoveredLifelines((LifelineEditPart) child, newBound, coveredLifelinesToAdd, coveredLifelinesToRemove, coveredLifelines);
}
}
}
@@ -180,12 +180,12 @@ public abstract class InteractionFragmentEditPart extends ShapeNodeEditPart {
/**
* Find parent editpart of lifeline
- *
+ *
* @return EditPart
*/
public EditPart getInteractionCompartment() {
EditPart editPart = getParent();
- while(editPart != null && !(editPart instanceof InteractionInteractionCompartmentEditPart)) {
+ while (editPart != null && !(editPart instanceof InteractionInteractionCompartmentEditPart)) {
editPart = editPart.getParent();
}
return editPart;
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 aeacb75b31b..e42cc609dc9 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -145,30 +145,31 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
/**
* Constructor.
- *
+ *
* @param view
*/
public InteractionOperandGuardEditPart(View view) {
super(view);
}
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- // installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ // installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, createPrimaryDragEditPolicy());
- //Do NOT allow delete guard, it also disable the Delete menu.
+ // Do NOT allow delete guard, it also disable the Delete menu.
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new SemanticEditPolicy() {
@Override
protected Command getSemanticCommand(IEditCommandRequest request) {
- if(request instanceof DestroyElementRequest) {
+ if (request instanceof DestroyElementRequest) {
return org.eclipse.gef.commands.UnexecutableCommand.INSTANCE;
}
return super.getSemanticCommand(request);
}
});
- //Just hide the guard for a operand, it also overrite the Hide menu action.
+ // Just hide the guard for a operand, it also overrite the Hide menu action.
installEditPolicy(EditPolicy.COMPONENT_ROLE, new ComponentEditPolicy() {
@Override
@@ -178,7 +179,7 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
@Override
protected Command createDeleteViewCommand(GroupRequest deleteRequest) {
- View source = ((InteractionOperandEditPart)getParent()).getNotationView();
+ View source = ((InteractionOperandEditPart) getParent()).getNotationView();
CreateEAnnotationCommand command = new CreateEAnnotationCommand(getEditingDomain(), source, InteractionOperandModelElementFactory.GUARD_VISIBILITY_KEY) {
@Override
@@ -196,6 +197,7 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
protected EditPolicy createPrimaryDragEditPolicy() {
return new NonResizableEditPolicyEx() {
+ @Override
protected void showChangeBoundsFeedback(ChangeBoundsRequest request) {
IFigure feedback = getDragSourceFeedbackFigure();
PrecisionRectangle rect = new PrecisionRectangle(getInitialFeedbackBounds().getCopy());
@@ -211,33 +213,35 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
min.width = mmode.LPtoDP(min.width);
max.height = mmode.LPtoDP(max.height);
max.width = mmode.LPtoDP(max.width);
- if(min.width > rect.width)
+ if (min.width > rect.width) {
rect.width = min.width;
- else if(max.width < rect.width)
+ } else if (max.width < rect.width) {
rect.width = max.width;
- if(min.height > rect.height)
+ }
+ if (min.height > rect.height) {
rect.height = min.height;
- else if(max.height < rect.height)
+ } else if (max.height < rect.height) {
rect.height = max.height;
- //parent bounds
- IFigure parentFigure = ((GraphicalEditPart)getParent()).getFigure();
+ }
+ // parent bounds
+ IFigure parentFigure = ((GraphicalEditPart) getParent()).getFigure();
Rectangle parentBounds = parentFigure.getBounds().getCopy();
parentFigure.translateToAbsolute(parentBounds);
- if(rect.x < parentBounds.x) {
+ if (rect.x < parentBounds.x) {
rect.x = parentBounds.x;
}
- if(rect.right() > parentBounds.right()) {
+ if (rect.right() > parentBounds.right()) {
rect.x = (parentBounds.right() - rect.width);
}
- if(rect.y < parentBounds.y) {
+ if (rect.y < parentBounds.y) {
rect.y = parentBounds.y;
}
- if(rect.bottom() > parentBounds.bottom()) {
+ if (rect.bottom() > parentBounds.bottom()) {
rect.y = parentBounds.bottom() - rect.height;
}
feedback.translateToRelative(rect);
feedback.setBounds(rect.getCopy());
- //Fixed bug about moving guard.
+ // Fixed bug about moving guard.
feedback.translateToAbsolute(rect);
request.setMoveDelta(new Point(rect.x - initialAbsBounds.x, rect.y - initialAbsBounds.y));
}
@@ -245,42 +249,42 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
}
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -292,10 +296,12 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
refreshVisuals();
}
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -305,35 +311,37 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
}
protected Image getLabelIcon() {
- return ElementIconUtil.getLabelIcon((org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart)getParent());
+ return ElementIconUtil.getLabelIcon((org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart) getParent());
}
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
}
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -343,21 +351,24 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
return getParser() != null;
}
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -368,26 +379,29 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
};
}
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
}
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = new GuardConditionParser();
}
return parser;
}
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
WrappingLabel primaryLabel = getPrimaryFigure().getPrimaryLabel();
CellEditorLocator locator = new TextCellEditorLocator(primaryLabel);
setManager(new MultilineLabelDirectEditManager(this, TextCellEditorEx.class, locator));
@@ -396,7 +410,7 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
}
public GuardFigure getPrimaryFigure() {
- return (GuardFigure)getFigure();
+ return (GuardFigure) getFigure();
}
protected void setManager(DirectEditManager manager) {
@@ -408,54 +422,55 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
}
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
}
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -467,13 +482,14 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -490,6 +506,7 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
}
}
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -501,82 +518,86 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
@Override
public void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- // IFigure figure = getFigure();
- // Dimension size = figure.getPreferredSize(-1, -1);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, figure, new Rectangle(loc, size));
+ // IFigure figure = getFigure();
+ // Dimension size = figure.getPreferredSize(-1, -1);
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(this, figure, new Rectangle(loc, size));
}
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
refreshBounds();
}
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
}
}
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -584,10 +605,12 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
}
}
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -597,15 +620,15 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
}
private View getFontStyleOwnerView() {
- return (View)getModel();
+ return (View) getModel();
}
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
// not a named element. no specific editor => do nothing
@@ -613,7 +636,7 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
}
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -624,9 +647,9 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
}
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -636,9 +659,9 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
@@ -648,13 +671,14 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -667,18 +691,20 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
}
}
+ @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
- } else if(ElementIconUtil.isIconNotification(event)) {
+ } else if (ElementIconUtil.isIconNotification(event)) {
refreshLabel();
} else {
refreshLabel();
@@ -686,31 +712,32 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
super.handleNotificationEvent(event);
}
+ @Override
protected IFigure createFigure() {
GuardFigure label = new GuardFigure();
- // WrappingLabel label = new WrappingLabel();
+ // WrappingLabel label = new WrappingLabel();
defaultText = getLabelTextHelper(label);
return label;
}
private static String getGuardLabelText(InteractionOperand interactionOperand, boolean edit) {
- if(interactionOperand == null) {
+ if (interactionOperand == null) {
return "";
}
Element owner = interactionOperand.getOwner();
- while(owner != null && !(owner instanceof CombinedFragment)) {
+ while (owner != null && !(owner instanceof CombinedFragment)) {
owner = owner.getOwner();
}
- CombinedFragment enclosingCF = (CombinedFragment)owner;
- if (enclosingCF == null){
+ CombinedFragment enclosingCF = (CombinedFragment) owner;
+ if (enclosingCF == null) {
return "";
}
InteractionOperatorKind cfOperator = enclosingCF.getInteractionOperator();
InteractionConstraint guard = interactionOperand.getGuard();
String specValue = null;
- if(guard != null) {
+ if (guard != null) {
ValueSpecification specification = guard.getSpecification();
- if(specification != null) {
+ if (specification != null) {
try {
specValue = specification.stringValue();
} catch (Exception e) {
@@ -718,24 +745,24 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
}
}
StringBuilder sb = new StringBuilder("");
- if(InteractionOperatorKind.LOOP_LITERAL.equals(cfOperator)) {
+ if (InteractionOperatorKind.LOOP_LITERAL.equals(cfOperator)) {
String condition = LoopOperatorUtil.getLoopCondition(guard);
- if(condition != null) {
+ if (condition != null) {
sb.append(condition);
}
}
- if(specValue == null) {
+ if (specValue == null) {
EList<InteractionOperand> operands = enclosingCF.getOperands();
- if(InteractionOperatorKind.ALT_LITERAL.equals(cfOperator) && interactionOperand.equals(operands.get(operands.size() - 1))) {
+ if (InteractionOperatorKind.ALT_LITERAL.equals(cfOperator) && interactionOperand.equals(operands.get(operands.size() - 1))) {
specValue = "else";
}
}
- if(specValue != null) {
- if(!edit) {
+ if (specValue != null) {
+ if (!edit) {
sb.append('[');
}
sb.append(specValue);
- if(!edit) {
+ if (!edit) {
sb.append(']');
}
}
@@ -745,13 +772,13 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
protected static InteractionOperand getInteractionOperand(Object element) {
InteractionOperand operand = null;
- if(element instanceof InteractionConstraint) {
- EObject owner = ((InteractionConstraint)element).eContainer();
- if(owner instanceof InteractionOperand) {
- operand = (InteractionOperand)owner;
+ if (element instanceof InteractionConstraint) {
+ EObject owner = ((InteractionConstraint) element).eContainer();
+ if (owner instanceof InteractionOperand) {
+ operand = (InteractionOperand) owner;
}
- } else if(element instanceof InteractionOperand) {
- operand = (InteractionOperand)element;
+ } else if (element instanceof InteractionOperand) {
+ operand = (InteractionOperand) element;
}
return operand;
}
@@ -759,29 +786,33 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
private static class GuardConditionParser extends MessageFormatParser implements ISemanticParser {
public GuardConditionParser() {
- super(new EAttribute[]{ UMLPackage.eINSTANCE.getLiteralInteger_Value(), UMLPackage.eINSTANCE.getLiteralString_Value() });
+ super(new EAttribute[] { UMLPackage.eINSTANCE.getLiteralInteger_Value(), UMLPackage.eINSTANCE.getLiteralString_Value() });
}
+ @Override
public List getSemanticElementsBeingParsed(EObject element) {
List<Element> semanticElementsBeingParsed = new ArrayList<Element>();
- if(element instanceof InteractionOperand) {
- InteractionOperand op = (InteractionOperand)element;
+ if (element instanceof InteractionOperand) {
+ InteractionOperand op = (InteractionOperand) element;
semanticElementsBeingParsed.add(op);
semanticElementsBeingParsed.add(op.getGuard());
}
return semanticElementsBeingParsed;
}
+ @Override
public boolean areSemanticElementsAffected(EObject listener, Object notification) {
EStructuralFeature feature = getEStructuralFeature(notification);
return isValidFeature(feature);
}
+ @Override
public boolean isAffectingEvent(Object event, int flags) {
EStructuralFeature feature = getEStructuralFeature(event);
return isValidFeature(feature);
}
+ @Override
public String getPrintString(IAdaptable element, int flags) {
Object adapter = element.getAdapter(EObject.class);
InteractionOperand operand = getInteractionOperand(adapter);
@@ -797,10 +828,10 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
public ICommand getParseCommand(IAdaptable adapter, String newString, int flags) {
EObject element = getInteractionOperand(adapter.getAdapter(EObject.class));
TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(element);
- if(editingDomain == null || !(element instanceof InteractionOperand)) {
+ if (editingDomain == null || !(element instanceof InteractionOperand)) {
return UnexecutableCommand.INSTANCE;
}
- InteractionOperand interactionOperand = (InteractionOperand)element;
+ InteractionOperand interactionOperand = (InteractionOperand) element;
InteractionConstraint guard = interactionOperand.getGuard();
CompositeTransactionalCommand command = new CompositeTransactionalCommand(editingDomain, "Set Values"); //$NON-NLS-1$
command.compose(new UpdateGuardConditionCommand(editingDomain, interactionOperand, guard, newString));
@@ -815,10 +846,10 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
protected EStructuralFeature getEStructuralFeature(Object notification) {
EStructuralFeature featureImpl = null;
- if(notification instanceof Notification) {
- Object feature = ((Notification)notification).getFeature();
- if(feature instanceof EStructuralFeature) {
- featureImpl = (EStructuralFeature)feature;
+ if (notification instanceof Notification) {
+ Object feature = ((Notification) notification).getFeature();
+ if (feature instanceof EStructuralFeature) {
+ featureImpl = (EStructuralFeature) feature;
}
}
return featureImpl;
@@ -846,33 +877,36 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- CombinedFragment enclosingCF = (CombinedFragment)interactionOperand.getOwner();
+ CombinedFragment enclosingCF = (CombinedFragment) interactionOperand.getOwner();
InteractionOperatorKind cfOperator = enclosingCF.getInteractionOperator();
- if(InteractionOperatorKind.LOOP_LITERAL.equals(cfOperator)) {
- if(text.contains("]") && text.contains("[")) {
+ if (InteractionOperatorKind.LOOP_LITERAL.equals(cfOperator)) {
+ if (text.contains("]") && text.contains("[")) {
String[] parts = text.split("]");
String[] nums = parts[0].replaceAll("\\[", "").split(",");
int min = 0, max = -1;
min = parseInt(nums[0], 0);
max = nums.length > 1 ? parseInt(nums[1], -1) : min;
- if(guard.getMinint() != null)
+ if (guard.getMinint() != null) {
setIntValue(guard.getMinint(), min);
- else
+ } else {
guard.setMinint(createLiteralInteger(min));
- if(guard.getMaxint() != null)
+ }
+ if (guard.getMaxint() != null) {
setIntValue(guard.getMaxint(), max);
- else
+ } else {
guard.setMaxint(createLiteralInteger(max));
- if(parts.length > 1)
+ }
+ if (parts.length > 1) {
text = parts[1] == null ? "" : parts[1].trim();
- else
+ } else {
text = "";
+ }
} else {
guard.setMinint(null);
guard.setMaxint(null);
}
}
- if(guard.getSpecification() != null || text.length() > 0) {
+ if (guard.getSpecification() != null || text.length() > 0) {
LiteralString literalString = UMLFactory.eINSTANCE.createLiteralString();
literalString.setValue(text);
guard.setSpecification(literalString);
@@ -887,8 +921,8 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
}
private void setIntValue(ValueSpecification spec, int val) {
- if(spec instanceof LiteralInteger) {
- ((LiteralInteger)spec).setValue(val);
+ if (spec instanceof LiteralInteger) {
+ ((LiteralInteger) spec).setValue(val);
}
}
@@ -911,7 +945,7 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
/**
* Constructor.
- *
+ *
*/
public GuardFigure() {
ToolbarLayout layout = new ToolbarLayout(false);
@@ -928,21 +962,21 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
}
/**
- * @see org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusUMLElementFigure#setStereotypeDisplay(java.lang.String,
- * org.eclipse.swt.graphics.Image)
- *
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusUMLElementFigure#setStereotypeDisplay(java.lang.String, org.eclipse.swt.graphics.Image)
+ *
* @param stereotypes
* @param image
*/
+ @Override
public void setStereotypeDisplay(String stereotypes, Image image) {
- if((stereotypes == null || stereotypes.trim().equals("")) && image == null) {
- if(stereotypeLabel != null) {
+ if ((stereotypes == null || stereotypes.trim().equals("")) && image == null) {
+ if (stereotypeLabel != null) {
remove(stereotypeLabel);
}
stereotypeLabel = null;
} else {
- if(stereotypeLabel == null) {
+ if (stereotypeLabel == null) {
stereotypeLabel = new Label();
add(stereotypeLabel, 0);
}
@@ -953,18 +987,19 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
/**
* @see org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeUMLElementFigure#setStereotypePropertiesInBrace(java.lang.String)
- *
+ *
* @param stereotypeProperties
*/
+ @Override
public void setStereotypePropertiesInBrace(String stereotypeProperties) {
- if(stereotypeProperties == null || stereotypeProperties.trim().equals("")) {
- if(stereotypePropertiesInBraceContent != null) {
+ if (stereotypeProperties == null || stereotypeProperties.trim().equals("")) {
+ if (stereotypePropertiesInBraceContent != null) {
remove(stereotypePropertiesInBraceContent);
}
stereotypePropertiesInBraceContent = null;
} else {
- if(stereotypePropertiesInBraceContent == null) {
+ if (stereotypePropertiesInBraceContent == null) {
stereotypePropertiesInBraceContent = new WrappingLabel();
stereotypePropertiesInBraceContent.setOpaque(false);
int index = getChildren().indexOf(stereotypeLabel);
@@ -977,60 +1012,66 @@ public class InteractionOperandGuardEditPart extends ShapeEditPart implements IT
/**
* @see org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeUMLElementFigure#setStereotypePropertiesInCompartment(java.lang.String)
- *
+ *
* @param stereotypeProperties
*/
+ @Override
public void setStereotypePropertiesInCompartment(String stereotypeProperties) {
}
/**
* @see org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeUMLElementFigure#getStereotypesLabel()
- *
+ *
* @return
*/
+ @Override
public Label getStereotypesLabel() {
return stereotypeLabel;
}
/**
* @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#setText(java.lang.String)
- *
+ *
* @param text
*/
+ @Override
public void setText(String text) {
primaryLabel.setText(text);
}
/**
* @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#getText()
- *
+ *
* @return
*/
+ @Override
public String getText() {
return primaryLabel.getText();
}
/**
* @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#setIcon(org.eclipse.swt.graphics.Image)
- *
+ *
* @param icon
*/
+ @Override
public void setIcon(Image icon) {
primaryLabel.setIcon(icon);
}
/**
* @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#getIcon()
- *
+ *
* @return
*/
+ @Override
public Image getIcon() {
return primaryLabel.getIcon();
}
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 451141ec844..7eb2cad0b53 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
@@ -88,7 +88,7 @@ import org.eclipse.uml2.uml.OccurrenceSpecification;
/**
* Edit part for message end to make it possible for selecting a messageEnd.
- *
+ *
*/
public class MessageEndEditPart extends GraphicalEditPart implements INodeEditPart {
@@ -110,57 +110,66 @@ public class MessageEndEditPart extends GraphicalEditPart implements INodeEditPa
public MessageEndEditPart(View view) {
super(view);
- if(view.getElement() instanceof MessageEnd)
- this.messageEnd = (MessageEnd)view.getElement();
+ if (view.getElement() instanceof MessageEnd) {
+ this.messageEnd = (MessageEnd) view.getElement();
+ }
}
+ @Override
public void setParent(EditPart parent) {
super.setParent(parent);
initLocator();
}
private void initLocator() {
- if(locator == null && messageEnd != null) {
+ if (locator == null && messageEnd != null) {
Message message = messageEnd.getMessage();
- if(message.getSendEvent() == messageEnd)
- locator = new ConnectionLocator(((AbstractConnectionEditPart)getParent()).getConnectionFigure(), ConnectionLocator.SOURCE);
- else
- locator = new ConnectionLocator(((AbstractConnectionEditPart)getParent()).getConnectionFigure(), ConnectionLocator.TARGET);
+ if (message.getSendEvent() == messageEnd) {
+ locator = new ConnectionLocator(((AbstractConnectionEditPart) getParent()).getConnectionFigure(), ConnectionLocator.SOURCE);
+ } else {
+ locator = new ConnectionLocator(((AbstractConnectionEditPart) getParent()).getConnectionFigure(), ConnectionLocator.TARGET);
+ }
}
}
@Override
protected void addNotationalListeners() {
- if(hasNotationView()) {
- addListenerFilter("View", this, (View)getModel()); //$NON-NLS-1$
+ if (hasNotationView()) {
+ addListenerFilter("View", this, (View) getModel()); //$NON-NLS-1$
}
}
+ @Override
protected List getModelSourceConnections() {
- return ViewUtil.getSourceConnectionsConnectingVisibleViews((View)getModel());
+ return ViewUtil.getSourceConnectionsConnectingVisibleViews((View) getModel());
}
+ @Override
protected List getModelTargetConnections() {
- List list = ViewUtil.getTargetConnectionsConnectingVisibleViews((View)getModel());
+ List list = ViewUtil.getTargetConnectionsConnectingVisibleViews((View) getModel());
return list;
}
+ @Override
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getView_SourceEdges().equals(feature))
+ if (NotationPackage.eINSTANCE.getView_SourceEdges().equals(feature)) {
refreshSourceConnections();
- else if(NotationPackage.eINSTANCE.getView_TargetEdges().equals(feature))
+ } else if (NotationPackage.eINSTANCE.getView_TargetEdges().equals(feature)) {
refreshTargetConnections();
- else
+ } else {
super.handleNotificationEvent(notification);
+ }
}
private static View createDummyView(AbstractMessageEditPart parent, EObject model) {
View view = parent.findChildByModel(model);
- if(view != null)
+ if (view != null) {
return view;
+ }
final Shape node = new ShapeImpl() {
+ @Override
public boolean eNotificationRequired() {
return true;
}
@@ -168,22 +177,26 @@ public class MessageEndEditPart extends GraphicalEditPart implements INodeEditPa
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(String.valueOf(VISUAL_ID));
node.setElement(model);
- // final View container = (View) parent.getModel();
- // ViewUtil.insertChildView(container.getDiagram(), node,-1, true);
+ // final View container = (View) parent.getModel();
+ // ViewUtil.insertChildView(container.getDiagram(), node,-1, true);
return node;
}
static class DummyCommand extends org.eclipse.emf.common.command.AbstractCommand {
+ @Override
public void execute() {
}
+ @Override
public void redo() {
}
+ @Override
public void undo() {
}
+ @Override
protected boolean prepare() {
return true;
}
@@ -192,12 +205,14 @@ public class MessageEndEditPart extends GraphicalEditPart implements INodeEditPa
private void addToResource(final View container, final View view) {
CommandHelper.executeCommandWithoutHistory(getEditingDomain(), new DummyCommand() {
+ @Override
public void execute() {
ViewUtil.insertChildView(container, view, -1, false);
}
}, true);
}
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new MessageEndSemanticEditPolicy());
@@ -213,127 +228,146 @@ public class MessageEndEditPart extends GraphicalEditPart implements INodeEditPa
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.
+ // 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);
}
+ @Override
protected IFigure createFigure() {
- final MessageEnd messageEnd = (MessageEnd)this.resolveSemanticElement();
+ final MessageEnd messageEnd = (MessageEnd) this.resolveSemanticElement();
IFigure fig = new MessageEndFigure();
fig.setForegroundColor(ColorConstants.white);
Label tooltip = new Label();
- if(messageEnd != null)
+ if (messageEnd != null) {
tooltip.setText(messageEnd.getName());
+ }
fig.setToolTip(tooltip);
fig.setOpaque(false);
// f.setFill(true);
- //((org.eclipse.gef.GraphicalEditPart) getParent()).getFigure().add(fig);
+ // ((org.eclipse.gef.GraphicalEditPart) getParent()).getFigure().add(fig);
return fig;
}
+ @Override
public boolean hasNotationView() {
return true;
}
+ @Override
public ConnectionAnchor getSourceConnectionAnchor(final ConnectionEditPart connEditPart) {
- final org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart connection = (org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart)connEditPart;
+ final org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart connection = (org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart) connEditPart;
String t = ""; //$NON-NLS-1$
try {
- t = (String)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ t = (String) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- Anchor a = ((Edge)connection.getModel()).getSourceAnchor();
- if(a instanceof IdentityAnchor)
- setResult(((IdentityAnchor)a).getId());
- else
+ Anchor a = ((Edge) connection.getModel()).getSourceAnchor();
+ if (a instanceof IdentityAnchor) {
+ setResult(((IdentityAnchor) a).getId());
+ }
+ else {
setResult(""); //$NON-NLS-1$
+ }
}
});
} catch (InterruptedException e) {
Trace.catching(DiagramUIPlugin.getInstance(), DiagramUIDebugOptions.EXCEPTIONS_CATCHING, getClass(), "getSourceConnectionAnchor", e); //$NON-NLS-1$
Log.error(DiagramUIPlugin.getInstance(), DiagramUIStatusCodes.IGNORED_EXCEPTION_WARNING, "getSourceConnectionAnchor", e); //$NON-NLS-1$
}
- IAnchorableFigure fig = ((IAnchorableFigure)getFigure());
+ IAnchorableFigure fig = ((IAnchorableFigure) getFigure());
return fig.getConnectionAnchor(t);
}
+ @Override
public ConnectionAnchor getTargetConnectionAnchor(ConnectionEditPart connEditPart) {
- final ConnectionNodeEditPart connection = (ConnectionNodeEditPart)connEditPart;
+ final ConnectionNodeEditPart connection = (ConnectionNodeEditPart) connEditPart;
String t = ""; //$NON-NLS-1$
try {
- t = (String)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ t = (String) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- Anchor a = ((Edge)connection.getModel()).getTargetAnchor();
- if(a instanceof IdentityAnchor)
- setResult(((IdentityAnchor)a).getId());
- else
+ Anchor a = ((Edge) connection.getModel()).getTargetAnchor();
+ if (a instanceof IdentityAnchor) {
+ setResult(((IdentityAnchor) a).getId());
+ }
+ else {
setResult(""); //$NON-NLS-1$
+ }
}
});
} catch (InterruptedException e) {
Trace.catching(DiagramUIPlugin.getInstance(), DiagramUIDebugOptions.EXCEPTIONS_CATCHING, getClass(), "getTargetConnectionAnchor", e); //$NON-NLS-1$
Log.error(DiagramUIPlugin.getInstance(), DiagramUIStatusCodes.IGNORED_EXCEPTION_WARNING, "getTargetConnectionAnchor", e); //$NON-NLS-1$
}
- IAnchorableFigure fig = ((IAnchorableFigure)getFigure());
+ IAnchorableFigure fig = ((IAnchorableFigure) getFigure());
ConnectionAnchor a = fig.getConnectionAnchor(t);
return a;
}
+ @Override
public ConnectionAnchor getTargetConnectionAnchor(Request request) {
Point center = getFigure().getBounds().getCenter();
getFigure().translateToAbsolute(center);
- Point pt = ((DropRequest)request).getLocation() == null ? center : new Point(((DropRequest)request).getLocation());
- if(request instanceof CreateRequest) {
+ Point pt = ((DropRequest) request).getLocation() == null ? center : new Point(((DropRequest) request).getLocation());
+ if (request instanceof CreateRequest) {
getFigure().translateToRelative(pt);
}
- ConnectionAnchor a = ((IAnchorableFigure)getFigure()).getTargetConnectionAnchorAt(pt);
+ ConnectionAnchor a = ((IAnchorableFigure) getFigure()).getTargetConnectionAnchorAt(pt);
return a;
}
+ @Override
public ConnectionAnchor getSourceConnectionAnchor(Request request) {
- IAnchorableFigure fig = ((IAnchorableFigure)getFigure());
- if(request instanceof ReconnectRequest) {
- if(((DropRequest)request).getLocation() == null) {
+ IAnchorableFigure fig = ((IAnchorableFigure) getFigure());
+ if (request instanceof ReconnectRequest) {
+ if (((DropRequest) request).getLocation() == null) {
return fig.getSourceConnectionAnchorAt(null);
}
- Point pt = ((DropRequest)request).getLocation().getCopy();
+ Point pt = ((DropRequest) request).getLocation().getCopy();
return fig.getSourceConnectionAnchorAt(pt);
- } else if(request instanceof DropRequest) {
- return fig.getSourceConnectionAnchorAt(((DropRequest)request).getLocation());
+ } else if (request instanceof DropRequest) {
+ return fig.getSourceConnectionAnchorAt(((DropRequest) request).getLocation());
}
return fig.getSourceConnectionAnchorAt(null);
}
+ @Override
public boolean canAttachNote() {
return true;
}
+ @Override
public String mapConnectionAnchorToTerminal(ConnectionAnchor c) {
- return ((IAnchorableFigure)getFigure()).getConnectionAnchorTerminal(c);
+ return ((IAnchorableFigure) getFigure()).getConnectionAnchorTerminal(c);
}
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.INodeEditPart#mapTerminalToConnectionAnchor(String)
*/
+ @Override
public ConnectionAnchor mapTerminalToConnectionAnchor(String terminal) {
- return ((IAnchorableFigure)getFigure()).getConnectionAnchor(terminal);
+ return ((IAnchorableFigure) getFigure()).getConnectionAnchor(terminal);
}
public void rebuildLinks(Diagram diagram) {
helper.collectViews(diagram);
- if(messageEnd == null)
+ if (messageEnd == null) {
return;
+ }
EAnnotation annotation = messageEnd.getEAnnotation("Connections");
- if(annotation != null) {
- for(EObject eo : annotation.getReferences()) {
+ 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();
- for(Object o : edges) {
- if(o instanceof Edge && ((Edge)o).getTarget() == null) {
- restoreEdgeTarget((Edge)o);
+ for (Object o : edges) {
+ if (o instanceof Edge && ((Edge) o).getTarget() == null) {
+ restoreEdgeTarget((Edge) o);
break;
}
}
@@ -344,16 +378,20 @@ public class MessageEndEditPart extends GraphicalEditPart implements INodeEditPa
private void restoreEdgeTarget(final Edge edge) {
org.eclipse.emf.common.command.Command c = new org.eclipse.emf.common.command.AbstractCommand() {
+ @Override
public void execute() {
- edge.setTarget((View)MessageEndEditPart.this.getModel());
+ edge.setTarget((View) MessageEndEditPart.this.getModel());
}
+ @Override
public void redo() {
}
+ @Override
public void undo() {
}
+ @Override
protected boolean prepare() {
return true;
}
@@ -366,19 +404,21 @@ public class MessageEndEditPart extends GraphicalEditPart implements INodeEditPa
*/
static class MessageEndGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
+ @Override
protected Connection createDummyConnection(Request req) {
Connection conn = super.createDummyConnection(req);
conn.setForegroundColor(org.eclipse.draw2d.ColorConstants.black);
return conn;
}
+ @Override
protected Command getConnectionAndRelationshipCreateCommand(CreateConnectionViewAndElementRequest request) {
Map<String, Object> extendedData = request.getExtendedData();
String requestHint = request.getConnectionViewAndElementDescriptor().getSemanticHint();
- if(((IHintedType)UMLElementTypes.GeneralOrdering_4012).getSemanticHint().equals(requestHint)) {
- if(getHost() instanceof MessageEndEditPart) {
+ if (((IHintedType) UMLElementTypes.GeneralOrdering_4012).getSemanticHint().equals(requestHint)) {
+ if (getHost() instanceof MessageEndEditPart) {
List<OccurrenceSpecification> events = new ArrayList<OccurrenceSpecification>(2);
- final MessageOccurrenceSpecification messageEnd = (MessageOccurrenceSpecification)((MessageEndEditPart)getHost()).resolveSemanticElement();
+ final MessageOccurrenceSpecification messageEnd = (MessageOccurrenceSpecification) ((MessageEndEditPart) getHost()).resolveSemanticElement();
events.add(messageEnd);
extendedData.put(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION, events);
extendedData.put(SequenceRequestConstant.OCCURRENCE_SPECIFICATION_LOCATION, request.getLocation());
@@ -387,13 +427,14 @@ public class MessageEndEditPart extends GraphicalEditPart implements INodeEditPa
return super.getConnectionAndRelationshipCreateCommand(request);
}
+ @Override
protected Command getConnectionAndRelationshipCompleteCommand(CreateConnectionViewAndElementRequest request) {
Map<String, Object> extendedData = request.getExtendedData();
String requestHint = request.getConnectionViewAndElementDescriptor().getSemanticHint();
- if(((IHintedType)UMLElementTypes.GeneralOrdering_4012).getSemanticHint().equals(requestHint)) {
- if(getHost() instanceof MessageEndEditPart) {
+ if (((IHintedType) UMLElementTypes.GeneralOrdering_4012).getSemanticHint().equals(requestHint)) {
+ if (getHost() instanceof MessageEndEditPart) {
List<OccurrenceSpecification> events = new ArrayList<OccurrenceSpecification>(2);
- final MessageOccurrenceSpecification messageEnd = (MessageOccurrenceSpecification)((MessageEndEditPart)getHost()).resolveSemanticElement();
+ final MessageOccurrenceSpecification messageEnd = (MessageOccurrenceSpecification) ((MessageEndEditPart) getHost()).resolveSemanticElement();
events.add(messageEnd);
extendedData.put(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2, events);
extendedData.put(SequenceRequestConstant.OCCURRENCE_SPECIFICATION_LOCATION_2, request.getLocation());
@@ -412,6 +453,7 @@ public class MessageEndEditPart extends GraphicalEditPart implements INodeEditPa
this.request = request;
}
+ @Override
public boolean canExecute() {
return true;
}
@@ -419,21 +461,21 @@ public class MessageEndEditPart extends GraphicalEditPart implements INodeEditPa
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
// adding new end
- if(request.getNewRelationshipEnd() instanceof MessageEnd) {
- MessageEndHelper.addConnectionSourceToMessageEnd((MessageEnd)request.getNewRelationshipEnd(), request.getReferenceOwner());
- if(request.getReferenceOwner() instanceof Constraint) {
- ((Constraint)request.getReferenceOwner()).getConstrainedElements().add((MessageEnd)request.getNewRelationshipEnd());
- } else if(request.getReferenceOwner() instanceof Comment) {
- ((Comment)request.getReferenceOwner()).getAnnotatedElements().add((MessageEnd)request.getNewRelationshipEnd());
+ if (request.getNewRelationshipEnd() instanceof MessageEnd) {
+ MessageEndHelper.addConnectionSourceToMessageEnd((MessageEnd) request.getNewRelationshipEnd(), request.getReferenceOwner());
+ if (request.getReferenceOwner() instanceof Constraint) {
+ ((Constraint) request.getReferenceOwner()).getConstrainedElements().add((MessageEnd) request.getNewRelationshipEnd());
+ } else if (request.getReferenceOwner() instanceof Comment) {
+ ((Comment) request.getReferenceOwner()).getAnnotatedElements().add((MessageEnd) request.getNewRelationshipEnd());
}
}
// removing old end
- if(request.getOldRelationshipEnd() instanceof MessageEnd) {
- MessageEndHelper.removeConnectionSourceFromMessageEnd((MessageEnd)request.getOldRelationshipEnd(), request.getReferenceOwner());
- if(request.getReferenceOwner() instanceof Constraint) {
- ((Constraint)request.getReferenceOwner()).getConstrainedElements().remove((MessageEnd)request.getOldRelationshipEnd());
- } else if(request.getReferenceOwner() instanceof Comment) {
- ((Comment)request.getReferenceOwner()).getAnnotatedElements().remove((MessageEnd)request.getOldRelationshipEnd());
+ if (request.getOldRelationshipEnd() instanceof MessageEnd) {
+ MessageEndHelper.removeConnectionSourceFromMessageEnd((MessageEnd) request.getOldRelationshipEnd(), request.getReferenceOwner());
+ if (request.getReferenceOwner() instanceof Constraint) {
+ ((Constraint) request.getReferenceOwner()).getConstrainedElements().remove(request.getOldRelationshipEnd());
+ } else if (request.getReferenceOwner() instanceof Comment) {
+ ((Comment) request.getReferenceOwner()).getAnnotatedElements().remove(request.getOldRelationshipEnd());
}
}
return CommandResult.newOKCommandResult();
@@ -442,31 +484,32 @@ 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));
+ 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.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommandEx(req, req.getSource(), req.getTarget()));
- } else if(UMLElementTypes.GeneralOrdering_4012 == req.getElementType()) {
+ } else if (UMLElementTypes.GeneralOrdering_4012 == req.getElementType()) {
return getGEFWrapper(new GeneralOrderingCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
}
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommandEx(req, req.getSource(), req.getTarget()));
- } else if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ } else if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return getGEFWrapper(new CommentAnnotatedElementCreateCommandEx(req, req.getSource(), req.getTarget()));
- } else if(UMLElementTypes.GeneralOrdering_4012 == req.getElementType()) {
+ } else if (UMLElementTypes.GeneralOrdering_4012 == req.getElementType()) {
return getGEFWrapper(new GeneralOrderingCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -488,10 +531,11 @@ public class MessageEndEditPart extends GraphicalEditPart implements INodeEditPa
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());
+ if (getTarget() instanceof MessageEnd) {
+ MessageEndHelper.addConnectionSourceToMessageEnd((MessageEnd) getTarget(), getSource());
}
return res;
}
@@ -506,8 +550,8 @@ public class MessageEndEditPart extends GraphicalEditPart implements INodeEditPa
@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());
+ if (getTarget() instanceof MessageEnd) {
+ MessageEndHelper.addConnectionSourceToMessageEnd((MessageEnd) getTarget(), getSource());
}
return res;
}
@@ -523,6 +567,7 @@ public class MessageEndEditPart extends GraphicalEditPart implements INodeEditPa
super(circleFigure);
}
+ @Override
public Point getLocation(Point reference) {
return getBox().getCenter();
}
@@ -543,21 +588,26 @@ public class MessageEndEditPart extends GraphicalEditPart implements INodeEditPa
// g.drawOval(r);
}
+ @Override
protected ConnectionAnchor createAnchor(PrecisionPoint p) {
- if(p == null)
+ if (p == null) {
return createDefaultAnchor();
+ }
return new MessageEndAnchor(this, p);
}
+ @Override
protected ConnectionAnchor createDefaultAnchor() {
return new MessageEndAnchor(this);
}
+ @Override
public void validate() {
relocateFigure(this);
super.validate();
}
+ @Override
public ConnectionAnchor getTargetConnectionAnchorAt(Point p) {
try {
return super.getTargetConnectionAnchorAt(p);
@@ -582,21 +632,22 @@ public class MessageEndEditPart extends GraphicalEditPart implements INodeEditPa
}
void collectViews(Diagram d) {
- if(diagram != d) { // compare pointer ref
+ if (diagram != d) { // compare pointer ref
diagram = d;
allViews.clear();
viewMaps.clear();
getAllNestedViews(diagram, allViews);
- for(View v : allViews) {
- if(v instanceof DecorationNode)
+ for (View v : allViews) {
+ if (v instanceof DecorationNode) {
continue;
+ }
viewMaps.put(v.getElement(), v);
}
}
}
static private void getAllNestedViews(View view, Set<View> allViews) {
- for(View childView : (List<View>)view.getChildren()) {
+ for (View childView : (List<View>) view.getChildren()) {
getAllNestedViews(childView, allViews);
allViews.add(childView);
}
@@ -605,31 +656,33 @@ public class MessageEndEditPart extends GraphicalEditPart implements INodeEditPa
@Override
public EditPart getTargetEditPart(Request request) {
- if(request instanceof CreateUnspecifiedTypeConnectionRequest) {
- List types = ((CreateUnspecifiedTypeConnectionRequest)request).getElementTypes();
- if(types.contains(UMLElementTypes.CommentAnnotatedElement_4010) || types.contains(UMLElementTypes.ConstraintConstrainedElement_4011) || types.contains(UMLElementTypes.GeneralOrdering_4012)) {
+ if (request instanceof CreateUnspecifiedTypeConnectionRequest) {
+ List types = ((CreateUnspecifiedTypeConnectionRequest) request).getElementTypes();
+ if (types.contains(UMLElementTypes.CommentAnnotatedElement_4010) || types.contains(UMLElementTypes.ConstraintConstrainedElement_4011) || types.contains(UMLElementTypes.GeneralOrdering_4012)) {
return super.getTargetEditPart(request);
}
- } else if(request instanceof ReconnectRequest) {
- ConnectionEditPart con = ((ReconnectRequest)request).getConnectionEditPart();
- if(con instanceof CommentAnnotatedElementEditPart || con instanceof ConstraintConstrainedElementEditPart || con instanceof GeneralOrderingEditPart) {
+ } else if (request instanceof ReconnectRequest) {
+ ConnectionEditPart con = ((ReconnectRequest) request).getConnectionEditPart();
+ if (con instanceof CommentAnnotatedElementEditPart || con instanceof ConstraintConstrainedElementEditPart || con instanceof GeneralOrderingEditPart) {
return super.getTargetEditPart(request);
}
- } else if(AnnotatedLinkEndEditPolicy.REQ_ANNOTATED_LINK_END.equals(request.getType()) || AnnotatedLinkEndEditPolicy.REQ_ANNOTATED_LINK_REORIENT_END.equals(request.getType())) {
+ } else if (AnnotatedLinkEndEditPolicy.REQ_ANNOTATED_LINK_END.equals(request.getType()) || AnnotatedLinkEndEditPolicy.REQ_ANNOTATED_LINK_REORIENT_END.equals(request.getType())) {
return super.getTargetEditPart(request);
- } else if(request instanceof CreateUnspecifiedTypeRequest && ((CreateUnspecifiedTypeRequest)request).getElementTypes().contains(UMLElementTypes.TimeConstraint_3019)) {
+ } else if (request instanceof CreateUnspecifiedTypeRequest && ((CreateUnspecifiedTypeRequest) request).getElementTypes().contains(UMLElementTypes.TimeConstraint_3019)) {
return super.getTargetEditPart(request);
}
- if(RequestConstants.REQ_SELECTION == request.getType() && isSelectable()) {
+ if (RequestConstants.REQ_SELECTION == request.getType() && isSelectable()) {
return this;
}
return null;
}
public void relocateFigure(MessageEndFigure fig) {
- if(locator == null)
+ if (locator == null) {
initLocator();
- if(locator != null)
+ }
+ if (locator != null) {
locator.relocate(fig);
+ }
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageEndHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageEndHelper.java
index ff4eb985ffd..12b755caca3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageEndHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageEndHelper.java
@@ -9,19 +9,20 @@ public class MessageEndHelper {
public static void removeConnectionSourceFromMessageEnd(MessageEnd messageEnd, EObject connectionSource) {
EAnnotation annotation = messageEnd.getEAnnotation("Connections");
- if(annotation != null) {
+ if (annotation != null) {
annotation.getReferences().remove(connectionSource);
}
}
public static void addConnectionSourceToMessageEnd(MessageEnd messageEnd, EObject connectionSource) {
EAnnotation annotation = messageEnd.getEAnnotation("Connections");
- if(annotation == null) {
+ if (annotation == null) {
annotation = EcoreFactory.eINSTANCE.createEAnnotation();
annotation.setSource("Connections"); //$NON-NLS-1$
messageEnd.getEAnnotations().add(annotation);
}
- if(!annotation.getReferences().contains(connectionSource))
+ if (!annotation.getReferences().contains(connectionSource)) {
annotation.getReferences().add(connectionSource);
+ }
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ObservationLinkEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ObservationLinkEditPart.java
index 1d4a40906fd..6767b87db03 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ObservationLinkEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ObservationLinkEditPart.java
@@ -18,7 +18,7 @@ import org.eclipse.uml2.uml.TimeObservation;
/**
* Observation link editpart used by time observation and duration observation
- *
+ *
*/
public class ObservationLinkEditPart extends AnnotatedLinkEditPart {
@@ -26,12 +26,13 @@ public class ObservationLinkEditPart extends AnnotatedLinkEditPart {
super(view);
}
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomComponentEditPolicy());
- //installEditPolicy(EditPolicy.COMPONENT_ROLE, new CustomComponentEditPolicy());
- //SequenceUtil.OBSERVATION_LINK_TYPE
- // installEditPolicy(EditPolicy.CONNECTION_ENDPOINTS_ROLE,new CustomConnectionEndpointEditPolicy());
+ // installEditPolicy(EditPolicy.COMPONENT_ROLE, new CustomComponentEditPolicy());
+ // SequenceUtil.OBSERVATION_LINK_TYPE
+ // installEditPolicy(EditPolicy.CONNECTION_ENDPOINTS_ROLE,new CustomConnectionEndpointEditPolicy());
}
private final class CustomComponentEditPolicy extends SemanticEditPolicy {
@@ -39,23 +40,23 @@ public class ObservationLinkEditPart extends AnnotatedLinkEditPart {
@Override
protected Command getSemanticCommand(IEditCommandRequest request) {
Command semanticCommand = super.getSemanticCommand(request);
- if(semanticCommand != null) {
- if(semanticCommand instanceof ICommandProxy) {
- ICommandProxy proxy = (ICommandProxy)semanticCommand;
- if(proxy.getICommand() instanceof CompositeTransactionalCommand) {
- CompositeTransactionalCommand compositeCommand = (CompositeTransactionalCommand)proxy.getICommand();
+ if (semanticCommand != null) {
+ if (semanticCommand instanceof ICommandProxy) {
+ ICommandProxy proxy = (ICommandProxy) semanticCommand;
+ if (proxy.getICommand() instanceof CompositeTransactionalCommand) {
+ CompositeTransactionalCommand compositeCommand = (CompositeTransactionalCommand) proxy.getICommand();
// update TimeObservation or DurationObservation model
- final ObservationLinkEditPart link = (ObservationLinkEditPart)getHost();
+ final ObservationLinkEditPart link = (ObservationLinkEditPart) getHost();
AbstractTransactionalCommand updateLinkSourceModelCmd = new AbstractTransactionalCommand(link.getEditingDomain(), "", null) {
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
EditPart source = link.getSource();
- if(source instanceof TimeObservationLabelEditPart) {
- TimeObservation timeObservation = (TimeObservation)((TimeObservationLabelEditPart)source).resolveSemanticElement();
+ if (source instanceof TimeObservationLabelEditPart) {
+ TimeObservation timeObservation = (TimeObservation) ((TimeObservationLabelEditPart) source).resolveSemanticElement();
timeObservation.setEvent(null);
- } else if(source instanceof DurationObservationEditPart) {
- DurationObservation durationObservation = (DurationObservation)((DurationObservationEditPart)source).resolveSemanticElement();
+ } else if (source instanceof DurationObservationEditPart) {
+ DurationObservation durationObservation = (DurationObservation) ((DurationObservationEditPart) source).resolveSemanticElement();
durationObservation.getEvents().clear();
}
return CommandResult.newOKCommandResult();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AbstractHeadImpactLayoutEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AbstractHeadImpactLayoutEditPolicy.java
index 643015f8bb7..6676eeabd8a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AbstractHeadImpactLayoutEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AbstractHeadImpactLayoutEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -44,7 +44,7 @@ import org.eclipse.uml2.uml.Element;
* Ignore the impact layout when the head get changed.
* 1. Font of head label changes.
* 2. Stereotype changes.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public abstract class AbstractHeadImpactLayoutEditPolicy extends GraphicalEditPolicy implements NotificationListener, IPapyrusListener {
@@ -56,24 +56,25 @@ public abstract class AbstractHeadImpactLayoutEditPolicy extends GraphicalEditPo
protected int currentHeadHeight = -1;
+ @Override
public void activate() {
// retrieve the view and the element managed by the edit part
View view = getView();
- if(view == null) {
+ if (view == null) {
return;
}
hostSemanticElement = getUMLElement();
// adds a listener on the view and the element controlled by the
// editpart
getDiagramEventBroker().addNotificationListener(view, this);
- if(hostSemanticElement == null) {
+ if (hostSemanticElement == null) {
return;
}
getDiagramEventBroker().addNotificationListener(hostSemanticElement, this);
// adds the listener for stereotype application and applied stereotypes
// add listener to react to the application and remove of a stereotype
// add a lister to each already applied stereotyped
- for(EObject stereotypeApplication : hostSemanticElement.getStereotypeApplications()) {
+ for (EObject stereotypeApplication : hostSemanticElement.getStereotypeApplications()) {
getDiagramEventBroker().addNotificationListener(stereotypeApplication, this);
}
currentHeadHeight = getHeadHeight();
@@ -84,28 +85,29 @@ public abstract class AbstractHeadImpactLayoutEditPolicy extends GraphicalEditPo
*/
public void impactLayout() {
int headHeight = getHeadHeight();
- if(currentHeadHeight > 0 && headHeight != currentHeadHeight) {
+ if (currentHeadHeight > 0 && headHeight != currentHeadHeight) {
doImpactLayout(headHeight - currentHeadHeight);
}
currentHeadHeight = headHeight;
}
/**
- *
+ *
* {@inheritDoc}
*/
+ @Override
public void deactivate() {
// retrieve the view and the element managed by the edit part
View view = getView();
- if(view == null) {
+ if (view == null) {
return;
}
getDiagramEventBroker().removeNotificationListener(view, this);
- if(hostSemanticElement == null) {
+ if (hostSemanticElement == null) {
return;
}
// remove listeners to applied stereotyped
- for(EObject stereotypeApplication : hostSemanticElement.getStereotypeApplications()) {
+ for (EObject stereotypeApplication : hostSemanticElement.getStereotypeApplications()) {
getDiagramEventBroker().removeNotificationListener(stereotypeApplication, this);
}
// remove notification on element
@@ -116,12 +118,12 @@ public abstract class AbstractHeadImpactLayoutEditPolicy extends GraphicalEditPo
/**
* Gets the diagram event broker from the editing domain.
- *
+ *
* @return the diagram event broker
*/
protected DiagramEventBroker getDiagramEventBroker() {
- TransactionalEditingDomain theEditingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
- if(theEditingDomain != null) {
+ TransactionalEditingDomain theEditingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
+ if (theEditingDomain != null) {
return DiagramEventBroker.getInstance(theEditingDomain);
}
return null;
@@ -129,48 +131,51 @@ public abstract class AbstractHeadImpactLayoutEditPolicy extends GraphicalEditPo
/**
* Returns the uml element controlled by the host edit part
- *
+ *
* @return the uml element controlled by the host edit part
*/
protected Element getUMLElement() {
EObject element = getView().getElement();
- if(element instanceof Element) {
- return (Element)element;
+ if (element instanceof Element) {
+ return (Element) element;
}
return null;
}
/**
* Returns the view controlled by the host edit part
- *
+ *
* @return the view controlled by the host edit part
*/
protected View getView() {
- return (View)getHost().getModel();
+ return (View) getHost().getModel();
}
/**
* @see org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener#notifyChanged(org.eclipse.emf.common.notify.Notification)
- *
+ *
* @param notification
*/
+ @Override
public void notifyChanged(Notification notification) {
Object feature = notification.getFeature();
boolean headChanged = false;
- if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
headChanged = true;
- } else if(notification.getNotifier() instanceof EAnnotation && UMLVisualInformationPapyrusConstant.STEREOTYPE_ANNOTATION == ((EAnnotation)notification.getNotifier()).getSource()) {
+ } else if (notification.getNotifier() instanceof EAnnotation && UMLVisualInformationPapyrusConstant.STEREOTYPE_ANNOTATION == ((EAnnotation) notification.getNotifier()).getSource()) {
headChanged = true;
- } else if((notification.getNotifier() instanceof DynamicEObjectImpl) && (hostSemanticElement != null) && (hostSemanticElement.getStereotypeApplications().contains(notification.getNotifier()))) {
+ } else if ((notification.getNotifier() instanceof DynamicEObjectImpl) && (hostSemanticElement != null) && (hostSemanticElement.getStereotypeApplications().contains(notification.getNotifier()))) {
headChanged = true;
- } else if(PapyrusStereotypeListener.MODIFIED_STEREOTYPE == notification.getEventType()) {
+ } else if (PapyrusStereotypeListener.MODIFIED_STEREOTYPE == notification.getEventType()) {
headChanged = true;
- } else if(notification instanceof StereotypeCustomNotification) {
+ } else if (notification instanceof StereotypeCustomNotification) {
headChanged = true;
}
- if(headChanged) {
+ if (headChanged) {
Display.getDefault().asyncExec(new Runnable() {
+ @Override
public void run() {
impactLayout();
}
@@ -181,10 +186,10 @@ public abstract class AbstractHeadImpactLayoutEditPolicy extends GraphicalEditPo
protected Rectangle getBoundsRect() {
Rectangle r = new Rectangle();
View view = getView();
- if(view instanceof Node) {
- LayoutConstraint layoutConstraint = ((Node)view).getLayoutConstraint();
- if(layoutConstraint instanceof Bounds) {
- Bounds b = (Bounds)layoutConstraint;
+ if (view instanceof Node) {
+ LayoutConstraint layoutConstraint = ((Node) view).getLayoutConstraint();
+ if (layoutConstraint instanceof Bounds) {
+ Bounds b = (Bounds) layoutConstraint;
r.x = b.getX();
r.y = b.getY();
r.width = b.getWidth();
@@ -192,39 +197,39 @@ public abstract class AbstractHeadImpactLayoutEditPolicy extends GraphicalEditPo
}
}
Rectangle bounds = getHostFigure().getBounds();
- if(r.x == -1) {
+ if (r.x == -1) {
r.x = bounds.x;
}
- if(r.y == -1) {
+ if (r.y == -1) {
r.y = bounds.y;
}
- if(r.width == -1) {
+ if (r.width == -1) {
r.width = bounds.width;
}
- if(r.height == -1) {
+ if (r.height == -1) {
r.height = bounds.height;
}
Dimension preferredSize = getHostFigure().getPreferredSize();
- if(r.width == 0) {
+ if (r.width == 0) {
r.width = preferredSize.width;
}
- if(r.height == 0) {
+ if (r.height == 0) {
r.height = preferredSize.height;
}
return r;
}
protected IFigure getPrimaryShape() {
- if(getHost() instanceof IPapyrusEditPart) {
- return ((IPapyrusEditPart)getHost()).getPrimaryShape();
+ if (getHost() instanceof IPapyrusEditPart) {
+ return ((IPapyrusEditPart) getHost()).getPrimaryShape();
}
return getHostFigure();
}
protected TransactionalEditingDomain getEditingDomain() {
EditPart host = getHost();
- if(host instanceof IGraphicalEditPart) {
- return ((IGraphicalEditPart)host).getEditingDomain();
+ if (host instanceof IGraphicalEditPart) {
+ return ((IGraphicalEditPart) host).getEditingDomain();
}
return null;
}
@@ -236,7 +241,7 @@ public abstract class AbstractHeadImpactLayoutEditPolicy extends GraphicalEditPo
/**
* Layout contents when the height of head has been changed.
- *
+ *
* @param resizeDelta
*/
protected abstract void doImpactLayout(int resizeDelta);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AbstractMessageItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AbstractMessageItemSemanticEditPolicy.java
index 1077206c687..8e1323cbc84 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AbstractMessageItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AbstractMessageItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -21,15 +21,16 @@ import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
import org.eclipse.gmf.runtime.notation.View;
/**
* Abstract ItemSemanticEditPolicy for messages.
- *
+ *
* Try to fixed bugs about reorient target of messages, because all Message EditParts implementing ITreeBranchEditPart, if we want to reorient target
* of a message to another message, the new target would be redirected to the target of the message. GMF use this to merge two links, but we doesn't
* need them for message creation.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class AbstractMessageItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
@@ -40,22 +41,22 @@ public class AbstractMessageItemSemanticEditPolicy extends UMLBaseItemSemanticEd
@Override
protected Command getReorientRelationshipTargetCommand(ReconnectRequest request) {
- EObject connectionSemElement = ViewUtil.resolveSemanticElement((View)request.getConnectionEditPart().getModel());
- EObject targetSemElement = ViewUtil.resolveSemanticElement((View)request.getTarget().getModel());
- EObject oldSemElement = ViewUtil.resolveSemanticElement((View)request.getConnectionEditPart().getTarget().getModel());
+ EObject connectionSemElement = ViewUtil.resolveSemanticElement((View) request.getConnectionEditPart().getModel());
+ EObject targetSemElement = ViewUtil.resolveSemanticElement((View) request.getTarget().getModel());
+ EObject oldSemElement = ViewUtil.resolveSemanticElement((View) request.getConnectionEditPart().getTarget().getModel());
// check if we need to redirect the semantic request because of a tree
// gesture.
- // String connectionHint = ViewUtil.getSemanticElementClassId((View)request.getConnectionEditPart().getModel());
- // if(((View)request.getTarget().getModel()).getElement() != null) {
- // String targetHint = ViewUtil.getSemanticElementClassId((View)request.getTarget().getModel());
- // if(request.getConnectionEditPart() instanceof ITreeBranchEditPart && request.getTarget() instanceof ITreeBranchEditPart && connectionHint.equals(targetHint)) {
- // ITreeBranchEditPart targetBranch = (ITreeBranchEditPart)request.getTarget();
+ // String connectionHint = ViewUtil.getSemanticElementClassId((View)request.getConnectionEditPart().getModel());
+ // if(((View)request.getTarget().getModel()).getElement() != null) {
+ // String targetHint = ViewUtil.getSemanticElementClassId((View)request.getTarget().getModel());
+ // if(request.getConnectionEditPart() instanceof ITreeBranchEditPart && request.getTarget() instanceof ITreeBranchEditPart && connectionHint.equals(targetHint)) {
+ // ITreeBranchEditPart targetBranch = (ITreeBranchEditPart)request.getTarget();
//
- // targetSemElement = ViewUtil.resolveSemanticElement((View)targetBranch.getTarget().getModel());
- // }
- // }
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
- ReorientRelationshipRequest semRequest = new ReorientRelationshipRequest(editingDomain, connectionSemElement, targetSemElement, oldSemElement, ReorientRelationshipRequest.REORIENT_TARGET);
+ // targetSemElement = ViewUtil.resolveSemanticElement((View)targetBranch.getTarget().getModel());
+ // }
+ // }
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
+ ReorientRelationshipRequest semRequest = new ReorientRelationshipRequest(editingDomain, connectionSemElement, targetSemElement, oldSemElement, ReorientRequest.REORIENT_TARGET);
semRequest.addParameters(request.getExtendedData());
return getSemanticCommand(semRequest);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AnnotatedConnectionHandleEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AnnotatedConnectionHandleEditPolicy.java
index 9ae2d8ff2d9..67dc7036685 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AnnotatedConnectionHandleEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AnnotatedConnectionHandleEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -28,7 +28,7 @@ import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
/**
* Custom ConnectionHandleEditPolicy for Comment, Observation and Constraint, only one outgoing supported.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
@SuppressWarnings("restriction")
@@ -39,13 +39,13 @@ public class AnnotatedConnectionHandleEditPolicy extends SequenceConnectionHandl
protected List getHandleFigures() {
List list = new ArrayList(1);
String tooltip = buildTooltip(HandleDirection.OUTGOING);
- if(tooltip != null) {
- ConnectionHandle connectionHandle = new ConnectionHandle((IGraphicalEditPart)getHost(), HandleDirection.OUTGOING, tooltip);
+ if (tooltip != null) {
+ ConnectionHandle connectionHandle = new ConnectionHandle((IGraphicalEditPart) getHost(), HandleDirection.OUTGOING, tooltip);
connectionHandle.setDragTracker(new ConnectionHandleTool(connectionHandle) {
@Override
protected String getCommandName() {
- if(isInState(STATE_CONNECTION_STARTED | STATE_ACCESSIBLE_DRAG_IN_PROGRESS)) {
+ if (isInState(STATE_CONNECTION_STARTED | STATE_ACCESSIBLE_DRAG_IN_PROGRESS)) {
return AnnotatedLinkEndEditPolicy.REQ_ANNOTATED_LINK_END;
} else {
return AnnotatedLinkStartEditPolicy.REQ_ANNOTATED_LINK_START;
@@ -54,7 +54,7 @@ public class AnnotatedConnectionHandleEditPolicy extends SequenceConnectionHandl
@Override
protected CreateConnectionRequest createTargetRequest() {
- IHintedType type = (IHintedType)UMLElementTypes.CommentAnnotatedElement_4010;
+ IHintedType type = (IHintedType) UMLElementTypes.CommentAnnotatedElement_4010;
return new CreateConnectionViewRequest(new ConnectionViewDescriptor(type, type.getSemanticHint(), getPreferencesHint()));
}
});
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 f714683d7ca..91db4040eb1 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -49,11 +49,11 @@ import org.eclipse.uml2.uml.NamedElement;
/**
* An editpolicy for handling connections end from Comment, Constraint and Observations.
- *
+ *
* The semantic element of the Host should be a instance of {@link NamedElement}.
- *
+ *
* @see AnnotatedLinkStartEditPolicy
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class AnnotatedLinkEndEditPolicy extends GraphicalNodeEditPolicy {
@@ -66,31 +66,31 @@ public class AnnotatedLinkEndEditPolicy extends GraphicalNodeEditPolicy {
@Override
public EditPart getTargetEditPart(Request request) {
- if(REQ_ANNOTATED_LINK_END.equals(request.getType()) || REQ_ANNOTATED_LINK_REORIENT_END.equals(request.getType())) {
- Point location = ((DropRequest)request).getLocation();
+ if (REQ_ANNOTATED_LINK_END.equals(request.getType()) || REQ_ANNOTATED_LINK_REORIENT_END.equals(request.getType())) {
+ 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();
- for(Object object : children) {
- if(object instanceof CustomLifelineEditPart) {
- CustomLifelineFigure figure = ((CustomLifelineEditPart)object).getPrimaryShape();
+ // Fixed bugs when link with PartDecomposition.
+ if (host instanceof CustomLifelineEditPart && ((CustomLifelineEditPart) host).isInlineMode()) {
+ List children = ((CustomLifelineEditPart) host).getChildren();
+ for (Object object : children) {
+ if (object instanceof CustomLifelineEditPart) {
+ CustomLifelineFigure figure = ((CustomLifelineEditPart) object).getPrimaryShape();
Point pt = location.getCopy();
figure.translateToRelative(pt);
- if(figure.containsPoint(pt)) {
- return (EditPart)object;
+ if (figure.containsPoint(pt)) {
+ return (EditPart) object;
}
}
}
- IFigure nameFigure = ((CustomLifelineEditPart)host).getPrimaryShape().getFigureLifelineNameContainerFigure();
+ IFigure nameFigure = ((CustomLifelineEditPart) host).getPrimaryShape().getFigureLifelineNameContainerFigure();
Point pt = location.getCopy();
nameFigure.translateToRelative(pt);
- if(nameFigure.containsPoint(pt)) {
+ if (nameFigure.containsPoint(pt)) {
return host;
}
return null;
}
- if(isEnterAnchorArea(host, location)) {
+ if (isEnterAnchorArea(host, location)) {
return host;
}
}
@@ -99,12 +99,12 @@ public class AnnotatedLinkEndEditPolicy extends GraphicalNodeEditPolicy {
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();
+ 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
+ // if mouse location is far from border, do not handle connection event
Rectangle innerRetangle = figure.getBounds().getCopy().shrink(10, 10);
- if(innerRetangle.contains(p)) {
+ if (innerRetangle.contains(p)) {
return false;
}
}
@@ -113,24 +113,24 @@ public class AnnotatedLinkEndEditPolicy extends GraphicalNodeEditPolicy {
@Override
public Command getCommand(Request request) {
- if(REQ_ANNOTATED_LINK_END.equals(request.getType())) {
- return getConnectionCompleteCommand((CreateConnectionRequest)request);
- } else if(REQ_ANNOTATED_LINK_REORIENT_END.equals(request.getType())) {
- return getReconnectTargetCommand((ReconnectRequest)request);
+ if (REQ_ANNOTATED_LINK_END.equals(request.getType())) {
+ return getConnectionCompleteCommand((CreateConnectionRequest) request);
+ } else if (REQ_ANNOTATED_LINK_REORIENT_END.equals(request.getType())) {
+ return getReconnectTargetCommand((ReconnectRequest) request);
}
return null;
}
@Override
protected Command getReconnectTargetCommand(ReconnectRequest request) {
- ICommandProxy c = (ICommandProxy)super.getReconnectTargetCommand(request);
- if(c == null) {
+ ICommandProxy c = (ICommandProxy) super.getReconnectTargetCommand(request);
+ if (c == null) {
return null;
}
- if(request.getConnectionEditPart() instanceof AnnotatedLinkEditPart) {
- CompositeCommand cc = (CompositeCommand)c.getICommand();
+ if (request.getConnectionEditPart() instanceof AnnotatedLinkEditPart) {
+ CompositeCommand cc = (CompositeCommand) c.getICommand();
AnnotatedLinkEditCommand ac = new AnnotatedLinkEditCommand(getEditingDomain());
- ac.setAnnotatedLink((AnnotatedLinkEditPart)request.getConnectionEditPart());
+ ac.setAnnotatedLink((AnnotatedLinkEditPart) request.getConnectionEditPart());
ac.setTarget(getHost());
cc.add(ac);
return c;
@@ -139,95 +139,95 @@ public class AnnotatedLinkEndEditPolicy extends GraphicalNodeEditPolicy {
}
private TransactionalEditingDomain getEditingDomain() {
- return ((IGraphicalEditPart)getHost()).getEditingDomain();
+ return ((IGraphicalEditPart) getHost()).getEditingDomain();
}
@Override
protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
- ICommandProxy proxy = (ICommandProxy)super.getConnectionCompleteCommand(request);
- if(proxy == null) {
+ ICommandProxy proxy = (ICommandProxy) super.getConnectionCompleteCommand(request);
+ if (proxy == null) {
return null;
}
- CompositeCommand cc = (CompositeCommand)proxy.getICommand();
+ CompositeCommand cc = (CompositeCommand) proxy.getICommand();
@SuppressWarnings("rawtypes")
Iterator it = cc.iterator();
AnnotatedLinkEditCommand command = null;
- while(it.hasNext()) {
+ while (it.hasNext()) {
Object next = it.next();
- if(next instanceof AnnotatedLinkEditCommand) {
- command = (AnnotatedLinkEditCommand)next;
+ if (next instanceof AnnotatedLinkEditCommand) {
+ command = (AnnotatedLinkEditCommand) next;
break;
}
}
- if(command == null) {
+ if (command == null) {
return UnexecutableCommand.INSTANCE;
}
command.setTarget(getHost());
- //update bendpoints
- // if((request.getSourceEditPart() instanceof CustomDurationConstraintEditPart) && !(request.getTargetEditPart() instanceof CustomDurationConstraintEditPart)) {
- // updateConnectionBendpoints(request, proxy);
- // }
+ // update bendpoints
+ // if((request.getSourceEditPart() instanceof CustomDurationConstraintEditPart) && !(request.getTargetEditPart() instanceof CustomDurationConstraintEditPart)) {
+ // updateConnectionBendpoints(request, proxy);
+ // }
return proxy;
}
- // private void updateConnectionBendpoints(CreateConnectionRequest request, ICommandProxy proxy) {
- // ICommand iCommand = proxy.getICommand();
- // if(!(iCommand instanceof CompositeCommand)) {
- // return;
- // }
- // INodeEditPart targetEP = getConnectionCompleteEditPart(request);
- // if(targetEP == null) {
- // 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.getSourceConnectionAnchor(request);// sourceEditPart.mapTerminalToConnectionAnchor(scaCommand.getNewSourceTerminal());
- // Point sourcePoint = sourceAnchor.getLocation(sourceAnchor.getReferencePoint());
- // Point targetPoint = targetAnchor.getLocation(targetAnchor.getReferencePoint());
+ // private void updateConnectionBendpoints(CreateConnectionRequest request, ICommandProxy proxy) {
+ // ICommand iCommand = proxy.getICommand();
+ // if(!(iCommand instanceof CompositeCommand)) {
+ // return;
+ // }
+ // INodeEditPart targetEP = getConnectionCompleteEditPart(request);
+ // if(targetEP == null) {
+ // 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.getSourceConnectionAnchor(request);// sourceEditPart.mapTerminalToConnectionAnchor(scaCommand.getNewSourceTerminal());
+ // Point sourcePoint = sourceAnchor.getLocation(sourceAnchor.getReferencePoint());
+ // Point targetPoint = targetAnchor.getLocation(targetAnchor.getReferencePoint());
//
- // if(sourcePoint.y != targetPoint.y) {
- // PointList newList = new PointList(3);
- // newList.addPoint(sourcePoint);
- // Point p = new Point(DurationConstraintAutomaticRouter.BENDPOINT_GATE,0);//addBendpoint(sourcePoint.x, targetPoint.x, sourcePoint.y);
- // newList.addPoint(p);
- // newList.addPoint(targetPoint);
- // sbbCommand.setNewPointList(newList, sourceAnchor.getReferencePoint(), targetAnchor.getReferencePoint());
- // }
- // }
+ // if(sourcePoint.y != targetPoint.y) {
+ // PointList newList = new PointList(3);
+ // newList.addPoint(sourcePoint);
+ // Point p = new Point(DurationConstraintAutomaticRouter.BENDPOINT_GATE,0);//addBendpoint(sourcePoint.x, targetPoint.x, sourcePoint.y);
+ // newList.addPoint(p);
+ // newList.addPoint(targetPoint);
+ // sbbCommand.setNewPointList(newList, sourceAnchor.getReferencePoint(), targetAnchor.getReferencePoint());
+ // }
+ // }
//
- // private Point addBendpoint(int x, int x2, int y) {
- // if(Math.abs(x - x2) > 20) {
- // return new PrecisionPoint(x2 + 20 * Math.signum(x - x2), y);
- // } else {
- // return new PrecisionPoint(x2 + (x - x2) * 0.5, y);
- // }
- // }
+ // private Point addBendpoint(int x, int x2, int y) {
+ // if(Math.abs(x - x2) > 20) {
+ // return new PrecisionPoint(x2 + 20 * Math.signum(x - x2), y);
+ // } else {
+ // return new PrecisionPoint(x2 + (x - x2) * 0.5, y);
+ // }
+ // }
@Override
public void eraseTargetFeedback(Request request) {
- if(REQ_ANNOTATED_LINK_END.equals(request.getType())) {
- CreateConnectionRequest connReq = (CreateConnectionRequest)request;
+ if (REQ_ANNOTATED_LINK_END.equals(request.getType())) {
+ CreateConnectionRequest connReq = (CreateConnectionRequest) request;
EditPart sourceEditPart = connReq.getSourceEditPart();
EditPolicy editPolicy = sourceEditPart.getEditPolicy(AnnotatedLinkStartEditPolicy.ANNOTATED_LINK_START_ROLE);
- PolylineConnection connectionFeedback = (PolylineConnection)getConnectionFeedback(editPolicy);
- if(connectionFeedback != null) {
+ PolylineConnection connectionFeedback = (PolylineConnection) getConnectionFeedback(editPolicy);
+ if (connectionFeedback != null) {
connectionFeedback.setTargetDecoration(null);
}
}
@@ -235,26 +235,26 @@ public class AnnotatedLinkEndEditPolicy extends GraphicalNodeEditPolicy {
@Override
public void showSourceFeedback(Request request) {
- //do nothing, this is not the primary GraphicalNodeEditPolicy.
+ // do nothing, this is not the primary GraphicalNodeEditPolicy.
}
@Override
public void eraseSourceFeedback(Request request) {
- //do nothing, this is not the primary GraphicalNodeEditPolicy.
+ // do nothing, this is not the primary GraphicalNodeEditPolicy.
}
@Override
public void showTargetFeedback(Request request) {
- if(REQ_ANNOTATED_LINK_END.equals(request.getType())) {
- //Show circle feedback at target anchor
- CreateConnectionRequest connReq = (CreateConnectionRequest)request;
+ if (REQ_ANNOTATED_LINK_END.equals(request.getType())) {
+ // Show circle feedback at target anchor
+ CreateConnectionRequest connReq = (CreateConnectionRequest) request;
EditPart sourceEditPart = connReq.getSourceEditPart();
EditPolicy editPolicy = sourceEditPart.getEditPolicy(AnnotatedLinkStartEditPolicy.ANNOTATED_LINK_START_ROLE);
editPolicy.showSourceFeedback(request);
- PolylineConnection connectionFeedback = (PolylineConnection)getConnectionFeedback(editPolicy);
- if(connectionFeedback != null) {
+ PolylineConnection connectionFeedback = (PolylineConnection) getConnectionFeedback(editPolicy);
+ if (connectionFeedback != null) {
Command command = getHost().getCommand(request);
- if(command != null && command.canExecute()) {
+ if (command != null && command.canExecute()) {
EllipseDecoration dec = new EllipseDecoration();
dec.setPreferredSize(10, 10);
dec.setSize(10, 10);
@@ -269,11 +269,11 @@ public class AnnotatedLinkEndEditPolicy extends GraphicalNodeEditPolicy {
}
private Connection getConnectionFeedback(EditPolicy policy) {
- if(policy != null) {
+ if (policy != null) {
try {
Field f = org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy.class.getDeclaredField("connectionFeedback");
f.setAccessible(true);
- return (Connection)f.get(policy);
+ return (Connection) f.get(policy);
} catch (Exception e) {
e.printStackTrace();
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AnnotatedLinkEndpointEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AnnotatedLinkEndpointEditPolicy.java
index 62e200fca7f..8f619be929b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AnnotatedLinkEndpointEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AnnotatedLinkEndpointEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -36,10 +36,10 @@ import org.eclipse.swt.SWT;
/**
* An editpolicy for handling reconnections of an {@link AnnotatedLinkEditPart}.
- *
+ *
* @see AnnotatedLinkStartEditPolicy
* @see AnnotatedLinkEndEditPolicy
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class AnnotatedLinkEndpointEditPolicy extends ConnectionEndpointEditPolicy {
@@ -48,15 +48,15 @@ public class AnnotatedLinkEndpointEditPolicy extends ConnectionEndpointEditPolic
@Override
public void eraseSourceFeedback(Request request) {
- if(AnnotatedLinkStartEditPolicy.REQ_ANNOTATED_LINK_REORIENT_START.equals(request.getType()) || AnnotatedLinkEndEditPolicy.REQ_ANNOTATED_LINK_REORIENT_END.equals(request.getType())) {
- eraseConnectionMoveFeedback((ReconnectRequest)request);
+ if (AnnotatedLinkStartEditPolicy.REQ_ANNOTATED_LINK_REORIENT_START.equals(request.getType()) || AnnotatedLinkEndEditPolicy.REQ_ANNOTATED_LINK_REORIENT_END.equals(request.getType())) {
+ eraseConnectionMoveFeedback((ReconnectRequest) request);
}
}
@Override
public void showSourceFeedback(Request request) {
- if(AnnotatedLinkStartEditPolicy.REQ_ANNOTATED_LINK_REORIENT_START.equals(request.getType()) || AnnotatedLinkEndEditPolicy.REQ_ANNOTATED_LINK_REORIENT_END.equals(request.getType())) {
- showConnectionMoveFeedback((ReconnectRequest)request);
+ if (AnnotatedLinkStartEditPolicy.REQ_ANNOTATED_LINK_REORIENT_START.equals(request.getType()) || AnnotatedLinkEndEditPolicy.REQ_ANNOTATED_LINK_REORIENT_END.equals(request.getType())) {
+ showConnectionMoveFeedback((ReconnectRequest) request);
}
}
@@ -65,15 +65,15 @@ public class AnnotatedLinkEndpointEditPolicy extends ConnectionEndpointEditPolic
super.showConnectionMoveFeedback(request);
EditPart target = request.getTarget();
boolean showFeedback = target != null;
- if(target != null) {
+ if (target != null) {
Command command = target.getCommand(request);
showFeedback = command != null && command.canExecute();
}
- if(showFeedback) {
+ if (showFeedback) {
Point location = null;
Connection connection = getConnection();
PointList points = connection.getPoints().getCopy();
- if(request.isMovingStartAnchor()) {
+ if (request.isMovingStartAnchor()) {
location = points.getFirstPoint();
} else {
location = points.getLastPoint();
@@ -81,7 +81,7 @@ public class AnnotatedLinkEndpointEditPolicy extends ConnectionEndpointEditPolic
connection.translateToAbsolute(location);
setFeedbackLocation(getAnchorFeedback(), location);
} else {
- if(anchorFeedback != null && anchorFeedback.getParent() != null) {
+ if (anchorFeedback != null && anchorFeedback.getParent() != null) {
removeFeedback(anchorFeedback);
}
anchorFeedback = null;
@@ -91,14 +91,14 @@ public class AnnotatedLinkEndpointEditPolicy extends ConnectionEndpointEditPolic
@Override
protected void eraseConnectionMoveFeedback(ReconnectRequest request) {
super.eraseConnectionMoveFeedback(request);
- if(anchorFeedback != null && anchorFeedback.getParent() != null) {
+ if (anchorFeedback != null && anchorFeedback.getParent() != null) {
removeFeedback(anchorFeedback);
}
anchorFeedback = null;
}
private void setFeedbackLocation(IFigure feedback, Point location) {
- if(feedback == null || location == null) {
+ if (feedback == null || location == null) {
return;
}
Point p = location.getCopy();
@@ -110,7 +110,7 @@ public class AnnotatedLinkEndpointEditPolicy extends ConnectionEndpointEditPolic
}
private IFigure getAnchorFeedback() {
- if(anchorFeedback == null || anchorFeedback.getParent() == null) {
+ if (anchorFeedback == null || anchorFeedback.getParent() == null) {
Ellipse feedback = new Ellipse();
feedback.setLineWidth(2);
feedback.setAntialias(SWT.ON);
@@ -125,11 +125,11 @@ public class AnnotatedLinkEndpointEditPolicy extends ConnectionEndpointEditPolic
@Override
protected List createSelectionHandles() {
List list = new ArrayList();
- list.add(new ConnectionEndpointHandle((ConnectionEditPart)getHost(), ConnectionLocator.SOURCE) {
+ list.add(new ConnectionEndpointHandle((ConnectionEditPart) getHost(), ConnectionLocator.SOURCE) {
@Override
protected DragTracker createDragTracker() {
- ConnectionEndpointTracker tracker = new ConnectionEndpointTracker((ConnectionEditPart)getOwner()) {
+ ConnectionEndpointTracker tracker = new ConnectionEndpointTracker((ConnectionEditPart) getOwner()) {
@Override
protected Request createTargetRequest() {
@@ -149,11 +149,11 @@ public class AnnotatedLinkEndpointEditPolicy extends ConnectionEndpointEditPolic
return tracker;
}
});
- list.add(new ConnectionEndpointHandle((ConnectionEditPart)getHost(), ConnectionLocator.TARGET) {
+ list.add(new ConnectionEndpointHandle((ConnectionEditPart) getHost(), ConnectionLocator.TARGET) {
@Override
protected DragTracker createDragTracker() {
- ConnectionEndpointTracker tracker = new ConnectionEndpointTracker((ConnectionEditPart)getOwner()) {
+ ConnectionEndpointTracker tracker = new ConnectionEndpointTracker((ConnectionEditPart) getOwner()) {
@Override
protected Request createTargetRequest() {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AnnotatedLinkStartEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AnnotatedLinkStartEditPolicy.java
index 7827bf89a55..fb47323dd95 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AnnotatedLinkStartEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AnnotatedLinkStartEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -38,9 +38,9 @@ import org.eclipse.uml2.uml.TimeObservation;
/**
* An editpolicy for handling connections start from Comment, Constraint and Observations.
- *
+ *
* @see AnnotatedLinkEndEditPolicy
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class AnnotatedLinkStartEditPolicy extends GraphicalNodeEditPolicy {
@@ -53,7 +53,7 @@ public class AnnotatedLinkStartEditPolicy extends GraphicalNodeEditPolicy {
@Override
public EditPart getTargetEditPart(Request request) {
- if(REQ_ANNOTATED_LINK_START.equals(request.getType()) || REQ_ANNOTATED_LINK_REORIENT_START.equals(request.getType())) {
+ if (REQ_ANNOTATED_LINK_START.equals(request.getType()) || REQ_ANNOTATED_LINK_REORIENT_START.equals(request.getType())) {
return getConnectableEditPart();
}
return null;
@@ -65,24 +65,24 @@ public class AnnotatedLinkStartEditPolicy extends GraphicalNodeEditPolicy {
@Override
protected INodeEditPart getConnectableEditPart() {
EditPart host = getHost();
- if(host instanceof INodeEditPart) {
- return (INodeEditPart)host;
+ if (host instanceof INodeEditPart) {
+ return (INodeEditPart) host;
} else {
- IGraphicalEditPart hostGraphical = (IGraphicalEditPart)host.getAdapter(IGraphicalEditPart.class);
- if(hostGraphical == null) {
+ IGraphicalEditPart hostGraphical = (IGraphicalEditPart) host.getAdapter(IGraphicalEditPart.class);
+ if (hostGraphical == null) {
return null;
}
EObject element = hostGraphical.resolveSemanticElement();
- if(element == null) {
+ if (element == null) {
return null;
}
EditPart parent = host.getParent();
- if(!(parent instanceof INodeEditPart)) {
+ if (!(parent instanceof INodeEditPart)) {
return null;
}
- IGraphicalEditPart parentGraphical = (IGraphicalEditPart)parent.getAdapter(IGraphicalEditPart.class);
- if(parentGraphical != null && element == parentGraphical.resolveSemanticElement()) {
- return (INodeEditPart)parent;
+ IGraphicalEditPart parentGraphical = (IGraphicalEditPart) parent.getAdapter(IGraphicalEditPart.class);
+ if (parentGraphical != null && element == parentGraphical.resolveSemanticElement()) {
+ return (INodeEditPart) parent;
}
}
return null;
@@ -90,25 +90,25 @@ public class AnnotatedLinkStartEditPolicy extends GraphicalNodeEditPolicy {
@Override
public Command getCommand(Request request) {
- if(REQ_ANNOTATED_LINK_START.equals(request.getType())) {
- return getConnectionCreateCommand((CreateConnectionRequest)request);
- } else if(REQ_ANNOTATED_LINK_REORIENT_START.equals(request.getType())) {
- return getReconnectSourceCommand((ReconnectRequest)request);
+ if (REQ_ANNOTATED_LINK_START.equals(request.getType())) {
+ return getConnectionCreateCommand((CreateConnectionRequest) request);
+ } else if (REQ_ANNOTATED_LINK_REORIENT_START.equals(request.getType())) {
+ return getReconnectSourceCommand((ReconnectRequest) request);
}
return null;
}
@Override
public void showSourceFeedback(Request request) {
- if(AnnotatedLinkEndEditPolicy.REQ_ANNOTATED_LINK_END.equals(request.getType())) {
- showCreationFeedback((CreateConnectionRequest)request);
+ if (AnnotatedLinkEndEditPolicy.REQ_ANNOTATED_LINK_END.equals(request.getType())) {
+ showCreationFeedback((CreateConnectionRequest) request);
}
}
@Override
public void eraseSourceFeedback(Request request) {
- if(AnnotatedLinkEndEditPolicy.REQ_ANNOTATED_LINK_END.equals(request.getType())) {
- eraseCreationFeedback((CreateConnectionRequest)request);
+ if (AnnotatedLinkEndEditPolicy.REQ_ANNOTATED_LINK_END.equals(request.getType())) {
+ eraseCreationFeedback((CreateConnectionRequest) request);
}
}
@@ -122,26 +122,26 @@ public class AnnotatedLinkStartEditPolicy extends GraphicalNodeEditPolicy {
@Override
protected Command getReconnectSourceCommand(ReconnectRequest request) {
EditPart host = getHost();
- //Quickly failed for TimeObservation, the event of a TimeObservation can only one.
- if(host instanceof GraphicalEditPart) {
- View primaryView = ((GraphicalEditPart)host).getPrimaryView();
+ // Quickly failed for TimeObservation, the event of a TimeObservation can only one.
+ if (host instanceof GraphicalEditPart) {
+ View primaryView = ((GraphicalEditPart) host).getPrimaryView();
EObject element = ViewUtil.resolveSemanticElement(primaryView);
- if(element instanceof TimeObservation && ((TimeObservation)element).getEvent() != null) {
+ if (element instanceof TimeObservation && ((TimeObservation) element).getEvent() != null) {
return UnexecutableCommand.INSTANCE;
}
}
- ICommandProxy c = (ICommandProxy)super.getReconnectSourceCommand(request);
- if(c == null) {
+ ICommandProxy c = (ICommandProxy) super.getReconnectSourceCommand(request);
+ if (c == null) {
return null;
}
- if(request.getConnectionEditPart() instanceof AnnotatedLinkEditPart) {
- if(getHost() instanceof CustomDurationConstraintEditPart && !((CustomDurationConstraintEditPart)getHost()).canCreateLink(request.getLocation())) {
+ if (request.getConnectionEditPart() instanceof AnnotatedLinkEditPart) {
+ if (getHost() instanceof CustomDurationConstraintEditPart && !((CustomDurationConstraintEditPart) getHost()).canCreateLink(request.getLocation())) {
return UnexecutableCommand.INSTANCE; // only 2 links are allowed, one for each side
}
- CompositeCommand cc = (CompositeCommand)c.getICommand();
+ CompositeCommand cc = (CompositeCommand) c.getICommand();
AnnotatedLinkEditCommand ac = new AnnotatedLinkEditCommand(getEditingDomain());
- ac.setAnnotatedLink((AnnotatedLinkEditPart)request.getConnectionEditPart());
+ ac.setAnnotatedLink((AnnotatedLinkEditPart) request.getConnectionEditPart());
ac.setSource(getHost());
cc.add(ac);
return c;
@@ -152,23 +152,23 @@ public class AnnotatedLinkStartEditPolicy extends GraphicalNodeEditPolicy {
@Override
protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
EditPart host = getHost();
- //Quickly failed for TimeObservation, the event of a TimeObservation can only one.
- if(host instanceof GraphicalEditPart) {
- View primaryView = ((GraphicalEditPart)host).getPrimaryView();
+ // Quickly failed for TimeObservation, the event of a TimeObservation can only one.
+ if (host instanceof GraphicalEditPart) {
+ View primaryView = ((GraphicalEditPart) host).getPrimaryView();
EObject element = ViewUtil.resolveSemanticElement(primaryView);
- if(element instanceof TimeObservation && ((TimeObservation)element).getEvent() != null) {
+ if (element instanceof TimeObservation && ((TimeObservation) element).getEvent() != null) {
return UnexecutableCommand.INSTANCE;
}
- if(host instanceof CustomDurationConstraintEditPart) {
- boolean can = ((CustomDurationConstraintEditPart)host).canCreateLink(request.getLocation());
- if(!can) {
+ if (host instanceof CustomDurationConstraintEditPart) {
+ boolean can = ((CustomDurationConstraintEditPart) host).canCreateLink(request.getLocation());
+ if (!can) {
return UnexecutableCommand.INSTANCE;
}
}
}
Command command = super.getConnectionCreateCommand(request);
- if(command instanceof ICommandProxy) {
- CompositeCommand cc = (CompositeCommand)((ICommandProxy)command).getICommand();
+ if (command instanceof ICommandProxy) {
+ CompositeCommand cc = (CompositeCommand) ((ICommandProxy) command).getICommand();
AnnotatedLinkEditCommand operation = new AnnotatedLinkEditCommand(getEditingDomain());
operation.setSource(getHost());
cc.add(operation);
@@ -177,6 +177,6 @@ public class AnnotatedLinkStartEditPolicy extends GraphicalNodeEditPolicy {
}
private TransactionalEditingDomain getEditingDomain() {
- return ((IGraphicalEditPart)getHost()).getEditingDomain();
+ return ((IGraphicalEditPart) getHost()).getEditingDomain();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AppliedStereotypeCommentCreationEditPolicyEx.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AppliedStereotypeCommentCreationEditPolicyEx.java
index 125e17d5765..ce51e443bd2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AppliedStereotypeCommentCreationEditPolicyEx.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AppliedStereotypeCommentCreationEditPolicyEx.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013, 2014 Soyatec, CEA, 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
@@ -58,9 +58,9 @@ import org.eclipse.uml2.uml.Lifeline;
/**
* Rewrite the CreateAppliedStereotypeCommentViewCommand to create all Comment View on the Interaction, but not the container of current node.
- *
+ *
* Because we can not add any Node on some container view such as Lifeline.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class AppliedStereotypeCommentCreationEditPolicyEx extends AppliedStereotypeCommentCreationEditPolicy {
@@ -72,7 +72,7 @@ public class AppliedStereotypeCommentCreationEditPolicyEx extends AppliedStereot
/**
* Constructor.
- *
+ *
* @param domain
* @param owner
* @param x
@@ -84,9 +84,10 @@ public class AppliedStereotypeCommentCreationEditPolicyEx extends AppliedStereot
super(domain, owner, x, y, base_Element, isABordererElement);
}
+ @Override
public void doExecute() {
- //create the node
+ // create the node
Node node = NotationFactory.eINSTANCE.createShape();
node.setVisible(true);
Bounds bounds = NotationFactory.eINSTANCE.createBounds();
@@ -101,11 +102,11 @@ public class AppliedStereotypeCommentCreationEditPolicyEx extends AppliedStereot
connectCommentNode(owner, node);
- EObjectValueStyle eObjectValueStyle = (EObjectValueStyle)node.createStyle(NotationPackage.eINSTANCE.getEObjectValueStyle());
+ EObjectValueStyle eObjectValueStyle = (EObjectValueStyle) node.createStyle(NotationPackage.eINSTANCE.getEObjectValueStyle());
eObjectValueStyle.setEObjectValue(base_element);
eObjectValueStyle.setName("BASE_ELEMENT");
- //create the link
+ // create the link
Connector edge = NotationFactory.eINSTANCE.createConnector();
edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
@@ -122,17 +123,17 @@ public class AppliedStereotypeCommentCreationEditPolicyEx extends AppliedStereot
anchor = NotationFactory.eINSTANCE.createIdentityAnchor();
edge.setTargetAnchor(anchor);
View source = owner;
- while(source != null && !(source instanceof Shape || source instanceof Edge)) {
- source = (View)source.eContainer();
+ while (source != null && !(source instanceof Shape || source instanceof Edge)) {
+ source = (View) source.eContainer();
}
edge.setSource(source);
edge.setTarget(node);
edge.setElement(null);
- eObjectValueStyle = (EObjectValueStyle)edge.createStyle(NotationPackage.eINSTANCE.getEObjectValueStyle());
+ eObjectValueStyle = (EObjectValueStyle) edge.createStyle(NotationPackage.eINSTANCE.getEObjectValueStyle());
eObjectValueStyle.setEObjectValue(base_element);
eObjectValueStyle.setName("BASE_ELEMENT");
- //copy EAnnotation
+ // copy EAnnotation
final EAnnotation stereotypeAnnotation = owner.getEAnnotation(UMLVisualInformationPapyrusConstant.STEREOTYPE_ANNOTATION);
EAnnotation stereotypeAnnotationCopy = EcoreUtil.copy(stereotypeAnnotation);
node.getEAnnotations().add(stereotypeAnnotationCopy);
@@ -146,65 +147,65 @@ public class AppliedStereotypeCommentCreationEditPolicyEx extends AppliedStereot
/**
* add the comment node form the owner
- *
+ *
* @param owner
- * the view from which we want to display a comment stereotype, cannot be null
+ * the view from which we want to display a comment stereotype, cannot be null
* @param commentNode
- * node that represent the comment , cannot be null
+ * node that represent the comment , cannot be null
*/
private void connectCommentNode(View owner, Node commentNode) {
- //in the case of the edge the comment has to be placed into the common parent of each end
- // if(owner instanceof Edge) {
- // View viewSource = ((Edge)owner).getSource();
- // View viewTarget = ((Edge)owner).getSource();
- // //list of source parents
- // ArrayList<View> parentsSource = getParentTree(viewSource);
- // //list of source targets
- // ArrayList<View> parentsTarget = getParentTree(viewTarget);
- // View commonParent = null;
- // int index = 0;
- // //find the common
- // while(commonParent == null && index < parentsSource.size()) {
- // if(parentsTarget.contains(parentsSource.get(index))) {
- // commonParent = parentsSource.get(index);
- // if(!(commonParent instanceof BasicCompartment)) {
- // commonParent = null;
- // }
- // }
- // index++;
- // }
- // // a common has been found
- // if(commonParent != null) {
- // ((Bounds)commentNode.getLayoutConstraint()).setX(100);
- // ((Bounds)commentNode.getLayoutConstraint()).setY(100);
- // ViewUtil.insertChildView(commonParent, commentNode, ViewUtil.APPEND, true);
- // return;
- // }
- // }
- //generic case
- View econtainer = (View)owner.eContainer();
- if(owner instanceof Edge) {
- econtainer = (View)((Edge)owner).getSource().eContainer();
- ((Bounds)commentNode.getLayoutConstraint()).setX(100);
- ((Bounds)commentNode.getLayoutConstraint()).setY(100);
- while(econtainer instanceof Edge) {
- econtainer = (View)((Edge)econtainer).getSource().eContainer();
+ // in the case of the edge the comment has to be placed into the common parent of each end
+ // if(owner instanceof Edge) {
+ // View viewSource = ((Edge)owner).getSource();
+ // View viewTarget = ((Edge)owner).getSource();
+ // //list of source parents
+ // ArrayList<View> parentsSource = getParentTree(viewSource);
+ // //list of source targets
+ // ArrayList<View> parentsTarget = getParentTree(viewTarget);
+ // View commonParent = null;
+ // int index = 0;
+ // //find the common
+ // while(commonParent == null && index < parentsSource.size()) {
+ // if(parentsTarget.contains(parentsSource.get(index))) {
+ // commonParent = parentsSource.get(index);
+ // if(!(commonParent instanceof BasicCompartment)) {
+ // commonParent = null;
+ // }
+ // }
+ // index++;
+ // }
+ // // a common has been found
+ // if(commonParent != null) {
+ // ((Bounds)commentNode.getLayoutConstraint()).setX(100);
+ // ((Bounds)commentNode.getLayoutConstraint()).setY(100);
+ // ViewUtil.insertChildView(commonParent, commentNode, ViewUtil.APPEND, true);
+ // return;
+ // }
+ // }
+ // generic case
+ View econtainer = (View) owner.eContainer();
+ if (owner instanceof Edge) {
+ econtainer = (View) ((Edge) owner).getSource().eContainer();
+ ((Bounds) commentNode.getLayoutConstraint()).setX(100);
+ ((Bounds) commentNode.getLayoutConstraint()).setY(100);
+ while (econtainer instanceof Edge) {
+ econtainer = (View) ((Edge) econtainer).getSource().eContainer();
}
}
- //for the case of a port
- if(isBorderedElement) {
- if(econtainer.eContainer() != null) {
- econtainer = (View)econtainer.eContainer();
+ // for the case of a port
+ if (isBorderedElement) {
+ if (econtainer.eContainer() != null) {
+ econtainer = (View) econtainer.eContainer();
}
}
- //Ignore to create on self container.
- if(ViewUtil.resolveSemanticElement(owner) == ViewUtil.resolveSemanticElement(econtainer)) {
- econtainer = (View)econtainer.eContainer();
+ // Ignore to create on self container.
+ if (ViewUtil.resolveSemanticElement(owner) == ViewUtil.resolveSemanticElement(econtainer)) {
+ econtainer = (View) econtainer.eContainer();
}
- //We should NOT add any child to Lifeline Directly.
- while(econtainer != null && (ViewUtil.resolveSemanticElement(econtainer) instanceof Lifeline || ViewUtil.resolveSemanticElement(econtainer) instanceof CombinedFragment || ViewUtil.resolveSemanticElement(econtainer) instanceof InteractionOperand)) {
- econtainer = (View)econtainer.eContainer();
+ // We should NOT add any child to Lifeline Directly.
+ while (econtainer != null && (ViewUtil.resolveSemanticElement(econtainer) instanceof Lifeline || ViewUtil.resolveSemanticElement(econtainer) instanceof CombinedFragment || ViewUtil.resolveSemanticElement(econtainer) instanceof InteractionOperand)) {
+ econtainer = (View) econtainer.eContainer();
}
ViewUtil.insertChildView(econtainer, commentNode, ViewUtil.APPEND, true);
@@ -212,17 +213,17 @@ public class AppliedStereotypeCommentCreationEditPolicyEx extends AppliedStereot
/**
* @param view
- * the view for which we look for its parents, cannot be null
+ * the view for which we look for its parents, cannot be null
* @return the list of parents of a view
*/
private ArrayList<View> getParentTree(View view) {
ArrayList<View> parents = new ArrayList<View>();
View currentView = view;
- while(currentView != null) {
- currentView = (View)currentView.eContainer();
- if(currentView != null) {
- if(!(currentView instanceof DecorationNode) && !(currentView instanceof BasicCompartment)) {
- //parents.addAll(currentView.getChildren());
+ while (currentView != null) {
+ currentView = (View) currentView.eContainer();
+ if (currentView != null) {
+ if (!(currentView instanceof DecorationNode) && !(currentView instanceof BasicCompartment)) {
+ // parents.addAll(currentView.getChildren());
}
parents.add(currentView);
}
@@ -232,38 +233,40 @@ public class AppliedStereotypeCommentCreationEditPolicyEx extends AppliedStereot
}
}
+ @Override
protected void executeAppliedStereotypeCommentCreation(final EditPart editPart, final TransactionalEditingDomain domain, final EObject semanticElement) {
Display.getCurrent().asyncExec(new Runnable() {
+ @Override
public void run() {
int x = 200;
int y = 100;
- if(editPart.getModel() instanceof Node) {
- LayoutConstraint constraint = ((Node)editPart.getModel()).getLayoutConstraint();
- if(constraint instanceof Bounds) {
- x = x + ((Bounds)constraint).getX();
- y = ((Bounds)constraint).getY();
+ if (editPart.getModel() instanceof Node) {
+ LayoutConstraint constraint = ((Node) editPart.getModel()).getLayoutConstraint();
+ if (constraint instanceof Bounds) {
+ x = x + ((Bounds) constraint).getX();
+ y = ((Bounds) constraint).getY();
}
}
- if(editPart.getModel() instanceof Edge && ((((Edge)editPart.getModel()).getSource()) instanceof Node)) {
+ if (editPart.getModel() instanceof Edge && ((((Edge) editPart.getModel()).getSource()) instanceof Node)) {
- LayoutConstraint constraint = ((Node)((Edge)editPart.getModel()).getSource()).getLayoutConstraint();
- if(constraint instanceof Bounds) {
- x = x + ((Bounds)constraint).getX();
- y = ((Bounds)constraint).getY() - 100;
+ LayoutConstraint constraint = ((Node) ((Edge) editPart.getModel()).getSource()).getLayoutConstraint();
+ if (constraint instanceof Bounds) {
+ x = x + ((Bounds) constraint).getX();
+ y = ((Bounds) constraint).getY() - 100;
}
}
boolean isBorderElement = false;
- if(!(editPart instanceof CustomDurationConstraintEditPart)) {
- if(editPart instanceof BorderedBorderItemEditPart) {
+ if (!(editPart instanceof CustomDurationConstraintEditPart)) {
+ if (editPart instanceof BorderedBorderItemEditPart) {
isBorderElement = true;
}
}
- if(getAppliedStereotypeCommentNode() == null) {
- CreateAppliedStereotypeCommentViewCommandEx command = new CreateAppliedStereotypeCommentViewCommandEx(domain, (View)editPart.getModel(), x, y, semanticElement, isBorderElement);
- //use to avoid to put it in the command stack
+ if (getAppliedStereotypeCommentNode() == null) {
+ CreateAppliedStereotypeCommentViewCommandEx command = new CreateAppliedStereotypeCommentViewCommandEx(domain, (View) editPart.getModel(), x, y, semanticElement, isBorderElement);
+ // use to avoid to put it in the command stack
try {
GMFUnsafe.write(domain, command);
} catch (Exception e) {
@@ -275,34 +278,35 @@ public class AppliedStereotypeCommentCreationEditPolicyEx extends AppliedStereot
});
}
+ @Override
protected Node getAppliedStereotypeCommentNode() {
Node node = super.getAppliedStereotypeCommentNode();
- if(node != null) {
+ if (node != null) {
return node;
}
- View view = (View)getHost().getModel();
+ View view = (View) getHost().getModel();
View semanticView = view;
- while(semanticView != null && !(semanticView instanceof Shape || semanticView instanceof Edge)) {
- semanticView = (View)semanticView.eContainer();
+ while (semanticView != null && !(semanticView instanceof Shape || semanticView instanceof Edge)) {
+ semanticView = (View) semanticView.eContainer();
}
- if(semanticView == null) {
+ if (semanticView == null) {
return null;
}
Edge appliedStereotypeLink = null;
- //look for all links with the id AppliedStereotypesCommentLinkEditPart.ID
+ // look for all links with the id AppliedStereotypesCommentLinkEditPart.ID
@SuppressWarnings("unchecked")
Iterator<Edge> edgeIterator = semanticView.getSourceEdges().iterator();
- while(edgeIterator.hasNext()) {
- Edge edge = (Edge)edgeIterator.next();
- if(edge.getType().equals(AppliedStereotypesCommentLinkEditPart.ID)) {
+ while (edgeIterator.hasNext()) {
+ Edge edge = edgeIterator.next();
+ if (edge.getType().equals(AppliedStereotypesCommentLinkEditPart.ID)) {
appliedStereotypeLink = edge;
}
}
- if(appliedStereotypeLink == null) {
+ if (appliedStereotypeLink == null) {
return null;
}
- return (Node)appliedStereotypeLink.getTarget();
+ return (Node) appliedStereotypeLink.getTarget();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AppliedStereotypeExternalNodeLabelEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AppliedStereotypeExternalNodeLabelEditPolicy.java
index 7aabb28a43d..04b85552c61 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AppliedStereotypeExternalNodeLabelEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/AppliedStereotypeExternalNodeLabelEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -28,7 +28,7 @@ import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil;
/**
* Display both stereotype and stereotype properties in one figure.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class AppliedStereotypeExternalNodeLabelEditPolicy extends AppliedStereotypeLabelDisplayEditPolicy {
@@ -37,7 +37,7 @@ public class AppliedStereotypeExternalNodeLabelEditPolicy extends AppliedStereot
/**
* Constructor.
- *
+ *
*/
public AppliedStereotypeExternalNodeLabelEditPolicy() {
this(null);
@@ -45,25 +45,26 @@ public class AppliedStereotypeExternalNodeLabelEditPolicy extends AppliedStereot
/**
* Constructor.
- *
+ *
*/
public AppliedStereotypeExternalNodeLabelEditPolicy(View hostView) {
this.hostView = hostView;
}
+ @Override
public void activate() {
// retrieve the view and the element managed by the edit part
View view = getView();
- if(view == null) {
+ if (view == null) {
return;
}
super.activate();
- if(hostView == null) {
+ if (hostView == null) {
// add a listener for TimeObservationEditPart
// eContainer = getParent() , but here it's the ECore model
EObject parent = view.eContainer();
- if(parent instanceof View) {
- hostView = (View)parent;
+ if (parent instanceof View) {
+ hostView = (View) parent;
}
}
getDiagramEventBroker().addNotificationListener(hostView, this);
@@ -74,7 +75,7 @@ public class AppliedStereotypeExternalNodeLabelEditPolicy extends AppliedStereot
@Override
public void deactivate() {
- if(hostView != null) {
+ if (hostView != null) {
getDiagramEventBroker().removeNotificationListener(hostView, this);
}
super.deactivate();
@@ -83,17 +84,18 @@ public class AppliedStereotypeExternalNodeLabelEditPolicy extends AppliedStereot
@Override
public void refreshDisplay() {
super.refreshDisplay();
- if(getHost() instanceof IPapyrusEditPart) {
- IFigure figure = ((IPapyrusEditPart)getHost()).getPrimaryShape();
+ if (getHost() instanceof IPapyrusEditPart) {
+ IFigure figure = ((IPapyrusEditPart) getHost()).getPrimaryShape();
- if(figure instanceof IPapyrusNodeUMLElementFigure) {
- refreshAppliedStereotypesProperties((IPapyrusNodeUMLElementFigure)figure);
+ if (figure instanceof IPapyrusNodeUMLElementFigure) {
+ refreshAppliedStereotypesProperties((IPapyrusNodeUMLElementFigure) figure);
}
}
}
+ @Override
public String stereotypesToDisplay() {
- if(hostView == null) {
+ if (hostView == null) {
return "";
}
// list of stereotypes to display
@@ -103,7 +105,7 @@ public class AppliedStereotypeExternalNodeLabelEditPolicy extends AppliedStereot
// check the presentation kind. if only icon => do not display
// stereotypes
- if(UMLVisualInformationPapyrusConstant.ICON_STEREOTYPE_PRESENTATION.equals(stereotypespresentationKind)) {
+ if (UMLVisualInformationPapyrusConstant.ICON_STEREOTYPE_PRESENTATION.equals(stereotypespresentationKind)) {
return ""; // empty string, so stereotype label should not be
// displayed
}
@@ -112,11 +114,11 @@ public class AppliedStereotypeExternalNodeLabelEditPolicy extends AppliedStereot
String stereotypesToDisplayWithQN = AppliedStereotypeHelper.getStereotypesQNToDisplay(hostView);
// the set is empty
- if(stereotypesToDisplayWithQN.length() == 0 && stereotypesToDisplay.length() == 0) {
+ if (stereotypesToDisplayWithQN.length() == 0 && stereotypesToDisplay.length() == 0) {
return "";
}
// vertical representation
- if(UMLVisualInformationPapyrusConstant.STEREOTYPE_TEXT_VERTICAL_PRESENTATION.equals(stereotypespresentationKind)) {
+ if (UMLVisualInformationPapyrusConstant.STEREOTYPE_TEXT_VERTICAL_PRESENTATION.equals(stereotypespresentationKind)) {
return Activator.ST_LEFT + stereotypesToDisplay(Activator.ST_RIGHT + "\n" + Activator.ST_LEFT, stereotypesToDisplay, stereotypesToDisplayWithQN) + Activator.ST_RIGHT;
} else {// horizontal representation
return Activator.ST_LEFT + stereotypesToDisplay(", ", stereotypesToDisplay, stereotypesToDisplayWithQN) + Activator.ST_RIGHT;
@@ -125,7 +127,7 @@ public class AppliedStereotypeExternalNodeLabelEditPolicy extends AppliedStereot
}
protected void refreshAppliedStereotypesProperties(IPapyrusNodeUMLElementFigure figure) {
- if(hostView == null) {
+ if (hostView == null) {
return;
}
final String stereotypesPropertiesToDisplay = AppliedStereotypeHelper.getAppliedStereotypesPropertiesToDisplay(hostView);
@@ -137,14 +139,14 @@ public class AppliedStereotypeExternalNodeLabelEditPolicy extends AppliedStereot
/**
* Refreshes the stereotypes properties displayed in a compartment of this
* edit part.
- *
+ *
* @param stereotypesPropertiesToDisplay
- * list of properties to display
+ * list of properties to display
* @param figure
- * the figure in which stereotype will be displayed
+ * the figure in which stereotype will be displayed
*/
protected void refreshAppliedStereotypesPropertiesInCompartment(String stereotypesPropertiesToDisplay, IPapyrusNodeUMLElementFigure figure) {
- if(hostView == null) {
+ if (hostView == null) {
return;
}
// retrieve the stereotype properties to be displayed
@@ -153,7 +155,7 @@ public class AppliedStereotypeExternalNodeLabelEditPolicy extends AppliedStereot
// if the string is not empty, then, the figure has to display it. Else,
// it displays nothing
- if(displayInCompartment) {
+ if (displayInCompartment) {
String todisplay = StereotypeUtil.getPropertiesValues(stereotypesPropertiesToDisplay, getUMLElement());
figure.setStereotypePropertiesInCompartment(todisplay);
} else {
@@ -166,7 +168,7 @@ public class AppliedStereotypeExternalNodeLabelEditPolicy extends AppliedStereot
* in this edit part.
*/
protected void refreshAppliedStereotypesPropertiesInBrace(String stereotypesPropertiesToDisplay, IPapyrusNodeUMLElementFigure figure) {
- if(hostView == null) {
+ if (hostView == null) {
return;
}
// check if properties have to be displayed in braces.
@@ -174,7 +176,7 @@ public class AppliedStereotypeExternalNodeLabelEditPolicy extends AppliedStereot
// if the string is not empty, then, the figure has to display it. Else,
// it displays nothing
- if(displayInBrace) {
+ if (displayInBrace) {
// it has to be displayed in braces, so compute the string to
// display
String todisplay = StereotypeUtil.getPropertiesValuesInBrace(stereotypesPropertiesToDisplay, getUMLElement());
@@ -186,19 +188,19 @@ public class AppliedStereotypeExternalNodeLabelEditPolicy extends AppliedStereot
/**
* @see org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy#refreshStereotypeDisplay()
- *
+ *
*/
@Override
protected void refreshStereotypeDisplay() {
- if(getHost() instanceof IPapyrusEditPart) {
- IFigure figure = ((IPapyrusEditPart)getHost()).getPrimaryShape();
+ if (getHost() instanceof IPapyrusEditPart) {
+ IFigure figure = ((IPapyrusEditPart) getHost()).getPrimaryShape();
- if(figure instanceof IPapyrusUMLElementFigure) {// calculate text
+ if (figure instanceof IPapyrusUMLElementFigure) {// calculate text
// and icon to
// display
final String stereotypesToDisplay = stereotypesToDisplay();
- ((IPapyrusUMLElementFigure)figure).setStereotypeDisplay(tag + (stereotypesToDisplay), null);
+ ((IPapyrusUMLElementFigure) figure).setStereotypeDisplay(tag + (stereotypesToDisplay), null);
}
}
}
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 dfb8e82516f..28994726df2 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -42,9 +42,9 @@ import org.eclipse.uml2.uml.InteractionFragment;
/**
* This creation policy is used to move covered interaction fragments into the interaction operand
* when creating a new combined fragment.
- *
+ *
* @author mvelten
- *
+ *
*/
public class CombinedFragmentCreationEditPolicy extends CreationEditPolicy {
@@ -52,28 +52,29 @@ public class CombinedFragmentCreationEditPolicy extends CreationEditPolicy {
@Override
protected Command getCreateElementAndViewCommand(CreateViewAndElementRequest request) {
Command createElementAndViewCmd = super.getCreateElementAndViewCommand(request);
- if(isDerivedCombinedFragment(request.getViewAndElementDescriptor().getSemanticHint())) {
+ if (isDerivedCombinedFragment(request.getViewAndElementDescriptor().getSemanticHint())) {
Rectangle selectionRect = getSelectionRectangle(request);
Set<InteractionFragment> coveredInteractionFragments = SequenceUtil.getCoveredInteractionFragments(selectionRect, getHost(), null);
request.getExtendedData().put(SequenceRequestConstant.COVERED_INTERACTIONFRAGMENTS, coveredInteractionFragments);
// Add updating bounds command for Combined fragment createment
String hint = request.getViewAndElementDescriptor().getSemanticHint();
- if(OperandBoundsComputeHelper.isDerivedCombinedFragment(hint)) {
- if(createElementAndViewCmd instanceof ICommandProxy) {
- ICommandProxy commandProxy = (ICommandProxy)createElementAndViewCmd;
+ if (OperandBoundsComputeHelper.isDerivedCombinedFragment(hint)) {
+ if (createElementAndViewCmd instanceof ICommandProxy) {
+ ICommandProxy commandProxy = (ICommandProxy) createElementAndViewCmd;
ICommand realCmd = commandProxy.getICommand();
- if(realCmd instanceof CompositeCommand) {
+ if (realCmd instanceof CompositeCommand) {
ICommand createUpdateBoundsCmd = OperandBoundsComputeHelper.createUpdateCFAndIOBoundsForCFCreationCommand(this.getHost(), request);
- if(createUpdateBoundsCmd != null)
- ((CompositeCommand)realCmd).add(createUpdateBoundsCmd);
+ if (createUpdateBoundsCmd != null) {
+ ((CompositeCommand) realCmd).add(createUpdateBoundsCmd);
+ }
}
}
}
}
- //Ordering fragments
- if(createElementAndViewCmd != null && createElementAndViewCmd.canExecute()) {
+ // Ordering fragments
+ if (createElementAndViewCmd != null && createElementAndViewCmd.canExecute()) {
ICommand orderingFragmentsCommand = FragmentsOrdererHelper.createOrderingFragmentsCommand(getHost(), request);
- if(orderingFragmentsCommand != null) {
+ if (orderingFragmentsCommand != null) {
createElementAndViewCmd = createElementAndViewCmd.chain(new ICommandProxy(orderingFragmentsCommand));
}
}
@@ -83,25 +84,26 @@ public class CombinedFragmentCreationEditPolicy extends CreationEditPolicy {
@Override
protected Command getCreateCommand(CreateViewRequest request) {
Command createViewCmd = super.getCreateCommand(request);
- if(createViewCmd instanceof ICommandProxy) {
- ICommandProxy commandProxy = (ICommandProxy)createViewCmd;
+ if (createViewCmd instanceof ICommandProxy) {
+ ICommandProxy commandProxy = (ICommandProxy) createViewCmd;
CompositeCommand compositeCommand = null;
ICommand realCmd = commandProxy.getICommand();
- if(realCmd instanceof CompositeCommand) {
- compositeCommand = (CompositeCommand)realCmd;
+ if (realCmd instanceof CompositeCommand) {
+ compositeCommand = (CompositeCommand) realCmd;
} else {
compositeCommand = new CompositeCommand(commandProxy.getLabel());
compositeCommand.add(realCmd);
realCmd = compositeCommand;
}
- for(ViewDescriptor viewDescriptor : request.getViewDescriptors()) {
+ for (ViewDescriptor viewDescriptor : request.getViewDescriptors()) {
String hint = viewDescriptor.getSemanticHint();
- if(isDerivedCombinedFragment(hint)) {
+ if (isDerivedCombinedFragment(hint)) {
// Add updating bounds command for Combined fragment createment
- if(OperandBoundsComputeHelper.isDerivedCombinedFragment(hint)) {
+ if (OperandBoundsComputeHelper.isDerivedCombinedFragment(hint)) {
ICommand createUpdateBoundsCmd = OperandBoundsComputeHelper.createUpdateCFAndIOBoundsForCFCreationCommand(this.getHost(), request);
- if(createUpdateBoundsCmd != null)
- ((CompositeCommand)realCmd).add(createUpdateBoundsCmd);
+ if (createUpdateBoundsCmd != null) {
+ ((CompositeCommand) realCmd).add(createUpdateBoundsCmd);
+ }
}
}
}
@@ -112,16 +114,16 @@ public class CombinedFragmentCreationEditPolicy extends CreationEditPolicy {
/**
* Retrieve the selection rectangle associated with the request.
- *
+ *
* @param request
- * the request
+ * the request
* @return
*/
private Rectangle getSelectionRectangle(CreateViewAndElementRequest request) {
Rectangle selectionRect = new Rectangle();
Point location = request.getLocation();
Dimension size = request.getSize();
- if(location != null) {
+ if (location != null) {
selectionRect.x = location.x;
selectionRect.y = location.y;
} else {
@@ -129,7 +131,7 @@ public class CombinedFragmentCreationEditPolicy extends CreationEditPolicy {
selectionRect.x = 100;
selectionRect.y = 100;
}
- if(size != null) {
+ if (size != null) {
selectionRect.height = size.height;
selectionRect.width = size.width;
} else {
@@ -142,19 +144,19 @@ public class CombinedFragmentCreationEditPolicy extends CreationEditPolicy {
/**
* Check if it is a combined fragment or something similar which needs this policy to move ift in the correct container.
- *
+ *
* @param hint
- * the semantic hint
+ * the semantic hint
* @return
*/
private static boolean isDerivedCombinedFragment(String hint) {
- if(((IHintedType)UMLElementTypes.InteractionOperand_3005).getSemanticHint().equals(hint)) {
+ if (((IHintedType) UMLElementTypes.InteractionOperand_3005).getSemanticHint().equals(hint)) {
return true;
}
- if(((IHintedType)UMLElementTypes.CombinedFragment_3004).getSemanticHint().equals(hint)) {
+ if (((IHintedType) UMLElementTypes.CombinedFragment_3004).getSemanticHint().equals(hint)) {
return true;
}
- if(((IHintedType)UMLElementTypes.ConsiderIgnoreFragment_3007).getSemanticHint().equals(hint)) {
+ if (((IHintedType) UMLElementTypes.ConsiderIgnoreFragment_3007).getSemanticHint().equals(hint)) {
return true;
}
return false;
@@ -162,14 +164,14 @@ public class CombinedFragmentCreationEditPolicy extends CreationEditPolicy {
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy#getTargetEditPart(org.eclipse.gef.Request)
- *
+ *
* @param request
* @return
*/
@Override
public EditPart getTargetEditPart(Request request) {
- //Fixed bugs about creating Gates on clientArea of CombinedFragment. Whatever the host is InteractionOperand or Compartment, just use CombinedFragment.
- if(isCreatingGate(request)) {
+ // Fixed bugs about creating Gates on clientArea of CombinedFragment. Whatever the host is InteractionOperand or Compartment, just use CombinedFragment.
+ if (isCreatingGate(request)) {
return getCombinedFragmentEditPart();
}
return super.getTargetEditPart(request);
@@ -177,8 +179,8 @@ public class CombinedFragmentCreationEditPolicy extends CreationEditPolicy {
private EditPart getCombinedFragmentEditPart() {
EditPart editPart = getHost();
- while(editPart != null) {
- if(editPart instanceof CombinedFragmentEditPart) {
+ while (editPart != null) {
+ if (editPart instanceof CombinedFragmentEditPart) {
return editPart;
}
editPart = editPart.getParent();
@@ -187,29 +189,29 @@ public class CombinedFragmentCreationEditPolicy extends CreationEditPolicy {
}
private boolean isCreatingGate(Request request) {
- if(!(request instanceof CreateRequest)) {
+ if (!(request instanceof CreateRequest)) {
return false;
}
- CreateRequest createReq = (CreateRequest)request;
+ CreateRequest createReq = (CreateRequest) request;
try {
Object newObjectType = createReq.getNewObjectType();
return GateEditPart.GATE_TYPE.equals(newObjectType);
} catch (Exception e) {
- //There's no CreationFactory set.
+ // There's no CreationFactory set.
return false;
}
}
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy#understandsRequest(org.eclipse.gef.Request)
- *
+ *
* @param request
* @return
*/
@Override
public boolean understandsRequest(Request request) {
- //Fixed bug when creating Gate, take care of CustomizableDropEditPolicy.
- if(isCreatingGate(request)) {
+ // Fixed bug when creating Gate, take care of CustomizableDropEditPolicy.
+ if (isCreatingGate(request)) {
return getCombinedFragmentEditPart() != null;
}
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/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 ba6322a6dd8..766bc8d3d3d 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -15,20 +15,13 @@ package org.eclipse.papyrus.uml.diagram.sequence.edit.policies;
import java.util.List;
-import org.eclipse.draw2d.FigureListener;
import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LayoutListener;
-import org.eclipse.draw2d.PositionConstants;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.emf.common.command.CompoundCommand;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.ExposeHelper;
-import org.eclipse.gef.GraphicalEditPart;
import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.diagram.ui.commands.SetBoundsCommand;
import org.eclipse.gmf.runtime.notation.Bounds;
@@ -50,15 +43,15 @@ public class CombinedFragmentHeadImpactLayoutEditPolicy extends AbstractHeadImpa
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.policies.AbstractHeadImpactLayoutEditPolicy#getHeadHeight()
- *
+ *
* @return
*/
@Override
protected int getHeadHeight() {
IFigure primaryShape = getPrimaryShape();
- if(primaryShape instanceof StereotypeInteractionFigure) {
- IFigure headContainer = ((StereotypeInteractionFigure)primaryShape).getHeaderLabel().getParent();
+ if (primaryShape instanceof StereotypeInteractionFigure) {
+ IFigure headContainer = ((StereotypeInteractionFigure) primaryShape).getHeaderLabel().getParent();
Rectangle boundsRect = getBoundsRect();
return headContainer.getPreferredSize(boundsRect.width, -1).height;
}
@@ -67,43 +60,44 @@ public class CombinedFragmentHeadImpactLayoutEditPolicy extends AbstractHeadImpa
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.policies.AbstractHeadImpactLayoutEditPolicy#doImpactLayout(int)
- *
+ *
* @param resizeDelta
*/
@Override
protected void doImpactLayout(int resizeDelta) {
CompoundCommand commands = new CompoundCommand();
- CombinedFragmentEditPart host = (CombinedFragmentEditPart)getHost();
- //1. resize the first operand.
- CombinedFragmentCombinedFragmentCompartmentEditPart compartment = (CombinedFragmentCombinedFragmentCompartmentEditPart)host.getPrimaryChildEditPart();
+ CombinedFragmentEditPart host = (CombinedFragmentEditPart) getHost();
+ // 1. resize the first operand.
+ CombinedFragmentCombinedFragmentCompartmentEditPart compartment = (CombinedFragmentCombinedFragmentCompartmentEditPart) host.getPrimaryChildEditPart();
List children = compartment.getChildren();
- if(!children.isEmpty()) {
+ if (!children.isEmpty()) {
Object child = children.get(0);
- if(child instanceof InteractionOperandEditPart) {
- InteractionOperandEditPart operand = (InteractionOperandEditPart)child;
- Node shape = (Node)operand.getNotationView();
- Bounds bounds = (Bounds)shape.getLayoutConstraint();
+ if (child instanceof InteractionOperandEditPart) {
+ InteractionOperandEditPart operand = (InteractionOperandEditPart) child;
+ Node shape = (Node) operand.getNotationView();
+ Bounds bounds = (Bounds) shape.getLayoutConstraint();
Dimension size = new Dimension(bounds.getWidth(), bounds.getHeight()).expand(0, -resizeDelta);
Rectangle newBounds = new Rectangle(new Point(bounds.getX(), bounds.getY() + resizeDelta), size);
commands.appendIfCanExecute(new GMFtoEMFCommandWrapper(new SetBoundsCommand(getEditingDomain(), "", operand, newBounds)));
Command cmd = OperandBoundsComputeHelper.getShiftEnclosedFragmentsCommand(operand, newBounds, resizeDelta);
- if(cmd != null) {
+ if (cmd != null) {
commands.appendIfCanExecute(new GEFtoEMFCommandWrapper(cmd));
}
}
}
- if(!commands.isEmpty() && commands.canExecute()) {
+ if (!commands.isEmpty() && commands.canExecute()) {
CommandHelper.executeCommandWithoutHistory(getEditingDomain(), commands, true);
}
- for(Object object : children) {
- EditPart part = (EditPart)object;
+ for (Object object : children) {
+ EditPart part = (EditPart) object;
EditPart current = part.getParent();
while (current != null) {
ExposeHelper helper = (ExposeHelper) current
.getAdapter(ExposeHelper.class);
- if (helper != null)
+ if (helper != null) {
helper.exposeDescendant(part);
+ }
current = current.getParent();
}
}
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 47e1c27285a..1eec7839c61 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -36,13 +36,13 @@ public class CombinedFragmentItemComponentEditPolicy extends ComponentEditPolicy
*/
@Override
protected Command createDeleteViewCommand(GroupRequest deleteRequest) {
- if(getEditingDomain() != null) {
+ if (getEditingDomain() != null) {
CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
cmd.setTransactionNestingEnabled(true);
CommandProxy deleteView = new CommandProxy(super.createDeleteViewCommand(deleteRequest));
- if(getEObject() instanceof CombinedFragment) {
- CombinedFragment cf = (CombinedFragment)getEObject();
- CombinedFragmentEditPart host = (CombinedFragmentEditPart)getHost();
+ if (getEObject() instanceof CombinedFragment) {
+ CombinedFragment cf = (CombinedFragment) getEObject();
+ CombinedFragmentEditPart host = (CombinedFragmentEditPart) getHost();
ICommand prompt = CombinedFragmentDeleteHelper.createDeleteViewCommand(cf, getEditingDomain(), host);
cmd.add(prompt);
}
@@ -54,16 +54,16 @@ public class CombinedFragmentItemComponentEditPolicy extends ComponentEditPolicy
/**
* Copy from superclass as visibility is private
- *
+ *
* @return the editing domain
*/
private TransactionalEditingDomain getEditingDomain() {
- if(getHost() instanceof IGraphicalEditPart) {
- return ((IGraphicalEditPart)getHost()).getEditingDomain();
- } else if(getHost() instanceof IEditingDomainProvider) {
- Object domain = ((IEditingDomainProvider)getHost()).getEditingDomain();
- if(domain instanceof TransactionalEditingDomain) {
- return (TransactionalEditingDomain)domain;
+ if (getHost() instanceof IGraphicalEditPart) {
+ return ((IGraphicalEditPart) getHost()).getEditingDomain();
+ } else if (getHost() instanceof IEditingDomainProvider) {
+ Object domain = ((IEditingDomainProvider) getHost()).getEditingDomain();
+ if (domain instanceof TransactionalEditingDomain) {
+ return (TransactionalEditingDomain) domain;
}
}
return null;
@@ -71,12 +71,12 @@ public class CombinedFragmentItemComponentEditPolicy extends ComponentEditPolicy
/**
* Get the EObject of the host
- *
+ *
* @return the EObject or null
*/
private EObject getEObject() {
- if(getHost() instanceof GraphicalEditPart) {
- return ((GraphicalEditPart)getHost()).resolveSemanticElement();
+ if (getHost() instanceof GraphicalEditPart) {
+ return ((GraphicalEditPart) getHost()).resolveSemanticElement();
}
return null;
}
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 2ffb43c5ac2..39743a6d908 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -36,11 +36,11 @@ public class CreationOnMessageEditPolicy extends CreationEditPolicy {
/**
* Get the command after updating the request with appropriate occurrences
- *
+ *
* @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy#getCreateElementAndViewCommand(org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest)
- *
+ *
* @param request
- * the request
+ * the request
* @return command or null
*/
@Override
@@ -48,56 +48,57 @@ public class CreationOnMessageEditPolicy extends CreationEditPolicy {
Map<String, Object> extendedData = request.getExtendedData();
// record the nearest event if necessary
String requestHint = request.getViewAndElementDescriptor().getSemanticHint();
- if(isCreatedOnOccurrenceSpecification(requestHint)) {
+ if (isCreatedOnOccurrenceSpecification(requestHint)) {
EditPart hostPart = getHost();
- if(hostPart instanceof ConnectionNodeEditPart) {
- LifelineEditPart sourceLifeline = SequenceUtil.getParentLifelinePart(((ConnectionNodeEditPart)hostPart).getSource());
- LifelineEditPart targetLifeline = SequenceUtil.getParentLifelinePart(((ConnectionNodeEditPart)hostPart).getTarget());
+ if (hostPart instanceof ConnectionNodeEditPart) {
+ LifelineEditPart sourceLifeline = SequenceUtil.getParentLifelinePart(((ConnectionNodeEditPart) hostPart).getSource());
+ LifelineEditPart targetLifeline = SequenceUtil.getParentLifelinePart(((ConnectionNodeEditPart) hostPart).getTarget());
Entry<Point, List<OccurrenceSpecification>> eventAndLocation = null;
- if(sourceLifeline != null) {
+ if (sourceLifeline != null) {
eventAndLocation = SequenceUtil.findNearestEvent(request.getLocation(), sourceLifeline);
}
- if(targetLifeline != null && eventAndLocation == null) {
+ if (targetLifeline != null && eventAndLocation == null) {
eventAndLocation = SequenceUtil.findNearestEvent(request.getLocation(), targetLifeline);
}
// find an event near enough to create the constraint or observation
List<OccurrenceSpecification> events = Collections.emptyList();
Point location = null;
- if(eventAndLocation != null) {
+ if (eventAndLocation != null) {
location = eventAndLocation.getKey();
events = eventAndLocation.getValue();
}
- if(extendedData.containsKey(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2)) {
+ if (extendedData.containsKey(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2)) {
extendedData.put(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2, events);
} else {
extendedData.put(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION, events);
}
- if(extendedData.containsKey(SequenceRequestConstant.OCCURRENCE_SPECIFICATION_LOCATION_2)) {
+ if (extendedData.containsKey(SequenceRequestConstant.OCCURRENCE_SPECIFICATION_LOCATION_2)) {
extendedData.put(SequenceRequestConstant.OCCURRENCE_SPECIFICATION_LOCATION_2, location);
} else {
extendedData.put(SequenceRequestConstant.OCCURRENCE_SPECIFICATION_LOCATION, location);
}
- if(location != null) {
- //Let the hosted lifeline to do it.
+ if (location != null) {
+ // Let the hosted lifeline to do it.
EditPart object = getHost().getViewer().findObjectAtExcluding(location, Collections.emptyList(), new EditPartViewer.Conditional() {
+ @Override
public boolean evaluate(EditPart editpart) {
return editpart instanceof LifelineEditPart;
}
});
LifelineEditPart targetEditPart = null;
- if(object instanceof LifelineEditPart) {
- targetEditPart = (LifelineEditPart)object;
+ if (object instanceof LifelineEditPart) {
+ targetEditPart = (LifelineEditPart) object;
} else {
- while(object != null) {
- if(object.getParent() instanceof LifelineEditPart) {
- targetEditPart = (LifelineEditPart)object.getParent();
+ while (object != null) {
+ if (object.getParent() instanceof LifelineEditPart) {
+ targetEditPart = (LifelineEditPart) object.getParent();
break;
}
object = object.getParent();
}
}
- if(targetEditPart != null) {
+ if (targetEditPart != null) {
return targetEditPart.getCommand(request);
}
}
@@ -108,9 +109,9 @@ public class CreationOnMessageEditPolicy extends CreationEditPolicy {
/**
* Return true if creation must be performed on an occurrence specification
- *
+ *
* @param requestHint
- * the hint of object to create
+ * the hint of object to create
* @return true if creation on an occurrence specification
*/
private boolean isCreatedOnOccurrenceSpecification(String requestHint) {
@@ -119,28 +120,28 @@ public class CreationOnMessageEditPolicy extends CreationEditPolicy {
/**
* Return true if hint is for creating a duration observation/constraint
- *
+ *
* @param requestHint
- * the hint of object to create
+ * the hint of object to create
* @return true if correct hint
*/
private boolean isDurationHint(String requestHint) {
- String durCstOnLifelineHint = ((IHintedType)UMLElementTypes.DurationConstraint_3021).getSemanticHint();
- String durCstOnMessage = ((IHintedType)UMLElementTypes.DurationConstraint_3023).getSemanticHint();
- String durObsOnMessage = ((IHintedType)UMLElementTypes.DurationObservation_3024).getSemanticHint();
+ String durCstOnLifelineHint = ((IHintedType) UMLElementTypes.DurationConstraint_3021).getSemanticHint();
+ String durCstOnMessage = ((IHintedType) UMLElementTypes.DurationConstraint_3023).getSemanticHint();
+ String durObsOnMessage = ((IHintedType) UMLElementTypes.DurationObservation_3024).getSemanticHint();
return durCstOnLifelineHint.equals(requestHint) /* || durCstOnMessage.equals(requestHint) */|| durObsOnMessage.equals(requestHint);
}
/**
* Return true if hint is for creating a time observation/constraint
- *
+ *
* @param requestHint
- * the hint of object to create
+ * the hint of object to create
* @return true if correct hint
*/
private boolean isTimeHint(String requestHint) {
- String timeConstraintHint = ((IHintedType)UMLElementTypes.TimeConstraint_3019).getSemanticHint();
- String timeObservationHint = ((IHintedType)UMLElementTypes.TimeObservation_3020).getSemanticHint();
+ String timeConstraintHint = ((IHintedType) UMLElementTypes.TimeConstraint_3019).getSemanticHint();
+ String timeObservationHint = ((IHintedType) UMLElementTypes.TimeObservation_3020).getSemanticHint();
return timeConstraintHint.equals(requestHint) || timeObservationHint.equals(requestHint);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CustomAppliedStereotypeContextLinkLabelDisplayEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CustomAppliedStereotypeContextLinkLabelDisplayEditPolicy.java
index cf0d610cd0b..7d0d121acd2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CustomAppliedStereotypeContextLinkLabelDisplayEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CustomAppliedStereotypeContextLinkLabelDisplayEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -31,24 +31,26 @@ public class CustomAppliedStereotypeContextLinkLabelDisplayEditPolicy extends Ap
super("context"); //$NON-NLS-1$
}
+ @Override
public void activate() {
// retrieve the view
View view = getView();
- if(view == null) {
+ if (view == null) {
return;
}
- //call the refresh overridden in this class
+ // call the refresh overridden in this class
refreshDisplay();
}
/**
* Refreshes the tag display
*/
+ @Override
protected void refreshStereotypeDisplay() {
- IFigure figure = ((GraphicalEditPart)getHost()).getFigure();
+ IFigure figure = ((GraphicalEditPart) getHost()).getFigure();
// the tag displayed here is <code>&laquo context &raquo</code> see the class constructor
- if(figure instanceof IPapyrusUMLElementFigure) {
- ((IPapyrusUMLElementFigure)figure).setStereotypeDisplay(tag, null);
+ if (figure instanceof IPapyrusUMLElementFigure) {
+ ((IPapyrusUMLElementFigure) figure).setStereotypeDisplay(tag, null);
}
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CustomConnectionHandleEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CustomConnectionHandleEditPolicy.java
index 1aac6358855..b707bd70d09 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CustomConnectionHandleEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CustomConnectionHandleEditPolicy.java
@@ -18,17 +18,17 @@ public final class CustomConnectionHandleEditPolicy extends ConnectionHandleEdit
List list = new ArrayList(2);
String tooltip;
tooltip = buildTooltip(ConnectionHandle.HandleDirection.INCOMING);
- if(tooltip != null) {
- list.add(new ConnectionHandle((IGraphicalEditPart)getHost(), ConnectionHandle.HandleDirection.INCOMING, tooltip));
+ if (tooltip != null) {
+ list.add(new ConnectionHandle((IGraphicalEditPart) getHost(), ConnectionHandle.HandleDirection.INCOMING, tooltip));
}
tooltip = buildTooltip(ConnectionHandle.HandleDirection.OUTGOING);
- if(tooltip != null) {
- ConnectionHandle connectionHandle = new ConnectionHandle((IGraphicalEditPart)getHost(), ConnectionHandle.HandleDirection.OUTGOING, tooltip);
+ if (tooltip != null) {
+ ConnectionHandle connectionHandle = new ConnectionHandle((IGraphicalEditPart) getHost(), ConnectionHandle.HandleDirection.OUTGOING, tooltip);
connectionHandle.setDragTracker(new ConnectionHandleTool(connectionHandle) {
@Override
protected String getCommandName() {
- if(isInState(STATE_CONNECTION_STARTED | STATE_ACCESSIBLE_DRAG_IN_PROGRESS)) {
+ if (isInState(STATE_CONNECTION_STARTED | STATE_ACCESSIBLE_DRAG_IN_PROGRESS)) {
return SequenceUtil.OBSERVATION_LINK_REQUEST_END;
} else {
return SequenceUtil.OBSERVATION_LINK_REQUEST_START;
@@ -38,14 +38,14 @@ public final class CustomConnectionHandleEditPolicy extends ConnectionHandleEdit
// see also UMLPaletteFactory.createObservationLinkCreationTool()
@Override
protected boolean updateTargetUnderMouse() {
- if(!isTargetLocked()) {
+ if (!isTargetLocked()) {
EditPart editPart = getCurrentViewer().findObjectAtExcluding(getLocation(), getExclusionSet(), getTargetingConditional());
- if(editPart != null) {
+ if (editPart != null) {
editPart = editPart.getTargetEditPart(getTargetRequest());
}
// fix observation link moving over ExecutionSpecificationEditPart
- if(getTargetRequest() instanceof TargetRequest) {
- ((TargetRequest)getTargetRequest()).setTargetEditPart(editPart);
+ if (getTargetRequest() instanceof TargetRequest) {
+ ((TargetRequest) getTargetRequest()).setTargetEditPart(editPart);
}
boolean changed = getTargetEditPart() != editPart;
setTargetEditPart(editPart);
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 f4bcbf25816..93014555368 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -134,7 +134,7 @@ import org.eclipse.uml2.uml.TimeObservation;
/**
* A policy to support dNd from the Model Explorer in the sequence diagram
- *
+ *
*/
public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPolicy {
@@ -201,12 +201,12 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
@Override
protected IUndoableOperation getDropObjectCommand(DropObjectsRequest dropRequest, final EObject droppedObject) {
IUndoableOperation dropObjectCommand = super.getDropObjectCommand(dropRequest, droppedObject);
- if(dropObjectCommand != null && dropObjectCommand.canExecute()) {
+ if (dropObjectCommand != null && dropObjectCommand.canExecute()) {
return dropObjectCommand;
}
// fix bug 364696(https://bugs.eclipse.org/bugs/show_bug.cgi?id=364696)
- if(droppedObject instanceof ConnectableElement) {
- return doDropConnectableElement(dropRequest, (ConnectableElement)droppedObject);
+ if (droppedObject instanceof ConnectableElement) {
+ return doDropConnectableElement(dropRequest, (ConnectableElement) droppedObject);
}
return dropObjectCommand;
}
@@ -216,13 +216,13 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
CreateViewRequest createShapeRequest = CreateViewRequestFactory.getCreateShapeRequest(UMLElementTypes.Lifeline_3001, UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
createShapeRequest.setLocation(location);
ViewDescriptor viewDescriptor = createShapeRequest.getViewDescriptors().get(0);
- CreateElementRequestAdapter elementAdapter = (CreateElementRequestAdapter)viewDescriptor.getElementAdapter();
- CreateElementRequest createElementRequest = (CreateElementRequest)elementAdapter.getAdapter(CreateElementRequest.class);
+ CreateElementRequestAdapter elementAdapter = (CreateElementRequestAdapter) viewDescriptor.getElementAdapter();
+ CreateElementRequest createElementRequest = (CreateElementRequest) elementAdapter.getAdapter(CreateElementRequest.class);
// parameter "ConnectableElement" used in LifelineCreateCommand#doConfigure()
createElementRequest.setParameter(SequenceRequestConstant.CONNECTABLE_ELEMENT, droppedObject);
EditPart host = getHost();
- Command theRealCmd = ((IGraphicalEditPart)host).getCommand(createShapeRequest);
- if(theRealCmd != null && theRealCmd.canExecute()) {
+ Command theRealCmd = ((IGraphicalEditPart) host).getCommand(createShapeRequest);
+ if (theRealCmd != null && theRealCmd.canExecute()) {
return new CommandProxy(theRealCmd);
}
return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
@@ -255,35 +255,35 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
@Override
protected Command getSpecificDropCommand(DropObjectsRequest dropRequest, Element semanticElement, int nodeVISUALID, int linkVISUALID) {
Point location = dropRequest.getLocation().getCopy();
- //handle gate creation
- if(semanticElement instanceof Gate) {
- return dropGate((Gate)semanticElement, location);
+ // handle gate creation
+ if (semanticElement instanceof Gate) {
+ return dropGate((Gate) semanticElement, location);
}
// handle specifically the case when node is on a message
Command cmd = handleNodeOnMessage(semanticElement, nodeVISUALID, linkVISUALID, location);
- if(cmd != null) {
+ if (cmd != null) {
return cmd;
}
- if(nodeVISUALID != -1) {
- switch(nodeVISUALID) {
+ if (nodeVISUALID != -1) {
+ switch (nodeVISUALID) {
case BehaviorExecutionSpecificationEditPart.VISUAL_ID:
case ActionExecutionSpecificationEditPart.VISUAL_ID:
- return dropExecutionSpecification((ExecutionSpecification)semanticElement, nodeVISUALID, location);
+ return dropExecutionSpecification((ExecutionSpecification) semanticElement, nodeVISUALID, location);
case DestructionOccurrenceSpecificationEditPart.VISUAL_ID:
- return dropDestructionOccurrence((DestructionOccurrenceSpecification)semanticElement, nodeVISUALID, location);
+ return dropDestructionOccurrence((DestructionOccurrenceSpecification) semanticElement, nodeVISUALID, location);
case StateInvariantEditPart.VISUAL_ID:
- return dropStateInvariant((StateInvariant)semanticElement, nodeVISUALID, location);
+ return dropStateInvariant((StateInvariant) semanticElement, nodeVISUALID, location);
case TimeConstraintEditPart.VISUAL_ID:
case DurationConstraintEditPart.VISUAL_ID:
- return dropIntervalConstraintInLifeline((IntervalConstraint)semanticElement, nodeVISUALID);
+ return dropIntervalConstraintInLifeline((IntervalConstraint) semanticElement, nodeVISUALID);
case TimeObservationEditPart.VISUAL_ID:
- return dropTimeObservationInLifeline((TimeObservation)semanticElement, nodeVISUALID, location);
+ return dropTimeObservationInLifeline((TimeObservation) semanticElement, nodeVISUALID, location);
case CombinedFragment2EditPart.VISUAL_ID:
- return dropCoRegion((CombinedFragment)semanticElement, nodeVISUALID, location);
+ return dropCoRegion((CombinedFragment) semanticElement, nodeVISUALID, location);
case CommentEditPart.VISUAL_ID:
case ConstraintEditPart.VISUAL_ID:
- if(semanticElement instanceof DurationConstraint) {
- return dropDurationConstraint((DurationConstraint)semanticElement, location);
+ if (semanticElement instanceof DurationConstraint) {
+ return dropDurationConstraint((DurationConstraint) semanticElement, location);
}
case Constraint2EditPart.VISUAL_ID:
case InteractionUseEditPart.VISUAL_ID:
@@ -291,7 +291,7 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
return dropNodeElement(semanticElement, nodeVISUALID, location);
case ConsiderIgnoreFragmentEditPart.VISUAL_ID:
case CombinedFragmentEditPart.VISUAL_ID:
- return dropCombinedFragment((CombinedFragment)semanticElement, nodeVISUALID, location);
+ return dropCombinedFragment((CombinedFragment) semanticElement, nodeVISUALID, location);
case ContinuationEditPart.VISUAL_ID:
case InteractionOperandEditPart.VISUAL_ID:
return dropCompartmentNodeElement(semanticElement, nodeVISUALID, location);
@@ -299,8 +299,8 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
return UnexecutableCommand.INSTANCE;
}
}
- if(linkVISUALID != -1) {
- switch(linkVISUALID) {
+ if (linkVISUALID != -1) {
+ switch (linkVISUALID) {
case MessageEditPart.VISUAL_ID:
case Message2EditPart.VISUAL_ID:
case Message3EditPart.VISUAL_ID:
@@ -320,20 +320,20 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
/**
* Get the drop command for the Element
- *
+ *
* @param element
- * the Element
+ * the Element
* @param nodeVISUALID
- * the node visual id
+ * the node visual id
* @return the drop command if the Element can be dropped
*/
private Command dropNodeElement(Element element, int nodeVISUALID, Point location) {
Element parent = element.getOwner();
- if(getHostObject().equals(parent)) {
+ if (getHostObject().equals(parent)) {
List<View> existingViews = DiagramEditPartsUtil.findViews(parent, getViewer());
- if(!existingViews.isEmpty()) {
+ if (!existingViews.isEmpty()) {
EditPart parentEditPart = lookForEditPart(parent);
- if(parentEditPart != null) {
+ if (parentEditPart != null) {
return new ICommandProxy(getDefaultDropNodeCommand(parentEditPart, nodeVISUALID, location, element));
}
}
@@ -343,46 +343,46 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
/**
* Get the drop command for the Element
- *
+ *
* @param element
- * the Element
+ * the Element
* @param nodeVISUALID
- * the node visual id
+ * the node visual id
* @return the drop command if the element can be dropped
*/
private Command dropCombinedFragment(CombinedFragment combinedFragment, int nodeVISUALID, Point location) {
Element parent = combinedFragment.getOwner();
Element parentContainer = parent.getOwner();
- if(!(parentContainer instanceof CombinedFragment)) {
+ if (!(parentContainer instanceof CombinedFragment)) {
parentContainer = parent;
}
- if(getHostObject().equals(parentContainer)) {
+ if (getHostObject().equals(parentContainer)) {
List<View> existingViews = DiagramEditPartsUtil.findViews(parent, getViewer());
- if(!existingViews.isEmpty()) {
+ if (!existingViews.isEmpty()) {
EditPart parentEditPart = lookForEditPart(parent);
- if(parentEditPart instanceof GraphicalEditPart) {
+ if (parentEditPart instanceof GraphicalEditPart) {
// check if all lifelines coversby exist in diagram.
Rectangle bounds = null;
List<Lifeline> lifelines = combinedFragment.getCovereds();
- for(Lifeline lifeline : combinedFragment.getCovereds()) {
+ for (Lifeline lifeline : combinedFragment.getCovereds()) {
EditPart lifelineEditPart = lookForEditPart(lifeline);
- if(lifelineEditPart == null) {
+ if (lifelineEditPart == null) {
Shell shell = Display.getCurrent().getActiveShell();
MessageDialog.openError(shell, DIALOG_TITLE, NLS.bind(LIFELINE_MISSING, lifeline.getName()));
return UnexecutableCommand.INSTANCE;
}
- if(lifelineEditPart instanceof GraphicalEditPart) {
- GraphicalEditPart graphicalEditPart = (GraphicalEditPart)lifelineEditPart;
+ if (lifelineEditPart instanceof GraphicalEditPart) {
+ GraphicalEditPart graphicalEditPart = (GraphicalEditPart) lifelineEditPart;
Rectangle rectangle = graphicalEditPart.getFigure().getBounds().getCopy();
graphicalEditPart.getFigure().translateToAbsolute(rectangle);
- if(bounds == null) {
+ if (bounds == null) {
bounds = rectangle;
} else {
bounds = bounds.union(rectangle);
}
}
}
- if(bounds == null) {
+ if (bounds == null) {
return new ICommandProxy(getDefaultDropNodeCommand(parentEditPart, nodeVISUALID, location, combinedFragment));
}
location.x = bounds.x;
@@ -410,14 +410,14 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
* @return
*/
protected ICommand dropCombinedFragment(EditPart hostEP, int nodeVISUALID, Point absoluteLocation, Dimension size, EObject droppedObject) {
- IHintedType type = ((IHintedType)getUMLElementType(nodeVISUALID));
+ IHintedType type = ((IHintedType) getUMLElementType(nodeVISUALID));
String semanticHint = null;
- if(type != null) {
+ if (type != null) {
semanticHint = type.getSemanticHint();
}
List<View> existingViews = DiagramEditPartsUtil.findViews(droppedObject, getViewer());
// only allow one view instance of a single element by diagram
- if(existingViews.isEmpty()) {
+ if (existingViews.isEmpty()) {
IAdaptable elementAdapter = new EObjectAdapter(droppedObject);
ViewDescriptor descriptor = new ViewDescriptor(elementAdapter, Node.class, semanticHint, ViewUtil.APPEND, true, getDiagramPreferencesHint());
CreateViewRequest createViewRequest = new CreateViewRequest(descriptor);
@@ -426,10 +426,10 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
// "ask" the host for a command associated with the
// CreateViewRequest
Command command = hostEP.getCommand(createViewRequest);
- if(createViewRequest.getNewObject() instanceof List) {
- for(Object object : (List<?>)createViewRequest.getNewObject()) {
- if(object instanceof IAdaptable) {
- DeferredCreateCommand createCommand2 = new DeferredCreateCommand(getEditingDomain(), droppedObject, (IAdaptable)object, getHost().getViewer());
+ if (createViewRequest.getNewObject() instanceof List) {
+ for (Object object : (List<?>) createViewRequest.getNewObject()) {
+ if (object instanceof IAdaptable) {
+ DeferredCreateCommand createCommand2 = new DeferredCreateCommand(getEditingDomain(), droppedObject, (IAdaptable) object, getHost().getViewer());
command.chain(new ICommandProxy(createCommand2));
}
}
@@ -443,7 +443,7 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
/**
* Get the drop command in case the element can be handled as an element in a CombinedFragment
- *
+ *
* @param element
* @param nodeVISUALID
* @param location
@@ -452,14 +452,14 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
private Command dropCompartmentNodeElement(Element element, int nodeVISUALID, Point location) {
Element parent = element.getOwner();
Element directParent = parent;
- if(parent instanceof InteractionOperand) {
+ if (parent instanceof InteractionOperand) {
parent = parent.getOwner();
}
- if(getHostObject().equals(parent)) {
+ if (getHostObject().equals(parent)) {
List<View> existingViews = DiagramEditPartsUtil.findViews(directParent, getViewer());
- if(!existingViews.isEmpty()) {
+ if (!existingViews.isEmpty()) {
EditPart parentEditPart = lookForEditPart(directParent);
- if(parentEditPart != null) {
+ if (parentEditPart != null) {
return new ICommandProxy(getDefaultDropNodeCommand(parentEditPart, nodeVISUALID, location, element));
}
}
@@ -469,30 +469,30 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
/**
* Get the drop command in case the element can be handled as a node on a message
- *
+ *
* @param semanticElement
- * the element being dropped from the model
+ * the element being dropped from the model
* @param nodeVISUALID
- * node visual id or -1
+ * node visual id or -1
* @param linkVISUALID
- * link visual id or -1
+ * link visual id or -1
* @param location
* @return the drop command if the element can be dropped as a message label node, or null otherwise
*/
private Command handleNodeOnMessage(Element semanticElement, int nodeVISUALID, int linkVISUALID, Point location) {
- if(nodeVISUALID == -1 && linkVISUALID == -1) {
+ if (nodeVISUALID == -1 && linkVISUALID == -1) {
// detect duration observation on a message
- if(semanticElement instanceof DurationObservation) {
- List<NamedElement> events = ((DurationObservation)semanticElement).getEvents();
- if(events.size() >= 2) {
+ if (semanticElement instanceof DurationObservation) {
+ List<NamedElement> events = ((DurationObservation) semanticElement).getEvents();
+ if (events.size() >= 2) {
return dropMessageNodeBetweenEvents(semanticElement, events.get(0), events.get(1));
}
}
}
- if(isDurationConstraintHint(nodeVISUALID, linkVISUALID)) {
+ if (isDurationConstraintHint(nodeVISUALID, linkVISUALID)) {
// detect duration constraint on a message
- if(semanticElement instanceof DurationConstraint) {
- return dropDurationConstraint((DurationConstraint)semanticElement, location);
+ if (semanticElement instanceof DurationConstraint) {
+ return dropDurationConstraint((DurationConstraint) semanticElement, location);
}
}
return null;
@@ -500,7 +500,7 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
/**
* Drop DurationConstraint at given location. The constrained elements would also be restored if existed.
- *
+ *
* @see dropDurationConstraint(Element durationConstraint, Element event1, Element event2, Point location)
* @param durationConstraint
* @param location
@@ -508,10 +508,10 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
protected Command dropDurationConstraint(DurationConstraint durationConstraint, Point location) {
List<Element> events = durationConstraint.getConstrainedElements();
Element event1 = null, event2 = null;
- if(events.size() >= 2) {
+ if (events.size() >= 2) {
event1 = events.get(0);
event2 = events.get(1);
- } else if(events.size() == 1) {
+ } else if (events.size() == 1) {
event1 = event2 = events.get(0);
}
return dropDurationConstraint(durationConstraint, event1, event2, location);
@@ -519,7 +519,7 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
/**
* Drop DurationConstraint at given location. The constrained elements would also be restored if existed.
- *
+ *
* @param durationConstraint
* @param event1
* @param event2
@@ -529,35 +529,35 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
private Command dropDurationConstraint(Element durationConstraint, Element event1, Element event2, Point location) {
List<View> existingViews = DiagramEditPartsUtil.findViews(durationConstraint, getViewer());
// only allow one view instance of a single element by diagram
- if(!existingViews.isEmpty()) {
+ if (!existingViews.isEmpty()) {
return UnexecutableCommand.INSTANCE;
}
IAdaptable elementAdapter = new EObjectAdapter(durationConstraint);
- IHintedType elementType = (IHintedType)UMLElementTypes.getElementType(DurationConstraintEditPart.VISUAL_ID);
+ IHintedType elementType = (IHintedType) UMLElementTypes.getElementType(DurationConstraintEditPart.VISUAL_ID);
ViewDescriptor descriptor = new ViewDescriptor(elementAdapter, Node.class, elementType.getSemanticHint(), ViewUtil.APPEND, true, getDiagramPreferencesHint());
CreateViewRequest createViewRequest = new CreateViewRequest(descriptor);
createViewRequest.setLocation(location);
// "ask" the host for a command associated with the
// CreateViewRequest
Command command = getHost().getCommand(createViewRequest);
- if(command == null || !command.canExecute()) {
+ if (command == null || !command.canExecute()) {
return UnexecutableCommand.INSTANCE;
}
- //restore links.
+ // restore links.
CompositeCommand result = new CompositeCommand(command.getLabel());
result.add(new CommandProxyWithResult(command, descriptor));
- Point[] constraintLocations = getLocationForDurationConstraint((DurationConstraint)durationConstraint, event1, event2, location);
- if(constraintLocations[0] != null && constraintLocations[1] != null) {
- if(constraintLocations[0].y <= constraintLocations[1].y) {
+ Point[] constraintLocations = getLocationForDurationConstraint((DurationConstraint) durationConstraint, event1, event2, location);
+ if (constraintLocations[0] != null && constraintLocations[1] != null) {
+ if (constraintLocations[0].y <= constraintLocations[1].y) {
result.add(new RestoreDurationConstraintLinkCommand(getEditingDomain(), descriptor, getViewer(), true, constraintLocations[0], getDiagramPreferencesHint()));
result.add(new RestoreDurationConstraintLinkCommand(getEditingDomain(), descriptor, getViewer(), false, constraintLocations[1], getDiagramPreferencesHint()));
- } else if(constraintLocations[0].y > constraintLocations[1].y) {
+ } else if (constraintLocations[0].y > constraintLocations[1].y) {
result.add(new RestoreDurationConstraintLinkCommand(getEditingDomain(), descriptor, getViewer(), false, constraintLocations[0], getDiagramPreferencesHint()));
result.add(new RestoreDurationConstraintLinkCommand(getEditingDomain(), descriptor, getViewer(), true, constraintLocations[1], getDiagramPreferencesHint()));
}
- } else if(constraintLocations[0] != null) {
+ } else if (constraintLocations[0] != null) {
result.add(new RestoreDurationConstraintLinkCommand(getEditingDomain(), descriptor, getViewer(), null, constraintLocations[0], getDiagramPreferencesHint()));
- } else if(constraintLocations[1] != null) {
+ } else if (constraintLocations[1] != null) {
result.add(new RestoreDurationConstraintLinkCommand(getEditingDomain(), descriptor, getViewer(), null, constraintLocations[1], getDiagramPreferencesHint()));
}
// it then can be used as an adaptable to retrieve the View
@@ -566,7 +566,7 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
/**
* Collect the locations of constrained elements.
- *
+ *
* @param durationConstraint
* @param event1
* @param event2
@@ -575,31 +575,31 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
*/
private Point[] getLocationForDurationConstraint(DurationConstraint durationConstraint, Element event1, Element event2, Point location) {
Point[] constraintLocations = new Point[2];
- if(event1 instanceof OccurrenceSpecification) {
- constraintLocations[0] = getLocationForDurationConstraintOnEvent((OccurrenceSpecification)event1);
+ if (event1 instanceof OccurrenceSpecification) {
+ constraintLocations[0] = getLocationForDurationConstraintOnEvent((OccurrenceSpecification) event1);
}
- if(event2 instanceof OccurrenceSpecification) {
- constraintLocations[1] = getLocationForDurationConstraintOnEvent((OccurrenceSpecification)event2);
+ if (event2 instanceof OccurrenceSpecification) {
+ constraintLocations[1] = getLocationForDurationConstraintOnEvent((OccurrenceSpecification) event2);
}
- if(constraintLocations[0] == null && event1 != null) {
+ if (constraintLocations[0] == null && event1 != null) {
EditPart editPart = lookForEditPart(event1);
- if(editPart instanceof INodeEditPart) {
- constraintLocations[0] = getLocationForDurationConstraintOnEditPart((INodeEditPart)editPart, location);
+ if (editPart instanceof INodeEditPart) {
+ constraintLocations[0] = getLocationForDurationConstraintOnEditPart((INodeEditPart) editPart, location);
}
}
- if(constraintLocations[1] == null && event2 != null) {
+ if (constraintLocations[1] == null && event2 != null) {
EditPart editPart = lookForEditPart(event2);
- if(editPart instanceof INodeEditPart) {
- constraintLocations[1] = getLocationForDurationConstraintOnEditPart((INodeEditPart)editPart, location.getTranslated(0, 40));
+ if (editPart instanceof INodeEditPart) {
+ constraintLocations[1] = getLocationForDurationConstraintOnEditPart((INodeEditPart) editPart, location.getTranslated(0, 40));
}
}
- if(event1 != null && event1 == event2 && constraintLocations[0] != null && constraintLocations[0].equals(constraintLocations[1])) {
+ if (event1 != null && event1 == event2 && constraintLocations[0] != null && constraintLocations[0].equals(constraintLocations[1])) {
EditPart editPart = lookForEditPart(event1);
- if(editPart instanceof IGraphicalEditPart) {
- Rectangle rect = SequenceUtil.getAbsoluteBounds((IGraphicalEditPart)editPart);
- if(rect.contains(constraintLocations[0].getTranslated(0, 40))) {
+ if (editPart instanceof IGraphicalEditPart) {
+ Rectangle rect = SequenceUtil.getAbsoluteBounds((IGraphicalEditPart) editPart);
+ if (rect.contains(constraintLocations[0].getTranslated(0, 40))) {
constraintLocations[1] = constraintLocations[0].getTranslated(0, 40);
- } else if(rect.contains(constraintLocations[0].getTranslated(0, -40))) {
+ } else if (rect.contains(constraintLocations[0].getTranslated(0, -40))) {
constraintLocations[1] = constraintLocations[0].getTranslated(0, -40);
}
}
@@ -609,29 +609,29 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
/**
* Get location from a INodeEditPart.
- *
+ *
* @param nodeEditPart
* @param reference
* @return
*/
private Point getLocationForDurationConstraintOnEditPart(INodeEditPart nodeEditPart, Point reference) {
- Rectangle rect = SequenceUtil.getAbsoluteBounds((IGraphicalEditPart)nodeEditPart);
+ Rectangle rect = SequenceUtil.getAbsoluteBounds((IGraphicalEditPart) nodeEditPart);
Point location = new Point();
- if(reference.y < rect.y) {
+ if (reference.y < rect.y) {
location.y = rect.y + 1;
- } else if(reference.y > rect.bottom()) {
+ } else if (reference.y > rect.bottom()) {
location.y = rect.bottom() - 1;
} else {
location.y = reference.y;
}
- for(int x = rect.x; x <= rect.right(); x++) {
+ for (int x = rect.x; x <= rect.right(); x++) {
CreateConnectionRequest request = new CreateConnectionRequest();
request.setType(REQ_CONNECTION_END);
request.setTargetEditPart(nodeEditPart);
location.x = x;
request.setLocation(location);
ConnectionAnchor targetAnchor = nodeEditPart.getTargetConnectionAnchor(request);
- if(targetAnchor != null) {
+ if (targetAnchor != null) {
location = targetAnchor.getLocation(reference);
break;
}
@@ -641,48 +641,48 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
/**
* Get location of OccurrenceSpecification.
- *
+ *
* @param event
* @return
*/
private Point getLocationForDurationConstraintOnEvent(OccurrenceSpecification event) {
Point targetLocation = null;
- if(event instanceof MessageOccurrenceSpecification) {
- Message message = ((MessageOccurrenceSpecification)event).getMessage();
- if(message == null) {
+ if (event instanceof MessageOccurrenceSpecification) {
+ Message message = ((MessageOccurrenceSpecification) event).getMessage();
+ if (message == null) {
return null;
}
ConnectionNodeEditPart messageEditPart = null;
DiagramEditPart diag = DiagramEditPartsUtil.getDiagramEditPart(getHost());
- for(Object conn : diag.getConnections()) {
- if(conn instanceof ConnectionNodeEditPart) {
- EObject connElt = ((ConnectionNodeEditPart)conn).resolveSemanticElement();
- if(message.equals(connElt)) {
- messageEditPart = (ConnectionNodeEditPart)conn;
+ for (Object conn : diag.getConnections()) {
+ if (conn instanceof ConnectionNodeEditPart) {
+ EObject connElt = ((ConnectionNodeEditPart) conn).resolveSemanticElement();
+ if (message.equals(connElt)) {
+ messageEditPart = (ConnectionNodeEditPart) conn;
break;
}
}
}
- if(messageEditPart == null) {
+ if (messageEditPart == null) {
return null;
}
- if(event == message.getSendEvent()) {
+ if (event == message.getSendEvent()) {
targetLocation = SequenceUtil.getAbsoluteEdgeExtremity(messageEditPart, true);
- } else if(event == message.getReceiveEvent()) {
+ } else if (event == message.getReceiveEvent()) {
targetLocation = SequenceUtil.getAbsoluteEdgeExtremity(messageEditPart, false);
}
- } else if(event instanceof ExecutionOccurrenceSpecification) {
- ExecutionSpecification execution = ((ExecutionOccurrenceSpecification)event).getExecution();
- if(execution != null) {
+ } else if (event instanceof ExecutionOccurrenceSpecification) {
+ ExecutionSpecification execution = ((ExecutionOccurrenceSpecification) event).getExecution();
+ if (execution != null) {
List<View> existingViews = DiagramEditPartsUtil.findViews(execution, getViewer());
- for(View view : existingViews) {
- if(ActionExecutionSpecificationEditPart.VISUAL_ID == UMLVisualIDRegistry.getVisualID(view) || BehaviorExecutionSpecificationEditPart.VISUAL_ID == UMLVisualIDRegistry.getVisualID(view)) {
+ for (View view : existingViews) {
+ if (ActionExecutionSpecificationEditPart.VISUAL_ID == UMLVisualIDRegistry.getVisualID(view) || BehaviorExecutionSpecificationEditPart.VISUAL_ID == UMLVisualIDRegistry.getVisualID(view)) {
Object object = getViewer().getEditPartRegistry().get(view);
- if(object instanceof IGraphicalEditPart) {
- Rectangle bounds = SequenceUtil.getAbsoluteBounds((IGraphicalEditPart)object);
- if(event == execution.getStart()) {
+ if (object instanceof IGraphicalEditPart) {
+ Rectangle bounds = SequenceUtil.getAbsoluteBounds((IGraphicalEditPart) object);
+ if (event == execution.getStart()) {
targetLocation = bounds.getTop();
- } else if(event == execution.getFinish()) {
+ } else if (event == execution.getFinish()) {
targetLocation = bounds.getBottom();
}
}
@@ -695,46 +695,46 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
/**
* Get the command to drop an element between two events in order to create a message label
- *
+ *
* @param droppedElement
- * the dropped element
+ * the dropped element
* @param event1
- * first event (of type MessageOccurrenceSpecification)
+ * first event (of type MessageOccurrenceSpecification)
* @param event2
- * second event (of type MessageOccurrenceSpecification)
+ * second event (of type MessageOccurrenceSpecification)
* @param element
* @return the command or false if the elements can not be dropped as message label
*/
private Command dropMessageNodeBetweenEvents(Element droppedElement, Element event1, Element event2) {
- if(event1 instanceof MessageOccurrenceSpecification && event2 instanceof MessageOccurrenceSpecification) {
- if(!event1.equals(event2)) {
+ if (event1 instanceof MessageOccurrenceSpecification && event2 instanceof MessageOccurrenceSpecification) {
+ if (!event1.equals(event2)) {
boolean endsOfSameMessage = false;
int visualId = -1;
- if(droppedElement instanceof DurationConstraint) {
+ if (droppedElement instanceof DurationConstraint) {
visualId = DurationConstraintInMessageEditPart.VISUAL_ID;
- endsOfSameMessage = DurationConstraintHelper.endsOfSameMessage((OccurrenceSpecification)event1, (OccurrenceSpecification)event2);
- } else if(droppedElement instanceof DurationObservation) {
+ endsOfSameMessage = DurationConstraintHelper.endsOfSameMessage((OccurrenceSpecification) event1, (OccurrenceSpecification) event2);
+ } else if (droppedElement instanceof DurationObservation) {
visualId = DurationObservationEditPart.VISUAL_ID;
- endsOfSameMessage = DurationObservationHelper.endsOfSameMessage((OccurrenceSpecification)event1, (OccurrenceSpecification)event2);
+ endsOfSameMessage = DurationObservationHelper.endsOfSameMessage((OccurrenceSpecification) event1, (OccurrenceSpecification) event2);
}
- if(endsOfSameMessage) {
- Message message = ((MessageOccurrenceSpecification)event1).getMessage();
+ if (endsOfSameMessage) {
+ Message message = ((MessageOccurrenceSpecification) event1).getMessage();
// search a connection which matches the possessing message
DiagramEditPart diag = DiagramEditPartsUtil.getDiagramEditPart(getHost());
- for(Object conn : diag.getConnections()) {
- if(conn instanceof ConnectionNodeEditPart) {
- EObject connElt = ((ConnectionNodeEditPart)conn).resolveSemanticElement();
- if(message.equals(connElt)) {
+ for (Object conn : diag.getConnections()) {
+ if (conn instanceof ConnectionNodeEditPart) {
+ EObject connElt = ((ConnectionNodeEditPart) conn).resolveSemanticElement();
+ if (message.equals(connElt)) {
// check that node isn't already represented, or dropping is impossible
- for(Object child : ((ConnectionNodeEditPart)conn).getChildren()) {
- if(child instanceof GraphicalEditPart) {
- EObject childElt = ((GraphicalEditPart)child).resolveSemanticElement();
- if(droppedElement.equals(childElt)) {
+ for (Object child : ((ConnectionNodeEditPart) conn).getChildren()) {
+ if (child instanceof GraphicalEditPart) {
+ EObject childElt = ((GraphicalEditPart) child).resolveSemanticElement();
+ if (droppedElement.equals(childElt)) {
return null;
}
}
}
- return dropNodeOnMessage((PackageableElement)droppedElement, (ConnectionNodeEditPart)conn, visualId);
+ return dropNodeOnMessage((PackageableElement) droppedElement, (ConnectionNodeEditPart) conn, visualId);
}
}
}
@@ -746,15 +746,15 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
/**
* Test whether visual ids are compatible with a duration constraint element
- *
+ *
* @param nodeVISUALID
- * the detected node visual id
+ * the detected node visual id
* @param linkVISUALID
- * the detected link visual id
+ * the detected link visual id
* @return true if element may be a duration constraint
*/
private boolean isDurationConstraintHint(int nodeVISUALID, int linkVISUALID) {
- if(linkVISUALID != -1) {
+ if (linkVISUALID != -1) {
return false;
} else {
return nodeVISUALID == -1 || nodeVISUALID == ConstraintEditPart.VISUAL_ID || nodeVISUALID == DurationConstraintEditPart.VISUAL_ID || nodeVISUALID == DurationConstraintInMessageEditPart.VISUAL_ID;
@@ -763,45 +763,45 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
/**
* Drop a duration observation or a duration constraint on a message edit part
- *
+ *
* @param durationLabelElement
- * the duration observation or duration constraint to display as message label
+ * the duration observation or duration constraint to display as message label
* @param messageEditPart
- * the containing message edit part
+ * the containing message edit part
* @param nodeVISUALID
- * the label node visual id
+ * the label node visual id
* @return the command or UnexecutableCommand
*/
private Command dropNodeOnMessage(PackageableElement durationLabelElement, ConnectionNodeEditPart messageEditPart, int nodeVISUALID) {
IAdaptable elementAdapter = new EObjectAdapter(durationLabelElement);
- ViewDescriptor descriptor = new ViewDescriptor(elementAdapter, Node.class, ((IHintedType)getUMLElementType(nodeVISUALID)).getSemanticHint(), ViewUtil.APPEND, false, getDiagramPreferencesHint());
+ ViewDescriptor descriptor = new ViewDescriptor(elementAdapter, Node.class, ((IHintedType) getUMLElementType(nodeVISUALID)).getSemanticHint(), ViewUtil.APPEND, false, getDiagramPreferencesHint());
return messageEditPart.getCommand(new CreateViewRequest(descriptor));
}
/**
* Drop a time observation on a lifeline.
- *
+ *
* @param observation
- * the time constraint
+ * the time constraint
* @param nodeVISUALID
- * the node visual id
+ * the node visual id
* @param dropLocation
* @return the command if the lifeline is the correct one or UnexecutableCommand
*/
private Command dropTimeObservationInLifeline(TimeObservation observation, int nodeVISUALID, Point dropLocation) {
CompoundCommand cc = new CompoundCommand("Drop");
IAdaptable elementAdapter = new EObjectAdapter(observation);
- ViewDescriptor descriptor = new ViewDescriptor(elementAdapter, Node.class, ((IHintedType)getUMLElementType(nodeVISUALID)).getSemanticHint(), ViewUtil.APPEND, true, getDiagramPreferencesHint());
+ ViewDescriptor descriptor = new ViewDescriptor(elementAdapter, Node.class, ((IHintedType) getUMLElementType(nodeVISUALID)).getSemanticHint(), ViewUtil.APPEND, true, getDiagramPreferencesHint());
cc.add(getHost().getCommand(new CreateViewRequest(descriptor)));
LifelineEditPart lifelinePart = SequenceUtil.getParentLifelinePart(getHost());
- if(lifelinePart != null) {
+ if (lifelinePart != null) {
NamedElement occ1 = observation.getEvent();
- if(occ1 instanceof OccurrenceSpecification) {
- Point middlePoint = SequenceUtil.findLocationOfEvent(lifelinePart, (OccurrenceSpecification)occ1);
- if(middlePoint != null) {
+ if (occ1 instanceof OccurrenceSpecification) {
+ Point middlePoint = SequenceUtil.findLocationOfEvent(lifelinePart, (OccurrenceSpecification) occ1);
+ if (middlePoint != null) {
int height = getDefaultDropHeight(nodeVISUALID);
Point startPoint = middlePoint.getCopy();
- if(height > 0) {
+ if (height > 0) {
startPoint.translate(0, -height / 2);
}
Rectangle newBounds = new Rectangle(startPoint, new Dimension(-1, height));
@@ -814,9 +814,9 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
}
}
}
- if(getHost() instanceof InteractionInteractionCompartmentEditPart) {
+ if (getHost() instanceof InteractionInteractionCompartmentEditPart) {
Rectangle newBounds = new Rectangle(dropLocation, new Dimension(-1, -1));
- ((InteractionInteractionCompartmentEditPart)getHost()).getFigure().translateToRelative(newBounds);
+ ((InteractionInteractionCompartmentEditPart) getHost()).getFigure().translateToRelative(newBounds);
SetBoundsCommand setBoundsCommand = new SetBoundsCommand(getEditingDomain(), "move", descriptor, newBounds);
cc.add(new ICommandProxy(setBoundsCommand));
return cc;
@@ -826,29 +826,29 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
/**
* Drop an interval constraint (duration or time) on a lifeline.
- *
+ *
* @param constraint
- * the interval constraint
+ * the interval constraint
* @param nodeVISUALID
- * the node visual id
+ * the node visual id
* @return the command if the lifeline is the correct one or UnexecutableCommand
*/
private Command dropIntervalConstraintInLifeline(IntervalConstraint constraint, int nodeVISUALID) {
CompoundCommand cc = new CompoundCommand("Drop");
IAdaptable elementAdapter = new EObjectAdapter(constraint);
- ViewDescriptor descriptor = new ViewDescriptor(elementAdapter, Node.class, ((IHintedType)getUMLElementType(nodeVISUALID)).getSemanticHint(), ViewUtil.APPEND, true, getDiagramPreferencesHint());
+ ViewDescriptor descriptor = new ViewDescriptor(elementAdapter, Node.class, ((IHintedType) getUMLElementType(nodeVISUALID)).getSemanticHint(), ViewUtil.APPEND, true, getDiagramPreferencesHint());
cc.add(getHost().getCommand(new CreateViewRequest(descriptor)));
LifelineEditPart lifelinePart = SequenceUtil.getParentLifelinePart(getHost());
- if(lifelinePart != null && constraint.getConstrainedElements().size() >= 2) {
+ if (lifelinePart != null && constraint.getConstrainedElements().size() >= 2) {
Element occ1 = constraint.getConstrainedElements().get(0);
Element occ2 = constraint.getConstrainedElements().get(1);
- if(occ1 instanceof OccurrenceSpecification && occ2 instanceof OccurrenceSpecification) {
- Point startPoint = SequenceUtil.findLocationOfEvent(lifelinePart, (OccurrenceSpecification)occ1);
- Point endPoint = SequenceUtil.findLocationOfEvent(lifelinePart, (OccurrenceSpecification)occ2);
- if(startPoint != null && endPoint != null) {
+ if (occ1 instanceof OccurrenceSpecification && occ2 instanceof OccurrenceSpecification) {
+ Point startPoint = SequenceUtil.findLocationOfEvent(lifelinePart, (OccurrenceSpecification) occ1);
+ Point endPoint = SequenceUtil.findLocationOfEvent(lifelinePart, (OccurrenceSpecification) occ2);
+ if (startPoint != null && endPoint != null) {
int height = endPoint.y - startPoint.y;
Rectangle newBounds = null;
- if(height < 0) {
+ if (height < 0) {
newBounds = new Rectangle(endPoint, new Dimension(-1, -height));
} else {
newBounds = new Rectangle(startPoint, new Dimension(-1, height));
@@ -861,14 +861,14 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
return cc;
}
}
- } else if(lifelinePart != null && constraint.getConstrainedElements().size() == 1) {
+ } else if (lifelinePart != null && constraint.getConstrainedElements().size() == 1) {
Element occ1 = constraint.getConstrainedElements().get(0);
- if(occ1 instanceof OccurrenceSpecification) {
- Point middlePoint = SequenceUtil.findLocationOfEvent(lifelinePart, (OccurrenceSpecification)occ1);
- if(middlePoint != null) {
+ if (occ1 instanceof OccurrenceSpecification) {
+ Point middlePoint = SequenceUtil.findLocationOfEvent(lifelinePart, (OccurrenceSpecification) occ1);
+ if (middlePoint != null) {
int height = getDefaultDropHeight(nodeVISUALID);
Point startPoint = middlePoint.getCopy();
- if(height > 0) {
+ if (height > 0) {
startPoint.translate(0, -height / 2);
}
Rectangle newBounds = new Rectangle(startPoint, new Dimension(-1, height));
@@ -886,13 +886,13 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
/**
* Get the default height to set to a drop object. This method is useful for dropped objects which must be positioned relatively to their center.
- *
+ *
* @param nodeVISUALID
- * the node visual id
+ * the node visual id
* @return arbitrary default height for the node visual id (eventually -1)
*/
private int getDefaultDropHeight(int nodeVISUALID) {
- if(TimeConstraintEditPart.VISUAL_ID == nodeVISUALID || TimeObservationEditPart.VISUAL_ID == nodeVISUALID) {
+ if (TimeConstraintEditPart.VISUAL_ID == nodeVISUALID || TimeObservationEditPart.VISUAL_ID == nodeVISUALID) {
return 2;
}
return -1;
@@ -902,7 +902,7 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
// an StateInvariant covereds systematically a unique lifeline
Lifeline lifeline = stateInvariant.getCovereds().get(0);
// Check that the container view is the view of the lifeline
- if(lifeline.equals(getHostObject())) {
+ if (lifeline.equals(getHostObject())) {
return new ICommandProxy(getDefaultDropNodeCommand(nodeVISUALID, location, stateInvariant));
}
return UnexecutableCommand.INSTANCE;
@@ -910,17 +910,17 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
/**
* Get lifelines element which contains these existingViews
- *
+ *
* @param existingViews
- * the existing views.
+ * the existing views.
* @return the list of lifeline.
*/
private List<Lifeline> getLifelines(List<View> existingViews) {
List<Lifeline> lifelines = new ArrayList<Lifeline>();
- for(View view : existingViews) {
- EObject eObject = ViewUtil.resolveSemanticElement((View)view.eContainer());
- if(eObject instanceof Lifeline) {
- lifelines.add((Lifeline)eObject);
+ for (View view : existingViews) {
+ EObject eObject = ViewUtil.resolveSemanticElement((View) view.eContainer());
+ if (eObject instanceof Lifeline) {
+ lifelines.add((Lifeline) eObject);
}
}
return lifelines;
@@ -928,7 +928,7 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
/**
* Create command for drop a Gate.
- *
+ *
* @param gate
* @param location
* @return
@@ -939,18 +939,18 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
/**
* Create command for drop a Gate.
- *
+ *
* @param gate
* @param location
* @return
*/
private ICommand getDropGateCommand(Gate gate, Point location) {
List<View> existingViews = DiagramEditPartsUtil.findViews(gate, getViewer());
- if(existingViews.isEmpty()) {
+ if (existingViews.isEmpty()) {
EObject owner = gate.eContainer();
- if(owner != null) {
- org.eclipse.gef.GraphicalEditPart parent = (org.eclipse.gef.GraphicalEditPart)lookForEditPart(owner);
- if(parent != null) {
+ if (owner != null) {
+ org.eclipse.gef.GraphicalEditPart parent = (org.eclipse.gef.GraphicalEditPart) lookForEditPart(owner);
+ if (parent != null) {
Point gateLocation = GateHelper.computeGateLocation(location, parent.getFigure(), null);
return new CreateGateViewCommand(getEditingDomain(), parent, gateLocation, new EObjectAdapter(gate));
}
@@ -961,11 +961,11 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
/**
* Drop a destructionEvent on a lifeline
- *
+ *
* @param destructionOccurence
- * the destructionEvent to drop
+ * the destructionEvent to drop
* @param nodeVISUALID
- * the node visualID
+ * the node visualID
* @return the command to drop the destructionEvent on a lifeline if allowed.
*/
private Command dropDestructionOccurrence(DestructionOccurrenceSpecification destructionOccurence, int nodeVISUALID, Point location) {
@@ -974,13 +974,13 @@ 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 (!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 (destructionOccurence.equals(occurrenceSpecification)) {
return new ICommandProxy(getDefaultDropNodeCommand(nodeVISUALID, location, destructionOccurence));
}
}
@@ -991,29 +991,29 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
/**
* Get the command to drop an execution specification node
- *
+ *
* @param es
- * execution specification
+ * execution specification
* @param nodeVISUALID
- * the execution specification's visual id
+ * the execution specification's visual id
* @param location
- * the location of the drop request
+ * the location of the drop request
* @return the drop command
*/
private Command dropExecutionSpecification(ExecutionSpecification es, int nodeVISUALID, Point location) {
List<View> existingViews = DiagramEditPartsUtil.findViews(es, getViewer());
// only allow one view instance of a single element by diagram
- if(existingViews.isEmpty()) {
+ if (existingViews.isEmpty()) {
// Find the lifeline of the ES
- if(es.getStart() != null && !es.getStart().getCovereds().isEmpty()) {
+ if (es.getStart() != null && !es.getStart().getCovereds().isEmpty()) {
// an Occurrence Specification covers systematically a unique lifeline
Lifeline lifeline = es.getStart().getCovereds().get(0);
// Check that the container view is the view of the lifeline
- if(lifeline.equals(getHostObject())) {
- //return new ICommandProxy(getDefaultDropNodeCommand(nodeVISUALID, location, es));
- IHintedType type = ((IHintedType)getUMLElementType(nodeVISUALID));
+ if (lifeline.equals(getHostObject())) {
+ // return new ICommandProxy(getDefaultDropNodeCommand(nodeVISUALID, location, es));
+ IHintedType type = ((IHintedType) getUMLElementType(nodeVISUALID));
String semanticHint = null;
- if(type != null) {
+ if (type != null) {
semanticHint = type.getSemanticHint();
}
IAdaptable elementAdapter = new EObjectAdapter(es);
@@ -1021,7 +1021,7 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
CreateViewRequest createViewRequest = new CreateViewRequest(descriptor);
// find best bounds
Rectangle bounds = getExecutionSpecificationBounds(es);
- if(bounds != null) {
+ if (bounds != null) {
createViewRequest.setLocation(bounds.getLocation());
createViewRequest.setSize(bounds.getSize());
} else {
@@ -1040,7 +1040,7 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
/**
* Get the command to drop an code region node
- *
+ *
* @param combinedFragment
* @param nodeVISUALID
* @param location
@@ -1049,13 +1049,13 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
private Command dropCoRegion(CombinedFragment combinedFragment, int nodeVISUALID, Point location) {
List<View> existingViews = DiagramEditPartsUtil.findViews(combinedFragment, getViewer());
// only allow one view instance of a single element by diagram
- if(existingViews.isEmpty()) {
- IGraphicalEditPart hostEditpart = (IGraphicalEditPart)getHost();
+ if (existingViews.isEmpty()) {
+ IGraphicalEditPart hostEditpart = (IGraphicalEditPart) getHost();
EObject element = hostEditpart.getNotationView().getElement();
- if(element instanceof Lifeline) {
- IHintedType type = ((IHintedType)getUMLElementType(nodeVISUALID));
+ if (element instanceof Lifeline) {
+ IHintedType type = ((IHintedType) getUMLElementType(nodeVISUALID));
String semanticHint = null;
- if(type != null) {
+ if (type != null) {
semanticHint = type.getSemanticHint();
}
IAdaptable elementAdapter = new EObjectAdapter(combinedFragment);
@@ -1074,9 +1074,9 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
/**
* Get the advised bounds to drop an execution specification
- *
+ *
* @param es
- * the dropped execution specification
+ * the dropped execution specification
* @return bounds of the es in absolute coordinates or null
*/
private Rectangle getExecutionSpecificationBounds(ExecutionSpecification es) {
@@ -1087,24 +1087,24 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
// end events of the link
OccurrenceSpecification startEvent = es.getStart();
OccurrenceSpecification finishEvent = es.getFinish();
- if(startEvent != null && finishEvent != null && getHost() instanceof LifelineEditPart) {
- LifelineEditPart hostLifeline = (LifelineEditPart)getHost();
+ if (startEvent != null && finishEvent != null && getHost() instanceof LifelineEditPart) {
+ LifelineEditPart hostLifeline = (LifelineEditPart) getHost();
// find location constraints for source
- startLocation = SequenceUtil.findLocationOfEvent((LifelineEditPart)getHost(), startEvent);
- if(startLocation == null) {
+ startLocation = SequenceUtil.findLocationOfEvent((LifelineEditPart) getHost(), startEvent);
+ if (startLocation == null) {
possibleStartLocations = SequenceUtil.findPossibleLocationsForEvent(hostLifeline, startEvent);
}
// find location constraints for target
finishLocation = SequenceUtil.findLocationOfEvent(hostLifeline, finishEvent);
- if(finishLocation == null) {
+ if (finishLocation == null) {
possibleFinishLocations = SequenceUtil.findPossibleLocationsForEvent(hostLifeline, finishEvent);
}
// find start and finish locations with correct y (start.y < finish.y) and proportions
- if(startLocation == null) {
- if(finishLocation != null) {
+ if (startLocation == null) {
+ if (finishLocation != null) {
int top = possibleStartLocations.x;
int bottom = possibleStartLocations.bottom();
- if(top > finishLocation.y) {
+ if (top > finishLocation.y) {
return null;
} else {
startLocation = possibleStartLocations.getTop();
@@ -1115,12 +1115,12 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
int bottomS = possibleStartLocations.bottom();
int topF = possibleFinishLocations.y;
int bottomF = possibleFinishLocations.bottom();
- if(topS > bottomF) {
+ if (topS > bottomF) {
return null;
} else {
startLocation = possibleStartLocations.getTop();
finishLocation = possibleFinishLocations.getBottom();
- if(bottomS < topF) {
+ if (bottomS < topF) {
startLocation.y = (topS + bottomS) / 2;
finishLocation.y = (topF + bottomF) / 2;
} else {
@@ -1130,11 +1130,11 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
}
}
}
- if(finishLocation == null) {
+ if (finishLocation == null) {
// startLocation != null
int top = possibleFinishLocations.y;
int bottom = possibleFinishLocations.bottom();
- if(bottom < startLocation.y) {
+ if (bottom < startLocation.y) {
return null;
} else {
finishLocation = possibleFinishLocations.getBottom();
@@ -1151,26 +1151,26 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
/**
* Get the command to drop a message link
- *
+ *
* @param dropRequest
- * request to drop
+ * request to drop
* @param semanticLink
- * message link
+ * message link
* @param linkVISUALID
- * the message's visual id
+ * the message's visual id
* @return the drop command
*/
private Command dropMessage(DropObjectsRequest dropRequest, Element semanticLink, int linkVISUALID) {
- //Do NOT drop again if existed.
+ // Do NOT drop again if existed.
List<View> existingViews = DiagramEditPartsUtil.findViews(semanticLink, getViewer());
- if(!existingViews.isEmpty()) {
+ if (!existingViews.isEmpty()) {
return UnexecutableCommand.INSTANCE;
}
Collection<?> sources = SequenceLinkMappingHelper.getInstance().getSource(semanticLink);
Collection<?> targets = SequenceLinkMappingHelper.getInstance().getTarget(semanticLink);
- if(!sources.isEmpty() && !targets.isEmpty()) {
- Element source = (Element)sources.toArray()[0];
- Element target = (Element)targets.toArray()[0];
+ if (!sources.isEmpty() && !targets.isEmpty()) {
+ Element source = (Element) sources.toArray()[0];
+ Element target = (Element) targets.toArray()[0];
return getDropLocatedLinkCommand(dropRequest, source, target, linkVISUALID, semanticLink);
} else {
return UnexecutableCommand.INSTANCE;
@@ -1180,53 +1180,54 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
/**
* The method provides command to create the binary link into the diagram. If the source and the
* target views do not exist, these views will be created.
- *
- * This implementation is very similar to
- * {@link CommonDiagramDragDropEditPolicy#dropBinaryLink(CompositeCommand, Element, Element, int, Point, Element)}.
- *
+ *
+ * This implementation is very similar to {@link CommonDiagramDragDropEditPolicy#dropBinaryLink(CompositeCommand, Element, Element, int, Point, Element)}.
+ *
* @param dropRequest
- * the drop request
+ * the drop request
* @param cc
- * the composite command that will contain the set of command to create the binary
- * link
+ * the composite command that will contain the set of command to create the binary
+ * link
* @param source
- * the element source of the link
+ * the element source of the link
* @param target
- * the element target of the link
+ * the element target of the link
* @param linkVISUALID
- * the link VISUALID used to create the view
+ * the link VISUALID used to create the view
* @param location
- * the location the location where the view will be be created
+ * the location the location where the view will be be created
* @param semanticLink
- * the semantic link that will be attached to the view
- *
+ * the semantic link that will be attached to the view
+ *
* @return the composite command
*/
protected Command getDropLocatedLinkCommand(DropObjectsRequest dropRequest, Element source, Element target, int linkVISUALID, Element semanticLink) {
// look for editpart
- GraphicalEditPart sourceEditPart = (GraphicalEditPart)lookForEditPart(source);
- GraphicalEditPart targetEditPart = (GraphicalEditPart)lookForEditPart(target);
+ GraphicalEditPart sourceEditPart = (GraphicalEditPart) lookForEditPart(source);
+ GraphicalEditPart targetEditPart = (GraphicalEditPart) lookForEditPart(target);
CompositeCommand cc = new CompositeCommand("Drop");
// descriptor of the link
- CreateConnectionViewRequest.ConnectionViewDescriptor linkdescriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(getUMLElementType(linkVISUALID), ((IHintedType)getUMLElementType(linkVISUALID)).getSemanticHint(), getDiagramPreferencesHint());
+ CreateConnectionViewRequest.ConnectionViewDescriptor linkdescriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(getUMLElementType(linkVISUALID), ((IHintedType) getUMLElementType(linkVISUALID)).getSemanticHint(),
+ getDiagramPreferencesHint());
// get source and target adapters, creating the add commands if necessary
IAdaptable sourceAdapter = null;
IAdaptable targetAdapter = null;
- if(sourceEditPart == null) {
+ if (sourceEditPart == null) {
ICommand createCommand = getDefaultDropNodeCommand(getLinkSourceDropLocation(dropRequest.getLocation(), source, target), source);
cc.add(createCommand);
- sourceAdapter = (IAdaptable)createCommand.getCommandResult().getReturnValue();
+ sourceAdapter = (IAdaptable) createCommand.getCommandResult().getReturnValue();
} else {
sourceAdapter = new SemanticAdapter(null, sourceEditPart.getModel());
}
- if(targetEditPart == null) {
+ if (targetEditPart == null) {
ICommand createCommand = getDefaultDropNodeCommand(getLinkTargetDropLocation(dropRequest.getLocation(), source, target), target);
cc.add(createCommand);
- targetAdapter = (IAdaptable)createCommand.getCommandResult().getReturnValue();
+ targetAdapter = (IAdaptable) createCommand.getCommandResult().getReturnValue();
} else {
targetAdapter = new SemanticAdapter(null, targetEditPart.getModel());
}
- CreateLocatedConnectionViewCommand aLinkCommand = new CreateLocatedConnectionViewCommand(getEditingDomain(), ((IHintedType)getUMLElementType(linkVISUALID)).getSemanticHint(), sourceAdapter, targetAdapter, getViewer(), getDiagramPreferencesHint(), linkdescriptor, null);
+ CreateLocatedConnectionViewCommand aLinkCommand = new CreateLocatedConnectionViewCommand(getEditingDomain(), ((IHintedType) getUMLElementType(linkVISUALID)).getSemanticHint(), sourceAdapter, targetAdapter, getViewer(), getDiagramPreferencesHint(),
+ linkdescriptor, null);
aLinkCommand.setElement(semanticLink);
Point[] sourceAndTarget = getLinkSourceAndTargetLocations(semanticLink, sourceEditPart, targetEditPart, dropRequest.getLocation().getCopy());// add default location support.
aLinkCommand.setLocations(sourceAndTarget[0], sourceAndTarget[1]);
@@ -1236,101 +1237,101 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
@Override
protected ICommand getDefaultDropNodeCommand(Point absoluteLocation, EObject droppedObject) {
- //Custom command for dropping a gate.
- if(droppedObject instanceof Gate) {
- return getDropGateCommand((Gate)droppedObject, absoluteLocation);
+ // Custom command for dropping a gate.
+ if (droppedObject instanceof Gate) {
+ return getDropGateCommand((Gate) droppedObject, absoluteLocation);
}
return super.getDefaultDropNodeCommand(absoluteLocation, droppedObject);
}
/**
* Get the source and target recommended points for creating the link
- *
+ *
* @param semanticLink
- * link to create
+ * link to create
* @param sourceEditPart
- * edit part source of the link
+ * edit part source of the link
* @param targetEditPart
- * edit part target of the link
+ * edit part target of the link
* @param dropLocation
- * default location if NOT found.
+ * default location if NOT found.
* @return a point array of size 2, with eventually null values (when no point constraint). Index 0 : source location, 1 : target location
*/
private Point[] getLinkSourceAndTargetLocations(Element semanticLink, GraphicalEditPart sourceEditPart, GraphicalEditPart targetEditPart, Point dropLocation) {
// index 0 : source location, 1 : target location
- Point[] sourceAndTarget = new Point[]{ null, null };
+ Point[] sourceAndTarget = new Point[] { null, null };
// end events of the link
OccurrenceSpecification sourceEvent = null;
OccurrenceSpecification targetEvent = null;
- if(semanticLink instanceof Message) {
- MessageEnd sendEvent = ((Message)semanticLink).getSendEvent();
- if(sendEvent instanceof OccurrenceSpecification) {
- sourceEvent = (OccurrenceSpecification)sendEvent;
- } else if(sendEvent instanceof Gate) {//for gate
- if(sourceEditPart != null) {
+ if (semanticLink instanceof Message) {
+ MessageEnd sendEvent = ((Message) semanticLink).getSendEvent();
+ if (sendEvent instanceof OccurrenceSpecification) {
+ sourceEvent = (OccurrenceSpecification) sendEvent;
+ } else if (sendEvent instanceof Gate) {// for gate
+ if (sourceEditPart != null) {
sourceAndTarget[0] = SequenceUtil.getAbsoluteBounds(sourceEditPart).getCenter();
} else {
sourceAndTarget[0] = dropLocation;
}
- } else if(sendEvent == null) {//found message
+ } else if (sendEvent == null) {// found message
sourceAndTarget[0] = dropLocation;
}
- MessageEnd rcvEvent = ((Message)semanticLink).getReceiveEvent();
- if(rcvEvent instanceof OccurrenceSpecification) {
- targetEvent = (OccurrenceSpecification)rcvEvent;
- } else if(rcvEvent instanceof Gate) {//for gate
- if(targetEditPart != null) {
+ MessageEnd rcvEvent = ((Message) semanticLink).getReceiveEvent();
+ if (rcvEvent instanceof OccurrenceSpecification) {
+ targetEvent = (OccurrenceSpecification) rcvEvent;
+ } else if (rcvEvent instanceof Gate) {// for gate
+ if (targetEditPart != null) {
sourceAndTarget[1] = SequenceUtil.getAbsoluteBounds(targetEditPart).getCenter();
} else {
sourceAndTarget[1] = dropLocation;
}
- } else if(rcvEvent == null) {//lost message
+ } else if (rcvEvent == null) {// lost message
sourceAndTarget[1] = dropLocation;
}
- } else if(semanticLink instanceof GeneralOrdering) {
- sourceEvent = ((GeneralOrdering)semanticLink).getBefore();
- targetEvent = ((GeneralOrdering)semanticLink).getAfter();
+ } else if (semanticLink instanceof GeneralOrdering) {
+ sourceEvent = ((GeneralOrdering) semanticLink).getBefore();
+ targetEvent = ((GeneralOrdering) semanticLink).getAfter();
}
- if(sourceEvent != null || targetEvent != null) {
+ if (sourceEvent != null || targetEvent != null) {
Rectangle possibleSourceLocations = null;
Rectangle possibleTargetLocations = null;
// find location constraints for source
- if(sourceEvent != null && sourceEditPart instanceof LifelineEditPart) {
- sourceAndTarget[0] = SequenceUtil.findLocationOfEvent((LifelineEditPart)sourceEditPart, sourceEvent);
- if(sourceAndTarget[0] == null) {
- possibleSourceLocations = SequenceUtil.findPossibleLocationsForEvent((LifelineEditPart)sourceEditPart, sourceEvent);
+ if (sourceEvent != null && sourceEditPart instanceof LifelineEditPart) {
+ sourceAndTarget[0] = SequenceUtil.findLocationOfEvent((LifelineEditPart) sourceEditPart, sourceEvent);
+ if (sourceAndTarget[0] == null) {
+ possibleSourceLocations = SequenceUtil.findPossibleLocationsForEvent((LifelineEditPart) sourceEditPart, sourceEvent);
}
}
- //find possible source location on Gate
- else if(sourceEditPart instanceof GateEditPart) {
+ // find possible source location on Gate
+ else if (sourceEditPart instanceof GateEditPart) {
possibleSourceLocations = SequenceUtil.getAbsoluteBounds(sourceEditPart);
}
// find location constraints for target
- if(targetEvent != null && targetEditPart instanceof LifelineEditPart) {
- sourceAndTarget[1] = SequenceUtil.findLocationOfEvent((LifelineEditPart)targetEditPart, targetEvent);
- if(sourceAndTarget[1] == null) {
- possibleTargetLocations = SequenceUtil.findPossibleLocationsForEvent((LifelineEditPart)targetEditPart, targetEvent);
+ if (targetEvent != null && targetEditPart instanceof LifelineEditPart) {
+ sourceAndTarget[1] = SequenceUtil.findLocationOfEvent((LifelineEditPart) targetEditPart, targetEvent);
+ if (sourceAndTarget[1] == null) {
+ possibleTargetLocations = SequenceUtil.findPossibleLocationsForEvent((LifelineEditPart) targetEditPart, targetEvent);
}
}
- //find possible target location on Gate
- else if(targetEditPart instanceof GateEditPart) {
+ // find possible target location on Gate
+ else if (targetEditPart instanceof GateEditPart) {
possibleTargetLocations = SequenceUtil.getAbsoluteBounds(sourceEditPart);
}
// deduce a possibility
- if(sourceAndTarget[0] == null && possibleSourceLocations != null) {
+ if (sourceAndTarget[0] == null && possibleSourceLocations != null) {
// we must fix the source
- if(sourceAndTarget[1] == null && possibleTargetLocations == null) {
+ if (sourceAndTarget[1] == null && possibleTargetLocations == null) {
// no target constraint, take center for source
sourceAndTarget[0] = possibleSourceLocations.getCenter();
- } else if(sourceAndTarget[1] != null) {
+ } else if (sourceAndTarget[1] != null) {
// target is fixed, find arranging source
int topSource = possibleSourceLocations.y;
int centerSource = possibleSourceLocations.getCenter().y;
- if(sourceAndTarget[1].y < topSource) {
+ if (sourceAndTarget[1].y < topSource) {
// we would draw an uphill message (forbidden).
// return best locations (command will not execute correctly and handle error report)
sourceAndTarget[0] = possibleSourceLocations.getTop();
- } else if(centerSource <= sourceAndTarget[1].y) {
+ } else if (centerSource <= sourceAndTarget[1].y) {
// simply fix to the center of constraint
sourceAndTarget[0] = possibleSourceLocations.getCenter();
} else {
@@ -1345,12 +1346,12 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
int bottomTarget = possibleTargetLocations.bottom();
int topSource = possibleSourceLocations.y;
int centerSource = possibleSourceLocations.getCenter().y;
- if(bottomTarget < topSource) {
+ if (bottomTarget < topSource) {
// we would draw an uphill message (forbidden).
// return best locations (command will not execute correctly and handle error report)
sourceAndTarget[0] = possibleSourceLocations.getTop();
sourceAndTarget[1] = possibleTargetLocations.getBottom();
- } else if(centerSource <= centerTarget) {
+ } else if (centerSource <= centerTarget) {
// simply fix to centers
sourceAndTarget[0] = possibleSourceLocations.getCenter();
sourceAndTarget[1] = possibleTargetLocations.getCenter();
@@ -1363,20 +1364,20 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
}
}
}
- if(sourceAndTarget[1] == null && possibleTargetLocations != null) {
+ if (sourceAndTarget[1] == null && possibleTargetLocations != null) {
// we must fix the target
// fixedSourceLocation == null => possibleSourceLocations == null
// source is fixed, find arranging target
int centerTarget = possibleTargetLocations.getCenter().y;
int bottomTarget = possibleTargetLocations.bottom();
- if(sourceAndTarget[0] == null) {
+ if (sourceAndTarget[0] == null) {
// simply fix to the center of constraint
sourceAndTarget[1] = possibleTargetLocations.getCenter();
- } else if(bottomTarget < sourceAndTarget[0].y) {
+ } else if (bottomTarget < sourceAndTarget[0].y) {
// we would draw an uphill message (forbidden).
// return best locations (command will not execute correctly and handle error report)
sourceAndTarget[1] = possibleTargetLocations.getBottom();
- } else if(sourceAndTarget[0].y <= centerTarget) {
+ } else if (sourceAndTarget[0].y <= centerTarget) {
// simply fix to the center of constraint
sourceAndTarget[1] = possibleTargetLocations.getCenter();
} else {
@@ -1386,14 +1387,14 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
}
}
}
- //repair location for lost/found.
- if(semanticLink instanceof Message) {
- MessageEnd sendEvent = ((Message)semanticLink).getSendEvent();
- if(sendEvent == null && sourceAndTarget[1] != null) {//found message
+ // repair location for lost/found.
+ if (semanticLink instanceof Message) {
+ MessageEnd sendEvent = ((Message) semanticLink).getSendEvent();
+ if (sendEvent == null && sourceAndTarget[1] != null) {// found message
sourceAndTarget[0] = new Point(dropLocation.x, sourceAndTarget[1].y);
}
- MessageEnd rcvEvent = ((Message)semanticLink).getReceiveEvent();
- if(rcvEvent == null && sourceAndTarget[0] != null) {//lost message
+ MessageEnd rcvEvent = ((Message) semanticLink).getReceiveEvent();
+ if (rcvEvent == null && sourceAndTarget[0] != null) {// lost message
sourceAndTarget[1] = new Point(dropLocation.x, sourceAndTarget[0].y);
}
}
@@ -1402,21 +1403,21 @@ public class CustomDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
/**
* Get the command to drop a general ordering link
- *
+ *
* @param dropRequest
- * request to drop
+ * request to drop
* @param semanticLink
- * general ordering link
+ * general ordering link
* @param linkVISUALID
- * the link's visual id
+ * the link's visual id
* @return the drop command
*/
private Command dropGeneralOrdering(DropObjectsRequest dropRequest, Element semanticLink, int linkVISUALID) {
Collection<?> sources = SequenceLinkMappingHelper.getInstance().getSource(semanticLink);
Collection<?> targets = SequenceLinkMappingHelper.getInstance().getTarget(semanticLink);
- if(!sources.isEmpty() && !targets.isEmpty()) {
- Element source = (Element)sources.toArray()[0];
- Element target = (Element)targets.toArray()[0];
+ if (!sources.isEmpty() && !targets.isEmpty()) {
+ Element source = (Element) sources.toArray()[0];
+ Element target = (Element) targets.toArray()[0];
return getDropLocatedLinkCommand(dropRequest, source, target, linkVISUALID, semanticLink);
} else {
return UnexecutableCommand.INSTANCE;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CustomExternalLabelPrimaryDragRoleEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CustomExternalLabelPrimaryDragRoleEditPolicy.java
index 07afa675ee8..74029a09797 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CustomExternalLabelPrimaryDragRoleEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CustomExternalLabelPrimaryDragRoleEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2010 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
@@ -39,14 +39,14 @@ public class CustomExternalLabelPrimaryDragRoleEditPolicy extends ResizableEditP
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
@Override
protected Command getMoveCommand(ChangeBoundsRequest request) {
- LabelEditPart editPart = (LabelEditPart)getHost();
+ LabelEditPart editPart = (LabelEditPart) getHost();
// FeedBack - Port + Delta
Rectangle updatedRect = new Rectangle();
PrecisionRectangle initialRect = new PrecisionRectangle(getInitialFeedbackBounds().getCopy());
@@ -58,7 +58,7 @@ public class CustomExternalLabelPrimaryDragRoleEditPolicy extends ResizableEditP
rect.translate(request.getMoveDelta());
rect.resize(request.getSizeDelta());
getHostFigure().translateToRelative(rect);
- ICommand moveCommand = new SetBoundsCommand(editPart.getEditingDomain(), DiagramUIMessages.MoveLabelCommand_Label_Location, new EObjectAdapter((View)editPart.getModel()), updatedRect);
+ ICommand moveCommand = new SetBoundsCommand(editPart.getEditingDomain(), DiagramUIMessages.MoveLabelCommand_Label_Location, new EObjectAdapter((View) editPart.getModel()), updatedRect);
return new ICommandProxy(moveCommand);
}
}
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 80ed2846679..917959accb9 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
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -66,8 +66,8 @@ import org.eclipse.uml2.uml.TimeObservation;
/**
* Edit Policy in charge of the removal of time/duration constraint/observation which no longer have associated events.
* <P>
- * This view checks that the host edit part, a time/duration constraint/observation edit part, has necessary associated events. It listens for model
- * notifications. As soon as it receives a remove event, it checks whether the time element should be also deleted.<BR/>
+ * This view checks that the host edit part, a time/duration constraint/observation edit part, has necessary associated events. It listens for model notifications. As soon as it receives a remove event, it checks whether the time element should be also
+ * deleted.<BR/>
* </P>
*/
public class DeleteTimeElementWithoutEventPolicy extends AbstractEditPolicy implements NotificationListener, IPapyrusListener {
@@ -87,13 +87,13 @@ public class DeleteTimeElementWithoutEventPolicy extends AbstractEditPolicy impl
@Override
public void activate() {
// retrieve the view and the element associated to the host edit part
- final View hostView = (View)getHost().getModel();
+ final View hostView = (View) getHost().getModel();
hostSemanticElement = hostView.getElement();
// adds listener to the event broker, listening for the view and the semantic element associated to the host edit part
getDiagramEventBroker().addNotificationListener(hostView, this);
getDiagramEventBroker().addNotificationListener(hostSemanticElement, this);
// retrieve the list of linked view to listen parents
- for(View linkedView : getLinkedViews()) {
+ for (View linkedView : getLinkedViews()) {
getDiagramEventBroker().addNotificationListener(linkedView.eContainer(), this);
}
super.activate();
@@ -101,22 +101,22 @@ public class DeleteTimeElementWithoutEventPolicy extends AbstractEditPolicy impl
/**
* Removes this edit policy as listener for changes to the specified semanticParent
- *
+ *
* @param semanticParent
- * the semantic parent to stop listen
+ * the semantic parent to stop listen
* @param childView
- * the view that does not requires this additional listener
+ * the view that does not requires this additional listener
*/
protected void removeAdditionalParentToListen(EObject semanticParent, View childView) {
// removes the view from the list of views that requires a listener for the semantic parent
- if(additionalParentToListen.containsKey(semanticParent)) {
+ if (additionalParentToListen.containsKey(semanticParent)) {
List<View> views = additionalParentToListen.get(semanticParent);
assert (views != null) : "list should not be null";
views.remove(childView);
- if(views.isEmpty()) {
+ if (views.isEmpty()) {
additionalParentToListen.remove(semanticParent);
// check this is not the parent semantic element of the host's semantic element
- if(!semanticParent.equals(((View)getHost().getModel()).getElement())) {
+ if (!semanticParent.equals(((View) getHost().getModel()).getElement())) {
getDiagramEventBroker().removeNotificationListener(semanticParent, this);
}
}
@@ -129,9 +129,9 @@ public class DeleteTimeElementWithoutEventPolicy extends AbstractEditPolicy impl
@Override
public void deactivate() {
// retrieve the view and the element associated to the host edit part
- final View hostView = (View)getHost().getModel();
+ final View hostView = (View) getHost().getModel();
// removes all notification listeners for the additional parent to listen
- for(EObject parent : additionalParentToListen.keySet()) {
+ for (EObject parent : additionalParentToListen.keySet()) {
getDiagramEventBroker().removeNotificationListener(parent, this);
}
additionalParentToListen.clear();
@@ -148,7 +148,7 @@ public class DeleteTimeElementWithoutEventPolicy extends AbstractEditPolicy impl
*/
protected final void deleteTimeElement() {
Command cmd = getDeleteElementCommand(false);
- if(cmd.canExecute()) {
+ if (cmd.canExecute()) {
executeCommand(cmd);
}
}
@@ -158,16 +158,16 @@ public class DeleteTimeElementWithoutEventPolicy extends AbstractEditPolicy impl
*/
protected final void deleteTimeView() {
Command cmd = getDeleteElementCommand(true);
- if(cmd.canExecute()) {
+ if (cmd.canExecute()) {
executeCommand(cmd);
}
}
/**
* Executes the supplied command inside an <code>unchecked action</code>
- *
+ *
* @param cmd
- * command that can be executed (i.e., cmd.canExecute() == true)
+ * command that can be executed (i.e., cmd.canExecute() == true)
*/
protected void executeCommand(final Command cmd) {
Map<String, Boolean> options = null;
@@ -177,17 +177,17 @@ public class DeleteTimeElementWithoutEventPolicy extends AbstractEditPolicy impl
// do not use the DiagramEditPart.isActivating since ConnectionEditPart's
// parent will not be a diagram edit part
EditPartViewer viewer = ep.getViewer();
- if(viewer instanceof DiagramGraphicalViewer) {
- isActivating = ((DiagramGraphicalViewer)viewer).isInitializing();
+ if (viewer instanceof DiagramGraphicalViewer) {
+ isActivating = ((DiagramGraphicalViewer) viewer).isInitializing();
}
- if(isActivating || !EditPartUtil.isWriteTransactionInProgress((IGraphicalEditPart)getHost(), false, false)) {
+ if (isActivating || !EditPartUtil.isWriteTransactionInProgress((IGraphicalEditPart) getHost(), false, false)) {
options = Collections.singletonMap(Transaction.OPTION_UNPROTECTED, Boolean.TRUE);
}
- AbstractEMFOperation operation = new AbstractEMFOperation(((IGraphicalEditPart)getHost()).getEditingDomain(), StringStatics.BLANK, options) {
+ AbstractEMFOperation operation = new AbstractEMFOperation(((IGraphicalEditPart) getHost()).getEditingDomain(), StringStatics.BLANK, options) {
@Override
protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- ((IGraphicalEditPart)getHost()).getDiagramEditDomain().getDiagramCommandStack().execute(cmd);
+ ((IGraphicalEditPart) getHost()).getDiagramEditDomain().getDiagramCommandStack().execute(cmd);
return Status.OK_STATUS;
}
@@ -206,65 +206,65 @@ public class DeleteTimeElementWithoutEventPolicy extends AbstractEditPolicy impl
/**
* Check if time element is correctly defined
- *
+ *
* @return true if it has necessary information, false if it is to be deleted
*/
protected boolean isTimeElementDefined() {
- if(hostSemanticElement instanceof TimeObservation) {
- return ((TimeObservation)hostSemanticElement).getEvent() != null;
- } else if(hostSemanticElement instanceof DurationObservation) {
- return ((DurationObservation)hostSemanticElement).getEvents().size() >= 2;
- } else if(hostSemanticElement instanceof TimeConstraint) {
- return ((TimeConstraint)hostSemanticElement).getConstrainedElements().size() > 0;
+ if (hostSemanticElement instanceof TimeObservation) {
+ return ((TimeObservation) hostSemanticElement).getEvent() != null;
+ } else if (hostSemanticElement instanceof DurationObservation) {
+ return ((DurationObservation) hostSemanticElement).getEvents().size() >= 2;
+ } else if (hostSemanticElement instanceof TimeConstraint) {
+ return ((TimeConstraint) hostSemanticElement).getConstrainedElements().size() > 0;
}
- // else if(hostSemanticElement instanceof DurationConstraint) {
- // /*
- // * Note that DurationConstraint may have only one ConstrainedElement.
- // * But in such a case, we suppose it has not been created as one of the concerned edit parts.
- // */
- // return ((DurationConstraint)hostSemanticElement).getConstrainedElements().size() >= 2;
- // }
+ // else if(hostSemanticElement instanceof DurationConstraint) {
+ // /*
+ // * Note that DurationConstraint may have only one ConstrainedElement.
+ // * But in such a case, we suppose it has not been created as one of the concerned edit parts.
+ // */
+ // return ((DurationConstraint)hostSemanticElement).getConstrainedElements().size() >= 2;
+ // }
return true;
}
/**
* Get the list of other required figures
- *
+ *
* @return list of views
*/
protected List<View> getLinkedViews() {
- if(getHost() instanceof TimeObservationEditPart && hostSemanticElement instanceof TimeObservation) {
+ if (getHost() instanceof TimeObservationEditPart && hostSemanticElement instanceof TimeObservation) {
LifelineEditPart lifeline = SequenceUtil.getParentLifelinePart(getHost());
- NamedElement occ = ((TimeObservation)hostSemanticElement).getEvent();
- if(occ instanceof OccurrenceSpecification) {
- EditPart part = SequenceUtil.getLinkedEditPart(lifeline, (OccurrenceSpecification)occ);
- if(part != null) {
- return Collections.singletonList((View)part.getModel());
+ NamedElement occ = ((TimeObservation) hostSemanticElement).getEvent();
+ if (occ instanceof OccurrenceSpecification) {
+ EditPart part = SequenceUtil.getLinkedEditPart(lifeline, (OccurrenceSpecification) occ);
+ if (part != null) {
+ return Collections.singletonList((View) part.getModel());
}
}
return Collections.emptyList();
- } else if(getHost() instanceof TimeConstraintEditPart && hostSemanticElement instanceof TimeConstraint) {
+ } 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) {
- EditPart part = SequenceUtil.getLinkedEditPart(lifeline, (OccurrenceSpecification)occs.get(0));
- if(part != null) {
- return Collections.singletonList((View)part.getModel());
+ List<Element> occs = ((TimeConstraint) hostSemanticElement).getConstrainedElements();
+ 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());
}
}
return Collections.emptyList();
- } else if(getHost() instanceof DurationConstraintEditPart && hostSemanticElement instanceof TimeConstraint) {
+ } else if (getHost() instanceof DurationConstraintEditPart && hostSemanticElement instanceof TimeConstraint) {
LifelineEditPart lifeline = SequenceUtil.getParentLifelinePart(getHost());
- List<Element> occs = ((TimeConstraint)hostSemanticElement).getConstrainedElements();
- if(occs.size() >= 2 && occs.get(0) instanceof OccurrenceSpecification && occs.get(1) instanceof OccurrenceSpecification) {
- EditPart part1 = SequenceUtil.getLinkedEditPart(lifeline, (OccurrenceSpecification)occs.get(0));
- EditPart part2 = SequenceUtil.getLinkedEditPart(lifeline, (OccurrenceSpecification)occs.get(1));
+ List<Element> occs = ((TimeConstraint) hostSemanticElement).getConstrainedElements();
+ if (occs.size() >= 2 && occs.get(0) instanceof OccurrenceSpecification && occs.get(1) instanceof OccurrenceSpecification) {
+ EditPart part1 = SequenceUtil.getLinkedEditPart(lifeline, (OccurrenceSpecification) occs.get(0));
+ EditPart part2 = SequenceUtil.getLinkedEditPart(lifeline, (OccurrenceSpecification) occs.get(1));
List<View> list = new ArrayList<View>(2);
- if(part1 != null) {
- list.add((View)part1.getModel());
+ if (part1 != null) {
+ list.add((View) part1.getModel());
}
- if(part2 != null) {
- list.add((View)part2.getModel());
+ if (part2 != null) {
+ list.add((View) part2.getModel());
}
return list;
}
@@ -276,48 +276,48 @@ public class DeleteTimeElementWithoutEventPolicy extends AbstractEditPolicy impl
/**
* Check if time element has required other figures
- *
+ *
* @return true if the time element figure miss one of the figure representing its ends.
*/
protected boolean timeElementMissAnEventFigure() {
- if(getHost() instanceof TimeObservationEditPart && hostSemanticElement instanceof TimeObservation) {
+ if (getHost() instanceof TimeObservationEditPart && hostSemanticElement instanceof TimeObservation) {
LifelineEditPart lifeline = SequenceUtil.getParentLifelinePart(getHost());
- NamedElement occ = ((TimeObservation)hostSemanticElement).getEvent();
- if(occ instanceof OccurrenceSpecification) {
- return SequenceUtil.getLinkedEditPart(lifeline, (OccurrenceSpecification)occ) == null;
+ NamedElement occ = ((TimeObservation) hostSemanticElement).getEvent();
+ if (occ instanceof OccurrenceSpecification) {
+ return SequenceUtil.getLinkedEditPart(lifeline, (OccurrenceSpecification) occ) == null;
}
return true;
- } else if(getHost() instanceof TimeConstraintEditPart && hostSemanticElement instanceof TimeConstraint) {
+ } 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) {
- return SequenceUtil.getLinkedEditPart(lifeline, (OccurrenceSpecification)occs.get(0)) == null;
+ List<Element> occs = ((TimeConstraint) hostSemanticElement).getConstrainedElements();
+ if (occs.size() > 0 && occs.get(0) instanceof OccurrenceSpecification) {
+ return SequenceUtil.getLinkedEditPart(lifeline, (OccurrenceSpecification) occs.get(0)) == null;
}
return true;
}
- // else if(getHost() instanceof DurationConstraintEditPart && hostSemanticElement instanceof DurationConstraint) {
- // LifelineEditPart lifeline = SequenceUtil.getParentLifelinePart(getHost());
- // List<Element> occs = ((DurationConstraint)hostSemanticElement).getConstrainedElements();
- // if(occs.size() >= 2 && occs.get(0) instanceof OccurrenceSpecification && occs.get(1) instanceof OccurrenceSpecification) {
- // return SequenceUtil.getLinkedEditPart(lifeline, (OccurrenceSpecification)occs.get(0)) == null || SequenceUtil.getLinkedEditPart(lifeline, (OccurrenceSpecification)occs.get(1)) == null;
- // }
- // return true;
- // }
+ // else if(getHost() instanceof DurationConstraintEditPart && hostSemanticElement instanceof DurationConstraint) {
+ // LifelineEditPart lifeline = SequenceUtil.getParentLifelinePart(getHost());
+ // List<Element> occs = ((DurationConstraint)hostSemanticElement).getConstrainedElements();
+ // if(occs.size() >= 2 && occs.get(0) instanceof OccurrenceSpecification && occs.get(1) instanceof OccurrenceSpecification) {
+ // return SequenceUtil.getLinkedEditPart(lifeline, (OccurrenceSpecification)occs.get(0)) == null || SequenceUtil.getLinkedEditPart(lifeline, (OccurrenceSpecification)occs.get(1)) == null;
+ // }
+ // return true;
+ // }
// a label on a message always has its parent message
return false;
}
/**
* Returns a {@link Command} to delete the host element
- *
+ *
* @param graphOnly
- * true if the view only must be removed
+ * true if the view only must be removed
* @return the command that destroys the host element
*/
protected Command getDeleteElementCommand(boolean graphOnly) {
- if(graphOnly) {
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
- return new ICommandProxy(new DeleteCommand(editingDomain, (View)getHost().getModel()));
+ if (graphOnly) {
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
+ return new ICommandProxy(new DeleteCommand(editingDomain, (View) getHost().getModel()));
} else {
DestroyElementRequest req = new DestroyElementRequest(hostSemanticElement, false);
return getDestroyElementCommand(req);
@@ -326,18 +326,18 @@ public class DeleteTimeElementWithoutEventPolicy extends AbstractEditPolicy impl
/**
* Copied from a generated method from a semantic edit policy which supports the edit element service
- *
+ *
* @param req
- * the DestroyElementRequest
+ * the DestroyElementRequest
* @return the destroy command
*/
protected Command getDestroyElementCommand(DestroyElementRequest req) {
EObject selectedEObject = req.getElementToDestroy();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
+ if (provider != null) {
// Retrieve delete command from the Element Edit service
ICommand deleteCommand = provider.getEditCommand(req);
- if(deleteCommand != null) {
+ if (deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
}
@@ -346,12 +346,12 @@ public class DeleteTimeElementWithoutEventPolicy extends AbstractEditPolicy impl
/**
* Gets the diagram event broker from the editing domain.
- *
+ *
* @return the diagram event broker
*/
protected DiagramEventBroker getDiagramEventBroker() {
- TransactionalEditingDomain theEditingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
- if(theEditingDomain != null) {
+ TransactionalEditingDomain theEditingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
+ if (theEditingDomain != null) {
return DiagramEventBroker.getInstance(theEditingDomain);
}
return null;
@@ -360,15 +360,16 @@ public class DeleteTimeElementWithoutEventPolicy extends AbstractEditPolicy impl
/**
* {@inheritDoc}
*/
+ @Override
public void notifyChanged(Notification notification) {
Object notifier = notification.getNotifier();
- if(notifier.equals(hostSemanticElement)) {
- if(Notification.REMOVE == notification.getEventType() || Notification.SET == notification.getEventType()) {
+ if (notifier.equals(hostSemanticElement)) {
+ if (Notification.REMOVE == notification.getEventType() || Notification.SET == notification.getEventType()) {
deleteTimeElementIfNeeded();
}
- } else if(notifier instanceof View) {
+ } else if (notifier instanceof View) {
// a view has been modified
- if(Notification.REMOVE == notification.getEventType()) {
+ if (Notification.REMOVE == notification.getEventType()) {
deleteTimeElementIfNeeded();
}
}
@@ -376,18 +377,18 @@ public class DeleteTimeElementWithoutEventPolicy extends AbstractEditPolicy impl
/**
* Removes a listener for the specified view, if it exists.
- *
+ *
* @param oldView
- * the old view to check
+ * the old view to check
*/
protected void removeListenerForView(View oldView) {
// create a temp list of elements to delete (iterator concurrent modification..)
Map<EObject, List<View>> parentsToDelete = new HashMap<EObject, List<View>>();
- for(EObject parent : additionalParentToListen.keySet()) {
+ for (EObject parent : additionalParentToListen.keySet()) {
List<View> parentViews = additionalParentToListen.get(parent);
- if(parentViews.contains(oldView)) {
+ if (parentViews.contains(oldView)) {
List<View> views = parentsToDelete.get(parent);
- if(views == null) {
+ if (views == null) {
views = new ArrayList<View>();
}
views.add(oldView);
@@ -403,12 +404,12 @@ public class DeleteTimeElementWithoutEventPolicy extends AbstractEditPolicy impl
// create a temp list of elements to delete (iterator concurrent modification..)
Map<EObject, List<View>> parentsToDelete = new HashMap<EObject, List<View>>();
// collect the elements to delete
- for(View view : impactedViews) {
- for(EObject parent : additionalParentToListen.keySet()) {
+ for (View view : impactedViews) {
+ for (EObject parent : additionalParentToListen.keySet()) {
List<View> parentViews = additionalParentToListen.get(parent);
- if(parentViews.contains(view)) {
+ if (parentViews.contains(view)) {
List<View> views = parentsToDelete.get(parent);
- if(views == null) {
+ if (views == null) {
views = new ArrayList<View>();
}
views.add(view);
@@ -417,9 +418,9 @@ public class DeleteTimeElementWithoutEventPolicy extends AbstractEditPolicy impl
}
}
// do the job
- for(EObject object : parentsToDelete.keySet()) {
+ for (EObject object : parentsToDelete.keySet()) {
List<View> views = parentsToDelete.get(object);
- for(View view : views) {
+ for (View view : views) {
removeAdditionalParentToListen(object, view);
}
}
@@ -429,11 +430,11 @@ public class DeleteTimeElementWithoutEventPolicy extends AbstractEditPolicy impl
* Check if the time element should be deleted and delete it if necessary.
*/
protected void deleteTimeElementIfNeeded() {
- if(!isTimeElementDefined()) {
+ if (!isTimeElementDefined()) {
// delete the time element
deleteTimeElement();
}
- if(timeElementMissAnEventFigure()) {
+ if (timeElementMissAnEventFigure()) {
// delete the view
deleteTimeView();
}
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/DestructionEventComponentEditPolicy.java
index 429dd145b63..906d3451887 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/DestructionEventComponentEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -34,8 +34,8 @@ public class DestructionEventComponentEditPolicy extends ComponentEditPolicy {
CompoundCommand deleteViewsCommand = new CompoundCommand();
Command deleteViewCommand = super.createDeleteViewCommand(deleteRequest);
deleteViewsCommand.add(deleteViewCommand);
- if(getHost() instanceof ShapeNodeEditPart) {
- TransactionalEditingDomain editingDomain = ((ShapeNodeEditPart)getHost()).getEditingDomain();
+ if (getHost() instanceof ShapeNodeEditPart) {
+ TransactionalEditingDomain editingDomain = ((ShapeNodeEditPart) getHost()).getEditingDomain();
SequenceDeleteHelper.completeDeleteDestructionOccurenceViewCommand(deleteViewsCommand, editingDomain, getHost());
}
return deleteViewsCommand;
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 d6f8968a51b..e9458099d70 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -54,56 +54,56 @@ import org.eclipse.uml2.uml.Lifeline;
* Edit Policy to create an element on a lifeline associated with the creation of a message.
* For example it can be used to create a Destruction Event with a Message Delete
* or the target Execution Specification with a Message Sync.
- *
+ *
* @author Mathieu Velten
- *
+ *
*/
public class ElementCreationWithMessageEditPolicy extends LifelineChildGraphicalNodeEditPolicy {
@Override
protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
- // CompoundCommand compound = new CompoundCommand();
+ // CompoundCommand compound = new CompoundCommand();
Command command = super.getConnectionCompleteCommand(request);
- if(command != null && command.canExecute()) {
- // compound.add(command);
- if(request instanceof CreateConnectionViewAndElementRequest) {
- CreateConnectionViewAndElementRequest viewRequest = (CreateConnectionViewAndElementRequest)request;
+ if (command != null && command.canExecute()) {
+ // compound.add(command);
+ if (request instanceof CreateConnectionViewAndElementRequest) {
+ CreateConnectionViewAndElementRequest viewRequest = (CreateConnectionViewAndElementRequest) request;
EditPart targetEP = getTargetEditPart(viewRequest);
- EObject target = ViewUtil.resolveSemanticElement((View)targetEP.getModel());
+ EObject target = ViewUtil.resolveSemanticElement((View) targetEP.getModel());
EditPart sourceEP = viewRequest.getSourceEditPart();
- EObject source = ViewUtil.resolveSemanticElement((View)sourceEP.getModel());
- if(getSyncMessageHint().equals(viewRequest.getConnectionViewDescriptor().getSemanticHint()) || getReplyMessageHint().equals(viewRequest.getConnectionViewDescriptor().getSemanticHint())) {
- if(target instanceof Lifeline ||
- // handle reflexive synch message by creating a new ES
- (target instanceof ExecutionSpecification && target.equals(source))) {
+ EObject source = ViewUtil.resolveSemanticElement((View) sourceEP.getModel());
+ if (getSyncMessageHint().equals(viewRequest.getConnectionViewDescriptor().getSemanticHint()) || getReplyMessageHint().equals(viewRequest.getConnectionViewDescriptor().getSemanticHint())) {
+ if (target instanceof Lifeline ||
+ // handle reflexive synch message by creating a new ES
+ (target instanceof ExecutionSpecification && target.equals(source))) {
InteractionFragment ift = SequenceUtil.findInteractionFragmentContainerAt(viewRequest.getLocation(), getHost());
// retrieve the good execution specification type using the source of the message
- if(target instanceof ExecutionSpecification) {
+ if (target instanceof ExecutionSpecification) {
// retrieve its associated lifeline
targetEP = targetEP.getParent();
- target = ViewUtil.resolveSemanticElement((View)targetEP.getModel());
+ target = ViewUtil.resolveSemanticElement((View) targetEP.getModel());
}
EditPart sourceEditPart = request.getSourceEditPart();
- if(sourceEditPart instanceof ActionExecutionSpecificationEditPart || sourceEditPart instanceof BehaviorExecutionSpecificationEditPart) {
- return new ICommandProxy(new PromptCreateElementAndNodeCommand(command, getEditingDomain(), viewRequest.getConnectionViewDescriptor(), (ShapeNodeEditPart)targetEP, target, sourceEP, request, ift));
+ if (sourceEditPart instanceof ActionExecutionSpecificationEditPart || 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_3006;
- // } else if(request.getSourceEditPart() instanceof BehaviorExecutionSpecificationEditPart) {
- // elementType = (IHintedType)UMLElementTypes.BehaviorExecutionSpecification_3003;
- // }
+ // IHintedType elementType = null;
+ // if(sourceEditPart instanceof ActionExecutionSpecificationEditPart) {
+ // elementType = (IHintedType)UMLElementTypes.ActionExecutionSpecification_3006;
+ // } else if(request.getSourceEditPart() instanceof BehaviorExecutionSpecificationEditPart) {
+ // elementType = (IHintedType)UMLElementTypes.BehaviorExecutionSpecification_3003;
+ // }
//
//
- // if(elementType != null) {
- // CreateElementAndNodeCommand createExecutionSpecificationCommand = new CreateElementAndNodeCommand(getEditingDomain(), (ShapeNodeEditPart)targetEP, target, elementType, request.getLocation());
- // createExecutionSpecificationCommand.putCreateElementRequestParameter(SequenceRequestConstant.INTERACTIONFRAGMENT_CONTAINER, ift);
- // compound.add(createExecutionSpecificationCommand);
+ // 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));
- // }
+ // // 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));
+ // }
}
}
}
@@ -112,44 +112,45 @@ public class ElementCreationWithMessageEditPolicy extends LifelineChildGraphical
}
private static String getSyncMessageHint() {
- IHintedType message = (IHintedType)UMLElementTypes.Message_4003;
+ IHintedType message = (IHintedType) UMLElementTypes.Message_4003;
return message.getSemanticHint();
}
private static String getReplyMessageHint() {
- IHintedType message = (IHintedType)UMLElementTypes.Message_4005;
+ IHintedType message = (IHintedType) UMLElementTypes.Message_4005;
return message.getSemanticHint();
}
private TransactionalEditingDomain getEditingDomain() {
- return ((IGraphicalEditPart)getHost()).getEditingDomain();
+ return ((IGraphicalEditPart) getHost()).getEditingDomain();
}
- //Fixed bugs about creating connections on a PartDecomposition.
+ // Fixed bugs about creating connections on a PartDecomposition.
+ @Override
public EditPart getTargetEditPart(Request request) {
EditPart host = getHost();
- if(host instanceof CustomLifelineEditPart) {
- CustomLifelineEditPart lifeline = (CustomLifelineEditPart)host;
+ if (host instanceof CustomLifelineEditPart) {
+ CustomLifelineEditPart lifeline = (CustomLifelineEditPart) host;
boolean inlineMode = lifeline.isInlineMode();
- if(inlineMode) {
+ if (inlineMode) {
Object type = request.getType();
- if(REQ_CONNECTION_END.equals(type)) {
- Point location = ((CreateConnectionRequest)request).getLocation().getCopy();
- if(isCreateConnectionRequest(request, UMLElementTypes.Message_4006) && isLocatedOnLifelineHeader(lifeline, location)) {
+ if (REQ_CONNECTION_END.equals(type)) {
+ Point location = ((CreateConnectionRequest) request).getLocation().getCopy();
+ if (isCreateConnectionRequest(request, UMLElementTypes.Message_4006) && isLocatedOnLifelineHeader(lifeline, location)) {
return host;
}
return getTargetEditPart(request, lifeline, location);
- } else if(REQ_CONNECTION_START.equals(type)) {
- Point location = ((CreateConnectionRequest)request).getLocation().getCopy();
+ } else if (REQ_CONNECTION_START.equals(type)) {
+ Point location = ((CreateConnectionRequest) request).getLocation().getCopy();
return getTargetEditPart(request, lifeline, location);
- } else if(REQ_RECONNECT_SOURCE.equals(type)) {
- Point location = ((ReconnectRequest)request).getLocation().getCopy();
+ } else if (REQ_RECONNECT_SOURCE.equals(type)) {
+ Point location = ((ReconnectRequest) request).getLocation().getCopy();
return getTargetEditPart(request, lifeline, location);
- } else if(REQ_RECONNECT_TARGET.equals(type)) {
- Point location = ((ReconnectRequest)request).getLocation().getCopy();
- ConnectionEditPart conn = ((ReconnectRequest)request).getConnectionEditPart();
- View model = (View)conn.getModel();
- if(4006 == UMLVisualIDRegistry.getVisualID(model) && isLocatedOnLifelineHeader(lifeline, location)) {
+ } else if (REQ_RECONNECT_TARGET.equals(type)) {
+ Point location = ((ReconnectRequest) request).getLocation().getCopy();
+ ConnectionEditPart conn = ((ReconnectRequest) request).getConnectionEditPart();
+ View model = (View) conn.getModel();
+ if (4006 == UMLVisualIDRegistry.getVisualID(model) && isLocatedOnLifelineHeader(lifeline, location)) {
return host;
}
return getTargetEditPart(request, lifeline, location);
@@ -161,13 +162,13 @@ public class ElementCreationWithMessageEditPolicy extends LifelineChildGraphical
private EditPart getTargetEditPart(Request request, CustomLifelineEditPart lifeline, Point location) {
EditPart childEditPart = getChildEditPart(lifeline, location);
- if(childEditPart instanceof CustomLifelineEditPart) {
- CustomLifelineEditPart childLifeline = (CustomLifelineEditPart)childEditPart;
- if(isCreateConnectionRequest(request, UMLElementTypes.Message_4006) && isLocatedOnLifelineHeader(childLifeline, location)) {
+ if (childEditPart instanceof CustomLifelineEditPart) {
+ CustomLifelineEditPart childLifeline = (CustomLifelineEditPart) childEditPart;
+ if (isCreateConnectionRequest(request, UMLElementTypes.Message_4006) && isLocatedOnLifelineHeader(childLifeline, location)) {
return childEditPart;
- } else if(request instanceof ReconnectRequest && (4006 == UMLVisualIDRegistry.getVisualID((View)((ReconnectRequest)request).getConnectionEditPart().getModel()) && isLocatedOnLifelineHeader(childLifeline, location))) {
+ } else if (request instanceof ReconnectRequest && (4006 == UMLVisualIDRegistry.getVisualID((View) ((ReconnectRequest) request).getConnectionEditPart().getModel()) && isLocatedOnLifelineHeader(childLifeline, location))) {
return childEditPart;
- } else if(isLocatedOnLifelineDotLine(childLifeline, location)) {
+ } else if (isLocatedOnLifelineDotLine(childLifeline, location)) {
return childEditPart;
} else {
return null;
@@ -178,15 +179,15 @@ public class ElementCreationWithMessageEditPolicy extends LifelineChildGraphical
private EditPart getChildEditPart(CustomLifelineEditPart lifeline, Point location) {
List children = lifeline.getChildren();
- for(Object object : children) {
- if(!(object instanceof GraphicalEditPart)) {
+ for (Object object : children) {
+ if (!(object instanceof GraphicalEditPart)) {
continue;
}
- GraphicalEditPart child = (GraphicalEditPart)object;
+ GraphicalEditPart child = (GraphicalEditPart) object;
IFigure figure = child.getFigure();
Point pt = location.getCopy();
figure.translateToRelative(pt);
- if(figure.containsPoint(pt)) {
+ if (figure.containsPoint(pt)) {
return child;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ExecutionGraphicalNodeEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ExecutionGraphicalNodeEditPolicy.java
index 30ae9bad1d8..9c07e76bcbd 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ExecutionGraphicalNodeEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ExecutionGraphicalNodeEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -40,7 +40,7 @@ import org.eclipse.uml2.uml.UMLFactory;
/**
* This class fixed the bug when reconnecting message from the end of an execution to the execution, at this moment, the model of the source and
* target are not changed, but the UML2 model must be changed from message end to execution occurrence specification.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class ExecutionGraphicalNodeEditPolicy extends ElementCreationWithMessageEditPolicy {
@@ -48,7 +48,7 @@ public class ExecutionGraphicalNodeEditPolicy extends ElementCreationWithMessage
@Override
protected Command getReconnectSourceCommand(ReconnectRequest request) {
Command command = super.getReconnectSourceCommand(request);
- if(command != null && command.canExecute() && !relationshipSourceHasChanged(request)) {
+ if (command != null && command.canExecute() && !relationshipSourceHasChanged(request)) {
command = appendUpdateExecutionEndCommand(request, command, false);
}
return command;
@@ -57,7 +57,7 @@ public class ExecutionGraphicalNodeEditPolicy extends ElementCreationWithMessage
@Override
protected Command getReconnectTargetCommand(ReconnectRequest request) {
Command command = super.getReconnectTargetCommand(request);
- if(command != null && command.canExecute() && !relationshipTargetHasChanged(request)) {
+ if (command != null && command.canExecute() && !relationshipTargetHasChanged(request)) {
command = appendUpdateExecutionEndCommand(request, command, true);
}
return command;
@@ -71,31 +71,31 @@ public class ExecutionGraphicalNodeEditPolicy extends ElementCreationWithMessage
private Command appendUpdateExecutionEndCommand(ReconnectRequest request, Command command, boolean messageTarget) {
EditPart target = request.getTarget();
ExecutionSpecification execution = null;
- if(target instanceof AbstractExecutionSpecificationEditPart) {
- EObject elt = ((AbstractExecutionSpecificationEditPart)target).resolveSemanticElement();
- if(elt instanceof ExecutionSpecification) {
- execution = (ExecutionSpecification)elt;
+ if (target instanceof AbstractExecutionSpecificationEditPart) {
+ EObject elt = ((AbstractExecutionSpecificationEditPart) target).resolveSemanticElement();
+ if (elt instanceof ExecutionSpecification) {
+ execution = (ExecutionSpecification) elt;
}
}
MessageEnd messageEnd = null;
ConnectionEditPart conn = request.getConnectionEditPart();
- if(conn instanceof AbstractMessageEditPart) {
- EObject elt = ((AbstractMessageEditPart)conn).resolveSemanticElement();
- if(elt instanceof Message) {
- messageEnd = messageTarget ? ((Message)elt).getReceiveEvent() : ((Message)elt).getSendEvent();
+ if (conn instanceof AbstractMessageEditPart) {
+ EObject elt = ((AbstractMessageEditPart) conn).resolveSemanticElement();
+ if (elt instanceof Message) {
+ messageEnd = messageTarget ? ((Message) elt).getReceiveEvent() : ((Message) elt).getSendEvent();
}
}
- if(execution != null && messageEnd != null) {
+ if (execution != null && messageEnd != null) {
OccurrenceSpecification start = execution.getStart();
OccurrenceSpecification finish = execution.getFinish();
- if(start != null && start == messageEnd) {
- command = command.chain(new ICommandProxy(new ResetExecutionEndCommand(((IGraphicalEditPart)target).getEditingDomain(), execution, true)));
- } else if(finish != null && finish == messageEnd) {
- command = command.chain(new ICommandProxy(new ResetExecutionEndCommand(((IGraphicalEditPart)target).getEditingDomain(), execution, false)));
+ if (start != null && start == messageEnd) {
+ command = command.chain(new ICommandProxy(new ResetExecutionEndCommand(((IGraphicalEditPart) target).getEditingDomain(), execution, true)));
+ } else if (finish != null && finish == messageEnd) {
+ command = command.chain(new ICommandProxy(new ResetExecutionEndCommand(((IGraphicalEditPart) target).getEditingDomain(), execution, false)));
}
}
- //ordering fragments.
- //fixed bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=417374
+ // ordering fragments.
+ // fixed bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=417374
Command orderingFragmentsCommand = FragmentsOrdererHelper.createOrderingFragmentsCommand(getHost(), request);
return command.chain(orderingFragmentsCommand);
}
@@ -116,7 +116,7 @@ public class ExecutionGraphicalNodeEditPolicy extends ElementCreationWithMessage
/**
* Constructor.
- *
+ *
* @param domain
* @param label
* @param affectedFiles
@@ -128,9 +128,8 @@ public class ExecutionGraphicalNodeEditPolicy extends ElementCreationWithMessage
}
/**
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.core.runtime.IAdaptable)
- *
+ * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+ *
* @param monitor
* @param info
* @return
@@ -139,8 +138,8 @@ public class ExecutionGraphicalNodeEditPolicy extends ElementCreationWithMessage
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(execution != null) {
- if(resetStart) {
+ if (execution != null) {
+ if (resetStart) {
OccurrenceSpecificationHelper.resetExecutionStart(execution, UMLFactory.eINSTANCE.createExecutionOccurrenceSpecification());
} else {
OccurrenceSpecificationHelper.resetExecutionFinish(execution, UMLFactory.eINSTANCE.createExecutionOccurrenceSpecification());
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 66372c15771..9cfb33c7524 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -43,27 +43,27 @@ public class ExecutionSpecificationComponentEditPolicy extends ComponentEditPoli
CompoundCommand deleteViewsCommand = new CompoundCommand();
Command deleteViewCommand = super.createDeleteViewCommand(deleteRequest);
deleteViewsCommand.add(deleteViewCommand);
- if(getHost() instanceof ShapeNodeEditPart) {
- TransactionalEditingDomain editingDomain = ((ShapeNodeEditPart)getHost()).getEditingDomain();
+ if (getHost() instanceof ShapeNodeEditPart) {
+ TransactionalEditingDomain editingDomain = ((ShapeNodeEditPart) getHost()).getEditingDomain();
SequenceDeleteHelper.completeDeleteExecutionSpecificationViewCommand(deleteViewsCommand, editingDomain, getHost());
- addDeleteViewChildrenCommand(deleteViewsCommand, editingDomain, (ShapeNodeEditPart)getHost());
+ addDeleteViewChildrenCommand(deleteViewsCommand, editingDomain, (ShapeNodeEditPart) getHost());
}
return deleteViewsCommand;
}
- // support nested actions and behaviors execution, https://bugs.eclipse.org/bugs/show_bug.cgi?id=384616
+ // 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);
- for(ShapeNodeEditPart p : list) {
- deleteViewsCommand.add(new ICommandProxy(new DeleteCommand(editingDomain, (View)p.getModel())));
+ for (ShapeNodeEditPart p : list) {
+ deleteViewsCommand.add(new ICommandProxy(new DeleteCommand(editingDomain, (View) p.getModel())));
SequenceDeleteHelper.completeDeleteExecutionSpecificationViewCommand(deleteViewsCommand, editingDomain, p);
- addDeleteViewChildrenCommand(deleteViewsCommand, editingDomain, p); //recursive delete children
+ addDeleteViewChildrenCommand(deleteViewsCommand, editingDomain, p); // recursive delete children
}
}
public static void addDestroyElementChildrenCommand(CompoundCommand deleteElementsCommand, TransactionalEditingDomain editingDomain, EditPart part) {
- List<ShapeNodeEditPart> list = LifelineXYLayoutEditPolicy.getAffixedExecutionSpecificationEditParts((ShapeNodeEditPart)part);
- for(ShapeNodeEditPart p : list) {
+ List<ShapeNodeEditPart> list = LifelineXYLayoutEditPolicy.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 4ef25784693..2416afbd8ef 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -67,7 +67,7 @@ import org.eclipse.uml2.uml.OccurrenceSpecification;
/**
* Add support to connect directly on ExecutionOccurrenceSpecification.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
@SuppressWarnings("restriction")
@@ -76,32 +76,33 @@ public class ExecutionSpecificationEndGraphicalNodeEditPolicy extends GraphicalN
@Override
protected Command getReconnectTargetCommand(ReconnectRequest request) {
INodeEditPart node = getConnectableEditPart();
- if(node == null)
+ if (node == null) {
return null;
+ }
TransactionalEditingDomain editingDomain = getEditingDomain();
ConnectionAnchor targetAnchor = getTargetConnectionAnchor(request.getTarget(), request);
INodeEditPart targetEP = getConnectionCompleteEditPart(request);
- if(targetEP == null) {
+ if (targetEP == null) {
return null;
}
SetConnectionEndsCommand sceCommand = new SetConnectionEndsCommand(editingDomain, StringStatics.BLANK);
- sceCommand.setEdgeAdaptor(new EObjectAdapter((EObject)request.getConnectionEditPart().getModel()));
+ sceCommand.setEdgeAdaptor(new EObjectAdapter((EObject) request.getConnectionEditPart().getModel()));
sceCommand.setNewTargetAdaptor(targetEP);
SetConnectionAnchorsCommand scaCommand = new SetConnectionAnchorsCommand(editingDomain, StringStatics.BLANK);
- scaCommand.setEdgeAdaptor(new EObjectAdapter((EObject)request.getConnectionEditPart().getModel()));
+ scaCommand.setEdgeAdaptor(new EObjectAdapter((EObject) request.getConnectionEditPart().getModel()));
scaCommand.setNewTargetTerminal(targetEP.mapConnectionAnchorToTerminal(targetAnchor));
CompositeCommand cc = new CompositeCommand(DiagramUIMessages.Commands_SetConnectionEndsCommand_Target);
cc.compose(sceCommand);
cc.compose(scaCommand);
Command cmd = new ICommandProxy(cc);
EditPart cep = request.getConnectionEditPart();
- RoutingStyle style = (RoutingStyle)((View)cep.getModel()).getStyle(NotationPackage.eINSTANCE.getRoutingStyle());
+ RoutingStyle style = (RoutingStyle) ((View) cep.getModel()).getStyle(NotationPackage.eINSTANCE.getRoutingStyle());
Routing currentRouter = Routing.MANUAL_LITERAL;
- if(style != null) {
+ if (style != null) {
currentRouter = style.getRouting();
}
Command cmdRouter = getRoutingAdjustment(request.getConnectionEditPart(), getSemanticHint(request), currentRouter, request.getTarget());
- if(cmdRouter != null) {
+ if (cmdRouter != null) {
cmd = cmd == null ? cmdRouter : cmd.chain(cmdRouter);
// reset the bendpoints
ConnectionAnchor sourceAnchor = node.getSourceConnectionAnchor(request);
@@ -112,143 +113,150 @@ public class ExecutionSpecificationEndGraphicalNodeEditPolicy extends GraphicalN
sbbCommand.setEdgeAdapter(request.getConnectionEditPart());
sbbCommand.setNewPointList(pointList, sourceAnchor.getReferencePoint(), targetAnchor.getReferencePoint());
Command cmdBP = new ICommandProxy(sbbCommand);
- if(cmdBP != null) {
+ if (cmdBP != null) {
cmd = cmd == null ? cmdBP : cmd.chain(cmdBP);
}
}
- if(cmd.canExecute()) {
+ if (cmd.canExecute()) {
return cmd.chain(FragmentsOrdererHelper.createOrderingFragmentsCommand(getHost(), request));
}
return cmd;
}
+ @Override
protected Command getReconnectSourceCommand(ReconnectRequest request) {
INodeEditPart node = getConnectableEditPart();
- if(node == null)
+ if (node == null) {
return null;
+ }
TransactionalEditingDomain editingDomain = getEditingDomain();
ConnectionAnchor sourceAnchor = getSourceConnectionAnchor(getHost(), request);
SetConnectionEndsCommand sceCommand = new SetConnectionEndsCommand(editingDomain, StringStatics.BLANK);
- sceCommand.setEdgeAdaptor(new EObjectAdapter((View)request.getConnectionEditPart().getModel()));
- sceCommand.setNewSourceAdaptor(new EObjectAdapter((View)node.getModel()));
+ sceCommand.setEdgeAdaptor(new EObjectAdapter((View) request.getConnectionEditPart().getModel()));
+ sceCommand.setNewSourceAdaptor(new EObjectAdapter((View) node.getModel()));
SetConnectionAnchorsCommand scaCommand = new SetConnectionAnchorsCommand(editingDomain, StringStatics.BLANK);
- scaCommand.setEdgeAdaptor(new EObjectAdapter((View)request.getConnectionEditPart().getModel()));
+ scaCommand.setEdgeAdaptor(new EObjectAdapter((View) request.getConnectionEditPart().getModel()));
scaCommand.setNewSourceTerminal(node.mapConnectionAnchorToTerminal(sourceAnchor));
CompositeCommand cc = new CompositeCommand(DiagramUIMessages.Commands_SetConnectionEndsCommand_Source);
cc.compose(sceCommand);
cc.compose(scaCommand);
ICommandProxy result = new ICommandProxy(cc);
- if(result.canExecute()) {
+ if (result.canExecute()) {
return result.chain(FragmentsOrdererHelper.createOrderingFragmentsCommand(node, request));
}
return result;
}
+ @Override
@SuppressWarnings({ "unchecked", "rawtypes" })
protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
request.getExtendedData().put(SequenceRequestConstant.TARGET_MODEL_CONTAINER, SequenceUtil.findInteractionFragmentContainerAt(getHostFigure().getBounds(), getHost()));
- ICommandProxy proxy = (ICommandProxy)request.getStartCommand();
- if(proxy == null) {
+ ICommandProxy proxy = (ICommandProxy) request.getStartCommand();
+ if (proxy == null) {
return null;
}
// reset the target edit-part for the request
INodeEditPart targetEP = getConnectionCompleteEditPart(request);
- if(targetEP == null) {
+ if (targetEP == null) {
return null;
}
- //Fixed bug about creating MessageSync on same Execution.
+ // Fixed bug about creating MessageSync on same Execution.
INodeEditPart sourceEditPart = getSourceEditPart(request.getSourceEditPart());
- if(request instanceof CreateConnectionViewRequest) {
- if(((IHintedType)UMLElementTypes.Message_4003).getSemanticHint().equals(((CreateConnectionViewRequest)request).getConnectionViewDescriptor().getSemanticHint())) {
- if(targetEP == sourceEditPart) {
+ if (request instanceof CreateConnectionViewRequest) {
+ if (((IHintedType) UMLElementTypes.Message_4003).getSemanticHint().equals(((CreateConnectionViewRequest) request).getConnectionViewDescriptor().getSemanticHint())) {
+ if (targetEP == sourceEditPart) {
return UnexecutableCommand.INSTANCE;
- } else if(targetEP instanceof AbstractExecutionSpecificationEditPart && getHost() instanceof ExecutionSpecificationEndEditPart) {
- EObject parentElement = ((AbstractExecutionSpecificationEditPart)targetEP).resolveSemanticElement();
- EObject element = ((ExecutionSpecificationEndEditPart)getHost()).resolveSemanticElement();
- if(parentElement instanceof ExecutionSpecification && element instanceof OccurrenceSpecification && element == ((ExecutionSpecification)parentElement).getFinish()) {
+ } else if (targetEP instanceof AbstractExecutionSpecificationEditPart && getHost() instanceof ExecutionSpecificationEndEditPart) {
+ EObject parentElement = ((AbstractExecutionSpecificationEditPart) targetEP).resolveSemanticElement();
+ EObject element = ((ExecutionSpecificationEndEditPart) getHost()).resolveSemanticElement();
+ if (parentElement instanceof ExecutionSpecification && element instanceof OccurrenceSpecification && element == ((ExecutionSpecification) parentElement).getFinish()) {
return UnexecutableCommand.INSTANCE;
}
}
}
}
- CompositeCommand cc = (CompositeCommand)proxy.getICommand();
+ CompositeCommand cc = (CompositeCommand) proxy.getICommand();
ConnectionAnchor targetAnchor = getTargetConnectionAnchor(getHost(), request);
Iterator commandItr = cc.iterator();
- commandItr.next(); //0
- SetConnectionEndsCommand sceCommand = (SetConnectionEndsCommand)commandItr.next(); //1
- sceCommand.setNewTargetAdaptor(new EObjectAdapter(((IGraphicalEditPart)targetEP).getNotationView()));
- SetConnectionAnchorsCommand scaCommand = (SetConnectionAnchorsCommand)commandItr.next(); //2
+ commandItr.next(); // 0
+ SetConnectionEndsCommand sceCommand = (SetConnectionEndsCommand) commandItr.next(); // 1
+ sceCommand.setNewTargetAdaptor(new EObjectAdapter(((IGraphicalEditPart) targetEP).getNotationView()));
+ SetConnectionAnchorsCommand scaCommand = (SetConnectionAnchorsCommand) commandItr.next(); // 2
scaCommand.setNewTargetTerminal(targetEP.mapConnectionAnchorToTerminal(targetAnchor));
setViewAdapter(sceCommand.getEdgeAdaptor());
ConnectionAnchor sourceAnchor = sourceEditPart.mapTerminalToConnectionAnchor(scaCommand.getNewSourceTerminal());
PointList pointList = new PointList();
- if(request.getLocation() == null) {
+ if (request.getLocation() == null) {
pointList.addPoint(sourceAnchor.getLocation(targetAnchor.getReferencePoint()));
pointList.addPoint(targetAnchor.getLocation(sourceAnchor.getReferencePoint()));
} else {
pointList.addPoint(sourceAnchor.getLocation(request.getLocation()));
pointList.addPoint(targetAnchor.getLocation(request.getLocation()));
}
- SetConnectionBendpointsCommand sbbCommand = (SetConnectionBendpointsCommand)commandItr.next(); //3
+ SetConnectionBendpointsCommand sbbCommand = (SetConnectionBendpointsCommand) commandItr.next(); // 3
sbbCommand.setNewPointList(pointList, sourceAnchor.getReferencePoint(), targetAnchor.getReferencePoint());
return request.getStartCommand();
}
private INodeEditPart getSourceEditPart(EditPart sourceEditPart) {
- if(sourceEditPart instanceof ExecutionSpecificationEndEditPart) {
- return (INodeEditPart)((ExecutionSpecificationEndEditPart)sourceEditPart).getParent();
+ if (sourceEditPart instanceof ExecutionSpecificationEndEditPart) {
+ return (INodeEditPart) ((ExecutionSpecificationEndEditPart) sourceEditPart).getParent();
}
- return (INodeEditPart)sourceEditPart;
+ return (INodeEditPart) sourceEditPart;
}
+ @Override
@SuppressWarnings("unchecked")
protected Command getConnectionAndRelationshipCompleteCommand(CreateConnectionViewAndElementRequest request) {
request.getExtendedData().put(SequenceRequestConstant.TARGET_MODEL_CONTAINER, SequenceUtil.findInteractionFragmentContainerAt(getHostFigure().getBounds(), getHost()));
// get the element descriptor
CreateElementRequestAdapter requestAdapter = request.getConnectionViewAndElementDescriptor().getCreateElementRequestAdapter();
// get the semantic request
- CreateRelationshipRequest createElementRequest = (CreateRelationshipRequest)requestAdapter.getAdapter(CreateRelationshipRequest.class);
+ CreateRelationshipRequest createElementRequest = (CreateRelationshipRequest) requestAdapter.getAdapter(CreateRelationshipRequest.class);
createElementRequest.setPrompt(!request.isUISupressed());
// complete the semantic request by filling in the source and
// destination
- INodeEditPart targetEP = (INodeEditPart)getHost();
- View sourceView = (View)request.getSourceEditPart().getModel();
- View targetView = (View)targetEP.getModel();
+ INodeEditPart targetEP = (INodeEditPart) getHost();
+ View sourceView = (View) request.getSourceEditPart().getModel();
+ View targetView = (View) targetEP.getModel();
// resolve the source
EObject source = ViewUtil.resolveSemanticElement(sourceView);
- if(source == null) {
+ if (source == null) {
source = sourceView;
}
createElementRequest.setSource(source);
// resolve the target
EObject target = ViewUtil.resolveSemanticElement(targetView);
- if(target == null) {
+ if (target == null) {
target = targetView;
}
createElementRequest.setTarget(target);
// get the create element request based on the elementdescriptor's
// request
- Command createElementCommand = targetEP.getCommand(new EditCommandRequestWrapper((CreateRelationshipRequest)requestAdapter.getAdapter(CreateRelationshipRequest.class), request.getExtendedData()));
+ Command createElementCommand = targetEP.getCommand(new EditCommandRequestWrapper((CreateRelationshipRequest) requestAdapter.getAdapter(CreateRelationshipRequest.class), request.getExtendedData()));
// create the create semantic element wrapper command
- if(null == createElementCommand)
+ if (null == createElementCommand) {
return null;
+ }
SemanticCreateCommand semanticCommand = new SemanticCreateCommand(requestAdapter, createElementCommand);
// get the view command
Command viewCommand = getConnectionCompleteCommand(request);
- if(null == viewCommand)
+ if (null == viewCommand) {
return null;
+ }
// form the compound command and return
CompositeCommand cc = new CompositeCommand(semanticCommand.getLabel());
cc.compose(semanticCommand);
cc.compose(new CommandProxy(viewCommand));
ICommandProxy result = new ICommandProxy(cc);
- if(result.canExecute()) {
+ if (result.canExecute()) {
Command orderFragments = FragmentsOrdererHelper.createOrderingFragmentsCommand(getHost().getParent(), request);
return result.chain(orderFragments);
}
return result;
}
+ @Override
@SuppressWarnings("unchecked")
protected Command getConnectionAndRelationshipCreateCommand(CreateConnectionViewAndElementRequest request) {
request.getExtendedData().put(SequenceRequestConstant.SOURCE_MODEL_CONTAINER, SequenceUtil.findInteractionFragmentContainerAt(getHostFigure().getBounds(), getHost()));
@@ -256,22 +264,23 @@ public class ExecutionSpecificationEndGraphicalNodeEditPolicy extends GraphicalN
}
private TransactionalEditingDomain getEditingDomain() {
- return ((IGraphicalEditPart)getHost()).getEditingDomain();
+ return ((IGraphicalEditPart) getHost()).getEditingDomain();
}
+ @Override
@SuppressWarnings("unchecked")
protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
- if(!(request instanceof CreateConnectionViewRequest)) {
+ if (!(request instanceof CreateConnectionViewRequest)) {
return null;
}
request.getExtendedData().put(SequenceRequestConstant.SOURCE_MODEL_CONTAINER, SequenceUtil.findInteractionFragmentContainerAt(getHostFigure().getBounds(), getHost()));
request.getExtendedData().put(SequenceRequestConstant.SOURCE_LOCATION_DATA, request.getLocation());
- CreateConnectionViewRequest req = (CreateConnectionViewRequest)request;
+ CreateConnectionViewRequest req = (CreateConnectionViewRequest) request;
CompositeCommand cc = new CompositeCommand(DiagramUIMessages.Commands_CreateCommand_Connection_Label);
- Diagram diagramView = ((View)getHost().getModel()).getDiagram();
+ Diagram diagramView = ((View) getHost().getModel()).getDiagram();
TransactionalEditingDomain editingDomain = getEditingDomain();
CreateCommand createCommand = new CreateCommand(editingDomain, req.getConnectionViewDescriptor(), diagramView.getDiagram());
- setViewAdapter((IAdaptable)createCommand.getCommandResult().getReturnValue());
+ setViewAdapter((IAdaptable) createCommand.getCommandResult().getReturnValue());
SetConnectionEndsCommand sceCommand = new SetConnectionEndsCommand(editingDomain, StringStatics.BLANK);
sceCommand.setEdgeAdaptor(getViewAdapter());
sceCommand.setNewSourceAdaptor(new EObjectAdapter(getView()));
@@ -292,83 +301,87 @@ public class ExecutionSpecificationEndGraphicalNodeEditPolicy extends GraphicalN
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.GraphicalNodeEditPolicy#getView()
- *
+ *
* @return
*/
@Override
protected View getView() {
- return (View)getHost().getParent().getModel();
+ return (View) getHost().getParent().getModel();
}
+ @Override
protected INodeEditPart getConnectableEditPart() {
- return (INodeEditPart)getHost().getParent();
+ return (INodeEditPart) getHost().getParent();
}
+ @Override
protected INodeEditPart getConnectionCompleteEditPart(Request request) {
- return (INodeEditPart)getHost().getParent();
+ return (INodeEditPart) getHost().getParent();
}
+ @Override
protected Connection createDummyConnection(Request req) {
Connection conn = super.createDummyConnection(req);
conn.setForegroundColor(ColorConstants.black);
return conn;
}
- // protected ConnectionAnchor getSourceConnectionAnchor(CreateConnectionRequest request) {
- // return getSourceConnectionAnchor(request.getSourceEditPart(), request);
- // }
+ // protected ConnectionAnchor getSourceConnectionAnchor(CreateConnectionRequest request) {
+ // return getSourceConnectionAnchor(request.getSourceEditPart(), request);
+ // }
@SuppressWarnings("unchecked")
private ConnectionAnchor getSourceConnectionAnchor(EditPart sourceEditPart, Request request) {
- if(sourceEditPart instanceof ExecutionSpecificationEndEditPart) {
+ if (sourceEditPart instanceof ExecutionSpecificationEndEditPart) {
request.getExtendedData().remove(AbstractExecutionSpecificationEditPart.EXECUTION_FIX_ANCHOR_POSITION);
- EObject element = ((ExecutionSpecificationEndEditPart)sourceEditPart).resolveSemanticElement();
- INodeEditPart parent = (INodeEditPart)sourceEditPart.getParent();
- if(parent instanceof IGraphicalEditPart) {
- EObject parentElement = ((IGraphicalEditPart)parent).resolveSemanticElement();
- if(parentElement instanceof ExecutionSpecification) {
- if(element == ((ExecutionSpecification)parentElement).getStart()) {
+ EObject element = ((ExecutionSpecificationEndEditPart) sourceEditPart).resolveSemanticElement();
+ INodeEditPart parent = (INodeEditPart) sourceEditPart.getParent();
+ if (parent instanceof IGraphicalEditPart) {
+ EObject parentElement = ((IGraphicalEditPart) parent).resolveSemanticElement();
+ if (parentElement instanceof ExecutionSpecification) {
+ if (element == ((ExecutionSpecification) parentElement).getStart()) {
request.getExtendedData().put(AbstractExecutionSpecificationEditPart.EXECUTION_FIX_ANCHOR_POSITION, PositionConstants.TOP);
- } else if(element == ((ExecutionSpecification)parentElement).getFinish()) {
+ } else if (element == ((ExecutionSpecification) parentElement).getFinish()) {
request.getExtendedData().put(AbstractExecutionSpecificationEditPart.EXECUTION_FIX_ANCHOR_POSITION, PositionConstants.BOTTOM);
}
}
}
ConnectionAnchor sourceConnectionAnchor = parent.getSourceConnectionAnchor(request);
- //Be sure to remove this key after used.
+ // Be sure to remove this key after used.
request.getExtendedData().remove(AbstractExecutionSpecificationEditPart.EXECUTION_FIX_ANCHOR_POSITION);
return sourceConnectionAnchor;
}
- return sourceEditPart instanceof INodeEditPart ? ((INodeEditPart)sourceEditPart).getSourceConnectionAnchor(request) : null;
+ return sourceEditPart instanceof INodeEditPart ? ((INodeEditPart) sourceEditPart).getSourceConnectionAnchor(request) : null;
}
@SuppressWarnings("unchecked")
private ConnectionAnchor getTargetConnectionAnchor(EditPart targetEditPart, Request request) {
- if(targetEditPart instanceof ExecutionSpecificationEndEditPart) {
+ if (targetEditPart instanceof ExecutionSpecificationEndEditPart) {
request.getExtendedData().remove(AbstractExecutionSpecificationEditPart.EXECUTION_FIX_ANCHOR_POSITION);
- EObject element = ((ExecutionSpecificationEndEditPart)targetEditPart).resolveSemanticElement();
- INodeEditPart parent = (INodeEditPart)targetEditPart.getParent();
- if(parent instanceof IGraphicalEditPart) {
- EObject parentElement = ((IGraphicalEditPart)parent).resolveSemanticElement();
- if(parentElement instanceof ExecutionSpecification) {
- if(element == ((ExecutionSpecification)parentElement).getStart()) {
+ EObject element = ((ExecutionSpecificationEndEditPart) targetEditPart).resolveSemanticElement();
+ INodeEditPart parent = (INodeEditPart) targetEditPart.getParent();
+ if (parent instanceof IGraphicalEditPart) {
+ EObject parentElement = ((IGraphicalEditPart) parent).resolveSemanticElement();
+ if (parentElement instanceof ExecutionSpecification) {
+ if (element == ((ExecutionSpecification) parentElement).getStart()) {
request.getExtendedData().put(AbstractExecutionSpecificationEditPart.EXECUTION_FIX_ANCHOR_POSITION, PositionConstants.TOP);
- } else if(element == ((ExecutionSpecification)parentElement).getFinish()) {
+ } else if (element == ((ExecutionSpecification) parentElement).getFinish()) {
request.getExtendedData().put(AbstractExecutionSpecificationEditPart.EXECUTION_FIX_ANCHOR_POSITION, PositionConstants.BOTTOM);
}
}
}
ConnectionAnchor targetConnectionAnchor = parent.getTargetConnectionAnchor(request);
- //Be sure to remove this key after used.
+ // Be sure to remove this key after used.
request.getExtendedData().remove(AbstractExecutionSpecificationEditPart.EXECUTION_FIX_ANCHOR_POSITION);
return targetConnectionAnchor;
}
- return targetEditPart instanceof INodeEditPart ? ((INodeEditPart)targetEditPart).getTargetConnectionAnchor(request) : null;
+ return targetEditPart instanceof INodeEditPart ? ((INodeEditPart) targetEditPart).getTargetConnectionAnchor(request) : null;
}
- // protected ConnectionAnchor getTargetConnectionAnchor(CreateConnectionRequest request) {
- // EditPart targetEditPart = request.getTargetEditPart();
- // return getTargetConnectionAnchor(targetEditPart, request);
- // }
+ // protected ConnectionAnchor getTargetConnectionAnchor(CreateConnectionRequest request) {
+ // EditPart targetEditPart = request.getTargetEditPart();
+ // return getTargetConnectionAnchor(targetEditPart, request);
+ // }
+ @Override
protected ConnectionRouter getDummyConnectionRouter(CreateConnectionRequest arg0) {
return LifelineChildGraphicalNodeEditPolicy.messageRouter;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ExternalLabelPrimaryDragRoleEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ExternalLabelPrimaryDragRoleEditPolicy.java
index 01efe3bb69f..33b40b6cd65 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ExternalLabelPrimaryDragRoleEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ExternalLabelPrimaryDragRoleEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2010 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
@@ -41,14 +41,14 @@ public class ExternalLabelPrimaryDragRoleEditPolicy extends NonResizableLabelEdi
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
@Override
protected Command getMoveCommand(ChangeBoundsRequest request) {
- LabelEditPart editPart = (LabelEditPart)getHost();
+ LabelEditPart editPart = (LabelEditPart) getHost();
// FeedBack - Port + Delta
Rectangle updatedRect = new Rectangle();
PrecisionRectangle initialRect = new PrecisionRectangle(getInitialFeedbackBounds().getCopy());
@@ -60,7 +60,7 @@ public class ExternalLabelPrimaryDragRoleEditPolicy extends NonResizableLabelEdi
rect.translate(request.getMoveDelta());
rect.resize(request.getSizeDelta());
getHostFigure().translateToRelative(rect);
- ICommand moveCommand = new SetBoundsCommand(editPart.getEditingDomain(), DiagramUIMessages.MoveLabelCommand_Label_Location, new EObjectAdapter((View)editPart.getModel()), updatedRect);
+ ICommand moveCommand = new SetBoundsCommand(editPart.getEditingDomain(), DiagramUIMessages.MoveLabelCommand_Label_Location, new EObjectAdapter((View) editPart.getModel()), updatedRect);
return new ICommandProxy(moveCommand);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/GateCreationEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/GateCreationEditPolicy.java
index db87fa6bae2..6c44b0c3a05 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/GateCreationEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/GateCreationEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -47,22 +47,22 @@ public class GateCreationEditPolicy extends LayoutEditPolicy {
/**
* Constructor.
- *
+ *
*/
public GateCreationEditPolicy() {
}
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy#getTargetEditPart(org.eclipse.gef.Request)
- *
+ *
* @param request
* @return
*/
@Override
public EditPart getTargetEditPart(Request request) {
- //Fixed bug when creating Gate, take care of CustomizableDropEditPolicy.
- if(isGateCreation(request)) {
- if(getHost() instanceof InteractionEditPart && !touchesInteractionBounds((GraphicalEditPart)getHost(), ((CreateRequest)request).getLocation())) {
+ // Fixed bug when creating Gate, take care of CustomizableDropEditPolicy.
+ if (isGateCreation(request)) {
+ if (getHost() instanceof InteractionEditPart && !touchesInteractionBounds((GraphicalEditPart) getHost(), ((CreateRequest) request).getLocation())) {
return null;
}
return getHost();
@@ -74,10 +74,10 @@ public class GateCreationEditPolicy extends LayoutEditPolicy {
Point p = location.getCopy();
IFigure figure = interaction.getFigure();
figure.translateToRelative(p);
- // if mouse location is far from border, do not handle connection event
+ // 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)) {
+ if (innerRetangle.contains(p)) {
return false;
}
return r.getExpanded(1, 1).contains(p);
@@ -85,13 +85,13 @@ public class GateCreationEditPolicy extends LayoutEditPolicy {
/**
* @see org.eclipse.gef.editpolicies.AbstractEditPolicy#showTargetFeedback(org.eclipse.gef.Request)
- *
+ *
* @param request
*/
@Override
public void showTargetFeedback(Request request) {
- if(isGateCreation(request)) {
- showCreateGateFeedback((CreateRequest)request);
+ if (isGateCreation(request)) {
+ showCreateGateFeedback((CreateRequest) request);
}
super.showTargetFeedback(request);
}
@@ -100,9 +100,9 @@ public class GateCreationEditPolicy extends LayoutEditPolicy {
* @param request
*/
private void showCreateGateFeedback(CreateRequest request) {
- if(gateFeedback == null) {
+ if (gateFeedback == null) {
gateFeedback = new RectangleFigure();
- ((RectangleFigure)gateFeedback).setLineWidth(2);
+ ((RectangleFigure) gateFeedback).setLineWidth(2);
gateFeedback.setSize(GateEditPart.DEFAULT_SIZE);
getFeedbackLayer().add(gateFeedback);
}
@@ -114,18 +114,18 @@ public class GateCreationEditPolicy extends LayoutEditPolicy {
Rectangle rect = locator.getValidLocation(proposedLocation, gateFeedback);
getHostFigure().translateToAbsolute(rect);
gateFeedback.translateToRelative(rect);
- if(rect.x < 0 || rect.y < 0) {
+ if (rect.x < 0 || rect.y < 0) {
// Try to fixed the bug about shaking when the feedback outside the viewer bounds.
// Now just display half-width of the normal rectangle.
Control control = getHost().getViewer().getControl();
- if(control instanceof FigureCanvas) {
- int hv = ((FigureCanvas)control).getViewport().getHorizontalRangeModel().getValue();
- if(rect.x < 0 && hv >= 0) {
+ if (control instanceof FigureCanvas) {
+ int hv = ((FigureCanvas) control).getViewport().getHorizontalRangeModel().getValue();
+ if (rect.x < 0 && hv >= 0) {
rect.x = 0;
rect.width = rect.width / 2;
}
- int vv = ((FigureCanvas)control).getViewport().getVerticalRangeModel().getValue();
- if(rect.y < 0 && vv >= 0) {
+ int vv = ((FigureCanvas) control).getViewport().getVerticalRangeModel().getValue();
+ if (rect.y < 0 && vv >= 0) {
rect.y = 0;
rect.height = rect.height / 2;
}
@@ -140,35 +140,35 @@ public class GateCreationEditPolicy extends LayoutEditPolicy {
/**
* @see org.eclipse.gef.editpolicies.AbstractEditPolicy#eraseTargetFeedback(org.eclipse.gef.Request)
- *
+ *
* @param request
*/
@Override
public void eraseTargetFeedback(Request request) {
super.eraseTargetFeedback(request);
- if(gateFeedback != null && gateFeedback.getParent() != null) {
+ if (gateFeedback != null && gateFeedback.getParent() != null) {
gateFeedback.getParent().remove(gateFeedback);
gateFeedback = null;
}
}
private boolean isGateCreation(Request request) {
- if(!(request instanceof CreateRequest)) {
+ if (!(request instanceof CreateRequest)) {
return false;
}
- CreateRequest createReq = (CreateRequest)request;
+ CreateRequest createReq = (CreateRequest) request;
try {
Object newObjectType = createReq.getNewObjectType();
return GateEditPart.GATE_TYPE.equals(newObjectType);
} catch (Exception e) {
- //There's no CreationFactory set.
+ // There's no CreationFactory set.
return false;
}
}
/**
* @see org.eclipse.gef.editpolicies.LayoutEditPolicy#createChildEditPolicy(org.eclipse.gef.EditPart)
- *
+ *
* @param child
* @return
*/
@@ -179,32 +179,32 @@ public class GateCreationEditPolicy extends LayoutEditPolicy {
/**
* @see org.eclipse.gef.editpolicies.LayoutEditPolicy#getCreateCommand(org.eclipse.gef.requests.CreateRequest)
- *
+ *
* @param request
* @return
*/
@Override
protected Command getCreateCommand(CreateRequest request) {
- if(isGateCreation(request)) {
+ if (isGateCreation(request)) {
EditPart targetEditPart = getTargetEditPart(request);
- if(targetEditPart == null) {
+ if (targetEditPart == null) {
return UnexecutableCommand.INSTANCE;
}
- //Disable creation when there's no refersTo set for InteractionUse.
- // IGraphicalEditPart adapter = (IGraphicalEditPart)targetEditPart.getAdapter(IGraphicalEditPart.class);
- // if(adapter != null) {
- // EObject semanticElement = adapter.resolveSemanticElement();
- // if(semanticElement instanceof InteractionUse && ((InteractionUse)semanticElement).getRefersTo() == null) {
- // return UnexecutableCommand.INSTANCE;
- // }
- // }
- if(targetEditPart instanceof InteractionEditPart) {
- if(!touchesInteractionBounds((InteractionEditPart)targetEditPart, ((CreateRequest)request).getLocation())) {
+ // Disable creation when there's no refersTo set for InteractionUse.
+ // IGraphicalEditPart adapter = (IGraphicalEditPart)targetEditPart.getAdapter(IGraphicalEditPart.class);
+ // if(adapter != null) {
+ // EObject semanticElement = adapter.resolveSemanticElement();
+ // if(semanticElement instanceof InteractionUse && ((InteractionUse)semanticElement).getRefersTo() == null) {
+ // return UnexecutableCommand.INSTANCE;
+ // }
+ // }
+ if (targetEditPart instanceof InteractionEditPart) {
+ if (!touchesInteractionBounds((InteractionEditPart) targetEditPart, request.getLocation())) {
return UnexecutableCommand.INSTANCE;
}
}
- Point location = (Point)request.getExtendedData().get(GATE_LOCATION_DATA);
- if(location == null) {
+ Point location = (Point) request.getExtendedData().get(GATE_LOCATION_DATA);
+ if (location == null) {
location = GateHelper.computeGateLocation(request.getLocation(), getHostFigure(), null);
}
return getCreateGateCommand(location);
@@ -220,12 +220,12 @@ public class GateCreationEditPolicy extends LayoutEditPolicy {
}
private TransactionalEditingDomain getEditingDomain() {
- return ((IGraphicalEditPart)getHost()).getEditingDomain();
+ return ((IGraphicalEditPart) getHost()).getEditingDomain();
}
/**
* @see org.eclipse.gef.editpolicies.LayoutEditPolicy#getMoveChildrenCommand(org.eclipse.gef.Request)
- *
+ *
* @param request
* @return
*/
@@ -236,16 +236,16 @@ public class GateCreationEditPolicy extends LayoutEditPolicy {
/**
* @see org.eclipse.gef.editpolicies.AbstractEditPolicy#understandsRequest(org.eclipse.gef.Request)
- *
+ *
* @param req
* @return
*/
@Override
public boolean understandsRequest(Request req) {
- //Fixed bug when creating Gate, take care of CustomizableDropEditPolicy.
- if(isGateCreation(req)) {
+ // Fixed bug when creating Gate, take care of CustomizableDropEditPolicy.
+ if (isGateCreation(req)) {
EditPart targetEditPart = getTargetEditPart(req);
- if(targetEditPart == null) {
+ if (targetEditPart == null) {
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/GateGraphicalNodeEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/GateGraphicalNodeEditPolicy.java
index 4e6042d202b..b990b2adcc6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/GateGraphicalNodeEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/GateGraphicalNodeEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -64,7 +64,7 @@ public class GateGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.GraphicalNodeEditPolicy#getConnectionCompleteCommand(org.eclipse.gef.requests.CreateConnectionRequest)
- *
+ *
* @param request
* @return
*/
@@ -72,52 +72,53 @@ public class GateGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
request.getExtendedData().put(SequenceRequestConstant.TARGET_MODEL_CONTAINER, getInteractionFragment(request.getLocation()));
Command command = super.getConnectionCompleteCommand(request);
- if(request instanceof CreateConnectionViewAndElementRequest) {
- CreateConnectionViewAndElementRequest viewRequest = (CreateConnectionViewAndElementRequest)request;
+ if (request instanceof CreateConnectionViewAndElementRequest) {
+ CreateConnectionViewAndElementRequest viewRequest = (CreateConnectionViewAndElementRequest) request;
EditPart sourceEP = viewRequest.getSourceEditPart();
- EObject source = ViewUtil.resolveSemanticElement((View)sourceEP.getModel());
+ EObject source = ViewUtil.resolveSemanticElement((View) sourceEP.getModel());
/*
* Create Graphical Gate if needed, See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=389531
*/
String semanticHint = viewRequest.getConnectionViewAndElementDescriptor().getSemanticHint();
- //Ignore CoRegion.
- if(!(sourceEP instanceof CombinedFragment2EditPart) && (((IHintedType)(UMLElementTypes.Message_4004)).getSemanticHint().equals(semanticHint) || ((IHintedType)(UMLElementTypes.Message_4005)).getSemanticHint().equals(semanticHint))) {
- if(source instanceof CombinedFragment || source instanceof Interaction || source instanceof InteractionUse) {
+ // Ignore CoRegion.
+ if (!(sourceEP instanceof CombinedFragment2EditPart) && (((IHintedType) (UMLElementTypes.Message_4004)).getSemanticHint().equals(semanticHint) || ((IHintedType) (UMLElementTypes.Message_4005)).getSemanticHint().equals(semanticHint))) {
+ if (source instanceof CombinedFragment || source instanceof Interaction || source instanceof InteractionUse) {
CompoundCommand cc = new CompoundCommand("Redirect to Gate");
Point location = null;
- IGraphicalEditPart adapter = (IGraphicalEditPart)sourceEP.getAdapter(IGraphicalEditPart.class);
- if(adapter != null) {
+ IGraphicalEditPart adapter = (IGraphicalEditPart) sourceEP.getAdapter(IGraphicalEditPart.class);
+ if (adapter != null) {
Point sourceLocation = request.getLocation();
Object object = request.getExtendedData().get(SequenceRequestConstant.SOURCE_LOCATION_DATA);
- if(object instanceof Point) {
- sourceLocation = (Point)object;
+ if (object instanceof Point) {
+ sourceLocation = (Point) object;
}
location = GateHelper.computeGateLocation(sourceLocation, adapter.getFigure(), null);
}
ConnectionViewDescriptor edgeAdapter = viewRequest.getConnectionViewDescriptor();
final IAdaptable elementAdapter = edgeAdapter.getElementAdapter();
- if(elementAdapter != null) {
+ if (elementAdapter != null) {
IAdaptable gateAdapter = new IAdaptable() {
+ @Override
public Object getAdapter(Class adapter) {
- if(Gate.class == adapter) {
- Message message = (Message)elementAdapter.getAdapter(Message.class);
+ if (Gate.class == adapter) {
+ Message message = (Message) elementAdapter.getAdapter(Message.class);
MessageEnd sendEvent = message.getSendEvent();
- if(sendEvent instanceof Gate) {
+ if (sendEvent instanceof Gate) {
return sendEvent;
}
}
return null;
}
};
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
CreateGateViewCommand createGateCommand = new CreateGateViewCommand(editingDomain, sourceEP, location, gateAdapter);
cc.add(new ICommandProxy(createGateCommand));
SetConnectionEndsCommand resetSourceCommand = new SetConnectionEndsCommand(editingDomain, null);
resetSourceCommand.setEdgeAdaptor(edgeAdapter);
resetSourceCommand.setNewSourceAdaptor(createGateCommand.getResult());
cc.add(new ICommandProxy(resetSourceCommand));
- if(cc.canExecute()) {
+ if (cc.canExecute()) {
command = command.chain(cc);
}
}
@@ -128,25 +129,25 @@ public class GateGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
}
private Gate resolveSemanticElement() {
- return (Gate)((GateEditPart)getHost()).resolveSemanticElement();
+ return (Gate) ((GateEditPart) getHost()).resolveSemanticElement();
}
/**
* Fix bug to find a correct InteractionOperand when connecting on CombinedFragment.
- *
+ *
* @param location
* @return
*/
private InteractionFragment getInteractionFragment(Point location) {
Gate gate = resolveSemanticElement();
- if(gate != null) {
- InteractionFragment fragment = (InteractionFragment)gate.eContainer();
- if(fragment instanceof CombinedFragment) {
+ if (gate != null) {
+ InteractionFragment fragment = (InteractionFragment) gate.eContainer();
+ if (fragment instanceof CombinedFragment) {
fragment = SequenceUtil.findInteractionFragmentContainerAt(location, getHost());
- if(!(fragment instanceof InteractionOperand)) {
- Rectangle rect = SequenceUtil.getAbsoluteBounds((IGraphicalEditPart)getHost());
+ if (!(fragment instanceof InteractionOperand)) {
+ Rectangle rect = SequenceUtil.getAbsoluteBounds((IGraphicalEditPart) getHost());
fragment = SequenceUtil.findInteractionFragmentContainerAt(rect.getRight(), getHost());
- if(!(fragment instanceof InteractionOperand)) {
+ if (!(fragment instanceof InteractionOperand)) {
fragment = SequenceUtil.findInteractionFragmentContainerAt(rect.getLeft(), getHost());
}
}
@@ -158,7 +159,7 @@ public class GateGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.GraphicalNodeEditPolicy#getConnectionAndRelationshipCompleteCommand(org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewAndElementRequest)
- *
+ *
* @param request
* @return
*/
@@ -170,40 +171,41 @@ public class GateGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.GraphicalNodeEditPolicy#getConnectionCreateCommand(org.eclipse.gef.requests.CreateConnectionRequest)
- *
+ *
* @param request
* @return
*/
@Override
protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
- if(request.getSourceEditPart() != null && request.getSourceEditPart() != getHost()) {
+ if (request.getSourceEditPart() != null && request.getSourceEditPart() != getHost()) {
return null;
}
request.getExtendedData().put(SequenceRequestConstant.SOURCE_MODEL_CONTAINER, getInteractionFragment(request.getLocation()));
- Rectangle rect = SequenceUtil.getAbsoluteBounds((IGraphicalEditPart)getHost());
+ Rectangle rect = SequenceUtil.getAbsoluteBounds((IGraphicalEditPart) getHost());
request.getExtendedData().put(SequenceRequestConstant.SOURCE_LOCATION_DATA, rect.getLocation());
return super.getConnectionCreateCommand(request);
}
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.GraphicalNodeEditPolicy#getConnectionAndRelationshipCreateCommand(org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewAndElementRequest)
- *
+ *
* @param request
* @return
*/
@Override
protected Command getConnectionAndRelationshipCreateCommand(CreateConnectionViewAndElementRequest request) {
- if(request.getSourceEditPart() != null && request.getSourceEditPart() != getHost()) {
+ if (request.getSourceEditPart() != null && request.getSourceEditPart() != getHost()) {
return null;
}
request.getExtendedData().put(SequenceRequestConstant.SOURCE_MODEL_CONTAINER, getInteractionFragment(request.getLocation()));
- Rectangle rect = SequenceUtil.getAbsoluteBounds((IGraphicalEditPart)getHost());
+ Rectangle rect = SequenceUtil.getAbsoluteBounds((IGraphicalEditPart) getHost());
request.getExtendedData().put(SequenceRequestConstant.SOURCE_LOCATION_DATA, rect.getLocation());
return super.getConnectionAndRelationshipCreateCommand(request);
}
+ @Override
protected Connection createDummyConnection(Request req) {
- PolylineConnection c = (PolylineConnection)super.createDummyConnection(req);
+ PolylineConnection c = (PolylineConnection) super.createDummyConnection(req);
c.setLineStyle(Graphics.LINE_DASHDOT);
c.setForegroundColor(ColorConstants.black);
return c;
@@ -211,7 +213,7 @@ public class GateGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.GraphicalNodeEditPolicy#getDummyConnectionRouter(org.eclipse.gef.requests.CreateConnectionRequest)
- *
+ *
* @param arg0
* @return
*/
@@ -222,18 +224,18 @@ public class GateGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.GraphicalNodeEditPolicy#getReconnectTargetCommand(org.eclipse.gef.requests.ReconnectRequest)
- *
+ *
* @param request
* @return
*/
@Override
protected Command getReconnectTargetCommand(ReconnectRequest request) {
ConnectionEditPart connectionEditPart = request.getConnectionEditPart();
- IGraphicalEditPart adapter = (IGraphicalEditPart)connectionEditPart.getAdapter(IGraphicalEditPart.class);
- if(adapter != null && adapter.resolveSemanticElement() instanceof Message) {
- Message oldMessage = (Message)adapter.resolveSemanticElement();
+ IGraphicalEditPart adapter = (IGraphicalEditPart) connectionEditPart.getAdapter(IGraphicalEditPart.class);
+ if (adapter != null && adapter.resolveSemanticElement() instanceof Message) {
+ Message oldMessage = (Message) adapter.resolveSemanticElement();
Gate gate = resolveSemanticElement();
- if(gate == null || (gate.getMessage() != null && oldMessage != gate.getMessage())) {
+ if (gate == null || (gate.getMessage() != null && oldMessage != gate.getMessage())) {
return UnexecutableCommand.INSTANCE;
}
}
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 f9b24527c2e..4af92da0682 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -69,9 +69,9 @@ import org.eclipse.uml2.uml.Message;
/**
* Graphical Presentation of Gate with In/Out
- *
+ *
* This GraphicalNodeEditPolicy used for CombinedFragment, InteractionUse and Interaction which can have Gates.
- *
+ *
* @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=389531
* @author Jin Liu (jin.liu@soyatec.com)
*/
@@ -79,7 +79,7 @@ public class GatesHolderGraphicalNodeEditPolicy extends SequenceGraphicalNodeEdi
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.policies.SequenceGraphicalNodeEditPolicy#getReconnectSourceCommand(org.eclipse.gef.requests.ReconnectRequest)
- *
+ *
* @param request
* @return
*/
@@ -87,10 +87,10 @@ public class GatesHolderGraphicalNodeEditPolicy extends SequenceGraphicalNodeEdi
protected Command getReconnectSourceCommand(ReconnectRequest request) {
ConnectionEditPart connection = request.getConnectionEditPart();
EditPart source = connection.getSource();
- if(source instanceof GateEditPart) {
- if(getHost() == source.getParent()) {
- return getMoveGateCommand((GateEditPart)source, request);
- } else if(isReconnectMessage(request) && !isRedirectFailed(request)) {
+ if (source instanceof GateEditPart) {
+ if (getHost() == source.getParent()) {
+ return getMoveGateCommand((GateEditPart) source, request);
+ } else if (isReconnectMessage(request) && !isRedirectFailed(request)) {
Point location = GateHelper.computeGateLocation(request.getLocation(), getHostFigure(), null);
CompositeCommand result = new CompositeCommand("");
CreateGateElementAndViewCommand createGateCommand = new CreateGateElementAndViewCommand(getEditingDomain(), getHost(), location);
@@ -121,7 +121,7 @@ public class GatesHolderGraphicalNodeEditPolicy extends SequenceGraphicalNodeEdi
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.policies.SequenceGraphicalNodeEditPolicy#getReconnectTargetCommand(org.eclipse.gef.requests.ReconnectRequest)
- *
+ *
* @param request
* @return
*/
@@ -129,10 +129,10 @@ public class GatesHolderGraphicalNodeEditPolicy extends SequenceGraphicalNodeEdi
protected Command getReconnectTargetCommand(ReconnectRequest request) {
ConnectionEditPart connection = request.getConnectionEditPart();
EditPart target = connection.getTarget();
- if(target instanceof GateEditPart) {
- if(getHost() == target.getParent()) {
- return getMoveGateCommand((GateEditPart)target, request);
- } else if(isReconnectMessage(request) && !isRedirectFailed(request)) {
+ if (target instanceof GateEditPart) {
+ if (getHost() == target.getParent()) {
+ return getMoveGateCommand((GateEditPart) target, request);
+ } else if (isReconnectMessage(request) && !isRedirectFailed(request)) {
Point location = GateHelper.computeGateLocation(request.getLocation(), getHostFigure(), null);
CompositeCommand result = new CompositeCommand("");
CreateGateElementAndViewCommand createGateCommand = new CreateGateElementAndViewCommand(getEditingDomain(), getHost(), location);
@@ -153,21 +153,21 @@ public class GatesHolderGraphicalNodeEditPolicy extends SequenceGraphicalNodeEdi
private boolean isReconnectMessage(ReconnectRequest request) {
ConnectionEditPart conn = request.getConnectionEditPart();
- IGraphicalEditPart adapter = (IGraphicalEditPart)conn.getAdapter(IGraphicalEditPart.class);
+ IGraphicalEditPart adapter = (IGraphicalEditPart) conn.getAdapter(IGraphicalEditPart.class);
return adapter != null && adapter.resolveSemanticElement() instanceof Message;
}
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.GraphicalNodeEditPolicy#getCommand(org.eclipse.gef.Request)
- *
+ *
* @param request
* @return
*/
@Override
public Command getCommand(Request request) {
- if(REQ_CONNECTION_END.equals(request.getType())) {
- if(isCreatingMessage(request, UMLElementTypes.Message_4004) || isCreatingMessage(request, UMLElementTypes.Message_4005) || isCreatingMessage(request, UMLElementTypes.Message_4009)) {
- return getConnectionEndWithGateCommand((CreateConnectionRequest)request);
+ if (REQ_CONNECTION_END.equals(request.getType())) {
+ if (isCreatingMessage(request, UMLElementTypes.Message_4004) || isCreatingMessage(request, UMLElementTypes.Message_4005) || isCreatingMessage(request, UMLElementTypes.Message_4009)) {
+ return getConnectionEndWithGateCommand((CreateConnectionRequest) request);
}
}
return super.getCommand(request);
@@ -175,30 +175,30 @@ public class GatesHolderGraphicalNodeEditPolicy extends SequenceGraphicalNodeEdi
/**
* Redirect the message end with a Graphical Gate.
- *
+ *
* @param request
* @return
*/
protected Command getConnectionEndWithGateCommand(CreateConnectionRequest request) {
CompoundCommand cc = new CompoundCommand(DiagramUIMessages.Command_CreateRelationship_Label);
- //1. Create Target Gate
+ // 1. Create Target Gate
Point targetLocation = GateHelper.computeGateLocation(request.getLocation(), getHostFigure(), null);
CreateGateElementAndViewCommand createTargetGateCommand = new CreateGateElementAndViewCommand(getEditingDomain(), getHost(), targetLocation);
createTargetGateCommand.setCreateInnerCFGate(true);
createTargetGateCommand.setVolatiled(!(getHost() instanceof InteractionEditPart));
cc.add(new ICommandProxy(createTargetGateCommand));
IAdaptable targetViewAdapter = createTargetGateCommand.getResult();
- //2. Create Source Gate if needed.
+ // 2. Create Source Gate if needed.
EditPart sourceEditPart = request.getSourceEditPart();
IAdaptable sourceViewAdapter = sourceEditPart;
- //Ignore message found.
- if(!isCreatingMessage(request, UMLElementTypes.Message_4009)) {
- if(sourceEditPart instanceof CombinedFragmentEditPart || sourceEditPart instanceof InteractionEditPart || sourceEditPart instanceof InteractionUseEditPart) {
- IGraphicalEditPart ep = (IGraphicalEditPart)sourceEditPart;
+ // Ignore message found.
+ if (!isCreatingMessage(request, UMLElementTypes.Message_4009)) {
+ if (sourceEditPart instanceof CombinedFragmentEditPart || sourceEditPart instanceof InteractionEditPart || sourceEditPart instanceof InteractionUseEditPart) {
+ IGraphicalEditPart ep = (IGraphicalEditPart) sourceEditPart;
Point location = request.getLocation();
Object locationData = request.getExtendedData().get(SequenceRequestConstant.SOURCE_LOCATION_DATA);
- if(locationData instanceof Point) {
- location = (Point)locationData;
+ if (locationData instanceof Point) {
+ location = (Point) locationData;
}
Point sourceLocation = GateHelper.computeGateLocation(location, ep.getFigure(), null);
CreateGateElementAndViewCommand createSourceGateCommand = new CreateGateElementAndViewCommand(getEditingDomain(), sourceViewAdapter, sourceLocation);
@@ -208,21 +208,21 @@ public class GatesHolderGraphicalNodeEditPolicy extends SequenceGraphicalNodeEdi
sourceViewAdapter = createSourceGateCommand.getResult();
}
}
- //3. Create Message.
+ // 3. Create Message.
ICommand createMessageCommand = createCreateMessageWithGateCommand(request, sourceViewAdapter, targetViewAdapter);
cc.add(new ICommandProxy(createMessageCommand));
return cc;
}
protected ICommand createCreateMessageWithGateCommand(CreateConnectionRequest request, IAdaptable sourceViewAdapter, IAdaptable targetViewAdapter) {
- if(request instanceof CreateConnectionViewAndElementRequest) {
- return new CreateMessageWithGateCommand((CreateConnectionViewAndElementRequest)request, sourceViewAdapter, targetViewAdapter, getHost().getViewer());
- } else if(request instanceof CreateUnspecifiedTypeConnectionRequest) {
- CreateUnspecifiedTypeConnectionRequest createReq = (CreateUnspecifiedTypeConnectionRequest)request;
+ if (request instanceof CreateConnectionViewAndElementRequest) {
+ return new CreateMessageWithGateCommand((CreateConnectionViewAndElementRequest) request, sourceViewAdapter, targetViewAdapter, getHost().getViewer());
+ } else if (request instanceof CreateUnspecifiedTypeConnectionRequest) {
+ CreateUnspecifiedTypeConnectionRequest createReq = (CreateUnspecifiedTypeConnectionRequest) request;
@SuppressWarnings("rawtypes")
List elementTypes = createReq.getElementTypes();
- if(elementTypes.size() == 1) {
- IElementType elementType = (IElementType)elementTypes.get(0);
+ if (elementTypes.size() == 1) {
+ IElementType elementType = (IElementType) elementTypes.get(0);
return new CreateMessageWithGateCommand(request, elementType, sourceViewAdapter, targetViewAdapter, getHost().getViewer());
}
}
@@ -230,26 +230,26 @@ public class GatesHolderGraphicalNodeEditPolicy extends SequenceGraphicalNodeEdi
}
protected boolean isCreatingMessage(Request request, IElementType elementType) {
- if(request instanceof CreateUnspecifiedTypeConnectionRequest) {
- return ((CreateUnspecifiedTypeConnectionRequest)request).getElementTypes().contains(elementType);
- } else if(elementType instanceof IHintedType && request instanceof CreateConnectionViewAndElementRequest) {
- return ((IHintedType)elementType).getSemanticHint().equals(((CreateConnectionViewAndElementRequest)request).getConnectionViewDescriptor().getSemanticHint());
+ if (request instanceof CreateUnspecifiedTypeConnectionRequest) {
+ return ((CreateUnspecifiedTypeConnectionRequest) request).getElementTypes().contains(elementType);
+ } else if (elementType instanceof IHintedType && request instanceof CreateConnectionViewAndElementRequest) {
+ return ((IHintedType) elementType).getSemanticHint().equals(((CreateConnectionViewAndElementRequest) request).getConnectionViewDescriptor().getSemanticHint());
}
return false;
}
protected TransactionalEditingDomain getEditingDomain() {
- return ((GraphicalEditPart)getHost()).getEditingDomain();
+ return ((GraphicalEditPart) getHost()).getEditingDomain();
}
/**
* This class is copied from DeferredCreateConnectionViewAndElementCommand.
- *
+ *
* But to fixed bugs about creating Message:
- *
+ *
* 1. Set the location for CreateConnectionViewRequest with created Gate.
* 2. Update targetContainer with created Gate.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
private static class CreateMessageWithGateCommand extends AbstractCommand {
@@ -285,13 +285,14 @@ public class GatesHolderGraphicalNodeEditPolicy extends SequenceGraphicalNodeEdi
this.viewer = currentViewer;
}
+ @Override
@SuppressWarnings("rawtypes")
public List getAffectedFiles() {
- if(viewer != null) {
+ if (viewer != null) {
EditPart editpart = viewer.getRootEditPart().getContents();
- if(editpart instanceof IGraphicalEditPart) {
- View view = (View)editpart.getModel();
- if(view != null) {
+ if (editpart instanceof IGraphicalEditPart) {
+ View view = (View) editpart.getModel();
+ if (view != null) {
IFile f = WorkspaceSynchronizer.getFile(view.eResource());
return f != null ? Collections.singletonList(f) : Collections.EMPTY_LIST;
}
@@ -300,10 +301,12 @@ public class GatesHolderGraphicalNodeEditPolicy extends SequenceGraphicalNodeEdi
return super.getAffectedFiles();
}
+ @Override
public boolean canUndo() {
return command != null && command.canUndo();
}
+ @Override
public boolean canRedo() {
return CommandUtilities.canRedo(command);
}
@@ -311,73 +314,79 @@ public class GatesHolderGraphicalNodeEditPolicy extends SequenceGraphicalNodeEdi
/**
* gives access to the connection source edit part, which is the edit part
* of the connection's source <code>View</code>
- *
+ *
* @return the source edit part
*/
protected EditPart getSourceEditPart() {
- return (IGraphicalEditPart)viewer.getEditPartRegistry().get(sourceViewAdapter.getAdapter(View.class));
+ return (IGraphicalEditPart) viewer.getEditPartRegistry().get(sourceViewAdapter.getAdapter(View.class));
}
/**
* gives access to the connection target edit part, which is the edit part
* of the connection's target <code>View</code>
- *
+ *
* @return the source edit part
*/
protected EditPart getTargetEditPart() {
- return (IGraphicalEditPart)viewer.getEditPartRegistry().get(targetViewAdapter.getAdapter(View.class));
+ return (IGraphicalEditPart) viewer.getEditPartRegistry().get(targetViewAdapter.getAdapter(View.class));
}
+ @Override
public boolean canExecute() {
- if(!(request instanceof CreateConnectionViewRequest) && !(request instanceof CreateUnspecifiedTypeConnectionRequest))
+ if (!(request instanceof CreateConnectionViewRequest) && !(request instanceof CreateUnspecifiedTypeConnectionRequest)) {
return false;
- if(request instanceof CreateUnspecifiedTypeConnectionRequest) {
- if(typeInfoAdapter == null)
+ }
+ if (request instanceof CreateUnspecifiedTypeConnectionRequest) {
+ if (typeInfoAdapter == null) {
return false;
- final IElementType typeInfo = (IElementType)typeInfoAdapter.getAdapter(IElementType.class);
- if(typeInfo != null) {
- if(((CreateUnspecifiedTypeConnectionRequest)request).getRequestForType(typeInfo) == null)
+ }
+ final IElementType typeInfo = (IElementType) typeInfoAdapter.getAdapter(IElementType.class);
+ if (typeInfo != null) {
+ if (((CreateUnspecifiedTypeConnectionRequest) request).getRequestForType(typeInfo) == null) {
return false;
+ }
}
}
return true;
}
+ @Override
@SuppressWarnings({ "restriction" })
protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
CreateConnectionViewRequest req = null;
- if(request != null) {
- if(request instanceof CreateConnectionViewRequest) {
- req = (CreateConnectionViewRequest)request;
+ if (request != null) {
+ if (request instanceof CreateConnectionViewRequest) {
+ req = (CreateConnectionViewRequest) request;
}
} else {
return CommandResult.newErrorCommandResult(getLabel());
}
- if(typeInfoAdapter != null) {
- IElementType typeInfo = (IElementType)typeInfoAdapter.getAdapter(IElementType.class);
- if(typeInfo == null) {
+ if (typeInfoAdapter != null) {
+ IElementType typeInfo = (IElementType) typeInfoAdapter.getAdapter(IElementType.class);
+ if (typeInfo == null) {
return CommandResult.newErrorCommandResult(getLabel());
}
- if(request instanceof CreateUnspecifiedTypeConnectionRequest) {
- req = ((CreateConnectionViewRequest)((CreateUnspecifiedTypeConnectionRequest)request).getRequestForType(typeInfo));
+ if (request instanceof CreateUnspecifiedTypeConnectionRequest) {
+ req = ((CreateConnectionViewRequest) ((CreateUnspecifiedTypeConnectionRequest) request).getRequestForType(typeInfo));
}
}
// Suppressing UI if the target edit part has not been created yet
// this is so that if we are creating a new target the connection
// creation will just take default data instead of prompting
// For Defect RATLC00524293
- if(targetViewAdapter.getAdapter(IGraphicalEditPart.class) == null && req instanceof SuppressibleUIRequest)
- ((SuppressibleUIRequest)req).setSuppressibleUI(true);
+ if (targetViewAdapter.getAdapter(IGraphicalEditPart.class) == null && req instanceof SuppressibleUIRequest) {
+ ((SuppressibleUIRequest) req).setSuppressibleUI(true);
+ }
EditPart sourceEP = getSourceEditPart();
EditPart targetEP = getTargetEditPart();
- // if(targetEP instanceof IGraphicalEditPart) {
- // Rectangle absoluteBounds = SequenceUtil.getAbsoluteBounds((IGraphicalEditPart)targetEP);
- // if(absoluteBounds != null) {
- // req.setLocation(absoluteBounds.getLocation());
- // }
- // } else {
- // req.setLocation(null);
- // }
+ // if(targetEP instanceof IGraphicalEditPart) {
+ // Rectangle absoluteBounds = SequenceUtil.getAbsoluteBounds((IGraphicalEditPart)targetEP);
+ // if(absoluteBounds != null) {
+ // req.setLocation(absoluteBounds.getLocation());
+ // }
+ // } else {
+ // req.setLocation(null);
+ // }
// There are situations where src or target can be null and we must
// check for these
// ie. When a Select Existing Dialog is presnetd to the user and the
@@ -386,44 +395,48 @@ public class GatesHolderGraphicalNodeEditPolicy extends SequenceGraphicalNodeEdi
// So the following assertions have been replaced with a check for null
// on the editparts.
// old code ... Assert.isNotNull(sourceEP); Assert.isNotNull(targetEP);
- if((sourceEP == null) || (targetEP == null))
+ if ((sourceEP == null) || (targetEP == null)) {
return null;
- // if(req instanceof CreateConnectionViewAndElementRequest) {
- // command = CreateConnectionViewAndElementRequest.getCreateCommand(req, sourceEP, targetEP);
- command = getCreateCommand((CreateConnectionViewRequest)req, sourceEP, targetEP);
- // } else {
- // command = CreateConnectionViewRequest.getCreateCommand(req, sourceEP, targetEP);
- // }
- if(command != null && command.canExecute()) {
+ }
+ // if(req instanceof CreateConnectionViewAndElementRequest) {
+ // command = CreateConnectionViewAndElementRequest.getCreateCommand(req, sourceEP, targetEP);
+ command = getCreateCommand(req, sourceEP, targetEP);
+ // } else {
+ // command = CreateConnectionViewRequest.getCreateCommand(req, sourceEP, targetEP);
+ // }
+ if (command != null && command.canExecute()) {
command.execute();
}
viewer = null;// for garbage collection
- View view = (View)req.getConnectionViewDescriptor().getAdapter(View.class);
- if(null == view) {
+ View view = (View) req.getConnectionViewDescriptor().getAdapter(View.class);
+ if (null == view) {
return CommandResult.newCancelledCommandResult();
}
- if(request instanceof CreateConnectionViewRequest) {
- ((CreateConnectionViewRequest)request).getConnectionViewDescriptor().setView(view);
+ if (request instanceof CreateConnectionViewRequest) {
+ ((CreateConnectionViewRequest) request).getConnectionViewDescriptor().setView(view);
}
return CommandResult.newOKCommandResult(req.getNewObject());
}
+ @Override
public String getLabel() {
- if(command != null) {
+ if (command != null) {
return command.getLabel();
}
return null;
}
+ @Override
protected CommandResult doRedoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- if(command != null) {
+ if (command != null) {
command.redo();
}
return CommandResult.newOKCommandResult();
}
+ @Override
protected CommandResult doUndoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- if(command != null) {
+ if (command != null) {
command.undo();
}
return CommandResult.newOKCommandResult();
@@ -432,7 +445,7 @@ public class GatesHolderGraphicalNodeEditPolicy extends SequenceGraphicalNodeEdi
/**
* Copied from CreateConnectionViewAndElementRequest.getCreateCommand()
- *
+ *
* @param request
* @param sourceEditPart
* @param targetEditPart
@@ -446,8 +459,8 @@ public class GatesHolderGraphicalNodeEditPolicy extends SequenceGraphicalNodeEdi
request.setTargetEditPart(targetEditPart);
request.setType(RequestConstants.REQ_CONNECTION_START);
Object location = request.getExtendedData().get(SequenceRequestConstant.SOURCE_LOCATION_DATA);
- if(location instanceof Point) {
- request.setLocation((Point)location);
+ if (location instanceof Point) {
+ request.setLocation((Point) location);
}
sourceEditPart.showTargetFeedback(request);
sourceEditPart.getCommand(request);
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 73685636962..e89000e2ae0 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
@@ -46,9 +46,9 @@ public class HighlightEditPolicy extends GraphicalEditPolicy {
public static final String HIGHLIGHT_ROLE = "Highlight Edit Policy";
- private static final String DURATION_CONSTRAINT_ON_LIFELINE_HINT = ((IHintedType)UMLElementTypes.DurationConstraint_3021).getSemanticHint();
+ private static final String DURATION_CONSTRAINT_ON_LIFELINE_HINT = ((IHintedType) UMLElementTypes.DurationConstraint_3021).getSemanticHint();
- private static final String TIME_CONSTRAINT_ON_LIFELINE_HINT = ((IHintedType)UMLElementTypes.TimeConstraint_3019).getSemanticHint();
+ private static final String TIME_CONSTRAINT_ON_LIFELINE_HINT = ((IHintedType) UMLElementTypes.TimeConstraint_3019).getSemanticHint();
protected Indicator sourceIndicator;
@@ -58,22 +58,22 @@ public class HighlightEditPolicy extends GraphicalEditPolicy {
public void showSourceFeedback(Request request) {
EditPolicy editPolicy = null;
Object type = request.getType();
- if(REQ_CONNECTION_END.equals(type)) {
+ if (REQ_CONNECTION_END.equals(type)) {
editPolicy = getHost().getEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE);
- } else if(SequenceUtil.OBSERVATION_LINK_REQUEST_END.equals(type)) {
+ } else if (SequenceUtil.OBSERVATION_LINK_REQUEST_END.equals(type)) {
editPolicy = getHost().getEditPolicy("observationlink");
}
- if(editPolicy != null) {
- EditPart targetEditPart = ((CreateConnectionRequest)request).getTargetEditPart();
+ if (editPolicy != null) {
+ EditPart targetEditPart = ((CreateConnectionRequest) request).getTargetEditPart();
boolean canExecute = targetEditPart != null;
- if(targetEditPart != null) {
+ if (targetEditPart != null) {
Command command = targetEditPart.getCommand(request);
canExecute = command != null && command.canExecute();
}
editPolicy.showSourceFeedback(request);
- PolylineConnection connectionFeedback = (PolylineConnection)getConnectionFeedback(editPolicy);
- if(connectionFeedback != null) {
- if(canExecute) {
+ PolylineConnection connectionFeedback = (PolylineConnection) getConnectionFeedback(editPolicy);
+ if (connectionFeedback != null) {
+ if (canExecute) {
EllipseDecoration dec = new EllipseDecoration();
dec.setPreferredSize(10, 10);
dec.setSize(10, 10);
@@ -85,20 +85,20 @@ public class HighlightEditPolicy extends GraphicalEditPolicy {
}
}
}
- if(REQ_RECONNECT_SOURCE.equals(type) || SequenceUtil.OBSERVATION_LINK_REQUEST_RECONNECT_SOURCE.equals(type)) {
+ if (REQ_RECONNECT_SOURCE.equals(type) || SequenceUtil.OBSERVATION_LINK_REQUEST_RECONNECT_SOURCE.equals(type)) {
editPolicy = getHost().getEditPolicy(EditPolicy.CONNECTION_ENDPOINTS_ROLE);
- if(editPolicy != null) {
+ if (editPolicy != null) {
editPolicy.showSourceFeedback(request);
}
- ConnectionEditPart connection = ((ReconnectRequest)request).getConnectionEditPart();
- EditPart target = ((ReconnectRequest)request).getTarget();
+ ConnectionEditPart connection = ((ReconnectRequest) request).getConnectionEditPart();
+ EditPart target = ((ReconnectRequest) request).getTarget();
boolean highlight = target != null;
- if(target != null) {
+ if (target != null) {
Command command = target.getCommand(request);
highlight = command != null && command.canExecute();
}
- if(highlight) {
- Connection conn = (Connection)connection.getFigure();
+ if (highlight) {
+ Connection conn = (Connection) connection.getFigure();
PointList line = conn.getPoints().getCopy();
conn.translateToAbsolute(line);
IFigure sourceFeedback = getSourceIndicator();
@@ -106,21 +106,21 @@ public class HighlightEditPolicy extends GraphicalEditPolicy {
} else {
safeRemoveFeedback(sourceIndicator);
}
- } else if(REQ_RECONNECT_TARGET.equals(type) || SequenceUtil.OBSERVATION_LINK_REQUEST_RECONNECT_TARGET.equals(type)) {
+ } else if (REQ_RECONNECT_TARGET.equals(type) || SequenceUtil.OBSERVATION_LINK_REQUEST_RECONNECT_TARGET.equals(type)) {
editPolicy = getHost().getEditPolicy(EditPolicy.CONNECTION_ENDPOINTS_ROLE);
- if(editPolicy != null) {
+ if (editPolicy != null) {
editPolicy.showSourceFeedback(request);
}
- ReconnectRequest reconnectRequest = (ReconnectRequest)request;
+ ReconnectRequest reconnectRequest = (ReconnectRequest) request;
ConnectionEditPart connection = reconnectRequest.getConnectionEditPart();
EditPart target = reconnectRequest.getTarget();
boolean highlight = target != null;
- if(target != null) {
+ if (target != null) {
Command command = target.getCommand(reconnectRequest);
highlight = command != null && command.canExecute();
}
- if(highlight) {
- Connection conn = (Connection)connection.getFigure();
+ if (highlight) {
+ Connection conn = (Connection) connection.getFigure();
PointList line = conn.getPoints().getCopy();
conn.translateToAbsolute(line);
IFigure targetFeedback = getTargetIndicator();
@@ -135,26 +135,26 @@ public class HighlightEditPolicy extends GraphicalEditPolicy {
@Override
public void showTargetFeedback(Request request) {
EditPart host = getHost();
- if(request instanceof GroupRequest) {
- List editParts = ((GroupRequest)request).getEditParts();
- for(Object object : editParts) {
- highlight((EditPart)object);
+ if (request instanceof GroupRequest) {
+ List editParts = ((GroupRequest) request).getEditParts();
+ for (Object object : editParts) {
+ highlight((EditPart) object);
}
- } else if(request instanceof CreateConnectionRequest) {
- CreateConnectionRequest req = (CreateConnectionRequest)request;
+ } else if (request instanceof CreateConnectionRequest) {
+ CreateConnectionRequest req = (CreateConnectionRequest) request;
EditPart sourceEditPart = req.getSourceEditPart();
EditPart targetEditPart = req.getTargetEditPart();
highlight(sourceEditPart);
highlight(targetEditPart);
- } else if(request instanceof ReconnectRequest) {
- highlight(((ReconnectRequest)request).getTarget());
- highlight(((ReconnectRequest)request).getConnectionEditPart());
+ } else if (request instanceof ReconnectRequest) {
+ highlight(((ReconnectRequest) request).getTarget());
+ highlight(((ReconnectRequest) request).getConnectionEditPart());
// for message end
- if(host instanceof MessageEndEditPart) {
+ if (host instanceof MessageEndEditPart) {
highlightMessageEnd(request);
} else {
Object type = request.getType();
- if(host instanceof LifelineEditPart && (SequenceUtil.OBSERVATION_LINK_REQUEST_END).equals(type)) {
+ if (host instanceof LifelineEditPart && (SequenceUtil.OBSERVATION_LINK_REQUEST_END).equals(type)) {
highlightObservationEvent(request);
}
}
@@ -162,9 +162,9 @@ public class HighlightEditPolicy extends GraphicalEditPolicy {
highlight(host);
}
// for Duration Constraint and Time Constraint.
- if(isCreating(request, DURATION_CONSTRAINT_ON_LIFELINE_HINT) || isCreating(request, TIME_CONSTRAINT_ON_LIFELINE_HINT)) {
+ if (isCreating(request, DURATION_CONSTRAINT_ON_LIFELINE_HINT) || isCreating(request, TIME_CONSTRAINT_ON_LIFELINE_HINT)) {
Command command = getHost().getCommand(request);
- if(command != null && command.canExecute()) {
+ if (command != null && command.canExecute()) {
highlightEventsAboutConstraints(request);
}
}
@@ -192,11 +192,11 @@ public class HighlightEditPolicy extends GraphicalEditPolicy {
}
private Connection getConnectionFeedback(EditPolicy policy) {
- if(policy != null) {
+ if (policy != null) {
try {
Field f = GraphicalNodeEditPolicy.class.getDeclaredField("connectionFeedback");
f.setAccessible(true);
- return (Connection)f.get(policy);
+ return (Connection) f.get(policy);
} catch (Exception e) {
}
}
@@ -208,12 +208,12 @@ public class HighlightEditPolicy extends GraphicalEditPolicy {
*/
private void highlightMessageEnd(Request request) {
Point location = getConnectiveLocation(request);
- if(location == null) {
+ if (location == null) {
// not connection request.
return;
}
- MessageEndEditPart host = (MessageEndEditPart)getHost();
- ConnectionNodeEditPart parent = (ConnectionNodeEditPart)host.getParent();
+ MessageEndEditPart host = (MessageEndEditPart) getHost();
+ ConnectionNodeEditPart parent = (ConnectionNodeEditPart) host.getParent();
Point p = getNearestEndOfConnection(location, parent);
IFigure feedback = getSourceIndicator();
setFeedbackLocation(feedback, p);
@@ -225,14 +225,14 @@ public class HighlightEditPolicy extends GraphicalEditPolicy {
*/
private void highlightObservationEvent(Request request) {
Point location = getConnectiveLocation(request);
- Entry<Point, List<OccurrenceSpecification>> eventAndLocation = SequenceUtil.findNearestEvent(location, (LifelineEditPart)getHost());
+ Entry<Point, List<OccurrenceSpecification>> eventAndLocation = SequenceUtil.findNearestEvent(location, (LifelineEditPart) getHost());
OccurrenceSpecification event = null;
- if(eventAndLocation != null) {
+ if (eventAndLocation != null) {
List<OccurrenceSpecification> events = eventAndLocation.getValue();
- for(OccurrenceSpecification occurrence : events) {
- if(occurrence instanceof MessageOccurrenceSpecification) {
- Message mess = ((MessageOccurrenceSpecification)occurrence).getMessage();
- if(occurrence.equals(mess.getReceiveEvent()) && MessageSort.SYNCH_CALL_LITERAL.equals(mess.getMessageSort())) {
+ for (OccurrenceSpecification occurrence : events) {
+ if (occurrence instanceof MessageOccurrenceSpecification) {
+ Message mess = ((MessageOccurrenceSpecification) occurrence).getMessage();
+ if (occurrence.equals(mess.getReceiveEvent()) && MessageSort.SYNCH_CALL_LITERAL.equals(mess.getMessageSort())) {
continue;
}
}
@@ -240,7 +240,7 @@ public class HighlightEditPolicy extends GraphicalEditPolicy {
break;
}
}
- if(event != null) {
+ if (event != null) {
Point p = fixLocationOfEventOnLifeline(getHost(), event, location.getCopy());
IFigure feedback = getTargetIndicator();
setFeedbackLocation(feedback, p);
@@ -252,10 +252,10 @@ public class HighlightEditPolicy extends GraphicalEditPolicy {
*/
private Point getConnectiveLocation(Request request) {
Point location = null;
- if(request instanceof CreateConnectionRequest) {
- location = ((CreateConnectionRequest)request).getLocation();
- } else if(request instanceof ReconnectRequest) {
- location = ((ReconnectRequest)request).getLocation();
+ if (request instanceof CreateConnectionRequest) {
+ location = ((CreateConnectionRequest) request).getLocation();
+ } else if (request instanceof ReconnectRequest) {
+ location = ((ReconnectRequest) request).getLocation();
}
return location;
}
@@ -266,10 +266,10 @@ 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);
- if(locTop instanceof Point && topEvents != null && topEvents instanceof Collection<?> && !((Collection<?>)topEvents).isEmpty()) {
- Point referenceTop = ((Point)locTop).getCopy();
- OccurrenceSpecification event = (OccurrenceSpecification)((Collection<?>)topEvents).iterator().next();
- if(event instanceof MessageOccurrenceSpecification) {
+ if (locTop instanceof Point && topEvents != null && topEvents instanceof Collection<?> && !((Collection<?>) topEvents).isEmpty()) {
+ Point referenceTop = ((Point) locTop).getCopy();
+ OccurrenceSpecification event = (OccurrenceSpecification) ((Collection<?>) topEvents).iterator().next();
+ if (event instanceof MessageOccurrenceSpecification) {
referenceTop = fixLocationOfEventOnLifeline(null, event, referenceTop);
}
IFigure sourceIndicator = getSourceIndicator();
@@ -277,10 +277,10 @@ public class HighlightEditPolicy extends GraphicalEditPolicy {
}
Object bottomEvents = request.getExtendedData().get(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2);
Object locBottom = request.getExtendedData().get(SequenceRequestConstant.OCCURRENCE_SPECIFICATION_LOCATION_2);
- if(locBottom instanceof Point && bottomEvents != null && bottomEvents instanceof Collection<?> && !((Collection<?>)bottomEvents).isEmpty()) {
- Point referenceBottom = ((Point)locBottom).getCopy();
- OccurrenceSpecification event = (OccurrenceSpecification)((Collection<?>)bottomEvents).iterator().next();
- if(event instanceof MessageOccurrenceSpecification) {
+ if (locBottom instanceof Point && bottomEvents != null && bottomEvents instanceof Collection<?> && !((Collection<?>) bottomEvents).isEmpty()) {
+ Point referenceBottom = ((Point) locBottom).getCopy();
+ OccurrenceSpecification event = (OccurrenceSpecification) ((Collection<?>) bottomEvents).iterator().next();
+ if (event instanceof MessageOccurrenceSpecification) {
referenceBottom = fixLocationOfEventOnLifeline(null, event, referenceBottom);
}
IFigure targetIndicator = getTargetIndicator();
@@ -289,19 +289,19 @@ public class HighlightEditPolicy extends GraphicalEditPolicy {
}
private Point fixLocationOfEventOnLifeline(EditPart lifeline, OccurrenceSpecification event, Point location) {
- if(lifeline == null) {
+ if (lifeline == null) {
lifeline = findLifelineAt(location);
}
- if(lifeline == null) {
+ if (lifeline == null) {
return location;
}
- Point loc = SequenceUtil.findLocationOfEvent((LifelineEditPart)lifeline, event);
- if(loc != null) {
+ Point loc = SequenceUtil.findLocationOfEvent((LifelineEditPart) lifeline, event);
+ if (loc != null) {
return loc;
}
EditPart linkedEditPart = SequenceUtil.getLinkedEditPart(lifeline, event);
- if(linkedEditPart instanceof ConnectionNodeEditPart) {
- ConnectionNodeEditPart connection = ((ConnectionNodeEditPart)linkedEditPart);
+ if (linkedEditPart instanceof ConnectionNodeEditPart) {
+ ConnectionNodeEditPart connection = ((ConnectionNodeEditPart) linkedEditPart);
return getNearestEndOfConnection(location, connection);
}
return location;
@@ -309,12 +309,12 @@ public class HighlightEditPolicy extends GraphicalEditPolicy {
private Point getNearestEndOfConnection(Point location, ConnectionNodeEditPart connection) {
Connection msgFigure = connection.getConnectionFigure();
- if(msgFigure instanceof AbstractPointListShape) {
- Point start = ((AbstractPointListShape)msgFigure).getStart().getCopy();
+ if (msgFigure instanceof AbstractPointListShape) {
+ Point start = ((AbstractPointListShape) msgFigure).getStart().getCopy();
msgFigure.translateToAbsolute(start);
- Point end = ((AbstractPointListShape)msgFigure).getEnd().getCopy();
+ Point end = ((AbstractPointListShape) msgFigure).getEnd().getCopy();
msgFigure.translateToAbsolute(end);
- if(location.getDistance(start) < location.getDistance(end)) {
+ if (location.getDistance(start) < location.getDistance(end)) {
return start;
} else {
return end;
@@ -324,7 +324,7 @@ public class HighlightEditPolicy extends GraphicalEditPolicy {
}
private boolean isCreating(Request request, String sementicHint) {
- if(request == null || sementicHint == null) {
+ if (request == null || sementicHint == null) {
return false;
}
String hint = getSementicHint(request);
@@ -337,13 +337,13 @@ public class HighlightEditPolicy extends GraphicalEditPolicy {
*/
private String getSementicHint(Request request) {
String hint = null;
- if(request instanceof CreateViewRequest) {
- ViewDescriptor viewDesc = ((CreateViewRequest)request).getViewDescriptors().iterator().next();
+ if (request instanceof CreateViewRequest) {
+ ViewDescriptor viewDesc = ((CreateViewRequest) request).getViewDescriptors().iterator().next();
hint = viewDesc.getSemanticHint();
- } else if(request instanceof CreateUnspecifiedTypeRequest) {
- Object elementType = ((CreateUnspecifiedTypeRequest)request).getElementTypes().iterator().next();
- if(elementType instanceof IHintedType) {
- hint = ((IHintedType)elementType).getSemanticHint();
+ } else if (request instanceof CreateUnspecifiedTypeRequest) {
+ Object elementType = ((CreateUnspecifiedTypeRequest) request).getElementTypes().iterator().next();
+ if (elementType instanceof IHintedType) {
+ hint = ((IHintedType) elementType).getSemanticHint();
}
}
return hint;
@@ -352,15 +352,15 @@ public class HighlightEditPolicy extends GraphicalEditPolicy {
@SuppressWarnings("rawtypes")
private EditPart findLifelineAt(Point pt) {
Collection values = getHost().getViewer().getEditPartRegistry().values();
- for(Object object : values) {
- if(!(object instanceof LifelineEditPart)) {
+ for (Object object : values) {
+ if (!(object instanceof LifelineEditPart)) {
continue;
}
- LifelineEditPart lifeline = ((LifelineEditPart)object);
+ LifelineEditPart lifeline = ((LifelineEditPart) object);
LifelineFigure primaryShape = lifeline.getPrimaryShape();
Point p = pt.getCopy();
primaryShape.translateToRelative(p);
- if(primaryShape.containsPoint(p)) {
+ if (primaryShape.containsPoint(p)) {
return lifeline;
}
}
@@ -368,14 +368,14 @@ public class HighlightEditPolicy extends GraphicalEditPolicy {
}
protected Indicator getSourceIndicator() {
- if(sourceIndicator == null || sourceIndicator.getParent() == null) {
+ if (sourceIndicator == null || sourceIndicator.getParent() == null) {
sourceIndicator = createCircleFeedback();
}
return sourceIndicator;
}
protected Indicator getTargetIndicator() {
- if(targetIndicator == null || targetIndicator.getParent() == null) {
+ if (targetIndicator == null || targetIndicator.getParent() == null) {
targetIndicator = createCircleFeedback();
}
return targetIndicator;
@@ -388,7 +388,7 @@ public class HighlightEditPolicy extends GraphicalEditPolicy {
}
protected void setFeedbackLocation(IFigure feedback, Point location) {
- if(feedback == null || location == null) {
+ if (feedback == null || location == null) {
return;
}
Point p = location.getCopy();
@@ -400,7 +400,7 @@ public class HighlightEditPolicy extends GraphicalEditPolicy {
}
private void safeRemoveFeedback(IFigure feedback) {
- if(feedback == null || feedback.getParent() == null) {
+ if (feedback == null || feedback.getParent() == null) {
return;
}
feedback.getParent().remove(feedback);
@@ -428,7 +428,7 @@ public class HighlightEditPolicy extends GraphicalEditPolicy {
/**
* Constructor.
- *
+ *
*/
public Indicator() {
setLineWidth(2);
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 15cb14b5563..b8ec1bccada 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -100,14 +100,14 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
@Override
protected Command getCreateCommand(CreateRequest request) {
- CreateViewRequest req = (CreateViewRequest)request;
+ CreateViewRequest req = (CreateViewRequest) request;
Command cmd = super.getCreateCommand(request);
- if(cmd != null && req.getSize() != null) { // create lifeline with specific size
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ if (cmd != null && req.getSize() != null) { // create lifeline with specific size
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
Iterator iter = req.getViewDescriptors().iterator();
- while(iter.hasNext()) {
- CreateViewRequest.ViewDescriptor viewDescriptor = (CreateViewRequest.ViewDescriptor)iter.next();
- if(((IHintedType)UMLElementTypes.Lifeline_3001).getSemanticHint().equals(viewDescriptor.getSemanticHint())) {
+ while (iter.hasNext()) {
+ CreateViewRequest.ViewDescriptor viewDescriptor = (CreateViewRequest.ViewDescriptor) iter.next();
+ if (((IHintedType) UMLElementTypes.Lifeline_3001).getSemanticHint().equals(viewDescriptor.getSemanticHint())) {
cmd = (new ICommandProxy(LifelineResizeHelper.createManualLabelSizeCommand(editingDomain, viewDescriptor))).chain(cmd);
}
}
@@ -124,63 +124,63 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
compoundCmd.setLabel("Move or Resize");
IFigure figure = getHostFigure();
Rectangle hostBounds = figure.getBounds();
- for(Object o : request.getEditParts()) {
- GraphicalEditPart child = (GraphicalEditPart)o;
+ for (Object o : request.getEditParts()) {
+ GraphicalEditPart child = (GraphicalEditPart) o;
Object constraintFor = getConstraintFor(request, child);
- if(constraintFor instanceof Rectangle) {
- Rectangle childBounds = (Rectangle)constraintFor;
- if(childBounds.x < 0 || childBounds.y < 0) {
+ if (constraintFor instanceof Rectangle) {
+ Rectangle childBounds = (Rectangle) constraintFor;
+ if (childBounds.x < 0 || childBounds.y < 0) {
return UnexecutableCommand.INSTANCE;
}
- if(child instanceof LifelineEditPart) {
- if(isVerticalMove(request)) {
- addLifelineResizeChildrenCommand(compoundCmd, request, (LifelineEditPart)child, 1);
+ if (child instanceof LifelineEditPart) {
+ if (isVerticalMove(request)) {
+ addLifelineResizeChildrenCommand(compoundCmd, request, (LifelineEditPart) child, 1);
}
- } else if(child instanceof CombinedFragmentEditPart) {
+ } else if (child instanceof CombinedFragmentEditPart) {
// Add restrictions to change the size
- if(!OperandBoundsComputeHelper.checkRedistrictOnCFResize(request, child)) {
+ if (!OperandBoundsComputeHelper.checkRedistrictOnCFResize(request, child)) {
return null;
}
- Command resizeChildrenCommand = getCombinedFragmentResizeChildrenCommand(request, (CombinedFragmentEditPart)child);
- if(resizeChildrenCommand != null && resizeChildrenCommand.canExecute()) {
+ Command resizeChildrenCommand = getCombinedFragmentResizeChildrenCommand(request, (CombinedFragmentEditPart) child);
+ if (resizeChildrenCommand != null && resizeChildrenCommand.canExecute()) {
compoundCmd.add(resizeChildrenCommand);
}
- // else if(resizeChildrenCommand != null) {
- // return UnexecutableCommand.INSTANCE;
- // }
+ // else if(resizeChildrenCommand != null) {
+ // return UnexecutableCommand.INSTANCE;
+ // }
}
boolean hasCreateLink = LifelineMessageCreateHelper.hasIncomingMessageCreate(child);
- if(hasCreateLink && !LifelineMessageCreateHelper.canMoveLifelineVertical((LifelineEditPart)child, (Rectangle)translateToModelConstraint(constraintFor))) {
+ if (hasCreateLink && !LifelineMessageCreateHelper.canMoveLifelineVertical((LifelineEditPart) child, (Rectangle) translateToModelConstraint(constraintFor))) {
return UnexecutableCommand.INSTANCE;
}
- if(!(child instanceof LifelineEditPart) || isVerticalMove(request) || hasCreateLink) {
+ if (!(child instanceof LifelineEditPart) || isVerticalMove(request) || hasCreateLink) {
Command changeConstraintCommand = createChangeConstraintCommand(request, child, translateToModelConstraint(constraintFor));
- // When we change the width by mouse, it passe to manual mode. see https://bugs.eclipse.org/bugs/show_bug.cgi?id=383723
- if(child instanceof LifelineEditPart && changeConstraintCommand != null && request.getSizeDelta().width != 0) {
- compoundCmd.add(new ICommandProxy(LifelineResizeHelper.createManualLabelSizeCommand((LifelineEditPart)child)));
+ // When we change the width by mouse, it passe to manual mode. see https://bugs.eclipse.org/bugs/show_bug.cgi?id=383723
+ if (child instanceof LifelineEditPart && changeConstraintCommand != null && request.getSizeDelta().width != 0) {
+ compoundCmd.add(new ICommandProxy(LifelineResizeHelper.createManualLabelSizeCommand((LifelineEditPart) child)));
}
compoundCmd.add(changeConstraintCommand);
}
- if(child instanceof CombinedFragmentEditPart) {
- OperandBoundsComputeHelper.createUpdateIOBoundsForCFResizeCommand(compoundCmd, request, (CombinedFragmentEditPart)child);
+ if (child instanceof CombinedFragmentEditPart) {
+ OperandBoundsComputeHelper.createUpdateIOBoundsForCFResizeCommand(compoundCmd, request, (CombinedFragmentEditPart) child);
}
int right = childBounds.right();
int bottom = childBounds.bottom();
int deltaX = 0;
int deltaY = 0;
- if(right > hostBounds.width) {
+ if (right > hostBounds.width) {
deltaX = right - hostBounds.width;
}
- if(bottom > hostBounds.height) {
+ if (bottom > hostBounds.height) {
deltaY = bottom - hostBounds.height;
}
- if(deltaX != 0 || deltaY != 0) {
- ChangeBoundsRequest boundsRequest = new ChangeBoundsRequest(RequestConstants.REQ_RESIZE);
+ if (deltaX != 0 || deltaY != 0) {
+ ChangeBoundsRequest boundsRequest = new ChangeBoundsRequest(org.eclipse.gef.RequestConstants.REQ_RESIZE);
boundsRequest.setSizeDelta(new Dimension(deltaX, deltaY));
EditPart hostParent = getHost().getParent();
boundsRequest.setEditParts(hostParent);
Command cmd = hostParent.getCommand(boundsRequest);
- if(cmd != null && cmd.canExecute()) {
+ if (cmd != null && cmd.canExecute()) {
compoundCmd.add(cmd);
}
}
@@ -190,9 +190,9 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
}
protected boolean isVerticalMove(ChangeBoundsRequest request) {
- if(request instanceof AlignmentRequest) {
- AlignmentRequest alignmentRequest = (AlignmentRequest)request;
- switch(alignmentRequest.getAlignment()) {
+ if (request instanceof AlignmentRequest) {
+ AlignmentRequest alignmentRequest = (AlignmentRequest) request;
+ switch (alignmentRequest.getAlignment()) {
case PositionConstants.BOTTOM:
case PositionConstants.TOP:
case PositionConstants.MIDDLE:
@@ -210,30 +210,30 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
/**
* Resize children of LifelineEditPart (Execution specification and lifeline)
- *
+ *
* @param compoundCmd
- * The command
+ * The command
* @param request
- * The request
+ * The request
* @param lifelineEditPart
- * The lifelineEditPart to resize
+ * The lifelineEditPart to resize
* @param number
- * The number of brother of the LifelineEditPart
+ * The number of brother of the LifelineEditPart
*/
public static void addLifelineResizeChildrenCommand(CompoundCommand compoundCmd, ChangeBoundsRequest request, LifelineEditPart lifelineEditPart, int number) {
// If the width increases or decreases, ExecutionSpecification elements need to
// be moved
int widthDelta;
- for(ShapeNodeEditPart executionSpecificationEP : LifelineEditPartUtil.getChildShapeNodeEditPart(lifelineEditPart)) {
- if(executionSpecificationEP.resolveSemanticElement() instanceof ExecutionSpecification) {
+ for (ShapeNodeEditPart executionSpecificationEP : LifelineEditPartUtil.getChildShapeNodeEditPart(lifelineEditPart)) {
+ if (executionSpecificationEP.resolveSemanticElement() instanceof ExecutionSpecification) {
// Lifeline's figure where the child is drawn
Rectangle rDotLine = lifelineEditPart.getContentPane().getBounds();
Rectangle figureBounds = executionSpecificationEP.getFigure().getBounds();
Rectangle newBounds = null;
View view = executionSpecificationEP.getNotationView();
- //Perfect to use the model.
- if(view instanceof Shape && ((Shape)view).getLayoutConstraint() instanceof Bounds) {
- Bounds bounds = (Bounds)((Shape)view).getLayoutConstraint();
+ // Perfect to use the model.
+ if (view instanceof Shape && ((Shape) view).getLayoutConstraint() instanceof Bounds) {
+ Bounds bounds = (Bounds) ((Shape) view).getLayoutConstraint();
newBounds = new Rectangle(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight());
} else {
// The new bounds will be calculated from the current bounds
@@ -243,12 +243,12 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
newBounds.y -= rDotLine.y;
}
widthDelta = request.getSizeDelta().width;
- if(widthDelta != 0) {
- if(rDotLine.getSize().width + widthDelta < newBounds.width * 2) {
+ if (widthDelta != 0) {
+ if (rDotLine.getSize().width + widthDelta < newBounds.width * 2) {
compoundCmd.add(UnexecutableCommand.INSTANCE);
}
// Apply SizeDelta to the children
- widthDelta = Math.round(widthDelta / ((float)2 * number));
+ widthDelta = Math.round(widthDelta / ((float) 2 * number));
newBounds.x += widthDelta;
SetBoundsCommand setBoundsCmd = new SetBoundsCommand(executionSpecificationEP.getEditingDomain(), "Re-location of a ExecutionSpecification due to a Lifeline movement", executionSpecificationEP, newBounds);
compoundCmd.add(new ICommandProxy(setBoundsCmd));
@@ -257,10 +257,10 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
compoundCmd.add(SequenceUtil.createUpdateEnclosingInteractionCommand(executionSpecificationEP, request.getMoveDelta(), new Dimension(widthDelta, 0)));
}
}
- // List<LifelineEditPart> innerConnectableElementList = lifelineEditPart.getInnerConnectableElementList();
- // for(LifelineEditPart lifelineEP : innerConnectableElementList) {
- // addLifelineResizeChildrenCommand(compoundCmd, request, lifelineEP, number * innerConnectableElementList.size());
- // }
+ // List<LifelineEditPart> innerConnectableElementList = lifelineEditPart.getInnerConnectableElementList();
+ // for(LifelineEditPart lifelineEP : innerConnectableElementList) {
+ // addLifelineResizeChildrenCommand(compoundCmd, request, lifelineEP, number * innerConnectableElementList.size());
+ // }
// fixed bug (id=364711) when lifeline bounds changed update coveredBys'
// bounds.
addUpdateInteractionFragmentsLocationCommand(compoundCmd, request, lifelineEditPart);
@@ -269,7 +269,7 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
/**
* Resize InteractionFragments if the Lifeline has CoveredBys, while
* Lifeline moving.
- *
+ *
* @param compoundCmd
* @param request
* @param lifelineEditPart
@@ -277,76 +277,76 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
private static void addUpdateInteractionFragmentsLocationCommand(CompoundCommand compoundCmd, ChangeBoundsRequest request, LifelineEditPart lifelineEditPart) {
// Fixed bug about resize lifeline corvered by some combined fragments. If the moveDelta is empty, ignore this? otherwise the children of lifeline would be moved again to wrong place.
Point moveDelta = request.getMoveDelta();
- if(moveDelta.x == 0 && moveDelta.y == 0) {
+ if (moveDelta.x == 0 && moveDelta.y == 0) {
return;
}
- // //There are some bugs about moving InteractionFragment when moving Lifelines.
- // Rectangle rect = lifelineEditPart.getFigure().getBounds().getCopy();
- // lifelineEditPart.getFigure().translateToAbsolute(rect);
- // rect = request.getTransformedRectangle(rect);
- // View shape = (View)lifelineEditPart.getModel();
- // Lifeline element = (Lifeline)shape.getElement();
- // EList<InteractionFragment> covereds = element.getCoveredBys();
- // EditPart parent = lifelineEditPart.getParent();
- // List<?> children = parent.getChildren();
- // for(Object obj : children) {
- // EditPart et = (EditPart)obj;
- // View sp = (View)et.getModel();
- // if(!covereds.contains(sp.getElement())) {
- // continue;
- // }
- // Rectangle bounds = ((GraphicalEditPart)et).getFigure().getBounds().getCopy();
- // ((GraphicalEditPart)et).getFigure().translateToAbsolute(bounds);
- // if(bounds.x + 20 < rect.x && bounds.right() - 20 > rect.right()) {
- // continue;
- // } else {
- // Dimension resizeInfo = new Dimension(0, 0);
- // Point moveInfo = new Point();
- // if(bounds.x + 20 > rect.x) {
- // moveInfo.x = rect.x - 20 - bounds.x;
- // resizeInfo.width = -moveInfo.x;
- // } else if(bounds.right() - 20 < rect.right()) {
- // resizeInfo.width = rect.right() + 20 - bounds.right();
- // }
- // if(resizeInfo.width == 0 && moveInfo.x == 0) {
- // continue;
- // }
- // ChangeBoundsRequest req = new ChangeBoundsRequest(REQ_RESIZE);
- // req.setEditParts(et);
- // req.setResizeDirection(PositionConstants.EAST);
- // req.setSizeDelta(resizeInfo);
- // req.setMoveDelta(moveInfo);
- // Command command = et.getCommand(req);
- // if(command != null && command.canExecute()) {
- // compoundCmd.add(command);
- // }
- // }
- // }
- //See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=364711
- View shape = (View)lifelineEditPart.getModel();
- Lifeline element = (Lifeline)shape.getElement();
+ // //There are some bugs about moving InteractionFragment when moving Lifelines.
+ // Rectangle rect = lifelineEditPart.getFigure().getBounds().getCopy();
+ // lifelineEditPart.getFigure().translateToAbsolute(rect);
+ // rect = request.getTransformedRectangle(rect);
+ // View shape = (View)lifelineEditPart.getModel();
+ // Lifeline element = (Lifeline)shape.getElement();
+ // EList<InteractionFragment> covereds = element.getCoveredBys();
+ // EditPart parent = lifelineEditPart.getParent();
+ // List<?> children = parent.getChildren();
+ // for(Object obj : children) {
+ // EditPart et = (EditPart)obj;
+ // View sp = (View)et.getModel();
+ // if(!covereds.contains(sp.getElement())) {
+ // continue;
+ // }
+ // Rectangle bounds = ((GraphicalEditPart)et).getFigure().getBounds().getCopy();
+ // ((GraphicalEditPart)et).getFigure().translateToAbsolute(bounds);
+ // if(bounds.x + 20 < rect.x && bounds.right() - 20 > rect.right()) {
+ // continue;
+ // } else {
+ // Dimension resizeInfo = new Dimension(0, 0);
+ // Point moveInfo = new Point();
+ // if(bounds.x + 20 > rect.x) {
+ // moveInfo.x = rect.x - 20 - bounds.x;
+ // resizeInfo.width = -moveInfo.x;
+ // } else if(bounds.right() - 20 < rect.right()) {
+ // resizeInfo.width = rect.right() + 20 - bounds.right();
+ // }
+ // if(resizeInfo.width == 0 && moveInfo.x == 0) {
+ // continue;
+ // }
+ // ChangeBoundsRequest req = new ChangeBoundsRequest(REQ_RESIZE);
+ // req.setEditParts(et);
+ // req.setResizeDirection(PositionConstants.EAST);
+ // req.setSizeDelta(resizeInfo);
+ // req.setMoveDelta(moveInfo);
+ // Command command = et.getCommand(req);
+ // if(command != null && command.canExecute()) {
+ // compoundCmd.add(command);
+ // }
+ // }
+ // }
+ // See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=364711
+ View shape = (View) lifelineEditPart.getModel();
+ Lifeline element = (Lifeline) shape.getElement();
EList<InteractionFragment> covereds = element.getCoveredBys();
EditPart parent = lifelineEditPart.getParent();
List<?> children = parent.getChildren();
Rectangle bounds = lifelineEditPart.getFigure().getBounds().getCopy();
bounds.translate(moveDelta);
Point center = bounds.getCenter();
- for(Object obj : children) {
- EditPart et = (EditPart)obj;
- View sp = (View)et.getModel();
- if(!covereds.contains(sp.getElement())) {
+ for (Object obj : children) {
+ EditPart et = (EditPart) obj;
+ View sp = (View) et.getModel();
+ if (!covereds.contains(sp.getElement())) {
continue;
}
- //If the center vertical line is covered by the CombibedFragment, do NOT move the CF again.
- Rectangle rect = ((GraphicalEditPart)et).getFigure().getBounds();
- if(rect.x < center.x && rect.right() > center.x) {
+ // If the center vertical line is covered by the CombibedFragment, do NOT move the CF again.
+ Rectangle rect = ((GraphicalEditPart) et).getFigure().getBounds();
+ if (rect.x < center.x && rect.right() > center.x) {
continue;
}
ChangeBoundsRequest req = new ChangeBoundsRequest(REQ_MOVE);
req.setEditParts(et);
req.setMoveDelta(request.getMoveDelta());
Command command = et.getCommand(req);
- if(command != null && command.canExecute()) {
+ if (command != null && command.canExecute()) {
compoundCmd.add(command);
}
}
@@ -354,15 +354,15 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
/**
* Handle the owning of interaction fragments when moving or resizing a CF.
- *
+ *
* @param compoundCmd
- * The command
+ * The command
* @param moveDelta
- * The move delta (given by the request).
+ * The move delta (given by the request).
* @param sizeDelta
- * The size delta (given by the request).
+ * The size delta (given by the request).
* @param combinedFragmentEditPart
- * The CF edit part.
+ * The CF edit part.
*/
@SuppressWarnings("unchecked")
public static Command getCombinedFragmentResizeChildrenCommand(ChangeBoundsRequest request, CombinedFragmentEditPart combinedFragmentEditPart) {
@@ -375,30 +375,30 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
CompoundCommand compoundCmd = new CompoundCommand();
// specific case for move :
// we want the execution specifications graphically owned by the lifeline to move with the combined fragment, and the contained messages too
- if(sizeDelta.equals(0, 0)) {
+ if (sizeDelta.equals(0, 0)) {
// retrieve all the edit parts in the registry
Set<Entry<Object, EditPart>> allEditPartEntries = combinedFragmentEditPart.getViewer().getEditPartRegistry().entrySet();
- for(Entry<Object, EditPart> epEntry : allEditPartEntries) {
+ for (Entry<Object, EditPart> epEntry : allEditPartEntries) {
EditPart ep = epEntry.getValue();
// handle move of object graphically owned by the lifeline
- if(ep instanceof ShapeEditPart) {
- ShapeEditPart sep = (ShapeEditPart)ep;
+ if (ep instanceof ShapeEditPart) {
+ ShapeEditPart sep = (ShapeEditPart) ep;
EObject elem = sep.getNotationView().getElement();
- if(elem instanceof InteractionFragment) {
+ if (elem instanceof InteractionFragment) {
IFigure figure = sep.getFigure();
Rectangle figureBounds = figure.getBounds().getCopy();
figure.getParent().translateToAbsolute(figureBounds);
- if(origCFBounds.contains(figureBounds)) {
+ if (origCFBounds.contains(figureBounds)) {
EditPart parentEP = sep.getParent();
- if(parentEP instanceof LifelineEditPart) {
- ChangeBoundsRequest esRequest = new ChangeBoundsRequest(RequestConstants.REQ_MOVE);
+ if (parentEP instanceof LifelineEditPart) {
+ 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);
- if(moveESCommand != null && !moveESCommand.canExecute()) {
+ Command moveESCommand = LifelineXYLayoutEditPolicy.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;
- } else if(moveESCommand != null) {
+ } else if (moveESCommand != null) {
compoundCmd.add(moveESCommand);
}
}
@@ -406,27 +406,27 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
}
}
// handle move of messages directly attached to a lifeline
- if(ep instanceof ConnectionEditPart) {
- ConnectionEditPart cep = (ConnectionEditPart)ep;
+ if (ep instanceof ConnectionEditPart) {
+ ConnectionEditPart cep = (ConnectionEditPart) ep;
Connection msgFigure = cep.getConnectionFigure();
ConnectionAnchor sourceAnchor = msgFigure.getSourceAnchor();
ConnectionAnchor targetAnchor = msgFigure.getTargetAnchor();
Point sourcePoint = sourceAnchor.getReferencePoint();
Point targetPoint = targetAnchor.getReferencePoint();
- Edge edge = (Edge)cep.getModel();
- if(origCFBounds.contains(sourcePoint) && cep.getSource() instanceof LifelineEditPart) {
- IdentityAnchor gmfAnchor = (IdentityAnchor)edge.getSourceAnchor();
+ Edge edge = (Edge) cep.getModel();
+ if (origCFBounds.contains(sourcePoint) && cep.getSource() instanceof LifelineEditPart) {
+ IdentityAnchor gmfAnchor = (IdentityAnchor) edge.getSourceAnchor();
Rectangle figureBounds = sourceAnchor.getOwner().getBounds();
compoundCmd.add(new ICommandProxy(getMoveAnchorCommand(moveDelta.y, figureBounds, gmfAnchor)));
}
- if(origCFBounds.contains(targetPoint) && cep.getTarget() instanceof LifelineEditPart) {
- IdentityAnchor gmfAnchor = (IdentityAnchor)edge.getTargetAnchor();
+ if (origCFBounds.contains(targetPoint) && cep.getTarget() instanceof LifelineEditPart) {
+ IdentityAnchor gmfAnchor = (IdentityAnchor) edge.getTargetAnchor();
Rectangle figureBounds = targetAnchor.getOwner().getBounds();
compoundCmd.add(new ICommandProxy(getMoveAnchorCommand(moveDelta.y, figureBounds, gmfAnchor)));
}
}
- if(ep instanceof DurationConstraintEditPart) {
- DurationConstraintEditPart dcp = (DurationConstraintEditPart)ep;
+ if (ep instanceof DurationConstraintEditPart) {
+ DurationConstraintEditPart dcp = (DurationConstraintEditPart) ep;
moveCoveredDurationConstraint(dcp, compoundCmd, origCFBounds, moveDelta);
}
}
@@ -435,24 +435,24 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
Rectangle newBoundsCF = origCFBounds.getCopy();
newBoundsCF.translate(moveDelta);
newBoundsCF.resize(sizeDelta);
- CombinedFragment cf = (CombinedFragment)combinedFragmentEditPart.resolveSemanticElement();
- if(combinedFragmentEditPart.getChildren().size() > 0 && combinedFragmentEditPart.getChildren().get(0) instanceof CombinedFragmentCombinedFragmentCompartmentEditPart) {
- CombinedFragmentCombinedFragmentCompartmentEditPart compartment = (CombinedFragmentCombinedFragmentCompartmentEditPart)combinedFragmentEditPart.getChildren().get(0);
+ CombinedFragment cf = (CombinedFragment) combinedFragmentEditPart.resolveSemanticElement();
+ if (combinedFragmentEditPart.getChildren().size() > 0 && combinedFragmentEditPart.getChildren().get(0) instanceof CombinedFragmentCombinedFragmentCompartmentEditPart) {
+ CombinedFragmentCombinedFragmentCompartmentEditPart compartment = (CombinedFragmentCombinedFragmentCompartmentEditPart) combinedFragmentEditPart.getChildren().get(0);
List<EditPart> combinedFragmentChildrenEditParts = compartment.getChildren();
List<InteractionOperandEditPart> interactionOperandEditParts = new ArrayList<InteractionOperandEditPart>();
InteractionOperand firstOperand = cf.getOperands().get(0);
// interaction fragments which will not be covered by the operands
Set<InteractionFragment> notCoveredAnymoreInteractionFragments = new HashSet<InteractionFragment>();
int headerHeight = 0;
- for(EditPart ep : combinedFragmentChildrenEditParts) {
- if(ep instanceof InteractionOperandEditPart) {
- InteractionOperandEditPart ioEP = (InteractionOperandEditPart)ep;
- InteractionOperand io = (InteractionOperand)ioEP.resolveSemanticElement();
- if(cf.getOperands().contains(io)) {
+ for (EditPart ep : combinedFragmentChildrenEditParts) {
+ if (ep instanceof InteractionOperandEditPart) {
+ InteractionOperandEditPart ioEP = (InteractionOperandEditPart) ep;
+ InteractionOperand io = (InteractionOperand) ioEP.resolveSemanticElement();
+ if (cf.getOperands().contains(io)) {
interactionOperandEditParts.add(ioEP);
// fill with all current fragments (filter later)
notCoveredAnymoreInteractionFragments.addAll(io.getFragments());
- if(firstOperand.equals(io)) {
+ if (firstOperand.equals(io)) {
Rectangle boundsIO = ioEP.getFigure().getBounds().getCopy();
ioEP.getFigure().getParent().translateToAbsolute(boundsIO);
headerHeight = boundsIO.y - origCFBounds.y;
@@ -460,18 +460,18 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
}
}
}
- double heightRatio = (double)(newBoundsCF.height - headerHeight) / (double)(origCFBounds.height - headerHeight);
- double widthRatio = (double)newBoundsCF.width / (double)origCFBounds.width;
- for(InteractionOperandEditPart ioEP : interactionOperandEditParts) {
- InteractionOperand io = (InteractionOperand)ioEP.resolveSemanticElement();
+ double heightRatio = (double) (newBoundsCF.height - headerHeight) / (double) (origCFBounds.height - headerHeight);
+ double widthRatio = (double) newBoundsCF.width / (double) origCFBounds.width;
+ for (InteractionOperandEditPart ioEP : interactionOperandEditParts) {
+ InteractionOperand io = (InteractionOperand) ioEP.resolveSemanticElement();
Rectangle newBoundsIO = SequenceUtil.getAbsoluteBounds(ioEP);
// apply the move delta which will impact all operands
newBoundsIO.translate(moveDelta);
// calculate the new bounds of the interaction operand
// scale according to the ratio
- newBoundsIO.height = (int)(newBoundsIO.height * heightRatio);
- newBoundsIO.width = (int)(newBoundsIO.width * widthRatio);
- if(firstOperand.equals(io)) {
+ newBoundsIO.height = (int) (newBoundsIO.height * heightRatio);
+ newBoundsIO.width = (int) (newBoundsIO.width * widthRatio);
+ if (firstOperand.equals(io)) {
// used to compensate the height of the "header" where the OperandKind is stored
newBoundsIO.y -= headerHeight;
newBoundsIO.height += headerHeight;
@@ -481,7 +481,7 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
ignoreSet.add(cf);
ignoreSet.addAll(cf.getOperands());
Set<InteractionFragment> coveredInteractionFragments = SequenceUtil.getCoveredInteractionFragments(newBoundsIO, combinedFragmentEditPart, ignoreSet);
- if(coveredInteractionFragments == null) {
+ if (coveredInteractionFragments == null) {
return UnexecutableCommand.INSTANCE;
}
// remove fragments that are covered by this operand from the notCovered set
@@ -489,18 +489,18 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
// set the enclosing operand to the moved/resized one if the current enclosing interaction is the enclosing interaction
// of the moved/resized operand or of another.
// => the interaction fragment that are inside an other container (like an enclosed CF) are not modified
- for(InteractionFragment ift : coveredInteractionFragments) {
- if(!cf.equals(ift)) {
+ for (InteractionFragment ift : coveredInteractionFragments) {
+ if (!cf.equals(ift)) {
Interaction interactionOwner = ift.getEnclosingInteraction();
InteractionOperand ioOwner = ift.getEnclosingOperand();
- if((ioOwner != null && (ioOwner.equals(cf.getEnclosingOperand()) || cf.equals(ioOwner.getOwner()))) || (interactionOwner != null && (interactionOwner.equals(cf.getEnclosingInteraction()) || cf.equals(interactionOwner.getOwner())))) {
+ if ((ioOwner != null && (ioOwner.equals(cf.getEnclosingOperand()) || cf.equals(ioOwner.getOwner()))) || (interactionOwner != null && (interactionOwner.equals(cf.getEnclosingInteraction()) || cf.equals(interactionOwner.getOwner())))) {
compoundCmd.add(new ICommandProxy(SequenceUtil.getSetEnclosingInteractionCommand(ioEP.getEditingDomain(), ift, io)));
}
}
}
}
- for(InteractionFragment ift : notCoveredAnymoreInteractionFragments) {
- if(cf.getEnclosingOperand() != null) {
+ for (InteractionFragment ift : notCoveredAnymoreInteractionFragments) {
+ if (cf.getEnclosingOperand() != null) {
compoundCmd.add(new ICommandProxy(SequenceUtil.getSetEnclosingInteractionCommand(combinedFragmentEditPart.getEditingDomain(), ift, cf.getEnclosingOperand())));
} else {
compoundCmd.add(new ICommandProxy(SequenceUtil.getSetEnclosingInteractionCommand(combinedFragmentEditPart.getEditingDomain(), ift, cf.getEnclosingInteraction())));
@@ -510,30 +510,30 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
}
// Print a user notification when we are not sure the command is appropriated
// Fixed bug: remove the notify dialog, see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=402977
- // EObject combinedFragment = combinedFragmentEditPart.resolveSemanticElement();
- // if(combinedFragment instanceof CombinedFragment && !sizeDelta.equals(0, 0)) {
- // if(((CombinedFragment)combinedFragment).getOperands().size() > 1) {
- // // append a command which notifies
- // Command notifyCmd = new Command() {
+ // EObject combinedFragment = combinedFragmentEditPart.resolveSemanticElement();
+ // if(combinedFragment instanceof CombinedFragment && !sizeDelta.equals(0, 0)) {
+ // if(((CombinedFragment)combinedFragment).getOperands().size() > 1) {
+ // // append a command which notifies
+ // 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 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()) {
- // compoundCmd.add(notifyCmd);
- // }
- // }
- // }
+ // @Override
+ // public void undo() {
+ // execute();
+ // }
+ // };
+ // if(notifyCmd.canExecute()) {
+ // compoundCmd.add(notifyCmd);
+ // }
+ // }
+ // }
// return null instead of unexecutable empty compound command
- if(compoundCmd.isEmpty()) {
+ if (compoundCmd.isEmpty()) {
return null;
}
return compoundCmd;
@@ -542,8 +542,8 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
private static void moveCoveredDurationConstraint(DurationConstraintEditPart dcp, CompoundCommand compoundCmd, Rectangle origCFBounds, Point moveDelta) {
Rectangle r = dcp.getFigure().getBounds().getCopy();
dcp.getFigure().translateToAbsolute(r);
- if(origCFBounds.contains(r)) {
- //see org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy.getMoveCommand(ChangeBoundsRequest)
+ if (origCFBounds.contains(r)) {
+ // see org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy.getMoveCommand(ChangeBoundsRequest)
IBorderItemEditPart borderItemEP = dcp;
IBorderItemLocator borderItemLocator = borderItemEP.getBorderItemLocator();
Rectangle realLocation = borderItemLocator.getValidLocation(dcp.getFigure().getBounds().getCopy(), borderItemEP.getFigure());
@@ -551,7 +551,7 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
Dimension d = realLocation.getTopLeft().getDifference(parentOrigin);
Point location = new Point(d.width, d.height);
location = location.translate(0, moveDelta.y);
- ICommandProxy resize = new ICommandProxy(new SetBoundsCommand(dcp.getEditingDomain(), DiagramUIMessages.Commands_MoveElement, new EObjectAdapter((View)dcp.getModel()), location));
+ ICommandProxy resize = new ICommandProxy(new SetBoundsCommand(dcp.getEditingDomain(), DiagramUIMessages.Commands_MoveElement, new EObjectAdapter((View) dcp.getModel()), location));
compoundCmd.add(resize);
}
}
@@ -559,12 +559,12 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
private static ICommand getMoveAnchorCommand(int yDelta, Rectangle figureBounds, IdentityAnchor gmfAnchor) {
String oldTerminal = gmfAnchor.getId();
PrecisionPoint pp = BaseSlidableAnchor.parseTerminalString(oldTerminal);
- int yPos = (int)Math.round(figureBounds.height * pp.preciseY);
+ int yPos = (int) Math.round(figureBounds.height * pp.preciseY);
yPos += yDelta;
- pp.preciseY = (double)yPos / figureBounds.height;
- if(pp.preciseY > 1.0) {
+ pp.preciseY = (double) yPos / figureBounds.height;
+ if (pp.preciseY > 1.0) {
pp.preciseY = 1.0;
- } else if(pp.preciseY < 0.0) {
+ } else if (pp.preciseY < 0.0) {
pp.preciseY = 0.0;
}
String newTerminal = (new BaseSlidableAnchor(null, pp)).getTerminal();
@@ -583,30 +583,30 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
child.getFigure().translateToRelative(rect);
rect.translate(getLayoutOrigin().getNegated());
Dimension sizeDelta = request.getSizeDelta();
- if(sizeDelta.width == 0 && sizeDelta.height == 0) {
+ if (sizeDelta.width == 0 && sizeDelta.height == 0) {
Rectangle cons = getCurrentConstraintFor(child);
- if(cons != null) {
+ if (cons != null) {
rect.setSize(cons.width, cons.height);
}
} else { // resize editpart
- // boolean skipMinSize = false;
- // if(child instanceof LifelineEditPart)// && LifelineResizeHelper.isManualSize((LifelineEditPart)child))
- // skipMinSize = true;
- //We introduce a MIN_WIDTH for Lifeline now.
+ // boolean skipMinSize = false;
+ // if(child instanceof LifelineEditPart)// && LifelineResizeHelper.isManualSize((LifelineEditPart)child))
+ // skipMinSize = true;
+ // We introduce a MIN_WIDTH for Lifeline now.
Dimension minSize = getMinimumSizeFor(child);
- if(sizeDelta.width != 0 && rect.width < minSize.width) { // In manual mode, there is no minimal width
+ if (sizeDelta.width != 0 && rect.width < minSize.width) { // In manual mode, there is no minimal width
return null;
}
- if(sizeDelta.height != 0 && rect.height < minSize.height) {
+ if (sizeDelta.height != 0 && rect.height < minSize.height) {
return null;
}
}
- rect = (Rectangle)getConstraintFor(rect);
+ rect = (Rectangle) getConstraintFor(rect);
Rectangle cons = getCurrentConstraintFor(child);
- if(sizeDelta.width == 0) {
+ if (sizeDelta.width == 0) {
rect.width = cons.width;
}
- if(sizeDelta.height == 0) {
+ if (sizeDelta.height == 0) {
rect.height = cons.height;
}
return rect;
@@ -618,8 +618,8 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
@Override
protected Dimension getMinimumSizeFor(GraphicalEditPart child) {
Dimension minimunSize;
- if(child instanceof LifelineEditPart) {
- minimunSize = getMinimumSizeFor((LifelineEditPart)child);
+ if (child instanceof LifelineEditPart) {
+ minimunSize = getMinimumSizeFor((LifelineEditPart) child);
} else {
minimunSize = super.getMinimumSizeFor(child);
}
@@ -628,18 +628,18 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
/**
* Get minimun for a lifeline
- *
+ *
* @param child
- * The lifeline
+ * The lifeline
* @return The minimun size
*/
private Dimension getMinimumSizeFor(LifelineEditPart child) {
LifelineEditPart lifelineEditPart = child;
Dimension minimunSize = lifelineEditPart.getFigure().getMinimumSize();
- for(LifelineEditPart lifelineEP : LifelineEditPartUtil.getInnerConnectableElementList(lifelineEditPart)) {
+ for (LifelineEditPart lifelineEP : LifelineEditPartUtil.getInnerConnectableElementList(lifelineEditPart)) {
minimunSize.union(getMinimumSizeFor(lifelineEP));
}
- for(ShapeNodeEditPart executionSpecificationEP : LifelineEditPartUtil.getChildShapeNodeEditPart(lifelineEditPart)) {
+ for (ShapeNodeEditPart executionSpecificationEP : LifelineEditPartUtil.getChildShapeNodeEditPart(lifelineEditPart)) {
int minimunHeight = executionSpecificationEP.getFigure().getBounds().bottom();
minimunSize.setSize(new Dimension(minimunSize.width, Math.max(minimunSize.height, minimunHeight)));
}
@@ -651,10 +651,10 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
*/
@Override
public Command getAddCommand(Request request) {
- if(request instanceof ChangeBoundsRequest) {
- //Only allow to move-in AppliedStereotypeCommentEditPart.
- List editParts = ((ChangeBoundsRequest)request).getEditParts();
- if(editParts.size() == 1 && editParts.get(0) instanceof AppliedStereotypesCommentEditPart) {
+ if (request instanceof ChangeBoundsRequest) {
+ // Only allow to move-in AppliedStereotypeCommentEditPart.
+ List editParts = ((ChangeBoundsRequest) request).getEditParts();
+ if (editParts.size() == 1 && editParts.get(0) instanceof AppliedStereotypesCommentEditPart) {
return super.getAddCommand(request);
}
return UnexecutableCommand.INSTANCE;
@@ -665,23 +665,23 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
/**
* Overrides to change the policy of connection anchors when resizing the lifeline.
* When resizing the lifeline, the connection must not move.
- *
+ *
* @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.XYLayoutEditPolicy#getCommand(org.eclipse.gef.Request)
*/
@SuppressWarnings("unchecked")
@Override
public Command getCommand(Request request) {
- if(request instanceof ChangeBoundsRequest) {
- ChangeBoundsRequest cbr = (ChangeBoundsRequest)request;
- if (cbr.getEditParts() == null){
+ if (request instanceof ChangeBoundsRequest) {
+ ChangeBoundsRequest cbr = (ChangeBoundsRequest) request;
+ if (cbr.getEditParts() == null) {
return super.getCommand(request);
}
int resizeDirection = cbr.getResizeDirection();
CompoundCommand compoundCmd = new CompoundCommand("Resize of Interaction Compartment Elements");
- for(EditPart ep : (List<EditPart>)cbr.getEditParts()) {
- if(ep instanceof LifelineEditPart && isVerticalMove(cbr)) {
+ for (EditPart ep : (List<EditPart>) cbr.getEditParts()) {
+ if (ep instanceof LifelineEditPart && isVerticalMove(cbr)) {
// Lifeline EditPart
- LifelineEditPart lifelineEP = (LifelineEditPart)ep;
+ LifelineEditPart lifelineEP = (LifelineEditPart) ep;
int preserveY = PreserveAnchorsPositionCommand.PRESERVE_Y;
Dimension newSizeDelta = PreserveAnchorsPositionCommand.getSizeDeltaToFitAnchors(lifelineEP, cbr.getSizeDelta(), preserveY);
// SetBounds command modifying the sizeDelta
@@ -690,7 +690,7 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
compoundCmd.add(new ICommandProxy(new CustomLifelineEditPart.PreserveAnchorsPositionCommandEx(lifelineEP, newSizeDelta, preserveY, lifelineEP.getPrimaryShape().getFigureLifelineDotLineFigure(), resizeDirection)));
}
}
- if(compoundCmd.size() == 0) {
+ if (compoundCmd.size() == 0) {
return super.getCommand(request);
} else {
return compoundCmd;
@@ -706,14 +706,14 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
* positions after the resize. It is recommended to obtain this newSizeDelta
* by means of calling
* PreserveAnchorsPositionCommand.getSizeDeltaToFitAnchors() operation
- *
+ *
* @param lifelineEP
- * The Lifeline that will be moved or resized
+ * The Lifeline that will be moved or resized
* @param cbr
- * The ChangeBoundsRequest for moving or resized the lifelineEP
+ * The ChangeBoundsRequest for moving or resized the lifelineEP
* @param newSizeDelta
- * The sizeDelta to used instead of the one contained in the
- * request
+ * The sizeDelta to used instead of the one contained in the
+ * request
* @return The SetBoundsCommand
*/
@SuppressWarnings("rawtypes")
@@ -741,7 +741,7 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
protected Rectangle getBoundsOffest(CreateViewRequest request, Rectangle bounds, CreateViewRequest.ViewDescriptor viewDescriptor) {
int translate = request.getViewDescriptors().indexOf(viewDescriptor) * 10;
Rectangle target = bounds.getCopy().translate(translate, translate);
- if(((IHintedType)UMLElementTypes.Lifeline_3001).getSemanticHint().equals(viewDescriptor.getSemanticHint())) {
+ if (((IHintedType) UMLElementTypes.Lifeline_3001).getSemanticHint().equals(viewDescriptor.getSemanticHint())) {
target.setY(LifelineHeadUtil.computeLifelineVerticalPosition(getHost()));
}
return target;
@@ -750,18 +750,18 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
@Override
protected void showSizeOnDropFeedback(CreateRequest request) {
super.showSizeOnDropFeedback(request);
- if(request instanceof CreateAspectUnspecifiedTypeRequest) {
- CreateAspectUnspecifiedTypeRequest req = (CreateAspectUnspecifiedTypeRequest)request;
- if(req.getElementTypes().contains(UMLElementTypes.CombinedFragment_3004) || req.getElementTypes().contains(UMLElementTypes.ConsiderIgnoreFragment_3007)) {
+ if (request instanceof CreateAspectUnspecifiedTypeRequest) {
+ CreateAspectUnspecifiedTypeRequest req = (CreateAspectUnspecifiedTypeRequest) request;
+ if (req.getElementTypes().contains(UMLElementTypes.CombinedFragment_3004) || req.getElementTypes().contains(UMLElementTypes.ConsiderIgnoreFragment_3007)) {
Rectangle rect = new Rectangle(request.getLocation(), request.getSize());
- if(!coveredLifelines.isEmpty()) {
- for(LifelineEditPart lifeline : coveredLifelines) {
+ if (!coveredLifelines.isEmpty()) {
+ for (LifelineEditPart lifeline : coveredLifelines) {
HighlightUtil.unhighlight(lifeline);
}
coveredLifelines.clear();
}
fillCoveredLifelines(rect);
- for(LifelineEditPart lifeline : coveredLifelines) {
+ for (LifelineEditPart lifeline : coveredLifelines) {
HighlightUtil.highlight(lifeline);
}
}
@@ -772,29 +772,29 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
private void fillCoveredLifelines(Rectangle rect) {
coveredLifelines.clear();
Collection values = getHost().getViewer().getEditPartRegistry().values();
- for(Object object : values) {
- if(!(object instanceof LifelineEditPart)) {
+ for (Object object : values) {
+ if (!(object instanceof LifelineEditPart)) {
continue;
}
- LifelineEditPart lifeline = ((LifelineEditPart)object);
+ LifelineEditPart lifeline = ((LifelineEditPart) object);
LifelineFigure primaryShape = lifeline.getPrimaryShape();
RectangleFigure nameFigure = primaryShape.getFigureLifelineNameContainerFigure();
- if(nameFigure != null) {
+ if (nameFigure != null) {
Rectangle r = nameFigure.getBounds().getCopy();
nameFigure.translateToAbsolute(r);
- if(rect.intersects(r)) {
+ if (rect.intersects(r)) {
coveredLifelines.add(lifeline);
continue;
}
}
LifelineDotLineCustomFigure dotLineFigure = primaryShape.getFigureLifelineDotLineFigure();
- if(dotLineFigure != null) {
+ if (dotLineFigure != null) {
Rectangle r = dotLineFigure.getBounds().getCopy();
- if(r.width != 1) {
+ if (r.width != 1) {
r.shrink(r.width / 2 - 1, 0);
}
dotLineFigure.translateToAbsolute(r);
- if(rect.intersects(r)) {
+ if (rect.intersects(r)) {
coveredLifelines.add(lifeline);
continue;
}
@@ -804,8 +804,8 @@ public class InteractionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy
@Override
protected void eraseSizeOnDropFeedback(Request request) {
- if(!coveredLifelines.isEmpty()) {
- for(LifelineEditPart lifeline : coveredLifelines) {
+ if (!coveredLifelines.isEmpty()) {
+ for (LifelineEditPart lifeline : coveredLifelines) {
HighlightUtil.unhighlight(lifeline);
}
coveredLifelines.clear();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionFragmentsCreationEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionFragmentsCreationEditPolicy.java
index 36bd4f96094..32cbca1b17a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionFragmentsCreationEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionFragmentsCreationEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -26,23 +26,23 @@ import org.eclipse.papyrus.uml.diagram.stereotype.edition.editpart.AppliedStereo
/**
* Ordering fragments after creation.
* See https://bugs.eclipse.org/bugs/show_bug.cgi?id=403233
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class InteractionFragmentsCreationEditPolicy extends PapyrusCreationEditPolicy {
/**
* @see org.eclipse.papyrus.uml.diagram.common.editpolicies.PapyrusCreationEditPolicy#getCreateElementAndViewCommand(org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest)
- *
+ *
* @param request
* @return
*/
@Override
protected Command getCreateElementAndViewCommand(CreateViewAndElementRequest request) {
Command command = super.getCreateElementAndViewCommand(request);
- if(command != null && command.canExecute()) {
+ if (command != null && command.canExecute()) {
ICommand orderingFragmentsCommand = FragmentsOrdererHelper.createOrderingFragmentsCommand(getHost(), request);
- if(orderingFragmentsCommand != null) {
+ if (orderingFragmentsCommand != null) {
command = command.chain(new ICommandProxy(orderingFragmentsCommand));
}
}
@@ -51,13 +51,13 @@ public class InteractionFragmentsCreationEditPolicy extends PapyrusCreationEditP
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy#getReparentViewCommand(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart)
- *
+ *
* @param gep
* @return
*/
@Override
protected ICommand getReparentViewCommand(IGraphicalEditPart gep) {
- if(gep instanceof AppliedStereotypesCommentEditPart) {
+ if (gep instanceof AppliedStereotypesCommentEditPart) {
return UnexecutableCommand.INSTANCE;
}
return super.getReparentViewCommand(gep);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionFragmentsOrderingEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionFragmentsOrderingEditPolicy.java
index f9c43d77456..120b0db3222 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionFragmentsOrderingEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionFragmentsOrderingEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -31,7 +31,7 @@ import org.eclipse.papyrus.uml.diagram.sequence.util.FragmentsOrdererHelper;
/**
* Ordering fragments after moving, resizing for Shapes and reconnect for message occurrence specifications.
* See https://bugs.eclipse.org/bugs/show_bug.cgi?id=403233
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class InteractionFragmentsOrderingEditPolicy extends GraphicalEditPolicy {
@@ -40,16 +40,16 @@ public class InteractionFragmentsOrderingEditPolicy extends GraphicalEditPolicy
/**
* @see org.eclipse.gef.editpolicies.AbstractEditPolicy#understandsRequest(org.eclipse.gef.Request)
- *
+ *
* @param req
* @return
*/
@Override
public boolean understandsRequest(Request req) {
Object type = req.getType();
- if(REQ_MOVE.equals(type) || REQ_RESIZE.equals(type)) {//Correct mistake(also fix bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=417375)
+ if (REQ_MOVE.equals(type) || REQ_RESIZE.equals(type)) {// Correct mistake(also fix bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=417375)
return true;
- } else if(getHost() instanceof AbstractMessageEditPart) {
+ } else if (getHost() instanceof AbstractMessageEditPart) {
return REQ_RECONNECT_SOURCE.equals(type) || REQ_RECONNECT_TARGET.equals(type) || REQ_CREATE_BENDPOINT.equals(type) || REQ_MOVE_BENDPOINT.equals(type);
}
return false;
@@ -57,7 +57,7 @@ public class InteractionFragmentsOrderingEditPolicy extends GraphicalEditPolicy
@Override
public EditPart getTargetEditPart(Request request) {
- if(understandsRequest(request)) {
+ if (understandsRequest(request)) {
return getHost();
}
return null;
@@ -65,7 +65,7 @@ public class InteractionFragmentsOrderingEditPolicy extends GraphicalEditPolicy
@Override
public Command getCommand(Request request) {
- if(understandsRequest(request)) {
+ if (understandsRequest(request)) {
AbstractTransactionalCommand cmd = new AbstractTransactionalCommand(getEditingDomain(), "", null) {
@Override
@@ -81,8 +81,8 @@ public class InteractionFragmentsOrderingEditPolicy extends GraphicalEditPolicy
private TransactionalEditingDomain getEditingDomain() {
EditPart host = getHost();
- if(host instanceof IGraphicalEditPart) {
- return ((IGraphicalEditPart)host).getEditingDomain();
+ if (host instanceof IGraphicalEditPart) {
+ return ((IGraphicalEditPart) host).getEditingDomain();
}
return null;
}
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 ea829b70f0a..bc29b3d7080 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -68,30 +68,30 @@ import org.eclipse.uml2.uml.MessageEnd;
/**
* 1. Create a Lifeline if the target of Message Created is not selected.
* See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=403134
- *
+ *
* 2. Redirect the source from CombinedFragment, Interaction and InteractionUse to a Graphical Gate.
* See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=389531
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class InteractionGraphicalNodeEditPolicy extends GatesHolderGraphicalNodeEditPolicy {
/**
* Constructor.
- *
+ *
*/
public InteractionGraphicalNodeEditPolicy() {
}
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.policies.SequenceGraphicalNodeEditPolicy#getTargetEditPart(org.eclipse.gef.Request)
- *
+ *
* @param request
* @return
*/
@Override
public EditPart getTargetEditPart(Request request) {
- if(REQ_CONNECTION_END.equals(request.getType()) && isCreateConnectionRequest(request, UMLElementTypes.Message_4006)) {
+ if (REQ_CONNECTION_END.equals(request.getType()) && isCreateConnectionRequest(request, UMLElementTypes.Message_4006)) {
return getHost();
}
return super.getTargetEditPart(request);
@@ -99,66 +99,67 @@ public class InteractionGraphicalNodeEditPolicy extends GatesHolderGraphicalNode
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.GraphicalNodeEditPolicy#getCommand(org.eclipse.gef.Request)
- *
+ *
* @param request
* @return
*/
@Override
public Command getCommand(Request request) {
- if(REQ_CONNECTION_END.equals(request.getType()) && isCreateConnectionRequest(request, UMLElementTypes.Message_4006)) {
- return getMessageCreateAndLifelineCommands((CreateConnectionRequest)request);
- } else if(REQ_CONNECTION_START.equals(request.getType()) && request instanceof CreateConnectionRequest) {
- //Fixed bug about mapping source location for creating a Gate.
- request.getExtendedData().put(SequenceRequestConstant.SOURCE_LOCATION_DATA, ((CreateConnectionRequest)request).getLocation());
+ if (REQ_CONNECTION_END.equals(request.getType()) && isCreateConnectionRequest(request, UMLElementTypes.Message_4006)) {
+ return getMessageCreateAndLifelineCommands((CreateConnectionRequest) request);
+ } else if (REQ_CONNECTION_START.equals(request.getType()) && request instanceof CreateConnectionRequest) {
+ // Fixed bug about mapping source location for creating a Gate.
+ request.getExtendedData().put(SequenceRequestConstant.SOURCE_LOCATION_DATA, ((CreateConnectionRequest) request).getLocation());
}
return super.getCommand(request);
}
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.policies.SequenceGraphicalNodeEditPolicy#getConnectionCompleteCommand(org.eclipse.gef.requests.CreateConnectionRequest)
- *
+ *
* @param request
* @return
*/
@Override
protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
Command command = super.getConnectionCompleteCommand(request);
- if(command != null && command.canExecute() && REQ_CONNECTION_END.equals(request.getType()) && isCreateConnectionRequest(request, UMLElementTypes.Message_4008)) {
+ if (command != null && command.canExecute() && REQ_CONNECTION_END.equals(request.getType()) && isCreateConnectionRequest(request, UMLElementTypes.Message_4008)) {
EditPart sourceEditPart = request.getSourceEditPart();
- EObject source = ViewUtil.resolveSemanticElement((View)sourceEditPart.getModel());
- //ignore CoRegion
- if(!(sourceEditPart instanceof CombinedFragment2EditPart) && (source instanceof CombinedFragment || source instanceof Interaction || source instanceof InteractionUse)) {
+ EObject source = ViewUtil.resolveSemanticElement((View) sourceEditPart.getModel());
+ // ignore CoRegion
+ if (!(sourceEditPart instanceof CombinedFragment2EditPart) && (source instanceof CombinedFragment || source instanceof Interaction || source instanceof InteractionUse)) {
Point location = null;
- IGraphicalEditPart adapter = (IGraphicalEditPart)sourceEditPart.getAdapter(IGraphicalEditPart.class);
+ IGraphicalEditPart adapter = (IGraphicalEditPart) sourceEditPart.getAdapter(IGraphicalEditPart.class);
TransactionalEditingDomain editingDomain = null;
- if(adapter != null) {
+ if (adapter != null) {
location = GateHelper.computeGateLocation(request.getLocation(), adapter.getFigure(), null);
editingDomain = adapter.getEditingDomain();
}
ConnectionViewDescriptor edgeAdaptor = null;
- if(request instanceof CreateConnectionViewRequest) {
- edgeAdaptor = ((CreateConnectionViewRequest)request).getConnectionViewDescriptor();
- } else if(request instanceof CreateUnspecifiedTypeConnectionRequest) {
- List elementTypes = ((CreateUnspecifiedTypeConnectionRequest)request).getElementTypes();
- if(elementTypes.size() == 1) {
- CreateRequest realRequest = ((CreateUnspecifiedTypeConnectionRequest)request).getRequestForType((IElementType)elementTypes.get(0));
- if(realRequest instanceof CreateConnectionViewRequest) {
- edgeAdaptor = ((CreateConnectionViewRequest)realRequest).getConnectionViewDescriptor();
+ if (request instanceof CreateConnectionViewRequest) {
+ edgeAdaptor = ((CreateConnectionViewRequest) request).getConnectionViewDescriptor();
+ } else if (request instanceof CreateUnspecifiedTypeConnectionRequest) {
+ List elementTypes = ((CreateUnspecifiedTypeConnectionRequest) request).getElementTypes();
+ if (elementTypes.size() == 1) {
+ CreateRequest realRequest = ((CreateUnspecifiedTypeConnectionRequest) request).getRequestForType((IElementType) elementTypes.get(0));
+ if (realRequest instanceof CreateConnectionViewRequest) {
+ edgeAdaptor = ((CreateConnectionViewRequest) realRequest).getConnectionViewDescriptor();
}
}
}
- if(edgeAdaptor != null) {
+ if (edgeAdaptor != null) {
final IAdaptable elementAdapter = edgeAdaptor.getElementAdapter();
- if(elementAdapter != null) {
+ if (elementAdapter != null) {
CompoundCommand cc = new CompoundCommand("Redirect to Gate");
cc.add(command);
IAdaptable gateAdaptor = new IAdaptable() {
+ @Override
public Object getAdapter(Class adapter) {
- if(Gate.class == adapter) {
- Message message = (Message)elementAdapter.getAdapter(Message.class);
+ if (Gate.class == adapter) {
+ Message message = (Message) elementAdapter.getAdapter(Message.class);
MessageEnd sendEvent = message.getSendEvent();
- if(sendEvent instanceof Gate) {
+ if (sendEvent instanceof Gate) {
return sendEvent;
}
}
@@ -184,13 +185,13 @@ public class InteractionGraphicalNodeEditPolicy extends GatesHolderGraphicalNode
}
protected Command getMessageCreateAndLifelineCommands(CreateConnectionRequest request) {
- InteractionEditPart iep = (InteractionEditPart)getHost();
+ InteractionEditPart iep = (InteractionEditPart) getHost();
IGraphicalEditPart container = iep.getChildBySemanticHint("" + InteractionInteractionCompartmentEditPart.VISUAL_ID);
CompoundCommand cc = new CompoundCommand(DiagramUIMessages.Command_CreateRelationship_Label);
- //1. Create a Lifeline.
+ // 1. Create a Lifeline.
CreateViewAndOptionallyElementCommand createOtherEndCmd = new CreateViewAndOptionallyElementCommand(UMLElementTypes.Lifeline_3001, container, request.getLocation(), iep.getDiagramPreferencesHint());
cc.add(new ICommandProxy(createOtherEndCmd));
- //2. Create message to the Lifeline.
+ // 2. Create message to the Lifeline.
ICommand connectionCmd = new CreateMessageCreateWithLifelineCommand(request, UMLElementTypes.Message_4006, request.getSourceEditPart(), createOtherEndCmd.getResult(), iep.getViewer());
cc.add(new ICommandProxy(connectionCmd));
return cc;
@@ -198,12 +199,12 @@ public class InteractionGraphicalNodeEditPolicy extends GatesHolderGraphicalNode
/**
* This class is copied from DeferredCreateConnectionViewAndElementCommand.
- *
+ *
* But to fixed bugs about creating Message:
- *
+ *
* 1. Set the location for CreateConnectionViewRequest with created Lifeline.
* 2. Update targetContainer with created Lifeline.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
private static class CreateMessageCreateWithLifelineCommand extends AbstractCommand {
@@ -230,13 +231,14 @@ public class InteractionGraphicalNodeEditPolicy extends GatesHolderGraphicalNode
this.viewer = currentViewer;
}
+ @Override
@SuppressWarnings("rawtypes")
public List getAffectedFiles() {
- if(viewer != null) {
+ if (viewer != null) {
EditPart editpart = viewer.getRootEditPart().getContents();
- if(editpart instanceof IGraphicalEditPart) {
- View view = (View)editpart.getModel();
- if(view != null) {
+ if (editpart instanceof IGraphicalEditPart) {
+ View view = (View) editpart.getModel();
+ if (view != null) {
IFile f = WorkspaceSynchronizer.getFile(view.eResource());
return f != null ? Collections.singletonList(f) : Collections.EMPTY_LIST;
}
@@ -245,10 +247,12 @@ public class InteractionGraphicalNodeEditPolicy extends GatesHolderGraphicalNode
return super.getAffectedFiles();
}
+ @Override
public boolean canUndo() {
return command != null && command.canUndo();
}
+ @Override
public boolean canRedo() {
return CommandUtilities.canRedo(command);
}
@@ -256,73 +260,79 @@ public class InteractionGraphicalNodeEditPolicy extends GatesHolderGraphicalNode
/**
* gives access to the connection source edit part, which is the edit part
* of the connection's source <code>View</code>
- *
+ *
* @return the source edit part
*/
protected EditPart getSourceEditPart() {
- return (IGraphicalEditPart)viewer.getEditPartRegistry().get(sourceViewAdapter.getAdapter(View.class));
+ return (IGraphicalEditPart) viewer.getEditPartRegistry().get(sourceViewAdapter.getAdapter(View.class));
}
/**
* gives access to the connection target edit part, which is the edit part
* of the connection's target <code>View</code>
- *
+ *
* @return the source edit part
*/
protected EditPart getTargetEditPart() {
- return (IGraphicalEditPart)viewer.getEditPartRegistry().get(targetViewAdapter.getAdapter(View.class));
+ return (IGraphicalEditPart) viewer.getEditPartRegistry().get(targetViewAdapter.getAdapter(View.class));
}
+ @Override
public boolean canExecute() {
- if(!(request instanceof CreateConnectionViewRequest) && !(request instanceof CreateUnspecifiedTypeConnectionRequest))
+ if (!(request instanceof CreateConnectionViewRequest) && !(request instanceof CreateUnspecifiedTypeConnectionRequest)) {
return false;
- if(request instanceof CreateUnspecifiedTypeConnectionRequest) {
- if(typeInfoAdapter == null)
+ }
+ if (request instanceof CreateUnspecifiedTypeConnectionRequest) {
+ if (typeInfoAdapter == null) {
return false;
- final IElementType typeInfo = (IElementType)typeInfoAdapter.getAdapter(IElementType.class);
- if(typeInfo != null) {
- if(((CreateUnspecifiedTypeConnectionRequest)request).getRequestForType(typeInfo) == null)
+ }
+ final IElementType typeInfo = (IElementType) typeInfoAdapter.getAdapter(IElementType.class);
+ if (typeInfo != null) {
+ if (((CreateUnspecifiedTypeConnectionRequest) request).getRequestForType(typeInfo) == null) {
return false;
+ }
}
}
return true;
}
+ @Override
@SuppressWarnings({ "restriction", "unchecked" })
protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
CreateConnectionViewRequest req = null;
- if(request != null) {
- if(request instanceof CreateConnectionViewRequest) {
- req = (CreateConnectionViewRequest)request;
+ if (request != null) {
+ if (request instanceof CreateConnectionViewRequest) {
+ req = (CreateConnectionViewRequest) request;
}
} else {
return CommandResult.newErrorCommandResult(getLabel());
}
- if(typeInfoAdapter != null) {
- IElementType typeInfo = (IElementType)typeInfoAdapter.getAdapter(IElementType.class);
- if(typeInfo == null) {
+ if (typeInfoAdapter != null) {
+ IElementType typeInfo = (IElementType) typeInfoAdapter.getAdapter(IElementType.class);
+ if (typeInfo == null) {
return CommandResult.newErrorCommandResult(getLabel());
}
- if(request instanceof CreateUnspecifiedTypeConnectionRequest) {
- req = ((CreateConnectionViewRequest)((CreateUnspecifiedTypeConnectionRequest)request).getRequestForType(typeInfo));
+ if (request instanceof CreateUnspecifiedTypeConnectionRequest) {
+ req = ((CreateConnectionViewRequest) ((CreateUnspecifiedTypeConnectionRequest) request).getRequestForType(typeInfo));
}
}
// Suppressing UI if the target edit part has not been created yet
// this is so that if we are creating a new target the connection
// creation will just take default data instead of prompting
// For Defect RATLC00524293
- if(targetViewAdapter.getAdapter(IGraphicalEditPart.class) == null && req instanceof SuppressibleUIRequest)
- ((SuppressibleUIRequest)req).setSuppressibleUI(true);
+ if (targetViewAdapter.getAdapter(IGraphicalEditPart.class) == null && req instanceof SuppressibleUIRequest) {
+ ((SuppressibleUIRequest) req).setSuppressibleUI(true);
+ }
EditPart sourceEP = getSourceEditPart();
EditPart targetEP = getTargetEditPart();
- // if(targetEP instanceof IGraphicalEditPart) {
- // Rectangle absoluteBounds = SequenceUtil.getAbsoluteBounds((IGraphicalEditPart)targetEP);
- // if(absoluteBounds != null) {
- // req.setLocation(absoluteBounds.getLocation());
- // }
- // } else {
- // req.setLocation(null);
- // }
+ // if(targetEP instanceof IGraphicalEditPart) {
+ // Rectangle absoluteBounds = SequenceUtil.getAbsoluteBounds((IGraphicalEditPart)targetEP);
+ // if(absoluteBounds != null) {
+ // req.setLocation(absoluteBounds.getLocation());
+ // }
+ // } else {
+ // req.setLocation(null);
+ // }
// There are situations where src or target can be null and we must
// check for these
// ie. When a Select Existing Dialog is presnetd to the user and the
@@ -331,41 +341,45 @@ public class InteractionGraphicalNodeEditPolicy extends GatesHolderGraphicalNode
// So the following assertions have been replaced with a check for null
// on the editparts.
// old code ... Assert.isNotNull(sourceEP); Assert.isNotNull(targetEP);
- if((sourceEP == null) || (targetEP == null))
+ if ((sourceEP == null) || (targetEP == null)) {
return null;
- if(req instanceof CreateConnectionViewAndElementRequest) {
+ }
+ if (req instanceof CreateConnectionViewAndElementRequest) {
req.getExtendedData().put(SequenceRequestConstant.TARGET_MODEL_CONTAINER, SequenceUtil.findInteractionFragmentContainerAt(req.getLocation(), getTargetEditPart()));
- command = CreateConnectionViewAndElementRequest.getCreateCommand(req, sourceEP, targetEP);
+ command = CreateConnectionViewRequest.getCreateCommand(req, sourceEP, targetEP);
} else {
command = CreateConnectionViewRequest.getCreateCommand(req, sourceEP, targetEP);
}
- if(command != null && command.canExecute()) {
+ if (command != null && command.canExecute()) {
command.execute();
}
viewer = null;// for garbage collection
- View view = (View)req.getConnectionViewDescriptor().getAdapter(View.class);
- if(null == view) {
+ View view = (View) req.getConnectionViewDescriptor().getAdapter(View.class);
+ if (null == view) {
return CommandResult.newCancelledCommandResult();
}
return CommandResult.newOKCommandResult(req.getNewObject());
}
+ @Override
public String getLabel() {
- if(command != null) {
+ if (command != null) {
return command.getLabel();
}
return null;
}
+ @Override
protected CommandResult doRedoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- if(command != null) {
+ if (command != null) {
command.redo();
}
return CommandResult.newOKCommandResult();
}
+ @Override
protected CommandResult doUndoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- if(command != null) {
+ if (command != null) {
command.undo();
}
return CommandResult.newOKCommandResult();
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 313fcdaf6ea..f58eef4421d 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -24,6 +24,7 @@ import org.eclipse.emf.common.command.CompoundCommand;
import org.eclipse.emf.edit.command.SetCommand;
import org.eclipse.gef.NodeEditPart;
import org.eclipse.gmf.runtime.diagram.ui.commands.SetBoundsCommand;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.BaseSlidableAnchor;
import org.eclipse.gmf.runtime.gef.ui.figures.SlidableAnchor;
import org.eclipse.gmf.runtime.notation.Anchor;
import org.eclipse.gmf.runtime.notation.Edge;
@@ -47,14 +48,14 @@ public class InteractionHeadImpactLayoutEditPolicy extends AbstractHeadImpactLay
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.policies.AbstractHeadImpactLayoutEditPolicy#getHeadHeight()
- *
+ *
* @return
*/
@Override
protected int getHeadHeight() {
IFigure primaryShape = getPrimaryShape();
- if(primaryShape instanceof StereotypeInteractionFigure) {
- IFigure headContainer = ((StereotypeInteractionFigure)primaryShape).getHeaderLabel().getParent();
+ if (primaryShape instanceof StereotypeInteractionFigure) {
+ IFigure headContainer = ((StereotypeInteractionFigure) primaryShape).getHeaderLabel().getParent();
Rectangle boundsRect = getBoundsRect();
return headContainer.getPreferredSize(boundsRect.width, -1).height;
}
@@ -63,45 +64,45 @@ public class InteractionHeadImpactLayoutEditPolicy extends AbstractHeadImpactLay
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.policies.AbstractHeadImpactLayoutEditPolicy#doImpactLayout(int)
- *
+ *
* @param resizeDelta
*/
@Override
protected void doImpactLayout(int resizeDelta) {
CompoundCommand commands = new CompoundCommand();
- //1. move gate
+ // 1. move gate
{
List children = getHost().getChildren();
List<GateEditPart> gates = new ArrayList<GateEditPart>();
- for(Object object : children) {
- if(object instanceof GateEditPart) {
- gates.add((GateEditPart)object);
+ for (Object object : children) {
+ if (object instanceof GateEditPart) {
+ gates.add((GateEditPart) object);
}
}
- if(!gates.isEmpty()) {
+ if (!gates.isEmpty()) {
Rectangle rect = getBoundsRect();
- for(GateEditPart gateEditPart : gates) {
- Node view = (Node)gateEditPart.getNotationView();
- Location location = (Location)view.getLayoutConstraint();
+ for (GateEditPart gateEditPart : gates) {
+ Node view = (Node) gateEditPart.getNotationView();
+ Location location = (Location) view.getLayoutConstraint();
Point pt = new Point(location.getX(), location.getY());
- if(pt.x == rect.x - GateEditPart.DEFAULT_SIZE.width / 2 || pt.x == rect.right() - GateEditPart.DEFAULT_SIZE.width / 2) {
+ if (pt.x == rect.x - GateEditPart.DEFAULT_SIZE.width / 2 || pt.x == rect.right() - GateEditPart.DEFAULT_SIZE.width / 2) {
commands.appendIfCanExecute(new GMFtoEMFCommandWrapper(new SetBoundsCommand(getEditingDomain(), "Move gate", gateEditPart, pt.getTranslated(0, resizeDelta))));
}
}
}
}
- //2. move FoundMessage
+ // 2. move FoundMessage
{
- List sourceConnections = ((NodeEditPart)getHost()).getSourceConnections();
- for(Object object : sourceConnections) {
- if(object instanceof Message7EditPart) {
- Edge edge = (Edge)((Message7EditPart)object).getNotationView();
+ List sourceConnections = ((NodeEditPart) getHost()).getSourceConnections();
+ for (Object object : sourceConnections) {
+ if (object instanceof Message7EditPart) {
+ Edge edge = (Edge) ((Message7EditPart) object).getNotationView();
Anchor sourceAnchor = edge.getSourceAnchor();
- if(sourceAnchor instanceof IdentityAnchor) {
- String terminal = ((IdentityAnchor)sourceAnchor).getId();
- PrecisionPoint pt = SlidableAnchor.parseTerminalString(terminal);
- if(pt.preciseY() > 1) {
+ if (sourceAnchor instanceof IdentityAnchor) {
+ String terminal = ((IdentityAnchor) sourceAnchor).getId();
+ PrecisionPoint pt = BaseSlidableAnchor.parseTerminalString(terminal);
+ if (pt.preciseY() > 1) {
pt.translate(0, resizeDelta);
commands.appendIfCanExecute(SetCommand.create(getEditingDomain(), sourceAnchor, NotationPackage.eINSTANCE.getIdentityAnchor_Id(), "(" + pt.preciseX() + "," + pt.preciseY() + ")"));
}
@@ -109,18 +110,18 @@ public class InteractionHeadImpactLayoutEditPolicy extends AbstractHeadImpactLay
}
}
}
- //3. Move LostMessage
+ // 3. Move LostMessage
{
- List targetConnections = ((NodeEditPart)getHost()).getTargetConnections();
- for(Object object : targetConnections) {
- if(object instanceof Message6EditPart) {
- AbstractMessageEditPart message = (AbstractMessageEditPart)object;
- Edge edge = (Edge)message.getNotationView();
+ List targetConnections = ((NodeEditPart) getHost()).getTargetConnections();
+ for (Object object : targetConnections) {
+ if (object instanceof Message6EditPart) {
+ AbstractMessageEditPart message = (AbstractMessageEditPart) object;
+ Edge edge = (Edge) message.getNotationView();
Anchor targetAnchor = edge.getTargetAnchor();
- if(targetAnchor instanceof IdentityAnchor) {
- String terminal = ((IdentityAnchor)targetAnchor).getId();
- PrecisionPoint pt = SlidableAnchor.parseTerminalString(terminal);
- if(pt.preciseY() > 1) {
+ if (targetAnchor instanceof IdentityAnchor) {
+ String terminal = ((IdentityAnchor) targetAnchor).getId();
+ PrecisionPoint pt = BaseSlidableAnchor.parseTerminalString(terminal);
+ if (pt.preciseY() > 1) {
pt.translate(0, resizeDelta);
commands.appendIfCanExecute(SetCommand.create(getEditingDomain(), targetAnchor, NotationPackage.eINSTANCE.getIdentityAnchor_Id(), "(" + pt.preciseX() + "," + pt.preciseY() + ")"));
}
@@ -128,7 +129,7 @@ public class InteractionHeadImpactLayoutEditPolicy extends AbstractHeadImpactLay
}
}
}
- if(commands.isEmpty() || !commands.canExecute()) {
+ if (commands.isEmpty() || !commands.canExecute()) {
return;
}
CommandHelper.executeCommandWithoutHistory(getEditingDomain(), commands, true);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandAppliedStereotypeLabelDisplayEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandAppliedStereotypeLabelDisplayEditPolicy.java
index e648ac49a61..8e1ec789590 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandAppliedStereotypeLabelDisplayEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandAppliedStereotypeLabelDisplayEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -32,14 +32,14 @@ public class InteractionOperandAppliedStereotypeLabelDisplayEditPolicy extends A
@Override
protected void refreshStereotypeDisplay() {
EditPart host = getHost();
- if(!(host instanceof CustomInteractionOperandEditPart)) {
+ if (!(host instanceof CustomInteractionOperandEditPart)) {
return;
}
- IGraphicalEditPart guard = ((CustomInteractionOperandEditPart)host).getChildBySemanticHint(InteractionOperandGuardEditPart.GUARD_TYPE);
- if(!(guard instanceof InteractionOperandGuardEditPart)) {
+ IGraphicalEditPart guard = ((CustomInteractionOperandEditPart) host).getChildBySemanticHint(InteractionOperandGuardEditPart.GUARD_TYPE);
+ if (!(guard instanceof InteractionOperandGuardEditPart)) {
return;
}
- GuardFigure figure = ((InteractionOperandGuardEditPart)guard).getPrimaryFigure();
+ GuardFigure figure = ((InteractionOperandGuardEditPart) guard).getPrimaryFigure();
// calculate text and icon to display
final String stereotypesToDisplay = stereotypesOnlyToDisplay();
// computes the icon to be displayed
@@ -49,9 +49,9 @@ public class InteractionOperandAppliedStereotypeLabelDisplayEditPolicy extends A
// Else, it displays
// nothing
// if (stereotypesToDisplay != "" || imageToDisplay != null) {
- if(figure instanceof IPapyrusNodeUMLElementFigure) {
- ((IPapyrusNodeUMLElementFigure)figure).setStereotypeDisplay(tag + ("".equals(stereotypesOnlyToDisplay()) ? stereotypesToDisplay : stereotypesToDisplay), imageToDisplay);
- if (figure instanceof IPapyrusNodeNamedElementFigure){
+ if (figure instanceof IPapyrusNodeUMLElementFigure) {
+ ((IPapyrusNodeUMLElementFigure) figure).setStereotypeDisplay(tag + ("".equals(stereotypesOnlyToDisplay()) ? stereotypesToDisplay : stereotypesToDisplay), imageToDisplay);
+ if (figure instanceof IPapyrusNodeNamedElementFigure) {
refreshAppliedStereotypesProperties((IPapyrusNodeNamedElementFigure) figure);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandComponentEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandComponentEditPolicy.java
index 0026c59984e..6a7c74031a7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandComponentEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandComponentEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -39,13 +39,13 @@ public class InteractionOperandComponentEditPolicy extends ComponentEditPolicy {
*/
@Override
protected Command createDeleteViewCommand(GroupRequest deleteRequest) {
- if(getEditingDomain() != null) {
+ if (getEditingDomain() != null) {
CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
cmd.setTransactionNestingEnabled(false);
cmd.add(new CommandProxy(super.createDeleteViewCommand(deleteRequest)));
- if(getEObject() instanceof InteractionOperand) {
+ if (getEObject() instanceof InteractionOperand) {
// Get the elements associated with the CF
- List<Element> elements = SequenceUtil.getInteractionOperandAssociatedElement((InteractionOperand)getEObject());
+ List<Element> elements = SequenceUtil.getInteractionOperandAssociatedElement((InteractionOperand) getEObject());
// Create the delete view commands
SequenceDeleteHelper.deleteView(cmd, elements, getEditingDomain());
}
@@ -57,16 +57,16 @@ public class InteractionOperandComponentEditPolicy extends ComponentEditPolicy {
/**
* Copy from superclass as visibility is private
- *
+ *
* @return the editing domain
*/
private TransactionalEditingDomain getEditingDomain() {
- if(getHost() instanceof IGraphicalEditPart) {
- return ((IGraphicalEditPart)getHost()).getEditingDomain();
- } else if(getHost() instanceof IEditingDomainProvider) {
- Object domain = ((IEditingDomainProvider)getHost()).getEditingDomain();
- if(domain instanceof TransactionalEditingDomain) {
- return (TransactionalEditingDomain)domain;
+ if (getHost() instanceof IGraphicalEditPart) {
+ return ((IGraphicalEditPart) getHost()).getEditingDomain();
+ } else if (getHost() instanceof IEditingDomainProvider) {
+ Object domain = ((IEditingDomainProvider) getHost()).getEditingDomain();
+ if (domain instanceof TransactionalEditingDomain) {
+ return (TransactionalEditingDomain) domain;
}
}
return null;
@@ -74,12 +74,12 @@ public class InteractionOperandComponentEditPolicy extends ComponentEditPolicy {
/**
* Get the EObject of the host
- *
+ *
* @return the EObject or null
*/
private EObject getEObject() {
- if(getHost() instanceof GraphicalEditPart) {
- return ((GraphicalEditPart)getHost()).resolveSemanticElement();
+ if (getHost() instanceof GraphicalEditPart) {
+ return ((GraphicalEditPart) getHost()).resolveSemanticElement();
}
return null;
}
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 77ff678a270..eba3b00d106 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -40,21 +40,21 @@ public class InteractionOperandDragDropEditPolicy extends ResizableEditPolicy {
*/
@Override
protected Command getResizeCommand(ChangeBoundsRequest request) {
- if((request.getResizeDirection() & PositionConstants.EAST_WEST) != 0) {
+ if ((request.getResizeDirection() & PositionConstants.EAST_WEST) != 0) {
EditPart parent = getHost().getParent().getParent();
return parent.getCommand(request);
} else {
- if(this.getHost() instanceof InteractionOperandEditPart && this.getHost().getParent() instanceof CombinedFragmentCombinedFragmentCompartmentEditPart) {
- InteractionOperandEditPart currentIOEP = (InteractionOperandEditPart)this.getHost();
- CombinedFragmentCombinedFragmentCompartmentEditPart compartEP = (CombinedFragmentCombinedFragmentCompartmentEditPart)this.getHost().getParent();
+ if (this.getHost() instanceof InteractionOperandEditPart && this.getHost().getParent() instanceof CombinedFragmentCombinedFragmentCompartmentEditPart) {
+ InteractionOperandEditPart currentIOEP = (InteractionOperandEditPart) this.getHost();
+ CombinedFragmentCombinedFragmentCompartmentEditPart compartEP = (CombinedFragmentCombinedFragmentCompartmentEditPart) this.getHost().getParent();
// if first interaction operand and resize direction is NORTH
- if(this.getHost() == OperandBoundsComputeHelper.findFirstIOEP(compartEP) && (request.getResizeDirection() & PositionConstants.NORTH) != 0) {
+ if (this.getHost() == OperandBoundsComputeHelper.findFirstIOEP(compartEP) && (request.getResizeDirection() & PositionConstants.NORTH) != 0) {
return getHost().getParent().getParent().getCommand(request);
} else {
int heightDelta = request.getSizeDelta().height();
- if((request.getResizeDirection() & PositionConstants.NORTH) != 0) {
+ if ((request.getResizeDirection() & PositionConstants.NORTH) != 0) {
return OperandBoundsComputeHelper.createIOEPResizeCommand(currentIOEP, heightDelta, compartEP, PositionConstants.NORTH);
- } else if((request.getResizeDirection() & PositionConstants.SOUTH) != 0) {
+ } else if ((request.getResizeDirection() & PositionConstants.SOUTH) != 0) {
return OperandBoundsComputeHelper.createIOEPResizeCommand(currentIOEP, heightDelta, compartEP, PositionConstants.SOUTH);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandLayoutEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandLayoutEditPolicy.java
index 5fb62d00122..b84b2131e1a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandLayoutEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandLayoutEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -41,7 +41,7 @@ public class InteractionOperandLayoutEditPolicy extends XYLayoutEditPolicy {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
EditPolicy result = super.createChildEditPolicy(child);
- if(result == null) {
+ if (result == null) {
return new ResizableShapeEditPolicy();
}
return result;
@@ -55,70 +55,70 @@ public class InteractionOperandLayoutEditPolicy extends XYLayoutEditPolicy {
EditPart combinedFragmentCompartment = getHost().getParent();
EditPart combinedFragment = combinedFragmentCompartment.getParent();
EditPart interactionCompartment = combinedFragment.getParent();
- if(REQ_CREATE.equals(request.getType()) && request instanceof CreateUnspecifiedTypeRequest) {
- if(UMLElementTypes.InteractionOperand_3005.equals(((CreateUnspecifiedTypeRequest)request).getElementTypes().get(0))) {
+ if (REQ_CREATE.equals(request.getType()) && request instanceof CreateUnspecifiedTypeRequest) {
+ if (UMLElementTypes.InteractionOperand_3005.equals(((CreateUnspecifiedTypeRequest) request).getElementTypes().get(0))) {
return combinedFragmentCompartment.getCommand(request);
- } else if(UMLElementTypes.CombinedFragment_3004.equals(((CreateUnspecifiedTypeRequest)request).getElementTypes().get(0))) {
- //Fixed bug about creating on InteractionOperand. (executed Twice).
- //return interactionCompartment.getCommand(request);
- } else if(UMLElementTypes.Lifeline_3001.equals(((CreateUnspecifiedTypeRequest)request).getElementTypes().get(0))) {
+ } else if (UMLElementTypes.CombinedFragment_3004.equals(((CreateUnspecifiedTypeRequest) request).getElementTypes().get(0))) {
+ // Fixed bug about creating on InteractionOperand. (executed Twice).
+ // return interactionCompartment.getCommand(request);
+ } else if (UMLElementTypes.Lifeline_3001.equals(((CreateUnspecifiedTypeRequest) request).getElementTypes().get(0))) {
return interactionCompartment.getCommand(request);
}
- } else if(request instanceof CreateConnectionViewAndElementRequest) {
- CreateConnectionRequest createConnectionRequest = (CreateConnectionRequest)request;
- if(getHost().equals(createConnectionRequest.getSourceEditPart())) {
+ } else if (request instanceof CreateConnectionViewAndElementRequest) {
+ CreateConnectionRequest createConnectionRequest = (CreateConnectionRequest) request;
+ if (getHost().equals(createConnectionRequest.getSourceEditPart())) {
createConnectionRequest.setSourceEditPart(combinedFragment);
}
- if(getHost().equals(createConnectionRequest.getTargetEditPart())) {
+ if (getHost().equals(createConnectionRequest.getTargetEditPart())) {
createConnectionRequest.setTargetEditPart(combinedFragment);
}
return combinedFragment.getCommand(request);
- } else if(request instanceof CreateViewAndElementRequest) {
- //FIXME If necessary
- //Update Bounds and Guides.
- return getCreateCommand((CreateViewAndElementRequest)request);
- } else if(REQ_RESIZE_CHILDREN.equals(request.getType())) {
+ } else if (request instanceof CreateViewAndElementRequest) {
+ // FIXME If necessary
+ // Update Bounds and Guides.
+ return getCreateCommand((CreateViewAndElementRequest) request);
+ } else if (REQ_RESIZE_CHILDREN.equals(request.getType())) {
return interactionCompartment.getCommand(request);
}
return super.getCommand(request);
}
- // /**
- // * Handle combined fragment resize
- // */
- // @Override
- // protected Command getResizeChildrenCommand(ChangeBoundsRequest request) {
- // CompoundCommand compoundCmd = new CompoundCommand();
- // compoundCmd.setLabel("Move or Resize");
+ // /**
+ // * Handle combined fragment resize
+ // */
+ // @Override
+ // protected Command getResizeChildrenCommand(ChangeBoundsRequest request) {
+ // CompoundCommand compoundCmd = new CompoundCommand();
+ // compoundCmd.setLabel("Move or Resize");
//
- // for(Object o : request.getEditParts()) {
- // GraphicalEditPart child = (GraphicalEditPart)o;
- // Object constraintFor = getConstraintFor(request, child);
- // if(constraintFor != null) {
- // if(child instanceof CombinedFragmentEditPart) {
- // Command resizeChildrenCommand = InteractionCompartmentXYLayoutEditPolicy.getCombinedFragmentResizeChildrenCommand(request, (CombinedFragmentEditPart)child);
- // if(resizeChildrenCommand != null && resizeChildrenCommand.canExecute()) {
- // compoundCmd.add(resizeChildrenCommand);
- // }
- // }
+ // for(Object o : request.getEditParts()) {
+ // GraphicalEditPart child = (GraphicalEditPart)o;
+ // Object constraintFor = getConstraintFor(request, child);
+ // if(constraintFor != null) {
+ // if(child instanceof CombinedFragmentEditPart) {
+ // Command resizeChildrenCommand = InteractionCompartmentXYLayoutEditPolicy.getCombinedFragmentResizeChildrenCommand(request, (CombinedFragmentEditPart)child);
+ // if(resizeChildrenCommand != null && resizeChildrenCommand.canExecute()) {
+ // compoundCmd.add(resizeChildrenCommand);
+ // }
+ // }
//
- // Command changeConstraintCommand = createChangeConstraintCommand(request, child, translateToModelConstraint(constraintFor));
- // compoundCmd.add(changeConstraintCommand);
- // }
- // }
- // if(compoundCmd.isEmpty()) {
- // return null;
- // }
- // return compoundCmd.unwrap();
- // }
+ // Command changeConstraintCommand = createChangeConstraintCommand(request, child, translateToModelConstraint(constraintFor));
+ // compoundCmd.add(changeConstraintCommand);
+ // }
+ // }
+ // if(compoundCmd.isEmpty()) {
+ // return null;
+ // }
+ // return compoundCmd.unwrap();
+ // }
@Override
protected Command getOrphanChildrenCommand(Request request) {
- //Do NOT allow orphan Guard.
- if(request instanceof GroupRequest) {
- List editParts = ((GroupRequest)request).getEditParts();
- for(Object object : editParts) {
- if(object instanceof InteractionOperandGuardEditPart) {
+ // Do NOT allow orphan Guard.
+ if (request instanceof GroupRequest) {
+ List editParts = ((GroupRequest) request).getEditParts();
+ for (Object object : editParts) {
+ if (object instanceof InteractionOperandGuardEditPart) {
return UnexecutableCommand.INSTANCE;
}
}
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 b901bddb00c..9112bc1d41b 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2010 Atos Origin.
*
- *
+ *
* 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
@@ -19,9 +19,9 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CustomLifelineEditPar
/**
* This policy is used to automatically move a lifeline when a stereotype is changed.
* this avoids the move of the dash line and its ES.
- *
+ *
* @author mvelten
- *
+ *
*/
public class LifelineAppliedStereotypeNodeLabelDisplayEditPolicy extends AppliedStereotypeNodeLabelDisplayEditPolicy {
@@ -31,8 +31,8 @@ public class LifelineAppliedStereotypeNodeLabelDisplayEditPolicy extends Applied
@Override
public void refreshDisplay() {
super.refreshDisplay();
- if(getHost() instanceof CustomLifelineEditPart) {
- ((CustomLifelineEditPart)getHost()).updateLifelinePosition();
+ if (getHost() instanceof CustomLifelineEditPart) {
+ ((CustomLifelineEditPart) 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 dd3848615f0..db2a06b75d5 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -78,17 +78,17 @@ public class LifelineChildGraphicalNodeEditPolicy extends SequenceGraphicalNodeE
@Override
public Command getCommand(Request request) {
- if(RequestConstants.REQ_CONNECTION_START.equals(request.getType())) {
- if(request instanceof CreateConnectionViewAndElementRequest) {
- return getConnectionAndRelationshipCreateCommand((CreateConnectionViewAndElementRequest)request);
- } else if(request instanceof CreateUnspecifiedTypeConnectionRequest) {
- return getUnspecifiedConnectionCreateCommand((CreateUnspecifiedTypeConnectionRequest)request);
+ if (org.eclipse.gef.RequestConstants.REQ_CONNECTION_START.equals(request.getType())) {
+ if (request instanceof CreateConnectionViewAndElementRequest) {
+ return getConnectionAndRelationshipCreateCommand((CreateConnectionViewAndElementRequest) request);
+ } else if (request instanceof CreateUnspecifiedTypeConnectionRequest) {
+ return getUnspecifiedConnectionCreateCommand((CreateUnspecifiedTypeConnectionRequest) request);
}
- } else if(RequestConstants.REQ_CONNECTION_END.equals(request.getType())) {
- if(request instanceof CreateConnectionViewAndElementRequest) {
- return getConnectionAndRelationshipCompleteCommand((CreateConnectionViewAndElementRequest)request);
- } else if(request instanceof CreateUnspecifiedTypeConnectionRequest) {
- return getUnspecifiedConnectionCompleteCommand((CreateUnspecifiedTypeConnectionRequest)request);
+ } else if (org.eclipse.gef.RequestConstants.REQ_CONNECTION_END.equals(request.getType())) {
+ if (request instanceof CreateConnectionViewAndElementRequest) {
+ return getConnectionAndRelationshipCompleteCommand((CreateConnectionViewAndElementRequest) request);
+ } else if (request instanceof CreateUnspecifiedTypeConnectionRequest) {
+ return getUnspecifiedConnectionCompleteCommand((CreateUnspecifiedTypeConnectionRequest) request);
}
}
return super.getCommand(request);
@@ -98,13 +98,13 @@ public class LifelineChildGraphicalNodeEditPolicy extends SequenceGraphicalNodeE
* Gets the command to start the creation of a new connection and
* relationship (if applicable) for a unspecified type request. This will
* update all the individual requests appropriately.
- *
+ *
* @param request
- * the unspecified type request
+ * the unspecified type request
* @return the command
*/
private Command getUnspecifiedConnectionCreateCommand(final CreateUnspecifiedTypeConnectionRequest request) {
- if(request.isDirectionReversed()) {
+ if (request.isDirectionReversed()) {
return new Command() {
/**
@@ -121,19 +121,19 @@ public class LifelineChildGraphicalNodeEditPolicy extends SequenceGraphicalNodeE
// Get the start command for each individual request, this will
// update each request as required.
final List commands = new ArrayList();
- for(Iterator iter = request.getAllRequests().iterator(); iter.hasNext();) {
- Request individualRequest = (Request)iter.next();
+ for (Iterator iter = request.getAllRequests().iterator(); iter.hasNext();) {
+ Request individualRequest = (Request) iter.next();
Command cmd = null;
- if(individualRequest instanceof CreateConnectionViewAndElementRequest) {
- cmd = getConnectionAndRelationshipCreateCommand((CreateConnectionViewAndElementRequest)individualRequest);
- } else if(individualRequest instanceof CreateConnectionViewRequest) {
- cmd = getConnectionCreateCommand((CreateConnectionViewRequest)individualRequest);
+ if (individualRequest instanceof CreateConnectionViewAndElementRequest) {
+ cmd = getConnectionAndRelationshipCreateCommand((CreateConnectionViewAndElementRequest) individualRequest);
+ } else if (individualRequest instanceof CreateConnectionViewRequest) {
+ cmd = getConnectionCreateCommand((CreateConnectionViewRequest) individualRequest);
}
- if(cmd != null && cmd.canExecute()) {
+ if (cmd != null && cmd.canExecute()) {
commands.add(cmd);
}
}
- if(commands.isEmpty()) {
+ if (commands.isEmpty()) {
// GEF's AbstractConnectionCreationTool expects a null command
// when the gesture should be disabled.
return null;
@@ -146,21 +146,21 @@ 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)
- *
+ *
* @param request
- * the reconnection request
+ * the reconnection request
* @return the command
*/
@Override
protected Command getReconnectSourceCommand(ReconnectRequest request) {
Command command = super.getReconnectSourceCommand(request);
- if(command != null) {
+ if (command != null) {
command = OccurrenceSpecificationMoveHelper.completeReconnectConnectionCommand(command, request, getConnectableEditPart());
- if(request.getConnectionEditPart() instanceof Message4EditPart && request.getTarget() instanceof LifelineEditPart) {
- LifelineEditPart newSource = (LifelineEditPart)request.getTarget();
- LifelineEditPart target = (LifelineEditPart)request.getConnectionEditPart().getTarget();
+ if (request.getConnectionEditPart() instanceof Message4EditPart && request.getTarget() instanceof LifelineEditPart) {
+ LifelineEditPart newSource = (LifelineEditPart) request.getTarget();
+ LifelineEditPart target = (LifelineEditPart) request.getConnectionEditPart().getTarget();
command = LifelineMessageCreateHelper.moveLifelineDown(command, target, newSource.getFigure().getBounds().getLocation().getCopy());
}
}
@@ -169,19 +169,19 @@ 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)
- *
+ *
* @param request
- * the reconnection request
+ * the reconnection request
* @return the command
*/
@Override
protected Command getReconnectTargetCommand(ReconnectRequest request) {
Command command = super.getReconnectTargetCommand(request);
- if(command != null) {
+ if (command != null) {
command = OccurrenceSpecificationMoveHelper.completeReconnectConnectionCommand(command, request, getConnectableEditPart());
- if(request.getConnectionEditPart() instanceof Message4EditPart && request.getTarget() instanceof LifelineEditPart) {
+ if (request.getConnectionEditPart() instanceof Message4EditPart && request.getTarget() instanceof LifelineEditPart) {
command = LifelineMessageCreateHelper.reconnectMessageCreateTarget(request, command);
}
}
@@ -190,33 +190,33 @@ public class LifelineChildGraphicalNodeEditPolicy extends SequenceGraphicalNodeE
/**
* Show the feedback for creating a duration constraint from this edit part
- *
+ *
* @see org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy#showSourceFeedback(org.eclipse.gef.Request)
* @param request
- * creation request
+ * creation request
*/
@Override
public void showSourceFeedback(Request request) {
- if(request instanceof CreateUnspecifiedTypeRequest) {
- Object hintedType = ((CreateUnspecifiedTypeRequest)request).getElementTypes().get(0);
+ if (request instanceof CreateUnspecifiedTypeRequest) {
+ Object hintedType = ((CreateUnspecifiedTypeRequest) request).getElementTypes().get(0);
CreateRequest req = null;
- if(UMLElementTypes.DurationConstraint_3021.equals(hintedType)) {
- req = ((CreateUnspecifiedTypeRequest)request).getRequestForType(UMLElementTypes.DurationConstraint_3021);
- } else if(UMLElementTypes.DurationObservation_3024.equals(hintedType)) {
- req = ((CreateUnspecifiedTypeRequest)request).getRequestForType(UMLElementTypes.DurationObservation_3024);
+ if (UMLElementTypes.DurationConstraint_3021.equals(hintedType)) {
+ req = ((CreateUnspecifiedTypeRequest) request).getRequestForType(UMLElementTypes.DurationConstraint_3021);
+ } else if (UMLElementTypes.DurationObservation_3024.equals(hintedType)) {
+ req = ((CreateUnspecifiedTypeRequest) request).getRequestForType(UMLElementTypes.DurationObservation_3024);
}
- if(req != null) {
+ if (req != null) {
Object initLocation = req.getExtendedData().get(SequenceRequestConstant.OCCURRENCE_SPECIFICATION_LOCATION);
- if(initLocation instanceof Point) {
- Point startPoint = ((Point)initLocation).getCopy();
- Point targetPoint = ((CreateUnspecifiedTypeRequest)request).getLocation().getCopy();
+ if (initLocation instanceof Point) {
+ Point startPoint = ((Point) initLocation).getCopy();
+ Point targetPoint = ((CreateUnspecifiedTypeRequest) request).getLocation().getCopy();
getFeedbackLayer().translateToRelative(startPoint);
getFeedbackLayer().translateToRelative(targetPoint);
- if(durationCreationFeedback == null) {
+ if (durationCreationFeedback == null) {
durationCreationFeedback = new Polyline();
durationCreationFeedback.setLineWidth(1);
durationCreationFeedback.setLineStyle(Graphics.LINE_DASHDOT);
- durationCreationFeedback.setForegroundColor(((IGraphicalEditPart)getHost()).getFigure().getLocalForegroundColor());
+ durationCreationFeedback.setForegroundColor(((IGraphicalEditPart) getHost()).getFigure().getLocalForegroundColor());
addFeedback(durationCreationFeedback);
}
durationCreationFeedback.setStart(startPoint);
@@ -230,15 +230,15 @@ public class LifelineChildGraphicalNodeEditPolicy extends SequenceGraphicalNodeE
/**
* Erase the feedback for creating a duration constraint from this edit part
- *
+ *
* @see org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy#eraseSourceFeedback(org.eclipse.gef.Request)
* @param request
- * creation request
+ * creation request
*/
@Override
public void eraseSourceFeedback(Request request) {
super.eraseSourceFeedback(request);
- if(durationCreationFeedback != null) {
+ if (durationCreationFeedback != null) {
removeFeedback(durationCreationFeedback);
}
durationCreationFeedback = null;
@@ -246,7 +246,7 @@ public class LifelineChildGraphicalNodeEditPolicy extends SequenceGraphicalNodeE
/**
* Get the replacing connection router for routing messages correctly
- *
+ *
* @see org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy#getDummyConnectionRouter(org.eclipse.gef.requests.CreateConnectionRequest)
*/
@Override
@@ -256,59 +256,60 @@ public class LifelineChildGraphicalNodeEditPolicy extends SequenceGraphicalNodeE
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.edit.policies.SequenceGraphicalNodeEditPolicy#getConnectionCompleteCommand(org.eclipse.gef.requests.CreateConnectionRequest)
- *
+ *
* @param request
* @return
*/
@Override
protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
Command command = super.getConnectionCompleteCommand(request);
- if(request instanceof CreateConnectionViewAndElementRequest) {
- CreateConnectionViewAndElementRequest viewRequest = (CreateConnectionViewAndElementRequest)request;
+ if (request instanceof CreateConnectionViewAndElementRequest) {
+ CreateConnectionViewAndElementRequest viewRequest = (CreateConnectionViewAndElementRequest) request;
EditPart sourceEP = viewRequest.getSourceEditPart();
- EObject source = ViewUtil.resolveSemanticElement((View)sourceEP.getModel());
+ EObject source = ViewUtil.resolveSemanticElement((View) sourceEP.getModel());
/*
* Create Graphical Gate if needed, See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=389531
*/
String semanticHint = viewRequest.getConnectionViewAndElementDescriptor().getSemanticHint();
- //Ignore CoRegion.
- if(!(sourceEP instanceof CombinedFragment2EditPart) && (((IHintedType)(UMLElementTypes.Message_4004)).getSemanticHint().equals(semanticHint) || ((IHintedType)(UMLElementTypes.Message_4005)).getSemanticHint().equals(semanticHint))) {
- if(source instanceof CombinedFragment || source instanceof Interaction || source instanceof InteractionUse) {
+ // Ignore CoRegion.
+ if (!(sourceEP instanceof CombinedFragment2EditPart) && (((IHintedType) (UMLElementTypes.Message_4004)).getSemanticHint().equals(semanticHint) || ((IHintedType) (UMLElementTypes.Message_4005)).getSemanticHint().equals(semanticHint))) {
+ if (source instanceof CombinedFragment || source instanceof Interaction || source instanceof InteractionUse) {
CompoundCommand cc = new CompoundCommand("Redirect to Gate");
Point location = null;
- IGraphicalEditPart adapter = (IGraphicalEditPart)sourceEP.getAdapter(IGraphicalEditPart.class);
- if(adapter != null) {
+ IGraphicalEditPart adapter = (IGraphicalEditPart) sourceEP.getAdapter(IGraphicalEditPart.class);
+ if (adapter != null) {
Point sourceLocation = request.getLocation();
Object object = request.getExtendedData().get(SequenceRequestConstant.SOURCE_LOCATION_DATA);
- if(object instanceof Point) {
- sourceLocation = (Point)object;
+ if (object instanceof Point) {
+ sourceLocation = (Point) object;
}
location = GateHelper.computeGateLocation(sourceLocation, adapter.getFigure(), null);
}
ConnectionViewDescriptor edgeAdapter = viewRequest.getConnectionViewDescriptor();
final IAdaptable elementAdapter = edgeAdapter.getElementAdapter();
- if(elementAdapter != null) {
+ if (elementAdapter != null) {
IAdaptable gateAdapter = new IAdaptable() {
+ @Override
public Object getAdapter(Class adapter) {
- if(Gate.class == adapter) {
- Message message = (Message)elementAdapter.getAdapter(Message.class);
+ if (Gate.class == adapter) {
+ Message message = (Message) elementAdapter.getAdapter(Message.class);
MessageEnd sendEvent = message.getSendEvent();
- if(sendEvent instanceof Gate) {
+ if (sendEvent instanceof Gate) {
return sendEvent;
}
}
return null;
}
};
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
CreateGateViewCommand createGateCommand = new CreateGateViewCommand(editingDomain, sourceEP, location, gateAdapter);
cc.add(new ICommandProxy(createGateCommand));
SetConnectionEndsCommand resetSourceCommand = new SetConnectionEndsCommand(editingDomain, null);
resetSourceCommand.setEdgeAdaptor(edgeAdapter);
resetSourceCommand.setNewSourceAdaptor(createGateCommand.getResult());
cc.add(new ICommandProxy(resetSourceCommand));
- if(cc.canExecute()) {
+ if (cc.canExecute()) {
command = command.chain(cc);
}
}
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/LifelineCreationEditPolicy.java
index 2eb9369e79b..e73ad8c0d4b 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/LifelineCreationEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -51,7 +51,7 @@ import org.eclipse.uml2.uml.OccurrenceSpecification;
/**
* A specific creation edit policy for the Lifeline.
* Execution Specification is created graphically on the lifeline, but depending on its graphical position determines also its model container.
- *
+ *
* Occurrence Specification is located on the lifeline, but not visible. Though, elements must be created on it.
*/
public class LifelineCreationEditPolicy extends CreationEditPolicy {
@@ -61,18 +61,18 @@ public class LifelineCreationEditPolicy extends CreationEditPolicy {
// get the element descriptor
CreateElementRequestAdapter requestAdapter = request.getViewAndElementDescriptor().getCreateElementRequestAdapter();
// get the semantic request
- CreateElementRequest createElementRequest = (CreateElementRequest)requestAdapter.getAdapter(CreateElementRequest.class);
- if(createElementRequest.getContainer() == null) {
+ 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();
+ View view = (View) getHost().getModel();
EObject hostElement = ViewUtil.resolveSemanticElement(view);
- if(hostElement == null && view.getElement() == null) {
+ 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) {
+ if (hostElement == null) {
return null;
}
createElementRequest.setContainer(hostElement);
@@ -82,23 +82,23 @@ public class LifelineCreationEditPolicy extends CreationEditPolicy {
extendedData.put(SequenceRequestConstant.INTERACTIONFRAGMENT_CONTAINER, ift);
// record the nearest event if necessary
String requestHint = request.getViewAndElementDescriptor().getSemanticHint();
- if(isCreatedOnOccurrenceSpecification(requestHint)) {
+ if (isCreatedOnOccurrenceSpecification(requestHint)) {
EditPart hostPart = getHost();
- if(hostPart instanceof LifelineEditPart) {
- Entry<Point, List<OccurrenceSpecification>> eventAndLocation = SequenceUtil.findNearestEvent(request.getLocation(), (LifelineEditPart)hostPart);
+ if (hostPart instanceof LifelineEditPart) {
+ Entry<Point, List<OccurrenceSpecification>> eventAndLocation = SequenceUtil.findNearestEvent(request.getLocation(), (LifelineEditPart) hostPart);
// find an event near enough to create the constraint or observation
List<OccurrenceSpecification> events = Collections.emptyList();
Point location = null;
- if(eventAndLocation != null) {
+ if (eventAndLocation != null) {
location = eventAndLocation.getKey();
events = eventAndLocation.getValue();
}
- if(extendedData.containsKey(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2)) {
+ if (extendedData.containsKey(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2)) {
extendedData.put(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2, events);
} else {
extendedData.put(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION, events);
}
- if(extendedData.containsKey(SequenceRequestConstant.OCCURRENCE_SPECIFICATION_LOCATION_2)) {
+ if (extendedData.containsKey(SequenceRequestConstant.OCCURRENCE_SPECIFICATION_LOCATION_2)) {
extendedData.put(SequenceRequestConstant.OCCURRENCE_SPECIFICATION_LOCATION_2, location);
} else {
extendedData.put(SequenceRequestConstant.OCCURRENCE_SPECIFICATION_LOCATION, location);
@@ -107,32 +107,32 @@ public class LifelineCreationEditPolicy extends CreationEditPolicy {
}
// get the create element command based on the elementdescriptor's
// request
- Command createElementCommand = getHost().getCommand(new EditCommandRequestWrapper((CreateElementRequest)requestAdapter.getAdapter(CreateElementRequest.class), request.getExtendedData()));
- if(createElementCommand == null) {
+ Command createElementCommand = getHost().getCommand(new EditCommandRequestWrapper((CreateElementRequest) requestAdapter.getAdapter(CreateElementRequest.class), request.getExtendedData()));
+ if (createElementCommand == null) {
return UnexecutableCommand.INSTANCE;
}
- if(!createElementCommand.canExecute()) {
+ if (!createElementCommand.canExecute()) {
return createElementCommand;
}
// create the semantic create wrapper command
SemanticCreateCommand semanticCommand = new SemanticCreateCommand(requestAdapter, createElementCommand);
Command viewCommand = getCreateCommand(request);
- Command refreshConnectionCommand = getHost().getCommand(new RefreshConnectionsRequest(((List)request.getNewObject())));
+ Command refreshConnectionCommand = getHost().getCommand(new RefreshConnectionsRequest(((List) request.getNewObject())));
// form the compound command and return
CompositeCommand cc = new CompositeCommand(semanticCommand.getLabel());
cc.compose(semanticCommand);
cc.compose(new CommandProxy(viewCommand));
- if(refreshConnectionCommand != null) {
+ if (refreshConnectionCommand != null) {
cc.compose(new CommandProxy(refreshConnectionCommand));
}
- LifelineEditPart parentPart = (LifelineEditPart)getHost();
- IHintedType type = (IHintedType)UMLElementTypes.Lifeline_3001;
- if(type.getSemanticHint().equals(request.getViewAndElementDescriptor().getSemanticHint())) {
+ LifelineEditPart parentPart = (LifelineEditPart) getHost();
+ IHintedType type = (IHintedType) UMLElementTypes.Lifeline_3001;
+ if (type.getSemanticHint().equals(request.getViewAndElementDescriptor().getSemanticHint())) {
setChildLifelineBounds(cc, request, parentPart);
}
- //Ordering fragments after creation, See https://bugs.eclipse.org/bugs/show_bug.cgi?id=403233
+ // Ordering fragments after creation, See https://bugs.eclipse.org/bugs/show_bug.cgi?id=403233
ICommand orderingFragmentsCommand = FragmentsOrdererHelper.createOrderingFragmentsCommand(getHost(), request);
- if(orderingFragmentsCommand != null && orderingFragmentsCommand.canExecute()) {
+ if (orderingFragmentsCommand != null && orderingFragmentsCommand.canExecute()) {
cc.compose(orderingFragmentsCommand);
}
return new ICommandProxy(cc);
@@ -140,7 +140,7 @@ public class LifelineCreationEditPolicy extends CreationEditPolicy {
private void setChildLifelineBounds(CompositeCommand cc, CreateViewAndElementRequest request, LifelineEditPart parentPart) {
Point location = request.getLocation().getCopy();
- LifelineDotLineCustomFigure parentFigure = (LifelineDotLineCustomFigure)parentPart.getContentPane();
+ LifelineDotLineCustomFigure parentFigure = (LifelineDotLineCustomFigure) parentPart.getContentPane();
Rectangle parentBounds = parentFigure.getBounds().getCopy();
parentFigure.translateToAbsolute(parentBounds);
Rectangle childBounds = parentBounds.getCopy();
@@ -154,9 +154,9 @@ public class LifelineCreationEditPolicy extends CreationEditPolicy {
/**
* Return true if creation must be performed on an occurrence specification
- *
+ *
* @param requestHint
- * the hint of object to create
+ * the hint of object to create
* @return true if creation on an occurrence specification
*/
private boolean isCreatedOnOccurrenceSpecification(String requestHint) {
@@ -165,28 +165,28 @@ public class LifelineCreationEditPolicy extends CreationEditPolicy {
/**
* Return true if hint is for creating a duration observation/constraint
- *
+ *
* @param requestHint
- * the hint of object to create
+ * the hint of object to create
* @return true if correct hint
*/
private boolean isDurationHint(String requestHint) {
- String durCstOnLifelineHint = ((IHintedType)UMLElementTypes.DurationConstraint_3021).getSemanticHint();
- String durCstOnMessage = ((IHintedType)UMLElementTypes.DurationConstraint_3023).getSemanticHint();
- String durObsOnMessage = ((IHintedType)UMLElementTypes.DurationObservation_3024).getSemanticHint();
+ String durCstOnLifelineHint = ((IHintedType) UMLElementTypes.DurationConstraint_3021).getSemanticHint();
+ String durCstOnMessage = ((IHintedType) UMLElementTypes.DurationConstraint_3023).getSemanticHint();
+ String durObsOnMessage = ((IHintedType) UMLElementTypes.DurationObservation_3024).getSemanticHint();
return durCstOnLifelineHint.equals(requestHint) || durCstOnMessage.equals(requestHint) || durObsOnMessage.equals(requestHint);
}
/**
* Return true if hint is for creating a time observation/constraint
- *
+ *
* @param requestHint
- * the hint of object to create
+ * the hint of object to create
* @return true if correct hint
*/
private boolean isTimeHint(String requestHint) {
- String timeConstraintHint = ((IHintedType)UMLElementTypes.TimeConstraint_3019).getSemanticHint();
- String timeObservationHint = ((IHintedType)UMLElementTypes.TimeObservation_3020).getSemanticHint();
+ String timeConstraintHint = ((IHintedType) UMLElementTypes.TimeConstraint_3019).getSemanticHint();
+ String timeObservationHint = ((IHintedType) UMLElementTypes.TimeObservation_3020).getSemanticHint();
return timeConstraintHint.equals(requestHint) || timeObservationHint.equals(requestHint);
}
}
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 072df221aab..2fcbac9650c 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -29,7 +29,7 @@ public class LifelineHeadImpactLayoutEditPolicy extends AbstractHeadImpactLayout
@Override
protected int getHeadHeight() {
- CustomLifelineFigure primaryShape = ((CustomLifelineEditPart)getHost()).getPrimaryShape();
+ CustomLifelineFigure primaryShape = ((CustomLifelineEditPart) getHost()).getPrimaryShape();
RectangleFigure figure = primaryShape.getFigureLifelineNameContainerFigure();
Rectangle r = getBoundsRect();
Dimension preferredSize = figure.getPreferredSize(r.width, -1);
@@ -38,7 +38,7 @@ public class LifelineHeadImpactLayoutEditPolicy extends AbstractHeadImpactLayout
@Override
protected void doImpactLayout(int resizeDelta) {
- LifelineHeadUtil.updateHead((LifelineEditPart)getHost(), resizeDelta);
+ LifelineHeadUtil.updateHead((LifelineEditPart) getHost(), resizeDelta);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineLabelEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineLabelEditPolicy.java
index 705575656b2..696138ea76a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineLabelEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineLabelEditPolicy.java
@@ -24,15 +24,15 @@ public class LifelineLabelEditPolicy extends AbstractMaskManagedEditPolicy {
Lifeline lifeline = getUMLElement();
// check host semantic element is not null
- if(lifeline == null) {
+ if (lifeline == null) {
return;
}
// adds a listener to the element itself, and to linked elements, like Type
getDiagramEventBroker().addNotificationListener(lifeline, this);
ConnectableElement ce = lifeline.getRepresents();
- if(ce != null) {
+ if (ce != null) {
getDiagramEventBroker().addNotificationListener(ce, this);
- if(ce.getType() != null) {
+ if (ce.getType() != null) {
getDiagramEventBroker().addNotificationListener(ce.getType(), this);
}
}
@@ -43,14 +43,14 @@ public class LifelineLabelEditPolicy extends AbstractMaskManagedEditPolicy {
super.removeAdditionalListeners();
Lifeline lifeline = getUMLElement();
// check host semantic element is not null
- if(lifeline == null) {
+ if (lifeline == null) {
return;
}
getDiagramEventBroker().removeNotificationListener(lifeline, this);
ConnectableElement ce = lifeline.getRepresents();
- if(ce != null) {
+ if (ce != null) {
getDiagramEventBroker().removeNotificationListener(ce, this);
- if(ce.getType() != null) {
+ if (ce.getType() != null) {
getDiagramEventBroker().removeNotificationListener(ce.getType(), this);
}
}
@@ -60,37 +60,37 @@ public class LifelineLabelEditPolicy extends AbstractMaskManagedEditPolicy {
public void notifyChanged(Notification notification) {
super.notifyChanged(notification);
Object object = notification.getNotifier();
- if(object == null || getUMLElement() == null) {
+ if (object == null || getUMLElement() == null) {
return;
}
- if(notification.getFeature().equals(UMLPackage.eINSTANCE.getNamedElement_Name())) {
+ if (notification.getFeature().equals(UMLPackage.eINSTANCE.getNamedElement_Name())) {
refreshDisplay();
- } else if(notification.getFeature().equals(UMLPackage.Literals.LIFELINE__REPRESENTS)) {
+ } else if (notification.getFeature().equals(UMLPackage.Literals.LIFELINE__REPRESENTS)) {
// change represent element
- if(notification.getNewValue() instanceof ConnectableElement) {
- ConnectableElement ce = (ConnectableElement)notification.getNewValue();
+ if (notification.getNewValue() instanceof ConnectableElement) {
+ ConnectableElement ce = (ConnectableElement) notification.getNewValue();
getDiagramEventBroker().addNotificationListener(ce, this);
- if(ce.getType() != null) {
+ if (ce.getType() != null) {
getDiagramEventBroker().addNotificationListener(ce.getType(), this);
}
}
- if(notification.getOldValue() instanceof ConnectableElement) {
- ConnectableElement ce = (ConnectableElement)notification.getOldValue();
+ if (notification.getOldValue() instanceof ConnectableElement) {
+ ConnectableElement ce = (ConnectableElement) notification.getOldValue();
getDiagramEventBroker().removeNotificationListener(ce, this);
- if(ce.getType() != null) {
+ if (ce.getType() != null) {
getDiagramEventBroker().removeNotificationListener(ce.getType(), this);
}
}
refreshDisplay();
- } else if(isMaskManagedAnnotation(object) || isRemovedMaskManagedLabelAnnotation(object, notification)) {
+ } else if (isMaskManagedAnnotation(object) || isRemovedMaskManagedLabelAnnotation(object, notification)) {
refreshDisplay();
- } else if(object.equals(getUMLElement().getRepresents())) {
+ } else if (object.equals(getUMLElement().getRepresents())) {
// change represent type
- if(notification.getNewValue() instanceof Type && notification.getNewValue() instanceof EObject) {
- getDiagramEventBroker().addNotificationListener((EObject)notification.getNewValue(), this);
+ if (notification.getNewValue() instanceof Type && notification.getNewValue() instanceof EObject) {
+ getDiagramEventBroker().addNotificationListener((EObject) notification.getNewValue(), this);
}
- if(notification.getOldValue() instanceof Type && notification.getOldValue() instanceof EObject) {
- getDiagramEventBroker().removeNotificationListener((EObject)notification.getOldValue(), this);
+ if (notification.getOldValue() instanceof Type && notification.getOldValue() instanceof EObject) {
+ getDiagramEventBroker().removeNotificationListener((EObject) notification.getOldValue(), this);
}
refreshDisplay();
}
@@ -99,11 +99,11 @@ public class LifelineLabelEditPolicy extends AbstractMaskManagedEditPolicy {
@Override
public void refreshDisplay() {
// calls the helper for this edit Part
- LifelineEditPart lp = (LifelineEditPart)getHost();
+ LifelineEditPart lp = (LifelineEditPart) getHost();
List children = lp.getChildren();
- for(Object p : children) {
- if(p instanceof LifelineNameEditPart) {
- LifelineLabelHelper.getInstance().refreshEditPartDisplay((GraphicalEditPart)p);
+ for (Object p : children) {
+ if (p instanceof LifelineNameEditPart) {
+ LifelineLabelHelper.getInstance().refreshEditPartDisplay((GraphicalEditPart) p);
}
}
}
@@ -126,6 +126,6 @@ public class LifelineLabelEditPolicy extends AbstractMaskManagedEditPolicy {
*/
@Override
public Lifeline getUMLElement() {
- return (Lifeline)hostSemanticElement;
+ return (Lifeline) hostSemanticElement;
}
}
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 f52c491fdda..c8f1b0a7572 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
@@ -40,24 +40,26 @@ public class LifelineSelectionEditPolicy extends ResizableEditPolicyEx {
setResizeDirections(PositionConstants.NORTH | PositionConstants.SOUTH | PositionConstants.WEST | PositionConstants.EAST);
}
+ @Override
protected List<?> createSelectionHandles() {
- final LifelineEditPart host = (LifelineEditPart)getHost();
+ final LifelineEditPart host = (LifelineEditPart) getHost();
final LifelineFigure primaryShape = host.getPrimaryShape();
// resizable in at least one direction
List<Handle> list = new ArrayList<Handle>();
// createMoveHandle(list);
final RectangleFigure figure = primaryShape.getFigureLifelineNameContainerFigure();
final Locator locator = new MoveHandleLocator(figure);
- final MoveHandle moveHandle = new MoveHandle((GraphicalEditPart)getHost(), locator);
+ final MoveHandle moveHandle = new MoveHandle((GraphicalEditPart) getHost(), locator);
figure.addFigureListener(new FigureListener() {
+ @Override
public void figureMoved(IFigure source) {
locator.relocate(moveHandle);
}
});
moveHandle.setCursor(Cursors.SIZEALL);
list.add(moveHandle);
-// createResizeHandle(list, PositionConstants.NORTH);
+ // createResizeHandle(list, PositionConstants.NORTH);
final IFigure fig = primaryShape.getFigureLifelineNameContainerFigure();
createResizeHandle(host, list, fig, PositionConstants.WEST);
createResizeHandle(host, list, fig, PositionConstants.EAST);
@@ -68,13 +70,14 @@ public class LifelineSelectionEditPolicy extends ResizableEditPolicyEx {
private void createResizeHandle(LifelineEditPart host, List<Handle> list, IFigure fig, int location) {
final Locator locator = new RelativeHandleLocator(fig, location);
Cursor cursor = Cursors.getDirectionalCursor(location, fig.isMirrored());
- final ResizeHandle westResizer = new ResizeHandle((GraphicalEditPart)host, locator, cursor);
+ final ResizeHandle westResizer = new ResizeHandle(host, locator, cursor);
ResizeTracker resizeTracker = new ResizeTracker(host, location);
westResizer.setDragTracker(resizeTracker);
-
+
final RectangleFigure figure = host.getPrimaryShape().getFigureLifelineNameContainerFigure();
figure.addFigureListener(new FigureListener() {
+ @Override
public void figureMoved(IFigure source) {
locator.relocate(westResizer);
}
@@ -82,20 +85,21 @@ public class LifelineSelectionEditPolicy extends ResizableEditPolicyEx {
list.add(westResizer);
}
+ @Override
protected void showChangeBoundsFeedback(ChangeBoundsRequest request) {
IFigure feedback = getDragSourceFeedbackFigure();
PrecisionRectangle rect = new PrecisionRectangle(getInitialFeedbackBounds().getCopy());
getHostFigure().translateToAbsolute(rect);
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 LifelineEditPart) {
+ // 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 LifelineEditPart) {
skipMinSize = true;
- LifelineEditPart lifelineEP = (LifelineEditPart)this.getHost();
- if(!SequenceUtil.isCreateMessageEndLifeline(lifelineEP)) {
+ LifelineEditPart lifelineEP = (LifelineEditPart) this.getHost();
+ if (!SequenceUtil.isCreateMessageEndLifeline(lifelineEP)) {
request.getMoveDelta().y = 0;
}
- //keepNameLabelBounds(lifelineEP, request, rect);
+ // keepNameLabelBounds(lifelineEP, request, rect);
// restrict child size within parent bounds
keepInParentBounds(lifelineEP, request, rect);
changeCombinedFragmentBounds(request, lifelineEP);
@@ -107,26 +111,28 @@ public class LifelineSelectionEditPolicy extends ResizableEditPolicyEx {
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);
+ // 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);
getHostFigure().translateToAbsolute(min);
getHostFigure().translateToAbsolute(max);
// In manual mode, there is no minimal width, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=383723
- if(min.width > rect.width && !skipMinSize) {
- if(request.getMoveDelta().x > 0 && request.getSizeDelta().width != 0) {
+ if (min.width > rect.width && !skipMinSize) {
+ if (request.getMoveDelta().x > 0 && request.getSizeDelta().width != 0) {
rect.x = right.x - min.width;
request.getMoveDelta().x = rect.x - left.x;
}
rect.width = min.width;
- } else if(max.width < rect.width)
+ } else if (max.width < rect.width) {
rect.width = max.width;
- if(min.height > rect.height)
+ }
+ if (min.height > rect.height) {
rect.height = min.height;
- else if(max.height < rect.height)
+ } else if (max.height < rect.height) {
rect.height = max.height;
+ }
feedback.translateToRelative(rect);
feedback.setBounds(rect);
}
@@ -135,47 +141,48 @@ public class LifelineSelectionEditPolicy extends ResizableEditPolicyEx {
PrecisionRectangle size = getMovedRectangle(rect, request);
Dimension preferSize = lifelineEP.getPrimaryShape().getFigureLifelineNameContainerFigure().getPreferredSize(-1, -1).getCopy();
getHostFigure().translateToAbsolute(preferSize); // handle scale size
- if(size.width < preferSize.width) {
+ if (size.width < preferSize.width) {
request.getSizeDelta().width = preferSize.width - rect.width;
- if(request.getMoveDelta().x > 0)
+ if (request.getMoveDelta().x > 0) {
request.getMoveDelta().x = rect.width - preferSize.width;
+ }
}
}
protected Rectangle getCurrentConstraintFor(GraphicalEditPart child) {
IFigure fig = child.getFigure();
- return (Rectangle)fig.getParent().getLayoutManager().getConstraint(fig);
+ return (Rectangle) fig.getParent().getLayoutManager().getConstraint(fig);
}
private void keepInParentBounds(LifelineEditPart lifelineEP, ChangeBoundsRequest request, PrecisionRectangle rect) {
- if(lifelineEP.getParent() instanceof LifelineEditPart) {
- LifelineEditPart parent = (LifelineEditPart)lifelineEP.getParent();
+ if (lifelineEP.getParent() instanceof LifelineEditPart) {
+ LifelineEditPart parent = (LifelineEditPart) lifelineEP.getParent();
Rectangle p = parent.getFigure().getBounds().getCopy();
parent.getFigure().translateToAbsolute(p);
PrecisionRectangle c = getMovedRectangle(rect, request);
Dimension preferSize = getHostFigure().getPreferredSize();
getHostFigure().translateToAbsolute(preferSize); // handle scale size
- if(request.getType().equals(RequestConstants.REQ_RESIZE)) {
- switch(request.getResizeDirection()) {
+ if (request.getType().equals(RequestConstants.REQ_RESIZE)) {
+ switch (request.getResizeDirection()) {
case PositionConstants.WEST:
- if(c.getLeft().x <= p.getLeft().x) { // exceed left edge
+ if (c.getLeft().x <= p.getLeft().x) { // exceed left edge
int delta = (p.getLeft().x - c.getLeft().x);
request.getMoveDelta().x += delta;
request.getSizeDelta().width -= delta;
}
break;
case PositionConstants.EAST:
- if(c.getRight().x + request.getSizeDelta().width >= p.getRight().x) { // exceed right edge
+ if (c.getRight().x + request.getSizeDelta().width >= p.getRight().x) { // exceed right edge
int delta = (c.getRight().x - p.getRight().x);
request.getSizeDelta().width -= delta;
}
break;
}
} else {
- if(c.getLeft().x <= p.getLeft().x) { // exceed left edge
+ if (c.getLeft().x <= p.getLeft().x) { // exceed left edge
int delta = (p.getLeft().x - c.getLeft().x);
request.getMoveDelta().x += delta;
- } else if(c.getRight().x >= p.getRight().x) { // exceed right edge
+ } else if (c.getRight().x >= p.getRight().x) { // exceed right edge
int delta = (c.getRight().x - p.getRight().x);
request.getMoveDelta().x -= delta;
}
@@ -183,24 +190,24 @@ public class LifelineSelectionEditPolicy extends ResizableEditPolicyEx {
// check lifeline intersect with each other
c = getMovedRectangle(rect, request);
Rectangle other = getLifelineIntersectBounds(lifelineEP, parent, request, c);
- if(other != null) {
- if(request.getSizeDelta().width == 0) { // move only
- //Fixed bug about moving child lifelines, do NOT allow move out now.
- if(request.getMoveDelta().x > 0) { // move right
- if((p.right() - other.right()) > 0) {
+ if (other != null) {
+ if (request.getSizeDelta().width == 0) { // move only
+ // Fixed bug about moving child lifelines, do NOT allow move out now.
+ if (request.getMoveDelta().x > 0) { // move right
+ if ((p.right() - other.right()) > 0) {
request.getMoveDelta().x = other.getRight().x - rect.getLeft().x;
} else {
- request.getMoveDelta().x = 0;//no margin for moving
+ request.getMoveDelta().x = 0;// no margin for moving
}
} else {
- if((other.x - p.x) > 0) {
+ if ((other.x - p.x) > 0) {
request.getMoveDelta().x = other.getLeft().x - rect.getRight().x;
} else {
- request.getMoveDelta().x = 0;//no margin for moving
+ request.getMoveDelta().x = 0;// no margin for moving
}
}
} else {
- if(request.getMoveDelta().x == 0) { // resize right edge
+ if (request.getMoveDelta().x == 0) { // resize right edge
request.getSizeDelta().width = other.getLeft().x - rect.getRight().x;
} else { // resize left edge
request.getMoveDelta().x = other.getRight().x - rect.getLeft().x;
@@ -213,15 +220,16 @@ public class LifelineSelectionEditPolicy extends ResizableEditPolicyEx {
private Rectangle getLifelineIntersectBounds(LifelineEditPart lifelineEP, LifelineEditPart parent, ChangeBoundsRequest request, PrecisionRectangle rect) {
List children = parent.getChildren();
- for(Object o : children)
- if(o instanceof LifelineEditPart && o != lifelineEP) {
- LifelineEditPart p = (LifelineEditPart)o;
+ for (Object o : children) {
+ if (o instanceof LifelineEditPart && o != lifelineEP) {
+ LifelineEditPart p = (LifelineEditPart) o;
Rectangle bounds = p.getFigure().getBounds().getCopy();
p.getFigure().translateToAbsolute(bounds);
- if(bounds.intersects(rect)) {
+ if (bounds.intersects(rect)) {
return bounds;
}
}
+ }
return null;
}
@@ -233,26 +241,27 @@ public class LifelineSelectionEditPolicy extends ResizableEditPolicyEx {
}
private void changeCombinedFragmentBounds(ChangeBoundsRequest request, LifelineEditPart lifelineEP) {
- if(request.getMoveDelta().x > 0) // move right
+ if (request.getMoveDelta().x > 0) {
return;
- View shape = (View)lifelineEP.getModel();
- Lifeline element = (Lifeline)shape.getElement();
+ }
+ View shape = (View) lifelineEP.getModel();
+ Lifeline element = (Lifeline) shape.getElement();
EList<InteractionFragment> covereds = element.getCoveredBys();
EditPart parent = lifelineEP.getParent();
List<?> children = parent.getChildren();
Rectangle bounds = lifelineEP.getFigure().getBounds().getCopy();
bounds.translate(request.getMoveDelta());
Point center = bounds.getCenter();
- for(Object obj : children) {
- if(obj instanceof CombinedFragmentEditPart) {
- CombinedFragmentEditPart et = (CombinedFragmentEditPart)obj;
- View sp = (View)et.getModel();
- if(!covereds.contains(sp.getElement())) {
+ for (Object obj : children) {
+ if (obj instanceof CombinedFragmentEditPart) {
+ CombinedFragmentEditPart et = (CombinedFragmentEditPart) obj;
+ View sp = (View) et.getModel();
+ if (!covereds.contains(sp.getElement())) {
continue;
}
- //If the center vertical line is covered by the CombibedFragment, do NOT move the CF again.
- Rectangle rect = ((GraphicalEditPart)et).getFigure().getBounds();
- if(rect.x < center.x && rect.right() > center.x) {
+ // If the center vertical line is covered by the CombibedFragment, do NOT move the CF again.
+ Rectangle rect = ((GraphicalEditPart) et).getFigure().getBounds();
+ if (rect.x < center.x && rect.right() > center.x) {
continue;
}
changeCombinedFragmentBounds(request, et, lifelineEP);
@@ -270,10 +279,10 @@ public class LifelineSelectionEditPolicy extends ResizableEditPolicyEx {
void changeCombinedFragmentBounds(ChangeBoundsRequest request, CombinedFragmentEditPart cep, LifelineEditPart lifelineEP) {
Rectangle rect = getTransformedRectangle(cep, request);
- if(rect.x <= 0) {
- if(maxMoveDelta != null)
+ if (rect.x <= 0) {
+ if (maxMoveDelta != null) {
request.getMoveDelta().x = maxMoveDelta.x;
- else {
+ } else {
Point p = new Point(Math.abs(rect.x), 0);
cep.getFigure().translateToAbsolute(p);
request.getMoveDelta().x = Math.min(0, request.getMoveDelta().x + p.x);
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/LifelineXYLayoutEditPolicy.java
index b0ba4e6f41d..acdb91b3fa3 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/LifelineXYLayoutEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -86,41 +86,41 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
/** The default spacing used between Execution Specification */
private final static int SPACING_HEIGHT = 5;
- // private final static int MAX_CHILD_EXECUTION_DEPTH = 4;
+ // private final static int MAX_CHILD_EXECUTION_DEPTH = 4;
// force location of time/duration elements and ES
- private static final String TIME_CONSTRAINT_HINT = ((IHintedType)UMLElementTypes.TimeConstraint_3019).getSemanticHint();
+ private static final String TIME_CONSTRAINT_HINT = ((IHintedType) UMLElementTypes.TimeConstraint_3019).getSemanticHint();
- private static final String TIME_OBSERVATION_HINT = ((IHintedType)UMLElementTypes.TimeObservation_3020).getSemanticHint();
+ private static final String TIME_OBSERVATION_HINT = ((IHintedType) UMLElementTypes.TimeObservation_3020).getSemanticHint();
- private static final String DURATION_CONSTRAINT_ON_LIFELINE_HINT = ((IHintedType)UMLElementTypes.DurationConstraint_3021).getSemanticHint();
+ private static final String DURATION_CONSTRAINT_ON_LIFELINE_HINT = ((IHintedType) UMLElementTypes.DurationConstraint_3021).getSemanticHint();
- private static final String ACTION_EXECUTION_SPECIFICATION_HINT = ((IHintedType)UMLElementTypes.ActionExecutionSpecification_3006).getSemanticHint();
+ private static final String ACTION_EXECUTION_SPECIFICATION_HINT = ((IHintedType) UMLElementTypes.ActionExecutionSpecification_3006).getSemanticHint();
- private static final String BEHAVIOR_EXECUTION_SPECIFICATION_HINT = ((IHintedType)UMLElementTypes.BehaviorExecutionSpecification_3003).getSemanticHint();
+ private static final String BEHAVIOR_EXECUTION_SPECIFICATION_HINT = ((IHintedType) UMLElementTypes.BehaviorExecutionSpecification_3003).getSemanticHint();
- private static final String CO_REGION_HINT = ((IHintedType)UMLElementTypes.CombinedFragment_3018).getSemanticHint();
+ private static final String CO_REGION_HINT = ((IHintedType) UMLElementTypes.CombinedFragment_3018).getSemanticHint();
@Override
public EditPart getTargetEditPart(Request request) {
EditPart targetEditPart = super.getTargetEditPart(request);
- if(targetEditPart instanceof CustomLifelineEditPart) {
- CustomLifelineEditPart lifelineEditPart = (CustomLifelineEditPart)targetEditPart;
- if(lifelineEditPart.isInlineMode()) {
+ if (targetEditPart instanceof CustomLifelineEditPart) {
+ CustomLifelineEditPart lifelineEditPart = (CustomLifelineEditPart) targetEditPart;
+ if (lifelineEditPart.isInlineMode()) {
Point location = null;
- if(request instanceof DropRequest) {
- location = ((DropRequest)request).getLocation();
+ if (request instanceof DropRequest) {
+ location = ((DropRequest) request).getLocation();
}
- if(location != null) {
+ if (location != null) {
List children = lifelineEditPart.getChildren();
- for(Object object : children) {
- if(!(object instanceof CustomLifelineEditPart)) {
+ for (Object object : children) {
+ if (!(object instanceof CustomLifelineEditPart)) {
continue;
}
- CustomLifelineEditPart child = (CustomLifelineEditPart)object;
+ CustomLifelineEditPart child = (CustomLifelineEditPart) object;
IFigure figure = child.getFigure();
Point pt = location.getCopy();
figure.translateToRelative(pt);
- if(figure.containsPoint(pt)) {
+ if (figure.containsPoint(pt)) {
return child;
}
}
@@ -133,13 +133,13 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
@Override
protected Command getOrphanChildrenCommand(Request request) {
- //Don't support, this will disable the createAddCommand(), too.
+ // Don't support, this will disable the createAddCommand(), too.
return UnexecutableCommand.INSTANCE;
}
@Override
protected Command createAddCommand(EditPart child, Object constraint) {
- //Don't supported.
+ // Don't supported.
return null;
}
@@ -149,47 +149,47 @@ 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 CustomLifelineEditPart && targetEditPart.getParent() instanceof CustomLifelineEditPart) {
Point location = request.getLocation();
- IFigure figure = ((CustomLifelineEditPart)targetEditPart).getPrimaryShape();
+ IFigure figure = ((CustomLifelineEditPart) targetEditPart).getPrimaryShape();
Point pt = location.getCopy();
figure.translateToRelative(pt);
- if(!figure.containsPoint(pt)) {
+ if (!figure.containsPoint(pt)) {
return UnexecutableCommand.INSTANCE;
}
}
- if(request instanceof CreateViewRequest) {
- CreateViewRequest cvr = (CreateViewRequest)request;
- if(cvr.getViewDescriptors().size() > 0) {
+ if (request instanceof CreateViewRequest) {
+ CreateViewRequest cvr = (CreateViewRequest) request;
+ if (cvr.getViewDescriptors().size() > 0) {
ViewDescriptor viewDescriptor = cvr.getViewDescriptors().iterator().next();
String semanticHint = viewDescriptor.getSemanticHint();
- if(TIME_CONSTRAINT_HINT.equals(semanticHint) || TIME_OBSERVATION_HINT.equals(semanticHint)) {
+ if (TIME_CONSTRAINT_HINT.equals(semanticHint) || TIME_OBSERVATION_HINT.equals(semanticHint)) {
Command cmd = getCommandForTimeObservationOrConstraint(cvr, viewDescriptor);
- if(cmd != null) {
+ if (cmd != null) {
return cmd;
}
}
- if(DURATION_CONSTRAINT_ON_LIFELINE_HINT.equals(semanticHint)) {
+ if (DURATION_CONSTRAINT_ON_LIFELINE_HINT.equals(semanticHint)) {
Command cmd = getCommandForDurationConstraint(cvr, viewDescriptor);
- if(cmd != null) {
+ if (cmd != null) {
return cmd;
}
}
- if(ACTION_EXECUTION_SPECIFICATION_HINT.equals(semanticHint) || BEHAVIOR_EXECUTION_SPECIFICATION_HINT.equals(semanticHint)) {
+ if (ACTION_EXECUTION_SPECIFICATION_HINT.equals(semanticHint) || BEHAVIOR_EXECUTION_SPECIFICATION_HINT.equals(semanticHint)) {
Command cmd = getCommandForExecutionSpecificationCreation(cvr, viewDescriptor);
- if(cmd != null) {
+ if (cmd != null) {
return cmd;
}
}
- if(CO_REGION_HINT.equals(semanticHint)) {
+ if (CO_REGION_HINT.equals(semanticHint)) {
Command cmd = getCommandForCoRegionCreation(cvr, viewDescriptor);
- if(cmd != null) {
+ if (cmd != null) {
return cmd;
}
}
- if(UMLVisualIDRegistry.getType(StateInvariantEditPart.VISUAL_ID).equals(semanticHint)) {
+ if (UMLVisualIDRegistry.getType(StateInvariantEditPart.VISUAL_ID).equals(semanticHint)) {
Command cmd = getCommandForStateInvariant(cvr, viewDescriptor);
- if(cmd != null) {
+ if (cmd != null) {
return cmd;
}
}
@@ -203,34 +203,34 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
*/
private Command getCommandForStateInvariant(CreateViewRequest cvr, ViewDescriptor viewDescriptor) {
Rectangle newBounds = new Rectangle();
- if(cvr.getLocation() != null) {
+ if (cvr.getLocation() != null) {
newBounds.setLocation(cvr.getLocation());
}
- if(cvr.getSize() != null) {
+ if (cvr.getSize() != null) {
newBounds.setSize(cvr.getSize());
} else {
newBounds.width = -1;
newBounds.height = -1;
}
- if(newBounds.x < 0 || newBounds.y < 0) {
+ if (newBounds.x < 0 || newBounds.y < 0) {
newBounds.x = newBounds.y = 0;
}
- LifelineEditPart parent = (LifelineEditPart)getHost();
+ LifelineEditPart parent = (LifelineEditPart) getHost();
IFigure mainFigure = parent.getMainFigure();
mainFigure.translateToRelative(newBounds);
- // mainFigure.translateFromParent(newBounds);
+ // mainFigure.translateFromParent(newBounds);
Rectangle bounds = mainFigure.getBounds().getCopy();
Point t = mainFigure.getClientArea().getLocation().getNegated();
newBounds.performTranslate(t.x, t.y);
newBounds.translate(0, bounds.y);
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
return new ICommandProxy(new SetBoundsCommand(editingDomain, DiagramUIMessages.SetLocationCommand_Label_Resize, viewDescriptor, newBounds));
}
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case StateInvariantEditPart.VISUAL_ID:
return new StateInvariantResizableEditPolicy();
case DestructionOccurrenceSpecificationEditPart.VISUAL_ID:
@@ -243,23 +243,23 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
protected Rectangle getCurrentConstraintFor(GraphicalEditPart child) {
IFigure fig = child.getFigure();
Object con = fig.getParent().getLayoutManager().getConstraint(fig);
- if(con instanceof Rectangle) {
- return (Rectangle)con;
+ if (con instanceof Rectangle) {
+ return (Rectangle) con;
}
return fig.getBounds();
}
@Override
protected Object getConstraintFor(CreateRequest request) {
- Rectangle constraint = (Rectangle)super.getConstraintFor(request);
- if(request instanceof CreateViewAndElementRequest) {
- CreateViewAndElementRequest req = (CreateViewAndElementRequest)request;
- IHintedType type = (IHintedType)UMLElementTypes.Lifeline_3001;
- if(type.getSemanticHint().equals(req.getViewAndElementDescriptor().getSemanticHint())) {
+ Rectangle constraint = (Rectangle) super.getConstraintFor(request);
+ if (request instanceof CreateViewAndElementRequest) {
+ CreateViewAndElementRequest req = (CreateViewAndElementRequest) request;
+ IHintedType type = (IHintedType) UMLElementTypes.Lifeline_3001;
+ if (type.getSemanticHint().equals(req.getViewAndElementDescriptor().getSemanticHint())) {
constraint.y = 0; // fix layout offset
}
- String destructionHint = ((IHintedType)UMLElementTypes.DestructionOccurrenceSpecification_3022).getSemanticHint();
- if(destructionHint.equals(req.getViewAndElementDescriptor().getSemanticHint()) && constraint.width < 0 && constraint.height < 0) {
+ String destructionHint = ((IHintedType) UMLElementTypes.DestructionOccurrenceSpecification_3022).getSemanticHint();
+ if (destructionHint.equals(req.getViewAndElementDescriptor().getSemanticHint()) && constraint.width < 0 && constraint.height < 0) {
constraint.width = constraint.height = 20;// set initial size, same as DestructionOccurrenceSpecificationPreferencePage
}
}
@@ -281,29 +281,29 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
private Command getCommandForCoRegionCreation(CreateViewRequest cvr, ViewDescriptor viewDescriptor) {
Rectangle newBounds = new Rectangle();
- if(cvr.getLocation() != null) {
+ if (cvr.getLocation() != null) {
newBounds.setLocation(cvr.getLocation());
}
- if(cvr.getSize() != null) {
+ if (cvr.getSize() != null) {
newBounds.setSize(cvr.getSize());
} else {
newBounds.width = -1;
newBounds.height = -1;
}
- if(newBounds.x < 0 || newBounds.y < 0) {
+ if (newBounds.x < 0 || newBounds.y < 0) {
newBounds.x = newBounds.y = 0;
}
- newBounds = getNewBoundsForCoRegion((LifelineEditPart)getHost(), newBounds);
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ newBounds = getNewBoundsForCoRegion((LifelineEditPart) getHost(), newBounds);
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
return new ICommandProxy(new SetBoundsCommand(editingDomain, DiagramUIMessages.SetLocationCommand_Label_Resize, viewDescriptor, newBounds));
}
private Rectangle getCreateExecuteSpecificationBounds(Point location, Dimension size, String semanticHint) {
Point newLocation = location == null ? new Point() : location.getCopy();
- if(newLocation.x < 0 || newLocation.y < 0) {
+ if (newLocation.x < 0 || newLocation.y < 0) {
newLocation.x = newLocation.y = 0;
}
- LifelineEditPart editPart = (LifelineEditPart)getHost();
+ LifelineEditPart editPart = (LifelineEditPart) getHost();
// Get the dotline figure
LifelineDotLineFigure figureLifelineDotLineFigure = editPart.getPrimaryShape().getFigureLifelineDotLineFigure();
List<ShapeNodeEditPart> executionSpecificationList = LifelineEditPartUtil.getChildShapeNodeEditPart(editPart);
@@ -312,11 +312,11 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
Rectangle dotLineFigureBounds = figureLifelineDotLineFigure.getBounds();
// If we are creating an ES from the popup menu bar
// We need to get a valid location to be able to create the ES figure
- if(newLocation.y < dotLineFigureBounds.y) {
+ if (newLocation.y < dotLineFigureBounds.y) {
int max = dotLineFigureBounds.y;
- for(ShapeNodeEditPart sp : executionSpecificationList) {
+ for (ShapeNodeEditPart sp : executionSpecificationList) {
int figureBottom = sp.getFigure().getBounds().y + sp.getFigure().getBounds().height;
- if(figureBottom > max) {
+ if (figureBottom > max) {
max = figureBottom;
}
}
@@ -332,7 +332,7 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
}
private ShapeNodeEditPart getParentWhenCreationExecuteSpecification(Point location, Dimension size, String semanticHint) {
- LifelineEditPart lifelineEditPart = (LifelineEditPart)getHost();
+ LifelineEditPart lifelineEditPart = (LifelineEditPart) getHost();
// Get the dotline figure
LifelineDotLineFigure figureLifelineDotLineFigure = lifelineEditPart.getPrimaryShape().getFigureLifelineDotLineFigure();
Point newLocation = location.getCopy();
@@ -340,14 +340,14 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
List<ShapeNodeEditPart> executionSpecificationList = LifelineEditPartUtil.getChildShapeNodeEditPart(lifelineEditPart);
ShapeNodeEditPart parent = null;
double distance = 0;
- for(ShapeNodeEditPart externalExecutionSpecificationEP : executionSpecificationList) {
+ for (ShapeNodeEditPart externalExecutionSpecificationEP : executionSpecificationList) {
IFigure figure = externalExecutionSpecificationEP.getFigure();
Rectangle bounds = figure.getBounds().getCopy();
- if(!bounds.contains(newLocation) || bounds.x > newLocation.x) {
+ if (!bounds.contains(newLocation) || bounds.x > newLocation.x) {
continue;
}
double newDistance = bounds.getLocation().getDistance(newLocation);
- if(distance == 0 || newDistance < distance) {
+ if (distance == 0 || newDistance < distance) {
parent = externalExecutionSpecificationEP;
distance = newDistance;
}
@@ -356,7 +356,7 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
}
private Command getCommandForExecutionSpecificationCreation(CreateViewRequest cvr, ViewDescriptor viewDescriptor) {
- LifelineEditPart editPart = (LifelineEditPart)getHost();
+ LifelineEditPart editPart = (LifelineEditPart) getHost();
List<ShapeNodeEditPart> executionSpecificationList = LifelineEditPartUtil.getChildShapeNodeEditPart(editPart);
Point location = cvr.getLocation();
Dimension size = cvr.getSize();
@@ -367,7 +367,7 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
LifelineDotLineFigure figureLifelineDotLineFigure = editPart.getPrimaryShape().getFigureLifelineDotLineFigure();
Rectangle dotLineBounds = figureLifelineDotLineFigure.getBounds();
ShapeNodeEditPart parent = getParentWhenCreationExecuteSpecification(location, size, semanticHint);
- if(parent != null) {
+ if (parent != null) {
Rectangle parentBounds = parent.getFigure().getBounds();
int width = parentBounds.width > 0 ? parentBounds.width : EXECUTION_INIT_WIDTH;
newBounds.x = parentBounds.x + width / 2 + 1;
@@ -377,14 +377,14 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
}
newBounds.x -= dotLineBounds.x;
newBounds.y -= dotLineBounds.y;
- // newBounds = getExecutionSpecificationNewBounds(true, editPart, new Rectangle(), newBounds, new ArrayList<ShapeNodeEditPart>(0), true);
- // if(newBounds == null) {
- // return UnexecutableCommand.INSTANCE;
- // }
+ // newBounds = getExecutionSpecificationNewBounds(true, editPart, new Rectangle(), newBounds, new ArrayList<ShapeNodeEditPart>(0), true);
+ // if(newBounds == null) {
+ // return UnexecutableCommand.INSTANCE;
+ // }
Command p = new ICommandProxy(new SetBoundsCommand(editPart.getEditingDomain(), "Creation of an ExecutionSpecification", viewDescriptor, newBounds));
// resize parent bar
- if(parent != null) {
- p = p.chain(resizeParentExecutionSpecification((LifelineEditPart)getHost(), parent, newBounds.getCopy(), executionSpecificationList));
+ if (parent != null) {
+ p = p.chain(resizeParentExecutionSpecification((LifelineEditPart) getHost(), parent, newBounds.getCopy(), executionSpecificationList));
}
return p;
}
@@ -394,7 +394,7 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
childBounds.x = bounds.x;
childBounds.width = bounds.width;
Rectangle rect = bounds.getCopy();
- if(childBounds.y > rect.y) {
+ if (childBounds.y > rect.y) {
return null;
}
rect.height += rect.y - childBounds.y;
@@ -404,7 +404,7 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
Command c = new ICommandProxy(new SetBoundsCommand(part.getEditingDomain(), "Resize of Parent Bar", part, newBounds.getCopy()));
command.add(c);
Point moveDelta = new Point(newBounds.x - bounds.x, newBounds.y - bounds.y);
- if(moveDelta.y != 0) {
+ if (moveDelta.y != 0) {
ChangeBoundsRequest request = new ChangeBoundsRequest();
request.setEditParts(part);
request.setMoveDelta(moveDelta);
@@ -412,7 +412,7 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
}
list.remove(part);
ShapeNodeEditPart parent = getParent(lifelinePart, part.getFigure().getBounds(), list);
- if(parent == null) {
+ if (parent == null) {
return command.unwrap();
}
return command.unwrap().chain(resizeParentExecutionSpecification(lifelinePart, parent, newBounds.getCopy(), list));
@@ -420,23 +420,23 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
/**
* Get the command for setting initial bounds of a Time Observation or Constraint representation
- *
+ *
* @param cver
- * the request
+ * the request
* @return command or null if none is appropriate
*/
private Command getCommandForTimeObservationOrConstraint(CreateViewRequest cvr, ViewDescriptor viewDescriptor) {
Object loc = cvr.getExtendedData().get(SequenceRequestConstant.OCCURRENCE_SPECIFICATION_LOCATION);
- if(loc instanceof Point) {
- IFigure parentFigure = ((IGraphicalEditPart)getHost()).getFigure();
- Point referencePoint = ((Point)loc).getCopy();
+ if (loc instanceof Point) {
+ IFigure parentFigure = ((IGraphicalEditPart) getHost()).getFigure();
+ Point referencePoint = ((Point) loc).getCopy();
parentFigure.translateToRelative(referencePoint);
referencePoint.translate(parentFigure.getBounds().getLocation().getCopy().negate());
// Get the height of the element
int newHeight = getFigureHeight(viewDescriptor.getSemanticHint(), cvr.getSize());
// Define the bounds of the new time element
Rectangle newBounds = new Rectangle(referencePoint.x, referencePoint.y - newHeight / 2, -1, newHeight);
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
return new ICommandProxy(new SetBoundsCommand(editingDomain, DiagramUIMessages.SetLocationCommand_Label_Resize, viewDescriptor, newBounds));
}
return null;
@@ -444,37 +444,37 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
/**
* Get the command for setting initial bounds of a Duration Constraint representation
- *
+ *
* @param cver
- * the request
+ * the request
* @return command or null if none is appropriate
*/
private Command getCommandForDurationConstraint(CreateViewRequest cvr, ViewDescriptor viewDescriptor) {
Object locTop = cvr.getExtendedData().get(SequenceRequestConstant.OCCURRENCE_SPECIFICATION_LOCATION);
Object locBottom = cvr.getExtendedData().get(SequenceRequestConstant.OCCURRENCE_SPECIFICATION_LOCATION_2);
- if(locTop instanceof Point && locBottom instanceof Point) {
- IFigure parentFigure = ((IGraphicalEditPart)getHost()).getFigure();
- Point referenceTop = ((Point)locTop).getCopy();
- Point referenceBottom = ((Point)locBottom).getCopy();
+ if (locTop instanceof Point && locBottom instanceof Point) {
+ IFigure parentFigure = ((IGraphicalEditPart) getHost()).getFigure();
+ Point referenceTop = ((Point) locTop).getCopy();
+ Point referenceBottom = ((Point) locBottom).getCopy();
// Get the height of the element
int newHeight = referenceBottom.y - referenceTop.y;
- if(newHeight > 0) {
+ if (newHeight > 0) {
parentFigure.translateToRelative(referenceTop);
Point parentFigDelta = parentFigure.getBounds().getLocation().getCopy().negate();
referenceTop.translate(parentFigDelta);
// Define the bounds of the new time element
Rectangle newBounds = new Rectangle(referenceTop.x, referenceTop.y, -1, newHeight);
- newBounds = CustomDurationConstraintEditPart.fixMessageBounds(newBounds, cvr, (LifelineEditPart)getHost());
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ newBounds = CustomDurationConstraintEditPart.fixMessageBounds(newBounds, cvr, (LifelineEditPart) getHost());
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
return new ICommandProxy(new SetBoundsCommand(editingDomain, DiagramUIMessages.SetLocationCommand_Label_Resize, viewDescriptor, newBounds));
- } else if(newHeight < 0) {
+ } else if (newHeight < 0) {
parentFigure.translateToRelative(referenceBottom);
Point parentFigDelta = parentFigure.getBounds().getLocation().getCopy().negate();
referenceBottom.translate(parentFigDelta);
// Define the bounds of the new time element
Rectangle newBounds = new Rectangle(referenceBottom.x, referenceBottom.y, -1, -newHeight);
- newBounds = CustomDurationConstraintEditPart.fixMessageBounds(newBounds, cvr, (LifelineEditPart)getHost());
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ newBounds = CustomDurationConstraintEditPart.fixMessageBounds(newBounds, cvr, (LifelineEditPart) getHost());
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
return new ICommandProxy(new SetBoundsCommand(editingDomain, DiagramUIMessages.SetLocationCommand_Label_Resize, viewDescriptor, newBounds));
}
}
@@ -483,17 +483,17 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
/**
* Get the adapted height, taking in account the represented figure
- *
+ *
* @param cr
- * the create request
+ * the create request
* @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;
- if(TIME_OBSERVATION_HINT.equals(semanticHint) || TIME_CONSTRAINT_HINT.equals(semanticHint)) {
+ 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;
- } else if(size != null) {
+ } else if (size != null) {
// heigh from request
newHeight = size.height;
} else {
@@ -507,32 +507,32 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
* positioned within a Lifeline EditPart. The notToCheckList is needed to avoid checking those
* ExecutionSpecification EditParts. The returned bounds are relative to the Lifeline figure so
* they can be used, directly, within a SetBoundsCommand.
- *
+ *
* @param lifelineEP
- * the lifeline ep
+ * the lifeline ep
* @param oldBounds
- * The old bounds of the ES
+ * The old bounds of the ES
* @param newBounds
- * The new initial bounds
+ * The new initial bounds
* @param notToCheckExecutionSpecificationList
- * The ExecutionSpecification EditPart's List that won't be checked
- *
+ * The ExecutionSpecification EditPart's List that won't be checked
+ *
* @return The new bounds of the executionSpecificationEP figure
*/
protected final static Rectangle getExecutionSpecificationNewBounds(boolean isMove, LifelineEditPart lifelineEP, Rectangle oldBounds, Rectangle newBounds, List<ShapeNodeEditPart> notToCheckExecutionSpecificationList, boolean useFixedXPos) {
// Lifeline's figure where the child is drawn
Rectangle dotLineBounds = lifelineEP.getPrimaryShape().getFigureLifelineDotLineFigure().getBounds();
// if ExecutionSpecification is resize outside of the lifeline bounds
- if(newBounds.y <= dotLineBounds.y || newBounds.x < dotLineBounds.x || newBounds.x > dotLineBounds.right()) {
+ if (newBounds.y <= dotLineBounds.y || newBounds.x < dotLineBounds.x || newBounds.x > dotLineBounds.right()) {
return null;
}
List<ShapeNodeEditPart> toCheckExecutionSpecificationList = LifelineEditPartUtil.getChildShapeNodeEditPart(lifelineEP);
toCheckExecutionSpecificationList.removeAll(notToCheckExecutionSpecificationList);
- if(isMove) {
+ if (isMove) {
ShapeNodeEditPart parent = getParent(lifelineEP, newBounds, toCheckExecutionSpecificationList);
- if(useFixedXPos) {
+ if (useFixedXPos) {
newBounds.x = oldBounds.x;
- } else if(parent == null) {
+ } else if (parent == null) {
// No mother, center position
int width = newBounds.width > 0 ? newBounds.width : EXECUTION_INIT_WIDTH;
newBounds.x = dotLineBounds.x + dotLineBounds.width / 2 - width / 2;
@@ -544,11 +544,11 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
} else {
ShapeNodeEditPart oldParent = getParent(lifelineEP, oldBounds, toCheckExecutionSpecificationList);
// forbid resize if the new bounds exceed Y-wise the bounds of a non-parent ES
- for(ShapeNodeEditPart esPart : toCheckExecutionSpecificationList) {
+ for (ShapeNodeEditPart esPart : toCheckExecutionSpecificationList) {
Rectangle esBounds = esPart.getFigure().getBounds();
int esYBottom = esBounds.y + esBounds.height;
- if(esPart != oldParent) {
- if(((oldBounds.y + oldBounds.height) <= esBounds.y && (newBounds.y + newBounds.height) >= esBounds.y) || (oldBounds.y >= esYBottom && newBounds.y <= esYBottom)) {
+ if (esPart != oldParent) {
+ if (((oldBounds.y + oldBounds.height) <= esBounds.y && (newBounds.y + newBounds.height) >= esBounds.y) || (oldBounds.y >= esYBottom && newBounds.y <= esYBottom)) {
return null;
}
}
@@ -566,9 +566,9 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
@Override
protected Command getResizeChildrenCommand(ChangeBoundsRequest request) {
// This policy is hosted in a LifelineEditPart
- LifelineEditPart lifelineEP = (LifelineEditPart)getHost();
+ LifelineEditPart lifelineEP = (LifelineEditPart) getHost();
Command command = getResizeOrMoveChildrenCommand(lifelineEP, request, false, true, false);
- if(command == null) {
+ if (command == null) {
command = super.getResizeChildrenCommand(request);
}
return command;
@@ -580,9 +580,9 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
@Override
protected Command getMoveChildrenCommand(Request request) {
// This policy is hosted in a LifelineEditPart
- LifelineEditPart lifelineEP = (LifelineEditPart)getHost();
- Command command = getResizeOrMoveChildrenCommand(lifelineEP, (ChangeBoundsRequest)request, true, true, false);
- if(command == null) {
+ LifelineEditPart lifelineEP = (LifelineEditPart) getHost();
+ Command command = getResizeOrMoveChildrenCommand(lifelineEP, (ChangeBoundsRequest) request, true, true, false);
+ if (command == null) {
command = super.getMoveChildrenCommand(request);
}
return command;
@@ -591,14 +591,14 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
@SuppressWarnings("unchecked")
public static Command getResizeOrMoveChildrenCommand(LifelineEditPart lifelineEP, ChangeBoundsRequest request, boolean isMove, boolean updateEnclosingInteraction, boolean useFixedXPos) {
List<EditPart> editParts = request.getEditParts();
- if(editParts != null) {
+ if (editParts != null) {
CompoundCommand compoundCmd = new CompoundCommand();
compoundCmd.setLabel("Move or resize");
compoundCmd.setDebugLabel("Debug: Move or resize of an ExecutionSpecification");
- for(EditPart ep : editParts) {
- if(ep instanceof ActionExecutionSpecificationEditPart || ep instanceof BehaviorExecutionSpecificationEditPart) {
+ for (EditPart ep : editParts) {
+ if (ep instanceof ActionExecutionSpecificationEditPart || ep instanceof BehaviorExecutionSpecificationEditPart) {
// an execution specification have been moved or resized
- ShapeNodeEditPart executionSpecificationEP = (ShapeNodeEditPart)ep;
+ ShapeNodeEditPart executionSpecificationEP = (ShapeNodeEditPart) ep;
// Check if height is within the limits of the figure
Dimension newSizeDelta = adaptSizeDeltaToMaxHeight(executionSpecificationEP.getFigure(), request.getSizeDelta());
// Current bounds of the ExecutionSpecification
@@ -606,16 +606,16 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
Rectangle newBounds = oldBounds.getCopy();
// According to the parameters, the new bounds would be the following
if (request instanceof AlignmentRequest) {
- AlignmentRequest alignmentRequest = (AlignmentRequest)request;
+ AlignmentRequest alignmentRequest = (AlignmentRequest) request;
// Horizontal-only alignment is not allowed
- switch(alignmentRequest.getAlignment()) {
+ switch (alignmentRequest.getAlignment()) {
case PositionConstants.LEFT:
case PositionConstants.CENTER:
case PositionConstants.RIGHT:
case PositionConstants.HORIZONTAL:
return UnexecutableCommand.INSTANCE;
- }
- newBounds = alignmentRequest.getAlignmentRectangle().getCopy();
+ }
+ newBounds = alignmentRequest.getAlignmentRectangle().getCopy();
executionSpecificationEP.getFigure().translateToRelative(newBounds);
// Remove X component of the alignment
newBounds.x = oldBounds.x;
@@ -637,17 +637,17 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
ShapeNodeEditPart parentBar = getParent(lifelineEP, newBounds, executionSpecificationList);
// change bounds to relative
newBounds = getExecutionSpecificationNewBounds(isMove, lifelineEP, oldBounds, newBounds, notToCheckExecutionSpecificationList, useFixedXPos);
- if(newBounds == null) {
+ if (newBounds == null) {
return UnexecutableCommand.INSTANCE;
}
- if(parentBar != null) {
+ if (parentBar != null) {
compoundCmd.add(resizeParentExecutionSpecification(lifelineEP, parentBar, newBounds.getCopy(), executionSpecificationList));
}
// Create and add the command to the compound command
SetBoundsCommand setBoundsCmd = new SetBoundsCommand(executionSpecificationEP.getEditingDomain(), "Resize of a ExecutionSpecification", executionSpecificationEP, newBounds);
compoundCmd.add(new ICommandProxy(setBoundsCmd));
Rectangle realMoveDelta = getRealMoveDelta(getRelativeBounds(executionSpecificationEP.getFigure()), newBounds);
- if(isMove) {
+ if (isMove) {
// Move also children
compoundCmd.add(createMovingAffixedExecutionSpecificationCommand(executionSpecificationEP, realMoveDelta, newBounds.getCopy()));
compoundCmd.add(createZOrderCommand(lifelineEP, executionSpecificationEP, newBounds.getCopy(), notToCheckExecutionSpecificationList));
@@ -658,39 +658,41 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
parentFigure.translateToAbsolute(newBounds);
// translateToAbsolute only does half of the work, I don't know why
newBounds.translate(parentFigure.getBounds().getLocation());
- if(updateEnclosingInteraction) {
+ if (updateEnclosingInteraction) {
// update the enclosing interaction of a moved execution specification
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, executionSpecificationEP.getFigure(), request.getResizeDirection())));
+ compoundCmd.add(new ICommandProxy(new CustomLifelineEditPart.PreserveAnchorsPositionCommandEx(executionSpecificationEP, new Dimension(realMoveDelta.width, realMoveDelta.height), PreserveAnchorsPositionCommand.PRESERVE_Y,
+ executionSpecificationEP.getFigure(), request.getResizeDirection())));
}
- if(ep instanceof CombinedFragment2EditPart) {
- CombinedFragment2EditPart cf2EP = (CombinedFragment2EditPart)ep;
+ if (ep instanceof CombinedFragment2EditPart) {
+ CombinedFragment2EditPart cf2EP = (CombinedFragment2EditPart) ep;
IFigure cf2Figure = cf2EP.getFigure();
Rectangle bounds = cf2Figure.getBounds().getCopy();
cf2Figure.getParent().translateToAbsolute(bounds);
Dimension sizeDelta = request.getSizeDelta();
- if(sizeDelta != null) {
- if(sizeDelta.width != 0) {
+ if (sizeDelta != null) {
+ if (sizeDelta.width != 0) {
return UnexecutableCommand.INSTANCE;
}
bounds.resize(sizeDelta);
}
Point moveDelta = request.getMoveDelta();
- if(moveDelta != null) {
+ if (moveDelta != null) {
bounds.translate(moveDelta);
}
// Create and add the set bounds command to the compound command
SetBoundsCommand setBoundsCmd = new SetBoundsCommand(cf2EP.getEditingDomain(), "Resize of a CoRegion", cf2EP, getNewBoundsForCoRegion(lifelineEP, bounds));
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(), request.getResizeDirection())));
+ 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(),
+ request.getResizeDirection())));
}
}
}
- if(!compoundCmd.isEmpty()) {
+ if (!compoundCmd.isEmpty()) {
return compoundCmd;
}
}
@@ -699,39 +701,39 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
/**
* Command for change ZOrder of ExecutionSpecification ordered from parent to children.
- *
+ *
* @param lifelineEP
- * the lifeline ep
+ * the lifeline ep
* @param executionSpecificationEP
- * the execution specification ep
+ * the execution specification ep
* @param newBounds
- * the new bounds
+ * the new bounds
* @param notToCheckExecutionSpecificationList
- * the not to check bes list
- *
+ * the not to check bes list
+ *
* @return the command
*/
protected final static Command createZOrderCommand(LifelineEditPart lifelineEP, ShapeNodeEditPart executionSpecificationEP, Rectangle newBounds, List<ShapeNodeEditPart> notToCheckExecutionSpecificationList) {
List<ShapeNodeEditPart> toCheckExecutionSpecificationList = LifelineEditPartUtil.getChildShapeNodeEditPart(lifelineEP);
toCheckExecutionSpecificationList.removeAll(notToCheckExecutionSpecificationList);
CompoundCommand cmd = new CompoundCommand();
- for(ShapeNodeEditPart externalExecutionSpecificationEP : toCheckExecutionSpecificationList) {
+ for (ShapeNodeEditPart externalExecutionSpecificationEP : toCheckExecutionSpecificationList) {
Rectangle externalExecutionSpecificationBounds = getRelativeBounds(externalExecutionSpecificationEP.getFigure());
// Check if there is any contact
- if(externalExecutionSpecificationBounds.touches(newBounds)) {
+ if (externalExecutionSpecificationBounds.touches(newBounds)) {
View containerView = ViewUtil.getContainerView(executionSpecificationEP.getPrimaryView());
- if(containerView != null) {
+ if (containerView != null) {
int i = 0;
int parentIndex = -1;
int childIndex = -1;
- for(Object child : containerView.getChildren()) {
- if(child == externalExecutionSpecificationEP.getPrimaryView()) {
+ for (Object child : containerView.getChildren()) {
+ if (child == externalExecutionSpecificationEP.getPrimaryView()) {
parentIndex = i;
- } else if(child == executionSpecificationEP.getPrimaryView()) {
+ } else if (child == executionSpecificationEP.getPrimaryView()) {
childIndex = i;
}
- if(parentIndex != -1 && childIndex != -1) {
- if(childIndex > parentIndex) {
+ if (parentIndex != -1 && childIndex != -1) {
+ if (childIndex > parentIndex) {
cmd.add(new ICommandProxy(new CustomZOrderCommand(executionSpecificationEP.getEditingDomain(), executionSpecificationEP.getPrimaryView(), parentIndex)));
cmd.add(new ICommandProxy(new CustomZOrderCommand(externalExecutionSpecificationEP.getEditingDomain(), externalExecutionSpecificationEP.getPrimaryView(), childIndex)));
} else {
@@ -743,7 +745,7 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
}
}
}
- if(!cmd.isEmpty()) {
+ if (!cmd.isEmpty()) {
return cmd;
}
return null;
@@ -754,27 +756,27 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
* positioned within a Lifeline EditPart. The notToCheckList is needed to avoid checking those
* ExecutionSpecification EditParts. The returned bounds are relative to the Lifeline figure so
* they can be used, directly, within a SetBoundsCommand.
- *
+ *
* @param lifelineDotLineFigure
- * TODO
+ * TODO
* @param newBounds
- * The new initial bounds
+ * The new initial bounds
* @param executionSpecifactionEditPart
- * TODO
+ * TODO
* @param notToCheckExecutionSpecificationList
- * The ExecutionSpecification EditPart's List that won't be checked
- *
+ * The ExecutionSpecification EditPart's List that won't be checked
+ *
* @return The new bounds of the executionSpecificationEP figure
*/
/**
* Get the (futur) parent of a ExecutionSpecification
- *
+ *
* @param lifelinePart
- *
+ *
* @param childBounds
- * the child bounds
+ * the child bounds
* @param toCheckExecutionSpecificationList
- * List of EditPart to check
+ * List of EditPart to check
* @return The parent
*/
public final static ShapeNodeEditPart getParent(LifelineEditPart lifelinePart, Rectangle childBounds, List<ShapeNodeEditPart> toCheckExecutionSpecificationList) {
@@ -782,12 +784,12 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
// Loop through the ExecutionSpecification list and try to find the most to the right
// ExecutionSpecification within the executionSpecificationEP Y-axis bounds
Rectangle externalBounds = childBounds.getCopy();
- for(ShapeNodeEditPart externalExecutionSpecificationEP : toCheckExecutionSpecificationList) {
+ for (ShapeNodeEditPart externalExecutionSpecificationEP : toCheckExecutionSpecificationList) {
Rectangle externalExecutionSpecificationBounds = externalExecutionSpecificationEP.getFigure().getBounds();
externalBounds.x = externalExecutionSpecificationBounds.x;
externalBounds.width = externalExecutionSpecificationBounds.width;
- if(externalExecutionSpecificationBounds.touches(externalBounds) && externalExecutionSpecificationBounds.x <= childBounds.x) {
- if(parent == null || externalExecutionSpecificationBounds.x > parent.getFigure().getBounds().x) {
+ if (externalExecutionSpecificationBounds.touches(externalBounds) && externalExecutionSpecificationBounds.x <= childBounds.x) {
+ if (parent == null || externalExecutionSpecificationBounds.x > parent.getFigure().getBounds().x) {
parent = externalExecutionSpecificationEP;
}
}
@@ -798,12 +800,12 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
/**
* Used to modify the sizeDelta if the given value is higher/lower than the highest/lowest
* allowed values of the figure.
- *
+ *
* @param figure
- * the figure
+ * the figure
* @param sizeDelta
- * the size delta
- *
+ * the size delta
+ *
* @return a corrected sizeDelta
*/
protected final static Dimension adaptSizeDeltaToMaxHeight(IFigure figure, Dimension sizeDelta) {
@@ -812,9 +814,9 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
int maximunFigureHeight = figure.getMaximumSize().height;
int minimunFigureHeight = figure.getMinimumSize().height;
int height = figureHeight + newSizeDelta.height;
- if(height > maximunFigureHeight) {
+ if (height > maximunFigureHeight) {
newSizeDelta.height = maximunFigureHeight - figureHeight;
- } else if(height < minimunFigureHeight) {
+ } else if (height < minimunFigureHeight) {
newSizeDelta.height = minimunFigureHeight - figureHeight;
}
return newSizeDelta;
@@ -825,10 +827,10 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
* given ExecutionSpecification EditPart. Not only the ones directly affixed to the
* executionSpecificationEP are returned, but the ones that are indirectly affixed as well (this
* is done recursively)
- *
+ *
* @param executionSpecificationEP
- * the execution specification ep
- *
+ * the execution specification ep
+ *
* @return the list of affixed ExecutionSpecification. If there is no affixed
* ExecutionSpecification, then an empty list will be returned
*/
@@ -841,12 +843,12 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
* Operation used by the above operation. It's main goal is to obtain, recursively, all the
* affixed ExecutionSpecification. In order to do so, it is needed a ExecutionSpecification
* EditPart and the notToCheckList.
- *
+ *
* @param executionSpecificationEP
- * the execution specification ep
+ * the execution specification ep
* @param notToCheckExecutionSpecificationList
- * the not to check ExecutionSpecification list
- *
+ * the not to check ExecutionSpecification list
+ *
* @return the list of affixed ExecutionSpecification. If there is no affixed
* ExecutionSpecification, then an empty list will be returned
*/
@@ -855,15 +857,15 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
List<ShapeNodeEditPart> newNotToCheckExecutionSpecificationList = new ArrayList<ShapeNodeEditPart>(notToCheckExecutionSpecificationList);
newNotToCheckExecutionSpecificationList.add(executionSpecificationEP);
// LifelineEditPart where the ExecutionSpecification EditPart is contained
- LifelineEditPart lifelineEP = (LifelineEditPart)executionSpecificationEP.getParent();
+ LifelineEditPart lifelineEP = (LifelineEditPart) executionSpecificationEP.getParent();
// ExecutionSpecification EditParts list
List<ShapeNodeEditPart> executionSpecificationList = LifelineEditPartUtil.getChildShapeNodeEditPart(lifelineEP);
executionSpecificationList.removeAll(newNotToCheckExecutionSpecificationList);
// List to store the Affixed ExecutionSpecification
List<ShapeNodeEditPart> affixedExecutionSpecificationList = new ArrayList<ShapeNodeEditPart>();
// Loop ExecutionSpecificationough the ExecutionSpecification list
- for(ShapeNodeEditPart childExecutionSpecificationEP : executionSpecificationList) {
- if(isAffixedToRight(executionSpecificationEP.getFigure().getBounds(), childExecutionSpecificationEP.getFigure().getBounds())) {
+ for (ShapeNodeEditPart childExecutionSpecificationEP : executionSpecificationList) {
+ if (isAffixedToRight(executionSpecificationEP.getFigure().getBounds(), childExecutionSpecificationEP.getFigure().getBounds())) {
affixedExecutionSpecificationList.add(childExecutionSpecificationEP);
// Add also it's affixed ExecutionSpecification
affixedExecutionSpecificationList.addAll(getAffixedExecutionSpecificationEditParts(childExecutionSpecificationEP, newNotToCheckExecutionSpecificationList));
@@ -877,17 +879,17 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
* Checks whether the right EditPart is affixed to the left EditPart. In order to do so, the
* operation checks if the right figure is really on the right and, if so, it just returns true
* if figures touch each other.
- *
+ *
* @param leftFigure
- * The left rectangle
+ * The left rectangle
* @param rightFigure
- * The right rectangle
- *
+ * The right rectangle
+ *
* @return true if the rectangles of both figures touch and the right figure is really on the
* right. False otherwise
*/
protected final static boolean isAffixedToRight(Rectangle leftFigure, Rectangle rightFigure) {
- // return leftFigure.touches(rightFigure) && leftFigure.x < rightFigure.x;
+ // return leftFigure.touches(rightFigure) && leftFigure.x < rightFigure.x;
return leftFigure.contains(rightFigure.getLocation()) && leftFigure.x < rightFigure.x;
}
@@ -895,20 +897,20 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
* If a ExecutionSpecification EditPart is going to be moved according to a moveDelta, this
* operation returns a compoundCommand that also moves the affixed ExecutionSpecification
* according to that delta.
- *
+ *
* @param executionSpecificationEP
- * The ExecutionSpecification EditPart that is going to be moved
+ * The ExecutionSpecification EditPart that is going to be moved
* @param moveDelta
- * The moveDelta of the previous EditPart
+ * The moveDelta of the previous EditPart
* @param newBounds
- * the new bounds
- *
+ * the new bounds
+ *
* @return the compound command
*/
protected final static CompoundCommand createMovingAffixedExecutionSpecificationCommand(ShapeNodeEditPart executionSpecificationEP, Rectangle moveDelta, Rectangle newBounds) {
- if(moveDelta.y != 0 || moveDelta.height != 0) {
+ if (moveDelta.y != 0 || moveDelta.height != 0) {
CompoundCommand compoundCmd = new CompoundCommand();
- for(ShapeNodeEditPart childExecutionSpecificationEP : getAffixedExecutionSpecificationEditParts(executionSpecificationEP)) {
+ for (ShapeNodeEditPart childExecutionSpecificationEP : getAffixedExecutionSpecificationEditParts(executionSpecificationEP)) {
// Get Relative Bounds
Rectangle childBounds = getRelativeBounds(childExecutionSpecificationEP.getFigure());
// Apply delta
@@ -927,11 +929,11 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
request.setMoveDelta(new Point(0, moveDelta.y));
OccurrenceSpecificationMoveHelper.completeMoveExecutionSpecificationCommand(compoundCmd, childExecutionSpecificationEP, childBounds.getCopy(), request);
// Move it's children as well
- if(!getAffixedExecutionSpecificationEditParts(childExecutionSpecificationEP).isEmpty()) {
+ if (!getAffixedExecutionSpecificationEditParts(childExecutionSpecificationEP).isEmpty()) {
compoundCmd.add(createMovingAffixedExecutionSpecificationCommand(childExecutionSpecificationEP, moveDelta, childBounds));
}
}
- if(!compoundCmd.isEmpty()) {
+ if (!compoundCmd.isEmpty()) {
return compoundCmd;
}
}
@@ -941,12 +943,12 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
/**
* Given an AbstractGraphialEditPart and the new relative bounds that the EditPart will have, it
* returns the real delta applied to the movement.
- *
+ *
* @param oldRelativeBounds
- * The old position of the mentioned EditPart
+ * The old position of the mentioned EditPart
* @param newRelativeBounds
- * The new position of the mentioned EditPart
- *
+ * The new position of the mentioned EditPart
+ *
* @return The real MoveDelta applied
*/
protected final static Rectangle getRealMoveDelta(Rectangle oldRelativeBounds, Rectangle newRelativeBounds) {
@@ -960,10 +962,10 @@ public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy {
/**
* It returns the relative bounds of an Figure.
- *
+ *
* @param figure
- * The Figure
- *
+ * The Figure
+ *
* @return The relative bounds regarding it's parent figure
*/
protected final static Rectangle getRelativeBounds(IFigure figure) {
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/MessageConnectionEditPolicy.java
index 7e640ce2ae5..17209ff9e0c 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/MessageConnectionEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -43,8 +43,8 @@ public class MessageConnectionEditPolicy extends ConnectionEditPolicy {
CompoundCommand deleteViewsCommand = new CompoundCommand();
Command deleteViewCommand = super.createDeleteViewCommand(deleteRequest);
deleteViewsCommand.add(deleteViewCommand);
- if(getHost() instanceof ConnectionNodeEditPart) {
- TransactionalEditingDomain editingDomain = ((ConnectionNodeEditPart)getHost()).getEditingDomain();
+ if (getHost() instanceof ConnectionNodeEditPart) {
+ TransactionalEditingDomain editingDomain = ((ConnectionNodeEditPart) getHost()).getEditingDomain();
SequenceDeleteHelper.completeDeleteMessageViewCommand(deleteViewsCommand, editingDomain, getHost());
}
return LifelineMessageCreateHelper.restoreLifelineOnMessageDelete(deleteViewsCommand, getHost());
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageConnectionLineSegEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageConnectionLineSegEditPolicy.java
index fd5cbd8091f..c2421cdb538 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageConnectionLineSegEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageConnectionLineSegEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -65,9 +65,9 @@ import org.eclipse.uml2.uml.OccurrenceSpecification;
/**
* This bendpoint edit policy is used to allow drag of horizontal messages and forbid drag otherwise.
- *
+ *
* @author mvelten
- *
+ *
*/
@SuppressWarnings("restriction")
public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditPolicy {
@@ -91,8 +91,8 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
@Override
protected List createManualHandles() {
RouterKind kind = RouterKind.getKind(getConnection(), getConnection().getPoints());
- if(kind == RouterKind.SELF || kind == RouterKind.HORIZONTAL || getConnection() instanceof MessageCreate) {
- //Removed the handles for self message.
+ if (kind == RouterKind.SELF || kind == RouterKind.HORIZONTAL || getConnection() instanceof MessageCreate) {
+ // Removed the handles for self message.
return Collections.emptyList();
}
return super.createManualHandles();
@@ -101,25 +101,25 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
@Override
public Command getCommand(Request request) {
RouterKind kind = RouterKind.getKind(getConnection(), getConnection().getPoints());
- if(kind == RouterKind.SELF || kind == RouterKind.HORIZONTAL || getConnection() instanceof MessageCreate) {
+ if (kind == RouterKind.SELF || kind == RouterKind.HORIZONTAL || getConnection() instanceof MessageCreate) {
return super.getCommand(request);
- } else if(request instanceof BendpointRequest) {
- return getMoveMessageCommand((BendpointRequest)request);
+ } else if (request instanceof BendpointRequest) {
+ return getMoveMessageCommand((BendpointRequest) request);
}
return null;
}
/**
* Add impossible to move the message lost/found by drag the middle line
- *
+ *
* @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=403138
*/
protected Command getMoveMessageCommand(BendpointRequest request) {
- if(getHost() instanceof Message6EditPart || getHost() instanceof Message7EditPart) {
+ if (getHost() instanceof Message6EditPart || getHost() instanceof Message7EditPart) {
PointList points = getConnection().getPoints().getCopy();
CompoundCommand command = new CompoundCommand("Move");
- AbstractMessageEditPart messageEditPart = (AbstractMessageEditPart)getHost();
- //move source
+ AbstractMessageEditPart messageEditPart = (AbstractMessageEditPart) getHost();
+ // move source
ReconnectRequest sourceReq = new ReconnectRequest(REQ_RECONNECT_SOURCE);
sourceReq.setConnectionEditPart(messageEditPart);
Point sourceLocation = points.getFirstPoint().getCopy();
@@ -129,7 +129,7 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
sourceReq.setTargetEditPart(source);
Command moveSourceCommand = source.getCommand(sourceReq);
command.add(moveSourceCommand);
- //move target
+ // move target
EditPart target = messageEditPart.getTarget();
ReconnectRequest targetReq = new ReconnectRequest(REQ_RECONNECT_TARGET);
targetReq.setConnectionEditPart(messageEditPart);
@@ -149,24 +149,24 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
*/
@Override
protected Command getBendpointsChangedCommand(BendpointRequest request) {
- if((getHost().getViewer() instanceof ScrollingGraphicalViewer) && (getHost().getViewer().getControl() instanceof FigureCanvas)) {
- SelectInDiagramHelper.exposeLocation((FigureCanvas)getHost().getViewer().getControl(), request.getLocation().getCopy());
+ if ((getHost().getViewer() instanceof ScrollingGraphicalViewer) && (getHost().getViewer().getControl() instanceof FigureCanvas)) {
+ SelectInDiagramHelper.exposeLocation((FigureCanvas) getHost().getViewer().getControl(), request.getLocation().getCopy());
}
- if(getHost() instanceof ConnectionNodeEditPart) {
- ConnectionNodeEditPart connectionPart = (ConnectionNodeEditPart)getHost();
+ if (getHost() instanceof ConnectionNodeEditPart) {
+ ConnectionNodeEditPart connectionPart = (ConnectionNodeEditPart) getHost();
EObject message = connectionPart.resolveSemanticElement();
- if(message instanceof Message) {
- MessageEnd send = ((Message)message).getSendEvent();
- MessageEnd rcv = ((Message)message).getReceiveEvent();
+ if (message instanceof Message) {
+ MessageEnd send = ((Message) message).getSendEvent();
+ MessageEnd rcv = ((Message) message).getReceiveEvent();
EditPart srcPart = connectionPart.getSource();
LifelineEditPart srcLifelinePart = SequenceUtil.getParentLifelinePart(srcPart);
EditPart tgtPart = connectionPart.getTarget();
LifelineEditPart tgtLifelinePart = SequenceUtil.getParentLifelinePart(tgtPart);
- if(/* send instanceof OccurrenceSpecification && rcv instanceof OccurrenceSpecification && */srcLifelinePart != null && tgtLifelinePart != null) {
+ if (/* send instanceof OccurrenceSpecification && rcv instanceof OccurrenceSpecification && */srcLifelinePart != null && tgtLifelinePart != null) {
RouterKind kind = RouterKind.getKind(getConnection(), getConnection().getPoints());
- if((getHost() instanceof MessageEditPart || getHost() instanceof Message2EditPart) && kind == RouterKind.SELF) {
+ if ((getHost() instanceof MessageEditPart || getHost() instanceof Message2EditPart) && kind == RouterKind.SELF) {
return getSelfLinkMoveCommand(request, connectionPart, send, rcv, srcLifelinePart);
- } else if(getHost() instanceof Message4EditPart) {
+ } else if (getHost() instanceof Message4EditPart) {
IFigure fig = tgtLifelinePart.getPrimaryShape().getFigureLifelineNameContainerFigure();
Rectangle bounds = fig.getBounds().getCopy();
fig.translateToAbsolute(bounds);
@@ -177,7 +177,7 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
Point location = tgtLifelinePart.getFigure().getBounds().getLocation().getCopy().translate(0, dy);
Command moveCmd = new ICommandProxy(new SetBoundsCommand(tgtLifelinePart.getEditingDomain(), DiagramUIMessages.SetLocationCommand_Label_Resize, new EObjectAdapter(tgtLifelinePart.getNotationView()), location));
// Take care of the order of commands, to make sure target is always bellow the source.
- if(dy < 0) { // move up
+ if (dy < 0) { // move up
return LifelineMessageCreateHelper.moveCascadeLifeline(tgtLifelinePart, moveCmd, dy);
} else { // move down
Command cmd = LifelineMessageCreateHelper.moveCascadeLifeline(tgtLifelinePart, null, dy);
@@ -186,17 +186,17 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
}
} else {
int y = request.getLocation().y;
- Command srcCmd = createMoveMessageEndCommand((Message)message, srcPart, send, y, srcLifelinePart);
- Command tgtCmd = createMoveMessageEndCommand((Message)message, tgtPart, rcv, y, tgtLifelinePart);
+ Command srcCmd = createMoveMessageEndCommand((Message) message, srcPart, send, y, srcLifelinePart);
+ Command tgtCmd = createMoveMessageEndCommand((Message) message, tgtPart, rcv, y, tgtLifelinePart);
CompoundCommand compoudCmd = new CompoundCommand(CustomMessages.MoveMessageCommand_Label);
/*
* Take care of the order of commands, to make sure target is always bellow the source.
* Otherwise, moving the target above the source would cause order conflict with existing CF.
*/
Point oldLocation = SequenceUtil.getAbsoluteEdgeExtremity(connectionPart, true);
- if(oldLocation != null) {
+ if (oldLocation != null) {
int oldY = oldLocation.y;
- if(oldY < y) {
+ if (oldY < y) {
compoudCmd.add(tgtCmd);
compoudCmd.add(srcCmd);
} else {
@@ -214,17 +214,17 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
/**
* Add impossible to move the anchor connected inside of CoRegion
- *
+ *
* @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=402970
*/
protected Command createMoveMessageEndCommand(Message message, EditPart endEditPart, MessageEnd end, int yLocation, LifelineEditPart lifeline) {
- if(end instanceof OccurrenceSpecification) {
+ if (end instanceof OccurrenceSpecification) {
List<EditPart> empty = Collections.emptyList();
- return OccurrenceSpecificationMoveHelper.getMoveOccurrenceSpecificationsCommand((OccurrenceSpecification)end, null, yLocation, -1, lifeline, empty);
- } else if(end instanceof Gate) {
+ return OccurrenceSpecificationMoveHelper.getMoveOccurrenceSpecificationsCommand((OccurrenceSpecification) end, null, yLocation, -1, lifeline, empty);
+ } else if (end instanceof Gate) {
boolean isSource = (end == message.getSendEvent());
- ConnectionNodeEditPart connection = (ConnectionNodeEditPart)getHost();
- if(isSource) {
+ ConnectionNodeEditPart connection = (ConnectionNodeEditPart) getHost();
+ if (isSource) {
ReconnectRequest req = new ReconnectRequest(REQ_RECONNECT_SOURCE);
req.setConnectionEditPart(connection);
req.setTargetEditPart(endEditPart);
@@ -248,58 +248,58 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
}
protected Command getSelfLinkMoveCommand(BendpointRequest request, ConnectionNodeEditPart connectionPart, MessageEnd send, MessageEnd rcv, LifelineEditPart srcLifelinePart) {
- //Just do it, checking was finished by showing feedback.
+ // Just do it, checking was finished by showing feedback.
Object moveData = request.getExtendedData().get(MOVE_LINE_ORIENTATION_DATA);
CompoundCommand compoudCmd = new CompoundCommand(CustomMessages.MoveMessageCommand_Label);
- //And make sure the self linked message can be customized by using bendpoints.
+ // And make sure the self linked message can be customized by using bendpoints.
compoudCmd.add(super.getBendpointsChangedCommand(request));
PointList points = getConnection().getPoints();
- if(MOVED_UP.equals(moveData)) {
+ if (MOVED_UP.equals(moveData)) {
Point sourceRefPoint = points.getFirstPoint();
getConnection().translateToAbsolute(sourceRefPoint);
Command srcCmd = getReconnectCommand(connectionPart, connectionPart.getSource(), sourceRefPoint, RequestConstants.REQ_RECONNECT_SOURCE);
compoudCmd.add(srcCmd);
- } else if(MOVED_DOWN.equals(moveData)) {
+ } else if (MOVED_DOWN.equals(moveData)) {
Point targetRefPoint = points.getLastPoint();
getConnection().translateToAbsolute(targetRefPoint);
- //Self message not always has same source and target, such as MessageSync.
+ // Self message not always has same source and target, such as MessageSync.
Command tgtCmd = getReconnectCommand(connectionPart, connectionPart.getTarget(), targetRefPoint, RequestConstants.REQ_RECONNECT_TARGET);
compoudCmd.add(tgtCmd);
}
return compoudCmd.unwrap();
- // CompoundCommand compoudCmd = new CompoundCommand(Messages.MoveMessageCommand_Label);
- // PointList points = getConnection().getPoints();
- // Point sourceRefPoint = points.getFirstPoint();;
- // Point targetRefPoint = points.getLastPoint();;
- // getConnection().translateToAbsolute(sourceRefPoint);
- // getConnection().translateToAbsolute(targetRefPoint);
- //
- // Point oldSourcePoint = SequenceUtil.findLocationOfEvent(srcLifelinePart, (OccurrenceSpecification)send);
- // int dy = sourceRefPoint.y - oldSourcePoint.y;
- // int dx = request.getLocation().x > sourceRefPoint.x ? 3 : -3;
- //
- // // check bounds
- // NodeFigure fig = srcLifelinePart.getPrimaryShape().getFigureLifelineDotLineFigure().getDashLineRectangle();
- // Rectangle bounds = fig.getBounds().getCopy();
- // fig.translateToAbsolute(bounds);
- //
- // bounds.expand(6, 0);
- // if(!bounds.contains(sourceRefPoint) || !bounds.contains(targetRefPoint)){
- // return UnexecutableCommand.INSTANCE; // cannot move outside lifeline part
- // }
- // sourceRefPoint = sourceRefPoint.translate(dx, 0);
- // targetRefPoint = targetRefPoint.translate(dx, 0);
- // Command srcCmd = getReconnectCommand(connectionPart, srcLifelinePart, sourceRefPoint, RequestConstants.REQ_RECONNECT_SOURCE);
- // Command tgtCmd = getReconnectCommand(connectionPart, srcLifelinePart, targetRefPoint, RequestConstants.REQ_RECONNECT_TARGET);
- //
- // if(dy < 0){ // move up
- // compoudCmd.add(srcCmd);
- // compoudCmd.add(tgtCmd);
- // }else{ // move down
- // compoudCmd.add(tgtCmd);
- // compoudCmd.add(srcCmd);
- // }
- // return compoudCmd;
+ // CompoundCommand compoudCmd = new CompoundCommand(Messages.MoveMessageCommand_Label);
+ // PointList points = getConnection().getPoints();
+ // Point sourceRefPoint = points.getFirstPoint();;
+ // Point targetRefPoint = points.getLastPoint();;
+ // getConnection().translateToAbsolute(sourceRefPoint);
+ // getConnection().translateToAbsolute(targetRefPoint);
+ //
+ // Point oldSourcePoint = SequenceUtil.findLocationOfEvent(srcLifelinePart, (OccurrenceSpecification)send);
+ // int dy = sourceRefPoint.y - oldSourcePoint.y;
+ // int dx = request.getLocation().x > sourceRefPoint.x ? 3 : -3;
+ //
+ // // check bounds
+ // NodeFigure fig = srcLifelinePart.getPrimaryShape().getFigureLifelineDotLineFigure().getDashLineRectangle();
+ // Rectangle bounds = fig.getBounds().getCopy();
+ // fig.translateToAbsolute(bounds);
+ //
+ // bounds.expand(6, 0);
+ // if(!bounds.contains(sourceRefPoint) || !bounds.contains(targetRefPoint)){
+ // return UnexecutableCommand.INSTANCE; // cannot move outside lifeline part
+ // }
+ // sourceRefPoint = sourceRefPoint.translate(dx, 0);
+ // targetRefPoint = targetRefPoint.translate(dx, 0);
+ // Command srcCmd = getReconnectCommand(connectionPart, srcLifelinePart, sourceRefPoint, RequestConstants.REQ_RECONNECT_SOURCE);
+ // Command tgtCmd = getReconnectCommand(connectionPart, srcLifelinePart, targetRefPoint, RequestConstants.REQ_RECONNECT_TARGET);
+ //
+ // if(dy < 0){ // move up
+ // compoudCmd.add(srcCmd);
+ // compoudCmd.add(tgtCmd);
+ // }else{ // move down
+ // compoudCmd.add(tgtCmd);
+ // compoudCmd.add(srcCmd);
+ // }
+ // return compoudCmd;
}
protected Command getReconnectCommand(ConnectionNodeEditPart connectionPart, EditPart targetPart, Point location, String requestType) {
@@ -320,25 +320,25 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
*/
@Override
public void showSourceFeedback(Request request) {
- if(request instanceof BendpointRequest) {
+ if (request instanceof BendpointRequest) {
RouterKind kind = RouterKind.getKind(getConnection(), getConnection().getPoints());
- if(kind == RouterKind.SELF || kind == RouterKind.HORIZONTAL || getConnection() instanceof MessageCreate) {
- if(getLineSegMode() != LineMode.OBLIQUE && REQ_MOVE_BENDPOINT.equals(request.getType())) {
- //Fixed bug about show feedback for moving bendpoints, make sure at least 3 points.
- List constraint = (List)getConnection().getRoutingConstraint();
- if(constraint.size() > 2) {
+ if (kind == RouterKind.SELF || kind == RouterKind.HORIZONTAL || getConnection() instanceof MessageCreate) {
+ if (getLineSegMode() != LineMode.OBLIQUE && REQ_MOVE_BENDPOINT.equals(request.getType())) {
+ // Fixed bug about show feedback for moving bendpoints, make sure at least 3 points.
+ List constraint = (List) getConnection().getRoutingConstraint();
+ if (constraint.size() > 2) {
super.showSourceFeedback(request);
}
} else {
super.showSourceFeedback(request);
}
- if(getLineSegMode() != LineMode.OBLIQUE && REQ_MOVE_BENDPOINT.equals(request.getType())) {
- showMoveLineSegFeedback((BendpointRequest)request);
+ if (getLineSegMode() != LineMode.OBLIQUE && REQ_MOVE_BENDPOINT.equals(request.getType())) {
+ showMoveLineSegFeedback((BendpointRequest) request);
}
}
- //Add impossible to move MessageLost and MessageFound by dragging the line.
- else if(getHost() instanceof Message7EditPart || getHost() instanceof Message6EditPart) {
- showMoveLineSegFeedback((BendpointRequest)request);
+ // Add impossible to move MessageLost and MessageFound by dragging the line.
+ else if (getHost() instanceof Message7EditPart || getHost() instanceof Message6EditPart) {
+ showMoveLineSegFeedback((BendpointRequest) request);
}
}
}
@@ -347,6 +347,7 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
static class DummyRouter extends AbstractRouter {
+ @Override
public void route(Connection conn) {
}
}
@@ -355,8 +356,8 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
@SuppressWarnings("unchecked")
protected void showMoveLineSegFeedback(BendpointRequest request) {
RouterKind kind = RouterKind.getKind(getConnection(), getConnection().getPoints());
- if((getHost() instanceof MessageEditPart || getHost() instanceof Message2EditPart) && kind == RouterKind.SELF) {
- if(router == null) {
+ if ((getHost() instanceof MessageEditPart || getHost() instanceof Message2EditPart) && kind == RouterKind.SELF) {
+ if (router == null) {
router = getConnection().getConnectionRouter();
getConnection().setConnectionRouter(new DummyRouter());
}
@@ -367,44 +368,44 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
int dx = 0;
int from = 0, to = 0;
int index = request.getIndex();
- if(index == 0) {
+ if (index == 0) {
dy = ptLoc.y - linkPoints.getFirstPoint().y;
from = 0;
to = 1;
request.getExtendedData().put(MOVE_LINE_ORIENTATION_DATA, MOVED_UP);
- } else if(index == 1) {
+ } else if (index == 1) {
dx = ptLoc.x - linkPoints.getMidpoint().x;
from = 1;
to = 2;
request.getExtendedData().put(MOVE_LINE_ORIENTATION_DATA, MOVED_HORIZONTAL);
- } else if(index == 2) {
+ } else if (index == 2) {
dy = ptLoc.y - linkPoints.getLastPoint().y;
from = 2;
to = 3;
request.getExtendedData().put(MOVE_LINE_ORIENTATION_DATA, MOVED_DOWN);
}
- if(getHost() instanceof MessageEditPart && index > 1) {
+ if (getHost() instanceof MessageEditPart && index > 1) {
dy = 0;
}
// move points on link
int size = linkPoints.size();
- if(from >= 0 && from < size && to >= 0 && to < size && from <= to) {
- for(int i = from; i <= to; i++) {
+ if (from >= 0 && from < size && to >= 0 && to < size && from <= to) {
+ for (int i = from; i <= to; i++) {
Point p = linkPoints.getPoint(i);
p.translate(dx, dy);
linkPoints.setPoint(p, i);
}
}
- // link should not exceed lifeline bounds
- if(checkBounds(linkPoints)) {
+ // link should not exceed lifeline bounds
+ if (checkBounds(linkPoints)) {
getConnection().setPoints(linkPoints);
getConnection().getLayoutManager().layout(getConnection());
}
return;
}
- //Add impossible to dragging MessageLost and MessageFound. See bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=403138
- if(getHost() instanceof Message4EditPart || getHost() instanceof Message6EditPart || getHost() instanceof Message7EditPart) {
- if(router == null) {
+ // Add impossible to dragging MessageLost and MessageFound. See bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=403138
+ if (getHost() instanceof Message4EditPart || getHost() instanceof Message6EditPart || getHost() instanceof Message7EditPart) {
+ if (router == null) {
router = getConnection().getConnectionRouter();
getConnection().setConnectionRouter(new DummyRouter());
}
@@ -413,11 +414,11 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
getConnection().translateToRelative(ptLoc);
int dy = ptLoc.y - linkPoints.getFirstPoint().y;
int size = linkPoints.size();
- for(int i = 0; i < size; i++) {
+ for (int i = 0; i < size; i++) {
Point p = linkPoints.getPoint(i).translate(0, dy);
linkPoints.setPoint(p, i);
}
- if(checkBounds(linkPoints)) {
+ if (checkBounds(linkPoints)) {
getConnection().setPoints(linkPoints);
getConnection().getLayoutManager().layout(getConnection());
}
@@ -427,42 +428,42 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
}
protected boolean checkBounds(PointList linkPoints) {
- if(linkPoints.getFirstPoint().y > linkPoints.getLastPoint().y) {
+ if (linkPoints.getFirstPoint().y > linkPoints.getLastPoint().y) {
return false;
}
- EditPart sourcePart = ((ConnectionNodeEditPart)getHost()).getSource();
- if(sourcePart instanceof LifelineEditPart) {
- LifelineEditPart lep = (LifelineEditPart)sourcePart;
+ EditPart sourcePart = ((ConnectionNodeEditPart) getHost()).getSource();
+ if (sourcePart instanceof LifelineEditPart) {
+ LifelineEditPart lep = (LifelineEditPart) sourcePart;
NodeFigure fig = lep.getPrimaryShape().getFigureLifelineDotLineFigure().getDashLineRectangle();
Rectangle bounds = fig.getBounds().getCopy();
fig.translateToAbsolute(bounds);
Rectangle conBounds = linkPoints.getBounds();
getConnection().translateToAbsolute(conBounds);
// check top and bottom y limit
- if(conBounds.y <= bounds.y || conBounds.getBottom().y >= bounds.getBottom().y) {
+ if (conBounds.y <= bounds.y || conBounds.getBottom().y >= bounds.getBottom().y) {
return false;
}
}
- //It seems the self message can be created on ES, too
- else if(sourcePart instanceof AbstractExecutionSpecificationEditPart) {
- AbstractExecutionSpecificationEditPart esep = (AbstractExecutionSpecificationEditPart)sourcePart;
+ // It seems the self message can be created on ES, too
+ else if (sourcePart instanceof AbstractExecutionSpecificationEditPart) {
+ AbstractExecutionSpecificationEditPart esep = (AbstractExecutionSpecificationEditPart) sourcePart;
IFigure fig = esep.getFigure();
Rectangle bounds = fig.getBounds().getCopy();
fig.translateToAbsolute(bounds);
Rectangle conBounds = linkPoints.getBounds().getCopy();
getConnection().translateToAbsolute(conBounds);
- if(getHost() instanceof MessageEditPart) {//Sync message is linked between two executions.
- if(conBounds.width < 2 || conBounds.height < 2
- // check top and bottom y limit
- || conBounds.y <= bounds.y || conBounds.getBottom().y >= bounds.getBottom().y) {
+ if (getHost() instanceof MessageEditPart) {// Sync message is linked between two executions.
+ if (conBounds.width < 2 || conBounds.height < 2
+ // check top and bottom y limit
+ || conBounds.y <= bounds.y || conBounds.getBottom().y >= bounds.getBottom().y) {
return false;
}
- } else if( //Don't change the orientation of self message.
+ } else if ( // Don't change the orientation of self message.
bounds.intersects(conBounds.getShrinked(1, 1))
- //make sure the line is not closest.
- || conBounds.width < 2 || conBounds.height < 2
- // check top and bottom y limit
- || conBounds.y <= bounds.y || conBounds.getBottom().y >= bounds.getBottom().y) {
+ // make sure the line is not closest.
+ || conBounds.width < 2 || conBounds.height < 2
+ // check top and bottom y limit
+ || conBounds.y <= bounds.y || conBounds.getBottom().y >= bounds.getBottom().y) {
return false;
}
}
@@ -473,34 +474,34 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
protected void eraseConnectionFeedback(BendpointRequest request, boolean removeFeedbackFigure) {
getConnection().setVisible(true);
super.eraseConnectionFeedback(request, removeFeedbackFigure);
- if(router != null) {
+ if (router != null) {
getConnection().setConnectionRouter(router);
}
router = null;
}
- // private boolean isHorizontal() {
- // Connection connection = getConnection();
- // RouterKind kind = RouterKind.getKind(connection, connection.getPoints());
+ // private boolean isHorizontal() {
+ // Connection connection = getConnection();
+ // RouterKind kind = RouterKind.getKind(connection, connection.getPoints());
//
- // if(kind.equals(RouterKind.HORIZONTAL)) {
- // return true;
- // }
- // return false;
- // }
+ // if(kind.equals(RouterKind.HORIZONTAL)) {
+ // return true;
+ // }
+ // return false;
+ // }
//
- // final private static char TERMINAL_START_CHAR = '(';
+ // final private static char TERMINAL_START_CHAR = '(';
//
- // final private static char TERMINAL_DELIMITER_CHAR = ',';
+ // final private static char TERMINAL_DELIMITER_CHAR = ',';
//
- // final private static char TERMINAL_END_CHAR = ')';
+ // final private static char TERMINAL_END_CHAR = ')';
//
- // private static String composeTerminalString(PrecisionPoint p) {
- // StringBuffer s = new StringBuffer(24);
- // s.append(TERMINAL_START_CHAR); // 1 char
- // s.append(p.preciseX); // 10 chars
- // s.append(TERMINAL_DELIMITER_CHAR); // 1 char
- // s.append(p.preciseY); // 10 chars
- // s.append(TERMINAL_END_CHAR); // 1 char
- // return s.toString(); // 24 chars max (+1 for safety, i.e. for string termination)
- // }
+ // private static String composeTerminalString(PrecisionPoint p) {
+ // StringBuffer s = new StringBuffer(24);
+ // s.append(TERMINAL_START_CHAR); // 1 char
+ // s.append(p.preciseX); // 10 chars
+ // s.append(TERMINAL_DELIMITER_CHAR); // 1 char
+ // s.append(p.preciseY); // 10 chars
+ // s.append(TERMINAL_END_CHAR); // 1 char
+ // return s.toString(); // 24 chars max (+1 for safety, i.e. for string termination)
+ // }
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageLabelEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageLabelEditPolicy.java
index 745c7251962..c15c03e2a1c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageLabelEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageLabelEditPolicy.java
@@ -36,11 +36,11 @@ public class MessageLabelEditPolicy extends AbstractMaskManagedEditPolicy {
@Override
public void refreshDisplay() {
// calls the helper for this edit Part
- ConnectionEditPart lp = (ConnectionEditPart)getHost();
+ ConnectionEditPart lp = (ConnectionEditPart) getHost();
List<?> children = lp.getChildren();
- for(Object p : children) {
- if(p instanceof ICustomMessageLabel) {
- MessageLabelHelper.getInstance().refreshEditPartDisplay((GraphicalEditPart)p);
+ for (Object p : children) {
+ if (p instanceof ICustomMessageLabel) {
+ MessageLabelHelper.getInstance().refreshEditPartDisplay((GraphicalEditPart) p);
}
}
}
@@ -57,8 +57,8 @@ public class MessageLabelEditPolicy extends AbstractMaskManagedEditPolicy {
@Override
public Message getUMLElement() {
- if(hostSemanticElement instanceof Message) {
- return ((Message)hostSemanticElement);
+ if (hostSemanticElement instanceof Message) {
+ return ((Message) hostSemanticElement);
}
return null;
}
@@ -69,36 +69,36 @@ public class MessageLabelEditPolicy extends AbstractMaskManagedEditPolicy {
this.defaultValueListener = new DefaultValueListener();
Message e = getUMLElement();
// check host semantic element is not null
- if(e == null || e.getSignature() == null) {
+ if (e == null || e.getSignature() == null) {
return;
}
hookMessageSignature(e.getSignature());
EList<ValueSpecification> argments = e.getArguments();
- for(ValueSpecification v : argments) {
- if(v instanceof EObject) {
+ for (ValueSpecification v : argments) {
+ if (v instanceof EObject) {
getDiagramEventBroker().addNotificationListener(v, this);
}
}
}
private void hookMessageSignature(NamedElement sig) {
- if(sig == null) {
+ if (sig == null) {
return;
}
- if(sig instanceof Operation) {
- Operation operation = (Operation)sig;
+ if (sig instanceof Operation) {
+ Operation operation = (Operation) sig;
getDiagramEventBroker().addNotificationListener(operation, this);
// adds a listener to the element itself, and to linked elements, like Type
- for(Parameter parameter : operation.getOwnedParameters()) {
+ for (Parameter parameter : operation.getOwnedParameters()) {
getDiagramEventBroker().addNotificationListener(parameter, this);
getDiagramEventBroker().addNotificationListener(parameter.getDefaultValue(), defaultValueListener);
// should also add this element as a listener of parameter type
getDiagramEventBroker().addNotificationListener(parameter.getType(), this);
}
- } else if(sig instanceof Signal) {
- Signal signal = (Signal)sig;
+ } else if (sig instanceof Signal) {
+ Signal signal = (Signal) sig;
getDiagramEventBroker().addNotificationListener(signal, this);
- for(Property property : signal.getOwnedAttributes()) {
+ for (Property property : signal.getOwnedAttributes()) {
getDiagramEventBroker().addNotificationListener(property, this);
getDiagramEventBroker().addNotificationListener(property.getDefaultValue(), defaultValueListener);
// should also add this element as a listener of parameter type
@@ -112,35 +112,35 @@ public class MessageLabelEditPolicy extends AbstractMaskManagedEditPolicy {
super.removeAdditionalListeners();
Message e = getUMLElement();
// check host semantic element is not null
- if(e == null || e.getSignature() == null) {
+ if (e == null || e.getSignature() == null) {
return;
}
unhookMessageSignature(e.getSignature());
EList<ValueSpecification> argments = e.getArguments();
- for(ValueSpecification v : argments) {
- if(v instanceof EObject) {
+ for (ValueSpecification v : argments) {
+ if (v instanceof EObject) {
getDiagramEventBroker().removeNotificationListener(v, this);
}
}
}
private void unhookMessageSignature(NamedElement sig) {
- if(sig == null) {
+ if (sig == null) {
return;
}
- if(sig instanceof Operation) {
- Operation operation = (Operation)sig;
+ if (sig instanceof Operation) {
+ Operation operation = (Operation) sig;
getDiagramEventBroker().removeNotificationListener(operation, this);
- for(Parameter parameter : operation.getOwnedParameters()) {
+ for (Parameter parameter : operation.getOwnedParameters()) {
getDiagramEventBroker().removeNotificationListener(parameter, this);
getDiagramEventBroker().removeNotificationListener(parameter.getDefaultValue(), defaultValueListener);
// remove parameter type listener
getDiagramEventBroker().removeNotificationListener(parameter.getType(), this);
}
- } else if(sig instanceof Signal) {
- Signal signal = (Signal)sig;
+ } else if (sig instanceof Signal) {
+ Signal signal = (Signal) sig;
getDiagramEventBroker().removeNotificationListener(signal, this);
- for(Property property : signal.getOwnedAttributes()) {
+ for (Property property : signal.getOwnedAttributes()) {
getDiagramEventBroker().removeNotificationListener(property, this);
getDiagramEventBroker().removeNotificationListener(property.getDefaultValue(), defaultValueListener);
// remove parameter type listener
@@ -155,57 +155,57 @@ public class MessageLabelEditPolicy extends AbstractMaskManagedEditPolicy {
final Object object = notification.getNotifier();
Message e = getUMLElement();
// check host semantic element is not null
- if(e == null) {
+ if (e == null) {
return;
}
- if(UMLPackage.Literals.MESSAGE__ARGUMENT.equals(notification.getFeature())) {
+ if (UMLPackage.Literals.MESSAGE__ARGUMENT.equals(notification.getFeature())) {
parameterListChange(notification);
return;
- } else if(e.getArguments().contains(object)) {
+ } else if (e.getArguments().contains(object)) {
refreshDisplay();
return;
}
NamedElement sig = e.getSignature();
- if(sig instanceof Operation) {
- Operation operation = (Operation)sig;
- if(object.equals(operation)) {
+ if (sig instanceof Operation) {
+ Operation operation = (Operation) sig;
+ if (object.equals(operation)) {
notifyOperationChanged(operation, notification);
- } else if(isParameter(object, operation)) {
+ } else if (isParameter(object, operation)) {
notifyParameterChanged(notification);
- } else if(isParameterType(object, operation)) {
+ } else if (isParameterType(object, operation)) {
notifyTypeChanged(notification);
}
- } else if(sig instanceof Signal) {
- Signal signal = (Signal)sig;
- if(object.equals(signal)) {
+ } else if (sig instanceof Signal) {
+ Signal signal = (Signal) sig;
+ if (object.equals(signal)) {
notifySignalChanged(signal, notification);
- } else if(isProperty(object, signal)) {
+ } else if (isProperty(object, signal)) {
notifyPropertyChanged(notification);
- } else if(isPropertyType(object, signal)) {
+ } else if (isPropertyType(object, signal)) {
notifyTypeChanged(notification);
- } else if(object instanceof ValueSpecification) {
- Element own = ((ValueSpecification)object).getOwner();
- if(isProperty(own, signal)) {
+ } else if (object instanceof ValueSpecification) {
+ Element own = ((ValueSpecification) object).getOwner();
+ if (isProperty(own, signal)) {
refreshDisplay(); // may be default value
}
}
}
- if(isMaskManagedAnnotation(object)) {
+ if (isMaskManagedAnnotation(object)) {
refreshDisplay();
- } else if(isRemovedMaskManagedLabelAnnotation(object, notification)) {
+ } else if (isRemovedMaskManagedLabelAnnotation(object, notification)) {
refreshDisplay();
- } else if(sig == null && object instanceof Message && notification.getFeature().equals(UMLPackage.eINSTANCE.getNamedElement_Name())) {
+ } else if (sig == null && object instanceof Message && notification.getFeature().equals(UMLPackage.eINSTANCE.getNamedElement_Name())) {
refreshDisplay();
}
- //Try to update label when signature of message changed.
- else if(UMLPackage.eINSTANCE.getMessage_Signature() == notification.getFeature()) {
+ // Try to update label when signature of message changed.
+ else if (UMLPackage.eINSTANCE.getMessage_Signature() == notification.getFeature()) {
Object oldValue = notification.getOldValue();
- if(oldValue instanceof NamedElement) {
- unhookMessageSignature((NamedElement)oldValue);
+ if (oldValue instanceof NamedElement) {
+ unhookMessageSignature((NamedElement) oldValue);
}
Object newValue = notification.getNewValue();
- if(newValue instanceof NamedElement) {
- hookMessageSignature((NamedElement)newValue);
+ if (newValue instanceof NamedElement) {
+ hookMessageSignature((NamedElement) newValue);
}
refreshDisplay();
}
@@ -220,13 +220,13 @@ public class MessageLabelEditPolicy extends AbstractMaskManagedEditPolicy {
}
private void notifyPropertyChanged(Notification notification) {
- switch(notification.getFeatureID(Property.class)) {
+ switch (notification.getFeatureID(Property.class)) {
case UMLPackage.PROPERTY__DEFAULT_VALUE: // set or unset default value
- if(notification.getOldValue() instanceof EObject) {
- getDiagramEventBroker().removeNotificationListener((EObject)notification.getOldValue(), defaultValueListener);
+ if (notification.getOldValue() instanceof EObject) {
+ getDiagramEventBroker().removeNotificationListener((EObject) notification.getOldValue(), defaultValueListener);
}
- if(notification.getNewValue() instanceof EObject) {
- getDiagramEventBroker().addNotificationListener((EObject)notification.getNewValue(), defaultValueListener);
+ if (notification.getNewValue() instanceof EObject) {
+ getDiagramEventBroker().addNotificationListener((EObject) notification.getNewValue(), defaultValueListener);
}
refreshDisplay();
break;
@@ -249,20 +249,20 @@ public class MessageLabelEditPolicy extends AbstractMaskManagedEditPolicy {
/**
* notifies that a parameter of the operation has changed.
- *
+ *
* @param parameter
- * the {@link Parameter} that has changed
+ * the {@link Parameter} that has changed
* @param notification
- * the notification send when the element has been changed
+ * the notification send when the element has been changed
*/
protected void notifyParameterChanged(Notification notification) {
- switch(notification.getFeatureID(Parameter.class)) {
+ switch (notification.getFeatureID(Parameter.class)) {
case UMLPackage.PARAMETER__DEFAULT_VALUE:
- if(notification.getOldValue() instanceof EObject) {
- getDiagramEventBroker().removeNotificationListener((EObject)notification.getOldValue(), defaultValueListener);
+ if (notification.getOldValue() instanceof EObject) {
+ getDiagramEventBroker().removeNotificationListener((EObject) notification.getOldValue(), defaultValueListener);
}
- if(notification.getNewValue() instanceof EObject) {
- getDiagramEventBroker().addNotificationListener((EObject)notification.getNewValue(), defaultValueListener);
+ if (notification.getNewValue() instanceof EObject) {
+ getDiagramEventBroker().addNotificationListener((EObject) notification.getNewValue(), defaultValueListener);
}
refreshDisplay();
break;
@@ -286,34 +286,34 @@ public class MessageLabelEditPolicy extends AbstractMaskManagedEditPolicy {
}
protected void parameterListChange(Notification notification) {
- switch(notification.getEventType()) {
+ switch (notification.getEventType()) {
// if it is added => adds listener to the type element
case Notification.ADD:
- getDiagramEventBroker().addNotificationListener((EObject)notification.getNewValue(), this);
+ getDiagramEventBroker().addNotificationListener((EObject) notification.getNewValue(), this);
refreshDisplay();
// if it is removed => removes listener from the type element
break;
case Notification.ADD_MANY:
- if(notification.getNewValue() instanceof List<?>) {
- List<?> addedElements = (List<?>)notification.getNewValue();
- for(Object addedElement : addedElements) {
- if(addedElement instanceof EObject) {
- getDiagramEventBroker().addNotificationListener((EObject)addedElement, this);
+ if (notification.getNewValue() instanceof List<?>) {
+ List<?> addedElements = (List<?>) notification.getNewValue();
+ for (Object addedElement : addedElements) {
+ if (addedElement instanceof EObject) {
+ getDiagramEventBroker().addNotificationListener((EObject) addedElement, this);
}
}
}
refreshDisplay();
break;
case Notification.REMOVE:
- getDiagramEventBroker().removeNotificationListener((EObject)notification.getOldValue(), this);
+ getDiagramEventBroker().removeNotificationListener((EObject) notification.getOldValue(), this);
refreshDisplay();
break;
case Notification.REMOVE_MANY:
- if(notification.getOldValue() instanceof List<?>) {
- List<?> removedElements = (List<?>)notification.getOldValue();
- for(Object removedElement : removedElements) {
- if(removedElement instanceof EObject) {
- getDiagramEventBroker().removeNotificationListener((EObject)removedElement, this);
+ if (notification.getOldValue() instanceof List<?>) {
+ List<?> removedElements = (List<?>) notification.getOldValue();
+ for (Object removedElement : removedElements) {
+ if (removedElement instanceof EObject) {
+ getDiagramEventBroker().removeNotificationListener((EObject) removedElement, this);
}
}
}
@@ -322,11 +322,11 @@ public class MessageLabelEditPolicy extends AbstractMaskManagedEditPolicy {
// if it is set, remove the old one and adds the new one. this is the method use when
// the type is set or removed...
case Notification.SET:
- if(notification.getNewValue() != null) {
- getDiagramEventBroker().addNotificationListener((EObject)notification.getNewValue(), this);
+ if (notification.getNewValue() != null) {
+ getDiagramEventBroker().addNotificationListener((EObject) notification.getNewValue(), this);
}
- if(notification.getOldValue() != null) {
- getDiagramEventBroker().removeNotificationListener((EObject)notification.getOldValue(), this);
+ if (notification.getOldValue() != null) {
+ getDiagramEventBroker().removeNotificationListener((EObject) notification.getOldValue(), this);
}
refreshDisplay();
default:
@@ -336,15 +336,15 @@ public class MessageLabelEditPolicy extends AbstractMaskManagedEditPolicy {
/**
* notifies that a parameter of the operation has changed.
- *
+ *
* @param parameter
- * the {@link Parameter} that has changed
+ * the {@link Parameter} that has changed
* @param notification
- * the notification send when the element has been changed
+ * the notification send when the element has been changed
*/
protected void notifyTypeChanged(Notification notification) {
// should be type.class, but seems to be a bug if this is put instead.
- switch(notification.getFeatureID(notification.getNotifier().getClass())) {
+ switch (notification.getFeatureID(notification.getNotifier().getClass())) {
case UMLPackage.TYPE__NAME:
case UMLPackage.TYPE__TEMPLATE_PARAMETER:
case UMLPackage.TYPE__VISIBILITY:
@@ -358,14 +358,14 @@ public class MessageLabelEditPolicy extends AbstractMaskManagedEditPolicy {
/**
* notifies that the the property has changed.
- *
+ *
* @param operation
- * the operation that has changed
+ * the operation that has changed
* @param notification
- * the notification send when the element has been changed
+ * the notification send when the element has been changed
*/
protected void notifyOperationChanged(Operation operation, Notification notification) {
- switch(notification.getFeatureID(Operation.class)) {
+ switch (notification.getFeatureID(Operation.class)) {
case UMLPackage.OPERATION__NAME:
case UMLPackage.OPERATION__VISIBILITY:
case UMLPackage.OPERATION__IS_UNIQUE:
@@ -386,7 +386,7 @@ public class MessageLabelEditPolicy extends AbstractMaskManagedEditPolicy {
}
private void notifySignalChanged(Signal signal, Notification notification) {
- switch(notification.getFeatureID(Signal.class)) {
+ switch (notification.getFeatureID(Signal.class)) {
case UMLPackage.SIGNAL__NAME:
case UMLPackage.SIGNAL__VISIBILITY:
refreshDisplay();
@@ -402,19 +402,19 @@ public class MessageLabelEditPolicy extends AbstractMaskManagedEditPolicy {
/**
* Checks if the given object is one of the parameter type of the operation
- *
+ *
* @param object
- * the object to test
+ * the object to test
* @param operation
* @return <code>true</code> if the object corresponds to the type of a parameter of the
* operation
*/
protected boolean isParameterType(Object object, Operation operation) {
- if(!(object instanceof Type)) {
+ if (!(object instanceof Type)) {
return false;
}
- for(Parameter parameter : operation.getOwnedParameters()) {
- if(object.equals(parameter.getType())) {
+ for (Parameter parameter : operation.getOwnedParameters()) {
+ if (object.equals(parameter.getType())) {
return true;
}
}
@@ -423,25 +423,25 @@ public class MessageLabelEditPolicy extends AbstractMaskManagedEditPolicy {
/**
* Checks if the given object is one of the parameter of the operation
- *
+ *
* @param object
- * the object to test
+ * the object to test
* @param operation
* @return <code>true</code> if the object is a parameter of the operation
*/
protected boolean isParameter(Object object, Operation operation) {
- if(!(object instanceof Parameter)) {
+ if (!(object instanceof Parameter)) {
return false;
}
return operation.getOwnedParameters().contains(object);
}
private boolean isPropertyType(Object object, Signal signal) {
- if(!(object instanceof Type)) {
+ if (!(object instanceof Type)) {
return false;
}
- for(Property property : signal.getOwnedAttributes()) {
- if(object.equals(property.getType())) {
+ for (Property property : signal.getOwnedAttributes()) {
+ if (object.equals(property.getType())) {
return true;
}
}
@@ -449,7 +449,7 @@ public class MessageLabelEditPolicy extends AbstractMaskManagedEditPolicy {
}
private boolean isProperty(Object object, Signal signal) {
- if(!(object instanceof Property)) {
+ if (!(object instanceof Property)) {
return false;
}
return signal.getOwnedAttributes().contains(object);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MoveableNonResizableLabelEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MoveableNonResizableLabelEditPolicy.java
index 3b2877d2a8e..72790acbafc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MoveableNonResizableLabelEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MoveableNonResizableLabelEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -52,7 +52,7 @@ public class MoveableNonResizableLabelEditPolicy extends NonResizableEditPolicyE
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
mh.setDragTracker(createSelectionHandleDragTracker());
return Collections.singletonList(mh);
@@ -63,7 +63,7 @@ public class MoveableNonResizableLabelEditPolicy extends NonResizableEditPolicyE
@Override
protected void eraseChangeBoundsFeedback(ChangeBoundsRequest request) {
super.eraseChangeBoundsFeedback(request);
- if(tether != null) {
+ if (tether != null) {
removeFeedback(tether);
}
tether = null;
@@ -74,23 +74,23 @@ public class MoveableNonResizableLabelEditPolicy extends NonResizableEditPolicyE
IFigure feedback = super.createDragSourceFeedbackFigure();
tether = new Polyline();
tether.setLineStyle(Graphics.LINE_DASHDOT);
- tether.setForegroundColor(((IGraphicalEditPart)getHost()).getFigure().getForegroundColor());
+ tether.setForegroundColor(((IGraphicalEditPart) getHost()).getFigure().getForegroundColor());
addFeedback(tether);
return feedback;
}
/**
* Calculates a point located at the middel of the parent connection
- *
+ *
* @return the point
*/
private Point getReferencePoint() {
- if(getHost().getParent() instanceof AbstractConnectionEditPart) {
- PointList ptList = ((Connection)((ConnectionEditPart)getHost().getParent()).getFigure()).getPoints();
+ if (getHost().getParent() instanceof AbstractConnectionEditPart) {
+ PointList ptList = ((Connection) ((ConnectionEditPart) getHost().getParent()).getFigure()).getPoints();
Point refPoint = PointListUtilities.calculatePointRelativeToLine(ptList, 0, 50, true);
return refPoint;
- } else if(getHost().getParent() instanceof GraphicalEditPart) {
- return ((AbstractGraphicalEditPart)getHost().getParent()).getFigure().getBounds().getCenter();
+ } else if (getHost().getParent() instanceof GraphicalEditPart) {
+ return ((AbstractGraphicalEditPart) getHost().getParent()).getFigure().getBounds().getCenter();
}
return null;
}
@@ -113,12 +113,12 @@ public class MoveableNonResizableLabelEditPolicy extends NonResizableEditPolicyE
// the teher end, however,
// the reference point is causing miscaculation when positioning. This
// has to be redone in version 2.
- if(((IGraphicalEditPart)getHost().getParent()).getFigure() instanceof Connection) {
+ if (((IGraphicalEditPart) getHost().getParent()).getFigure() instanceof Connection) {
centerMain = new Rectangle(refPoint.x, refPoint.y, 0, 0);
getHostFigure().translateToAbsolute(centerMain);
p.translateToRelative(centerMain);
} else {
- centerMain = ((IGraphicalEditPart)getHost().getParent()).getFigure().getBounds().getCopy();
+ centerMain = ((IGraphicalEditPart) getHost().getParent()).getFigure().getBounds().getCopy();
centerMain.translate(centerMain.width / 2, centerMain.height / 2);
getHostFigure().translateToAbsolute(centerMain);
p.translateToRelative(centerMain);
@@ -131,11 +131,11 @@ public class MoveableNonResizableLabelEditPolicy extends NonResizableEditPolicyE
Point startPoint = midTop;
int x = r.x + r.width / 2 - refPoint.x;
int y = r.y + r.height / 2 - refPoint.y;
- if(y > 0 && y > x && y > -x) {
+ if (y > 0 && y > x && y > -x) {
startPoint = midTop;
- } else if(y < 0 && y < x && y < -x) {
+ } else if (y < 0 && y < x && y < -x) {
startPoint = midBottom;
- } else if(x < 0 && y > x && y < -x) {
+ } else if (x < 0 && y > x && y < -x) {
startPoint = midRight;
} else {
startPoint = midLeft;
@@ -146,7 +146,7 @@ public class MoveableNonResizableLabelEditPolicy extends NonResizableEditPolicyE
@Override
protected Command getMoveCommand(ChangeBoundsRequest request) {
- GraphicalEditPart editPart = (GraphicalEditPart)getHost();
+ GraphicalEditPart editPart = (GraphicalEditPart) getHost();
Point refPoint = getReferencePoint();
// translate the feedback figure
PrecisionRectangle rect = new PrecisionRectangle(getInitialFeedbackBounds().getCopy());
@@ -155,7 +155,7 @@ public class MoveableNonResizableLabelEditPolicy extends NonResizableEditPolicyE
rect.resize(request.getSizeDelta());
getHostFigure().translateToRelative(rect);
Point normalPoint = LabelHelper.offsetFromRelativeCoordinate(getHostFigure(), rect, refPoint);
- ICommand moveCommand = new SetBoundsCommand(editPart.getEditingDomain(), DiagramUIMessages.MoveLabelCommand_Label_Location, new EObjectAdapter((View)editPart.getModel()), normalPoint);
+ ICommand moveCommand = new SetBoundsCommand(editPart.getEditingDomain(), DiagramUIMessages.MoveLabelCommand_Label_Location, new EObjectAdapter((View) editPart.getModel()), normalPoint);
return new ICommandProxy(moveCommand);
}
@@ -164,7 +164,7 @@ public class MoveableNonResizableLabelEditPolicy extends NonResizableEditPolicyE
* as the parent of the label and connection will not be the same as the
* target editpart, instead it returns true always since labels can only be
* moved and not resized.
- *
+ *
* @return a drag tracker
*/
protected DragTracker createSelectionHandleDragTracker() {
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 c77a6567fb1..5ff5aefb851 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
@@ -61,7 +61,7 @@ import org.eclipse.uml2.uml.TimeObservation;
/**
* This policy is to process observation link creating, reconnecting
- *
+ *
*/
public class ObservationLinkPolicy extends GraphicalNodeEditPolicy {
@@ -73,39 +73,39 @@ public class ObservationLinkPolicy extends GraphicalNodeEditPolicy {
@Override
public Command getCommand(Request request) {
- if(request instanceof CreateUnspecifiedTypeConnectionRequest) {
- if(((CreateUnspecifiedTypeConnectionRequest)request).getElementTypes().contains(ObservationLinkMetamodelType.getInstance())) {
- if(SequenceUtil.OBSERVATION_LINK_REQUEST_START.equals(request.getType())) {
- return getConnectionCreateCommand((CreateConnectionRequest)request);
+ if (request instanceof CreateUnspecifiedTypeConnectionRequest) {
+ if (((CreateUnspecifiedTypeConnectionRequest) request).getElementTypes().contains(ObservationLinkMetamodelType.getInstance())) {
+ if (SequenceUtil.OBSERVATION_LINK_REQUEST_START.equals(request.getType())) {
+ return getConnectionCreateCommand((CreateConnectionRequest) request);
}
- if(SequenceUtil.OBSERVATION_LINK_REQUEST_END.equals(request.getType())) {
- return getConnectionCompleteCommand((CreateConnectionRequest)request);
+ if (SequenceUtil.OBSERVATION_LINK_REQUEST_END.equals(request.getType())) {
+ return getConnectionCompleteCommand((CreateConnectionRequest) request);
}
}
return null;
}
- if(request instanceof CreateConnectionRequest) {
- CreateConnectionRequest cc = (CreateConnectionRequest)request;
- if(cc.getNewObject() != null) {
- if(cc.getNewObject() instanceof ObservationLink) {
- if(SequenceUtil.OBSERVATION_LINK_REQUEST_START.equals(request.getType())) {
- return getConnectionCreateCommand((CreateConnectionRequest)request);
+ if (request instanceof CreateConnectionRequest) {
+ CreateConnectionRequest cc = (CreateConnectionRequest) request;
+ if (cc.getNewObject() != null) {
+ if (cc.getNewObject() instanceof ObservationLink) {
+ if (SequenceUtil.OBSERVATION_LINK_REQUEST_START.equals(request.getType())) {
+ return getConnectionCreateCommand((CreateConnectionRequest) request);
}
- if(SequenceUtil.OBSERVATION_LINK_REQUEST_END.equals(request.getType())) {
- return getConnectionCompleteCommand((CreateConnectionRequest)request);
+ if (SequenceUtil.OBSERVATION_LINK_REQUEST_END.equals(request.getType())) {
+ return getConnectionCompleteCommand((CreateConnectionRequest) request);
}
}
}
return null;
}
- if(request instanceof ReconnectRequest) {
- ReconnectRequest rr = (ReconnectRequest)request;
- if(rr.getConnectionEditPart() instanceof ObservationLinkEditPart) {
- if(SequenceUtil.OBSERVATION_LINK_REQUEST_RECONNECT_SOURCE.equals(request.getType())) {
- return getReconnectSourceCommand((ReconnectRequest)request);
+ if (request instanceof ReconnectRequest) {
+ ReconnectRequest rr = (ReconnectRequest) request;
+ if (rr.getConnectionEditPart() instanceof ObservationLinkEditPart) {
+ if (SequenceUtil.OBSERVATION_LINK_REQUEST_RECONNECT_SOURCE.equals(request.getType())) {
+ return getReconnectSourceCommand((ReconnectRequest) request);
}
- if(SequenceUtil.OBSERVATION_LINK_REQUEST_RECONNECT_TARGET.equals(request.getType())) {
- return getReconnectTargetCommand((ReconnectRequest)request);
+ if (SequenceUtil.OBSERVATION_LINK_REQUEST_RECONNECT_TARGET.equals(request.getType())) {
+ return getReconnectTargetCommand((ReconnectRequest) request);
}
}
}
@@ -114,18 +114,19 @@ public class ObservationLinkPolicy extends GraphicalNodeEditPolicy {
@Override
public EditPart getTargetEditPart(Request request) {
- if(SequenceUtil.OBSERVATION_LINK_REQUEST_START.equals(request.getType()) || SequenceUtil.OBSERVATION_LINK_REQUEST_END.equals(request.getType()) || SequenceUtil.OBSERVATION_LINK_REQUEST_RECONNECT_SOURCE.equals(request.getType()) || SequenceUtil.OBSERVATION_LINK_REQUEST_RECONNECT_TARGET.equals(request.getType())) {
- if(request instanceof CreateConnectionRequest) {
- if(((CreateConnectionRequest)request).getSourceEditPart() instanceof TimeObservationLabelEditPart) {
- if(getHost() instanceof AbstractMessageEditPart) {
+ if (SequenceUtil.OBSERVATION_LINK_REQUEST_START.equals(request.getType()) || SequenceUtil.OBSERVATION_LINK_REQUEST_END.equals(request.getType()) || SequenceUtil.OBSERVATION_LINK_REQUEST_RECONNECT_SOURCE.equals(request.getType())
+ || SequenceUtil.OBSERVATION_LINK_REQUEST_RECONNECT_TARGET.equals(request.getType())) {
+ if (request instanceof CreateConnectionRequest) {
+ if (((CreateConnectionRequest) request).getSourceEditPart() instanceof TimeObservationLabelEditPart) {
+ if (getHost() instanceof AbstractMessageEditPart) {
return null;
}
}
}
- if(SequenceUtil.OBSERVATION_LINK_REQUEST_RECONNECT_TARGET.equals(request.getType())) {
- if(request instanceof ReconnectRequest) {
- if(((ReconnectRequest)request).getConnectionEditPart().getSource() instanceof TimeObservationLabelEditPart) {
- if(getHost() instanceof AbstractMessageEditPart) {
+ if (SequenceUtil.OBSERVATION_LINK_REQUEST_RECONNECT_TARGET.equals(request.getType())) {
+ if (request instanceof ReconnectRequest) {
+ if (((ReconnectRequest) request).getConnectionEditPart().getSource() instanceof TimeObservationLabelEditPart) {
+ if (getHost() instanceof AbstractMessageEditPart) {
return null;
}
}
@@ -139,21 +140,21 @@ public class ObservationLinkPolicy extends GraphicalNodeEditPolicy {
@Override
protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
EditPart host = getHost();
- if(host instanceof TimeObservationLabelEditPart) {
- TimeObservationLabelEditPart timeObservationLabelEditPart = (TimeObservationLabelEditPart)host;
- if(timeObservationLabelEditPart.getSourceConnections().size() > 0) {
+ if (host instanceof TimeObservationLabelEditPart) {
+ TimeObservationLabelEditPart timeObservationLabelEditPart = (TimeObservationLabelEditPart) host;
+ if (timeObservationLabelEditPart.getSourceConnections().size() > 0) {
return null;
}
- } else if(host instanceof DurationObservationEditPart) {
- DurationObservationEditPart durationObservationEditPart = (DurationObservationEditPart)host;
- if(durationObservationEditPart.getSourceConnections().size() > 0) {
+ } else if (host instanceof DurationObservationEditPart) {
+ DurationObservationEditPart durationObservationEditPart = (DurationObservationEditPart) host;
+ if (durationObservationEditPart.getSourceConnections().size() > 0) {
return null;
}
} else {
return null;
}
CompositeCommand cc = new CompositeCommand(DiagramUIMessages.Commands_CreateCommand_Connection_Label);
- CreateObservationLinkCommand cmd = new CreateObservationLinkCommand(((GraphicalEditPart)editPart).getEditingDomain(), "Create connection command", null);
+ CreateObservationLinkCommand cmd = new CreateObservationLinkCommand(((GraphicalEditPart) editPart).getEditingDomain(), "Create connection command", null);
cmd.setSourceEditPart(host);
cmd.setRequest(request);
cc.compose(cmd);
@@ -165,25 +166,25 @@ public class ObservationLinkPolicy extends GraphicalNodeEditPolicy {
@Override
protected Command getConnectionCompleteCommand(final CreateConnectionRequest request) {
EditPart sourceEditPart = request.getSourceEditPart();
- if((sourceEditPart instanceof TimeObservationLabelEditPart) && !(getHost() instanceof LifelineEditPart)) {
+ if ((sourceEditPart instanceof TimeObservationLabelEditPart) && !(getHost() instanceof LifelineEditPart)) {
return null;
- } else if(sourceEditPart instanceof DurationObservationEditPart && !(getHost() instanceof AbstractMessageEditPart)) {
+ } else if (sourceEditPart instanceof DurationObservationEditPart && !(getHost() instanceof AbstractMessageEditPart)) {
return null;
}
- ICommandProxy proxy = (ICommandProxy)request.getStartCommand();
- if(proxy == null) {
+ ICommandProxy proxy = (ICommandProxy) request.getStartCommand();
+ if (proxy == null) {
return null;
}
CompositeCommand result = new CompositeCommand("Add observation link command");
- if(sourceEditPart instanceof TimeObservationLabelEditPart) {
- result.add(new UpdateTimeObservationLinkTargetElementCommand(((IGraphicalEditPart)getHost()).getEditingDomain(), "Update semantic model", null, request, getHost()));
- } else if(sourceEditPart instanceof DurationObservationEditPart) {
- result.add(new UpdateDurationObservationLinkTargetElementCommand(((IGraphicalEditPart)getHost()).getEditingDomain(), "Update semantic model", null, request, getHost()));
+ if (sourceEditPart instanceof TimeObservationLabelEditPart) {
+ result.add(new UpdateTimeObservationLinkTargetElementCommand(((IGraphicalEditPart) getHost()).getEditingDomain(), "Update semantic model", null, request, getHost()));
+ } else if (sourceEditPart instanceof DurationObservationEditPart) {
+ result.add(new UpdateDurationObservationLinkTargetElementCommand(((IGraphicalEditPart) getHost()).getEditingDomain(), "Update semantic model", null, request, getHost()));
}
- //1:
- CompositeCommand cc = (CompositeCommand)proxy.getICommand();
+ // 1:
+ CompositeCommand cc = (CompositeCommand) proxy.getICommand();
Iterator commandItr = cc.iterator();
- CreateObservationLinkCommand createConnectorViewCommand = (CreateObservationLinkCommand)commandItr.next();
+ CreateObservationLinkCommand createConnectorViewCommand = (CreateObservationLinkCommand) commandItr.next();
createConnectorViewCommand.setSourceEditPart(request.getSourceEditPart());
createConnectorViewCommand.setTargetEditPart(request.getTargetEditPart());
result.add(cc);
@@ -193,21 +194,21 @@ public class ObservationLinkPolicy extends GraphicalNodeEditPolicy {
@Override
protected Command getReconnectSourceCommand(final ReconnectRequest request) {
Command reconnectSourceCommand = super.getReconnectSourceCommand(request);
- ICommandProxy proxy = (ICommandProxy)reconnectSourceCommand;
- CompositeCommand cc = (CompositeCommand)proxy.getICommand();
+ ICommandProxy proxy = (ICommandProxy) reconnectSourceCommand;
+ CompositeCommand cc = (CompositeCommand) proxy.getICommand();
// update semantic model
- if(request.getConnectionEditPart().getSource() instanceof TimeObservationLabelEditPart && getHost() instanceof TimeObservationLabelEditPart) {
- TimeObservationLabelEditPart timeObservationLabelEditPart = (TimeObservationLabelEditPart)getHost();
- if(timeObservationLabelEditPart.getSourceConnections().size() > 0) {
+ if (request.getConnectionEditPart().getSource() instanceof TimeObservationLabelEditPart && getHost() instanceof TimeObservationLabelEditPart) {
+ TimeObservationLabelEditPart timeObservationLabelEditPart = (TimeObservationLabelEditPart) getHost();
+ if (timeObservationLabelEditPart.getSourceConnections().size() > 0) {
return null;
}
- cc.add(new UpdateTimeObservationLinkSourceElementCommand(((IGraphicalEditPart)getHost()).getEditingDomain(), "Update semantic model", null, request, getHost()));
- } else if(request.getConnectionEditPart().getSource() instanceof DurationObservationEditPart && getHost() instanceof DurationObservationEditPart) {
- DurationObservationEditPart durationObservationEditPart = (DurationObservationEditPart)getHost();
- if(durationObservationEditPart.getSourceConnections().size() > 0) {
+ cc.add(new UpdateTimeObservationLinkSourceElementCommand(((IGraphicalEditPart) getHost()).getEditingDomain(), "Update semantic model", null, request, getHost()));
+ } else if (request.getConnectionEditPart().getSource() instanceof DurationObservationEditPart && getHost() instanceof DurationObservationEditPart) {
+ DurationObservationEditPart durationObservationEditPart = (DurationObservationEditPart) getHost();
+ if (durationObservationEditPart.getSourceConnections().size() > 0) {
return null;
}
- cc.add(new UpdateDurationObservationLinkSourceElementCommand(((IGraphicalEditPart)getHost()).getEditingDomain(), "Update semantic model", null, request, getHost()));
+ cc.add(new UpdateDurationObservationLinkSourceElementCommand(((IGraphicalEditPart) getHost()).getEditingDomain(), "Update semantic model", null, request, getHost()));
}
return reconnectSourceCommand;
}
@@ -215,27 +216,27 @@ public class ObservationLinkPolicy extends GraphicalNodeEditPolicy {
@Override
protected Command getReconnectTargetCommand(final ReconnectRequest request) {
Command reconnectTargetCommand = super.getReconnectTargetCommand(request);
- ICommandProxy proxy = (ICommandProxy)reconnectTargetCommand;
- CompositeCommand cc = (CompositeCommand)proxy.getICommand();
+ ICommandProxy proxy = (ICommandProxy) reconnectTargetCommand;
+ CompositeCommand cc = (CompositeCommand) proxy.getICommand();
// update semantic model
- if(request.getConnectionEditPart().getSource() instanceof TimeObservationLabelEditPart) {
- cc.add(new UpdateTimeObservationLinkTargetElementCommand(((IGraphicalEditPart)getHost()).getEditingDomain(), "Update semantic model", null, request, getHost()));
- } else if(request.getConnectionEditPart().getSource() instanceof DurationObservationEditPart) {
- cc.add(new UpdateDurationObservationLinkTargetElementCommand(((IGraphicalEditPart)getHost()).getEditingDomain(), "Update semantic model", null, request, getHost()));
+ if (request.getConnectionEditPart().getSource() instanceof TimeObservationLabelEditPart) {
+ cc.add(new UpdateTimeObservationLinkTargetElementCommand(((IGraphicalEditPart) getHost()).getEditingDomain(), "Update semantic model", null, request, getHost()));
+ } else if (request.getConnectionEditPart().getSource() instanceof DurationObservationEditPart) {
+ cc.add(new UpdateDurationObservationLinkTargetElementCommand(((IGraphicalEditPart) getHost()).getEditingDomain(), "Update semantic model", null, request, getHost()));
}
return proxy;
}
@Override
public void showSourceFeedback(Request request) {
- if((SequenceUtil.OBSERVATION_LINK_REQUEST_END).equals(request.getType())) {
- showCreationFeedback((CreateConnectionRequest)request);
+ if ((SequenceUtil.OBSERVATION_LINK_REQUEST_END).equals(request.getType())) {
+ showCreationFeedback((CreateConnectionRequest) request);
}
}
@Override
protected FeedbackHelper getFeedbackHelper(CreateConnectionRequest request) {
- if(feedbackHelper == null) {
+ if (feedbackHelper == null) {
feedbackHelper = new FeedbackHelper();
Point p = request.getLocation();
connectionFeedback = createDummyConnection(request);
@@ -251,22 +252,24 @@ public class ObservationLinkPolicy extends GraphicalNodeEditPolicy {
@Override
public void showTargetFeedback(Request request) {
- if(SequenceUtil.OBSERVATION_LINK_REQUEST_START.equals(request.getType()) || SequenceUtil.OBSERVATION_LINK_REQUEST_END.equals(request.getType()) || SequenceUtil.OBSERVATION_LINK_REQUEST_RECONNECT_SOURCE.equals(request.getType()) || SequenceUtil.OBSERVATION_LINK_REQUEST_RECONNECT_TARGET.equals(request.getType())) {
- showTargetConnectionFeedback((DropRequest)request);
+ if (SequenceUtil.OBSERVATION_LINK_REQUEST_START.equals(request.getType()) || SequenceUtil.OBSERVATION_LINK_REQUEST_END.equals(request.getType()) || SequenceUtil.OBSERVATION_LINK_REQUEST_RECONNECT_SOURCE.equals(request.getType())
+ || SequenceUtil.OBSERVATION_LINK_REQUEST_RECONNECT_TARGET.equals(request.getType())) {
+ showTargetConnectionFeedback((DropRequest) request);
}
}
@Override
public void eraseSourceFeedback(Request request) {
- if(SequenceUtil.OBSERVATION_LINK_REQUEST_END.equals(request.getType())) {
- eraseCreationFeedback((CreateConnectionRequest)request);
+ if (SequenceUtil.OBSERVATION_LINK_REQUEST_END.equals(request.getType())) {
+ eraseCreationFeedback((CreateConnectionRequest) request);
}
}
@Override
public void eraseTargetFeedback(Request request) {
- if(SequenceUtil.OBSERVATION_LINK_REQUEST_START.equals(request.getType()) || SequenceUtil.OBSERVATION_LINK_REQUEST_END.equals(request.getType()) || SequenceUtil.OBSERVATION_LINK_REQUEST_RECONNECT_SOURCE.equals(request.getType()) || SequenceUtil.OBSERVATION_LINK_REQUEST_RECONNECT_TARGET.equals(request.getType())) {
- eraseTargetConnectionFeedback((DropRequest)request);
+ if (SequenceUtil.OBSERVATION_LINK_REQUEST_START.equals(request.getType()) || SequenceUtil.OBSERVATION_LINK_REQUEST_END.equals(request.getType()) || SequenceUtil.OBSERVATION_LINK_REQUEST_RECONNECT_SOURCE.equals(request.getType())
+ || SequenceUtil.OBSERVATION_LINK_REQUEST_RECONNECT_TARGET.equals(request.getType())) {
+ eraseTargetConnectionFeedback((DropRequest) request);
}
}
@@ -283,20 +286,20 @@ public class ObservationLinkPolicy extends GraphicalNodeEditPolicy {
public UpdateDurationObservationLinkSourceElementCommand(TransactionalEditingDomain domain, String label, List affectedFiles, ReconnectRequest request, EditPart hostPart) {
super(domain, label, affectedFiles);
this.request = request;
- sourceTolEP = (DurationObservationEditPart)request.getConnectionEditPart().getSource();
+ sourceTolEP = (DurationObservationEditPart) request.getConnectionEditPart().getSource();
this.hostPart = hostPart;
}
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(sourceTolEP == hostPart) {
+ if (sourceTolEP == hostPart) {
return CommandResult.newCancelledCommandResult();
}
- View sourceView = (View)sourceTolEP.getModel();
- DurationObservation sourceDurationObservation = (DurationObservation)sourceView.getElement();
- DurationObservationEditPart targetDoEP = (DurationObservationEditPart)hostPart;
- View targetView = (View)targetDoEP.getModel();
- DurationObservation targetDurationObservation = (DurationObservation)targetView.getElement();
+ View sourceView = (View) sourceTolEP.getModel();
+ DurationObservation sourceDurationObservation = (DurationObservation) sourceView.getElement();
+ DurationObservationEditPart targetDoEP = (DurationObservationEditPart) hostPart;
+ View targetView = (View) targetDoEP.getModel();
+ DurationObservation targetDurationObservation = (DurationObservation) targetView.getElement();
targetDurationObservation.getEvents().addAll(sourceDurationObservation.getEvents());
sourceDurationObservation.getEvents().clear();
return CommandResult.newOKCommandResult();
@@ -304,7 +307,7 @@ public class ObservationLinkPolicy extends GraphicalNodeEditPolicy {
@Override
public boolean canExecute() {
- if(hostPart instanceof DurationObservationEditPart) {
+ if (hostPart instanceof DurationObservationEditPart) {
return true;
}
return false;
@@ -326,45 +329,45 @@ public class ObservationLinkPolicy extends GraphicalNodeEditPolicy {
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
DurationObservationEditPart doEP = null;
- if(request instanceof CreateConnectionRequest) {
- doEP = (DurationObservationEditPart)(((CreateConnectionRequest)request).getSourceEditPart());
- } else if(request instanceof ReconnectRequest) {
- doEP = (DurationObservationEditPart)(((ReconnectRequest)request).getConnectionEditPart().getSource());
+ if (request instanceof CreateConnectionRequest) {
+ doEP = (DurationObservationEditPart) (((CreateConnectionRequest) request).getSourceEditPart());
+ } else if (request instanceof ReconnectRequest) {
+ doEP = (DurationObservationEditPart) (((ReconnectRequest) request).getConnectionEditPart().getSource());
}
- View view = (View)doEP.getModel();
- DurationObservation durationObservation = (DurationObservation)view.getElement();
+ View view = (View) doEP.getModel();
+ DurationObservation durationObservation = (DurationObservation) view.getElement();
EList<NamedElement> events = durationObservation.getEvents();
- // if is reconnect operation, first remove orginal message event of DurationObservation
- if(request instanceof ReconnectRequest) {
+ // if is reconnect operation, first remove orginal message event of DurationObservation
+ if (request instanceof ReconnectRequest) {
events.clear();
}
Map<String, Object> extendedData = request.getExtendedData();
// assign the occurrence specification
Object paramOcc1 = extendedData.get(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION);
Object paramOcc2 = extendedData.get(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2);
- if(paramOcc1 != null && paramOcc2 != null) {
- events.add((OccurrenceSpecification)paramOcc1);
- events.add((OccurrenceSpecification)paramOcc2);
+ if (paramOcc1 != null && paramOcc2 != null) {
+ events.add((OccurrenceSpecification) paramOcc1);
+ events.add((OccurrenceSpecification) paramOcc2);
}
return CommandResult.newOKCommandResult();
}
@Override
public boolean canExecute() {
- if(hostPart instanceof ConnectionNodeEditPart) {
+ if (hostPart instanceof ConnectionNodeEditPart) {
Map<String, Object> extendedData = request.getExtendedData();
- if(hostPart instanceof AbstractMessageEditPart) {
- AbstractMessageEditPart messageEP = (AbstractMessageEditPart)hostPart;
- View view = (View)messageEP.getModel();
- Message message = (Message)view.getElement();
- if(message.getSendEvent() != null) {
+ if (hostPart instanceof AbstractMessageEditPart) {
+ AbstractMessageEditPart messageEP = (AbstractMessageEditPart) hostPart;
+ View view = (View) messageEP.getModel();
+ Message message = (Message) view.getElement();
+ if (message.getSendEvent() != null) {
extendedData.put(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION, message.getSendEvent());
}
- if(message.getReceiveEvent() != null) {
+ 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(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION) && extendedData.containsKey(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION_2)) {
return true;
}
}
@@ -385,20 +388,20 @@ public class ObservationLinkPolicy extends GraphicalNodeEditPolicy {
public UpdateTimeObservationLinkSourceElementCommand(TransactionalEditingDomain domain, String label, List affectedFiles, ReconnectRequest request, EditPart hostPart) {
super(domain, label, affectedFiles);
this.request = request;
- sourceTolEP = (TimeObservationLabelEditPart)request.getConnectionEditPart().getSource();
+ sourceTolEP = (TimeObservationLabelEditPart) request.getConnectionEditPart().getSource();
this.hostPart = hostPart;
}
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(sourceTolEP == hostPart) {
+ if (sourceTolEP == hostPart) {
return CommandResult.newCancelledCommandResult();
}
- View sourceView = (View)sourceTolEP.getModel();
- TimeObservation sourceTimeObservation = (TimeObservation)sourceView.getElement();
- TimeObservationLabelEditPart targetTolEP = (TimeObservationLabelEditPart)hostPart;
- View targetView = (View)targetTolEP.getModel();
- TimeObservation targetTimeObservation = (TimeObservation)targetView.getElement();
+ View sourceView = (View) sourceTolEP.getModel();
+ TimeObservation sourceTimeObservation = (TimeObservation) sourceView.getElement();
+ TimeObservationLabelEditPart targetTolEP = (TimeObservationLabelEditPart) hostPart;
+ View targetView = (View) targetTolEP.getModel();
+ TimeObservation targetTimeObservation = (TimeObservation) targetView.getElement();
targetTimeObservation.setEvent(sourceTimeObservation.getEvent());
sourceTimeObservation.setEvent(null);
return CommandResult.newOKCommandResult();
@@ -406,7 +409,7 @@ public class ObservationLinkPolicy extends GraphicalNodeEditPolicy {
@Override
public boolean canExecute() {
- if(hostPart instanceof TimeObservationLabelEditPart) {
+ if (hostPart instanceof TimeObservationLabelEditPart) {
return true;
}
return false;
@@ -430,17 +433,17 @@ public class ObservationLinkPolicy extends GraphicalNodeEditPolicy {
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
TimeObservationLabelEditPart tolEP = null;
- if(request instanceof CreateConnectionRequest) {
- tolEP = (TimeObservationLabelEditPart)(((CreateConnectionRequest)request).getSourceEditPart());
- } else if(request instanceof ReconnectRequest) {
- tolEP = (TimeObservationLabelEditPart)(((ReconnectRequest)request).getConnectionEditPart().getSource());
+ if (request instanceof CreateConnectionRequest) {
+ tolEP = (TimeObservationLabelEditPart) (((CreateConnectionRequest) request).getSourceEditPart());
+ } else if (request instanceof ReconnectRequest) {
+ tolEP = (TimeObservationLabelEditPart) (((ReconnectRequest) request).getConnectionEditPart().getSource());
}
- View view = (View)tolEP.getModel();
- TimeObservation timeObservation = (TimeObservation)view.getElement();
+ View view = (View) tolEP.getModel();
+ TimeObservation timeObservation = (TimeObservation) view.getElement();
// assign the occurrence specification
- if(!occList.isEmpty()) {
- for(OccurrenceSpecification occurrence : occList) {
- //Not needed since fixed bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=402975
+ if (!occList.isEmpty()) {
+ for (OccurrenceSpecification occurrence : occList) {
+ // Not needed since fixed bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=402975
/*
* if(occurrence instanceof MessageOccurrenceSpecification) {
* Message mess = ((MessageOccurrenceSpecification)occurrence).getMessage();
@@ -457,46 +460,46 @@ public class ObservationLinkPolicy extends GraphicalNodeEditPolicy {
}
}
// reset request vertical location
- if(timeObservation.getEvent() instanceof MessageOccurrenceSpecification) {
- Point messageOccurrenceLoc = SequenceUtil.findLocationOfMessageOccurrence((GraphicalEditPart)hostPart, (MessageOccurrenceSpecification)timeObservation.getEvent());
+ if (timeObservation.getEvent() instanceof MessageOccurrenceSpecification) {
+ Point messageOccurrenceLoc = SequenceUtil.findLocationOfMessageOccurrence((GraphicalEditPart) hostPart, (MessageOccurrenceSpecification) timeObservation.getEvent());
setRequestLocation(messageOccurrenceLoc);
- } else if(timeObservation.getEvent() instanceof ExecutionOccurrenceSpecification) {
- Point executionOccurrenceLoc = SequenceUtil.findLocationOfExecutionOccurrence((GraphicalEditPart)hostPart, (ExecutionOccurrenceSpecification)timeObservation.getEvent());
+ } else if (timeObservation.getEvent() instanceof ExecutionOccurrenceSpecification) {
+ Point executionOccurrenceLoc = SequenceUtil.findLocationOfExecutionOccurrence((GraphicalEditPart) hostPart, (ExecutionOccurrenceSpecification) timeObservation.getEvent());
setRequestLocation(executionOccurrenceLoc);
}
return CommandResult.newOKCommandResult();
}
private void setRequestLocation(Point occurrenceLoc) {
- if(occurrenceLoc == null) {
+ if (occurrenceLoc == null) {
return;
}
- if(request instanceof CreateConnectionRequest) {
- CreateConnectionRequest req = (CreateConnectionRequest)request;
+ if (request instanceof CreateConnectionRequest) {
+ CreateConnectionRequest req = (CreateConnectionRequest) request;
req.setLocation(new Point(req.getLocation().x, occurrenceLoc.y));
- } else if(request instanceof ReconnectRequest) {
- ReconnectRequest req = (ReconnectRequest)request;
+ } else if (request instanceof ReconnectRequest) {
+ ReconnectRequest req = (ReconnectRequest) request;
req.setLocation(new Point(req.getLocation().x, occurrenceLoc.y));
}
}
@Override
public boolean canExecute() {
- if(hostPart instanceof LifelineEditPart) {
+ if (hostPart instanceof LifelineEditPart) {
Point location = null;
- if(request instanceof CreateConnectionRequest) {
- location = ((CreateConnectionRequest)request).getLocation();
- } else if(request instanceof ReconnectRequest) {
- location = ((ReconnectRequest)request).getLocation();
+ if (request instanceof CreateConnectionRequest) {
+ location = ((CreateConnectionRequest) request).getLocation();
+ } else if (request instanceof ReconnectRequest) {
+ location = ((ReconnectRequest) request).getLocation();
}
- Entry<Point, List<OccurrenceSpecification>> eventAndLocation = SequenceUtil.findNearestEvent(location, (LifelineEditPart)hostPart);
+ Entry<Point, List<OccurrenceSpecification>> eventAndLocation = SequenceUtil.findNearestEvent(location, (LifelineEditPart) hostPart);
// find an event near enough to create the
// constraint or observation
occList = Collections.emptyList();
- if(eventAndLocation != null) {
+ if (eventAndLocation != null) {
occList = eventAndLocation.getValue();
}
- if(!occList.isEmpty()) {
+ if (!occList.isEmpty()) {
/*
* for(OccurrenceSpecification occurrence : occList) {
* if(occurrence instanceof MessageOccurrenceSpecification) {
@@ -511,7 +514,7 @@ public class ObservationLinkPolicy extends GraphicalNodeEditPolicy {
* return true;
* }
*/
- //Not needed since fixed bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=402975
+ // Not needed since fixed bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=402975
return true;
}
}
@@ -552,18 +555,18 @@ public class ObservationLinkPolicy extends GraphicalNodeEditPolicy {
c = new ObservationLink();
c.setType(SequenceUtil.OBSERVATION_LINK_TYPE);
c.setElement(null);
- View newSourceView = (View)sourceEditPart.getModel();
+ View newSourceView = (View) sourceEditPart.getModel();
c.setSource(newSourceView);
ViewUtil.insertChildView(newSourceView.getDiagram(), c, -1, true);
- INodeEditPart ce = (INodeEditPart)sourceEditPart;
+ INodeEditPart ce = (INodeEditPart) sourceEditPart;
ConnectionAnchor sourceAnchor = ce.getSourceConnectionAnchor(request);
newSourceTerminal = ce.mapConnectionAnchorToTerminal(sourceAnchor);
- if(newSourceTerminal != null) {
- if(newSourceTerminal.length() == 0) {
+ if (newSourceTerminal != null) {
+ if (newSourceTerminal.length() == 0) {
c.setSourceAnchor(null);
} else {
- IdentityAnchor a = (IdentityAnchor)c.getSourceAnchor();
- if(a == null) {
+ IdentityAnchor a = (IdentityAnchor) c.getSourceAnchor();
+ if (a == null) {
a = NotationFactory.eINSTANCE.createIdentityAnchor();
}
a.setId(newSourceTerminal);
@@ -576,25 +579,25 @@ public class ObservationLinkPolicy extends GraphicalNodeEditPolicy {
private void initCompleteCommand() {
// reset the target edit-part for the request
- if(targetEditPart != null) {
- View newTargetView = ((IGraphicalEditPart)targetEditPart).getNotationView();
+ if (targetEditPart != null) {
+ View newTargetView = ((IGraphicalEditPart) targetEditPart).getNotationView();
c.setTarget(newTargetView);
// 3:
- INodeEditPart ce = (INodeEditPart)targetEditPart;
+ INodeEditPart ce = (INodeEditPart) targetEditPart;
ConnectionAnchor targetAnchor = null;
- if(ce instanceof LifelineEditPart) {
- LifelineEditPart lifelinePart = (LifelineEditPart)ce;
+ if (ce instanceof LifelineEditPart) {
+ LifelineEditPart lifelinePart = (LifelineEditPart) ce;
targetAnchor = LifelineEditPartUtil.getNodeFigure(lifelinePart).getTargetConnectionAnchorAt(request.getLocation());
} else {
targetAnchor = ce.getTargetConnectionAnchor(request);
}
String newTargetTerminal = ce.mapConnectionAnchorToTerminal(targetAnchor);
- if(newTargetTerminal != null) {
- if(newTargetTerminal.length() == 0) {
+ if (newTargetTerminal != null) {
+ if (newTargetTerminal.length() == 0) {
c.setTargetAnchor(null);
} else {
- IdentityAnchor a = (IdentityAnchor)c.getTargetAnchor();
- if(a == null) {
+ IdentityAnchor a = (IdentityAnchor) c.getTargetAnchor();
+ if (a == null) {
a = NotationFactory.eINSTANCE.createIdentityAnchor();
}
a.setId(newTargetTerminal);
@@ -602,10 +605,10 @@ public class ObservationLinkPolicy extends GraphicalNodeEditPolicy {
}
}
// 4:
- INodeEditPart sourceEditPart = (INodeEditPart)request.getSourceEditPart();
+ INodeEditPart sourceEditPart = (INodeEditPart) request.getSourceEditPart();
ConnectionAnchor sourceAnchor = sourceEditPart.mapTerminalToConnectionAnchor(newSourceTerminal);
PointList pointList = new PointList();
- if(request.getLocation() == null) {
+ if (request.getLocation() == null) {
pointList.addPoint(sourceAnchor.getLocation(targetAnchor.getReferencePoint()));
pointList.addPoint(targetAnchor.getLocation(sourceAnchor.getReferencePoint()));
} else {
@@ -614,7 +617,7 @@ public class ObservationLinkPolicy extends GraphicalNodeEditPolicy {
}
List newBendpoints = new ArrayList();
int numOfPoints = pointList.size();
- for(short i = 0; i < numOfPoints; i++) {
+ for (short i = 0; i < numOfPoints; i++) {
Dimension s = pointList.getPoint(i).getDifference(sourceAnchor.getReferencePoint());
Dimension t = pointList.getPoint(i).getDifference(targetAnchor.getReferencePoint());
newBendpoints.add(new RelativeBendpoint(s.width, s.height, t.width, t.height));
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/RemoveOrphanViewPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/RemoveOrphanViewPolicy.java
index 2a11cc680ea..b65a9570603 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/RemoveOrphanViewPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/RemoveOrphanViewPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -22,7 +22,7 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineNameEditPart;
* this policy is used to suppress orphan node view in GMF view the policy to remove orphan
* connection is more complex. It is dependent of the diagram. see remove OrphanConnectionView
* policy
- *
+ *
*/
public class RemoveOrphanViewPolicy extends OrphanViewPolicy {
@@ -35,10 +35,10 @@ public class RemoveOrphanViewPolicy extends OrphanViewPolicy {
@Override
protected boolean isOrphaned(View view) {
- //Since added support of ShapeCompartment for NamedElement(See ShapeCompartmentEditPolicy.CreateShapeCompartmentViewCommand, the element is not set for ShapeCompartment),
- //There's a bug about removing orphaned views. Some ShapeCompartments unrelated to current context would be removed, this will block the undo/redo actions.
- if(view instanceof BasicCompartment) {
- return ((BasicCompartment)view).getElement() == null;
+ // Since added support of ShapeCompartment for NamedElement(See ShapeCompartmentEditPolicy.CreateShapeCompartmentViewCommand, the element is not set for ShapeCompartment),
+ // There's a bug about removing orphaned views. Some ShapeCompartments unrelated to current context would be removed, this will block the undo/redo actions.
+ if (view instanceof BasicCompartment) {
+ return ((BasicCompartment) view).getElement() == null;
}
return super.isOrphaned(view);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/SequenceConnectionHandleEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/SequenceConnectionHandleEditPolicy.java
index 114d740d9af..0d08773446e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/SequenceConnectionHandleEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/SequenceConnectionHandleEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -32,17 +32,17 @@ import org.eclipse.ui.PlatformUI;
/**
* Fixed bug about displaying diagram assistant handles.
* In GMF DiagramAssistantEditPolicy, isDiagramPartActive() is only available for IDiagramWorkbenchPart, but we use PapyrusMultiDiagramEditor.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class SequenceConnectionHandleEditPolicy extends ConnectionHandleEditPolicy {
@Override
protected boolean shouldShowDiagramAssistant() {
- if(!(getHost().isActive() && isPreferenceOn() && isHostEditable() && isHostResolvable() && isDiagramPartActive())) {
+ if (!(getHost().isActive() && isPreferenceOn() && isHostEditable() && isHostResolvable() && isDiagramPartActive())) {
return false;
}
- if(hasHandles() || !isSelectionToolActive()) {
+ if (hasHandles() || !isSelectionToolActive()) {
return false;
}
return true;
@@ -64,9 +64,9 @@ public class SequenceConnectionHandleEditPolicy extends ConnectionHandleEditPoli
private boolean isSelectionToolActive() {
// getViewer calls getParent so check for null
- if(getHost().getParent() != null) {
+ if (getHost().getParent() != null) {
Tool theTool = getHost().getViewer().getEditDomain().getActiveTool();
- if((theTool != null) && theTool instanceof SelectionTool) {
+ if ((theTool != null) && theTool instanceof SelectionTool) {
return true;
}
}
@@ -75,25 +75,25 @@ public class SequenceConnectionHandleEditPolicy extends ConnectionHandleEditPoli
/**
* Checks if the diagram part is active.
- *
+ *
* @return True if the diagram part is active; false otherwise.
*/
private boolean isDiagramPartActive() {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if(window != null) {
+ if (window != null) {
IWorkbenchPage page = window.getActivePage();
- if(page != null) {
+ if (page != null) {
IWorkbenchPart activePart = page.getActivePart();
IDiagramWorkbenchPart editorPart = null;
- if(activePart instanceof IDiagramWorkbenchPart) {
- editorPart = (IDiagramWorkbenchPart)activePart;
- } else if(activePart instanceof IAdaptable) {
- editorPart = (IDiagramWorkbenchPart)((IAdaptable)activePart).getAdapter(IDiagramWorkbenchPart.class);
+ if (activePart instanceof IDiagramWorkbenchPart) {
+ editorPart = (IDiagramWorkbenchPart) activePart;
+ } else if (activePart instanceof IAdaptable) {
+ editorPart = (IDiagramWorkbenchPart) ((IAdaptable) activePart).getAdapter(IDiagramWorkbenchPart.class);
}
- if(editorPart == null) {
+ if (editorPart == null) {
return false;
}
- return editorPart.getDiagramEditPart().getRoot().equals(((IGraphicalEditPart)getHost()).getRoot());
+ return editorPart.getDiagramEditPart().getRoot().equals(((IGraphicalEditPart) getHost()).getRoot());
}
}
return false;
@@ -101,26 +101,26 @@ public class SequenceConnectionHandleEditPolicy extends ConnectionHandleEditPoli
/**
* Checks if the host editpart is editable.
- *
+ *
* @return True if the host is editable; false otherwise.
*/
private boolean isHostEditable() {
- if(getHost() instanceof GraphicalEditPart) {
- return ((GraphicalEditPart)getHost()).isEditModeEnabled();
+ if (getHost() instanceof GraphicalEditPart) {
+ return ((GraphicalEditPart) getHost()).isEditModeEnabled();
}
return true;
}
/**
* Is the host's semantic reference resolvable (if applicable)?
- *
+ *
* @return true if the semantic reference is resolvable, true if there is no
* semantic reference, and false otherwise
*/
private boolean isHostResolvable() {
- final View view = (View)getHost().getModel();
+ final View view = (View) getHost().getModel();
EObject element = view.getElement();
- if(element != null) {
+ if (element != null) {
return !element.eIsProxy();
}
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 8bd3eb4b8e8..d23a68a664a 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,7 +1,7 @@
/*****************************************************************************
* 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
@@ -85,7 +85,7 @@ import org.eclipse.uml2.uml.OccurrenceSpecification;
* - 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 {
@@ -96,9 +96,9 @@ public class SequenceGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
/**
* 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
+ * creation request
* @return Command
*/
@Override
@@ -106,20 +106,20 @@ public class SequenceGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
Map<String, Object> extendedData = request.getExtendedData();
// record the nearest event if necessary
String requestHint = request.getConnectionViewAndElementDescriptor().getSemanticHint();
- if(isCreatedNearOccurrenceSpecification(requestHint) || isOnOccerrenceSpecification(request.getLocation())) {
+ if (isCreatedNearOccurrenceSpecification(requestHint) || isOnOccerrenceSpecification(request.getLocation())) {
LifelineEditPart lifelinePart = SequenceUtil.getParentLifelinePart(getHost());
- if(lifelinePart != null) {
+ 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) {
+ 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) {
+ if (location != null) {
request.setLocation(location);
}
}
@@ -129,12 +129,12 @@ public class SequenceGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
private boolean isOnOccerrenceSpecification(Point location) {
EditPart editPart = getHost().getViewer().findObjectAt(location);
- if(editPart == null) {
+ if (editPart == null) {
return false;
}
Object model = editPart.getModel();
- if(model instanceof View) {
- return (ViewUtil.resolveSemanticElement((View)model) instanceof OccurrenceSpecification);
+ if (model instanceof View) {
+ return (ViewUtil.resolveSemanticElement((View) model) instanceof OccurrenceSpecification);
}
return false;
}
@@ -142,9 +142,9 @@ public class SequenceGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
/**
* 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
+ * the creation request
* @return Command
*/
@Override
@@ -152,27 +152,27 @@ public class SequenceGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
Map<String, Object> extendedData = request.getExtendedData();
// record the nearest event if necessary
String requestHint = request.getConnectionViewAndElementDescriptor().getSemanticHint();
- if(isCreatedNearOccurrenceSpecification(requestHint) || isOnOccerrenceSpecification(request.getLocation())) {
+ if (isCreatedNearOccurrenceSpecification(requestHint) || isOnOccerrenceSpecification(request.getLocation())) {
LifelineEditPart lifelinePart = SequenceUtil.getParentLifelinePart(getHost());
- if(lifelinePart != null) {
+ 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) {
+ 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) {
+ if (location != null) {
request.setLocation(location);
}
}
}
- //Ordering message occurrence specifications after message creation, See https://bugs.eclipse.org/bugs/show_bug.cgi?id=403233
+ // 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()) {
+ if (command != null && command.canExecute()) {
command = command.chain(FragmentsOrdererHelper.createOrderingFragmentsCommand(getHost(), request));
}
return command;
@@ -180,38 +180,38 @@ public class SequenceGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
/**
* Return true if creation must be performed to or from an occurrence specification
- *
+ *
* @param requestHint
- * the hint of object to create
+ * 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_4012).getSemanticHint();
+ String generalOrderingHint = ((IHintedType) UMLElementTypes.GeneralOrdering_4012).getSemanticHint();
return generalOrderingHint.equals(requestHint);
}
/**
* Return true if a message is being created
- *
+ *
* @param requestHint
- * the hint of object to create
+ * 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_4003).getSemanticHint();
+ String messageHint = ((IHintedType) UMLElementTypes.Message_4003).getSemanticHint();
messageHints.add(messageHint);
- messageHint = ((IHintedType)UMLElementTypes.Message_4004).getSemanticHint();
+ messageHint = ((IHintedType) UMLElementTypes.Message_4004).getSemanticHint();
messageHints.add(messageHint);
- messageHint = ((IHintedType)UMLElementTypes.Message_4005).getSemanticHint();
+ messageHint = ((IHintedType) UMLElementTypes.Message_4005).getSemanticHint();
messageHints.add(messageHint);
- messageHint = ((IHintedType)UMLElementTypes.Message_4006).getSemanticHint();
+ messageHint = ((IHintedType) UMLElementTypes.Message_4006).getSemanticHint();
messageHints.add(messageHint);
- messageHint = ((IHintedType)UMLElementTypes.Message_4007).getSemanticHint();
+ messageHint = ((IHintedType) UMLElementTypes.Message_4007).getSemanticHint();
messageHints.add(messageHint);
- messageHint = ((IHintedType)UMLElementTypes.Message_4008).getSemanticHint();
+ messageHint = ((IHintedType) UMLElementTypes.Message_4008).getSemanticHint();
messageHints.add(messageHint);
- messageHint = ((IHintedType)UMLElementTypes.Message_4009).getSemanticHint();
+ messageHint = ((IHintedType) UMLElementTypes.Message_4009).getSemanticHint();
messageHints.add(messageHint);
return messageHints.contains(requestHint);
}
@@ -220,13 +220,13 @@ public class SequenceGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
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) {
+ 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()) {
+ if (sourcePointCopy.y() < sourceBounds.getBottom().y()) {
target.getFigure().translateToAbsolute(sourceBounds);
request.getLocation().setY(sourceBounds.getBottom().y() + 1);
}
@@ -238,13 +238,13 @@ public class SequenceGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
* location if needed.
*/
PointEx sourcePoint = new PointEx(request.getLocation());
- Viewport vp = findViewport((GraphicalEditPart)getHost().getViewer().getRootEditPart());
- if(vp != null) {
+ 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.
+ // Safely calculate the source model container here.
request.getExtendedData().put(SequenceRequestConstant.SOURCE_MODEL_CONTAINER, SequenceUtil.findInteractionFragmentContainerAt(sourcePoint, getHost()));
return super.getConnectionCreateCommand(request);
}
@@ -253,16 +253,16 @@ public class SequenceGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
IFigure figure = null;
Viewport port = null;
do {
- if(figure == null) {
+ if (figure == null) {
figure = part.getContentPane();
} else {
figure = figure.getParent();
}
- if(figure instanceof Viewport) {
- port = (Viewport)figure;
+ if (figure instanceof Viewport) {
+ port = (Viewport) figure;
break;
}
- } while(figure != part.getFigure() && figure != null);
+ } while (figure != part.getFigure() && figure != null);
return port;
}
@@ -272,80 +272,80 @@ public class SequenceGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
@Override
protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
Command command = super.getConnectionCompleteCommand(request);
- if(command == null) {
+ 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)) {
+ 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);
+ // 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) {
+ // 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);
+ sourcePoint = ((PointEx) sourcePoint).adjustToFitNewViewport(loc2);
}
}
// prevent uphill message (leave margin for horizontal messages)
- boolean messageCreate = ((IHintedType)UMLElementTypes.Message_4006).getSemanticHint().equals(requestHint);
- if(sourcePoint == null || sourcePoint.y >= targetPoint.y + MARGIN) {
- if(!messageCreate && !isLostFoundMessage(requestHint)) {
+ boolean messageCreate = ((IHintedType) UMLElementTypes.Message_4006).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) {
+ 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_4005).getSemanticHint();
- if(replyHint.equals(desc.getSemanticHint()) && request.getSourceEditPart() instanceof IGraphicalEditPart) {
- Rectangle srcBounds = SequenceUtil.getAbsoluteBounds((IGraphicalEditPart)request.getSourceEditPart());
+ if (request instanceof CreateConnectionViewAndElementRequest) {
+ ConnectionViewAndElementDescriptor desc = ((CreateConnectionViewAndElementRequest) request).getConnectionViewAndElementDescriptor();
+ String replyHint = ((IHintedType) UMLElementTypes.Message_4005).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) {
+ 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())) {
+ 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()));
+ // 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());
+ 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_4004).getSemanticHint().equals(requestHint)) {
+ // update bendpoints for self link message.
+ if (connectionFeedback != null && ((IHintedType) UMLElementTypes.Message_4004).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_4006).getSemanticHint()))) {
- LifelineEditPart target = (LifelineEditPart)request.getTargetEditPart();
+ if (request.getTargetEditPart() instanceof LifelineEditPart && !(request.getSourceEditPart().equals(request.getTargetEditPart()))) {
+ if (requestHint.equals((((IHintedType) UMLElementTypes.Message_4006).getSemanticHint()))) {
+ LifelineEditPart target = (LifelineEditPart) request.getTargetEditPart();
command = LifelineMessageCreateHelper.moveLifelineDown(command, target, sourcePoint.getCopy());
}
}
@@ -356,46 +356,46 @@ public class SequenceGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
* 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) {
+ if (connectionFeedback == null || connectionFeedback.getPoints().size() < 4) {
return;
}
- if(!(command instanceof ICommandProxy)) {
+ if (!(command instanceof ICommandProxy)) {
return;
}
- ICommand iCommand = ((ICommandProxy)command).getICommand();
- if(!(iCommand instanceof CompositeCommand)) {
+ ICommand iCommand = ((ICommandProxy) command).getICommand();
+ if (!(iCommand instanceof CompositeCommand)) {
return;
}
INodeEditPart targetEP = getConnectionCompleteEditPart(request);
- if(targetEP == null) {
+ if (targetEP == null) {
return;
}
LifelineEditPart sourceLifeline = getLifeline(request.getSourceEditPart());
LifelineEditPart targetLifeline = getLifeline(request.getTargetEditPart());
boolean isSelfLink = sourceLifeline != null && sourceLifeline.equals(targetLifeline);
- if(!isSelfLink) {
+ if (!isSelfLink) {
return;
}
- CompositeCommand cc = (CompositeCommand)iCommand;
+ CompositeCommand cc = (CompositeCommand) iCommand;
SetConnectionAnchorsCommand scaCommand = null;
SetConnectionBendpointsCommand sbbCommand = null;
Iterator it = cc.iterator();
- while(it.hasNext()) {
+ while (it.hasNext()) {
Object next = it.next();
- if(next instanceof SetConnectionBendpointsCommand) {
- sbbCommand = (SetConnectionBendpointsCommand)next;
- } else if(next instanceof SetConnectionAnchorsCommand) {
- scaCommand = (SetConnectionAnchorsCommand)next;
+ if (next instanceof SetConnectionBendpointsCommand) {
+ sbbCommand = (SetConnectionBendpointsCommand) next;
+ } else if (next instanceof SetConnectionAnchorsCommand) {
+ scaCommand = (SetConnectionAnchorsCommand) next;
}
- if(sbbCommand != null && scaCommand != null) {
+ if (sbbCommand != null && scaCommand != null) {
break;
}
}
- if(sbbCommand == null || scaCommand == null) {
+ if (sbbCommand == null || scaCommand == null) {
return;
}
ConnectionAnchor targetAnchor = targetEP.getTargetConnectionAnchor(request);
- INodeEditPart sourceEditPart = (INodeEditPart)request.getSourceEditPart();
+ INodeEditPart sourceEditPart = (INodeEditPart) request.getSourceEditPart();
ConnectionAnchor sourceAnchor = sourceEditPart.mapTerminalToConnectionAnchor(scaCommand.getNewSourceTerminal());
PointList pointList = connectionFeedback.getPoints().getCopy();
connectionFeedback.translateToAbsolute(pointList);
@@ -403,11 +403,11 @@ public class SequenceGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
}
private LifelineEditPart getLifeline(EditPart editPart) {
- if(editPart == null) {
+ if (editPart == null) {
return null;
}
- if(editPart instanceof LifelineEditPart) {
- return (LifelineEditPart)editPart;
+ if (editPart instanceof LifelineEditPart) {
+ return (LifelineEditPart) editPart;
}
return getLifeline(editPart.getParent());
}
@@ -417,14 +417,14 @@ public class SequenceGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
*/
@Override
protected Command getReconnectSourceCommand(ReconnectRequest request) {
- if(isUphillMessage(request) && !isLostFoundMessage(request)) {
+ if (isUphillMessage(request) && !isLostFoundMessage(request)) {
return UnexecutableCommand.INSTANCE;
}
// prevent duplicate link
- if(request.getConnectionEditPart() instanceof Message4EditPart && request.getTarget() != null && !LifelineMessageCreateHelper.canReconnectMessageCreate(request)) {
+ if (request.getConnectionEditPart() instanceof Message4EditPart && request.getTarget() != null && !LifelineMessageCreateHelper.canReconnectMessageCreate(request)) {
return UnexecutableCommand.INSTANCE;
}
- //Avoid to reconnect AppliedStereotypesCommentLink to another EditPart.
+ // Avoid to reconnect AppliedStereotypesCommentLink to another EditPart.
ConnectionEditPart connection = request.getConnectionEditPart();
if (connection instanceof AppliedStereotypesCommentLinkEditPart) {
if (connection.getSource() != getConnectableEditPart()) {
@@ -432,8 +432,8 @@ public class SequenceGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
}
}
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()) {
+ // //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;
@@ -441,14 +441,14 @@ public class SequenceGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
private boolean isLostFoundMessage(ReconnectRequest request) {
ConnectionEditPart connectionEditPart = request.getConnectionEditPart();
- if(connectionEditPart instanceof Message7EditPart || connectionEditPart instanceof Message6EditPart) {
+ if (connectionEditPart instanceof Message7EditPart || connectionEditPart instanceof Message6EditPart) {
return true;
}
return false;
}
private boolean isLostFoundMessage(String requestHint) {
- if(((IHintedType)UMLElementTypes.Message_4008).getSemanticHint().equals(requestHint) || ((IHintedType)UMLElementTypes.Message_4009).getSemanticHint().equals(requestHint)) {
+ if (((IHintedType) UMLElementTypes.Message_4008).getSemanticHint().equals(requestHint) || ((IHintedType) UMLElementTypes.Message_4009).getSemanticHint().equals(requestHint)) {
return true;
}
return false;
@@ -459,16 +459,16 @@ public class SequenceGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
*/
@Override
protected Command getReconnectTargetCommand(ReconnectRequest request) {
- if(isUphillMessage(request) && !isLostFoundMessage(request)) {
+ if (isUphillMessage(request) && !isLostFoundMessage(request)) {
return UnexecutableCommand.INSTANCE;
}
// prevent duplicate link
- if(request.getConnectionEditPart() instanceof Message4EditPart && request.getTarget() != null && !LifelineMessageCreateHelper.canReconnectMessageCreate(request)) {
+ if (request.getConnectionEditPart() instanceof Message4EditPart && 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()) {
+ // 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;
@@ -476,27 +476,27 @@ public class SequenceGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
/**
* Check that a message doesn't have its target point above its source point
- *
+ *
* @param request
- * the ReconnectRequest
+ * 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) {
+ 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();
+ 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())) {
+ if (REQ_RECONNECT_SOURCE.equals(request.getType())) {
return request.getLocation().y >= end.y + MARGIN;
- } else if(REQ_RECONNECT_TARGET.equals(request.getType())) {
+ } else if (REQ_RECONNECT_TARGET.equals(request.getType())) {
return start.y >= request.getLocation().y + MARGIN;
} else {
return start.y >= end.y + MARGIN;
@@ -511,7 +511,7 @@ public class SequenceGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
* 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) {
@@ -523,11 +523,11 @@ public class SequenceGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
/**
* 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.
+ * The list of items making up the content of the popup menu.
* @param request
- * The relevant create connection request.
+ * The relevant create connection request.
* @return the command to popup up the menu and create the connection
*/
@Override
@@ -556,9 +556,9 @@ public class SequenceGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
@Override
public String getText(Object object) {
- if(object instanceof IHintedType) {
- IHintedType elementType = (IHintedType)object;
- switch(UMLVisualIDRegistry.getVisualID(elementType.getSemanticHint())) {
+ if (object instanceof IHintedType) {
+ IHintedType elementType = (IHintedType) object;
+ switch (UMLVisualIDRegistry.getVisualID(elementType.getSemanticHint())) {
case MessageEditPart.VISUAL_ID:
return Messages.createMessageSync1CreationTool_title;
case Message2EditPart.VISUAL_ID:
@@ -583,52 +583,52 @@ public class SequenceGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
@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())) {
+ 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_4008)) {
+ if (request instanceof CreateConnectionRequest) {
+ if (host instanceof InteractionEditPart) {
+ if (REQ_CONNECTION_END.equals(request.getType()) && isCreateConnectionRequest(request, UMLElementTypes.Message_4008)) {
return host;
}
- if(REQ_CONNECTION_START.equals(request.getType()) && isCreateConnectionRequest(request, UMLElementTypes.Message_4009)) {
+ if (REQ_CONNECTION_START.equals(request.getType()) && isCreateConnectionRequest(request, UMLElementTypes.Message_4009)) {
return host;
}
- InteractionEditPart interactionPart = (InteractionEditPart)host;
- if(!touchesInteractionBounds(interactionPart, ((CreateConnectionRequest)request).getLocation())) {
+ InteractionEditPart interactionPart = (InteractionEditPart) host;
+ if (!touchesInteractionBounds(interactionPart, ((CreateConnectionRequest) request).getLocation())) {
return null;
}
- } else if(host instanceof InteractionOperandEditPart) {
+ } else if (host instanceof InteractionOperandEditPart) {
return null;
- } else if(host instanceof InteractionFragmentEditPart) {
- CreateConnectionRequest req = (CreateConnectionRequest)request;
+ } 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)) {
+ // 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();
+ } 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()) && 4008 == UMLVisualIDRegistry.getVisualID((View)model)) {
+ if (model instanceof View) {
+ if (REQ_RECONNECT_TARGET.equals(request.getType()) && 4008 == UMLVisualIDRegistry.getVisualID((View) model)) {
return host;
}
- if(REQ_RECONNECT_SOURCE.equals(request.getType()) && 4009 == UMLVisualIDRegistry.getVisualID((View)model)) {
+ if (REQ_RECONNECT_SOURCE.equals(request.getType()) && 4009 == UMLVisualIDRegistry.getVisualID((View) model)) {
return host;
}
}
- InteractionEditPart interactionEditPart = (InteractionEditPart)getHost();
- if(!touchesInteractionBounds(interactionEditPart, ((ReconnectRequest)request).getLocation())) {
+ InteractionEditPart interactionEditPart = (InteractionEditPart) getHost();
+ if (!touchesInteractionBounds(interactionEditPart, ((ReconnectRequest) request).getLocation())) {
return null;
}
- } else if(host instanceof InteractionOperandEditPart) {
+ } 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)) {
+ } 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;
}
}
@@ -642,25 +642,25 @@ public class SequenceGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
Point p = location.getCopy();
IFigure figure = interaction.getFigure();
figure.translateToRelative(p);
- // if mouse location is far from border, do not handle connection event
+ // 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)) {
+ 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)) {
+ 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)) {
+ if (request instanceof CreateConnectionViewRequest) {
+ String requestHint = ((CreateConnectionViewRequest) request).getConnectionViewDescriptor().getSemanticHint();
+ if (((IHintedType) type).getSemanticHint().equals(requestHint)) {
return true;
}
}
@@ -669,7 +669,7 @@ public class SequenceGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
@Override
protected ConnectionRouter getDummyConnectionRouter(CreateConnectionRequest req) {
- if(req.getSourceEditPart() instanceof InteractionEditPart || req.getSourceEditPart() instanceof CombinedFragmentEditPart) {
+ if (req.getSourceEditPart() instanceof InteractionEditPart || req.getSourceEditPart() instanceof CombinedFragmentEditPart) {
return ConnectionRouter.NULL;
}
return super.getDummyConnectionRouter(req);
@@ -678,7 +678,7 @@ public class SequenceGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
/**
* 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 {
@@ -692,14 +692,14 @@ public class SequenceGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
}
public void setViewportLocation(Point p) {
- if(p != null) {
+ if (p != null) {
viewportLocation = p.getCopy();
}
}
public Point adjustToFitNewViewport(Point newViewportLoc) {
Point pt = getCopy();
- if(newViewportLoc != null && viewportLocation != null && !newViewportLoc.equals(viewportLocation)) {
+ if (newViewportLoc != null && viewportLocation != null && !newViewportLoc.equals(viewportLocation)) {
pt.x += (viewportLocation.x - newViewportLoc.x);
pt.y += (viewportLocation.y - newViewportLoc.y);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/TimeRelatedSelectionEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/TimeRelatedSelectionEditPolicy.java
index 049845b9421..aa64b751e00 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/TimeRelatedSelectionEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/TimeRelatedSelectionEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -45,13 +45,13 @@ public class TimeRelatedSelectionEditPolicy extends BorderItemSelectionEditPolic
protected Command getMoveCommand(ChangeBoundsRequest request) {
updateRequest(request);
// Prepare request
- if(getHost() instanceof IBorderItemEditPart) {
- OccurrenceSpecificationMoveHelper.prepareTimeRelatedElementMoveRequest(request, (IBorderItemEditPart)getHost());
+ if (getHost() instanceof IBorderItemEditPart) {
+ OccurrenceSpecificationMoveHelper.prepareTimeRelatedElementMoveRequest(request, (IBorderItemEditPart) getHost());
}
- //In fact, BorderItem can not be moved out of parent bounds, so the moveDelta if not correctly when move out parent.
+ // In fact, BorderItem can not be moved out of parent bounds, so the moveDelta if not correctly when move out parent.
Command command = super.getMoveCommand(request);
- if(command != null) {
- if(invalidMoveDurationConstraint(request.getMoveDelta())) {
+ if (command != null) {
+ if (invalidMoveDurationConstraint(request.getMoveDelta())) {
return UnexecutableCommand.INSTANCE;
}
command = OccurrenceSpecificationMoveHelper.completeMoveTimeRelatedElementCommand(command, request, getHost(), getHostFigure());
@@ -63,64 +63,64 @@ public class TimeRelatedSelectionEditPolicy extends BorderItemSelectionEditPolic
* Bug description:
* When we move down the Duration Constraint which attached to a Execution Specification, the Execution Specification can be moved out it's Parent
* Execution Specification. This would not happen when move Execution Specification directly.
- *
+ *
* At present, we just avoid this kind of moving.
*/
private boolean invalidMoveDurationConstraint(Point moveDelta) {
- if(!(getHost() instanceof DurationConstraintEditPart) || moveDelta == null || moveDelta.y == 0) {
+ if (!(getHost() instanceof DurationConstraintEditPart) || moveDelta == null || moveDelta.y == 0) {
return false;
}
- DurationConstraintEditPart editPart = (DurationConstraintEditPart)getHost();
- DurationConstraint durationConstraint = (DurationConstraint)editPart.resolveSemanticElement();
+ DurationConstraintEditPart editPart = (DurationConstraintEditPart) getHost();
+ DurationConstraint durationConstraint = (DurationConstraint) editPart.resolveSemanticElement();
EList<Element> constrainedElements = durationConstraint.getConstrainedElements();
List<ExecutionSpecification> executions = new ArrayList<ExecutionSpecification>();
- for(Element element : constrainedElements) {
- if(!(element instanceof ExecutionOccurrenceSpecification)) {
+ for (Element element : constrainedElements) {
+ if (!(element instanceof ExecutionOccurrenceSpecification)) {
continue;
}
- ExecutionSpecification execution = ((ExecutionOccurrenceSpecification)element).getExecution();
- if(execution != null && !executions.contains(execution)) {
+ ExecutionSpecification execution = ((ExecutionOccurrenceSpecification) element).getExecution();
+ if (execution != null && !executions.contains(execution)) {
executions.add(execution);
}
}
- if(executions.isEmpty()) {
+ if (executions.isEmpty()) {
return false;
}
- // LifelineEditPart lifelineEditPart = (LifelineEditPart)getHost().getParent();
- // for(ExecutionSpecification executionSpecification : executions) {
- // Collection<Setting> settings = CacheAdapter.getInstance().getNonNavigableInverseReferences(executionSpecification);
- // for(Setting ref : settings) {
- // if(NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
- // View view = (View)ref.getEObject();
- // EditPart part = DiagramEditPartsUtil.getEditPartFromView(view, getHost());
- // if(!(part instanceof ShapeNodeEditPart)) {
- // continue;
- // }
- // Rectangle childBounds = ((ShapeNodeEditPart)part).getFigure().getBounds().getCopy();
- // List<ShapeNodeEditPart> toCheckExecutionSpecificationList = new ArrayList<ShapeNodeEditPart>(lifelineEditPart.getChildShapeNodeEditPart());
- // toCheckExecutionSpecificationList.remove(part);
- // ShapeNodeEditPart parent = LifelineXYLayoutEditPolicy.getParent(lifelineEditPart, childBounds, toCheckExecutionSpecificationList);
- // if(parent != null) {
- // Rectangle parentBounds = parent.getFigure().getBounds().getCopy();
- // if(childBounds.y + moveDelta.y >= parentBounds.bottom() - 1) {
- // return true;
- // }
- // }
- // }
- // }
- // }
+ // LifelineEditPart lifelineEditPart = (LifelineEditPart)getHost().getParent();
+ // for(ExecutionSpecification executionSpecification : executions) {
+ // Collection<Setting> settings = CacheAdapter.getInstance().getNonNavigableInverseReferences(executionSpecification);
+ // for(Setting ref : settings) {
+ // if(NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
+ // View view = (View)ref.getEObject();
+ // EditPart part = DiagramEditPartsUtil.getEditPartFromView(view, getHost());
+ // if(!(part instanceof ShapeNodeEditPart)) {
+ // continue;
+ // }
+ // Rectangle childBounds = ((ShapeNodeEditPart)part).getFigure().getBounds().getCopy();
+ // List<ShapeNodeEditPart> toCheckExecutionSpecificationList = new ArrayList<ShapeNodeEditPart>(lifelineEditPart.getChildShapeNodeEditPart());
+ // toCheckExecutionSpecificationList.remove(part);
+ // ShapeNodeEditPart parent = LifelineXYLayoutEditPolicy.getParent(lifelineEditPart, childBounds, toCheckExecutionSpecificationList);
+ // if(parent != null) {
+ // Rectangle parentBounds = parent.getFigure().getBounds().getCopy();
+ // if(childBounds.y + moveDelta.y >= parentBounds.bottom() - 1) {
+ // return true;
+ // }
+ // }
+ // }
+ // }
+ // }
return true;
}
/**
* By default, the IBorderItemEditPart can not be moved out of the parent.
- *
+ *
* @param request
*/
private void updateRequest(ChangeBoundsRequest request) {
- IBorderItemEditPart borderItemEP = (IBorderItemEditPart)getHost();
+ IBorderItemEditPart borderItemEP = (IBorderItemEditPart) getHost();
IBorderItemLocator borderItemLocator = borderItemEP.getBorderItemLocator();
- if(borderItemLocator != null) {
+ if (borderItemLocator != null) {
Rectangle initialFeedbackBounds = getInitialFeedbackBounds();
PrecisionRectangle rect = new PrecisionRectangle(initialFeedbackBounds.getCopy());
getHostFigure().translateToAbsolute(rect);
@@ -131,8 +131,8 @@ public class TimeRelatedSelectionEditPolicy extends BorderItemSelectionEditPolic
Point parentOrigin = borderItemEP.getFigure().getParent().getBounds().getTopLeft();
Dimension d = realLocation.getTopLeft().getDifference(parentOrigin);
Point newLocation = new Point(d.width, d.height);
- if(getHost().getModel() instanceof Node && ((Node)getHost().getModel()).getLayoutConstraint() instanceof Bounds) {
- Bounds bounds = (Bounds)((Node)getHost().getModel()).getLayoutConstraint();
+ if (getHost().getModel() instanceof Node && ((Node) getHost().getModel()).getLayoutConstraint() instanceof Bounds) {
+ Bounds bounds = (Bounds) ((Node) getHost().getModel()).getLayoutConstraint();
Point moveDelta = request.getMoveDelta();
moveDelta.x = newLocation.x - bounds.getX();
moveDelta.y = newLocation.y - bounds.getY();
@@ -142,8 +142,8 @@ public class TimeRelatedSelectionEditPolicy extends BorderItemSelectionEditPolic
@Override
protected void showChangeBoundsFeedback(ChangeBoundsRequest request) {
- if(getHost() instanceof IBorderItemEditPart) {
- OccurrenceSpecificationMoveHelper.prepareTimeRelatedElementMoveRequest(request, (IBorderItemEditPart)getHost());
+ if (getHost() instanceof IBorderItemEditPart) {
+ OccurrenceSpecificationMoveHelper.prepareTimeRelatedElementMoveRequest(request, (IBorderItemEditPart) getHost());
}
super.showChangeBoundsFeedback(request);
}
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
index 429075474d8..fdd32dfc950 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -79,17 +79,17 @@ public class CustomActionExecutionSpecificationItemSemanticEditPolicy extends Ac
CompoundCommand deleteElementsCommand = new CompoundCommand();
EObject selectedEObject = req.getElementToDestroy();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
+ if (provider != null) {
// Retrieve delete command from the Element Edit service
ICommand deleteCommand = provider.getEditCommand(req);
- if(deleteCommand != null) {
+ if (deleteCommand != null) {
deleteElementsCommand.add(new ICommandProxy(deleteCommand));
- if(selectedEObject instanceof ExecutionSpecification && getHost() instanceof ShapeNodeEditPart) {
- SequenceDeleteHelper.destroyExecutionOccurrenceSpecification(req, deleteElementsCommand, (ShapeNodeEditPart)getHost(), (ExecutionSpecification)selectedEObject);
+ if (selectedEObject instanceof ExecutionSpecification && getHost() instanceof ShapeNodeEditPart) {
+ SequenceDeleteHelper.destroyExecutionOccurrenceSpecification(req, deleteElementsCommand, (ShapeNodeEditPart) getHost(), (ExecutionSpecification) selectedEObject);
}
}
}
- if(deleteElementsCommand.size() > 0) {
+ if (deleteElementsCommand.size() > 0) {
return deleteElementsCommand;
}
return UnexecutableCommand.INSTANCE;
@@ -97,17 +97,17 @@ public class CustomActionExecutionSpecificationItemSemanticEditPolicy extends Ac
/**
* 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()));
+ 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) {
+ ExecutionSpecificationComponentEditPolicy.addDeleteViewChildrenCommand(deleteViewsCommand, getEditingDomain(), (ShapeNodeEditPart) getHost());
+ if (mainCommand == null) {
return deleteViewsCommand;
} else {
return mainCommand.chain(deleteViewsCommand);
@@ -129,35 +129,35 @@ public class CustomActionExecutionSpecificationItemSemanticEditPolicy extends Ac
*/
@Override
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return null;
}
- //add general ordering
- if(UMLElementTypes.GeneralOrdering_4012 == req.getElementType()) {
+ // add general ordering
+ if (UMLElementTypes.GeneralOrdering_4012 == req.getElementType()) {
return getGEFWrapper(new CustomGeneralOrderingCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -169,35 +169,35 @@ public class CustomActionExecutionSpecificationItemSemanticEditPolicy extends Ac
*/
@Override
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- //add general ordering
- if(UMLElementTypes.GeneralOrdering_4012 == req.getElementType()) {
+ // add general ordering
+ if (UMLElementTypes.GeneralOrdering_4012 == req.getElementType()) {
return getGEFWrapper(new CustomGeneralOrderingCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -206,13 +206,13 @@ public class CustomActionExecutionSpecificationItemSemanticEditPolicy extends Ac
/**
* 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)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -227,9 +227,9 @@ public class CustomActionExecutionSpecificationItemSemanticEditPolicy extends Ac
return getGEFWrapper(new CustomMessage6ReorientCommand(req));
case Message7EditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- //add general ordering
+ // add general ordering
case GeneralOrderingEditPart.VISUAL_ID:
- if(req.getNewRelationshipEnd() instanceof OccurrenceSpecification) {
+ if (req.getNewRelationshipEnd() instanceof OccurrenceSpecification) {
return getGEFWrapper(new GeneralOrderingReorientCommand(req));
} else {
return null;
@@ -241,12 +241,12 @@ public class CustomActionExecutionSpecificationItemSemanticEditPolicy extends Ac
/**
* 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)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
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
index 97c4e37b94b..dfa970ef325 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -79,17 +79,17 @@ public class CustomBehaviorExecutionSpecificationItemSemanticEditPolicy extends
CompoundCommand deleteElementsCommand = new CompoundCommand();
EObject selectedEObject = req.getElementToDestroy();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
+ if (provider != null) {
// Retrieve delete command from the Element Edit service
ICommand deleteCommand = provider.getEditCommand(req);
- if(deleteCommand != null) {
+ if (deleteCommand != null) {
deleteElementsCommand.add(new ICommandProxy(deleteCommand));
- if(selectedEObject instanceof ExecutionSpecification && getHost() instanceof ShapeNodeEditPart) {
- SequenceDeleteHelper.destroyExecutionOccurrenceSpecification(req, deleteElementsCommand, (ShapeNodeEditPart)getHost(), (ExecutionSpecification)selectedEObject);
+ if (selectedEObject instanceof ExecutionSpecification && getHost() instanceof ShapeNodeEditPart) {
+ SequenceDeleteHelper.destroyExecutionOccurrenceSpecification(req, deleteElementsCommand, (ShapeNodeEditPart) getHost(), (ExecutionSpecification) selectedEObject);
}
}
}
- if(deleteElementsCommand.size() > 0) {
+ if (deleteElementsCommand.size() > 0) {
return deleteElementsCommand;
}
return UnexecutableCommand.INSTANCE;
@@ -97,17 +97,17 @@ public class CustomBehaviorExecutionSpecificationItemSemanticEditPolicy extends
/**
* 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()));
+ 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) {
+ ExecutionSpecificationComponentEditPolicy.addDeleteViewChildrenCommand(deleteViewsCommand, getEditingDomain(), (ShapeNodeEditPart) getHost());
+ if (mainCommand == null) {
return deleteViewsCommand;
} else {
return mainCommand.chain(deleteViewsCommand);
@@ -129,35 +129,35 @@ public class CustomBehaviorExecutionSpecificationItemSemanticEditPolicy extends
*/
@Override
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return null;
}
- //add general ordering
- if(UMLElementTypes.GeneralOrdering_4012 == req.getElementType()) {
+ // add general ordering
+ if (UMLElementTypes.GeneralOrdering_4012 == req.getElementType()) {
return getGEFWrapper(new CustomGeneralOrderingCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -169,35 +169,35 @@ public class CustomBehaviorExecutionSpecificationItemSemanticEditPolicy extends
*/
@Override
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- //add general ordering
- if(UMLElementTypes.GeneralOrdering_4012 == req.getElementType()) {
+ // add general ordering
+ if (UMLElementTypes.GeneralOrdering_4012 == req.getElementType()) {
return getGEFWrapper(new CustomGeneralOrderingCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -206,13 +206,13 @@ public class CustomBehaviorExecutionSpecificationItemSemanticEditPolicy extends
/**
* 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)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -227,9 +227,9 @@ public class CustomBehaviorExecutionSpecificationItemSemanticEditPolicy extends
return getGEFWrapper(new CustomMessage6ReorientCommand(req));
case Message7EditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- //add general ordering
+ // add general ordering
case GeneralOrderingEditPart.VISUAL_ID:
- if(req.getNewRelationshipEnd() instanceof OccurrenceSpecification) {
+ if (req.getNewRelationshipEnd() instanceof OccurrenceSpecification) {
return getGEFWrapper(new GeneralOrderingReorientCommand(req));
} else {
return null;
@@ -241,12 +241,12 @@ public class CustomBehaviorExecutionSpecificationItemSemanticEditPolicy extends
/**
* 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)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
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
index afd480e7134..84c5a747fbf 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -70,10 +70,10 @@ public class CustomCombinedFragment2ItemSemanticEditPolicy extends CombinedFragm
protected Command getDestroyElementCommand(DestroyElementRequest req) {
EObject selectedEObject = req.getElementToDestroy();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
+ if (provider != null) {
// Retrieve delete command from the Element Edit service
ICommand deleteCommand = provider.getEditCommand(req);
- if(deleteCommand != null) {
+ if (deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
}
@@ -95,35 +95,35 @@ public class CustomCombinedFragment2ItemSemanticEditPolicy extends CombinedFragm
*/
@Override
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return null;
}
- //add general ordering
- if(UMLElementTypes.GeneralOrdering_4012 == req.getElementType()) {
+ // add general ordering
+ if (UMLElementTypes.GeneralOrdering_4012 == req.getElementType()) {
return getGEFWrapper(new CustomGeneralOrderingCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -135,35 +135,35 @@ public class CustomCombinedFragment2ItemSemanticEditPolicy extends CombinedFragm
*/
@Override
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- //add general ordering
- if(UMLElementTypes.GeneralOrdering_4012 == req.getElementType()) {
+ // add general ordering
+ if (UMLElementTypes.GeneralOrdering_4012 == req.getElementType()) {
return getGEFWrapper(new CustomGeneralOrderingCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -172,13 +172,13 @@ public class CustomCombinedFragment2ItemSemanticEditPolicy extends CombinedFragm
/**
* 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)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -193,9 +193,9 @@ public class CustomCombinedFragment2ItemSemanticEditPolicy extends CombinedFragm
return getGEFWrapper(new CustomMessage6ReorientCommand(req));
case Message7EditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- //add general ordering
+ // add general ordering
case GeneralOrderingEditPart.VISUAL_ID:
- if(req.getNewRelationshipEnd() instanceof OccurrenceSpecification) {
+ if (req.getNewRelationshipEnd() instanceof OccurrenceSpecification) {
return getGEFWrapper(new GeneralOrderingReorientCommand(req));
} else {
return null;
@@ -207,12 +207,12 @@ public class CustomCombinedFragment2ItemSemanticEditPolicy extends CombinedFragm
/**
* 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)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
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
index 3a746d5d6ce..24aa6b33b6a 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -34,21 +34,24 @@ public class CustomCombinedFragmentCombinedFragmentCompartmentItemSemanticEditPo
/**
* Generated not for limit InteractionOperand number. {@inheritDoc}
- *
+ *
* @Override
*/
@Override
protected Command getCreateCommand(CreateElementRequest req) {
- if(UMLElementTypes.InteractionOperand_3005 == req.getElementType()) {
+ if (UMLElementTypes.InteractionOperand_3005 == req.getElementType()) {
CombinedFragment combinedFragment = getAssociatedCombinedFragment(req.getContainer());
- if(combinedFragment == null) {
+ 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))) {
+ 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
@@ -57,22 +60,22 @@ public class CustomCombinedFragmentCombinedFragmentCompartmentItemSemanticEditPo
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() {
+ // 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 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);
- // }
+ // @Override
+ // public void undo() {
+ // execute();
+ // }
+ // };
+ // if(notifyCmd.canExecute()) {
+ // result.add(notifyCmd);
+ // }
return result;
}
return super.getCreateCommand(req);
@@ -83,9 +86,9 @@ public class CustomCombinedFragmentCombinedFragmentCompartmentItemSemanticEditPo
*/
private CombinedFragment getAssociatedCombinedFragment(EObject eObject) {
CombinedFragment combinedFragment = null;
- if(eObject instanceof CombinedFragment) {
- return (CombinedFragment)eObject;
- } else if(eObject != 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
index 96b1eb3ecfc..c372e334d45 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -69,12 +69,12 @@ public class CustomCombinedFragmentItemSemanticEditPolicy extends CombinedFragme
protected Command getDestroyElementCommand(DestroyElementRequest req) {
EObject selectedEObject = req.getElementToDestroy();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
+ 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());
+ 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);
@@ -99,31 +99,31 @@ public class CustomCombinedFragmentItemSemanticEditPolicy extends CombinedFragme
*/
@Override
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return null;
}
return null;
@@ -134,31 +134,31 @@ public class CustomCombinedFragmentItemSemanticEditPolicy extends CombinedFragme
*/
@Override
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -167,12 +167,12 @@ public class CustomCombinedFragmentItemSemanticEditPolicy extends CombinedFragme
/**
* 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)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -194,12 +194,12 @@ public class CustomCombinedFragmentItemSemanticEditPolicy extends CombinedFragme
/**
* 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)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
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
index 1e112a963d0..78371180289 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -34,14 +34,14 @@ public class CustomCommentAnnotatedElementItemSemanticEditPolicy extends Comment
*/
@Override
protected Command getDestroyReferenceCommand(final DestroyReferenceRequest req) {
- if(req.getReferencedObject() instanceof MessageEnd) {
+ 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());
+ if (res.getStatus().isOK()) {
+ MessageEndHelper.removeConnectionSourceFromMessageEnd((MessageEnd) req.getReferencedObject(), req.getContainer());
}
return res;
}
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
index 2a8e47e3acc..14d6b1d3dc1 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -67,17 +67,17 @@ public class CustomCommentItemSemanticEditPolicy extends CommentItemSemanticEdit
*/
@Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View)getHost().getModel();
+ 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) {
+ 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 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));
@@ -99,31 +99,31 @@ public class CustomCommentItemSemanticEditPolicy extends CommentItemSemanticEdit
*/
@Override
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return null;
}
return null;
@@ -134,31 +134,31 @@ public class CustomCommentItemSemanticEditPolicy extends CommentItemSemanticEdit
*/
@Override
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -167,12 +167,12 @@ public class CustomCommentItemSemanticEditPolicy extends CommentItemSemanticEdit
/**
* 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)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -194,12 +194,12 @@ public class CustomCommentItemSemanticEditPolicy extends CommentItemSemanticEdit
/**
* 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)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
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
index 9615cd59839..c965bbdb970 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -69,12 +69,12 @@ public class CustomConsiderIgnoreFragmentItemSemanticEditPolicy extends Consider
protected Command getDestroyElementCommand(DestroyElementRequest req) {
EObject selectedEObject = req.getElementToDestroy();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
+ 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());
+ 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);
@@ -98,31 +98,31 @@ public class CustomConsiderIgnoreFragmentItemSemanticEditPolicy extends Consider
*/
@Override
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return null;
}
return null;
@@ -133,31 +133,31 @@ public class CustomConsiderIgnoreFragmentItemSemanticEditPolicy extends Consider
*/
@Override
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -166,12 +166,12 @@ public class CustomConsiderIgnoreFragmentItemSemanticEditPolicy extends Consider
/**
* 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)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -193,12 +193,12 @@ public class CustomConsiderIgnoreFragmentItemSemanticEditPolicy extends Consider
/**
* 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)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
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
index 4b820425009..2e93d6bc877 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -34,14 +34,14 @@ public class CustomConstraintConstrainedElementItemSemanticEditPolicy extends Co
*/
@Override
protected Command getDestroyReferenceCommand(final DestroyReferenceRequest req) {
- if(req.getReferencedObject() instanceof MessageEnd) {
+ 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());
+ if (res.getStatus().isOK()) {
+ MessageEndHelper.removeConnectionSourceFromMessageEnd((MessageEnd) req.getReferencedObject(), req.getContainer());
}
return res;
}
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
index dc48f8bcc36..cc911683fb5 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -68,17 +68,17 @@ public class CustomConstraintItemSemanticEditPolicy extends ConstraintItemSemant
*/
@Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View)getHost().getModel();
+ 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) {
+ 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 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));
@@ -100,34 +100,34 @@ public class CustomConstraintItemSemanticEditPolicy extends ConstraintItemSemant
*/
@Override
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintContext_8500 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintContext_8500 == req.getElementType()) {
return getGEFWrapper(new CustomContextLinkCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -138,34 +138,34 @@ public class CustomConstraintItemSemanticEditPolicy extends ConstraintItemSemant
*/
@Override
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintContext_8500 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintContext_8500 == req.getElementType()) {
return getGEFWrapper(new CustomContextLinkCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -174,12 +174,12 @@ public class CustomConstraintItemSemanticEditPolicy extends ConstraintItemSemant
/**
* 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)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -201,12 +201,12 @@ public class CustomConstraintItemSemanticEditPolicy extends ConstraintItemSemant
/**
* 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)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
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
index cca79515b83..792c17cf3a4 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -67,17 +67,17 @@ public class CustomContinuationItemSemanticEditPolicy extends ContinuationItemSe
*/
@Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View)getHost().getModel();
+ 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) {
+ 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 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));
@@ -99,31 +99,31 @@ public class CustomContinuationItemSemanticEditPolicy extends ContinuationItemSe
*/
@Override
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return null;
}
return null;
@@ -134,31 +134,31 @@ public class CustomContinuationItemSemanticEditPolicy extends ContinuationItemSe
*/
@Override
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -167,12 +167,12 @@ public class CustomContinuationItemSemanticEditPolicy extends ContinuationItemSe
/**
* 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)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -194,12 +194,12 @@ public class CustomContinuationItemSemanticEditPolicy extends ContinuationItemSe
/**
* 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)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
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
index ea93ed9fc54..c85c4ce095a 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -74,10 +74,10 @@ public class CustomDestructionOccurrenceSpecificationItemSemanticEditPolicy exte
protected Command getDestroyElementCommand(DestroyElementRequest req) {
EObject selectedEObject = req.getElementToDestroy();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
+ if (provider != null) {
// Retrieve delete command from the Element Edit service
ICommand deleteCommand = provider.getEditCommand(req);
- if(deleteCommand != null) {
+ if (deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
}
@@ -98,34 +98,34 @@ public class CustomDestructionOccurrenceSpecificationItemSemanticEditPolicy exte
*/
@Override
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return null;
}
- if(UMLElementTypes.GeneralOrdering_4012 == req.getElementType()) {
+ if (UMLElementTypes.GeneralOrdering_4012 == req.getElementType()) {
return getGEFWrapper(new CustomGeneralOrderingCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -136,34 +136,34 @@ public class CustomDestructionOccurrenceSpecificationItemSemanticEditPolicy exte
*/
@Override
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.GeneralOrdering_4012 == req.getElementType()) {
+ if (UMLElementTypes.GeneralOrdering_4012 == req.getElementType()) {
return getGEFWrapper(new CustomGeneralOrderingCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -172,12 +172,12 @@ public class CustomDestructionOccurrenceSpecificationItemSemanticEditPolicy exte
/**
* 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)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -201,12 +201,12 @@ public class CustomDestructionOccurrenceSpecificationItemSemanticEditPolicy exte
/**
* 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)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
@@ -217,16 +217,16 @@ public class CustomDestructionOccurrenceSpecificationItemSemanticEditPolicy exte
/**
* 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()));
+ Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View) getHost().getModel()));
deleteViewsCommand.add(deleteViewCommand);
SequenceDeleteHelper.completeDeleteDestructionOccurenceViewCommand(deleteViewsCommand, getEditingDomain(), getHost());
- if(mainCommand == null) {
+ 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
index 4a0981cf8c9..a5c418a6e87 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -67,17 +67,17 @@ public class CustomDurationConstraintInMessageItemSemanticEditPolicy extends Dur
*/
@Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View)getHost().getModel();
+ 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) {
+ 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 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));
@@ -99,31 +99,31 @@ public class CustomDurationConstraintInMessageItemSemanticEditPolicy extends Dur
*/
@Override
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -134,31 +134,31 @@ public class CustomDurationConstraintInMessageItemSemanticEditPolicy extends Dur
*/
@Override
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -167,12 +167,12 @@ public class CustomDurationConstraintInMessageItemSemanticEditPolicy extends Dur
/**
* 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)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -194,12 +194,12 @@ public class CustomDurationConstraintInMessageItemSemanticEditPolicy extends Dur
/**
* 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)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
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
index 066dbbfd9ba..e1d9073ba24 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -67,17 +67,17 @@ public class CustomDurationConstraintItemSemanticEditPolicy extends DurationCons
*/
@Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View)getHost().getModel();
+ 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) {
+ 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 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));
@@ -99,31 +99,31 @@ public class CustomDurationConstraintItemSemanticEditPolicy extends DurationCons
*/
@Override
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -134,31 +134,31 @@ public class CustomDurationConstraintItemSemanticEditPolicy extends DurationCons
*/
@Override
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -167,12 +167,12 @@ public class CustomDurationConstraintItemSemanticEditPolicy extends DurationCons
/**
* 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)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -194,12 +194,12 @@ public class CustomDurationConstraintItemSemanticEditPolicy extends DurationCons
/**
* 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)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
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
index e649a829ba9..a9329a3c753 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -67,17 +67,17 @@ public class CustomDurationObservationItemSemanticEditPolicy extends DurationObs
*/
@Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View)getHost().getModel();
+ 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) {
+ 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 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));
@@ -99,31 +99,31 @@ public class CustomDurationObservationItemSemanticEditPolicy extends DurationObs
*/
@Override
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return null;
}
return null;
@@ -134,31 +134,31 @@ public class CustomDurationObservationItemSemanticEditPolicy extends DurationObs
*/
@Override
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -167,12 +167,12 @@ public class CustomDurationObservationItemSemanticEditPolicy extends DurationObs
/**
* 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)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -194,12 +194,12 @@ public class CustomDurationObservationItemSemanticEditPolicy extends DurationObs
/**
* 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)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
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
index 4a734be076d..b51f5067697 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -69,10 +69,10 @@ public class CustomGeneralOrderingItemSemanticEditPolicy extends GeneralOrdering
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 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));
+ // return getGEFWrapper(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
}
/**
@@ -89,31 +89,31 @@ public class CustomGeneralOrderingItemSemanticEditPolicy extends GeneralOrdering
*/
@Override
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return null;
}
return null;
@@ -124,31 +124,31 @@ public class CustomGeneralOrderingItemSemanticEditPolicy extends GeneralOrdering
*/
@Override
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -157,12 +157,12 @@ public class CustomGeneralOrderingItemSemanticEditPolicy extends GeneralOrdering
/**
* 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)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -184,12 +184,12 @@ public class CustomGeneralOrderingItemSemanticEditPolicy extends GeneralOrdering
/**
* 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)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
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
index c9eadaca395..8a041630ad6 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -23,8 +23,9 @@ import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
*/
public class CustomInteractionContextLinkSemanticEditPolicy extends CustomInteractionItemSemanticEditPolicy {
+ @Override
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.ConstraintContext_8500 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintContext_8500 == 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
index a8f4ecab65d..2a84b53f63c 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -38,31 +38,31 @@ public class CustomInteractionInteractionCompartmentItemSemanticEditPolicy exten
*/
@Override
protected Command getCreateCommand(CreateElementRequest req) {
- if(UMLElementTypes.ConsiderIgnoreFragment_3007 == req.getElementType()) {
+ if (UMLElementTypes.ConsiderIgnoreFragment_3007 == req.getElementType()) {
return getGEFWrapper(new CustomConsiderIgnoreFragmentCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.CombinedFragment_3004 == req.getElementType()) {
+ if (UMLElementTypes.CombinedFragment_3004 == req.getElementType()) {
return getGEFWrapper(new CustomCombinedFragmentCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.Lifeline_3001 == req.getElementType()) {
+ if (UMLElementTypes.Lifeline_3001 == req.getElementType()) {
return getGEFWrapper(new CustomLifelineCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.InteractionUse_3002 == req.getElementType()) {
+ if (UMLElementTypes.InteractionUse_3002 == req.getElementType()) {
return getGEFWrapper(new CustomInteractionUseCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.Constraint_3008 == req.getElementType()) {
+ if (UMLElementTypes.Constraint_3008 == req.getElementType()) {
return getGEFWrapper(new CustomConstraintCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.Comment_3009 == req.getElementType()) {
+ if (UMLElementTypes.Comment_3009 == req.getElementType()) {
return getGEFWrapper(new CommentCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.TimeObservation_3020 == req.getElementType()) {
+ if (UMLElementTypes.TimeObservation_3020 == req.getElementType()) {
return getGEFWrapper(new CustomTimeObservationCreateCommand(req));
}
- if(UMLElementTypes.DurationObservation_3024 == req.getElementType()) {
+ if (UMLElementTypes.DurationObservation_3024 == req.getElementType()) {
return getGEFWrapper(new CustomDurationObservationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.DurationConstraint_3021 == req.getElementType()) {
+ if (UMLElementTypes.DurationConstraint_3021 == 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
index ed33cec95e7..0b0dad35aa2 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -68,10 +68,10 @@ public class CustomInteractionItemSemanticEditPolicy extends InteractionItemSema
*/
@Override
protected Command getCreateCommand(CreateElementRequest req) {
- if(UMLElementTypes.DurationConstraint_3023 == req.getElementType()) {
+ if (UMLElementTypes.DurationConstraint_3023 == req.getElementType()) {
return getGEFWrapper(new CustomDurationConstraintInMessageCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.DurationObservation_3024 == req.getElementType()) {
+ if (UMLElementTypes.DurationObservation_3024 == req.getElementType()) {
return getGEFWrapper(new CustomDurationObservationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
return super.getCreateCommand(req);
@@ -84,10 +84,10 @@ public class CustomInteractionItemSemanticEditPolicy extends InteractionItemSema
protected Command getDestroyElementCommand(DestroyElementRequest req) {
EObject selectedEObject = req.getElementToDestroy();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
+ if (provider != null) {
// Retrieve delete command from the Element Edit service
ICommand deleteCommand = provider.getEditCommand(req);
- if(deleteCommand != null) {
+ if (deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
}
@@ -108,31 +108,31 @@ public class CustomInteractionItemSemanticEditPolicy extends InteractionItemSema
*/
@Override
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return null;
}
return null;
@@ -143,31 +143,31 @@ public class CustomInteractionItemSemanticEditPolicy extends InteractionItemSema
*/
@Override
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -176,12 +176,12 @@ public class CustomInteractionItemSemanticEditPolicy extends InteractionItemSema
/**
* 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)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -203,12 +203,12 @@ public class CustomInteractionItemSemanticEditPolicy extends InteractionItemSema
/**
* 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)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
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
index cdb0beb5df5..eca7a18249f 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -16,7 +16,6 @@ package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
import java.util.List;
import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PositionConstants;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.ConnectionEditPart;
@@ -29,24 +28,20 @@ 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.helpers.AnchorHelper;
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.CustomLifelineEditPart;
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.edit.parts.MessageEditPart;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CustomLifelineEditPart.CustomLifelineFigure;
import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
-import org.hamcrest.core.IsInstanceOf;
/**
* 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.ConstraintContext_8500 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintContext_8500 == req.getElementType()) {
return getGEFWrapper(new CustomContextLinkCreateCommand(req, req.getSource(), req.getTarget()));
}
return super.getCompleteCreateRelationshipCommand(req);
@@ -54,26 +49,26 @@ public class CustomInteractionOperandContextLinkSemanticEditPolicy extends Custo
@Override
public EditPart getTargetEditPart(Request request) {
- if(request instanceof CreateUnspecifiedTypeConnectionRequest) {
- CreateUnspecifiedTypeConnectionRequest createRequest = (CreateUnspecifiedTypeConnectionRequest)request;
+ if (request instanceof CreateUnspecifiedTypeConnectionRequest) {
+ CreateUnspecifiedTypeConnectionRequest createRequest = (CreateUnspecifiedTypeConnectionRequest) request;
List<?> relationshipTypes = createRequest.getElementTypes();
- for(Object obj : relationshipTypes) {
- if(UMLElementTypes.ConstraintContext_8500.equals(obj)) {
- Point location = ((DropRequest)request).getLocation();
+ for (Object obj : relationshipTypes) {
+ if (UMLElementTypes.ConstraintContext_8500.equals(obj)) {
+ Point location = ((DropRequest) request).getLocation();
EditPart host = getHost();
- if(isEnterAnchorArea(host, location)) {
+ if (isEnterAnchorArea(host, location)) {
return host;
}
}
}
}
- if(request instanceof ReconnectRequest) {
- ReconnectRequest reconnectRequest = (ReconnectRequest)request;
+ if (request instanceof ReconnectRequest) {
+ ReconnectRequest reconnectRequest = (ReconnectRequest) request;
ConnectionEditPart connectionEditPart = reconnectRequest.getConnectionEditPart();
- if(connectionEditPart instanceof ContextLinkEditPart) {
- Point location = ((DropRequest)request).getLocation();
+ if (connectionEditPart instanceof ContextLinkEditPart) {
+ Point location = ((DropRequest) request).getLocation();
EditPart host = getHost();
- if(isEnterAnchorArea(host, location)) {
+ if (isEnterAnchorArea(host, location)) {
return host;
}
}
@@ -83,12 +78,12 @@ public class CustomInteractionOperandContextLinkSemanticEditPolicy extends Custo
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();
+ 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
+ // if mouse location is far from border, do not handle connection event
Rectangle innerRetangle = figure.getBounds().getCopy().shrink(10, 10);
- if(innerRetangle.contains(p)) {
+ if (innerRetangle.contains(p)) {
return false;
}
}
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
index 45f52fbda6c..58771fab912 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -13,14 +13,12 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
-import org.eclipse.draw2d.geometry.Point;
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.DropRequest;
import org.eclipse.gef.requests.ReconnectRequest;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.common.core.command.ICompositeCommand;
@@ -80,16 +78,16 @@ public class CustomInteractionOperandItemSemanticEditPolicy extends InteractionO
*/
@Override
protected Command getCreateCommand(CreateElementRequest req) {
- if(UMLElementTypes.InteractionUse_3002 == req.getElementType()) {
+ if (UMLElementTypes.InteractionUse_3002 == req.getElementType()) {
return getGEFWrapper(new CustomInteractionUseCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.ConsiderIgnoreFragment_3007 == req.getElementType()) {
+ if (UMLElementTypes.ConsiderIgnoreFragment_3007 == req.getElementType()) {
return getGEFWrapper(new CustomConsiderIgnoreFragmentCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.CombinedFragment_3004 == req.getElementType()) {
+ if (UMLElementTypes.CombinedFragment_3004 == req.getElementType()) {
return getGEFWrapper(new CustomCombinedFragmentCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.Continuation_3016 == req.getElementType()) {
+ if (UMLElementTypes.Continuation_3016 == req.getElementType()) {
return getGEFWrapper(new CustomContinuationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
return super.getCreateCommand(req);
@@ -100,16 +98,16 @@ public class CustomInteractionOperandItemSemanticEditPolicy extends InteractionO
*/
@Override
public Command getCommand(Request request) {
- if(request instanceof ReconnectRequest) {
- ReconnectRequest reconnectRequest = (ReconnectRequest)request;
+ if (request instanceof ReconnectRequest) {
+ ReconnectRequest reconnectRequest = (ReconnectRequest) request;
ConnectionEditPart connectionEditPart = reconnectRequest.getConnectionEditPart();
- if(connectionEditPart instanceof ContextLinkEditPart) {
+ if (connectionEditPart instanceof ContextLinkEditPart) {
return super.getCommand(request);
}
}
- if(request instanceof ReconnectRequest) {
+ if (request instanceof ReconnectRequest) {
EditPart combinedFragment = getHost().getParent().getParent();
- ((ReconnectRequest)request).setTargetEditPart(combinedFragment);
+ ((ReconnectRequest) request).setTargetEditPart(combinedFragment);
return combinedFragment.getCommand(request);
}
return super.getCommand(request);
@@ -122,12 +120,12 @@ public class CustomInteractionOperandItemSemanticEditPolicy extends InteractionO
protected Command getDestroyElementCommand(DestroyElementRequest req) {
EObject selectedEObject = req.getElementToDestroy();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
+ 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);
+ if (deleteCommand != null) {
+ if (deleteCommand instanceof ICompositeCommand) {
+ OperandBoundsComputeHelper.addUpdateBoundsCommandForOperandDelelete(this.getHost(), (ICompositeCommand) deleteCommand);
}
return new ICommandProxy(deleteCommand);
}
@@ -149,73 +147,73 @@ public class CustomInteractionOperandItemSemanticEditPolicy extends InteractionO
*/
@Override
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
// redirect message creation to CF
EditPart combinedFragmentPart = getHost().getParent().getParent();
- EObject combinedFragment = ((IGraphicalEditPart)combinedFragmentPart).resolveSemanticElement();
- if(((IGraphicalEditPart)getHost()).resolveSemanticElement().equals(req.getSource())) {
+ 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()));
+ return null;// return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
// redirect message creation to CF
EditPart combinedFragmentPart = getHost().getParent().getParent();
- EObject combinedFragment = ((IGraphicalEditPart)combinedFragmentPart).resolveSemanticElement();
- if(((IGraphicalEditPart)getHost()).resolveSemanticElement().equals(req.getSource())) {
+ 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()));
+ return null;// return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
// redirect message creation to CF
EditPart combinedFragmentPart = getHost().getParent().getParent();
- EObject combinedFragment = ((IGraphicalEditPart)combinedFragmentPart).resolveSemanticElement();
- if(((IGraphicalEditPart)getHost()).resolveSemanticElement().equals(req.getSource())) {
+ 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()));
+ return null;// return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
// redirect message creation to CF
EditPart combinedFragmentPart = getHost().getParent().getParent();
- EObject combinedFragment = ((IGraphicalEditPart)combinedFragmentPart).resolveSemanticElement();
- if(((IGraphicalEditPart)getHost()).resolveSemanticElement().equals(req.getSource())) {
+ 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()));
+ return null;// return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
// redirect message creation to CF
EditPart combinedFragmentPart = getHost().getParent().getParent();
- EObject combinedFragment = ((IGraphicalEditPart)combinedFragmentPart).resolveSemanticElement();
- if(((IGraphicalEditPart)getHost()).resolveSemanticElement().equals(req.getSource())) {
+ 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()));
+ return null;// return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
// redirect message creation to CF
EditPart combinedFragmentPart = getHost().getParent().getParent();
- EObject combinedFragment = ((IGraphicalEditPart)combinedFragmentPart).resolveSemanticElement();
- if(((IGraphicalEditPart)getHost()).resolveSemanticElement().equals(req.getSource())) {
+ 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()));
+ return null;// return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
// redirect message creation to CF
EditPart combinedFragmentPart = getHost().getParent().getParent();
- EObject combinedFragment = ((IGraphicalEditPart)combinedFragmentPart).resolveSemanticElement();
- if(((IGraphicalEditPart)getHost()).resolveSemanticElement().equals(req.getSource())) {
+ 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()));
+ return null;// return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return null;
}
return null;
@@ -226,38 +224,38 @@ public class CustomInteractionOperandItemSemanticEditPolicy extends InteractionO
*/
@Override
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
// let InteractionOperandLayoutEditPolicy redirect messages
- return null;//return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
+ return null;// return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
// let InteractionOperandLayoutEditPolicy redirect messages
- return null;//return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
+ return null;// return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
// let InteractionOperandLayoutEditPolicy redirect messages
- return null;//return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
+ return null;// return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
// let InteractionOperandLayoutEditPolicy redirect messages
- return null;//return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
+ return null;// return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
// let InteractionOperandLayoutEditPolicy redirect messages
- return null;//return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
+ return null;// return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
// let InteractionOperandLayoutEditPolicy redirect messages
- return null;//return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
+ return null;// return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
// let InteractionOperandLayoutEditPolicy redirect messages
- return null;//return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
+ return null;// return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -266,12 +264,12 @@ public class CustomInteractionOperandItemSemanticEditPolicy extends InteractionO
/**
* 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)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -293,12 +291,12 @@ public class CustomInteractionOperandItemSemanticEditPolicy extends InteractionO
/**
* 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)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
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
index 04facb41908..75b34dae0c8 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -67,17 +67,17 @@ public class CustomInteractionUseItemSemanticEditPolicy extends InteractionUseIt
*/
@Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View)getHost().getModel();
+ 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) {
+ 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 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));
@@ -99,31 +99,31 @@ public class CustomInteractionUseItemSemanticEditPolicy extends InteractionUseIt
*/
@Override
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return null;
}
return null;
@@ -134,31 +134,31 @@ public class CustomInteractionUseItemSemanticEditPolicy extends InteractionUseIt
*/
@Override
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -167,12 +167,12 @@ public class CustomInteractionUseItemSemanticEditPolicy extends InteractionUseIt
/**
* 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)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -194,12 +194,12 @@ public class CustomInteractionUseItemSemanticEditPolicy extends InteractionUseIt
/**
* 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)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
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
index 54c00bcf5d3..637108a7a89 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -87,54 +87,54 @@ public class CustomLifelineItemSemanticEditPolicy extends LifelineItemSemanticEd
/**
* 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_3006 == req.getElementType()) {
+ if (UMLElementTypes.ActionExecutionSpecification_3006 == req.getElementType()) {
return getGEFWrapper(new CustomActionExecutionSpecificationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.BehaviorExecutionSpecification_3003 == req.getElementType()) {
+ if (UMLElementTypes.BehaviorExecutionSpecification_3003 == req.getElementType()) {
return getGEFWrapper(new CustomBehaviorExecutionSpecificationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.StateInvariant_3017 == req.getElementType()) {
+ if (UMLElementTypes.StateInvariant_3017 == req.getElementType()) {
return getGEFWrapper(new CustomStateInvariantCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.CombinedFragment_3018 == req.getElementType()) {
+ if (UMLElementTypes.CombinedFragment_3018 == req.getElementType()) {
return getGEFWrapper(new CustomCombinedFragment2CreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.TimeConstraint_3019 == req.getElementType()) {
+ if (UMLElementTypes.TimeConstraint_3019 == req.getElementType()) {
return getGEFWrapper(new CustomTimeConstraintCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- //Fix https://bugs.eclipse.org/bugs/show_bug.cgi?id=364826
- // if(UMLElementTypes.TimeObservation_3020 == req.getElementType()) {
- // return getGEFWrapper(new TimeObservationCreateCommand(req));
- // }
- if(UMLElementTypes.DurationConstraint_3021 == req.getElementType()) {
+ // Fix https://bugs.eclipse.org/bugs/show_bug.cgi?id=364826
+ // if(UMLElementTypes.TimeObservation_3020 == req.getElementType()) {
+ // return getGEFWrapper(new TimeObservationCreateCommand(req));
+ // }
+ if (UMLElementTypes.DurationConstraint_3021 == req.getElementType()) {
return getGEFWrapper(new CustomDurationConstraintCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.DestructionOccurrenceSpecification_3022 == req.getElementType()) {
+ if (UMLElementTypes.DestructionOccurrenceSpecification_3022 == req.getElementType()) {
return getGEFWrapper(new CustomDestructionOccurrenceSpecificationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- //add lifelines
- if(UMLElementTypes.Lifeline_3001 == req.getElementType()) {
- CustomLifelineEditPart lifelineEditPart = (CustomLifelineEditPart)getHost();
- if(lifelineEditPart.isInlineCapability()) {
+ // add lifelines
+ if (UMLElementTypes.Lifeline_3001 == 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_3023 == req.getElementType()) {
+ // add DurationObservation/Constraint
+ if (UMLElementTypes.DurationConstraint_3023 == req.getElementType()) {
return getGEFWrapper(new CustomDurationConstraintCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- // Fix https://bugs.eclipse.org/bugs/show_bug.cgi?id=364826
- // if(UMLElementTypes.DurationObservation_3024 == req.getElementType()) {
- // return getGEFWrapper(new DurationObservationCreateCommand(req));
- // }
+ // Fix https://bugs.eclipse.org/bugs/show_bug.cgi?id=364826
+ // if(UMLElementTypes.DurationObservation_3024 == req.getElementType()) {
+ // return getGEFWrapper(new DurationObservationCreateCommand(req));
+ // }
return super.getCreateCommand(req);
}
@@ -145,21 +145,21 @@ public class CustomLifelineItemSemanticEditPolicy extends LifelineItemSemanticEd
protected Command getDestroyElementCommand(DestroyElementRequest req) {
EObject selectedEObject = req.getElementToDestroy();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
+ if (provider != null) {
// Retrieve delete command from the Element Edit service
ICommand deleteCommand = provider.getEditCommand(req);
- if(deleteCommand != null) {
+ if (deleteCommand != null) {
Command command = new ICommandProxy(deleteCommand);
- command = LifelineMessageCreateHelper.restoreLifelineOnDelete(command, (LifelineEditPart)getHost());
+ command = LifelineMessageCreateHelper.restoreLifelineOnDelete(command, (LifelineEditPart) getHost());
CompoundCommand deleteElementsCommand = new CompoundCommand();
deleteElementsCommand.add(command);
- if(getHost() instanceof LifelineEditPart) {
- LifelineEditPart ep = (LifelineEditPart)getHost();
+ 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());
+ for (Object obj : children) {
+ if (obj instanceof AbstractExecutionSpecificationEditPart) {
+ SequenceDeleteHelper.destroyMessageEvents(deleteElementsCommand, (AbstractExecutionSpecificationEditPart) obj, req.getEditingDomain());
}
}
}
@@ -184,35 +184,35 @@ public class CustomLifelineItemSemanticEditPolicy extends LifelineItemSemanticEd
*/
@Override
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return null;
}
- //add general ordering
- if(UMLElementTypes.GeneralOrdering_4012 == req.getElementType()) {
+ // add general ordering
+ if (UMLElementTypes.GeneralOrdering_4012 == req.getElementType()) {
return getGEFWrapper(new CustomGeneralOrderingCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -224,35 +224,35 @@ public class CustomLifelineItemSemanticEditPolicy extends LifelineItemSemanticEd
*/
@Override
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- //add general ordering
- if(UMLElementTypes.GeneralOrdering_4012 == req.getElementType()) {
+ // add general ordering
+ if (UMLElementTypes.GeneralOrdering_4012 == req.getElementType()) {
return getGEFWrapper(new CustomGeneralOrderingCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -261,13 +261,13 @@ public class CustomLifelineItemSemanticEditPolicy extends LifelineItemSemanticEd
/**
* 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)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -282,9 +282,9 @@ public class CustomLifelineItemSemanticEditPolicy extends LifelineItemSemanticEd
return getGEFWrapper(new CustomMessage6ReorientCommand(req));
case Message7EditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessage7ReorientCommand(req));
- //add general ordering
+ // add general ordering
case GeneralOrderingEditPart.VISUAL_ID:
- if(req.getNewRelationshipEnd() instanceof OccurrenceSpecification) {
+ if (req.getNewRelationshipEnd() instanceof OccurrenceSpecification) {
return getGEFWrapper(new GeneralOrderingReorientCommand(req));
} else {
return null;
@@ -296,12 +296,12 @@ public class CustomLifelineItemSemanticEditPolicy extends LifelineItemSemanticEd
/**
* 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)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
@@ -315,18 +315,18 @@ public class CustomLifelineItemSemanticEditPolicy extends LifelineItemSemanticEd
*/
@Override
public boolean understandsRequest(Request request) {
- if(REQ_RECONNECT_SOURCE.equals(request.getType())) {
- ReconnectRequest reconnReq = (ReconnectRequest)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 && 4009 == UMLVisualIDRegistry.getVisualID((View)model)) {
+ // Source of Message Found should be always located on Interaction.
+ if (model instanceof View && 4009 == UMLVisualIDRegistry.getVisualID((View) model)) {
return false;
}
- } else if(REQ_RECONNECT_TARGET.equals(request.getType())) {
- ReconnectRequest reconnReq = (ReconnectRequest)request;
+ } 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 && 4008 == UMLVisualIDRegistry.getVisualID((View)model)) {
+ // Target of Message Lost should be always located on Interaction.
+ if (model instanceof View && 4008 == UMLVisualIDRegistry.getVisualID((View) model)) {
return false;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessage2ItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessage2ItemSemanticEditPolicy.java
index 200487329aa..38b816deaf5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessage2ItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessage2ItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -64,16 +64,16 @@ public class CustomMessage2ItemSemanticEditPolicy extends Message2ItemSemanticEd
/**
* Added to add duration constraint
- *
+ *
* @Override
* add Duration Constraint
*/
@Override
protected Command getCreateCommand(CreateElementRequest req) {
- if(UMLElementTypes.DurationConstraint_3023 == req.getElementType()) {
+ if (UMLElementTypes.DurationConstraint_3023 == req.getElementType()) {
return getGEFWrapper(new CustomDurationConstraintCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.DurationObservation_3024 == req.getElementType()) {
+ if (UMLElementTypes.DurationObservation_3024 == req.getElementType()) {
return getGEFWrapper(new CustomDurationObservationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
return null;
@@ -81,7 +81,7 @@ public class CustomMessage2ItemSemanticEditPolicy extends Message2ItemSemanticEd
/**
* the added code to delete the messageoccurencespecification when the message is deleted
- *
+ *
* @Override
*/
@Override
@@ -91,16 +91,16 @@ public class CustomMessage2ItemSemanticEditPolicy extends Message2ItemSemanticEd
/**
* 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()));
+ Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View) getHost().getModel()));
deleteViewsCommand.add(deleteViewCommand);
SequenceDeleteHelper.completeDeleteMessageViewCommand(deleteViewsCommand, getEditingDomain(), getHost());
- if(mainCommand == null) {
+ if (mainCommand == null) {
return deleteViewsCommand;
} else {
return mainCommand.chain(deleteViewsCommand);
@@ -121,31 +121,31 @@ public class CustomMessage2ItemSemanticEditPolicy extends Message2ItemSemanticEd
*/
@Override
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return null;
}
return null;
@@ -156,31 +156,31 @@ public class CustomMessage2ItemSemanticEditPolicy extends Message2ItemSemanticEd
*/
@Override
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -189,12 +189,12 @@ public class CustomMessage2ItemSemanticEditPolicy extends Message2ItemSemanticEd
/**
* 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)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -216,12 +216,12 @@ public class CustomMessage2ItemSemanticEditPolicy extends Message2ItemSemanticEd
/**
* 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)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessage3ItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessage3ItemSemanticEditPolicy.java
index 8a0adca4859..5a5d4921677 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessage3ItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessage3ItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -64,16 +64,16 @@ public class CustomMessage3ItemSemanticEditPolicy extends Message3ItemSemanticEd
/**
* Added to add duration constraint
- *
+ *
* @Override
* add Duration Constraint
*/
@Override
protected Command getCreateCommand(CreateElementRequest req) {
- if(UMLElementTypes.DurationConstraint_3023 == req.getElementType()) {
+ if (UMLElementTypes.DurationConstraint_3023 == req.getElementType()) {
return getGEFWrapper(new CustomDurationConstraintCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.DurationObservation_3024 == req.getElementType()) {
+ if (UMLElementTypes.DurationObservation_3024 == req.getElementType()) {
return getGEFWrapper(new CustomDurationObservationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
return null;
@@ -89,16 +89,16 @@ public class CustomMessage3ItemSemanticEditPolicy extends Message3ItemSemanticEd
/**
* 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()));
+ Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View) getHost().getModel()));
deleteViewsCommand.add(deleteViewCommand);
SequenceDeleteHelper.completeDeleteMessageViewCommand(deleteViewsCommand, getEditingDomain(), getHost());
- if(mainCommand == null) {
+ if (mainCommand == null) {
return deleteViewsCommand;
} else {
return mainCommand.chain(deleteViewsCommand);
@@ -119,31 +119,31 @@ public class CustomMessage3ItemSemanticEditPolicy extends Message3ItemSemanticEd
*/
@Override
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return null;
}
return null;
@@ -154,31 +154,31 @@ public class CustomMessage3ItemSemanticEditPolicy extends Message3ItemSemanticEd
*/
@Override
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -187,12 +187,12 @@ public class CustomMessage3ItemSemanticEditPolicy extends Message3ItemSemanticEd
/**
* 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)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -214,12 +214,12 @@ public class CustomMessage3ItemSemanticEditPolicy extends Message3ItemSemanticEd
/**
* 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)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessage4ItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessage4ItemSemanticEditPolicy.java
index b06f09f1b90..ee691285464 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessage4ItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessage4ItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -65,16 +65,16 @@ public class CustomMessage4ItemSemanticEditPolicy extends Message4ItemSemanticEd
/**
* Added to add duration constraint
- *
+ *
* @Override
* add Duration Constraint
*/
@Override
protected Command getCreateCommand(CreateElementRequest req) {
- if(UMLElementTypes.DurationConstraint_3023 == req.getElementType()) {
+ if (UMLElementTypes.DurationConstraint_3023 == req.getElementType()) {
return getGEFWrapper(new CustomDurationConstraintCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.DurationObservation_3024 == req.getElementType()) {
+ if (UMLElementTypes.DurationObservation_3024 == req.getElementType()) {
return getGEFWrapper(new CustomDurationObservationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
return null;
@@ -93,16 +93,16 @@ public class CustomMessage4ItemSemanticEditPolicy extends Message4ItemSemanticEd
/**
* 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()));
+ Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View) getHost().getModel()));
deleteViewsCommand.add(deleteViewCommand);
SequenceDeleteHelper.completeDeleteMessageViewCommand(deleteViewsCommand, getEditingDomain(), getHost());
- if(mainCommand == null) {
+ if (mainCommand == null) {
return deleteViewsCommand;
} else {
return mainCommand.chain(deleteViewsCommand);
@@ -123,31 +123,31 @@ public class CustomMessage4ItemSemanticEditPolicy extends Message4ItemSemanticEd
*/
@Override
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return null;
}
return null;
@@ -158,31 +158,31 @@ public class CustomMessage4ItemSemanticEditPolicy extends Message4ItemSemanticEd
*/
@Override
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -191,12 +191,12 @@ public class CustomMessage4ItemSemanticEditPolicy extends Message4ItemSemanticEd
/**
* 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)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -218,12 +218,12 @@ public class CustomMessage4ItemSemanticEditPolicy extends Message4ItemSemanticEd
/**
* 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)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessage5ItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessage5ItemSemanticEditPolicy.java
index 1ff17e3e08f..4d0758a5c39 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessage5ItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessage5ItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -64,16 +64,16 @@ public class CustomMessage5ItemSemanticEditPolicy extends Message5ItemSemanticEd
/**
* Added to add duration constraint
- *
+ *
* @Override
* add Duration Constraint
*/
@Override
protected Command getCreateCommand(CreateElementRequest req) {
- if(UMLElementTypes.DurationConstraint_3023 == req.getElementType()) {
+ if (UMLElementTypes.DurationConstraint_3023 == req.getElementType()) {
return getGEFWrapper(new CustomDurationConstraintCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.DurationObservation_3024 == req.getElementType()) {
+ if (UMLElementTypes.DurationObservation_3024 == req.getElementType()) {
return getGEFWrapper(new CustomDurationObservationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
return null;
@@ -89,16 +89,16 @@ public class CustomMessage5ItemSemanticEditPolicy extends Message5ItemSemanticEd
/**
* 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()));
+ Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View) getHost().getModel()));
deleteViewsCommand.add(deleteViewCommand);
SequenceDeleteHelper.completeDeleteMessageViewCommand(deleteViewsCommand, getEditingDomain(), getHost());
- if(mainCommand == null) {
+ if (mainCommand == null) {
return deleteViewsCommand;
} else {
return mainCommand.chain(deleteViewsCommand);
@@ -119,31 +119,31 @@ public class CustomMessage5ItemSemanticEditPolicy extends Message5ItemSemanticEd
*/
@Override
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return null;
}
return null;
@@ -154,31 +154,31 @@ public class CustomMessage5ItemSemanticEditPolicy extends Message5ItemSemanticEd
*/
@Override
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -187,12 +187,12 @@ public class CustomMessage5ItemSemanticEditPolicy extends Message5ItemSemanticEd
/**
* 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)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -214,12 +214,12 @@ public class CustomMessage5ItemSemanticEditPolicy extends Message5ItemSemanticEd
/**
* 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)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessage6ItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessage6ItemSemanticEditPolicy.java
index dff3856f165..e304b9c1466 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessage6ItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessage6ItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -64,16 +64,16 @@ public class CustomMessage6ItemSemanticEditPolicy extends Message6ItemSemanticEd
/**
* Added to add duration constraint
- *
+ *
* @Override
* add Duration Constraint
*/
@Override
protected Command getCreateCommand(CreateElementRequest req) {
- if(UMLElementTypes.DurationConstraint_3023 == req.getElementType()) {
+ if (UMLElementTypes.DurationConstraint_3023 == req.getElementType()) {
return getGEFWrapper(new CustomDurationConstraintCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.DurationObservation_3024 == req.getElementType()) {
+ if (UMLElementTypes.DurationObservation_3024 == req.getElementType()) {
return getGEFWrapper(new CustomDurationObservationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
return null;
@@ -89,16 +89,16 @@ public class CustomMessage6ItemSemanticEditPolicy extends Message6ItemSemanticEd
/**
* 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()));
+ Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View) getHost().getModel()));
deleteViewsCommand.add(deleteViewCommand);
SequenceDeleteHelper.completeDeleteMessageViewCommand(deleteViewsCommand, getEditingDomain(), getHost());
- if(mainCommand == null) {
+ if (mainCommand == null) {
return deleteViewsCommand;
} else {
return mainCommand.chain(deleteViewsCommand);
@@ -119,31 +119,31 @@ public class CustomMessage6ItemSemanticEditPolicy extends Message6ItemSemanticEd
*/
@Override
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return null;
}
return null;
@@ -154,31 +154,31 @@ public class CustomMessage6ItemSemanticEditPolicy extends Message6ItemSemanticEd
*/
@Override
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -187,12 +187,12 @@ public class CustomMessage6ItemSemanticEditPolicy extends Message6ItemSemanticEd
/**
* 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)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -214,12 +214,12 @@ public class CustomMessage6ItemSemanticEditPolicy extends Message6ItemSemanticEd
/**
* 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)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessage7ItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessage7ItemSemanticEditPolicy.java
index 2e2b82ac8fd..830eddbfe27 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessage7ItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessage7ItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -64,16 +64,16 @@ public class CustomMessage7ItemSemanticEditPolicy extends Message7ItemSemanticEd
/**
* Added to add duration constraint
- *
+ *
* @Override
* add Duration Constraint
*/
@Override
protected Command getCreateCommand(CreateElementRequest req) {
- if(UMLElementTypes.DurationConstraint_3023 == req.getElementType()) {
+ if (UMLElementTypes.DurationConstraint_3023 == req.getElementType()) {
return getGEFWrapper(new CustomDurationConstraintCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.DurationObservation_3024 == req.getElementType()) {
+ if (UMLElementTypes.DurationObservation_3024 == req.getElementType()) {
return getGEFWrapper(new CustomDurationObservationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
return null;
@@ -89,16 +89,16 @@ public class CustomMessage7ItemSemanticEditPolicy extends Message7ItemSemanticEd
/**
* 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()));
+ Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View) getHost().getModel()));
deleteViewsCommand.add(deleteViewCommand);
SequenceDeleteHelper.completeDeleteMessageViewCommand(deleteViewsCommand, getEditingDomain(), getHost());
- if(mainCommand == null) {
+ if (mainCommand == null) {
return deleteViewsCommand;
} else {
return mainCommand.chain(deleteViewsCommand);
@@ -119,31 +119,31 @@ public class CustomMessage7ItemSemanticEditPolicy extends Message7ItemSemanticEd
*/
@Override
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return null;
}
return null;
@@ -154,31 +154,31 @@ public class CustomMessage7ItemSemanticEditPolicy extends Message7ItemSemanticEd
*/
@Override
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -187,12 +187,12 @@ public class CustomMessage7ItemSemanticEditPolicy extends Message7ItemSemanticEd
/**
* 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)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -214,12 +214,12 @@ public class CustomMessage7ItemSemanticEditPolicy extends Message7ItemSemanticEd
/**
* 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)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageItemSemanticEditPolicy.java
index bf6d84a1486..5ee0c1aed61 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomMessageItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -64,16 +64,16 @@ public class CustomMessageItemSemanticEditPolicy extends MessageItemSemanticEdit
/**
* Added to add duration constraint
- *
+ *
* @Override
* add Duration Constraint
*/
@Override
protected Command getCreateCommand(CreateElementRequest req) {
- if(UMLElementTypes.DurationConstraint_3023 == req.getElementType()) {
+ if (UMLElementTypes.DurationConstraint_3023 == req.getElementType()) {
return getGEFWrapper(new CustomDurationConstraintCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.DurationObservation_3024 == req.getElementType()) {
+ if (UMLElementTypes.DurationObservation_3024 == req.getElementType()) {
return getGEFWrapper(new CustomDurationObservationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
return null;
@@ -89,16 +89,16 @@ public class CustomMessageItemSemanticEditPolicy extends MessageItemSemanticEdit
/**
* 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()));
+ Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View) getHost().getModel()));
deleteViewsCommand.add(deleteViewCommand);
SequenceDeleteHelper.completeDeleteMessageViewCommand(deleteViewsCommand, getEditingDomain(), getHost());
- if(mainCommand == null) {
+ if (mainCommand == null) {
return deleteViewsCommand;
} else {
return mainCommand.chain(deleteViewsCommand);
@@ -119,31 +119,31 @@ public class CustomMessageItemSemanticEditPolicy extends MessageItemSemanticEdit
*/
@Override
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return null;
}
return null;
@@ -154,31 +154,31 @@ public class CustomMessageItemSemanticEditPolicy extends MessageItemSemanticEdit
*/
@Override
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -187,12 +187,12 @@ public class CustomMessageItemSemanticEditPolicy extends MessageItemSemanticEdit
/**
* 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)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -214,12 +214,12 @@ public class CustomMessageItemSemanticEditPolicy extends MessageItemSemanticEdit
/**
* 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)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
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
index 8fc2f65b830..901aee4389c 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -30,7 +30,7 @@ public class CustomPackageItemSemanticEditPolicy extends PackageItemSemanticEdit
*/
@Override
protected Command getCreateCommand(CreateElementRequest req) {
- if(UMLElementTypes.Interaction_2001 == req.getElementType()) {
+ if (UMLElementTypes.Interaction_2001 == 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
index d2683dd90f6..3a10bec0f20 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -67,17 +67,17 @@ public class CustomStateInvariantItemSemanticEditPolicy extends StateInvariantIt
*/
@Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View)getHost().getModel();
+ 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) {
+ 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 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));
@@ -99,31 +99,31 @@ public class CustomStateInvariantItemSemanticEditPolicy extends StateInvariantIt
*/
@Override
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return null;
}
return null;
@@ -134,31 +134,31 @@ public class CustomStateInvariantItemSemanticEditPolicy extends StateInvariantIt
*/
@Override
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -167,12 +167,12 @@ public class CustomStateInvariantItemSemanticEditPolicy extends StateInvariantIt
/**
* 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)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -194,12 +194,12 @@ public class CustomStateInvariantItemSemanticEditPolicy extends StateInvariantIt
/**
* 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)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
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
index 94c70bf13de..71cb7f2b7b4 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -67,17 +67,17 @@ public class CustomTimeConstraintItemSemanticEditPolicy extends TimeConstraintIt
*/
@Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View)getHost().getModel();
+ 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) {
+ 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 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));
@@ -99,31 +99,31 @@ public class CustomTimeConstraintItemSemanticEditPolicy extends TimeConstraintIt
*/
@Override
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -134,31 +134,31 @@ public class CustomTimeConstraintItemSemanticEditPolicy extends TimeConstraintIt
*/
@Override
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -167,12 +167,12 @@ public class CustomTimeConstraintItemSemanticEditPolicy extends TimeConstraintIt
/**
* 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)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -194,12 +194,12 @@ public class CustomTimeConstraintItemSemanticEditPolicy extends TimeConstraintIt
/**
* 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)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
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
index 8556abb629f..1738d4bc15c 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -67,17 +67,17 @@ public class CustomTimeObservationItemSemanticEditPolicy extends TimeObservation
*/
@Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View)getHost().getModel();
+ 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) {
+ 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 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));
@@ -99,31 +99,31 @@ public class CustomTimeObservationItemSemanticEditPolicy extends TimeObservation
*/
@Override
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return null;
}
return null;
@@ -134,31 +134,31 @@ public class CustomTimeObservationItemSemanticEditPolicy extends TimeObservation
*/
@Override
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4003 == req.getElementType()) {
+ if (UMLElementTypes.Message_4003 == req.getElementType()) {
return getGEFWrapper(new CustomMessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return getGEFWrapper(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ if (UMLElementTypes.Message_4005 == req.getElementType()) {
return getGEFWrapper(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == req.getElementType()) {
+ if (UMLElementTypes.Message_4006 == req.getElementType()) {
return getGEFWrapper(new CustomMessage4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == req.getElementType()) {
+ if (UMLElementTypes.Message_4007 == req.getElementType()) {
return getGEFWrapper(new CustomMessage5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ if (UMLElementTypes.Message_4008 == req.getElementType()) {
return getGEFWrapper(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ if (UMLElementTypes.Message_4009 == req.getElementType()) {
return getGEFWrapper(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == req.getElementType()) {
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
return null;
@@ -167,12 +167,12 @@ public class CustomTimeObservationItemSemanticEditPolicy extends TimeObservation
/**
* 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)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -194,12 +194,12 @@ public class CustomTimeObservationItemSemanticEditPolicy extends TimeObservation
/**
* 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)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CustomCommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
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
index efca2e2f3c2..6e3b43aa52f 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -55,7 +55,7 @@ public class GateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
/**
* Constructor.
- *
+ *
* @param elementType
*/
public GateItemSemanticEditPolicy() {
@@ -64,38 +64,39 @@ public class GateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
/**
* @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);
+ 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;
+ 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) {
+ if (selectedEObject instanceof Gate && ((Gate) selectedEObject).getMessage() != null) {
return UnexecutableCommand.INSTANCE;
}
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
+ if (provider != null) {
// Retrieve delete command from the Element Edit service
ICommand deleteCommand = provider.getEditCommand(req);
- if(deleteCommand != null) {
+ if (deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
}
@@ -106,8 +107,9 @@ public class GateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
* @param request
* @return
*/
+ @Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new CustomMessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -130,6 +132,7 @@ public class GateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
* @param request
* @return
*/
+ @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest request) {
return super.getReorientReferenceRelationshipCommand(request);
}
@@ -138,14 +141,15 @@ public class GateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
* @param request
* @return
*/
+ @Override
protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(UMLElementTypes.Message_4004 == req.getElementType()) {
+ if (UMLElementTypes.Message_4004 == req.getElementType()) {
return new ICommandProxy(new CustomMessage2CreateCommand(req, req.getSource(), req.getTarget()));
- } else if(UMLElementTypes.Message_4005 == req.getElementType()) {
+ } else if (UMLElementTypes.Message_4005 == req.getElementType()) {
return new ICommandProxy(new CustomMessage3CreateCommand(req, req.getSource(), req.getTarget()));
- } else if(UMLElementTypes.Message_4008 == req.getElementType()) {
+ } else if (UMLElementTypes.Message_4008 == req.getElementType()) {
return new ICommandProxy(new CustomMessage6CreateCommand(req, req.getSource(), req.getTarget()));
- } else if(UMLElementTypes.Message_4009 == req.getElementType()) {
+ } else if (UMLElementTypes.Message_4009 == req.getElementType()) {
return new ICommandProxy(new CustomMessage7CreateCommand(req, req.getSource(), req.getTarget()));
}
return super.getCreateRelationshipCommand(req);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/AppliedStereotypeLabelFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/AppliedStereotypeLabelFigure.java
index 12804f53c87..a2f98dbe9fc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/AppliedStereotypeLabelFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/AppliedStereotypeLabelFigure.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -26,7 +26,7 @@ import org.eclipse.swt.graphics.Image;
/**
* This figure use to display stereotype and properties in brace.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class AppliedStereotypeLabelFigure extends Figure implements ILabelFigure, IPapyrusNodeUMLElementFigure {
@@ -38,7 +38,7 @@ public class AppliedStereotypeLabelFigure extends Figure implements ILabelFigure
/**
* Constructor.
- *
+ *
*/
public AppliedStereotypeLabelFigure() {
createContents();
@@ -59,13 +59,13 @@ public class AppliedStereotypeLabelFigure extends Figure implements ILabelFigure
}
/**
- * @see org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusUMLElementFigure#setStereotypeDisplay(java.lang.String,
- * org.eclipse.swt.graphics.Image)
- *
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusUMLElementFigure#setStereotypeDisplay(java.lang.String, org.eclipse.swt.graphics.Image)
+ *
* @param stereotypes
* @param image
*/
+ @Override
public void setStereotypeDisplay(String stereotypes, Image image) {
stereotypeLabel.setText(stereotypes);
stereotypeLabel.setIcon(image);
@@ -73,18 +73,19 @@ public class AppliedStereotypeLabelFigure extends Figure implements ILabelFigure
/**
* @see org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeUMLElementFigure#setStereotypePropertiesInBrace(java.lang.String)
- *
+ *
* @param stereotypeProperties
*/
+ @Override
public void setStereotypePropertiesInBrace(String stereotypeProperties) {
- if(stereotypeProperties == null || stereotypeProperties.trim().equals("")) {
- if(stereotypePropertiesInBraceContent != null) {
+ if (stereotypeProperties == null || stereotypeProperties.trim().equals("")) {
+ if (stereotypePropertiesInBraceContent != null) {
remove(stereotypePropertiesInBraceContent);
}
stereotypePropertiesInBraceContent = null;
} else {
- if(stereotypePropertiesInBraceContent == null) {
+ if (stereotypePropertiesInBraceContent == null) {
stereotypePropertiesInBraceContent = new WrappingLabel();
stereotypePropertiesInBraceContent.setOpaque(false);
this.add(stereotypePropertiesInBraceContent);
@@ -96,60 +97,66 @@ public class AppliedStereotypeLabelFigure extends Figure implements ILabelFigure
/**
* @see org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeUMLElementFigure#setStereotypePropertiesInCompartment(java.lang.String)
- *
+ *
* @param stereotypeProperties
*/
+ @Override
public void setStereotypePropertiesInCompartment(String stereotypeProperties) {
}
/**
* @see org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeUMLElementFigure#getStereotypesLabel()
- *
+ *
* @return
*/
+ @Override
public Label getStereotypesLabel() {
return stereotypeLabel;
}
/**
* @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#setText(java.lang.String)
- *
+ *
* @param text
*/
+ @Override
public void setText(String text) {
stereotypeLabel.setText(text);
}
/**
* @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#getText()
- *
+ *
* @return
*/
+ @Override
public String getText() {
return stereotypeLabel.getText();
}
/**
* @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#setIcon(org.eclipse.swt.graphics.Image)
- *
+ *
* @param icon
*/
+ @Override
public void setIcon(Image icon) {
stereotypeLabel.setIcon(icon);
}
/**
* @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#getIcon()
- *
+ *
* @return
*/
+ @Override
public Image getIcon() {
return stereotypeLabel.getIcon();
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/CoRegionCombinedFragmentFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/CoRegionCombinedFragmentFigure.java
index 3d19e1b72b3..d0630a8e5cf 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/CoRegionCombinedFragmentFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/CoRegionCombinedFragmentFigure.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -36,7 +36,7 @@ public class CoRegionCombinedFragmentFigure extends RectangleFigure {
/**
* Constructor
- *
+ *
* @generated
*/
public CoRegionCombinedFragmentFigure() {
@@ -49,7 +49,7 @@ public class CoRegionCombinedFragmentFigure extends RectangleFigure {
/**
* Draw the vertical bracket
- *
+ *
* @see org.eclipse.draw2d.Shape#paintFigure(org.eclipse.draw2d.Graphics)
*/
@Override
@@ -65,7 +65,7 @@ public class CoRegionCombinedFragmentFigure extends RectangleFigure {
graphics.drawLine(r.right() - 1, r.bottom() - 1, r.right() - 1, r.bottom() - 1 - BRACKET_HEIGHT);
graphics.drawLine(r.x, r.bottom() - 1, r.x, r.bottom() - 1 - BRACKET_HEIGHT);
// Refresh the line
- int endY = r.height + r.y;//fixed a issue on height.
+ int endY = r.height + r.y;// fixed a issue on height.
Point pStart = new Point(r.x + r.width / 2, r.y + 1);
centralVerticalLine.setSize(1, endY - pStart.y);
centralVerticalLine.setLocation(pStart);
@@ -78,33 +78,33 @@ public class CoRegionCombinedFragmentFigure extends RectangleFigure {
public boolean containsPoint(int x, int y) {
Rectangle rect = getBounds();
// check if point is at the topline of the figure
- if(x > rect.x && x < rect.x + rect.width) {
- if(y > rect.y - COREGION_HIT_WIDTH && y < rect.y + COREGION_HIT_WIDTH) {
+ if (x > rect.x && x < rect.x + rect.width) {
+ if (y > rect.y - COREGION_HIT_WIDTH && y < rect.y + COREGION_HIT_WIDTH) {
return true;
}
}
// check if point is at the bottom line of the figure
- if(x > rect.x && x < rect.x + rect.width) {
- if(y > rect.y + rect.height - COREGION_HIT_WIDTH && y < rect.y + rect.height + COREGION_HIT_WIDTH) {
+ if (x > rect.x && x < rect.x + rect.width) {
+ if (y > rect.y + rect.height - COREGION_HIT_WIDTH && y < rect.y + rect.height + COREGION_HIT_WIDTH) {
return true;
}
}
// check if point is at the left line of the figure
- if(x > rect.x - COREGION_HIT_WIDTH && x < rect.x + COREGION_HIT_WIDTH) {
- if(y > rect.y && y < rect.y + rect.height) {
+ if (x > rect.x - COREGION_HIT_WIDTH && x < rect.x + COREGION_HIT_WIDTH) {
+ if (y > rect.y && y < rect.y + rect.height) {
return true;
}
}
// check if point is at the right line of the figure
- if(x > rect.x + rect.width - COREGION_HIT_WIDTH && x < rect.x + rect.width + COREGION_HIT_WIDTH) {
- if(y > rect.y && y < rect.y + rect.height) {
+ if (x > rect.x + rect.width - COREGION_HIT_WIDTH && x < rect.x + rect.width + COREGION_HIT_WIDTH) {
+ if (y > rect.y && y < rect.y + rect.height) {
return true;
}
}
- for(IFigure child : (List<IFigure>)getChildren()) {
+ for (IFigure child : (List<IFigure>) getChildren()) {
Point local = new Point(x, y);
translateFromParent(local);
- if(child.containsPoint(local)) {
+ if (child.containsPoint(local)) {
return true;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/CombinedFragmentFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/CombinedFragmentFigure.java
index a68dfe2a522..42d47a22ddf 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/CombinedFragmentFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/CombinedFragmentFigure.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -51,8 +51,8 @@ public class CombinedFragmentFigure extends StereotypeInteractionFigure {
public WrappingLabel getTitleLabel() {
return titleLabel;
}
-
- public IFigure getHeaderContainer(){
+
+ public IFigure getHeaderContainer() {
return header;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/CustomContextLinkFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/CustomContextLinkFigure.java
index d802846854f..23e11805850 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/CustomContextLinkFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/CustomContextLinkFigure.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -20,7 +20,7 @@ import org.eclipse.papyrus.uml.diagram.common.figure.edge.DashedEdgeFigure;
/**
* Create an {@link CustomContextLinkFigure} with the tag <code>&laquo context &raquo</code>
- *
+ *
*/
public class CustomContextLinkFigure extends DashedEdgeFigure {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/DestructionEventFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/DestructionEventFigure.java
index 6f01b718a16..40e65fea04c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/DestructionEventFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/DestructionEventFigure.java
@@ -3,7 +3,7 @@
* 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: David Sciamma (Anyware Technologies), Mathieu Garcia (Anyware
* Technologies), Jacques Lescot (Anyware Technologies), Thomas Friol (Anyware
* Technologies), Nicolas Lalevee (Anyware Technologies) - initial API and
@@ -16,14 +16,14 @@ import org.eclipse.draw2d.Graphics;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
public class DestructionEventFigure extends org.eclipse.draw2d.Figure {
/**
* Constructor <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
public DestructionEventFigure() {
@@ -32,7 +32,7 @@ public class DestructionEventFigure extends org.eclipse.draw2d.Figure {
/**
* The stop is a cross
- *
+ *
* @see org.eclipse.draw2d.Figure#paintFigure(org.eclipse.draw2d.Graphics)
*/
@Override
@@ -41,9 +41,9 @@ public class DestructionEventFigure extends org.eclipse.draw2d.Figure {
graphics.pushState();
int width = bounds.width;
int height = bounds.height;
- if(width > height) {
+ if (width > height) {
width = height;
- } else if(width < height) {
+ } else if (width < height) {
height = width;
}
int x = bounds.x + bounds.width / 2 - width / 2;
@@ -55,7 +55,7 @@ public class DestructionEventFigure extends org.eclipse.draw2d.Figure {
}
public void setLineWidth(int w) {
- if((lineWidth == w) || (w < 0)) {
+ if ((lineWidth == w) || (w < 0)) {
return;
}
lineWidth = w;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/EllipseDecoration.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/EllipseDecoration.java
index cf447c7d18f..4cb0d0173ef 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/EllipseDecoration.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/EllipseDecoration.java
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2009 Borland Software Corporation
- *
+ *
* 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
@@ -36,12 +36,13 @@ public class EllipseDecoration extends Ellipse implements RotatableDecoration {
super.setLocation(p.getTranslated(delta));
}
+ @Override
public void setReferencePoint(Point p) {
}
@Override
protected void outlineShape(Graphics graphics) {
- if(myAlwaysFill) {
+ if (myAlwaysFill) {
Color oldBack = graphics.getBackgroundColor();
graphics.setBackgroundColor(graphics.getForegroundColor());
fillShape(graphics);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/InteractionOperandFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/InteractionOperandFigure.java
index 57ead5b710d..5a8d21820c9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/InteractionOperandFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/InteractionOperandFigure.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -26,7 +26,7 @@ public class InteractionOperandFigure extends PapyrusNodeFigure {
@Override
public void paintFigure(Graphics graphics) {
super.paintFigure(graphics);
- if(lineSeparator) {
+ if (lineSeparator) {
graphics.setLineStyle(getLineStyle());
graphics.setLineWidth(getLineWidth());
graphics.drawLine(getBounds().getTopLeft(), getBounds().getTopRight());
@@ -35,7 +35,7 @@ public class InteractionOperandFigure extends PapyrusNodeFigure {
/**
* Set the line separator
- *
+ *
* @param lineSeparator
*/
public void setLineSeparator(boolean lineSeparator) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/InteractionUseRectangleFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/InteractionUseRectangleFigure.java
index 2f10f873859..f9c128a259f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/InteractionUseRectangleFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/InteractionUseRectangleFigure.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -20,7 +20,7 @@ import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
/**
* The figure of the InteractionUse
- *
+ *
* Change super type to support displaying stereotypes, modified by [Jin Liu(jin.liu@soyatec.com)]
*/
public class InteractionUseRectangleFigure extends StereotypeInteractionFigure {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/LifelineDotLineCustomFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/LifelineDotLineCustomFigure.java
index 3dfaeca9aca..623e9171734 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/LifelineDotLineCustomFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/LifelineDotLineCustomFigure.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -95,19 +95,19 @@ public class LifelineDotLineCustomFigure extends LifelineDotLineFigure {
/**
* Configure the lifeline figure
- *
+ *
* @param inlineMode
- * true if inline mode enabled
+ * true if inline mode enabled
* @param innerConnectableElementsNumber
- * Number of children
+ * Number of children
*/
public void configure(boolean inlineMode, int innerConnectableElementsNumber) {
- if(inlineMode) {
+ if (inlineMode) {
this.innerConnectableElementsNumber = innerConnectableElementsNumber;
}
- if(this.inlineMode != inlineMode) {
+ if (this.inlineMode != inlineMode) {
this.inlineMode = inlineMode;
- if(inlineMode) {
+ if (inlineMode) {
setLayoutManager(inlineModeManager);
} else {
setLayoutManager(normalModeManager);
@@ -120,7 +120,7 @@ public class LifelineDotLineCustomFigure extends LifelineDotLineFigure {
*/
@Override
protected void outlineShape(Graphics graphics) {
- if(!inlineMode) {
+ if (!inlineMode) {
paintDashLineBackground(graphics);
super.outlineShape(graphics);
}
@@ -128,7 +128,7 @@ public class LifelineDotLineCustomFigure extends LifelineDotLineFigure {
protected void paintDashLineBackground(Graphics graphics) {
NodeFigure dashLineRectangle = getDashLineRectangle();
- if(!dashLineRectangle.isOpaque()) {
+ if (!dashLineRectangle.isOpaque()) {
return;
}
Rectangle r = getBounds().getCopy();
@@ -147,11 +147,11 @@ public class LifelineDotLineCustomFigure extends LifelineDotLineFigure {
@Override
public boolean containsPoint(int x, int y) {
- if(!super.containsPoint(x, y)) {
+ if (!super.containsPoint(x, y)) {
return false;
}
NodeFigure dashLineRectangle = getDashLineRectangle();
- if(dashLineRectangle.containsPoint(x, y)) {
+ if (dashLineRectangle.containsPoint(x, y)) {
return true;
}
return false;
@@ -168,13 +168,13 @@ public class LifelineDotLineCustomFigure extends LifelineDotLineFigure {
public IFigure findMouseEventTargetAt(int x, int y) {
// check children first instead of self
IFigure f = findMouseEventTargetInDescendantsAt(x, y);
- if(f != null) {
+ if (f != null) {
return f;
}
- if(!containsPoint(x, y)) {
+ if (!containsPoint(x, y)) {
return null;
}
- if(isMouseEventTarget()) {
+ if (isMouseEventTarget()) {
return this;
}
return null;
@@ -182,17 +182,17 @@ public class LifelineDotLineCustomFigure extends LifelineDotLineFigure {
@Override
public IFigure findFigureAt(int x, int y, TreeSearch search) {
- if(search.prune(this)) {
+ if (search.prune(this)) {
return null;
}
IFigure child = findDescendantAtExcluding(x, y, search);
- if(child != null) {
+ if (child != null) {
return child;
}
- if(!containsPoint(x, y)) {
+ if (!containsPoint(x, y)) {
return null;
}
- if(search.accept(this)) {
+ if (search.accept(this)) {
return this;
}
return null;
@@ -205,13 +205,13 @@ public class LifelineDotLineCustomFigure extends LifelineDotLineFigure {
public IFigure findMouseEventTargetAt(int x, int y) {
// check children first instead of self
IFigure f = findMouseEventTargetInDescendantsAt(x, y);
- if(f != null) {
+ if (f != null) {
return f;
}
- if(!containsPoint(x, y)) {
+ if (!containsPoint(x, y)) {
return null;
}
- if(isMouseEventTarget()) {
+ if (isMouseEventTarget()) {
return this;
}
return null;
@@ -219,17 +219,17 @@ public class LifelineDotLineCustomFigure extends LifelineDotLineFigure {
@Override
public IFigure findFigureAt(int x, int y, TreeSearch search) {
- if(search.prune(this)) {
+ if (search.prune(this)) {
return null;
}
IFigure child = findDescendantAtExcluding(x, y, search);
- if(child != null) {
+ if (child != null) {
return child;
}
- if(!containsPoint(x, y)) {
+ if (!containsPoint(x, y)) {
return null;
}
- if(search.accept(this)) {
+ if (search.accept(this)) {
return this;
}
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/LifelineFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/LifelineFigure.java
index f674d292ae1..24d6b181997 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/LifelineFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/LifelineFigure.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -19,6 +19,7 @@ import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.LayoutManager;
import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.draw2d.OrderedLayout;
import org.eclipse.draw2d.RectangleFigure;
import org.eclipse.draw2d.StackLayout;
import org.eclipse.draw2d.ToolbarLayout;
@@ -46,7 +47,7 @@ public class LifelineFigure extends NodeNamedElementFigure {
/**
* Constructor.
- *
+ *
*/
public LifelineFigure() {
}
@@ -57,7 +58,7 @@ public class LifelineFigure extends NodeNamedElementFigure {
/**
* Get the rectangle which contains all labels
- *
+ *
* @see org.eclipse.papyrus.uml.diagram.common.figure.node.NodeNamedElementFigure#getDefaultLabelsContainer()
* @return lifeline labels rectangle
*/
@@ -68,7 +69,7 @@ public class LifelineFigure extends NodeNamedElementFigure {
/**
* Create the composite structure.
- *
+ *
* @see org.eclipse.papyrus.uml.diagram.common.figure.node.PapyrusNodeFigure#createCompositeFigureStructure()
*/
@Override
@@ -82,13 +83,12 @@ public class LifelineFigure extends NodeNamedElementFigure {
/**
* Paint the label rectangle as background instead of the whole figure
- *
- * @see org.eclipse.papyrus.uml.diagram.common.figure.node.PapyrusNodeFigure#paintBackground(org.eclipse.draw2d.Graphics,
- * org.eclipse.draw2d.geometry.Rectangle)
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.PapyrusNodeFigure#paintBackground(org.eclipse.draw2d.Graphics, org.eclipse.draw2d.geometry.Rectangle)
* @param graphics
- * graphics tool
+ * graphics tool
* @param rectangle
- * unused
+ * unused
*/
@Override
protected void paintBackground(Graphics graphics, Rectangle rectangle) {
@@ -97,7 +97,7 @@ public class LifelineFigure extends NodeNamedElementFigure {
/**
* Get the figure on which the border must be drawn.
- *
+ *
* @see org.eclipse.papyrus.uml.diagram.common.figure.node.PapyrusNodeFigure#getBorderedFigure()
* @return the rectangle containing labels
*/
@@ -108,10 +108,10 @@ public class LifelineFigure extends NodeNamedElementFigure {
/**
* Construct the appropriate border
- *
+ *
* @see org.eclipse.papyrus.uml.diagram.common.figure.node.PapyrusNodeFigure#getDefaultBorder(org.eclipse.swt.graphics.Color)
* @param borderColor
- * the color of the border
+ * the color of the border
* @return the border
*/
@Override
@@ -123,9 +123,10 @@ public class LifelineFigure extends NodeNamedElementFigure {
/**
* Get layout to display content of properties compartment.
- *
+ *
* @return the layout
*/
+ @Override
protected LayoutManager getPropertiesCompartmentLayout() {
ToolbarLayout layout = new ToolbarLayout(false);
layout.setStretchMinorAxis(true);
@@ -134,7 +135,7 @@ public class LifelineFigure extends NodeNamedElementFigure {
/**
* Create the name label with width wrap
- *
+ *
* @see org.eclipse.papyrus.uml.diagram.common.figure.node.NodeNamedElementFigure#createNameLabel()
*/
@Override
@@ -148,6 +149,7 @@ public class LifelineFigure extends NodeNamedElementFigure {
private void createContents() {
fFigureLifelineNameContainerFigure = new RectangleFigure() {
+ @Override
protected void fillShape(Graphics graphics) {
graphics.pushState();
applyTransparency(graphics);
@@ -161,29 +163,29 @@ public class LifelineFigure extends NodeNamedElementFigure {
this.add(fFigureLifelineNameContainerFigure, BorderLayout.TOP);
// change layout
ToolbarLayout layout = new ToolbarLayout(false);
- layout.setMinorAlignment(ToolbarLayout.ALIGN_CENTER);
+ layout.setMinorAlignment(OrderedLayout.ALIGN_CENTER);
fFigureLifelineNameContainerFigure.setLayoutManager(layout);
// remove label creation (created by parent figure)
- // fFigureLifelineLabelFigure = new WrappingLabel();
+ // fFigureLifelineLabelFigure = new WrappingLabel();
//
//
//
//
- // fFigureLifelineLabelFigure.setText("<...>");
+ // fFigureLifelineLabelFigure.setText("<...>");
//
//
//
//
- // fFigureLifelineLabelFigure.setTextWrap(true);
+ // fFigureLifelineLabelFigure.setTextWrap(true);
//
//
//
//
- // fFigureLifelineLabelFigure.setAlignment(PositionConstants.CENTER);
+ // fFigureLifelineLabelFigure.setAlignment(PositionConstants.CENTER);
//
//
//
- // fFigureLifelineNameContainerFigure.add(fFigureLifelineLabelFigure);
+ // fFigureLifelineNameContainerFigure.add(fFigureLifelineLabelFigure);
fFigureExecutionsContainerFigure = new RectangleFigure();
fFigureExecutionsContainerFigure.setFill(false);
fFigureExecutionsContainerFigure.setOutline(false);
@@ -219,8 +221,9 @@ public class LifelineFigure extends NodeNamedElementFigure {
@Override
public void setLineWidth(int w) {
- if(w < 0)
+ if (w < 0) {
return;
+ }
super.setLineWidth(w);
fFigureLifelineNameContainerFigure.setLineWidth(w);
fFigureLifelineDotLineFigure.setLineWidth(w);
@@ -228,9 +231,9 @@ public class LifelineFigure extends NodeNamedElementFigure {
@Override
public void setShadow(boolean shadow) {
- if(!shadow)
+ if (!shadow) {
fFigureLifelineNameContainerFigure.setBorder(new MarginBorder(getMapMode().DPtoLP(7), getMapMode().DPtoLP(7), getMapMode().DPtoLP(7), getMapMode().DPtoLP(7)));
- else {
+ } else {
RectangularShadowBorder b = new RectangularShadowBorder(3, getForegroundColor()) {
@Override
@@ -249,13 +252,13 @@ public class LifelineFigure extends NodeNamedElementFigure {
public IFigure findMouseEventTargetAt(int x, int y) {
// check children first instead of self
IFigure f = findMouseEventTargetInDescendantsAt(x, y);
- if(f != null) {
+ if (f != null) {
return f;
}
- if(!containsPoint(x, y)) {
+ if (!containsPoint(x, y)) {
return null;
}
- if(isMouseEventTarget()) {
+ if (isMouseEventTarget()) {
return this;
}
return null;
@@ -263,17 +266,17 @@ public class LifelineFigure extends NodeNamedElementFigure {
@Override
public IFigure findFigureAt(int x, int y, TreeSearch search) {
- if(search.prune(this)) {
+ if (search.prune(this)) {
return null;
}
IFigure child = findDescendantAtExcluding(x, y, search);
- if(child != null) {
+ if (child != null) {
return child;
}
- if(!containsPoint(x, y)) {
+ if (!containsPoint(x, y)) {
return null;
}
- if(search.accept(this)) {
+ if (search.accept(this)) {
return this;
}
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageAsync.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageAsync.java
index 9fa9b22d8bc..152a2280159 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageAsync.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageAsync.java
@@ -9,7 +9,7 @@ public class MessageAsync extends MessageFigure {
/**
* Constructor.
- *
+ *
*/
public MessageAsync() {
super();
@@ -17,13 +17,14 @@ public class MessageAsync extends MessageFigure {
/**
* Constructor.
- *
+ *
* @param mapMode
*/
public MessageAsync(IMapMode mapMode) {
super(mapMode);
}
+ @Override
protected RotatableDecoration createTargetDecoration() {
PolylineDecoration df = new PolylineDecoration();
df.setForegroundColor(getForegroundColor());
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageCreate.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageCreate.java
index 60a854bd74e..d82c038359e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageCreate.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageCreate.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -27,14 +27,14 @@ public class MessageCreate extends MessageFigure {
/**
* Constructor.
- *
+ *
*/
public MessageCreate() {
}
/**
* Constructor.
- *
+ *
* @param mapMode
*/
public MessageCreate(IMapMode mapMode) {
@@ -45,7 +45,7 @@ public class MessageCreate extends MessageFigure {
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.figures.MessageFigure#createTargetDecoration()
- *
+ *
* @return
*/
@Override
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageDelete.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageDelete.java
index 84d7a5f65d8..d53e06483cd 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageDelete.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageDelete.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -26,14 +26,14 @@ public class MessageDelete extends MessageFigure {
/**
* Constructor.
- *
+ *
*/
public MessageDelete() {
}
/**
* Constructor.
- *
+ *
* @param mapMode
*/
public MessageDelete(IMapMode mapMode) {
@@ -43,7 +43,7 @@ public class MessageDelete extends MessageFigure {
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.figures.MessageFigure#createTargetDecoration()
- *
+ *
* @return
*/
@Override
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageFigure.java
index b9d2066c1e8..70862c75908 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageFigure.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -43,7 +43,7 @@ public abstract class MessageFigure extends UMLEdgeFigure {
/**
* Constructor.
- *
+ *
*/
public MessageFigure() {
this(null);
@@ -61,31 +61,33 @@ public abstract class MessageFigure extends UMLEdgeFigure {
setTargetDecoration(createTargetDecoration());
}
+ @Override
public void setLineWidth(int w) {
super.setLineWidth(w);
- if(getSourceDecoration() instanceof Shape) {
- ((Shape)getSourceDecoration()).setLineWidth(w);
+ if (getSourceDecoration() instanceof Shape) {
+ ((Shape) getSourceDecoration()).setLineWidth(w);
}
- if(getTargetDecoration() instanceof Shape) {
- ((Shape)getTargetDecoration()).setLineWidth(w);
+ if (getTargetDecoration() instanceof Shape) {
+ ((Shape) getTargetDecoration()).setLineWidth(w);
}
}
@Override
public void setForegroundColor(Color c) {
super.setForegroundColor(c);
- if(getSourceDecoration() instanceof Shape) {
- ((Shape)getSourceDecoration()).setForegroundColor(c);
- ((Shape)getSourceDecoration()).setBackgroundColor(c);
+ if (getSourceDecoration() instanceof Shape) {
+ ((Shape) getSourceDecoration()).setForegroundColor(c);
+ ((Shape) getSourceDecoration()).setBackgroundColor(c);
}
- if(getTargetDecoration() instanceof Shape) {
- ((Shape)getTargetDecoration()).setForegroundColor(c);
- ((Shape)getTargetDecoration()).setBackgroundColor(c);
+ if (getTargetDecoration() instanceof Shape) {
+ ((Shape) getTargetDecoration()).setForegroundColor(c);
+ ((Shape) getTargetDecoration()).setBackgroundColor(c);
}
}
protected abstract RotatableDecoration createTargetDecoration();
+ @Override
protected void createContents() {
super.createContents();
messageLabelFigure = new WrappingLabel();
@@ -103,7 +105,7 @@ public abstract class MessageFigure extends UMLEdgeFigure {
}
public IMapMode getMapMode() {
- if(mapMode != null) {
+ if (mapMode != null) {
return mapMode;
}
return MapModeUtil.getMapMode();
@@ -118,7 +120,7 @@ public abstract class MessageFigure extends UMLEdgeFigure {
/**
* @param selection
- * the selection to set
+ * the selection to set
*/
public void setSelection(boolean selection) {
this.selection = selection;
@@ -134,12 +136,12 @@ public abstract class MessageFigure extends UMLEdgeFigure {
/**
* @see org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx#getCursor()
- *
+ *
* @return
*/
@Override
public Cursor getCursor() {
- if(customCursor != null) {
+ if (customCursor != null) {
return customCursor;
}
return super.getCursor();
@@ -147,7 +149,7 @@ public abstract class MessageFigure extends UMLEdgeFigure {
/**
* @param customCursor
- * the customCursor to set
+ * the customCursor to set
*/
public void setCustomCursor(Cursor customCursor) {
this.customCursor = customCursor;
@@ -155,7 +157,7 @@ public abstract class MessageFigure extends UMLEdgeFigure {
/**
* @param mapMode
- * the mapMode to set
+ * the mapMode to set
*/
public void setMapMode(IMapMode mapMode) {
this.mapMode = mapMode;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageFound.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageFound.java
index 06456acb6f0..ea0036bb42a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageFound.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageFound.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -27,14 +27,14 @@ public class MessageFound extends MessageFigure {
/**
* Constructor.
- *
+ *
*/
public MessageFound() {
}
/**
* Constructor.
- *
+ *
* @param mapMode
*/
public MessageFound(IMapMode mapMode) {
@@ -52,7 +52,7 @@ public class MessageFound extends MessageFigure {
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.figures.MessageFigure#createTargetDecoration()
- *
+ *
* @return
*/
@Override
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageLost.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageLost.java
index 68e00ea10b7..1640bdda598 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageLost.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageLost.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -29,14 +29,14 @@ public class MessageLost extends MessageFigure {
/**
* Constructor.
- *
+ *
*/
public MessageLost() {
}
/**
* Constructor.
- *
+ *
* @param mapMode
*/
public MessageLost(IMapMode mapMode) {
@@ -46,7 +46,7 @@ public class MessageLost extends MessageFigure {
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.figures.MessageFigure#createTargetDecoration()
- *
+ *
* @return
*/
@Override
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageReply.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageReply.java
index b73fbd4aab7..5661b187f62 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageReply.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageReply.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -27,14 +27,14 @@ public class MessageReply extends MessageFigure {
/**
* Constructor.
- *
+ *
*/
public MessageReply() {
}
/**
* Constructor.
- *
+ *
* @param mapMode
*/
public MessageReply(IMapMode mapMode) {
@@ -45,7 +45,7 @@ public class MessageReply extends MessageFigure {
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.figures.MessageFigure#createTargetDecoration()
- *
+ *
* @return
*/
@Override
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageSync.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageSync.java
index 10af31cf49c..07199d45942 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageSync.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageSync.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -26,14 +26,14 @@ public class MessageSync extends MessageFigure {
/**
* Constructor.
- *
+ *
*/
public MessageSync() {
}
/**
* Constructor.
- *
+ *
* @param mapMode
*/
public MessageSync(IMapMode mapMode) {
@@ -43,7 +43,7 @@ public class MessageSync extends MessageFigure {
/**
* @see org.eclipse.papyrus.uml.diagram.sequence.figures.MessageFigure#createTargetDecoration()
- *
+ *
* @return
*/
@Override
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/StereotypeInteractionFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/StereotypeInteractionFigure.java
index 4d227ca2e7b..3e43399f07c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/StereotypeInteractionFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/StereotypeInteractionFigure.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -34,32 +34,34 @@ import org.eclipse.swt.graphics.Font;
/**
* This figure allows to display Stereotypes(both single stereotype name and stereotype in brace) on top of the name label.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class StereotypeInteractionFigure extends InteractionRectangleFigure {
/**
* Constructor.
- *
+ *
*/
public StereotypeInteractionFigure() {
}
/**
* Display stereotype on top of the name.
- *
+ *
* Return a RectangleFigure has BorderLayout.
*/
+ @Override
protected RectangleFigure createHeader() {
interactionLabel = new WrappingLabel() {
+ @Override
public void setFont(Font f) {
super.setFont(f);
- if(stereotypesLabel != null) {
+ if (stereotypesLabel != null) {
stereotypesLabel.setFont(f);
}
- if(stereotypePropertiesInBraceContent != null) {
+ if (stereotypePropertiesInBraceContent != null) {
stereotypePropertiesInBraceContent.setFont(f);
}
}
@@ -75,19 +77,19 @@ public class StereotypeInteractionFigure extends InteractionRectangleFigure {
int labelWidth = -1;
- for(Object obj : getChildren()) {
- if(obj instanceof Label) {//Stereotype labels
- labelWidth = Math.max(labelWidth, ((Label)obj).getPreferredSize().width);
- } else if(obj instanceof WrappingLabel) {
- WrappingLabel wLabel = (WrappingLabel)obj;
+ for (Object obj : getChildren()) {
+ if (obj instanceof Label) {// Stereotype labels
+ labelWidth = Math.max(labelWidth, ((Label) obj).getPreferredSize().width);
+ } else if (obj instanceof WrappingLabel) {
+ WrappingLabel wLabel = (WrappingLabel) obj;
labelWidth = Math.max(labelWidth, wLabel.getPreferredSize().width);
}
}
// case the size of the label is 0 or -1 (no label)
- if(labelWidth <= 0) {
+ if (labelWidth <= 0) {
labelWidth = r.width / 4;
- } else if(labelWidth > r.width) {
+ } else if (labelWidth > r.width) {
labelWidth = r.width;
}
@@ -133,7 +135,7 @@ public class StereotypeInteractionFigure extends InteractionRectangleFigure {
interactionLabelContainer.add(interactionLabel);
Figure header = new Figure();
- // header.setBorder(new MarginBorder(1, 1, 0, 3));
+ // header.setBorder(new MarginBorder(1, 1, 0, 3));
header.setLayoutManager(new ToolbarLayout(false));
header.add(interactionLabelContainer);
@@ -145,10 +147,11 @@ public class StereotypeInteractionFigure extends InteractionRectangleFigure {
return container;
}
+ @Override
public void setStereotypes(String stereotypes) {
- if(stereotypes == null || stereotypes.trim().equals("")) {
+ if (stereotypes == null || stereotypes.trim().equals("")) {
// Remove label if any
- if(this.stereotypesLabel != null) {
+ if (this.stereotypesLabel != null) {
getStereotypeLabelContainer().remove(this.stereotypesLabel);
this.stereotypesLabel = null;
}
@@ -157,10 +160,11 @@ public class StereotypeInteractionFigure extends InteractionRectangleFigure {
super.setStereotypes(stereotypes);
}
+ @Override
public void setStereotypePropertiesInBrace(String stereotypeProperties) {
- if(stereotypeProperties == null || stereotypeProperties.trim().equals("")) {
+ if (stereotypeProperties == null || stereotypeProperties.trim().equals("")) {
// Remove label if any
- if(this.stereotypePropertiesInBraceContent != null) {
+ if (this.stereotypePropertiesInBraceContent != null) {
getStereotypePropertiesInBraceLabelContainer().remove(this.stereotypePropertiesInBraceContent);
this.stereotypePropertiesInBraceContent = null;
}
@@ -169,10 +173,12 @@ public class StereotypeInteractionFigure extends InteractionRectangleFigure {
super.setStereotypePropertiesInBrace(stereotypeProperties);
}
+ @Override
protected IFigure getStereotypeLabelContainer() {
return interactionLabelContainer;
}
+ @Override
protected IFigure getStereotypePropertiesInBraceLabelContainer() {
return interactionLabelContainer;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/handlers/CustomAlignmentHandler.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/handlers/CustomAlignmentHandler.java
index 2495fab8af2..30603acefb4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/handlers/CustomAlignmentHandler.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/handlers/CustomAlignmentHandler.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -24,14 +24,14 @@ public class CustomAlignmentHandler extends AlignementHandler {
/**
* Constructor.
- *
+ *
*/
public CustomAlignmentHandler() {
}
/**
* @see org.eclipse.papyrus.uml.diagram.menu.actions.handlers.AlignementHandler#getCommand()
- *
+ *
* @return
* @throws ExecutionException
*/
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/handlers/CustomSizeHandler.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/handlers/CustomSizeHandler.java
index fdfa473867d..2b697beeed1 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/handlers/CustomSizeHandler.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/handlers/CustomSizeHandler.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -41,14 +41,14 @@ public class CustomSizeHandler extends SizeHandler {
/**
* Constructor.
- *
+ *
*/
public CustomSizeHandler() {
}
/**
* @see org.eclipse.papyrus.uml.diagram.menu.actions.handlers.SizeHandler#getCommand()
- *
+ *
* @return
* @throws ExecutionException
*/
@@ -64,7 +64,7 @@ public class CustomSizeHandler extends SizeHandler {
/**
* Constructor.
- *
+ *
* @param parameter
* @param selectedElements
*/
@@ -74,13 +74,13 @@ public class CustomSizeHandler extends SizeHandler {
/**
* Return the command for the Same Height Action
- *
+ *
* @return
* Return the command for the Same Height Action
*/
@Override
protected Command getHeightCommand() {
- if(!(this.selectedElements.size() > 1)) {
+ if (!(this.selectedElements.size() > 1)) {
return UnexecutableCommand.INSTANCE;
} else {
// Create a compound command to hold the resize commands
@@ -89,23 +89,23 @@ public class CustomSizeHandler extends SizeHandler {
Iterator<IGraphicalEditPart> iter = selectedElements.iterator();
// Get the Primary Selection
Dimension primarySize = getPrimarySize();
- while(iter.hasNext()) {
+ while (iter.hasNext()) {
// For each figure in the selection (to be resize) a request is created for resize to new bounds in the south-east direction.
// The command for this resize is contributed by the edit part for the resize request.
IGraphicalEditPart toResize = iter.next();
- View resizeView = (View)toResize.getModel();
- Integer previousWidth = (Integer)ViewUtil.getStructuralFeatureValue(resizeView, NotationPackage.eINSTANCE.getSize_Width());
- Integer previousHeight = (Integer)ViewUtil.getStructuralFeatureValue(resizeView, NotationPackage.eINSTANCE.getSize_Height());
+ View resizeView = (View) toResize.getModel();
+ Integer previousWidth = (Integer) ViewUtil.getStructuralFeatureValue(resizeView, NotationPackage.eINSTANCE.getSize_Width());
+ Integer previousHeight = (Integer) ViewUtil.getStructuralFeatureValue(resizeView, NotationPackage.eINSTANCE.getSize_Height());
Dimension previousSize;
- if(previousWidth.intValue() == -1 || previousHeight.intValue() == -1) {
+ if (previousWidth.intValue() == -1 || previousHeight.intValue() == -1) {
previousSize = toResize.getFigure().getSize().getCopy();
} else {
previousSize = new Dimension(previousWidth.intValue(), previousHeight.intValue());
}
// Calculate delta resize
Dimension delta = new Dimension(0, primarySize.height - previousSize.height);
- if(isLifelines()) {
- //Align all Lifelines at bottom.
+ if (isLifelines()) {
+ // Align all Lifelines at bottom.
Rectangle constraint = getLifelineConstraint();
Rectangle previousRect = SequenceUtil.getAbsoluteBounds(toResize);
delta.height = constraint.bottom() - previousRect.bottom();
@@ -114,7 +114,7 @@ public class CustomSizeHandler extends SizeHandler {
ChangeBoundsRequest bRequest = new ChangeBoundsRequest();
bRequest.setResizeDirection(PositionConstants.SOUTH);
bRequest.setSizeDelta(delta);
- bRequest.setType(RequestConstants.REQ_RESIZE);
+ bRequest.setType(org.eclipse.gef.RequestConstants.REQ_RESIZE);
Command resizeCommand = toResize.getCommand(bRequest);
// Previous implementation (following line) forced bounds on view instead of using resize command provided by the edit part.
//
@@ -128,7 +128,7 @@ public class CustomSizeHandler extends SizeHandler {
}
protected Dimension getPrimarySize() {
- if(selectedElements.isEmpty()) {
+ if (selectedElements.isEmpty()) {
return null;
}
// Get the Primary Selection
@@ -138,11 +138,11 @@ public class CustomSizeHandler extends SizeHandler {
}
private boolean isLifelines() {
- if(selectedElements.isEmpty()) {
+ if (selectedElements.isEmpty()) {
return true;
}
boolean isLifelines = true;
- for(int i = 0; i < selectedElements.size(); i++) {
+ for (int i = 0; i < selectedElements.size(); i++) {
isLifelines &= selectedElements.get(i) instanceof LifelineEditPart;
}
return isLifelines;
@@ -150,8 +150,8 @@ public class CustomSizeHandler extends SizeHandler {
protected Rectangle getLifelineConstraint() {
Rectangle constraint = new Rectangle();
- for(int i = 0; i < selectedElements.size(); i++) {
- LifelineEditPart lifelineEditPart = (LifelineEditPart)selectedElements.get(i);
+ for (int i = 0; i < selectedElements.size(); i++) {
+ LifelineEditPart lifelineEditPart = (LifelineEditPart) selectedElements.get(i);
Rectangle rect = SequenceUtil.getAbsoluteBounds(lifelineEditPart);
constraint.union(rect);
}
@@ -159,11 +159,11 @@ public class CustomSizeHandler extends SizeHandler {
}
protected Dimension getPrimarySize(IGraphicalEditPart primaryChild) {
- View primaryView = (View)primaryChild.getModel();
- Integer width = (Integer)ViewUtil.getStructuralFeatureValue(primaryView, NotationPackage.eINSTANCE.getSize_Width());
- Integer height = (Integer)ViewUtil.getStructuralFeatureValue(primaryView, NotationPackage.eINSTANCE.getSize_Height());
+ View primaryView = (View) primaryChild.getModel();
+ Integer width = (Integer) ViewUtil.getStructuralFeatureValue(primaryView, NotationPackage.eINSTANCE.getSize_Width());
+ Integer height = (Integer) ViewUtil.getStructuralFeatureValue(primaryView, NotationPackage.eINSTANCE.getSize_Height());
Dimension primarySize;
- if(width.intValue() == -1 || height.intValue() == -1) {
+ if (width.intValue() == -1 || height.intValue() == -1) {
primarySize = primaryChild.getFigure().getSize().getCopy();
} else {
primarySize = new Dimension(width.intValue(), height.intValue());
@@ -173,13 +173,13 @@ public class CustomSizeHandler extends SizeHandler {
/**
* Return the command for the Same Width Action
- *
+ *
* @return
* the command for the Same Width Action
*/
@Override
protected Command getWidthCommand() {
- if(!(this.selectedElements.size() > 1)) {
+ if (!(this.selectedElements.size() > 1)) {
return UnexecutableCommand.INSTANCE;
} else {
// Create a compound command to hold the resize commands
@@ -188,15 +188,15 @@ public class CustomSizeHandler extends SizeHandler {
Iterator<IGraphicalEditPart> iter = selectedElements.iterator();
// Get the Primary Selection
Dimension primarySize = getPrimarySize();
- while(iter.hasNext()) {
+ while (iter.hasNext()) {
// For each figure in the selection (to be resize) a request is created for resize to new bounds in the south-east direction.
// The command for this resize is contributed by the edit part for the resize request.
IGraphicalEditPart toResize = iter.next();
- View resizeView = (View)toResize.getModel();
- Integer previousWidth = (Integer)ViewUtil.getStructuralFeatureValue(resizeView, NotationPackage.eINSTANCE.getSize_Width());
- Integer previousHeight = (Integer)ViewUtil.getStructuralFeatureValue(resizeView, NotationPackage.eINSTANCE.getSize_Height());
+ View resizeView = (View) toResize.getModel();
+ Integer previousWidth = (Integer) ViewUtil.getStructuralFeatureValue(resizeView, NotationPackage.eINSTANCE.getSize_Width());
+ Integer previousHeight = (Integer) ViewUtil.getStructuralFeatureValue(resizeView, NotationPackage.eINSTANCE.getSize_Height());
Dimension previousSize;
- if(previousWidth.intValue() == -1 || previousHeight.intValue() == -1) {
+ if (previousWidth.intValue() == -1 || previousHeight.intValue() == -1) {
previousSize = toResize.getFigure().getSize().getCopy();
} else {
previousSize = new Dimension(previousWidth.intValue(), previousHeight.intValue());
@@ -207,7 +207,7 @@ public class CustomSizeHandler extends SizeHandler {
ChangeBoundsRequest bRequest = new ChangeBoundsRequest();
bRequest.setResizeDirection(PositionConstants.EAST);
bRequest.setSizeDelta(delta);
- bRequest.setType(RequestConstants.REQ_RESIZE);
+ bRequest.setType(org.eclipse.gef.RequestConstants.REQ_RESIZE);
Command resizeCommand = toResize.getCommand(bRequest);
// Previous implementation (following line) forced bounds on view instead of using resize command provided by the edit part.
//
@@ -222,12 +222,12 @@ public class CustomSizeHandler extends SizeHandler {
/**
* @see org.eclipse.papyrus.uml.diagram.menu.actions.SizeAction#getBothCommand()
- *
+ *
* @return
*/
@Override
protected Command getBothCommand() {
- if(!(this.selectedElements.size() > 1)) {
+ if (!(this.selectedElements.size() > 1)) {
return UnexecutableCommand.INSTANCE;
} else {
// Create a compound command to hold the resize commands
@@ -239,29 +239,29 @@ public class CustomSizeHandler extends SizeHandler {
// Get the Primary Selection
int last = selectedElements.size() - 1;
IGraphicalEditPart primary = selectedElements.get(last);
- View primaryView = (View)primary.getModel();
- Integer width = (Integer)ViewUtil.getStructuralFeatureValue(primaryView, NotationPackage.eINSTANCE.getSize_Width());
- Integer height = (Integer)ViewUtil.getStructuralFeatureValue(primaryView, NotationPackage.eINSTANCE.getSize_Height());
+ View primaryView = (View) primary.getModel();
+ Integer width = (Integer) ViewUtil.getStructuralFeatureValue(primaryView, NotationPackage.eINSTANCE.getSize_Width());
+ Integer height = (Integer) ViewUtil.getStructuralFeatureValue(primaryView, NotationPackage.eINSTANCE.getSize_Height());
Dimension primarySize;
- if(width.intValue() == -1 || height.intValue() == -1) {
+ if (width.intValue() == -1 || height.intValue() == -1) {
primarySize = primary.getFigure().getSize().getCopy();
} else {
primarySize = new Dimension(width.intValue(), height.intValue());
}
- while(iter.hasNext()) {
+ while (iter.hasNext()) {
// For each figure in the selection (to be resize) a request is created for resize to new bounds in the south-east direction.
// The command for this resize is contributed by the edit part for the resize request.
IGraphicalEditPart toResize = iter.next();
- View resizeView = (View)toResize.getModel();
- Integer previousWidth = (Integer)ViewUtil.getStructuralFeatureValue(resizeView, NotationPackage.eINSTANCE.getSize_Width());
- Integer previousHeight = (Integer)ViewUtil.getStructuralFeatureValue(resizeView, NotationPackage.eINSTANCE.getSize_Height());
+ View resizeView = (View) toResize.getModel();
+ Integer previousWidth = (Integer) ViewUtil.getStructuralFeatureValue(resizeView, NotationPackage.eINSTANCE.getSize_Width());
+ Integer previousHeight = (Integer) ViewUtil.getStructuralFeatureValue(resizeView, NotationPackage.eINSTANCE.getSize_Height());
Dimension previousSize;
- if(previousWidth.intValue() == -1 || previousHeight.intValue() == -1) {
+ if (previousWidth.intValue() == -1 || previousHeight.intValue() == -1) {
previousSize = toResize.getFigure().getSize().getCopy();
} else {
previousSize = new Dimension(previousWidth.intValue(), previousHeight.intValue());
@@ -269,8 +269,8 @@ public class CustomSizeHandler extends SizeHandler {
// Calculate delta resize
Dimension delta = new Dimension(primarySize.width - previousSize.width, primarySize.height - previousSize.height);
- if(isLifelines()) {
- //Align all Lifelines at bottom.
+ if (isLifelines()) {
+ // Align all Lifelines at bottom.
Rectangle constraint = getLifelineConstraint();
Rectangle previousRect = SequenceUtil.getAbsoluteBounds(toResize);
delta.height = constraint.bottom() - previousRect.bottom();
@@ -279,7 +279,7 @@ public class CustomSizeHandler extends SizeHandler {
ChangeBoundsRequest bRequest = new ChangeBoundsRequest();
bRequest.setResizeDirection(PositionConstants.SOUTH_EAST);
bRequest.setSizeDelta(delta);
- bRequest.setType(RequestConstants.REQ_RESIZE);
+ bRequest.setType(org.eclipse.gef.RequestConstants.REQ_RESIZE);
Command resizeCommand = toResize.getCommand(bRequest);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/CellEditorLocators.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/CellEditorLocators.java
index 4e783da3e91..4acbd82e3a2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/CellEditorLocators.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/CellEditorLocators.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -26,18 +26,18 @@ import org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigu
public class CellEditorLocators {
public static CellEditorLocator getTextCellEditorLocator(ITextAwareEditPart source) {
- if(source.getFigure() instanceof IMultilineEditableFigure)
- return new MultilineCellEditorLocator((IMultilineEditableFigure)source.getFigure());
- else if(source.getFigure() instanceof WrappingLabel)
- return new TextCellEditorLocator((WrappingLabel)source.getFigure());
- else if(source.getFigure() instanceof NodeFigure) {
- WrappingLabel wrappingLabel = (WrappingLabel)source.getFigure().getChildren().get(0);
- if(wrappingLabel != null) {
+ if (source.getFigure() instanceof IMultilineEditableFigure) {
+ return new MultilineCellEditorLocator((IMultilineEditableFigure) source.getFigure());
+ } else if (source.getFigure() instanceof WrappingLabel) {
+ return new TextCellEditorLocator((WrappingLabel) source.getFigure());
+ } else if (source.getFigure() instanceof NodeFigure) {
+ WrappingLabel wrappingLabel = (WrappingLabel) source.getFigure().getChildren().get(0);
+ if (wrappingLabel != null) {
return new TextCellEditorLocator(wrappingLabel);
}
- return new LabelCellEditorLocator((Label)source.getFigure());
+ return new LabelCellEditorLocator((Label) source.getFigure());
} else {
- return new LabelCellEditorLocator((Label)source.getFigure());
+ return new LabelCellEditorLocator((Label) source.getFigure());
}
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/CenterLocator.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/CenterLocator.java
index 312ec2aa7d6..2251aaa8133 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/CenterLocator.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/CenterLocator.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -38,18 +38,18 @@ public class CenterLocator extends BorderItemLocator {
/**
* The DestructionEventFigure.
- *
+ *
* It must be access through the method {@link #getDestructionEventFigure()}
*/
private DestructionEventFigure destructionEventFigure = null;
/**
* Constructor
- *
+ *
* @param parentFigure
- * the parent figure
+ * the parent figure
* @param location
- * ContinuationLocator.TOP or ContinuationLocator.BOTTOM
+ * ContinuationLocator.TOP or ContinuationLocator.BOTTOM
*/
public CenterLocator(IFigure parentFigure, int location) {
super(parentFigure, location);
@@ -57,14 +57,14 @@ public class CenterLocator extends BorderItemLocator {
/**
* Get the LifelineDotLineFigure
- *
+ *
* @return the lifelineDotLineFigure or null
*/
private LifelineDotLineCustomFigure getLifelineDotLineFigure() {
- if(lifelineDotLineFigure == null) {
- for(Object childFig : getParentFigure().getChildren()) {
- if(childFig instanceof LifelineFigure) {
- lifelineDotLineFigure = ((LifelineFigure)childFig).getFigureLifelineDotLineFigure();
+ if (lifelineDotLineFigure == null) {
+ for (Object childFig : getParentFigure().getChildren()) {
+ if (childFig instanceof LifelineFigure) {
+ lifelineDotLineFigure = ((LifelineFigure) childFig).getFigureLifelineDotLineFigure();
return lifelineDotLineFigure;
}
}
@@ -74,15 +74,15 @@ public class CenterLocator extends BorderItemLocator {
/**
* Get the BorderItemContainerFigure
- *
+ *
* @return the borderItemContainerFigure or null
*/
private BorderItemContainerFigure getBorderItemContainerFigure() {
- if(borderItemContainerFigure == null) {
+ if (borderItemContainerFigure == null) {
IFigure figure = getParentFigure().getParent();
- for(Object object : figure.getChildren()) {
- if(object instanceof BorderItemContainerFigure) {
- borderItemContainerFigure = (BorderItemContainerFigure)object;
+ for (Object object : figure.getChildren()) {
+ if (object instanceof BorderItemContainerFigure) {
+ borderItemContainerFigure = (BorderItemContainerFigure) object;
return borderItemContainerFigure;
}
}
@@ -92,18 +92,18 @@ public class CenterLocator extends BorderItemLocator {
/**
* Get the DestructionEventFigure of the lifeline, if it is drawn.
- *
+ *
* @return the DestructionEventFigure or null
*/
private DestructionEventFigure getDestructionEventFigure() {
- if(destructionEventFigure == null) {
+ if (destructionEventFigure == null) {
BorderItemContainerFigure borderItemContainerFigure = getBorderItemContainerFigure();
- if(borderItemContainerFigure != null) {
- for(Object child : borderItemContainerFigure.getChildren()) {
- if(child instanceof DefaultSizeNodeFigure) {
- for(Object figure : ((DefaultSizeNodeFigure)child).getChildren()) {
- if(figure instanceof DestructionEventFigure) {
- destructionEventFigure = (DestructionEventFigure)figure;
+ if (borderItemContainerFigure != null) {
+ for (Object child : borderItemContainerFigure.getChildren()) {
+ if (child instanceof DefaultSizeNodeFigure) {
+ for (Object figure : ((DefaultSizeNodeFigure) child).getChildren()) {
+ if (figure instanceof DestructionEventFigure) {
+ destructionEventFigure = (DestructionEventFigure) figure;
return destructionEventFigure;
}
}
@@ -117,13 +117,13 @@ public class CenterLocator extends BorderItemLocator {
/**
* Overrides :
* - the destructionEventFigure is always drawn at the end of the figure
- *
+ *
* @see org.eclipse.draw2d.Locator#relocate(org.eclipse.draw2d.IFigure)
*/
@Override
public void relocate(IFigure borderItem) {
- if(getDestructionEventFigure() != null) {
- if(borderItem.equals(getDestructionEventFigure().getParent())) {
+ if (getDestructionEventFigure() != null) {
+ if (borderItem.equals(getDestructionEventFigure().getParent())) {
borderItem.setLocation(new Point(getHorizontalPosition(borderItem), getParentBorder().y + getParentBorder().height - borderItem.getBounds().height / 2));
return;
}
@@ -133,8 +133,8 @@ public class CenterLocator extends BorderItemLocator {
@Override
public Rectangle getValidLocation(Rectangle proposedLocation, IFigure borderItem) {
- if(getDestructionEventFigure() != null) {
- if(borderItem.equals(getDestructionEventFigure().getParent())) {
+ if (getDestructionEventFigure() != null) {
+ if (borderItem.equals(getDestructionEventFigure().getParent())) {
Rectangle realLocation = new Rectangle(proposedLocation);
Point point = new Point(getParentBorder().getCenter().x - realLocation.getSize().width / 2, getParentBorder().y + getParentBorder().height - realLocation.height / 2);
realLocation.setLocation(point);
@@ -146,12 +146,12 @@ public class CenterLocator extends BorderItemLocator {
/**
* Get the parent dotLine border
- *
+ *
* @return <code>Rectangle</code> that is the bounds of the parent dot line.
*/
protected Rectangle getParentDotLineBorder() {
LifelineDotLineCustomFigure dotline = getLifelineDotLineFigure();
- if(dotline != null) {
+ if (dotline != null) {
return dotline.getBounds().getCopy();
}
return super.getParentBorder();
@@ -159,7 +159,7 @@ public class CenterLocator extends BorderItemLocator {
/**
* Locate the figure on its parent
- *
+ *
* @param suggestedLocation
* @param suggestedSide
* @return point
@@ -174,20 +174,20 @@ public class CenterLocator extends BorderItemLocator {
/**
* Get the vertical position of the itemBorder
- *
+ *
* @param y
- * the suggested location
+ * the suggested location
* @param height
- * the border item height
+ * the border item height
* @return the vertical position of the item border on the lifeline
*/
private int getVerticalPosition(int y, int height) {
int validY = y;
Rectangle parentDotLineBorder = getParentDotLineBorder();
int maxY = parentDotLineBorder.y + parentDotLineBorder.height - getSouthInsets();
- if(y + height > maxY) {
+ if (y + height > maxY) {
validY = maxY - height;
- } else if(y < parentDotLineBorder.y) {
+ } else if (y < parentDotLineBorder.y) {
validY = parentDotLineBorder.y;
}
return validY;
@@ -196,9 +196,9 @@ public class CenterLocator extends BorderItemLocator {
/**
* Get the horizontal position of the borderItem drawn on a lifeline.
* Those elements are drawn at the center of the lifeline, ie on the dot line.
- *
+ *
* @param borderItem
- * the borderItem
+ * the borderItem
* @return the horizontal position of the border item
*/
private int getHorizontalPosition(IFigure borderItem) {
@@ -208,12 +208,12 @@ public class CenterLocator extends BorderItemLocator {
/**
* Get the insets to use at the bottom of the figure.
* It is used to prevent others borderItems to be drawn on or below the destructionEventFigure
- *
+ *
* @return If a destructionEventFigure is drawn, it returns the height of its figure, otherwise it returns 0
*/
private int getSouthInsets() {
DestructionEventFigure destructionEventFigure = getDestructionEventFigure();
- if(destructionEventFigure != null) {
+ if (destructionEventFigure != null) {
return destructionEventFigure.getBounds().height;
}
return 0;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/ContinuationLocator.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/ContinuationLocator.java
index 09d8da04f98..4f9cfe9677c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/ContinuationLocator.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/ContinuationLocator.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -23,7 +23,7 @@ import org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator;
/**
* A specific locator for Continuation.
* This locator is in charge of positioning the continuation at the top or the bottom of its container.
- *
+ *
*/
public class ContinuationLocator extends BorderItemLocator {
@@ -31,11 +31,11 @@ public class ContinuationLocator extends BorderItemLocator {
/**
* Constructor
- *
+ *
* @param parentFigure
- * the parent figure
+ * the parent figure
* @param location
- * ContinuationLocator.TOP or ContinuationLocator.BOTTOM
+ * ContinuationLocator.TOP or ContinuationLocator.BOTTOM
*/
public ContinuationLocator(IFigure parentFigure, int location) {
super(parentFigure, location);
@@ -43,7 +43,7 @@ public class ContinuationLocator extends BorderItemLocator {
/**
* Locate the figure on its parent
- *
+ *
* @param suggestedLocation
* @param suggestedSide
* @return point
@@ -52,7 +52,7 @@ public class ContinuationLocator extends BorderItemLocator {
protected Point locateOnParent(Point suggestedLocation, int suggestedSide, IFigure borderItem) {
Rectangle bounds = getParentBorder();
Dimension borderItemSize = getSize(borderItem);
- if(getPreferredSideOfParent() == PositionConstants.SOUTH) {
+ if (getPreferredSideOfParent() == PositionConstants.SOUTH) {
return new Point(bounds.x + MARGIN, bounds.y + bounds.height - borderItemSize.height - MARGIN);
}
return new Point(bounds.x + MARGIN, bounds.y + MARGIN);
@@ -62,7 +62,7 @@ public class ContinuationLocator extends BorderItemLocator {
* Overrides :
* - the width of the borderItem is equivalent to its parentBorder width - MARGIN * 2
* - the CurrentSide and PreferredSide are no more needed.
- *
+ *
* @see org.eclipse.draw2d.Locator#relocate(org.eclipse.draw2d.IFigure)
*/
@Override
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/GateLocator.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/GateLocator.java
index 8b96e32b20e..5acf9858596 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/GateLocator.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/GateLocator.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -36,7 +36,7 @@ public class GateLocator extends AdvancedBorderItemLocator {
/**
* Constructor.
- *
+ *
* @param parentFigure
*/
public GateLocator(IFigure parentFigure) {
@@ -49,9 +49,8 @@ public class GateLocator extends AdvancedBorderItemLocator {
}
/**
- * @see org.eclipse.papyrus.uml.diagram.common.locator.AdvancedBorderItemLocator#getValidLocation(org.eclipse.draw2d.geometry.Rectangle,
- * org.eclipse.draw2d.IFigure)
- *
+ * @see org.eclipse.papyrus.uml.diagram.common.locator.AdvancedBorderItemLocator#getValidLocation(org.eclipse.draw2d.geometry.Rectangle, org.eclipse.draw2d.IFigure)
+ *
* @param proposedLocation
* @param borderItem
* @return
@@ -60,34 +59,34 @@ public class GateLocator extends AdvancedBorderItemLocator {
public Rectangle getValidLocation(Rectangle proposedLocation, IFigure borderItem) {
Rectangle validLocation = proposedLocation.getCopy();
Rectangle bounds = getParentBorder();
- //Enable to locate the Gate on top/bottom.
+ // Enable to locate the Gate on top/bottom.
int alignment = getAlignment(proposedLocation);
- if(PositionConstants.LEFT == alignment) {
+ if (PositionConstants.LEFT == alignment) {
validLocation.x = bounds.x - proposedLocation.width / 2;
- if(validLocation.y < (bounds.y - proposedLocation.height / 2)) {
+ if (validLocation.y < (bounds.y - proposedLocation.height / 2)) {
validLocation.y = (bounds.y - proposedLocation.height / 2);
- } else if(validLocation.y > (bounds.bottom() - proposedLocation.height / 2)) {
+ } else if (validLocation.y > (bounds.bottom() - proposedLocation.height / 2)) {
validLocation.y = (bounds.bottom() - proposedLocation.height / 2);
}
- } else if(PositionConstants.RIGHT == alignment) {
+ } else if (PositionConstants.RIGHT == alignment) {
validLocation.x = bounds.right() - proposedLocation.width / 2;
- if(validLocation.y < (bounds.y - proposedLocation.height / 2)) {
+ if (validLocation.y < (bounds.y - proposedLocation.height / 2)) {
validLocation.y = (bounds.y - proposedLocation.height / 2);
- } else if(validLocation.y > (bounds.bottom() - proposedLocation.height / 2)) {
+ } else if (validLocation.y > (bounds.bottom() - proposedLocation.height / 2)) {
validLocation.y = (bounds.bottom() - proposedLocation.height / 2);
}
- } else if(PositionConstants.TOP == alignment) {
+ } else if (PositionConstants.TOP == alignment) {
validLocation.y = (bounds.y - proposedLocation.height / 2);
- if(validLocation.x < (bounds.x - proposedLocation.width / 2)) {
+ if (validLocation.x < (bounds.x - proposedLocation.width / 2)) {
validLocation.x = (bounds.x - proposedLocation.width / 2);
- } else if(validLocation.x > (bounds.right() - proposedLocation.width / 2)) {
+ } else if (validLocation.x > (bounds.right() - proposedLocation.width / 2)) {
validLocation.x = (bounds.right() - proposedLocation.width / 2);
}
} else {
validLocation.y = (bounds.bottom() - proposedLocation.height / 2);
- if(validLocation.x < (bounds.x - proposedLocation.width / 2)) {
+ if (validLocation.x < (bounds.x - proposedLocation.width / 2)) {
validLocation.x = (bounds.x - proposedLocation.width / 2);
- } else if(validLocation.x > (bounds.right() - proposedLocation.width / 2)) {
+ } else if (validLocation.x > (bounds.right() - proposedLocation.width / 2)) {
validLocation.x = (bounds.right() - proposedLocation.width / 2);
}
}
@@ -99,38 +98,38 @@ public class GateLocator extends AdvancedBorderItemLocator {
}
public int getAlignment(Rectangle newConstraint) {
- if(alignment != null) {
+ if (alignment != null) {
Rectangle modelConstraint = getModelConstraint();
- if(modelConstraint != null && modelConstraint.equals(newConstraint)) {
+ if (modelConstraint != null && modelConstraint.equals(newConstraint)) {
return alignment.intValue();
}
}
Rectangle parentBounds = getParentBorder();
- if(parentBounds.isEmpty()) {
+ if (parentBounds.isEmpty()) {
return PositionConstants.NONE;
}
- if(parentBounds.touches(newConstraint)) {
+ if (parentBounds.touches(newConstraint)) {
Point center = newConstraint.getCenter();
int leftOffset = Math.abs(center.x - parentBounds.x);
int rightOffset = Math.abs(center.x - parentBounds.right());
int topOffset = Math.abs(center.y - parentBounds.y);
int bottomOffset = Math.abs(center.y - parentBounds.bottom());
int minOffset = Math.min(Math.min(leftOffset, rightOffset), Math.min(topOffset, bottomOffset));
- if(minOffset == leftOffset) {
+ if (minOffset == leftOffset) {
alignment = PositionConstants.LEFT;
- } else if(minOffset == rightOffset) {
+ } else if (minOffset == rightOffset) {
alignment = PositionConstants.RIGHT;
- } else if(minOffset == topOffset) {
+ } else if (minOffset == topOffset) {
alignment = PositionConstants.TOP;
} else {
alignment = PositionConstants.BOTTOM;
}
} else {
- if(newConstraint.x > parentBounds.x && newConstraint.bottom() < parentBounds.y && newConstraint.right() < parentBounds.right()) {
+ if (newConstraint.x > parentBounds.x && newConstraint.bottom() < parentBounds.y && newConstraint.right() < parentBounds.right()) {
alignment = PositionConstants.TOP;
- } else if(newConstraint.x > parentBounds.x && newConstraint.y > parentBounds.bottom() && newConstraint.right() < parentBounds.right()) {
+ } else if (newConstraint.x > parentBounds.x && newConstraint.y > parentBounds.bottom() && newConstraint.right() < parentBounds.right()) {
alignment = PositionConstants.BOTTOM;
- } else if(newConstraint.right() < parentBounds.x) {
+ } else if (newConstraint.right() < parentBounds.x) {
alignment = PositionConstants.LEFT;
} else {
alignment = PositionConstants.RIGHT;
@@ -141,17 +140,17 @@ public class GateLocator extends AdvancedBorderItemLocator {
/**
* @see org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator#getParentBorder()
- *
+ *
* @return
*/
@Override
protected Rectangle getParentBorder() {
Rectangle parentBorder = super.getParentBorder();
- if(parentBorder.isEmpty() && gateEditPart != null) {
- //This can be only used when the diagram is opening.
+ if (parentBorder.isEmpty() && gateEditPart != null) {
+ // This can be only used when the diagram is opening.
EditPart parent = gateEditPart.getParent();
- if(parent instanceof IGraphicalEditPart) {
- return SequenceUtil.getAbsoluteBounds((IGraphicalEditPart)parent);
+ if (parent instanceof IGraphicalEditPart) {
+ return SequenceUtil.getAbsoluteBounds((IGraphicalEditPart) parent);
}
}
return parentBorder;
@@ -159,7 +158,7 @@ public class GateLocator extends AdvancedBorderItemLocator {
/**
* @see org.eclipse.papyrus.uml.diagram.common.locator.AdvancedBorderItemLocator#relocate(org.eclipse.draw2d.IFigure)
- *
+ *
* @param borderItem
*/
@Override
@@ -173,12 +172,12 @@ public class GateLocator extends AdvancedBorderItemLocator {
/**
* @see org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator#getConstraint()
- *
+ *
* @return
*/
@Override
public Rectangle getConstraint() {
- if(gateEditPart != null) {
+ if (gateEditPart != null) {
return getModelConstraint();
}
return super.getConstraint();
@@ -188,9 +187,9 @@ public class GateLocator extends AdvancedBorderItemLocator {
* @return
*/
protected Rectangle getModelConstraint() {
- //Ensure the constraint is same as the model.
- int x = ((Integer)gateEditPart.getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)gateEditPart.getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ // Ensure the constraint is same as the model.
+ int x = ((Integer) gateEditPart.getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) gateEditPart.getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Rectangle constraint = new Rectangle(x, y, GateEditPart.DEFAULT_SIZE.width, GateEditPart.DEFAULT_SIZE.height);
return constraint;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/LabelCellEditorLocator.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/LabelCellEditorLocator.java
index 05c3246fddf..de0dc484094 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/LabelCellEditorLocator.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/LabelCellEditorLocator.java
@@ -33,15 +33,16 @@ public class LabelCellEditorLocator implements CellEditorLocator {
/**
* @generated
*/
+ @Override
public void relocate(CellEditor celleditor) {
- Text text = (Text)celleditor.getControl();
+ Text text = (Text) celleditor.getControl();
Rectangle rect = getLabel().getTextBounds().getCopy();
getLabel().translateToAbsolute(rect);
- if(!text.getFont().isDisposed()) {
+ if (!text.getFont().isDisposed()) {
int avr = FigureUtilities.getFontMetrics(text.getFont()).getAverageCharWidth();
rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT, SWT.DEFAULT)).expand(avr * 2, 0));
}
- if(!rect.equals(new Rectangle(text.getBounds()))) {
+ if (!rect.equals(new Rectangle(text.getBounds()))) {
text.setBounds(rect.x, rect.y, rect.width, rect.height);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/MultilineCellEditorLocator.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/MultilineCellEditorLocator.java
index c9d691a15cd..e0f01471802 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/MultilineCellEditorLocator.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/MultilineCellEditorLocator.java
@@ -32,16 +32,17 @@ public class MultilineCellEditorLocator implements CellEditorLocator {
/**
* @generated
*/
+ @Override
public void relocate(CellEditor celleditor) {
- Text text = (Text)celleditor.getControl();
+ Text text = (Text) celleditor.getControl();
Rectangle rect = getMultilineEditableFigure().getBounds().getCopy();
rect.x = getMultilineEditableFigure().getEditionLocation().x;
rect.y = getMultilineEditableFigure().getEditionLocation().y;
getMultilineEditableFigure().translateToAbsolute(rect);
- if(getMultilineEditableFigure().getText().length() > 0) {
+ if (getMultilineEditableFigure().getText().length() > 0) {
rect.setSize(new Dimension(text.computeSize(rect.width, SWT.DEFAULT)));
}
- if(!rect.equals(new Rectangle(text.getBounds()))) {
+ if (!rect.equals(new Rectangle(text.getBounds()))) {
text.setBounds(rect.x, rect.y, rect.width, rect.height);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/SelfMessageLabelLocator.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/SelfMessageLabelLocator.java
index 601d5292014..deed43b9b43 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/SelfMessageLabelLocator.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/SelfMessageLabelLocator.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -27,7 +27,7 @@ import org.eclipse.gmf.runtime.draw2d.ui.geometry.PointListUtilities;
/**
* New label locator for self linked message, the label would be located outside of the bounds of message by default.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class SelfMessageLabelLocator extends LabelLocator {
@@ -42,22 +42,22 @@ public class SelfMessageLabelLocator extends LabelLocator {
public void relocate(IFigure target) {
Dimension size = target.getPreferredSize();
boolean relocated = false;
- PointList points = ((Connection)parent).getPoints();
+ PointList points = ((Connection) parent).getPoints();
List lineSegments = PointListUtilities.getLineSegments(points);
- if(lineSegments.size() == 3) {
+ if (lineSegments.size() == 3) {
Point start = points.getFirstPoint();
- LineSeg center = (LineSeg)lineSegments.get(1);
- if(center.isVertical()) {
+ LineSeg center = (LineSeg) lineSegments.get(1);
+ if (center.isVertical()) {
Point origin = center.getOrigin();
Point terminus = center.getTerminus();
Point loc = new Point(origin.x, -1);
- if(origin.x < terminus.x) {
+ if (origin.x < terminus.x) {
loc.y = origin.y + ((terminus.y - origin.y) / 2);
} else {
loc.y = terminus.y + ((origin.y - terminus.y) / 2);
}
Rectangle rect = new Rectangle(loc, size);
- if(start.x < loc.x) {
+ if (start.x < loc.x) {
rect.translate(H_MARGIN, -1 * size.height / 2);
} else {
rect.translate(-H_MARGIN - size.width, -1 * size.height / 2);
@@ -66,7 +66,7 @@ public class SelfMessageLabelLocator extends LabelLocator {
relocated = true;
}
}
- if(!relocated) {
+ if (!relocated) {
super.relocate(target);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/TextCellEditorLocator.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/TextCellEditorLocator.java
index ed8a72a4b80..17290345087 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/TextCellEditorLocator.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/TextCellEditorLocator.java
@@ -33,19 +33,20 @@ public class TextCellEditorLocator implements CellEditorLocator {
/**
* @generated
*/
+ @Override
public void relocate(CellEditor celleditor) {
- Text text = (Text)celleditor.getControl();
+ Text text = (Text) celleditor.getControl();
Rectangle rect = getWrapLabel().getTextBounds().getCopy();
getWrapLabel().translateToAbsolute(rect);
- if(!text.getFont().isDisposed()) {
- if(getWrapLabel().isTextWrapOn() && getWrapLabel().getText().length() > 0) {
+ if (!text.getFont().isDisposed()) {
+ if (getWrapLabel().isTextWrapOn() && getWrapLabel().getText().length() > 0) {
rect.setSize(new Dimension(text.computeSize(rect.width, SWT.DEFAULT)));
} else {
int avr = FigureUtilities.getFontMetrics(text.getFont()).getAverageCharWidth();
rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT, SWT.DEFAULT)).expand(avr * 2, 0));
}
}
- if(!rect.equals(new Rectangle(text.getBounds()))) {
+ if (!rect.equals(new Rectangle(text.getBounds()))) {
text.setBounds(rect.x, rect.y, rect.width, rect.height);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/TimeMarkElementPositionLocator.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/TimeMarkElementPositionLocator.java
index cdc0c278eb6..b09d78cbd74 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/TimeMarkElementPositionLocator.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/locator/TimeMarkElementPositionLocator.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -89,13 +89,13 @@ public class TimeMarkElementPositionLocator extends AdvancedBorderItemLocator {
int side = findClosestSideOfParent(realLocation, getParentBorder());
Point newTopLeft = locateOnBorder(realLocation.getTopLeft(), side, 0, borderItem);
// correct in case the figure is linked to a destruction event
- if(timeElementPointsDestructionEvent()) {
+ if (timeElementPointsDestructionEvent()) {
Point destr = getDestructionEventCenter();
- if(destr != null) {
- if(editPart instanceof DurationConstraintEditPart) {
+ if (destr != null) {
+ if (editPart instanceof DurationConstraintEditPart) {
// bottom is at the destruction event y
realLocation.height = destr.y - newTopLeft.y;
- } else if(editPart instanceof TimeObservationEditPart || editPart instanceof TimeConstraintEditPart) {
+ } else if (editPart instanceof TimeObservationEditPart || editPart instanceof TimeConstraintEditPart) {
// center is at the destruction event y
newTopLeft.y = destr.y - realLocation.height / 2;
}
@@ -107,13 +107,13 @@ public class TimeMarkElementPositionLocator extends AdvancedBorderItemLocator {
/**
* The y location takes precedence on the preferred side or on collision.
- *
+ *
* @param suggestedLocation
- * the suggester location (y must be respected)
+ * the suggester location (y must be respected)
* @param suggestedSide
- * the suggested side
+ * the suggested side
* @param circuitCount
- * recursion count to avoid an infinite loop
+ * recursion count to avoid an infinite loop
* @return point
*/
@Override
@@ -121,11 +121,11 @@ public class TimeMarkElementPositionLocator extends AdvancedBorderItemLocator {
Point recommendedLocation = locateOnParent(suggestedLocation, suggestedSide, borderItem);
IFigure conflictingBorderItem = getConflictingBorderItemFigure(recommendedLocation, borderItem);
// max circuit count of 2 allows to try other side, then go back to original side if occupied
- if(circuitCount < 2 && conflictingBorderItem != null) {
- if(suggestedSide == PositionConstants.WEST) {
+ if (circuitCount < 2 && conflictingBorderItem != null) {
+ if (suggestedSide == PositionConstants.WEST) {
// west is occupied, try east
return locateOnBorder(recommendedLocation, PositionConstants.EAST, circuitCount + 1, borderItem);
- } else { //EAST
+ } else { // EAST
// east is occupied, try west
return locateOnBorder(recommendedLocation, PositionConstants.WEST, circuitCount + 1, borderItem);
}
@@ -136,14 +136,14 @@ public class TimeMarkElementPositionLocator extends AdvancedBorderItemLocator {
/**
* Utility to calculate the bounds of the dot line to use as parent with consideration for the handle
* bounds inset.
- *
+ *
* @return <code>Rectangle</code> that is the bounds of the parent dot line.
*/
protected Rectangle getParentDotLineBorder() {
// get the dot line of the lifeline if available
- for(Object childFig : getParentFigure().getChildren()) {
- if(childFig instanceof LifelineFigure) {
- LifelineDotLineCustomFigure dotline = ((LifelineFigure)childFig).getFigureLifelineDotLineFigure();
+ for (Object childFig : getParentFigure().getChildren()) {
+ if (childFig instanceof LifelineFigure) {
+ LifelineDotLineCustomFigure dotline = ((LifelineFigure) childFig).getFigureLifelineDotLineFigure();
return dotline.getBounds().getCopy();
}
}
@@ -153,7 +153,7 @@ public class TimeMarkElementPositionLocator extends AdvancedBorderItemLocator {
/**
* Ensure the suggested location actually lies on the parent boundary. The
* side takes precedence.
- *
+ *
* @param suggestedLocation
* @param suggestedSide
* @return point
@@ -172,22 +172,22 @@ public class TimeMarkElementPositionLocator extends AdvancedBorderItemLocator {
int eastX = parentFigureXCenter + horizontalGap[1];
int southY = parentFigureY + parentFigureHeight - getBorderItemOffset().height;
int northY = parentFigureY + getBorderItemOffset().height;
- if(suggestedSide == PositionConstants.WEST) {
- if(suggestedLocation.x != westX) {
+ if (suggestedSide == PositionConstants.WEST) {
+ if (suggestedLocation.x != westX) {
newX = westX;
}
- if(suggestedLocation.y < bounds.getTopLeft().y) {
+ if (suggestedLocation.y < bounds.getTopLeft().y) {
newY = northY;
- } else if(suggestedLocation.y > bounds.getBottomLeft().y - borderItemSize.height) {
+ } else if (suggestedLocation.y > bounds.getBottomLeft().y - borderItemSize.height) {
newY = southY - borderItemSize.height;
}
} else { // EAST
- if(suggestedLocation.x != eastX) {
+ if (suggestedLocation.x != eastX) {
newX = eastX;
}
- if(suggestedLocation.y < bounds.getTopLeft().y) {
+ if (suggestedLocation.y < bounds.getTopLeft().y) {
newY = northY;
- } else if(suggestedLocation.y > bounds.getBottomLeft().y - borderItemSize.height) {
+ } else if (suggestedLocation.y > bounds.getBottomLeft().y - borderItemSize.height) {
newY = southY - borderItemSize.height;
}
}
@@ -196,15 +196,15 @@ public class TimeMarkElementPositionLocator extends AdvancedBorderItemLocator {
/**
* Get the center of the destruction event figure (relative)
- *
+ *
* @return the destruction center or null
*/
private Point getDestructionEventCenter() {
LifelineEditPart lifeline = SequenceUtil.getParentLifelinePart(editPart);
- if(lifeline != null) {
- for(Object child : lifeline.getChildren()) {
- if(child instanceof DestructionOccurrenceSpecificationEditPart) {
- return ((DestructionOccurrenceSpecificationEditPart)child).getFigure().getBounds().getCenter();
+ if (lifeline != null) {
+ for (Object child : lifeline.getChildren()) {
+ if (child instanceof DestructionOccurrenceSpecificationEditPart) {
+ return ((DestructionOccurrenceSpecificationEditPart) child).getFigure().getBounds().getCenter();
}
}
}
@@ -213,22 +213,22 @@ public class TimeMarkElementPositionLocator extends AdvancedBorderItemLocator {
/**
* Know whether the figure must be located all down because its element references a destruction event
- *
+ *
* @return true if destruction event is referenced
*/
private boolean timeElementPointsDestructionEvent() {
- if(editPart instanceof GraphicalEditPart) {
+ if (editPart instanceof GraphicalEditPart) {
// get event occurrence(s)
- EObject element = ((GraphicalEditPart)editPart).resolveSemanticElement();
+ EObject element = ((GraphicalEditPart) editPart).resolveSemanticElement();
List<? extends Element> occurrences = Collections.emptyList();
- if(element instanceof TimeObservation) {
- NamedElement occurence = ((TimeObservation)element).getEvent();
+ if (element instanceof TimeObservation) {
+ NamedElement occurence = ((TimeObservation) element).getEvent();
occurrences = Collections.singletonList(occurence);
- } else if(element instanceof TimeConstraint || element instanceof DurationConstraint) {
- occurrences = ((IntervalConstraint)element).getConstrainedElements();
+ } else if (element instanceof TimeConstraint || element instanceof DurationConstraint) {
+ occurrences = ((IntervalConstraint) element).getConstrainedElements();
}
- for(Element occurrence : occurrences) {
- if(occurrence instanceof DestructionOccurrenceSpecificationEditPart) {
+ for (Element occurrence : occurrences) {
+ if (occurrence instanceof DestructionOccurrenceSpecificationEditPart) {
return true;
}
}
@@ -238,51 +238,51 @@ public class TimeMarkElementPositionLocator extends AdvancedBorderItemLocator {
/**
* Get the gaps to know how the figure must be translated from the center of the lifeline, taking in account executions.
- *
+ *
* @return a size 2 array with left translation at index 0 et right at index 1
*/
private int[] getHorizontalGap() {
- int[] horizontalGap = new int[]{ 0, 0 };
- if(editPart instanceof GraphicalEditPart) {
+ int[] horizontalGap = new int[] { 0, 0 };
+ if (editPart instanceof GraphicalEditPart) {
// get event occurrence(s)
LifelineEditPart lifeline = SequenceUtil.getParentLifelinePart(editPart);
- EObject element = ((GraphicalEditPart)editPart).resolveSemanticElement();
+ EObject element = ((GraphicalEditPart) editPart).resolveSemanticElement();
List<? extends Element> occurrences = Collections.emptyList();
- if(element instanceof TimeObservation) {
- NamedElement occurence = ((TimeObservation)element).getEvent();
+ if (element instanceof TimeObservation) {
+ NamedElement occurence = ((TimeObservation) element).getEvent();
occurrences = Collections.singletonList(occurence);
- } else if(element instanceof TimeConstraint || element instanceof DurationConstraint) {
- occurrences = ((IntervalConstraint)element).getConstrainedElements();
+ } else if (element instanceof TimeConstraint || element instanceof DurationConstraint) {
+ occurrences = ((IntervalConstraint) element).getConstrainedElements();
}
boolean horizontalGapSet = false;
// check bounds of event's execution
- for(Element occurrence : occurrences) {
- if(occurrence instanceof OccurrenceSpecification) {
- EditPart part = SequenceUtil.getLinkedEditPart(lifeline, (OccurrenceSpecification)occurrence);
- if(part instanceof ConnectionEditPart && occurrence instanceof MessageOccurrenceSpecification) {
+ for (Element occurrence : occurrences) {
+ if (occurrence instanceof OccurrenceSpecification) {
+ EditPart part = SequenceUtil.getLinkedEditPart(lifeline, (OccurrenceSpecification) occurrence);
+ if (part instanceof ConnectionEditPart && occurrence instanceof MessageOccurrenceSpecification) {
// get the bounds of the execution on which the connection is connected
- ConnectionEditPart conn = (ConnectionEditPart)part;
- Message message = ((MessageOccurrenceSpecification)occurrence).getMessage();
- if(message != null) {
+ ConnectionEditPart conn = (ConnectionEditPart) part;
+ Message message = ((MessageOccurrenceSpecification) occurrence).getMessage();
+ if (message != null) {
boolean start = message.getSendEvent() != null && message.getSendEvent().equals(occurrence);
- if(start) {
+ if (start) {
part = conn.getSource();
} else {
part = conn.getTarget();
}
}
}
- if(part instanceof ShapeNodeEditPart && !lifeline.equals(part)) {
- Rectangle execBounds = ((ShapeNodeEditPart)part).getFigure().getBounds();
+ if (part instanceof ShapeNodeEditPart && !lifeline.equals(part)) {
+ Rectangle execBounds = ((ShapeNodeEditPart) part).getFigure().getBounds();
Rectangle parentBounds = getParentBorder();
int leftGap = execBounds.getLeft().x - parentBounds.getCenter().x;
int rightGap = execBounds.getRight().x - parentBounds.getCenter().x;
- if(part instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (part instanceof DestructionOccurrenceSpecificationEditPart) {
// center of destruction event is considered
leftGap = 0;
rightGap = 0;
}
- if(!horizontalGapSet) {
+ if (!horizontalGapSet) {
horizontalGap[0] = leftGap;
horizontalGap[1] = rightGap;
horizontalGapSet = true;
@@ -300,7 +300,7 @@ public class TimeMarkElementPositionLocator extends AdvancedBorderItemLocator {
/**
* Find the closest side when x,y is inside parent.
- *
+ *
* @param proposedLocation
* @param parentBorder
* @return draw constant
@@ -309,7 +309,7 @@ public class TimeMarkElementPositionLocator extends AdvancedBorderItemLocator {
// Rectangle parentBorder = getParentBorder();
Point parentCenter = parentBorder.getCenter();
Point childCenter = proposedLocation.getCenter();
- if(childCenter.x < parentCenter.x) // West, North or South.
+ if (childCenter.x < parentCenter.x) // West, North or South.
{
return PositionConstants.WEST;
} else { // EAST, NORTH or SOUTH
@@ -319,18 +319,18 @@ public class TimeMarkElementPositionLocator extends AdvancedBorderItemLocator {
/**
* Relocate the child border item within the parent
- *
+ *
* @see org.eclipse.papyrus.uml.diagram.common.locator.AdvancedBorderItemLocator#relocate(org.eclipse.draw2d.IFigure)
- *
+ *
* @param borderItem
- * the item to relocate
+ * the item to relocate
*/
@Override
public void relocate(IFigure borderItem) {
// reset bounds of borderItem
Dimension size = getCorrectSize(borderItem);
Rectangle rectSuggested = getConstraint().getCopy();
- if(rectSuggested.getTopLeft().x == 0 && rectSuggested.getTopLeft().y == 0) {
+ if (rectSuggested.getTopLeft().x == 0 && rectSuggested.getTopLeft().y == 0) {
rectSuggested.setLocation(getPreferredLocation(borderItem));
} else {
// recovered constraint must be translated with the parent location to be absolute
@@ -340,7 +340,7 @@ public class TimeMarkElementPositionLocator extends AdvancedBorderItemLocator {
Rectangle validLocation = getValidLocation(rectSuggested, borderItem);
// the constraint is not reset, but the item bounds are
borderItem.setBounds(validLocation);
- if(timeElementPointsDestructionEvent() && editPart instanceof DurationConstraintEditPart) {
+ if (timeElementPointsDestructionEvent() && editPart instanceof DurationConstraintEditPart) {
// except when duration constraint is reduced ...
int w = getConstraint().getSize().width;
getConstraint().setSize(w, validLocation.height);
@@ -353,13 +353,13 @@ public class TimeMarkElementPositionLocator extends AdvancedBorderItemLocator {
/**
* Gets the size of the border item figure. Take in account the constraint as a minimum size.
- *
+ *
* @param borderItem
* @return the size of the border item figure.
*/
protected final Dimension getCorrectSize(IFigure borderItem) {
Dimension size = getConstraint().getSize();
- if(size.isEmpty()) {
+ if (size.isEmpty()) {
size.union(borderItem.getPreferredSize(size.width, size.height));
}
return size;
@@ -367,22 +367,22 @@ public class TimeMarkElementPositionLocator extends AdvancedBorderItemLocator {
/**
* Redraw the time marks
- *
+ *
* @param borderItem
- * the relocated border item
+ * the relocated border item
* @param location
- * the new location
+ * the new location
*/
private void redrawTimeMarks(IFigure borderItem, Rectangle location) {
- for(Object child : borderItem.getChildren()) {
- if(child instanceof TimeConstraintFigure) {
- ((TimeConstraintFigure)child).setCurrentSideOfFigure(getCurrentSideOfParent(), location);
- } else if(child instanceof TimeObservationFigure) {
- ((TimeObservationFigure)child).setCurrentSideOfFigure(getCurrentSideOfParent(), location);
- } else if(child instanceof CustomDurationConstraintFigure) {
- ((CustomDurationConstraintFigure)child).updateArrow(location.width, location.height);
- } else if(child instanceof DefaultSizeNodeFigure) {
- redrawTimeMarks((IFigure)child, location);
+ for (Object child : borderItem.getChildren()) {
+ if (child instanceof TimeConstraintFigure) {
+ ((TimeConstraintFigure) child).setCurrentSideOfFigure(getCurrentSideOfParent(), location);
+ } else if (child instanceof TimeObservationFigure) {
+ ((TimeObservationFigure) child).setCurrentSideOfFigure(getCurrentSideOfParent(), location);
+ } else if (child instanceof CustomDurationConstraintFigure) {
+ ((CustomDurationConstraintFigure) child).updateArrow(location.width, location.height);
+ } else if (child instanceof DefaultSizeNodeFigure) {
+ redrawTimeMarks((IFigure) child, location);
}
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/parser/custom/DurationObservationParser.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/parser/custom/DurationObservationParser.java
index 7386152a61a..07f7d26505a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/parser/custom/DurationObservationParser.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/parser/custom/DurationObservationParser.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -37,7 +37,7 @@ public class DurationObservationParser extends MessageFormatParser implements IS
private static final String LINE_BREAK = System.getProperty("line.separator");
public DurationObservationParser() {
- super(new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() });
+ super(new EAttribute[] { UMLPackage.eINSTANCE.getNamedElement_Name() });
}
public DurationObservationParser(EAttribute[] features) {
@@ -50,16 +50,16 @@ public class DurationObservationParser extends MessageFormatParser implements IS
/**
* Gets the e structural feature.
- *
+ *
* @param notification
* @return the structural feature
*/
protected EStructuralFeature getEStructuralFeature(Object notification) {
EStructuralFeature featureImpl = null;
- if(notification instanceof Notification) {
- Object feature = ((Notification)notification).getFeature();
- if(feature instanceof EStructuralFeature) {
- featureImpl = (EStructuralFeature)feature;
+ if (notification instanceof Notification) {
+ Object feature = ((Notification) notification).getFeature();
+ if (feature instanceof EStructuralFeature) {
+ featureImpl = (EStructuralFeature) feature;
}
}
return featureImpl;
@@ -80,8 +80,8 @@ public class DurationObservationParser extends MessageFormatParser implements IS
@Override
public String getPrintString(IAdaptable element, int flags) {
Object adapter = element.getAdapter(EObject.class);
- if(adapter instanceof DurationObservation) {
- return DurationObservationHelper.getLabelString((DurationObservation)adapter);
+ if (adapter instanceof DurationObservation) {
+ return DurationObservationHelper.getLabelString((DurationObservation) adapter);
}
return "";
}
@@ -89,6 +89,7 @@ public class DurationObservationParser extends MessageFormatParser implements IS
/**
* {@inheritDoc}
*/
+ @Override
public boolean areSemanticElementsAffected(EObject listener, Object notification) {
EStructuralFeature feature = getEStructuralFeature(notification);
return isValidFeature(feature);
@@ -97,11 +98,12 @@ public class DurationObservationParser extends MessageFormatParser implements IS
/**
* {@inheritDoc}
*/
+ @Override
@SuppressWarnings("unchecked")
public List getSemanticElementsBeingParsed(EObject element) {
List<Element> semanticElementsBeingParsed = new ArrayList<Element>();
- if(element instanceof DurationObservation) {
- DurationObservation observation = (DurationObservation)element;
+ if (element instanceof DurationObservation) {
+ DurationObservation observation = (DurationObservation) element;
semanticElementsBeingParsed.add(observation);
}
return semanticElementsBeingParsed;
@@ -109,12 +111,13 @@ public class DurationObservationParser extends MessageFormatParser implements IS
/**
* Determines if the given feature has to be taken into account in this parser
- *
+ *
* @param feature
- * the feature to test
+ * the feature to test
* @return true if is valid, false otherwise
*/
private boolean isValidFeature(EStructuralFeature feature) {
- return UMLPackage.eINSTANCE.getNamedElement_Name().equals(feature) || UMLPackage.eINSTANCE.getMessage_SendEvent().equals(feature) || UMLPackage.eINSTANCE.getMessage_ReceiveEvent().equals(feature) || UMLPackage.eINSTANCE.getDurationObservation_Event().equals(feature);
+ return UMLPackage.eINSTANCE.getNamedElement_Name().equals(feature) || UMLPackage.eINSTANCE.getMessage_SendEvent().equals(feature) || UMLPackage.eINSTANCE.getMessage_ReceiveEvent().equals(feature)
+ || UMLPackage.eINSTANCE.getDurationObservation_Event().equals(feature);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/parser/custom/InteractionUseCustomParsers.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/parser/custom/InteractionUseCustomParsers.java
index 25c01bba94a..43f3a3980ba 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/parser/custom/InteractionUseCustomParsers.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/parser/custom/InteractionUseCustomParsers.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -43,15 +43,15 @@ public class InteractionUseCustomParsers extends MessageFormatParser implements
}
public InteractionUseCustomParsers() {
- super(new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() });
+ super(new EAttribute[] { UMLPackage.eINSTANCE.getNamedElement_Name() });
}
protected EStructuralFeature getEStructuralFeature(Object notification) {
EStructuralFeature featureImpl = null;
- if(notification instanceof Notification) {
- Object feature = ((Notification)notification).getFeature();
- if(feature instanceof EStructuralFeature) {
- featureImpl = (EStructuralFeature)feature;
+ if (notification instanceof Notification) {
+ Object feature = ((Notification) notification).getFeature();
+ if (feature instanceof EStructuralFeature) {
+ featureImpl = (EStructuralFeature) feature;
}
}
return featureImpl;
@@ -81,12 +81,12 @@ public class InteractionUseCustomParsers extends MessageFormatParser implements
public String getPrintString(IAdaptable element, int flags) {
Object obj = element.getAdapter(EObject.class);
StringBuffer sb = new StringBuffer();
- if(obj instanceof InteractionUse) {
- InteractionUse interactionUse = (InteractionUse)obj;
+ if (obj instanceof InteractionUse) {
+ InteractionUse interactionUse = (InteractionUse) obj;
Interaction interaction = interactionUse.getRefersTo();
- if(interaction != null) {
+ if (interaction != null) {
String interactionName = interaction.getName();
- if(interactionName != null) {
+ if (interactionName != null) {
sb.append(interaction.getName());
}
}
@@ -101,6 +101,7 @@ public class InteractionUseCustomParsers extends MessageFormatParser implements
* org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser#areSemanticElementsAffected
* (org.eclipse.emf.ecore.EObject, java.lang.Object)
*/
+ @Override
public boolean areSemanticElementsAffected(EObject listener, Object notification) {
EStructuralFeature feature = getEStructuralFeature(notification);
return isValidFeature(feature);
@@ -113,13 +114,14 @@ public class InteractionUseCustomParsers extends MessageFormatParser implements
* org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser#getSemanticElementsBeingParsed
* (org.eclipse.emf.ecore.EObject)
*/
+ @Override
public List getSemanticElementsBeingParsed(EObject element) {
List<Element> semanticElementsBeingParsed = new ArrayList<Element>();
- if(element instanceof InteractionUse) {
- InteractionUse interactionUse = (InteractionUse)element;
+ if (element instanceof InteractionUse) {
+ InteractionUse interactionUse = (InteractionUse) element;
semanticElementsBeingParsed.add(interactionUse);
Interaction interaction = interactionUse.getRefersTo();
- if(interaction != null) {
+ if (interaction != null) {
// Add the interaction refered.
semanticElementsBeingParsed.add(interaction);
// TODO : Collaboration and interactionUse
@@ -130,9 +132,9 @@ public class InteractionUseCustomParsers extends MessageFormatParser implements
/**
* Determines if the given feature has to be taken into account in this parser
- *
+ *
* @param feature
- * the feature to test
+ * the feature to test
* @return true if is valid, false otherwise
*/
private boolean isValidFeature(EStructuralFeature feature) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/parser/custom/LifelineCustomParsers.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/parser/custom/LifelineCustomParsers.java
index a8479cb1809..f92901b385a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/parser/custom/LifelineCustomParsers.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/parser/custom/LifelineCustomParsers.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -52,15 +52,15 @@ public class LifelineCustomParsers extends MessageFormatParser implements ISeman
}
public LifelineCustomParsers() {
- super(new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() });
+ super(new EAttribute[] { UMLPackage.eINSTANCE.getNamedElement_Name() });
}
protected EStructuralFeature getEStructuralFeature(Object notification) {
EStructuralFeature featureImpl = null;
- if(notification instanceof Notification) {
- Object feature = ((Notification)notification).getFeature();
- if(feature instanceof EStructuralFeature) {
- featureImpl = (EStructuralFeature)feature;
+ if (notification instanceof Notification) {
+ Object feature = ((Notification) notification).getFeature();
+ if (feature instanceof EStructuralFeature) {
+ featureImpl = (EStructuralFeature) feature;
}
}
return featureImpl;
@@ -74,52 +74,52 @@ public class LifelineCustomParsers extends MessageFormatParser implements ISeman
/**
* Information identifying the lifeline displayed inside the rectangle
- *
+ *
* @see org.eclipse.papyrus.uml.diagram.sequence.parsers.MessageFormatParser#getPrintString(org.eclipse.core.runtime.IAdaptable, int)
*/
@Override
public String getPrintString(IAdaptable element, int flags) {
Object obj = element.getAdapter(EObject.class);
StringBuffer sb = new StringBuffer();
- if(obj instanceof Lifeline) {
- Lifeline lifeline = (Lifeline)obj;
+ if (obj instanceof Lifeline) {
+ Lifeline lifeline = (Lifeline) obj;
ConnectableElement connectableElement = lifeline.getRepresents();
ValueSpecification selector = lifeline.getSelector();
- if(connectableElement != null) {
+ if (connectableElement != null) {
// Add ConnectableElement Name
String connectableElementName = connectableElement.getName();
- if(connectableElementName != null) {
+ if (connectableElementName != null) {
sb.append(connectableElementName);
}
// Add the selector if it is a LiteralSpecification
- if(selector instanceof LiteralSpecification) {
+ if (selector instanceof LiteralSpecification) {
sb.append("[").append(ValueSpecificationUtil.getSpecificationValue(selector)).append("]");
}
// Add the type name
Type type = connectableElement.getType();
- if(type != null && type.getName() != null && type.getName().length() > 0) {
+ if (type != null && type.getName() != null && type.getName().length() > 0) {
sb.append(" : ").append(type.getName());
}
}
// Add the selector if it is an Expression
- if(selector instanceof Expression || selector instanceof OpaqueExpression || selector instanceof TimeExpression) {
+ if (selector instanceof Expression || selector instanceof OpaqueExpression || selector instanceof TimeExpression) {
String specificationValue = ValueSpecificationUtil.getSpecificationValue(selector);
- if(specificationValue != null && specificationValue.length() > 0) {
+ if (specificationValue != null && specificationValue.length() > 0) {
sb.append("\n").append(specificationValue);
}
}
// Add the decomposition
PartDecomposition partDecomposition = lifeline.getDecomposedAs();
- if(partDecomposition != null) {
+ if (partDecomposition != null) {
Interaction refersTo = partDecomposition.getRefersTo();
- if(refersTo != null) {
+ if (refersTo != null) {
sb.append("\nref ").append(refersTo.getName());
}
}
// LifelineIndent cannot be empty so if the stringBuffer is empty we add the name of the
// lifeline
// This case occurs when creating the lifeline for example
- if(sb.length() == 0) {
+ if (sb.length() == 0) {
sb.append(lifeline.getName());
}
}
@@ -133,6 +133,7 @@ public class LifelineCustomParsers extends MessageFormatParser implements ISeman
* org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser#areSemanticElementsAffected
* (org.eclipse.emf.ecore.EObject, java.lang.Object)
*/
+ @Override
public boolean areSemanticElementsAffected(EObject listener, Object notification) {
EStructuralFeature feature = getEStructuralFeature(notification);
return isValidFeature(feature);
@@ -145,30 +146,31 @@ public class LifelineCustomParsers extends MessageFormatParser implements ISeman
* org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser#getSemanticElementsBeingParsed
* (org.eclipse.emf.ecore.EObject)
*/
+ @Override
public List getSemanticElementsBeingParsed(EObject element) {
List<Element> semanticElementsBeingParsed = new ArrayList<Element>();
- if(element instanceof Lifeline) {
- Lifeline lifeline = (Lifeline)element;
+ if (element instanceof Lifeline) {
+ Lifeline lifeline = (Lifeline) element;
// Add the lifeline
semanticElementsBeingParsed.add(lifeline);
// Add the selector
- if(lifeline.getSelector() != null) {
+ if (lifeline.getSelector() != null) {
semanticElementsBeingParsed.add(lifeline.getSelector());
}
// Add the partDecomposition
PartDecomposition partDecomposition = lifeline.getDecomposedAs();
- if(partDecomposition != null) {
+ if (partDecomposition != null) {
semanticElementsBeingParsed.add(partDecomposition);
// Add the Interaction refered by the partDecomposition
- if(partDecomposition.getRefersTo() != null) {
+ if (partDecomposition.getRefersTo() != null) {
semanticElementsBeingParsed.add(partDecomposition.getRefersTo());
}
}
// Add the connectableElement and its type if it has any
ConnectableElement connectableElement = lifeline.getRepresents();
- if(connectableElement != null) {
+ if (connectableElement != null) {
semanticElementsBeingParsed.add(connectableElement);
- if(connectableElement.getType() != null) {
+ if (connectableElement.getType() != null) {
semanticElementsBeingParsed.add(connectableElement.getType());
}
}
@@ -178,12 +180,15 @@ public class LifelineCustomParsers extends MessageFormatParser implements ISeman
/**
* Determines if the given feature has to be taken into account in this parser
- *
+ *
* @param feature
- * the feature to test
+ * the feature to test
* @return true if is valid, false otherwise
*/
private boolean isValidFeature(EStructuralFeature feature) {
- return UMLPackage.eINSTANCE.getNamedElement_Name().equals(feature) || UMLPackage.eINSTANCE.getTypedElement_Type().equals(feature) || UMLPackage.eINSTANCE.getLiteralInteger_Value().equals(feature) || UMLPackage.eINSTANCE.getLiteralUnlimitedNatural_Value().equals(feature) || UMLPackage.eINSTANCE.getLiteralBoolean_Value().equals(feature) || UMLPackage.eINSTANCE.getLiteralString_Value().equals(feature) || UMLPackage.eINSTANCE.getOpaqueExpression_Body().equals(feature) || UMLPackage.eINSTANCE.getLifeline_Selector().equals(feature) || UMLPackage.eINSTANCE.getLifeline_DecomposedAs().equals(feature) || UMLPackage.eINSTANCE.getLifeline_Represents().equals(feature) || UMLPackage.eINSTANCE.getInteractionUse_RefersTo().equals(feature);
+ return UMLPackage.eINSTANCE.getNamedElement_Name().equals(feature) || UMLPackage.eINSTANCE.getTypedElement_Type().equals(feature) || UMLPackage.eINSTANCE.getLiteralInteger_Value().equals(feature)
+ || UMLPackage.eINSTANCE.getLiteralUnlimitedNatural_Value().equals(feature) || UMLPackage.eINSTANCE.getLiteralBoolean_Value().equals(feature) || UMLPackage.eINSTANCE.getLiteralString_Value().equals(feature)
+ || UMLPackage.eINSTANCE.getOpaqueExpression_Body().equals(feature) || UMLPackage.eINSTANCE.getLifeline_Selector().equals(feature) || UMLPackage.eINSTANCE.getLifeline_DecomposedAs().equals(feature)
+ || UMLPackage.eINSTANCE.getLifeline_Represents().equals(feature) || UMLPackage.eINSTANCE.getInteractionUse_RefersTo().equals(feature);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/parser/custom/MessageCustomParser.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/parser/custom/MessageCustomParser.java
index 72b6f82121c..8cf4267d8c4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/parser/custom/MessageCustomParser.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/parser/custom/MessageCustomParser.java
@@ -46,32 +46,32 @@ public class MessageCustomParser extends MessageFormatParser implements ISemanti
}
public MessageCustomParser() {
- super(new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() });
+ super(new EAttribute[] { UMLPackage.eINSTANCE.getNamedElement_Name() });
}
@Override
public String getPrintString(IAdaptable adapter, int flags) {
Object obj = adapter.getAdapter(EObject.class);
String result = null;
- if(obj instanceof Message) {
- Message message = (Message)obj;
+ if (obj instanceof Message) {
+ Message message = (Message) obj;
NamedElement signature = message.getSignature();
- if(signature instanceof Operation) {
- Operation operation = (Operation)signature;
- if(MessageSort.REPLY_LITERAL.equals(message.getMessageSort())) {
+ if (signature instanceof Operation) {
+ Operation operation = (Operation) signature;
+ if (MessageSort.REPLY_LITERAL.equals(message.getMessageSort())) {
result = OperationUtil.getCustomLabel(operation, Arrays.asList(ICustomAppearance.DISP_NAME, ICustomAppearance.DISP_RT_TYPE));
- } else if(MessageSort.SYNCH_CALL_LITERAL.equals(message.getMessageSort())) {
+ } else if (MessageSort.SYNCH_CALL_LITERAL.equals(message.getMessageSort())) {
result = OperationUtil.getCustomLabel(operation, Arrays.asList(ICustomAppearance.DISP_NAME, ICustomAppearance.DISP_PARAMETER_NAME, ICustomAppearance.DISP_PARAMETER_TYPE));
} else {
result = OperationUtil.getCustomLabel(operation, Arrays.asList(ICustomAppearance.DISP_NAME, ICustomAppearance.DISP_PARAMETER_NAME, ICustomAppearance.DISP_PARAMETER_TYPE, ICustomAppearance.DISP_RT_TYPE));
}
- } else if(signature instanceof Signal) {
- result = SignalUtil.getCustomLabel((Signal)signature, Arrays.asList(ICustomAppearance.DISP_NAME, ICustomAppearance.DISP_TYPE));
- } else if(signature != null) {
+ } else if (signature instanceof Signal) {
+ result = SignalUtil.getCustomLabel((Signal) signature, Arrays.asList(ICustomAppearance.DISP_NAME, ICustomAppearance.DISP_TYPE));
+ } else if (signature != null) {
result = signature.getName();
}
// If the String is empty, we add the name of the message
- if(result == null || result.equals("")) {
+ if (result == null || result.equals("")) {
result = message.getName();
}
}
@@ -86,18 +86,18 @@ public class MessageCustomParser extends MessageFormatParser implements ISemanti
@Override
public List<Element> getSemanticElementsBeingParsed(EObject element) {
List<Element> semanticElementsBeingParsed = new ArrayList<Element>();
- if(element instanceof Message) {
- Message message = (Message)element;
+ if (element instanceof Message) {
+ Message message = (Message) element;
semanticElementsBeingParsed.add(message);
NamedElement signature = message.getSignature();
semanticElementsBeingParsed.add(signature);
- if(signature instanceof Operation) {
- for(Parameter parameter : ((Operation)signature).getOwnedParameters()) {
+ if (signature instanceof Operation) {
+ for (Parameter parameter : ((Operation) signature).getOwnedParameters()) {
semanticElementsBeingParsed.add(parameter);
}
}
- if(signature instanceof Signal) {
- for(Property property : ((Signal)signature).getOwnedAttributes()) {
+ if (signature instanceof Signal) {
+ for (Property property : ((Signal) signature).getOwnedAttributes()) {
semanticElementsBeingParsed.add(property);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/parser/custom/TimeConstraintParser.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/parser/custom/TimeConstraintParser.java
index 16c3080fc1d..60615cf84c7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/parser/custom/TimeConstraintParser.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/parser/custom/TimeConstraintParser.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -60,7 +60,7 @@ public class TimeConstraintParser extends MessageFormatParser implements ISemant
private static final String FORMAT = "{%s}";
public TimeConstraintParser() {
- super(new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() });
+ super(new EAttribute[] { UMLPackage.eINSTANCE.getNamedElement_Name() });
}
public TimeConstraintParser(EAttribute[] features) {
@@ -73,16 +73,16 @@ public class TimeConstraintParser extends MessageFormatParser implements ISemant
/**
* Gets the e structural feature.
- *
+ *
* @param notification
* @return the structural feature
*/
protected EStructuralFeature getEStructuralFeature(Object notification) {
EStructuralFeature featureImpl = null;
- if(notification instanceof Notification) {
- Object feature = ((Notification)notification).getFeature();
- if(feature instanceof EStructuralFeature) {
- featureImpl = (EStructuralFeature)feature;
+ if (notification instanceof Notification) {
+ Object feature = ((Notification) notification).getFeature();
+ if (feature instanceof EStructuralFeature) {
+ featureImpl = (EStructuralFeature) feature;
}
}
return featureImpl;
@@ -103,21 +103,21 @@ public class TimeConstraintParser extends MessageFormatParser implements ISemant
@Override
public String getPrintString(IAdaptable element, int flags) {
Object adapter = element.getAdapter(EObject.class);
- if(adapter instanceof TimeConstraint) {
- TimeConstraint constraint = (TimeConstraint)adapter;
+ if (adapter instanceof TimeConstraint) {
+ TimeConstraint constraint = (TimeConstraint) adapter;
ValueSpecification spec = constraint.getSpecification();
return String.format(FORMAT, ValueSpecificationUtil.getSpecificationValue(spec));
- } else if(adapter instanceof DurationConstraint) {
- String value = getDurationConstraint((DurationConstraint)adapter);
+ } else if (adapter instanceof DurationConstraint) {
+ String value = getDurationConstraint((DurationConstraint) adapter);
return String.format(FORMAT, value);
- } else if(adapter instanceof Message) {
+ } else if (adapter instanceof Message) {
StringBuffer result = new StringBuffer();
- Message message = (Message)adapter;
+ Message message = (Message) adapter;
MessageEnd event1 = message.getSendEvent();
MessageEnd event2 = message.getReceiveEvent();
List<DurationConstraint> constraints = DurationConstraintHelper.getDurationConstraintsBetween(event1, event2);
- for(DurationConstraint constraint : constraints) {
- if(result.length() > 0) {
+ for (DurationConstraint constraint : constraints) {
+ if (result.length() > 0) {
result.append(LINE_BREAK);
}
ValueSpecification spec = constraint.getSpecification();
@@ -131,6 +131,7 @@ public class TimeConstraintParser extends MessageFormatParser implements ISemant
/**
* {@inheritDoc}
*/
+ @Override
public boolean areSemanticElementsAffected(EObject listener, Object notification) {
EStructuralFeature feature = getEStructuralFeature(notification);
return isValidFeature(feature);
@@ -139,21 +140,22 @@ public class TimeConstraintParser extends MessageFormatParser implements ISemant
/**
* {@inheritDoc}
*/
+ @Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public List getSemanticElementsBeingParsed(EObject element) {
HashSet<Element> semanticElementsBeingParsed = new HashSet<Element>();
- if(element instanceof Constraint) {
- Constraint constraint = (Constraint)element;
+ if (element instanceof Constraint) {
+ Constraint constraint = (Constraint) element;
ValueSpecificationUtil.addEnclosedValueSpecificationToCollection(constraint.getSpecification(), semanticElementsBeingParsed);
- } else if(element instanceof Message) {
- Message message = (Message)element;
+ } else if (element instanceof Message) {
+ Message message = (Message) element;
semanticElementsBeingParsed.add(message);
MessageEnd event1 = message.getSendEvent();
semanticElementsBeingParsed.add(event1);
MessageEnd event2 = message.getReceiveEvent();
semanticElementsBeingParsed.add(event2);
List<DurationConstraint> constraints = DurationConstraintHelper.getDurationConstraintsBetween(event1, event2);
- for(DurationConstraint constraint : constraints) {
+ for (DurationConstraint constraint : constraints) {
semanticElementsBeingParsed.add(constraint);
// owner for listening DurationConstraint deletion
semanticElementsBeingParsed.add(constraint.getOwner());
@@ -164,9 +166,9 @@ public class TimeConstraintParser extends MessageFormatParser implements ISemant
/**
* Determines if the given feature has to be taken into account in this parser
- *
+ *
* @param feature
- * the feature to test
+ * the feature to test
* @return true if is valid, false otherwise
*/
private boolean isValidFeature(EStructuralFeature feature) {
@@ -175,20 +177,20 @@ public class TimeConstraintParser extends MessageFormatParser implements ISemant
@Override
public String getEditString(IAdaptable adapter, int flags) {
- EObject element = (EObject)adapter.getAdapter(EObject.class);
- if(element instanceof DurationConstraint) {
- return getDurationConstraint((DurationConstraint)element);
+ EObject element = (EObject) adapter.getAdapter(EObject.class);
+ if (element instanceof DurationConstraint) {
+ return getDurationConstraint((DurationConstraint) element);
}
return super.getEditString(adapter, flags);
}
protected String getDurationConstraint(DurationConstraint constraint) {
ValueSpecification spec = constraint.getSpecification();
- if(spec instanceof Interval) {
- Interval interval = (Interval)spec;
+ if (spec instanceof Interval) {
+ Interval interval = (Interval) spec;
String min = ValueSpecificationUtil.getSpecificationValue(interval.getMin());
String max = ValueSpecificationUtil.getSpecificationValue(interval.getMax());
- if(min.equals(max)) {
+ if (min.equals(max)) {
return min;
}
}
@@ -198,40 +200,40 @@ public class TimeConstraintParser extends MessageFormatParser implements ISemant
@Override
public ICommand getParseCommand(IAdaptable adapter, String newString, int flags) {
- EObject element = (EObject)adapter.getAdapter(EObject.class);
- if(element instanceof DurationConstraint) {
+ EObject element = (EObject) adapter.getAdapter(EObject.class);
+ if (element instanceof DurationConstraint) {
TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(element);
- if(editingDomain == null) {
+ if (editingDomain == null) {
return UnexecutableCommand.INSTANCE;
}
Object[] values = parseInterval(newString);
- if(values == null || values.length != 2) {
+ if (values == null || values.length != 2) {
return UnexecutableCommand.INSTANCE;
}
- return new UpdateDurationConstraintCommand(editingDomain, (DurationConstraint)element, values[0], values[1]);
+ return new UpdateDurationConstraintCommand(editingDomain, (DurationConstraint) element, values[0], values[1]);
}
return super.getParseCommand(adapter, newString, flags);
}
private Object[] parseInterval(String newString) {
int pos = newString.indexOf("..");
- if(pos > -1) {
+ if (pos > -1) {
String[] part = { newString.substring(0, pos), newString.substring(pos + 2) };
try {
int min = Integer.parseInt(part[0].trim());
int max = Integer.parseInt(part[1].trim());
- return new Integer[]{ min, max };
+ return new Integer[] { min, max };
} catch (Exception e) {
}
return part;
} else {
try {
int value = Integer.parseInt(newString);
- return new Integer[]{ value, value };
+ return new Integer[] { value, value };
} catch (Exception e) {
}
// same value for min and max
- return new String[]{ newString, newString };
+ return new String[] { newString, newString };
}
}
@@ -253,8 +255,8 @@ public class TimeConstraintParser extends MessageFormatParser implements ISemant
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
ValueSpecification spec = constraint.getSpecification();
- if(spec instanceof Interval) {
- Interval interval = (Interval)spec;
+ if (spec instanceof Interval) {
+ Interval interval = (Interval) spec;
setValue(interval.getMin(), min);
setValue(interval.getMax(), max);
}
@@ -262,10 +264,10 @@ public class TimeConstraintParser extends MessageFormatParser implements ISemant
}
private void setValue(ValueSpecification spec, Object val) {
- if(spec instanceof Duration) {
- Duration dur = (Duration)spec;
- if(dur.getExpr() instanceof LiteralInteger && val instanceof Integer) {
- ((LiteralInteger)dur.getExpr()).setValue((Integer)val);
+ if (spec instanceof Duration) {
+ Duration dur = (Duration) spec;
+ if (dur.getExpr() instanceof LiteralInteger && val instanceof Integer) {
+ ((LiteralInteger) dur.getExpr()).setValue((Integer) val);
} else {
LiteralString str = UMLFactory.eINSTANCE.createLiteralString();
str.setValue(val.toString());
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/parser/custom/TimeObservationParser.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/parser/custom/TimeObservationParser.java
index fe214ddd88e..d75eade6baf 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/parser/custom/TimeObservationParser.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/parser/custom/TimeObservationParser.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -36,7 +36,7 @@ public class TimeObservationParser extends MessageFormatParser implements ISeman
private static final String FORMAT = "@%s";
public TimeObservationParser() {
- super(new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() });
+ super(new EAttribute[] { UMLPackage.eINSTANCE.getNamedElement_Name() });
}
public TimeObservationParser(EAttribute[] features) {
@@ -49,16 +49,16 @@ public class TimeObservationParser extends MessageFormatParser implements ISeman
/**
* Gets the e structural feature.
- *
+ *
* @param notification
* @return the structural feature
*/
protected EStructuralFeature getEStructuralFeature(Object notification) {
EStructuralFeature featureImpl = null;
- if(notification instanceof Notification) {
- Object feature = ((Notification)notification).getFeature();
- if(feature instanceof EStructuralFeature) {
- featureImpl = (EStructuralFeature)feature;
+ if (notification instanceof Notification) {
+ Object feature = ((Notification) notification).getFeature();
+ if (feature instanceof EStructuralFeature) {
+ featureImpl = (EStructuralFeature) feature;
}
}
return featureImpl;
@@ -80,9 +80,9 @@ public class TimeObservationParser extends MessageFormatParser implements ISeman
public String getPrintString(IAdaptable element, int flags) {
StringBuffer result = new StringBuffer();
Object adapter = element.getAdapter(EObject.class);
- if(adapter instanceof TimeObservation) {
- TimeObservation observation = (TimeObservation)adapter;
- if(observation.getName() != null) {
+ if (adapter instanceof TimeObservation) {
+ TimeObservation observation = (TimeObservation) adapter;
+ if (observation.getName() != null) {
return String.format(FORMAT, observation.getName());
}
}
@@ -92,6 +92,7 @@ public class TimeObservationParser extends MessageFormatParser implements ISeman
/**
* {@inheritDoc}
*/
+ @Override
public boolean areSemanticElementsAffected(EObject listener, Object notification) {
EStructuralFeature feature = getEStructuralFeature(notification);
return isValidFeature(feature);
@@ -100,20 +101,21 @@ public class TimeObservationParser extends MessageFormatParser implements ISeman
/**
* {@inheritDoc}
*/
+ @Override
@SuppressWarnings("unchecked")
public List getSemanticElementsBeingParsed(EObject element) {
List<Element> semanticElementsBeingParsed = new ArrayList<Element>();
- if(element instanceof TimeObservation) {
- semanticElementsBeingParsed.add((TimeObservation)element);
+ if (element instanceof TimeObservation) {
+ semanticElementsBeingParsed.add((TimeObservation) element);
}
return semanticElementsBeingParsed;
}
/**
* Determines if the given feature has to be taken into account in this parser
- *
+ *
* @param feature
- * the feature to test
+ * the feature to test
* @return true if is valid, false otherwise
*/
private boolean isValidFeature(EStructuralFeature feature) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CustomCombinedFragmentPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CustomCombinedFragmentPreferencePage.java
index 41dc04ae026..00681e9c88d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CustomCombinedFragmentPreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CustomCombinedFragmentPreferencePage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -47,7 +47,7 @@ public class CustomCombinedFragmentPreferencePage extends CombinedFragmentPrefer
/**
* Constructor.
- *
+ *
*/
public CustomCombinedFragmentPreferencePage() {
super();
@@ -60,30 +60,34 @@ public class CustomCombinedFragmentPreferencePage extends CombinedFragmentPrefer
String key = PackageEditPart.MODEL_ID + "_CombinedFragment";
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.WIDTH), 40);
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.HEIGHT), 40);
- for(String name : compartments) {
+ for (String name : compartments) {
String preferenceName = PreferencesConstantsHelper.getCompartmentElementConstant(key, name, PreferencesConstantsHelper.COMPARTMENT_VISIBILITY);
store.setDefault(preferenceName, true);
}
}
+ @Override
protected TreeMap<String, Boolean> getCompartmentTitleVisibilityPreferences() {
TreeMap<String, Boolean> map = new TreeMap<String, Boolean>();
- for(String name : compartments) {
+ for (String name : compartments) {
map.put(name, Boolean.FALSE);
}
return map;
}
+ @Override
protected void initializeCompartmentsList() {
- for(String name : compartments) {
+ for (String name : compartments) {
this.compartmentsList.add(name);
}
}
+ @Override
protected TreeMap<String, String> getLabelRole() {
return new TreeMap<String, String>();
}
+ @Override
protected void createPageContents(Composite parent) {
super.createPageContents(parent);
NodeColorGroup colorGroupForNodeComposite = new NodeColorGroup(parent, getPreferenceKey(), this);
@@ -92,12 +96,12 @@ public class CustomCombinedFragmentPreferencePage extends CombinedFragmentPrefer
addAbstractGroup(backgroundColorGroup);
DecorationGroup decorationGroup = new DecorationGroup(parent, getPreferenceKey(), this);
addAbstractGroup(decorationGroup);
- if(!compartmentsList.isEmpty()) {
+ if (!compartmentsList.isEmpty()) {
NodeCompartmentGroupEx compartmentGroup = new NodeCompartmentGroupEx(parent, getPreferenceKey(), this, compartmentsList, getCompartmentTitleVisibilityPreferences().keySet(), getPreferenceStore());
addAbstractGroup(compartmentGroup);
}
- //Label role group
- if(!getLabelRole().isEmpty()) {
+ // Label role group
+ if (!getLabelRole().isEmpty()) {
LabelGroup compartmentGroup = new LabelGroup(parent, getPreferenceKey(), this, getLabelRole());
addAbstractGroup(compartmentGroup);
}
@@ -113,9 +117,9 @@ public class CustomCombinedFragmentPreferencePage extends CombinedFragmentPrefer
private final Set<String> compartmentsWithTitle;
/**
- *
+ *
* Constructor.
- *
+ *
* @param parent
* @param title
* @param dialogPage
@@ -131,18 +135,18 @@ public class CustomCombinedFragmentPreferencePage extends CombinedFragmentPrefer
/**
* create the content.
- *
+ *
* @param parent
- * : the parent composite
+ * : the parent composite
*/
protected void createContent(Composite parent) {
- for(String compartment : myCompartments) {
+ for (String compartment : myCompartments) {
addCompartmentVisibilityGroup(parent, compartment);
}
}
protected void addCompartmentVisibilityGroup(Composite parent, String compartment) {
- // show Compartment Visibility and CompartmentName Visibility items in the same row
+ // show Compartment Visibility and CompartmentName Visibility items in the same row
Group group = new Group(parent, SWT.NONE);
group.setLayout(new GridLayout(2, true));
group.setText(compartment);
@@ -153,22 +157,22 @@ public class CustomCombinedFragmentPreferencePage extends CombinedFragmentPrefer
String compartmentVisibilityPreference = PreferencesConstantsHelper.getCompartmentElementConstant(getKey(), compartment, PreferencesConstantsHelper.COMPARTMENT_VISIBILITY);
String compartmentVisibilityLabel = "Show compartment";
Button showCompartmentButton = addCheckboxField(group, compartmentVisibilityPreference, compartmentVisibilityLabel);
- if(this.compartmentsWithTitle.contains(compartment)) {
+ if (this.compartmentsWithTitle.contains(compartment)) {
String compartmentNameVisibilityPreference = PreferencesConstantsHelper.getCompartmentElementConstant(getKey(), compartment, PreferencesConstantsHelper.COMPARTMENT_NAME_VISIBILITY);
String compartmentNameVisibilityLabel = "Show name";
Button showNameButton = addCheckboxField(group, compartmentNameVisibilityPreference, compartmentNameVisibilityLabel);
boolean showCompartmentIsNotChecked = !myPreferenceStore.getBoolean(compartmentVisibilityPreference);
- if(showCompartmentIsNotChecked) {
+ if (showCompartmentIsNotChecked) {
showNameButton.setEnabled(false);
}
- createDependency(showCompartmentButton, new Control[]{ showNameButton });
+ createDependency(showCompartmentButton, new Control[] { showNameButton });
}
}
protected Button addCheckboxField(Composite parent, String preferenceKey, String label) {
- // show Compartment Visibility and CompartmentName Visibility items in the same row
- // as CheckBoxFieldEditor resets layout data to fit the grid we create this stub plate
- // @see #doFillIntoGrid
+ // show Compartment Visibility and CompartmentName Visibility items in the same row
+ // as CheckBoxFieldEditor resets layout data to fit the grid we create this stub plate
+ // @see #doFillIntoGrid
Composite plate = new Composite(parent, SWT.NONE);
plate.setLayoutData(new GridData());
CheckBoxFieldEditor compartmentVisibilityBooleanFieldEditor = new CheckBoxFieldEditor(preferenceKey, label, plate);
@@ -181,13 +185,15 @@ public class CustomCombinedFragmentPreferencePage extends CombinedFragmentPrefer
protected void createDependency(final Button master, final Control[] slaves) {
SelectionListener dependencyListener = new SelectionListener() {
+ @Override
public void widgetSelected(SelectionEvent e) {
boolean state = master.getSelection();
- for(int i = 0; i < slaves.length; i++) {
+ for (int i = 0; i < slaves.length; i++) {
slaves[i].setEnabled(state);
}
}
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {
}
};
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CustomConsiderIgnoreFragmentPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CustomConsiderIgnoreFragmentPreferencePage.java
index f962e678f04..984a89a1da7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CustomConsiderIgnoreFragmentPreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CustomConsiderIgnoreFragmentPreferencePage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -49,30 +49,34 @@ public class CustomConsiderIgnoreFragmentPreferencePage extends ConsiderIgnoreFr
String key = PackageEditPart.MODEL_ID + "_ConsiderIgnoreFragment";
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.WIDTH), 40);
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.HEIGHT), 40);
- for(String name : compartments) {
+ for (String name : compartments) {
String preferenceName = PreferencesConstantsHelper.getCompartmentElementConstant(key, name, PreferencesConstantsHelper.COMPARTMENT_VISIBILITY);
store.setDefault(preferenceName, true);
}
}
+ @Override
protected TreeMap<String, Boolean> getCompartmentTitleVisibilityPreferences() {
TreeMap<String, Boolean> map = new TreeMap<String, Boolean>();
- for(String name : compartments) {
+ for (String name : compartments) {
map.put(name, Boolean.FALSE);
}
return map;
}
+ @Override
protected void initializeCompartmentsList() {
- for(String name : compartments) {
+ for (String name : compartments) {
this.compartmentsList.add(name);
}
}
+ @Override
protected TreeMap<String, String> getLabelRole() {
return new TreeMap<String, String>();
}
+ @Override
protected void createPageContents(Composite parent) {
super.createPageContents(parent);
NodeColorGroup colorGroupForNodeComposite = new NodeColorGroup(parent, getPreferenceKey(), this);
@@ -81,12 +85,12 @@ public class CustomConsiderIgnoreFragmentPreferencePage extends ConsiderIgnoreFr
addAbstractGroup(backgroundColorGroup);
DecorationGroup decorationGroup = new DecorationGroup(parent, getPreferenceKey(), this);
addAbstractGroup(decorationGroup);
- if(!compartmentsList.isEmpty()) {
+ if (!compartmentsList.isEmpty()) {
NodeCompartmentGroupEx compartmentGroup = new NodeCompartmentGroupEx(parent, getPreferenceKey(), this, compartmentsList, getCompartmentTitleVisibilityPreferences().keySet(), getPreferenceStore());
addAbstractGroup(compartmentGroup);
}
- //Label role group
- if(!getLabelRole().isEmpty()) {
+ // Label role group
+ if (!getLabelRole().isEmpty()) {
LabelGroup compartmentGroup = new LabelGroup(parent, getPreferenceKey(), this, getLabelRole());
addAbstractGroup(compartmentGroup);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CustomDestructionOccurrenceSpecificationPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CustomDestructionOccurrenceSpecificationPreferencePage.java
index 780d14f3b85..f4ac5ef3215 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CustomDestructionOccurrenceSpecificationPreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CustomDestructionOccurrenceSpecificationPreferencePage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CustomDiagramPreferenceInitializer.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CustomDiagramPreferenceInitializer.java
index 000bf328be3..53aabcb2562 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CustomDiagramPreferenceInitializer.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CustomDiagramPreferenceInitializer.java
@@ -13,6 +13,7 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.sequence.preferences;
+import org.eclipse.gmf.runtime.diagram.ui.preferences.DiagramsPreferencePage;
import org.eclipse.jface.preference.IPreferenceStore;
/**
@@ -22,7 +23,7 @@ public class CustomDiagramPreferenceInitializer extends DiagramPreferenceInitial
/**
* Add the diagram preference page to the initialization
- *
+ *
* @Override (update at each gmf change) diagram preference page
*/
@Override
@@ -49,10 +50,10 @@ public class CustomDiagramPreferenceInitializer extends DiagramPreferenceInitial
MessagePreferencePage.initDefaults(store);
GeneralOrderingPreferencePage.initDefaults(store);
// diagram preference page
- DiagramGeneralPreferencePage.initDefaults(store);
+ DiagramsPreferencePage.initDefaults(store);
DestructionOccurrenceSpecificationPreferencePage.initDefaults(store);
- //Custom preference pages.
+ // Custom preference pages.
CustomCombinedFragmentPreferencePage.initDefaults(store);
CustomConsiderIgnoreFragmentPreferencePage.initDefaults(store);
CustomDestructionOccurrenceSpecificationPreferencePage.initDefaults(store);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CustomInteractionOperandPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CustomInteractionOperandPreferencePage.java
index c4a480fdd02..b2c18913c2d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CustomInteractionOperandPreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CustomInteractionOperandPreferencePage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -23,9 +23,9 @@ import org.eclipse.swt.widgets.Group;
/**
* Add the possibility to display or hide the guard of Operand
- *
+ *
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=402966
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class CustomInteractionOperandPreferencePage extends InteractionOperandPreferencePage {
@@ -41,7 +41,7 @@ public class CustomInteractionOperandPreferencePage extends InteractionOperandPr
/**
* @see org.eclipse.papyrus.infra.gmfdiag.preferences.pages.AbstractPapyrusNodePreferencePage#createPageContents(org.eclipse.swt.widgets.Composite)
- *
+ *
* @param parent
*/
@Override
@@ -57,7 +57,7 @@ public class CustomInteractionOperandPreferencePage extends InteractionOperandPr
Group group = new Group(parent, SWT.NONE);
group.setText("Guard");
group.setLayout(new GridLayout());
- //Guard Visibility
+ // Guard Visibility
guardVisibleButton = new Button(group, SWT.CHECK);
guardVisibleButton.setText("Show");
guardVisibleButton.setSelection(getPreferenceStore().getBoolean(GUARD_VISIBILITY));
@@ -65,24 +65,24 @@ public class CustomInteractionOperandPreferencePage extends InteractionOperandPr
/**
* @see org.eclipse.papyrus.infra.gmfdiag.preferences.pages.AbstractPapyrusPreferencePage#performDefaults()
- *
+ *
*/
@Override
protected void performDefaults() {
super.performDefaults();
- if(guardVisibleButton != null && !guardVisibleButton.isDisposed()) {
+ if (guardVisibleButton != null && !guardVisibleButton.isDisposed()) {
guardVisibleButton.setSelection(getPreferenceStore().getDefaultBoolean(GUARD_VISIBILITY));
}
}
/**
* @see org.eclipse.jface.preference.PreferencePage#performApply()
- *
+ *
*/
@Override
protected void performApply() {
super.performApply();
- if(guardVisibleButton != null && !guardVisibleButton.isDisposed()) {
+ if (guardVisibleButton != null && !guardVisibleButton.isDisposed()) {
getPreferenceStore().setValue(GUARD_VISIBILITY, guardVisibleButton.getSelection());
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DestructionEventPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DestructionEventPreferencePage.java
index 3a926005543..23626c9d5ca 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DestructionEventPreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DestructionEventPreferencePage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -47,13 +47,16 @@ public class DestructionEventPreferencePage extends AbstractPapyrusNodePreferenc
String key = PackageEditPart.MODEL_ID + "_DestructionEvent";
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.WIDTH), 40);
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.HEIGHT), 40);
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
// Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
+ // org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
+ // new org.eclipse.swt.graphics.RGB(255, 255, 255),
+ // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT),
+ // gradientPreferenceConverter.getPreferenceValue());
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomEditPartProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomEditPartProvider.java
index a82666966dc..d1e2256ca18 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomEditPartProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomEditPartProvider.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -28,27 +28,28 @@ public class CustomEditPartProvider extends UMLEditPartProvider {
@Override
protected IGraphicalEditPart createEditPart(View view) {
IGraphicalEditPart customEditPart = createCustomEditPart(view);
- if(customEditPart != null) {
+ if (customEditPart != null) {
return customEditPart;
}
return super.createEditPart(view);
}
protected IGraphicalEditPart createCustomEditPart(View view) {
- if(GateEditPart.GATE_TYPE.equals(view.getType())) {
+ if (GateEditPart.GATE_TYPE.equals(view.getType())) {
return new GateEditPart(view);
- } else if(GateNameEditPart.GATE_NAME_TYPE.equals(view.getType())) {
+ } else if (GateNameEditPart.GATE_NAME_TYPE.equals(view.getType())) {
return new GateNameEditPart(view);
- } else if(InteractionOperandGuardEditPart.GUARD_TYPE.equals(view.getType())) {
+ } else if (InteractionOperandGuardEditPart.GUARD_TYPE.equals(view.getType())) {
return new InteractionOperandGuardEditPart(view);
- } else if(BehaviorExecutionSpecificationBehaviorEditPart.BEHAVIOR_TYPE.equals(view.getType())) {
+ } else if (BehaviorExecutionSpecificationBehaviorEditPart.BEHAVIOR_TYPE.equals(view.getType())) {
return new BehaviorExecutionSpecificationBehaviorEditPart(view);
}
- if(view instanceof Connector) {
- if(((Connector)view).getType().equals(SequenceUtil.OBSERVATION_LINK_TYPE))
- return new ObservationLinkEditPart((View)view);
+ if (view instanceof Connector) {
+ if (((Connector) view).getType().equals(SequenceUtil.OBSERVATION_LINK_TYPE)) {
+ return new ObservationLinkEditPart(view);
+ }
}
- switch(UMLVisualIDRegistry.getVisualID(view)) {
+ switch (UMLVisualIDRegistry.getVisualID(view)) {
case PackageEditPart.VISUAL_ID:
return new CustomPackageEditPart(view);
case InteractionEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomEditPolicyProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomEditPolicyProvider.java
index 133e1322008..d283657e5f1 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomEditPolicyProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomEditPolicyProvider.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2011 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
@@ -44,67 +44,69 @@ import org.eclipse.uml2.uml.Observation;
/**
* this is an editpolicy provider in charge to install a policy to navigate between diagrams and elements
- *
+ *
*/
public class CustomEditPolicyProvider implements IEditPolicyProvider {
/**
- *
+ *
* {@inheritDoc}
*/
+ @Override
public void addProviderChangeListener(IProviderChangeListener listener) {
}
/**
- *
+ *
* {@inheritDoc}
*/
+ @Override
public void createEditPolicies(final EditPart editPart) {
EditPolicy editPolicy = editPart.getEditPolicy(EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- if(editPolicy != null) {
+ if (editPolicy != null) {
editPart.removeEditPolicy(EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- //fixed bug about display Connection Handles.
+ // fixed bug about display Connection Handles.
editPart.installEditPolicy(EditPolicyRoles.CONNECTION_HANDLES_ROLE, new SequenceConnectionHandleEditPolicy());
}
installHighlightPolicy(editPart);
SequenceUtil.installObservationLinkPolicy(editPart);
- //install annotated link edit policy.
- if(editPart instanceof IGraphicalEditPart) {
+ // install annotated link edit policy.
+ if (editPart instanceof IGraphicalEditPart) {
Object model = editPart.getModel();
- if(model instanceof View) {
- View view = (View)model;
- EObject element = ViewUtil.resolveSemanticElement((View)model);
- if(element instanceof Element && editPart instanceof INodeEditPart) {
+ if (model instanceof View) {
+ View view = (View) model;
+ EObject element = ViewUtil.resolveSemanticElement((View) model);
+ if (element instanceof Element && editPart instanceof INodeEditPart) {
installEditPolicy(editPart, new AnnotatedLinkEndEditPolicy(), AnnotatedLinkEndEditPolicy.ANNOTATED_LINK_END_ROLE);
}
- if(editPart instanceof INodeEditPart && (element instanceof Constraint || element instanceof Observation || element instanceof Comment)) {
+ if (editPart instanceof INodeEditPart && (element instanceof Constraint || element instanceof Observation || element instanceof Comment)) {
installEditPolicy(editPart, new AnnotatedLinkStartEditPolicy(), AnnotatedLinkStartEditPolicy.ANNOTATED_LINK_START_ROLE);
editPart.removeEditPolicy(EditPolicyRoles.CONNECTION_HANDLES_ROLE);
editPart.installEditPolicy(EditPolicyRoles.CONNECTION_HANDLES_ROLE, new AnnotatedConnectionHandleEditPolicy());
}
- //Ordering fragments after moving and resizing, See https://bugs.eclipse.org/bugs/show_bug.cgi?id=403233
- if(view.isSetElement() && (view.getElement() instanceof InteractionFragment)) {
+ // Ordering fragments after moving and resizing, See https://bugs.eclipse.org/bugs/show_bug.cgi?id=403233
+ if (view.isSetElement() && (view.getElement() instanceof InteractionFragment)) {
editPart.installEditPolicy(InteractionFragmentsOrderingEditPolicy.ORDERING_ROLE, new InteractionFragmentsOrderingEditPolicy());
}
}
}
- //install/removel Tooltip EditPolicy
+ // install/removel Tooltip EditPolicy
TooltipUtil.manageTooltipEditPolicy(editPart);
}
/**
* Safely install a EditPolicy, if the editpolicy with given role is existed in editpart, ignore it.
- *
+ *
* @param editPart
* @param editPolicy
* @param role
*/
private void installEditPolicy(EditPart editPart, EditPolicy editPolicy, String role) {
- if(editPart == null || editPolicy == null) {
+ if (editPart == null || editPolicy == null) {
return;
}
EditPolicy myEditPolicy = editPart.getEditPolicy(role);
- if(myEditPolicy == null) {
+ if (myEditPolicy == null) {
editPart.installEditPolicy(role, editPolicy);
}
}
@@ -114,26 +116,28 @@ public class CustomEditPolicyProvider implements IEditPolicyProvider {
}
/**
- *
+ *
* {@inheritDoc}
*/
+ @Override
public boolean provides(IOperation operation) {
- CreateEditPoliciesOperation epOperation = (CreateEditPoliciesOperation)operation;
- if(!(epOperation.getEditPart() instanceof GraphicalEditPart) && !(epOperation.getEditPart() instanceof ConnectionEditPart)) {
+ CreateEditPoliciesOperation epOperation = (CreateEditPoliciesOperation) operation;
+ if (!(epOperation.getEditPart() instanceof GraphicalEditPart) && !(epOperation.getEditPart() instanceof ConnectionEditPart)) {
return false;
}
EditPart gep = epOperation.getEditPart();
- String diagramType = ((View)gep.getModel()).getDiagram().getType();
- if(PackageEditPart.MODEL_ID.equals(diagramType)) {
+ String diagramType = ((View) gep.getModel()).getDiagram().getType();
+ if (PackageEditPart.MODEL_ID.equals(diagramType)) {
return true;
}
return false;
}
/**
- *
+ *
* {@inheritDoc}
*/
+ @Override
public void removeProviderChangeListener(IProviderChangeListener listener) {
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomModelingAssistantProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomModelingAssistantProvider.java
index 822223c0c2d..477554a57ee 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomModelingAssistantProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomModelingAssistantProvider.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -29,11 +29,12 @@ import org.eclipse.uml2.uml.Observation;
*/
public class CustomModelingAssistantProvider extends UMLModelingAssistantProvider {
+ @Override
public List getRelTypesOnSource(IAdaptable source) {
- IGraphicalEditPart sourceEditPart = (IGraphicalEditPart)source.getAdapter(IGraphicalEditPart.class);
- if(sourceEditPart != null) {
+ IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source.getAdapter(IGraphicalEditPart.class);
+ if (sourceEditPart != null) {
EObject element = sourceEditPart.resolveSemanticElement();
- if(element instanceof Constraint || element instanceof Observation || element instanceof Comment) {
+ if (element instanceof Constraint || element instanceof Observation || element instanceof Comment) {
ArrayList<IElementType> types = new ArrayList<IElementType>(1);
types.add(UMLElementTypes.CommentAnnotatedElement_4010);
return types;
@@ -43,19 +44,18 @@ public class CustomModelingAssistantProvider extends UMLModelingAssistantProvide
}
/**
- * @see org.eclipse.papyrus.uml.diagram.sequence.providers.UMLModelingAssistantProvider#getRelTypesOnSourceAndTarget(org.eclipse.core.runtime.IAdaptable,
- * org.eclipse.core.runtime.IAdaptable)
- *
+ * @see org.eclipse.papyrus.uml.diagram.sequence.providers.UMLModelingAssistantProvider#getRelTypesOnSourceAndTarget(org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IAdaptable)
+ *
* @param source
* @param target
* @return
*/
@Override
public List getRelTypesOnSourceAndTarget(IAdaptable source, IAdaptable target) {
- IGraphicalEditPart sourceEditPart = (IGraphicalEditPart)source.getAdapter(IGraphicalEditPart.class);
- if(sourceEditPart != null) {
+ IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source.getAdapter(IGraphicalEditPart.class);
+ if (sourceEditPart != null) {
EObject element = sourceEditPart.resolveSemanticElement();
- if(element instanceof Constraint || element instanceof Observation || element instanceof Comment) {
+ if (element instanceof Constraint || element instanceof Observation || element instanceof Comment) {
ArrayList<IElementType> types = new ArrayList<IElementType>(1);
types.add(UMLElementTypes.CommentAnnotatedElement_4010);
return types;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomNamespaceEditPolicyProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomNamespaceEditPolicyProvider.java
index f8f6fdd8c70..7be06f6a964 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomNamespaceEditPolicyProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomNamespaceEditPolicyProvider.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -32,26 +32,27 @@ import org.eclipse.uml2.uml.Namespace;
/**
* An edit policy provider to install
- *
+ *
* @author Boutheina Bannour
- *
+ *
*/
public class CustomNamespaceEditPolicyProvider extends AbstractProvider implements IEditPolicyProvider {
+ @Override
public boolean provides(IOperation operation) {
- CreateEditPoliciesOperation epOperation = (CreateEditPoliciesOperation)operation;
+ CreateEditPoliciesOperation epOperation = (CreateEditPoliciesOperation) operation;
EditPart editPart = epOperation.getEditPart();
- if(editPart == null) {
+ if (editPart == null) {
return false;
}
EObject eElement = EMFHelper.getEObject(editPart);
- if(!(eElement instanceof Namespace)) {
+ if (!(eElement instanceof Namespace)) {
return false;
}
try {
// check whether the element is a papyrus element.
ServicesRegistry registry = ServiceUtilsForEObject.getInstance().getServiceRegistry(eElement);
- if(registry == null) {
+ if (registry == null) {
return false;
}
} catch (Exception ex) {
@@ -61,13 +62,14 @@ public class CustomNamespaceEditPolicyProvider extends AbstractProvider implemen
return (editPart instanceof IPrimaryEditPart);
}
+ @Override
public void createEditPolicies(EditPart editPart) {
// install policy for InteractionEditPart
- if(editPart instanceof InteractionEditPart) {
+ if (editPart instanceof InteractionEditPart) {
editPart.installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomInteractionContextLinkSemanticEditPolicy());
}
// install policy for InteractionOperandEditPart
- if(editPart instanceof InteractionOperandEditPart) {
+ if (editPart instanceof InteractionOperandEditPart) {
editPart.installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomInteractionOperandContextLinkSemanticEditPolicy());
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomValidationProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomValidationProvider.java
index a3e8128da97..a9c272b7d45 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomValidationProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomValidationProvider.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -47,13 +47,14 @@ public class CustomValidationProvider extends UMLValidationProvider {
/**
* select all moved edit parts which are linked to an occurrence specification
*/
+ @Override
public boolean selects(Object object) {
- if(object instanceof Bounds) {
+ if (object instanceof Bounds) {
// validate on resize or move
- object = ((Bounds)object).eContainer();
+ object = ((Bounds) object).eContainer();
}
- if(object instanceof View && PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID((View)object))) {
- final int id = UMLVisualIDRegistry.getVisualID((View)object);
+ if (object instanceof View && PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID((View) object))) {
+ final int id = UMLVisualIDRegistry.getVisualID((View) object);
boolean result = false;
// Lifeline
result = result || id == LifelineEditPart.VISUAL_ID;
@@ -65,10 +66,10 @@ public class CustomValidationProvider extends UMLValidationProvider {
result = result || id == CombinedFragment2EditPart.VISUAL_ID;
result = result || id == InteractionOperandEditPart.VISUAL_ID;
// Time related : do nothing, the real event support will be also moved
- //result = result || id == TimeConstraintEditPart.VISUAL_ID;
- //result = result || id == TimeObservationEditPart.VISUAL_ID;
- //result = result || id == DurationConstraintEditPart.VISUAL_ID;
- //result = result || id == DurationObservationEditPart.VISUAL_ID;
+ // result = result || id == TimeConstraintEditPart.VISUAL_ID;
+ // result = result || id == TimeObservationEditPart.VISUAL_ID;
+ // result = result || id == DurationConstraintEditPart.VISUAL_ID;
+ // result = result || id == DurationObservationEditPart.VISUAL_ID;
// Messages
result = result || id == MessageEditPart.VISUAL_ID;
result = result || id == Message2EditPart.VISUAL_ID;
@@ -78,7 +79,7 @@ public class CustomValidationProvider extends UMLValidationProvider {
result = result || id == Message6EditPart.VISUAL_ID;
result = result || id == Message7EditPart.VISUAL_ID;
// General Ordering : do nothing, the real event support will be also moved
- //result = result || id == GeneralOrderingEditPart.VISUAL_ID;
+ // result = result || id == GeneralOrderingEditPart.VISUAL_ID;
return result;
}
return false;
@@ -90,6 +91,7 @@ public class CustomValidationProvider extends UMLValidationProvider {
/**
* do not presume on target type
*/
+ @Override
public IStatus validate(IValidationContext ctx) {
// do not presume on target type
EObject target = ctx.getTarget();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomViewProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomViewProvider.java
index 88437eb3196..0db2cd2ae52 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomViewProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomViewProvider.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -62,6 +62,7 @@ import org.eclipse.uml2.uml.InteractionOperand;
*/
public class CustomViewProvider extends UMLViewProvider {
+ @Override
protected boolean provides(CreateNodeViewOperation op) {
if (op.getContainerView() == null) {
return false;
@@ -72,12 +73,14 @@ public class CustomViewProvider extends UMLViewProvider {
// UMLVisualIDRegistry.getNodeVisualID(View,
// EObject)
if (InteractionInteractionCompartmentEditPart.VISUAL_ID == UMLVisualIDRegistry
- .getVisualID(op.getContainerView()))
+ .getVisualID(op.getContainerView())) {
return true;
+ }
}
return super.provides(op);
}
+ @Override
protected boolean provides(CreateViewForKindOperation op) {
if (op.getContainerView() == null) {
return false;
@@ -88,8 +91,9 @@ public class CustomViewProvider extends UMLViewProvider {
// UMLVisualIDRegistry.getNodeVisualID(View,
// EObject)
if (InteractionInteractionCompartmentEditPart.VISUAL_ID == UMLVisualIDRegistry
- .getVisualID(op.getContainerView()))
+ .getVisualID(op.getContainerView())) {
return true;
+ }
}
return super.provides(op);
}
@@ -110,6 +114,7 @@ public class CustomViewProvider extends UMLViewProvider {
return edge;
}
+ @Override
public Node createTimeObservation_3020(EObject domainElement,
View containerView, int index, boolean persisted,
PreferencesHint preferencesHint) {
@@ -158,6 +163,7 @@ public class CustomViewProvider extends UMLViewProvider {
return node;
}
+ @Override
public Node createDurationConstraint_3021(EObject domainElement,
View containerView, int index, boolean persisted,
PreferencesHint preferencesHint) {
@@ -196,6 +202,7 @@ public class CustomViewProvider extends UMLViewProvider {
return node;
}
+ @Override
public Node createCombinedFragment_3004(EObject domainElement,
View containerView, int index, boolean persisted,
PreferencesHint preferencesHint) {
@@ -231,6 +238,7 @@ public class CustomViewProvider extends UMLViewProvider {
return node;
}
+ @Override
public Node createDurationConstraint_3023(EObject domainElement,
View containerView, int index, boolean persisted,
PreferencesHint preferencesHint) {
@@ -268,6 +276,7 @@ public class CustomViewProvider extends UMLViewProvider {
return node;
}
+ @Override
public Node createDurationObservation_3024(EObject domainElement,
View containerView, int index, boolean persisted,
PreferencesHint preferencesHint) {
@@ -304,6 +313,7 @@ public class CustomViewProvider extends UMLViewProvider {
return node;
}
+ @Override
public Node createConsiderIgnoreFragment_3007(EObject domainElement,
View containerView, int index, boolean persisted,
PreferencesHint preferencesHint) {
@@ -339,6 +349,7 @@ public class CustomViewProvider extends UMLViewProvider {
return node;
}
+ @Override
public Edge createCommentAnnotatedElement_4010(View containerView,
int index, boolean persisted, PreferencesHint preferencesHint) {
Edge edge = NotationFactory.eINSTANCE.createEdge(); // override
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/DisplayBehaviorContributionItem.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/DisplayBehaviorContributionItem.java
index 7f7cd36d9b7..4ee5a7b2713 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/DisplayBehaviorContributionItem.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/DisplayBehaviorContributionItem.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -19,7 +19,6 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.jface.action.ContributionItem;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.BehaviorExecutionSpecificationBehaviorEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.util.BehaviorDisplayHelper;
import org.eclipse.swt.SWT;
@@ -41,9 +40,10 @@ public class DisplayBehaviorContributionItem extends ContributionItem implements
/**
* @see org.eclipse.ui.menus.IWorkbenchContribution#initialize(org.eclipse.ui.services.IServiceLocator)
- *
+ *
* @param serviceLocator
*/
+ @Override
public void initialize(IServiceLocator serviceLocator) {
this.serviceLocator = serviceLocator;
}
@@ -54,11 +54,11 @@ public class DisplayBehaviorContributionItem extends ContributionItem implements
}
private ISelection getSelection() {
- if(serviceLocator == null) {
+ if (serviceLocator == null) {
return null;
}
- ISelectionService selectionService = (ISelectionService)serviceLocator.getService(ISelectionService.class);
- if(selectionService != null) {
+ ISelectionService selectionService = (ISelectionService) serviceLocator.getService(ISelectionService.class);
+ if (selectionService != null) {
return selectionService.getSelection();
}
return null;
@@ -66,7 +66,7 @@ public class DisplayBehaviorContributionItem extends ContributionItem implements
/**
* @see org.eclipse.jface.action.ContributionItem#fill(org.eclipse.swt.widgets.Menu, int)
- *
+ *
* @param menu
* @param index
*/
@@ -74,20 +74,21 @@ public class DisplayBehaviorContributionItem extends ContributionItem implements
public void fill(Menu menu, int index) {
super.fill(menu, index);
ISelection selection = getSelection();
- if(selection == null || selection.isEmpty()) {
+ if (selection == null || selection.isEmpty()) {
return;
}
- if(selection instanceof IStructuredSelection) {
- Object firstElement = ((IStructuredSelection)selection).getFirstElement();
- if(firstElement instanceof BehaviorExecutionSpecificationEditPart) {
- final View view = ((BehaviorExecutionSpecificationEditPart)firstElement).getNotationView();
- final TransactionalEditingDomain domain = ((BehaviorExecutionSpecificationEditPart)firstElement).getEditingDomain();
+ if (selection instanceof IStructuredSelection) {
+ Object firstElement = ((IStructuredSelection) selection).getFirstElement();
+ if (firstElement instanceof BehaviorExecutionSpecificationEditPart) {
+ final View view = ((BehaviorExecutionSpecificationEditPart) firstElement).getNotationView();
+ final TransactionalEditingDomain domain = ((BehaviorExecutionSpecificationEditPart) firstElement).getEditingDomain();
boolean displayBehavior = BehaviorDisplayHelper.shouldDisplayBehavior(view);
- if(displayBehavior) {
+ if (displayBehavior) {
MenuItem hide = new MenuItem(menu, SWT.NONE, 0);
hide.setText("Hide Behavior Label");
hide.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
Command cmd = BehaviorDisplayHelper.getChangeDisplayBehaviorCommand(domain, view, false);
domain.getCommandStack().execute(cmd);
@@ -99,6 +100,7 @@ public class DisplayBehaviorContributionItem extends ContributionItem implements
show.setText("Display Behavior Label");
show.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
Command cmd = BehaviorDisplayHelper.getChangeDisplayBehaviorCommand(domain, view, true);
domain.getCommandStack().execute(cmd);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/DurationConstraintContributionItem.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/DurationConstraintContributionItem.java
index 286f8938424..aa59079669d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/DurationConstraintContributionItem.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/DurationConstraintContributionItem.java
@@ -46,7 +46,7 @@ public class DurationConstraintContributionItem extends ContributionItem impleme
private MenuItem subMenuItem;
/**
- *
+ *
*/
public DurationConstraintContributionItem() {
setId("org.eclipse.papyrus.sequence.duraitonconstraint.menuitem");
@@ -65,7 +65,7 @@ public class DurationConstraintContributionItem extends ContributionItem impleme
*/
@Override
public void dispose() {
- if(subMenuItem != null && !subMenuItem.isDisposed()) {
+ if (subMenuItem != null && !subMenuItem.isDisposed()) {
subMenuItem.dispose();
}
}
@@ -90,18 +90,18 @@ public class DurationConstraintContributionItem extends ContributionItem impleme
// first case: this class was not able to retrieve the selection service
// or does not understand the current selection.
// does not build any sub-menu and returns.
- if(selectedElement == null) {
+ if (selectedElement == null) {
return;
}
// get the uml object type of this element, using the business resolver
final Object businessObject = EMFHelper.getEObject(selectedElement);
// no object found: exit
- if(businessObject == null || !(businessObject instanceof DurationConstraint)) {
+ if (businessObject == null || !(businessObject instanceof DurationConstraint)) {
return;
}
- createSubMenu(menu, index, (DurationConstraint)businessObject);
+ createSubMenu(menu, index, (DurationConstraint) businessObject);
}
protected void createSubMenu(Menu menu, int index, DurationConstraint businessObject) {
@@ -110,10 +110,12 @@ public class DurationConstraintContributionItem extends ContributionItem impleme
subMenuItem.addSelectionListener(new SelectionListener() {
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {
}
+ @Override
public void widgetSelected(SelectionEvent e) {
doRotate();
}
@@ -122,26 +124,26 @@ public class DurationConstraintContributionItem extends ContributionItem impleme
/**
* Retrieves and return the current selected element
- *
+ *
* @return the current selected element
*/
protected Object getSelectedElement() {
ISelection selection = getSelection();
// this checks if it is the good instance AND if it is not null
- if(selection instanceof IStructuredSelection) {
- return ((IStructuredSelection)selection).getFirstElement();
+ if (selection instanceof IStructuredSelection) {
+ return ((IStructuredSelection) selection).getFirstElement();
}
return null;
}
/**
* Retrieves and return the current selection
- *
+ *
* @return the current selection
*/
protected ISelection getSelection() {
ISelectionService selectionService = getSelectionService();
- if(selectionService != null) {
+ if (selectionService != null) {
return selectionService.getSelection();
}
return null;
@@ -149,12 +151,12 @@ public class DurationConstraintContributionItem extends ContributionItem impleme
/**
* Returns the selection service for the current workbench
- *
+ *
* @return the selection service for the current workbench or <code>null</code> if no selection
* service was found.
*/
protected ISelectionService getSelectionService() {
- ISelectionService selectionService = (ISelectionService)serviceLocator.getService(ISelectionService.class);
+ ISelectionService selectionService = (ISelectionService) serviceLocator.getService(ISelectionService.class);
return selectionService;
}
@@ -169,7 +171,7 @@ public class DurationConstraintContributionItem extends ContributionItem impleme
/**
* The default implementation of this <code>IContributionItem</code> method does nothing.
* Subclasses may override.
- *
+ *
* @since 3.0
*/
@Override
@@ -179,7 +181,7 @@ public class DurationConstraintContributionItem extends ContributionItem impleme
/**
* The default implementation of this <code>IContributionItem</code> method does nothing.
* Subclasses may override.
- *
+ *
* @since 3.0
*/
@Override
@@ -255,6 +257,7 @@ public class DurationConstraintContributionItem extends ContributionItem impleme
/**
* {@inheritDoc}
*/
+ @Override
public void initialize(IServiceLocator serviceLocator) {
assert (serviceLocator != null);
this.serviceLocator = serviceLocator;
@@ -262,10 +265,11 @@ public class DurationConstraintContributionItem extends ContributionItem impleme
private void doRotate() {
Object element = getSelectedElement();
- if(!(element instanceof CustomDurationConstraintEditPart))
+ if (!(element instanceof CustomDurationConstraintEditPart)) {
return;
+ }
- CustomDurationConstraintEditPart durationPart = (CustomDurationConstraintEditPart)element;
+ CustomDurationConstraintEditPart durationPart = (CustomDurationConstraintEditPart) element;
boolean isVertical = durationPart.isArrowVertical();
CompositeCommand compositeCmd = new CompositeCommand("rotate");
@@ -278,28 +282,31 @@ public class DurationConstraintContributionItem extends ContributionItem impleme
// update anchor
List list = durationPart.getSourceConnections();
- for(Object o : list)
- if(o instanceof CustomCommentAnnotatedElementEditPart) {
- CustomCommentAnnotatedElementEditPart connectionPart = (CustomCommentAnnotatedElementEditPart)o;
+ for (Object o : list) {
+ if (o instanceof CustomCommentAnnotatedElementEditPart) {
+ CustomCommentAnnotatedElementEditPart connectionPart = (CustomCommentAnnotatedElementEditPart) o;
String terminal = AnchorHelper.getAnchorId(connectionPart.getEditingDomain(), connectionPart, true);
- if(terminal.length() > 0) {
+ if (terminal.length() > 0) {
PrecisionPoint pt = BaseSlidableAnchor.parseTerminalString(terminal);
SetConnectionAnchorsCommand rotateAnchorsCommand = new SetConnectionAnchorsCommand(connectionPart.getEditingDomain(), "Rotate Duration Anchors");
rotateAnchorsCommand.setEdgeAdaptor(new EObjectAdapter(connectionPart.getNotationView()));
- if(isVertical) {
- if(pt.y < 0.3)
+ if (isVertical) {
+ if (pt.y < 0.3) {
rotateAnchorsCommand.setNewSourceTerminal("(0,0.5){L}");
- else if(pt.y > 0.7)
+ } else if (pt.y > 0.7) {
rotateAnchorsCommand.setNewSourceTerminal("(1,0.5){R}");
+ }
} else {
- if(pt.x < 0.3)
+ if (pt.x < 0.3) {
rotateAnchorsCommand.setNewSourceTerminal("(0.5,0){T}");
- else if(pt.x > 0.7)
+ } else if (pt.x > 0.7) {
rotateAnchorsCommand.setNewSourceTerminal("(0.5,1){D}");
+ }
}
compositeCmd.add(rotateAnchorsCommand);
}
}
+ }
// execute command
durationPart.getEditingDomain().getCommandStack().execute(new GMFtoEMFCommandWrapper(compositeCmd));
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/PostEditPolicyProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/PostEditPolicyProvider.java
index ec59afc8ebf..4a3c951cf35 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/PostEditPolicyProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/PostEditPolicyProvider.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -39,36 +39,38 @@ import org.eclipse.papyrus.uml.diagram.stereotype.edition.editpolicies.AppliedSt
/**
* Highest priority EditPolicyProvider, which can ensure the installed EditPolicies correctly.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class PostEditPolicyProvider implements IEditPolicyProvider {
/**
* @see org.eclipse.gmf.runtime.common.core.service.IProvider#addProviderChangeListener(org.eclipse.gmf.runtime.common.core.service.IProviderChangeListener)
- *
+ *
* @param listener
*/
+ @Override
public void addProviderChangeListener(IProviderChangeListener listener) {
}
/**
* @see org.eclipse.gmf.runtime.common.core.service.IProvider#provides(org.eclipse.gmf.runtime.common.core.service.IOperation)
- *
+ *
* @param operation
* @return
*/
+ @Override
public boolean provides(IOperation operation) {
- CreateEditPoliciesOperation epOperation = (CreateEditPoliciesOperation)operation;
- if(!(epOperation.getEditPart() instanceof GraphicalEditPart) && !(epOperation.getEditPart() instanceof ConnectionEditPart)) {
+ CreateEditPoliciesOperation epOperation = (CreateEditPoliciesOperation) operation;
+ if (!(epOperation.getEditPart() instanceof GraphicalEditPart) && !(epOperation.getEditPart() instanceof ConnectionEditPart)) {
return false;
}
EditPart gep = epOperation.getEditPart();
- String diagramType = ((View)gep.getModel()).getDiagram().getType();
- if(PackageEditPart.MODEL_ID.equals(diagramType)) {
+ String diagramType = ((View) gep.getModel()).getDiagram().getType();
+ if (PackageEditPart.MODEL_ID.equals(diagramType)) {
return true;
}
return false;
@@ -76,23 +78,27 @@ public class PostEditPolicyProvider implements IEditPolicyProvider {
/**
* @see org.eclipse.gmf.runtime.common.core.service.IProvider#removeProviderChangeListener(org.eclipse.gmf.runtime.common.core.service.IProviderChangeListener)
- *
+ *
* @param listener
*/
+ @Override
public void removeProviderChangeListener(IProviderChangeListener listener) {
}
/**
* @see org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.IEditPolicyProvider#createEditPolicies(org.eclipse.gef.EditPart)
- *
+ *
* @param editPart
*/
+ @Override
public void createEditPolicies(EditPart editPart) {
- //Replace AppliedStereotypeCommentCreationEditPolicy to a custom one.
- if(editPart instanceof AbstractExecutionSpecificationEditPart || editPart instanceof CustomDestructionOccurrenceSpecificationEditPart || editPart instanceof CustomDurationConstraintEditPart || editPart instanceof CustomDurationConstraintEditPart || editPart instanceof CustomStateInvariantEditPart || editPart instanceof CustomTimeConstraintLabelEditPart || editPart instanceof CustomTimeObservationLabelEditPart || editPart instanceof AbstractMessageEditPart || editPart instanceof GeneralOrderingEditPart || editPart instanceof CustomContinuationEditPart || editPart instanceof CustomInteractionOperandEditPart || editPart instanceof GateEditPart) {
+ // Replace AppliedStereotypeCommentCreationEditPolicy to a custom one.
+ if (editPart instanceof AbstractExecutionSpecificationEditPart || editPart instanceof CustomDestructionOccurrenceSpecificationEditPart || editPart instanceof CustomDurationConstraintEditPart || editPart instanceof CustomDurationConstraintEditPart
+ || editPart instanceof CustomStateInvariantEditPart || editPart instanceof CustomTimeConstraintLabelEditPart || editPart instanceof CustomTimeObservationLabelEditPart || editPart instanceof AbstractMessageEditPart
+ || editPart instanceof GeneralOrderingEditPart || editPart instanceof CustomContinuationEditPart || editPart instanceof CustomInteractionOperandEditPart || editPart instanceof GateEditPart) {
editPart.installEditPolicy(AppliedStereotypeCommentCreationEditPolicy.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/service/DurationCreationTool.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/service/DurationCreationTool.java
index a684a59367d..ed93ca15a4b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/service/DurationCreationTool.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/service/DurationCreationTool.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -16,6 +16,7 @@ package org.eclipse.papyrus.uml.diagram.sequence.service;
import java.util.List;
import java.util.Map;
+import org.eclipse.draw2d.Cursors;
import org.eclipse.draw2d.FigureCanvas;
import org.eclipse.draw2d.Viewport;
import org.eclipse.draw2d.geometry.Rectangle;
@@ -88,14 +89,14 @@ public class DurationCreationTool extends AspectUnspecifiedTypeCreationTool {
/**
* Constructor of the creation tool.
- *
+ *
* @param elementTypes
- * element types the tool can create
+ * element types the tool can create
*/
public DurationCreationTool(List<IElementType> elementTypes) {
super(elementTypes);
setDefaultCursor(SharedCursors.CURSOR_PLUG);
- setDisabledCursor(SharedCursors.NO);
+ setDisabledCursor(Cursors.NO);
}
/**
@@ -103,7 +104,7 @@ public class DurationCreationTool extends AspectUnspecifiedTypeCreationTool {
*/
@Override
protected boolean handleDrag() {
- if(isInState(STATE_CONNECTION_STARTED)) {
+ if (isInState(STATE_CONNECTION_STARTED)) {
return handleMove();
}
return false;
@@ -114,12 +115,12 @@ public class DurationCreationTool extends AspectUnspecifiedTypeCreationTool {
*/
@Override
protected boolean handleDragInProgress() {
- if(isInState(STATE_ACCESSIBLE_DRAG_IN_PROGRESS)) {
+ if (isInState(STATE_ACCESSIBLE_DRAG_IN_PROGRESS)) {
return handleMove();
}
{ // ----------- add for drag creation size -----
- if(isInState(STATE_DRAG_IN_PROGRESS)) {
+ if (isInState(STATE_DRAG_IN_PROGRESS)) {
updateTargetRequest();
setCurrentCommand(getCommand());
showTargetFeedback();
@@ -134,7 +135,7 @@ public class DurationCreationTool extends AspectUnspecifiedTypeCreationTool {
*/
@Override
protected String getDebugNameForState(int s) {
- if(s == STATE_CONNECTION_STARTED || s == STATE_ACCESSIBLE_DRAG_IN_PROGRESS) {
+ if (s == STATE_CONNECTION_STARTED || s == STATE_ACCESSIBLE_DRAG_IN_PROGRESS) {
return "Connection Started";//$NON-NLS-1$
}
return super.getDebugNameForState(s);
@@ -142,26 +143,26 @@ public class DurationCreationTool extends AspectUnspecifiedTypeCreationTool {
/**
* Sets the location of the request.
- *
+ *
* @see org.eclipse.gef.tools.TargetingTool#updateTargetRequest()
*/
@Override
protected void updateTargetRequest() {
- // CreateRequest req = getCreateRequest();
- // req.setLocation(getLocation());
- super.updateTargetRequest(); // ----------- add for drag creation size
+ // CreateRequest req = getCreateRequest();
+ // req.setLocation(getLocation());
+ super.updateTargetRequest(); // ----------- add for drag creation size
}
/**
* Sets the target request. This method is typically not called; subclasses normally override {@link #createTargetRequest()}.
- *
+ *
* @see org.eclipse.gef.tools.TargetingTool#setTargetRequest(org.eclipse.gef.Request)
* @param req
- * the target request
+ * the target request
*/
@Override
protected void setTargetRequest(Request req) {
- if(req == null && connectionSource != null) {
+ if (req == null && connectionSource != null) {
// do not erase the request when target changes (behavior inherited from CreationTool)
return;
}
@@ -184,7 +185,7 @@ public class DurationCreationTool extends AspectUnspecifiedTypeCreationTool {
* Subclasses may extend or override this method to do additional creation setup, such as
* prompting the user to choose an option about the connection being created. Returns <code>true</code> to indicate that the connection creation
* succeeded.
- *
+ *
* @return <code>true</code> if the connection creation was performed
*/
protected boolean handleCreateConnection() {
@@ -209,31 +210,32 @@ public class DurationCreationTool extends AspectUnspecifiedTypeCreationTool {
* When the button is first pressed, the source node and its command contribution are
* determined and locked in. After that time, the tool will be looking for the target
* node to complete the connection
- *
+ *
* @see org.eclipse.gef.tools.AbstractTool#handleButtonDown(int)
* @param button
- * which button is pressed
+ * which button is pressed
* @return <code>true</code> if the button down was processed
*/
@Override
protected boolean handleButtonDown(int button) {
- if(button == 1 && stateTransition(STATE_CONNECTION_STARTED, STATE_TERMINAL)) {
+ if (button == 1 && stateTransition(STATE_CONNECTION_STARTED, STATE_TERMINAL)) {
return handleCreateConnection();
}
- if(isInState(STATE_INITIAL) && button == 1) {
+ if (isInState(STATE_INITIAL) && button == 1) {
updateTargetRequest();
updateTargetUnderMouse();
setConnectionSource(getTargetEditPart());
- { // ----------- add for drag creation size
- if(getTargetEditPart() instanceof InteractionInteractionCompartmentEditPart)
+ { // ----------- add for drag creation size
+ if (getTargetEditPart() instanceof InteractionInteractionCompartmentEditPart) {
return super.handleButtonDown(button);
+ }
}
Command command = getCommand();
Request request = getTargetRequest();
- //target elements of request have been set
- if(command != null) {
+ // target elements of request have been set
+ if (command != null) {
setState(STATE_CONNECTION_STARTED);
setCurrentCommand(command);
viewer = getCurrentViewer();
@@ -243,12 +245,12 @@ public class DurationCreationTool extends AspectUnspecifiedTypeCreationTool {
extendedData.put(SequenceRequestConstant.OCCURRENCE_SPECIFICATION_LOCATION_2, null);
}
}
- if(isInState(STATE_INITIAL) && button != 1) {
+ if (isInState(STATE_INITIAL) && button != 1) {
setState(STATE_INVALID);
handleInvalidInput();
}
- if(isInState(STATE_CONNECTION_STARTED)) {
- //Fake a drag to cause feedback to be displayed immediately on mouse down.
+ if (isInState(STATE_CONNECTION_STARTED)) {
+ // Fake a drag to cause feedback to be displayed immediately on mouse down.
handleDrag();
}
return true;
@@ -259,17 +261,17 @@ public class DurationCreationTool extends AspectUnspecifiedTypeCreationTool {
*/
@Override
protected boolean handleMove() {
- if(isInState(STATE_CONNECTION_STARTED) && viewer != getCurrentViewer()) {
+ if (isInState(STATE_CONNECTION_STARTED) && viewer != getCurrentViewer()) {
return false;
}
- if(isInState(STATE_CONNECTION_STARTED | STATE_INITIAL | STATE_ACCESSIBLE_DRAG_IN_PROGRESS)) {
+ if (isInState(STATE_CONNECTION_STARTED | STATE_INITIAL | STATE_ACCESSIBLE_DRAG_IN_PROGRESS)) {
updateTargetRequest();
updateTargetUnderMouse();
showSourceFeedback();
showTargetFeedback();
setCurrentCommand(getCommand());
}
- if(isInState(STATE_CONNECTION_STARTED)) {
+ if (isInState(STATE_CONNECTION_STARTED)) {
// Expose the diagram as the user scrolls in the area handled by the
// autoexpose helper.
updateAutoexposeHelper();
@@ -279,23 +281,23 @@ public class DurationCreationTool extends AspectUnspecifiedTypeCreationTool {
/**
* Sets the source editpart for the creation
- *
+ *
* @param source
- * the source editpart node
+ * the source editpart node
*/
protected void setConnectionSource(EditPart source) {
- if(connectionSource != null) {
+ if (connectionSource != null) {
connectionSource.removeEditPartListener(deactivationListener);
}
connectionSource = source;
- if(connectionSource != null) {
+ if (connectionSource != null) {
connectionSource.addEditPartListener(deactivationListener);
}
}
/**
* Returns <code>true</code> if feedback is being shown.
- *
+ *
* @return <code>true</code> if showing source feedback
*/
protected boolean isShowingSourceFeedback() {
@@ -306,11 +308,11 @@ public class DurationCreationTool extends AspectUnspecifiedTypeCreationTool {
* Asks the source editpart to erase connection creation feedback.
*/
protected void eraseSourceFeedback() {
- if(!isShowingSourceFeedback()) {
+ if (!isShowingSourceFeedback()) {
return;
}
setFlag(FLAG_SOURCE_FEEDBACK, false);
- if(connectionSource != null) {
+ if (connectionSource != null) {
connectionSource.eraseSourceFeedback(getSourceRequest());
}
}
@@ -318,12 +320,12 @@ public class DurationCreationTool extends AspectUnspecifiedTypeCreationTool {
/**
* Scrolling can happen either in the {@link AbstractTool#STATE_INITIAL initial} state or
* once the source of the connection has been {@link AbstractConnectionCreationTool#STATE_CONNECTION_STARTED identified}.
- *
+ *
* @see org.eclipse.gef.Tool#mouseWheelScrolled(org.eclipse.swt.widgets.Event, org.eclipse.gef.EditPartViewer)
*/
@Override
public void mouseWheelScrolled(Event event, EditPartViewer viewer) {
- if(isInState(STATE_INITIAL | STATE_CONNECTION_STARTED)) {
+ if (isInState(STATE_INITIAL | STATE_CONNECTION_STARTED)) {
performViewerMouseWheel(event, viewer);
}
}
@@ -332,7 +334,7 @@ public class DurationCreationTool extends AspectUnspecifiedTypeCreationTool {
* Returns the request sent to the source node. The source node receives the same request
* that is used with the target node. The only difference is that at that time the
* request will be typed as {@link RequestConstants#REQ_CONNECTION_START}.
- *
+ *
* @return the request used with the source node editpart
*/
protected Request getSourceRequest() {
@@ -343,7 +345,7 @@ public class DurationCreationTool extends AspectUnspecifiedTypeCreationTool {
* Sends a show feedback request to the source editpart and sets the feedback flag.
*/
protected void showSourceFeedback() {
- if(connectionSource != null) {
+ if (connectionSource != null) {
connectionSource.showSourceFeedback(getSourceRequest());
}
setFlag(FLAG_SOURCE_FEEDBACK, true);
@@ -351,24 +353,24 @@ public class DurationCreationTool extends AspectUnspecifiedTypeCreationTool {
/**
* Unloads or resets the tool if the state is in the terminal or invalid state.
- *
+ *
* @see org.eclipse.gef.tools.AbstractTool#handleButtonUp(int)
*/
@Override
protected boolean handleButtonUp(int button) {
- if(isInState(STATE_CONNECTION_STARTED)) {
+ if (isInState(STATE_CONNECTION_STARTED)) {
handleCreateConnection();
}
{ // ----------- add for drag creation size ------
- if(stateTransition(STATE_DRAG | STATE_DRAG_IN_PROGRESS, STATE_TERMINAL)) {
+ if (stateTransition(STATE_DRAG | STATE_DRAG_IN_PROGRESS, STATE_TERMINAL)) {
eraseTargetFeedback();
unlockTargetEditPart();
performCreation(button);
}
}
setState(STATE_TERMINAL);
- if(isInState(STATE_TERMINAL | STATE_INVALID)) {
+ if (isInState(STATE_TERMINAL | STATE_INVALID)) {
handleFinished();
}
return true;
@@ -379,8 +381,8 @@ public class DurationCreationTool extends AspectUnspecifiedTypeCreationTool {
*/
@Override
protected boolean handleCommandStackChanged() {
- if(!isInState(STATE_INITIAL)) {
- if(getCurrentInput().isMouseButtonDown(1)) {
+ if (!isInState(STATE_INITIAL)) {
+ if (getCurrentInput().isMouseButtonDown(1)) {
setState(STATE_INVALID);
} else {
setState(STATE_INITIAL);
@@ -405,28 +407,28 @@ public class DurationCreationTool extends AspectUnspecifiedTypeCreationTool {
/**
* Calculate the cursor to display
- *
+ *
* @see org.eclipse.gef.tools.AbstractConnectionCreationTool#calculateCursor()
*/
@Override
protected Cursor calculateCursor() {
- if(isInState(STATE_CONNECTION_STARTED)) {
+ if (isInState(STATE_CONNECTION_STARTED)) {
// Give some feedback so the user knows the area where autoscrolling
// will occur.
- if(getAutoexposeHelper() != null) {
- return SharedCursors.HAND;
+ if (getAutoexposeHelper() != null) {
+ return Cursors.HAND;
} else {
// Give some feedback so the user knows that they can't drag
// outside the viewport.
- if(getCurrentViewer() != null) {
+ if (getCurrentViewer() != null) {
Control control = getCurrentViewer().getControl();
- if(control instanceof FigureCanvas) {
- Viewport viewport = ((FigureCanvas)control).getViewport();
+ if (control instanceof FigureCanvas) {
+ Viewport viewport = ((FigureCanvas) control).getViewport();
Rectangle rect = Rectangle.SINGLETON;
viewport.getClientArea(rect);
viewport.translateToParent(rect);
viewport.translateToAbsolute(rect);
- if(!rect.contains(getLocation())) {
+ if (!rect.contains(getLocation())) {
return getDisabledCursor();
}
}
@@ -434,9 +436,9 @@ public class DurationCreationTool extends AspectUnspecifiedTypeCreationTool {
}
}
Command command = getCurrentCommand();
- if(command != null && command.canExecute()) {
+ if (command != null && command.canExecute()) {
EditPart ep = getTargetEditPart();
- if(ep instanceof DiagramEditPart || ep instanceof CompartmentEditPart) {
+ if (ep instanceof DiagramEditPart || ep instanceof CompartmentEditPart) {
return CURSOR_TARGET_MENU;
}
}
@@ -445,16 +447,16 @@ public class DurationCreationTool extends AspectUnspecifiedTypeCreationTool {
/**
* Get the command to execute
- *
+ *
* @see org.eclipse.gmf.runtime.diagram.ui.tools.CreationTool#getCommand()
- *
+ *
* @return the command
*/
@Override
protected Command getCommand() {
- if(!antiScroll) {
+ if (!antiScroll) {
EditPart targetPart = getTargetEditPart();
- if(targetPart == null) {
+ if (targetPart == null) {
return null;
}
Request req = getTargetRequest();
@@ -499,10 +501,11 @@ public class DurationCreationTool extends AspectUnspecifiedTypeCreationTool {
* }
* }
*/
- if(targetPart instanceof InteractionInteractionCompartmentEditPart || targetPart instanceof ConnectionNodeEditPart)
+ if (targetPart instanceof InteractionInteractionCompartmentEditPart || targetPart instanceof ConnectionNodeEditPart) {
return targetPart.getCommand(req);
+ }
targetPart = getInteractionEditPart(targetPart);
- if(targetPart != null) {
+ if (targetPart != null) {
return targetPart.getCommand(req);
}
}
@@ -510,10 +513,10 @@ public class DurationCreationTool extends AspectUnspecifiedTypeCreationTool {
}
private EditPart getInteractionEditPart(EditPart editPart) {
- if(editPart == null) {
+ if (editPart == null) {
return null;
}
- if(editPart instanceof InteractionInteractionCompartmentEditPart) {
+ if (editPart instanceof InteractionInteractionCompartmentEditPart) {
return editPart;
}
return getInteractionEditPart(editPart.getParent());
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/BehaviorDisplayHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/BehaviorDisplayHelper.java
index 91063f64d34..04d074b38e5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/BehaviorDisplayHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/BehaviorDisplayHelper.java
@@ -65,7 +65,7 @@ public class BehaviorDisplayHelper extends AnnotationModelElementFactory {
public static Command getChangeDisplayBehaviorCommand(
TransactionalEditingDomain domain, View source, final Object display) {
return new CreateEAnnotationCommand(
- (TransactionalEditingDomain) domain, source, DISPLAY_BEHAVIOR) {
+ domain, source, DISPLAY_BEHAVIOR) {
@Override
protected void doExecute() {
@@ -144,6 +144,7 @@ public class BehaviorDisplayHelper extends AnnotationModelElementFactory {
}
}
+ @Override
protected Command getCommand(final Object value) {
return getChangeDisplayBehaviorCommand(
(TransactionalEditingDomain) domain, (View) source, value);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/CombinedFragmentDeleteHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/CombinedFragmentDeleteHelper.java
index 14a32e8f421..2494fa290e6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/CombinedFragmentDeleteHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/CombinedFragmentDeleteHelper.java
@@ -54,9 +54,10 @@ public class CombinedFragmentDeleteHelper {
this.elementToEdit = elementToEdit;
}
+ @Override
public Object getEditHelperContext() {
IClientContext context = getClientContext();
- if(context == null) {
+ if (context == null) {
return getElementToEdit();
} else {
return new EditHelperContext(getElementToEdit(), context);
@@ -83,15 +84,15 @@ public class CombinedFragmentDeleteHelper {
public MoveOperandFragmentsCommand(CombinedFragmentEditPart host, CombinedFragment cf, InteractionOperand op, EditRequest editRequest) {
super(null, editRequest.getElementToEdit(), editRequest);
InteractionOperand enclosingOp = cf.getEnclosingOperand();
- if(enclosingOp != null) {
+ if (enclosingOp != null) {
Element owner = enclosingOp.getOwner();
- if(owner instanceof CombinedFragment) {
+ if (owner instanceof CombinedFragment) {
this.parent = enclosingOp;
}
} else {
Element owner = cf.getOwner();
- if(owner instanceof Interaction) {
- this.parent = (InteractionFragment)owner;
+ if (owner instanceof Interaction) {
+ this.parent = (InteractionFragment) owner;
}
}
this.host = host;
@@ -107,14 +108,14 @@ public class CombinedFragmentDeleteHelper {
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(parent != null && !fragmentsToMove.isEmpty()) {
+ if (parent != null && !fragmentsToMove.isEmpty()) {
List<CombinedFragmentEditPart> parts = collectCombinedFragmentParts();
- if(parent instanceof InteractionOperand) {
- ((InteractionOperand)parent).getFragments().addAll(fragmentsToMove);
- moveToOperandPart((InteractionOperandEditPart)host.getParent(), parts);
- } else if(parent instanceof Interaction) {
- ((Interaction)parent).getFragments().addAll(fragmentsToMove);
- moveToInteractionPart((InteractionInteractionCompartmentEditPart)host.getParent(), parts);
+ if (parent instanceof InteractionOperand) {
+ ((InteractionOperand) parent).getFragments().addAll(fragmentsToMove);
+ moveToOperandPart((InteractionOperandEditPart) host.getParent(), parts);
+ } else if (parent instanceof Interaction) {
+ ((Interaction) parent).getFragments().addAll(fragmentsToMove);
+ moveToInteractionPart((InteractionInteractionCompartmentEditPart) host.getParent(), parts);
}
}
sourceOperand.getFragments().clear();
@@ -122,12 +123,12 @@ public class CombinedFragmentDeleteHelper {
}
private void moveToOperandPart(GraphicalEditPart op, List<CombinedFragmentEditPart> keepParts) {
- if(!keepParts.isEmpty()) {
- Rectangle parentBounds = getAbsoluteBounds((AbstractGraphicalEditPart)op.getParent());
- for(CombinedFragmentEditPart cef : keepParts) {
+ if (!keepParts.isEmpty()) {
+ Rectangle parentBounds = getAbsoluteBounds((AbstractGraphicalEditPart) op.getParent());
+ for (CombinedFragmentEditPart cef : keepParts) {
View view = cef.getNotationView();
op.getNotationView().getPersistedChildren().add(view);
- Bounds bounds = (Bounds)((Shape)cef.getNotationView()).getLayoutConstraint();
+ Bounds bounds = (Bounds) ((Shape) cef.getNotationView()).getLayoutConstraint();
Rectangle absolute = getAbsoluteBounds(cef);
bounds.setX(absolute.x() - parentBounds.x());
bounds.setY(absolute.y() - parentBounds.y());
@@ -136,12 +137,12 @@ public class CombinedFragmentDeleteHelper {
}
private void moveToInteractionPart(GraphicalEditPart op, List<CombinedFragmentEditPart> keepParts) {
- if(!keepParts.isEmpty()) {
+ if (!keepParts.isEmpty()) {
Rectangle b = getAbsoluteBounds(op);
- for(CombinedFragmentEditPart cef : keepParts) {
+ for (CombinedFragmentEditPart cef : keepParts) {
View view = cef.getNotationView();
op.getNotationView().getPersistedChildren().add(view);
- Bounds bounds = (Bounds)((Shape)cef.getNotationView()).getLayoutConstraint();
+ Bounds bounds = (Bounds) ((Shape) cef.getNotationView()).getLayoutConstraint();
Rectangle absolute = getAbsoluteBounds(cef);
absolute.performTranslate(-b.x, -b.y);
bounds.setX(absolute.x() - 5);
@@ -152,11 +153,11 @@ public class CombinedFragmentDeleteHelper {
private List<CombinedFragmentEditPart> collectCombinedFragmentParts() {
List<CombinedFragmentEditPart> parts = new ArrayList<CombinedFragmentEditPart>();
- for(InteractionFragment f : fragmentsToMove) {
- if(f instanceof CombinedFragment) {
+ for (InteractionFragment f : fragmentsToMove) {
+ if (f instanceof CombinedFragment) {
EditPart p = findEditPartByModel(host, f);
- if(p instanceof CombinedFragmentEditPart) {
- parts.add((CombinedFragmentEditPart)p);
+ if (p instanceof CombinedFragmentEditPart) {
+ parts.add((CombinedFragmentEditPart) p);
}
}
}
@@ -199,11 +200,11 @@ public class CombinedFragmentDeleteHelper {
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, org.eclipse.core.runtime.IAdaptable info) throws ExecutionException {
CommandResult cmdResult = super.doExecuteWithResult(progressMonitor, info);
- if(!cmdResult.getStatus().isOK()) {
+ if (!cmdResult.getStatus().isOK()) {
return cmdResult;
}
this.choice = cmdResult.getReturnValue().toString();
- if(choice.contains(labels[0])) {
+ if (choice.contains(labels[0])) {
deletaAllCommand.execute(progressMonitor, info);
return deletaAllCommand.getCommandResult();
} else {
@@ -214,7 +215,7 @@ public class CombinedFragmentDeleteHelper {
@Override
protected CommandResult doUndoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- if(choice != null && choice.contains(labels[0])) {
+ if (choice != null && choice.contains(labels[0])) {
deletaAllCommand.undo(progressMonitor, info);
return deletaAllCommand.getCommandResult();
} else {
@@ -225,7 +226,7 @@ public class CombinedFragmentDeleteHelper {
@Override
protected CommandResult doRedoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- if(choice.contains(labels[0])) {
+ if (choice.contains(labels[0])) {
deletaAllCommand.redo(progressMonitor, info);
return deletaAllCommand.getCommandResult();
} else {
@@ -265,12 +266,12 @@ public class CombinedFragmentDeleteHelper {
CompositeTransactionalCommand deleteCfOnly = new CompositeTransactionalCommand(transactionalEditingDomain, null);
{
// remove children from operands and append to parent combined fragment
- for(InteractionOperand op : cf.getOperands()) {
+ for (InteractionOperand op : cf.getOperands()) {
deleteCfOnly.add(new MoveOperandFragmentsCommand(host, cf, op, new EditRequest(transactionalEditingDomain, cf)));
}
deleteCfOnly.add(new DeleteCombinedFragmentCommand(transactionalEditingDomain, provider, req));
}
- return new SelectAndDeleteCommand(deleteAll, deleteCfOnly, new String[]{ "Delete all", "Keep contents" });
+ return new SelectAndDeleteCommand(deleteAll, deleteCfOnly, new String[] { "Delete all", "Keep contents" });
}
public static ICommand createDeleteViewCommand(CombinedFragment cf, TransactionalEditingDomain transactionalEditingDomain, CombinedFragmentEditPart host) {
@@ -284,15 +285,15 @@ public class CombinedFragmentDeleteHelper {
CompositeTransactionalCommand deleteCfOnly = new CompositeTransactionalCommand(transactionalEditingDomain, null);
{
// remove children from operands and append to parent combined fragment
- for(InteractionOperand op : cf.getOperands()) {
+ for (InteractionOperand op : cf.getOperands()) {
deleteCfOnly.add(new MoveOperandFragmentsCommand(host, cf, op, new EditRequest(transactionalEditingDomain, cf)));
}
// delete operands from combined fragment
- for(Element element : cf.getOperands()) {
+ for (Element element : cf.getOperands()) {
SequenceDeleteHelper.deleteView(deleteCfOnly, element, transactionalEditingDomain);
}
}
- return new SelectAndDeleteCommand(deleteAll, deleteCfOnly, new String[]{ "Hide all", "Keep contents" });
+ return new SelectAndDeleteCommand(deleteAll, deleteCfOnly, new String[] { "Hide all", "Keep contents" });
}
static Rectangle getAbsoluteBounds(AbstractGraphicalEditPart part) {
@@ -303,15 +304,15 @@ public class CombinedFragmentDeleteHelper {
public static EditPart findEditPartByModel(EditPart part, EObject m) {
List children = part.getChildren();
- if(children != null && children.size() > 0) {
- for(Object o : children) {
- EditPart p = (EditPart)o;
+ if (children != null && children.size() > 0) {
+ for (Object o : children) {
+ EditPart p = (EditPart) o;
Object model = p.getModel();
- if(model != null && model instanceof View && m.equals(((View)model).getElement())) {
+ if (model != null && model instanceof View && m.equals(((View) model).getElement())) {
return p;
}
EditPart res = findEditPartByModel(p, m);
- if(res != null) {
+ if (res != null) {
return res;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/CommandHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/CommandHelper.java
index 73eb786060b..d449676a36a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/CommandHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/CommandHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -88,7 +88,7 @@ import org.eclipse.uml2.uml.UMLPackage;
/**
* A helper class for the command.
- *
+ *
*/
public class CommandHelper {
@@ -119,11 +119,11 @@ public class CommandHelper {
/**
* Create a message on the given interaction. It only creates the message and not its messages end.
- *
+ *
* @param interaction
- * the containing interaction
+ * the containing interaction
* @param messageSort
- * the messageSort.
+ * the messageSort.
* @return the created message
*/
public static Message doCreateMessage(Interaction interaction, MessageSort messageSort, NamedElement signature) {
@@ -133,11 +133,11 @@ public class CommandHelper {
// Set MessageSort
message.setMessageSort(messageSort);
String prefix = "";
- if(signature != null) {
+ if (signature != null) {
prefix = signature.getName() + "_";
}
ElementInitializers.init_NamedElement(message, prefix);
- if(signature != null) {
+ if (signature != null) {
message.setSignature(signature);
}
return message;
@@ -145,11 +145,11 @@ public class CommandHelper {
/**
* Create message occurence specification
- *
+ *
* @param interaction
- * The interaction
+ * The interaction
* @param event
- * The event to attach
+ * The event to attach
* @return The message occurence specification
*/
public static MessageOccurrenceSpecification doCreateMessageOccurrence(InteractionFragment fragment, Event event, Lifeline lifeline) {
@@ -162,19 +162,19 @@ public class CommandHelper {
/**
* Create an ExecutionOccurrenceSpecification
- *
+ *
* @param es
- * the ExecutionSpecification associated with this ExecutionOccurrenceSpecification.
+ * the ExecutionSpecification associated with this ExecutionOccurrenceSpecification.
* @param event
- * the event associated with this OccurrenceSpecification. It must be of type ExecutionEvent.
+ * the event associated with this OccurrenceSpecification. It must be of type ExecutionEvent.
* @param fragment
- * the fragment enclosing this OccurenceSpecifcation. It must be an Interaction or an Operand.
+ * the fragment enclosing this OccurenceSpecifcation. It must be an Interaction or an Operand.
* @return the Execution Occurrence Specification
*/
public static ExecutionOccurrenceSpecification doCreateExecutionOccurenceSpecification(ExecutionSpecification es, InteractionFragment fragment, Lifeline lifeline) {
// Create the ExecutionOccurrenceSpecification
ExecutionOccurrenceSpecification eos = UMLFactory.eINSTANCE.createExecutionOccurrenceSpecification();
- // Configure the EOS.
+ // Configure the EOS.
// The event is an ExecutionEvent
doConfigureOccurenceSpecification(eos, null, fragment, lifeline);
// Set the executionSpecification of the ExecutionOccurrenceSpecification
@@ -184,53 +184,53 @@ public class CommandHelper {
/**
* Configure an OccurrenceSpecification
- *
+ *
* @param os
- * the occurrenceSpecification to configure
+ * the occurrenceSpecification to configure
* @param event
- * the event to associated with the {@link OccurrenceSpecification}
+ * the event to associated with the {@link OccurrenceSpecification}
* @param fragment
- * the fragment containing the {@link OccurrenceSpecification}. It can be an {@link Interaction} or an {@link InteractionOperand}
+ * the fragment containing the {@link OccurrenceSpecification}. It can be an {@link Interaction} or an {@link InteractionOperand}
* @param lifeline
- * the covered lifeline
+ * the covered lifeline
*/
private static void doConfigureOccurenceSpecification(OccurrenceSpecification os, Event event, InteractionFragment fragment, Lifeline lifeline) {
// Set the Container of the OccurrenceSpecification
- if(fragment instanceof Interaction) {
- os.setEnclosingInteraction((Interaction)fragment);
- } else if(fragment instanceof InteractionOperand) {
- os.setEnclosingOperand((InteractionOperand)fragment);
+ if (fragment instanceof Interaction) {
+ os.setEnclosingInteraction((Interaction) fragment);
+ } else if (fragment instanceof InteractionOperand) {
+ os.setEnclosingOperand((InteractionOperand) fragment);
}
// Set the covered lifeline
os.getCovereds().add(lifeline);
// Set the event of the OccurrenceSpecification
- //now it doesn't exist
- //os.setEvent(event);
+ // now it doesn't exist
+ // os.setEvent(event);
}
/**
* Attach an Interaction on a Lifeline
- *
+ *
* @param lifeline
- * The lifeline
+ * The lifeline
* @param fragment
- * The interaction fragment
+ * The interaction fragment
*/
public static void setSingleCovered(Lifeline lifeline, InteractionFragment fragment) {
- if(!fragment.getCovereds().contains(lifeline)) {
+ if (!fragment.getCovereds().contains(lifeline)) {
fragment.getCovereds().add(lifeline);
}
}
/**
* Get the signature of the message. Opens a dialog box to select a signature.
- *
+ *
* @param model
- * The model
+ * The model
* @param source
- * The source of the message
+ * The source of the message
* @param target
- * The target of the message
+ * The target of the message
* @return null, if cancel has been pressed. An empty list if the null Element has been
* selected, or a list with the selected element.
*/
@@ -241,15 +241,15 @@ public class CommandHelper {
/**
* Get the signature of the message. Opens a dialog box to select a signature. Inputs depends on
* the messageSort, if any.
- *
+ *
* @param model
- * The model
+ * The model
* @param source
- * The source of the message
+ * The source of the message
* @param target
- * The target of the message
+ * The target of the message
* @param messageSort
- * true if message sort is set
+ * true if message sort is set
* @return null, if cancel has been pressed. An empty list if the null Element has been
* selected, or a list with the selected element.
*/
@@ -262,44 +262,44 @@ public class CommandHelper {
boolean useSignals = true;
// according to the type of the message
// choose which types we should care of
- if(MessageSort.SYNCH_CALL_LITERAL.equals(messageSort)) {
+ if (MessageSort.SYNCH_CALL_LITERAL.equals(messageSort)) {
useSignals = false;
- } else if(MessageSort.CREATE_MESSAGE_LITERAL.equals(messageSort) || MessageSort.DELETE_MESSAGE_LITERAL.equals(messageSort)) {
+ } else if (MessageSort.CREATE_MESSAGE_LITERAL.equals(messageSort) || MessageSort.DELETE_MESSAGE_LITERAL.equals(messageSort)) {
useOperations = false;
- } else if(MessageSort.REPLY_LITERAL.equals(messageSort)) {
+ } else if (MessageSort.REPLY_LITERAL.equals(messageSort)) {
parentsOwner = source;
useSignals = false;
}
LinkedHashMap<EClass, List<EObject>> mapTypesPossibleParents = new LinkedHashMap<EClass, List<EObject>>();
- if(useSignals) {
+ if (useSignals) {
mapTypesPossibleParents.put(UMLPackage.eINSTANCE.getSignal(), new LinkedList<EObject>());
}
- if(useOperations) {
+ if (useOperations) {
mapTypesPossibleParents.put(UMLPackage.eINSTANCE.getOperation(), new LinkedList<EObject>());
}
// add the parents we can find
boolean existingParent = false;
List<Type> types = new ArrayList<Type>();
- if(parentsOwner instanceof InteractionFragment) {
- EList<Lifeline> lifelines = ((InteractionFragment)parentsOwner).getCovereds();
- for(Lifeline l : lifelines) {
- if(l.getRepresents() != null && l.getRepresents().getType() != null) {
+ if (parentsOwner instanceof InteractionFragment) {
+ EList<Lifeline> lifelines = ((InteractionFragment) parentsOwner).getCovereds();
+ for (Lifeline l : lifelines) {
+ if (l.getRepresents() != null && l.getRepresents().getType() != null) {
types.add(l.getRepresents().getType());
}
boolean result = addParentsFromLifeline(l, mapTypesPossibleParents);
- if(result) {
+ if (result) {
existingParent = true;
}
}
- } else if(parentsOwner instanceof Lifeline) {
- Lifeline l = (Lifeline)parentsOwner;
- if(l.getRepresents() != null && l.getRepresents().getType() != null) {
+ } else if (parentsOwner instanceof Lifeline) {
+ Lifeline l = (Lifeline) parentsOwner;
+ if (l.getRepresents() != null && l.getRepresents().getType() != null) {
types.add(l.getRepresents().getType());
}
existingParent = addParentsFromLifeline(l, mapTypesPossibleParents);
}
// if no parent available => no signature
- if(!existingParent) {
+ if (!existingParent) {
return new ArrayList<NamedElement>();
}
Set<EObject> existingElements = getExistingElementsFromParents(mapTypesPossibleParents);
@@ -313,14 +313,15 @@ public class CommandHelper {
return Collections.<NamedElement> emptyList();
}
// Open the selection dialog
- SelectOrCreateDialog dialog = new SelectOrCreateDialog(Display.getCurrent().getActiveShell(), CustomMessages.CommandHelper_CreateMessage, createTypeLabelProvider(), new AdapterFactoryLabelProvider(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory()), editingDomain, existingElements, mapTypesPossibleParents, types);
+ SelectOrCreateDialog dialog = new SelectOrCreateDialog(Display.getCurrent().getActiveShell(), CustomMessages.CommandHelper_CreateMessage, createTypeLabelProvider(), new AdapterFactoryLabelProvider(UMLDiagramEditorPlugin.getInstance()
+ .getItemProvidersAdapterFactory()), editingDomain, existingElements, mapTypesPossibleParents, types);
// Get the selected result
- if(dialog.open() == Window.OK) {
+ if (dialog.open() == Window.OK) {
// list to return
List<NamedElement> returnElements = new ArrayList<NamedElement>();
EObject element = dialog.getSelected();
- if(element instanceof NamedElement) {
- returnElements.add((NamedElement)element);
+ if (element instanceof NamedElement) {
+ returnElements.add((NamedElement) element);
return returnElements;
}
return returnElements;
@@ -331,15 +332,15 @@ public class CommandHelper {
private static void clearConnectionFeedback() {
AspectUnspecifiedTypeConnectionToolEx conTool = null;
IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- if(editor instanceof CoreMultiDiagramEditor) {
- editor = ((CoreMultiDiagramEditor)editor).getActiveEditor();
- if(editor instanceof DiagramEditor) {
- DiagramEditor de = (DiagramEditor)editor;
+ if (editor instanceof CoreMultiDiagramEditor) {
+ editor = ((CoreMultiDiagramEditor) editor).getActiveEditor();
+ if (editor instanceof DiagramEditor) {
+ DiagramEditor de = (DiagramEditor) editor;
DiagramEditPart diagramEP = de.getDiagramEditPart();
EditDomain domain = diagramEP.getRoot().getViewer().getEditDomain();
Tool tool = domain.getActiveTool();
- if(tool instanceof AspectUnspecifiedTypeConnectionToolEx) {
- conTool = (AspectUnspecifiedTypeConnectionToolEx)tool;
+ if (tool instanceof AspectUnspecifiedTypeConnectionToolEx) {
+ conTool = (AspectUnspecifiedTypeConnectionToolEx) tool;
conTool.clearConnectionFeedback();
}
}
@@ -348,30 +349,30 @@ public class CommandHelper {
/**
* find the existing elements from the possible parents
- *
+ *
* @param mapTypesPossibleParents
- * map of list containing the possible parents
+ * map of list containing the possible parents
* @return
*/
private static Set<EObject> getExistingElementsFromParents(Map<EClass, List<EObject>> mapTypesPossibleParents) {
// find the existing elements using the parents we just found
Set<EObject> existingElements = new HashSet<EObject>();
- for(EClass eClass : mapTypesPossibleParents.keySet()) {
+ for (EClass eClass : mapTypesPossibleParents.keySet()) {
List<EObject> parents = mapTypesPossibleParents.get(eClass);
- for(EObject parent : parents) {
- if(parent instanceof Classifier) {
- existingElements.addAll(((Classifier)parent).getAllOperations());
+ for (EObject parent : parents) {
+ if (parent instanceof Classifier) {
+ existingElements.addAll(((Classifier) parent).getAllOperations());
// add operations from port
- EList<Property> attrs = ((Classifier)parent).getAllAttributes();
- for(Property p : attrs) {
- if(p instanceof Port && p.getType() instanceof Classifier) {
- existingElements.addAll(((Classifier)p.getType()).getAllOperations());
+ EList<Property> attrs = ((Classifier) parent).getAllAttributes();
+ for (Property p : attrs) {
+ if (p instanceof Port && p.getType() instanceof Classifier) {
+ existingElements.addAll(((Classifier) p.getType()).getAllOperations());
}
}
- } else if(parent instanceof Package) {
- EList<Element> ownedElements = ((Package)parent).allOwnedElements();
- for(Element e : ownedElements) {
- if(e instanceof Signal) {
+ } else if (parent instanceof Package) {
+ EList<Element> ownedElements = ((Package) parent).allOwnedElements();
+ for (Element e : ownedElements) {
+ if (e instanceof Signal) {
existingElements.add(e);
}
}
@@ -384,7 +385,7 @@ public class CommandHelper {
/**
* Create a specific label provider for types
* which remove everything after the first space
- *
+ *
* @return the label provider
*/
private static AdapterFactoryLabelProvider createTypeLabelProvider() {
@@ -396,7 +397,7 @@ public class CommandHelper {
// => keep only the first word
String text = super.getText(object);
int index = text.indexOf(" "); //$NON-NLS-1$
- if(index != -1) {
+ if (index != -1) {
text = text.substring(0, index);
}
return text;
@@ -408,29 +409,29 @@ public class CommandHelper {
/**
* add to the map the possible parents (classes, packages)
* founded "in" the lifeline
- *
+ *
* @param l
- * The lifeline where to look for possible parents
+ * The lifeline where to look for possible parents
* @param mapTypesPossibleParents
- * The map where to store this parents
+ * The map where to store this parents
* @return true if at least one parent was added
*/
private static boolean addParentsFromLifeline(Lifeline l, Map<EClass, List<EObject>> mapTypesPossibleParents) {
ConnectableElement e = l.getRepresents();
boolean existingParent = false;
// If there is no connectable element (ie : lifeline doesn't have a represents property yet)
- if(e == null) {
+ if (e == null) {
return false;
}
Type type = e.getType();
- if(type == null) {
+ if (type == null) {
return false;
}
// the classes are related to operation
List<EObject> possibleClassifier = mapTypesPossibleParents.get(UMLPackage.eINSTANCE.getOperation());
- if(possibleClassifier != null) {
- if(type instanceof Classifier) {
- Classifier classifier = (Classifier)type;
+ if (possibleClassifier != null) {
+ if (type instanceof Classifier) {
+ Classifier classifier = (Classifier) type;
possibleClassifier.add(classifier);
// add the supertypes of the class
possibleClassifier.addAll(classifier.allParents());
@@ -439,7 +440,7 @@ public class CommandHelper {
}
// and the packages to signal
List<EObject> possiblePackages = mapTypesPossibleParents.get(UMLPackage.eINSTANCE.getSignal());
- if(possiblePackages != null && type.getPackage() != null) {
+ if (possiblePackages != null && type.getPackage() != null) {
Package package_ = type.getPackage();
possiblePackages.add(package_);
// add the owners of the package
@@ -452,9 +453,9 @@ public class CommandHelper {
/**
* Get the signature of the message. Opens a dialog box to select a signature. Inputs depends on
* the messageSort, if any.
- *
+ *
* @param availableProperties
- * list of available properties
+ * list of available properties
* @return null, if cancel has been pressed. An empty list if the null Element has been
* selected, or a list with the selected element.
*/
@@ -463,15 +464,15 @@ public class CommandHelper {
ElementListSelectionDialog dialog = new ElementListSelectionDialog(Display.getCurrent().getActiveShell(), labelProvider);
dialog.setTitle("Property Selection"); //$NON-NLS-1$
dialog.setMessage("Select a property (* = any string, ? = any char):"); //$NON-NLS-1$
- if(availableProperties == null || availableProperties.isEmpty()) {
+ if (availableProperties == null || availableProperties.isEmpty()) {
return null;
}
dialog.setElements(availableProperties.toArray());
Property element = null;
int dialogResult = dialog.open();
- if(dialogResult == Window.OK) {
- if(!"".equals(dialog.getFirstResult())) { //$NON-NLS-1$
- element = (Property)dialog.getFirstResult();
+ if (dialogResult == Window.OK) {
+ if (!"".equals(dialog.getFirstResult())) { //$NON-NLS-1$
+ element = (Property) dialog.getFirstResult();
}
}
return element;
@@ -479,17 +480,17 @@ public class CommandHelper {
/**
* Execute a EMF command without history (cancelation usage)
- *
+ *
* @param editingDomain
- * The editing domain
+ * The editing domain
* @param command
- * The command
+ * The command
*/
public static void executeCommandWithoutHistory(EditingDomain editingDomain, org.eclipse.emf.common.command.Command command) {
try {
CommandStack commandStack = editingDomain.getCommandStack();
- if(commandStack instanceof TransactionalCommandStack) {
- ((TransactionalCommandStack)commandStack).execute(command, Collections.singletonMap(Transaction.OPTION_UNPROTECTED, Boolean.TRUE));
+ if (commandStack instanceof TransactionalCommandStack) {
+ ((TransactionalCommandStack) commandStack).execute(command, Collections.singletonMap(Transaction.OPTION_UNPROTECTED, Boolean.TRUE));
} else {
commandStack.execute(command);
}
@@ -502,16 +503,16 @@ public class CommandHelper {
/**
* Execute a EMF command without history
- *
+ *
* @param editingDomain
- * The editing domain
+ * The editing domain
* @param command
- * The command
+ * The command
* @param flag
*/
public static void executeCommandWithoutHistory(EditingDomain editingDomain, org.eclipse.emf.common.command.Command command, boolean flag) {
TransactionalCommandStackImpl stack = new TransactionalCommandStackImpl();
- stack.setEditingDomain((InternalTransactionalEditingDomain)editingDomain);
+ stack.setEditingDomain((InternalTransactionalEditingDomain) editingDomain);
try {
stack.execute(command, Collections.singletonMap(Transaction.OPTION_UNPROTECTED, Boolean.TRUE));
} catch (InterruptedException e) {
@@ -524,23 +525,23 @@ public class CommandHelper {
/**
* Retrieve the Lifeline associated with an ExecutionSpecification.
* According to the UML Specification, an ExecutionSpecification must have a start and a finish.
- *
+ *
* In Papyrus, an ExecutionSpecification may not have a start and finish.
* To handle this specific case, we return the first lifeline that the ES covered.
- *
+ *
* @param es
- * the targeted execution specification
+ * the targeted execution specification
* @return the associated lifeline, or null if the ES has no start, no finish, no covered lifelines.
*/
public static Lifeline getExecutionSpecificationLifeline(ExecutionSpecification es) {
Lifeline lifeline = null;
- if(es.getStart() != null) {
+ if (es.getStart() != null) {
lifeline = es.getStart().getCovereds().get(0);
- } else if(es.getFinish() != null) {
+ } else if (es.getFinish() != null) {
lifeline = es.getFinish().getCovereds().get(0);
}
- if(lifeline == null) {
- if(!es.getCovereds().isEmpty()) {
+ if (lifeline == null) {
+ if (!es.getCovereds().isEmpty()) {
lifeline = es.getCovereds().get(0);
}
}
@@ -549,41 +550,41 @@ public class CommandHelper {
/**
* Create an DestructionEvent and an occurrenceSpecification bounds to the lifeline
- *
+ *
* @param destructionEvent
- * the destructionEvent
+ * the destructionEvent
* @param lifeline
- * the lifeline associated with the destructionEvent
+ * the lifeline associated with the destructionEvent
* @param modelContainer
- * the container of the occurrenceSpecification that will bound the lifeline and the destructionEvent.
+ * the container of the occurrenceSpecification that will bound the lifeline and the destructionEvent.
* @return
*/
- // public static DestructionEvent doCreateDestructionEvent(Lifeline lifeline, Object modelContainer) {
+ // public static DestructionEvent doCreateDestructionEvent(Lifeline lifeline, Object modelContainer) {
//
- // // Get the nearest package
- // Package pack = lifeline.getNearestPackage();
+ // // Get the nearest package
+ // Package pack = lifeline.getNearestPackage();
//
- // EClass destructionEventEClass = UMLPackage.eINSTANCE.getDestructionEvent();
- // // Add the destructionEvent to the Package
- // DestructionEvent destructionEvent = (DestructionEvent)pack.createPackagedElement(ElementInitializers.getNextNumberedName(pack.getOwnedElements(), destructionEventEClass.getName()), destructionEventEClass);
+ // EClass destructionEventEClass = UMLPackage.eINSTANCE.getDestructionEvent();
+ // // Add the destructionEvent to the Package
+ // DestructionEvent destructionEvent = (DestructionEvent)pack.createPackagedElement(ElementInitializers.getNextNumberedName(pack.getOwnedElements(), destructionEventEClass.getName()), destructionEventEClass);
//
- // // Create an occurrenceSpecification
- // Element element = createElement(modelContainer, UMLPackage.eINSTANCE.getOccurrenceSpecification());
- // OccurrenceSpecification os = null;
- // if(element instanceof OccurrenceSpecification) {
- // os = (OccurrenceSpecification)element;
- // doConfigureOccurenceSpecification(os, destructionEvent, (InteractionFragment)modelContainer, lifeline);
- // }
+ // // Create an occurrenceSpecification
+ // Element element = createElement(modelContainer, UMLPackage.eINSTANCE.getOccurrenceSpecification());
+ // OccurrenceSpecification os = null;
+ // if(element instanceof OccurrenceSpecification) {
+ // os = (OccurrenceSpecification)element;
+ // doConfigureOccurenceSpecification(os, destructionEvent, (InteractionFragment)modelContainer, lifeline);
+ // }
//
- // return destructionEvent;
- // }
+ // return destructionEvent;
+ // }
/**
* Create an DestructionOccurrenceSpecification bounds to the lifeline
- *
+ *
* @param lifeline
- * the lifeline associated with the destructionEvent
+ * the lifeline associated with the destructionEvent
* @param modelContainer
- * the container of the occurrenceSpecification that will bound the lifeline and the destructionEvent.
+ * the container of the occurrenceSpecification that will bound the lifeline and the destructionEvent.
* @return
*/
public static DestructionOccurrenceSpecification doCreateDestructionOccurrenceSpecification(Lifeline lifeline, Object modelContainer) {
@@ -592,27 +593,27 @@ public class CommandHelper {
// Create an occurrenceSpecification
Element element = createElement(modelContainer, UMLPackage.eINSTANCE.getDestructionOccurrenceSpecification());
DestructionOccurrenceSpecification os = null;
- if(element instanceof DestructionOccurrenceSpecification) {
- os = (DestructionOccurrenceSpecification)element;
- doConfigureOccurenceSpecification(os, null, (InteractionFragment)modelContainer, lifeline);
+ if (element instanceof DestructionOccurrenceSpecification) {
+ os = (DestructionOccurrenceSpecification) element;
+ doConfigureOccurenceSpecification(os, null, (InteractionFragment) modelContainer, lifeline);
}
return os;
}
/**
* Create an StateInvariant
- *
+ *
* @param lifeline
- * the lifeline on which the stateInvariant is created (or which is covered by the StateInvariant).
+ * the lifeline on which the stateInvariant is created (or which is covered by the StateInvariant).
* @param modelContainer
- * the model container
+ * the model container
* @return the created stateInvariant or null
*/
public static StateInvariant doCreateStateInvariant(Lifeline lifeline, Object modelContainer) {
StateInvariant stateInvariant = null;
Element element = createElement(modelContainer, UMLPackage.eINSTANCE.getStateInvariant());
- if(element instanceof StateInvariant) {
- stateInvariant = (StateInvariant)element;
+ if (element instanceof StateInvariant) {
+ stateInvariant = (StateInvariant) element;
// Get the covered lifeline
stateInvariant.getCovereds().add(lifeline);
// Create the associated invariant
@@ -623,13 +624,13 @@ public class CommandHelper {
private static Element createElement(Object modelContainer, EClass eClass) {
// Get the enclosing interaction fragment
- if(modelContainer instanceof InteractionOperand) {
- InteractionOperand interactionOperand = (InteractionOperand)modelContainer;
- // Create the ES
+ if (modelContainer instanceof InteractionOperand) {
+ InteractionOperand interactionOperand = (InteractionOperand) modelContainer;
+ // Create the ES
return interactionOperand.createFragment(ElementInitializers.getNextNumberedName(interactionOperand.getFragments(), eClass.getName()), eClass);
- } else if(modelContainer instanceof Interaction) {
- Interaction interaction = (Interaction)modelContainer;
- // Create the ES
+ } else if (modelContainer instanceof Interaction) {
+ Interaction interaction = (Interaction) modelContainer;
+ // Create the ES
return interaction.createFragment(ElementInitializers.getNextNumberedName(interaction.getFragments(), eClass.getName()), eClass);
}
return null;
@@ -637,19 +638,19 @@ public class CommandHelper {
/**
* Create a CombinedFragment and its associated interaction Operand
- *
+ *
* @param modelContainer
- * the container of the CF. It could be an InteractionOperand or an Interaction.
+ * the container of the CF. It could be an InteractionOperand or an Interaction.
* @param operatorKind
- * the operatorKind of the combinedFragment
+ * the operatorKind of the combinedFragment
* @return the created CombinedFragment or null
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
public static CombinedFragment doCreateCombinedFragment(Object modelContainer, InteractionOperatorKind operatorKind, Collection coveredLifelines) {
CombinedFragment combinedFragment = null;
Element element = createElement(modelContainer, UMLPackage.eINSTANCE.getCombinedFragment());
- if(element instanceof CombinedFragment) {
- combinedFragment = (CombinedFragment)element;
+ if (element instanceof CombinedFragment) {
+ combinedFragment = (CombinedFragment) element;
combinedFragment.getCovereds().addAll(coveredLifelines);
// Set the operator kind
combinedFragment.setInteractionOperator(operatorKind);
@@ -662,19 +663,19 @@ public class CommandHelper {
/**
* Create a CoRegion element :
* a CombinedFragment with InteractionOperator set to 'Parallel'
- *
+ *
* @param modelContainer
- * the parent element of the CoRegion
+ * the parent element of the CoRegion
* @param coveredLifeline
- * the lifeline on which the CoRegion is created
+ * the lifeline on which the CoRegion is created
* @return the created CoRegion or null
*/
public static CombinedFragment doCreateCoRegion(Object modelContainer, Lifeline coveredLifeline) {
// Create a Parallel CombinedFragment
Element element = createElement(modelContainer, UMLPackage.eINSTANCE.getCombinedFragment());
- if(element instanceof CombinedFragment) {
- CombinedFragment combinedFragment = (CombinedFragment)element;
- combinedFragment = (CombinedFragment)element;
+ if (element instanceof CombinedFragment) {
+ CombinedFragment combinedFragment = (CombinedFragment) element;
+ combinedFragment = (CombinedFragment) element;
combinedFragment.getCovereds().add(coveredLifeline);
// Set the operator kind
combinedFragment.setInteractionOperator(InteractionOperatorKind.PAR_LITERAL);
@@ -686,18 +687,18 @@ public class CommandHelper {
/**
* Create an ExecutionSpecification. It also creates the start and finish ExecutionOccurenceSpecification of the ExecutionSpecification, and their
* corresponding events.
- *
+ *
* @param es
- * the executionSpecification to create.
+ * the executionSpecification to create.
* @param lifeline
- * the lifeline covered by the ExecutionSpecification.
+ * the lifeline covered by the ExecutionSpecification.
* @return the created executionSpecification
*/
public static ExecutionSpecification doCreateExecutionSpecification(ExecutionSpecification es, Lifeline lifeline, Object modelContainer) {
InteractionFragment interactionFragment = null;
// Get the enclosing interaction fragment
- if(modelContainer instanceof InteractionOperand) {
- InteractionOperand interactionOperand = (InteractionOperand)modelContainer;
+ if (modelContainer instanceof InteractionOperand) {
+ InteractionOperand interactionOperand = (InteractionOperand) modelContainer;
interactionFragment = interactionOperand;
} else {
Interaction interaction = lifeline.getInteraction();
@@ -705,20 +706,20 @@ public class CommandHelper {
}
// Create events
org.eclipse.uml2.uml.Package eventContainer = interactionFragment.getNearestPackage();
- // ExecutionEvent startingExecutionEvent = EventHelper.doCreateExecutionEvent(eventContainer);
- // ExecutionEvent finishingExecutionEvent = EventHelper.doCreateExecutionEvent(eventContainer);
+ // ExecutionEvent startingExecutionEvent = EventHelper.doCreateExecutionEvent(eventContainer);
+ // ExecutionEvent finishingExecutionEvent = EventHelper.doCreateExecutionEvent(eventContainer);
// Create fragments in the correct order : start OccurenceSpecification, ExecutionSpecification, finish OccurenceSpecification
// start
ExecutionOccurrenceSpecification start = CommandHelper.doCreateExecutionOccurenceSpecification(null, interactionFragment, lifeline);
// Create the ExecutionSpecification
- if(modelContainer instanceof InteractionOperand) {
- InteractionOperand interactionOperand = (InteractionOperand)modelContainer;
- // Create the ES
- es = (ExecutionSpecification)interactionOperand.createFragment(null, es.eClass());
+ if (modelContainer instanceof InteractionOperand) {
+ InteractionOperand interactionOperand = (InteractionOperand) modelContainer;
+ // Create the ES
+ es = (ExecutionSpecification) interactionOperand.createFragment(null, es.eClass());
} else {
Interaction interaction = lifeline.getInteraction();
- // Create the ES
- es = (ExecutionSpecification)interaction.createFragment(null, es.eClass());
+ // Create the ES
+ es = (ExecutionSpecification) interaction.createFragment(null, es.eClass());
}
// finish
ExecutionOccurrenceSpecification finish = CommandHelper.doCreateExecutionOccurenceSpecification(es, interactionFragment, lifeline);
@@ -735,7 +736,7 @@ public class CommandHelper {
private static void initExecutionSpecificationName(ExecutionSpecification es) {
String body = ""; //$NON-NLS-1$
- if(es instanceof ActionExecutionSpecification) {
+ if (es instanceof ActionExecutionSpecification) {
body = "ActionExecSpec"; //$NON-NLS-1$
} else {
body = "BehaviorExecSpec"; //$NON-NLS-1$
@@ -749,150 +750,150 @@ public class CommandHelper {
/**
* Create a MessageEnd
- *
+ *
* @param interaction
- * fragment
- * The Interaction fragment
+ * fragment
+ * The Interaction fragment
* @param callEvent
- * The call event
+ * The call event
* @param element
- * The element
+ * The element
* @param direction
- * The message direction
+ * The message direction
* @return A MessageOccurrenceSpecification if element is ExecutionSpecification or Lifeline. A
* Gate if element is Interaction or CombinedFragment or InteractionUse
*/
public static MessageEnd createMessageEnd(InteractionFragment interactionFragment, Event event, Element element, MessageDirection direction) {
MessageEnd endMsg = null;
- if(element instanceof MessageEnd) {
- endMsg = (MessageEnd)element;
- } else if(element instanceof Lifeline) {
- endMsg = doCreateMessageOccurrence(interactionFragment, event, (Lifeline)element);
- } else if(element instanceof ExecutionSpecification) {
- Lifeline lifeline = getExecutionSpecificationLifeline((ExecutionSpecification)element);
+ if (element instanceof MessageEnd) {
+ endMsg = (MessageEnd) element;
+ } else if (element instanceof Lifeline) {
+ endMsg = doCreateMessageOccurrence(interactionFragment, event, (Lifeline) element);
+ } else if (element instanceof ExecutionSpecification) {
+ Lifeline lifeline = getExecutionSpecificationLifeline((ExecutionSpecification) element);
endMsg = doCreateMessageOccurrence(interactionFragment, event, lifeline);
- } else if(element instanceof Interaction || element instanceof CombinedFragment || element instanceof InteractionUse) {
+ } else if (element instanceof Interaction || element instanceof CombinedFragment || element instanceof InteractionUse) {
endMsg = doCreateGate(element, direction);
- } else if(element instanceof ExecutionOccurrenceSpecification) {
- endMsg = createMessageEnd(interactionFragment, event, ((ExecutionOccurrenceSpecification)element).getExecution(), direction);
+ } else if (element instanceof ExecutionOccurrenceSpecification) {
+ endMsg = createMessageEnd(interactionFragment, event, ((ExecutionOccurrenceSpecification) element).getExecution(), direction);
}
return endMsg;
}
/**
* Create gate if element is a Interaction, a Combined Fragment or a Interaction Use
- *
+ *
* @param element
- * The element
+ * The element
* @param direction
- * The message direction
+ * The message direction
* @return The gate
* @throws IllegalArgumentException
- * if the element is not a right element type
+ * if the element is not a right element type
*/
public static Gate doCreateGate(Element element, MessageDirection direction) {
Gate gate = GateHelper.createGate(element, true);
- if(element instanceof CombinedFragment) {
+ if (element instanceof CombinedFragment) {
GateHelper.setVolatile(gate, true);
}
- // Gate gate = null;
- // if(element instanceof Interaction) {
- // gate = ((Interaction)element).createFormalGate(null);
- // } else if(element instanceof CombinedFragment) {
- // CombinedFragment combinedFragment = (CombinedFragment)element;
- // EList<Gate> cfragmentGates = combinedFragment.getCfragmentGates();
- // if(cfragmentGates.isEmpty()) {
- // gate = ((CombinedFragment)element).createCfragmentGate(null);
- // } else {
- // // remove connection feedbacks before opening dialog
- // clearConnectionFeedback();
- // // Introduce to create new Gate every time.
- // final Gate newGate = UMLFactory.eINSTANCE.createGate();
- // Shell shell = Display.getCurrent().getActiveShell();
- // ILabelProvider labelProvider = new AdapterFactoryLabelProvider(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory()) {
+ // Gate gate = null;
+ // if(element instanceof Interaction) {
+ // gate = ((Interaction)element).createFormalGate(null);
+ // } else if(element instanceof CombinedFragment) {
+ // CombinedFragment combinedFragment = (CombinedFragment)element;
+ // EList<Gate> cfragmentGates = combinedFragment.getCfragmentGates();
+ // if(cfragmentGates.isEmpty()) {
+ // gate = ((CombinedFragment)element).createCfragmentGate(null);
+ // } else {
+ // // remove connection feedbacks before opening dialog
+ // clearConnectionFeedback();
+ // // Introduce to create new Gate every time.
+ // final Gate newGate = UMLFactory.eINSTANCE.createGate();
+ // Shell shell = Display.getCurrent().getActiveShell();
+ // ILabelProvider labelProvider = new AdapterFactoryLabelProvider(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory()) {
//
- // @Override
- // public Image getImage(Object object) {
- // if(newGate == object) {
- // return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ADD);
- // }
- // return super.getImage(object);
- // }
+ // @Override
+ // public Image getImage(Object object) {
+ // if(newGate == object) {
+ // return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ADD);
+ // }
+ // return super.getImage(object);
+ // }
//
- // @Override
- // public String getText(Object object) {
- // if(newGate == object) {
- // return "<create new gate>";
- // }
- // return super.getText(object);
- // }
- // };
- // ElementListSelectionDialog dialog = new ElementListSelectionDialog(shell, labelProvider);
- // dialog.setTitle("Gates of the CombinedFragment has");
- // dialog.setMessage(CHOOSE_GATE_DIALOG_MSG);
- // dialog.setMultipleSelection(false);
- // List<Gate> gates = new ArrayList<Gate>();
- // gates.add(newGate);
- // for(Gate actualGate : cfragmentGates) {
- // gates.add(actualGate);
- // }
- // //Reuse existing gates by default.
- // if(!cfragmentGates.isEmpty()) {
- // dialog.setInitialSelections(new Object[]{ cfragmentGates.get(0) });
- // }
- // dialog.setElements(gates.toArray());
- // if(dialog.open() == Window.OK) {
- // gate = (Gate)dialog.getFirstResult();
- // if(gate == newGate) {
- // gate = combinedFragment.createCfragmentGate(null);
- // }
- // } else { // cancel button
- // throw new OperationCanceledException();
- // }
- // }
- // } else if(element instanceof InteractionUse) {
- // // remove connection feedbacks before opening dialog
- // clearConnectionFeedback();
- // Shell shell = Display.getCurrent().getActiveShell();
- // InteractionUse interactionUse = (InteractionUse)element;
- // if(interactionUse.getRefersTo() == null) {
- // MessageDialog.openError(shell, NO_REFERENCED_INTERACTION_DIALOG_TITLE, NO_REFERENCED_INTERACTION_DIALOG_MSG);
- // return null;
- // }
- // // ILabelProvider labelProvider = new AdapterFactoryLabelProvider(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory());
- // // ElementListSelectionDialog dialog = new ElementListSelectionDialog(shell, labelProvider);
- // // dialog.setTitle(CHOOSE_GATE_DIALOG_TITLE);
- // // dialog.setMessage(CHOOSE_GATE_DIALOG_MSG);
- // // dialog.setMultipleSelection(false);
- // //
- // // List<Gate> gates = new ArrayList<Gate>();
- // // for(Gate actualGate : ((InteractionUse)element).getActualGates()) {
- // // if(actualGate.getName().startsWith(direction.getName())) {
- // // gates.add(actualGate);
- // // }
- // // }
- // // dialog.setElements(gates.toArray());
- // // if(dialog.open() == Window.OK) {
- // // gate = (Gate)dialog.getFirstResult();
- // // }
- // /**
- // * Quickly fixed: Try to create new gate every time.
- // */
- // Interaction refersTo = interactionUse.getRefersTo();
- // String name = direction.toString().toLowerCase() + "_Gate";
- // int index = 0;
- // while(refersTo.getFormalGate(name) != null) {
- // name = direction.toString().toLowerCase() + "_Gate" + index;
- // index++;
- // }
- // Gate formalGate = UMLFactory.eINSTANCE.createGate();
- // formalGate.setName(name);
- // refersTo.getFormalGates().add(formalGate);
- // gate = ((InteractionUse)element).getActualGate(formalGate.getName());
- // } else {
- // throw new IllegalArgumentException(WRONG_GATE_CONTAINER_TYPE_ERROR_MSG);
- // }
- if(gate != null && gate.getName() == null) {
+ // @Override
+ // public String getText(Object object) {
+ // if(newGate == object) {
+ // return "<create new gate>";
+ // }
+ // return super.getText(object);
+ // }
+ // };
+ // ElementListSelectionDialog dialog = new ElementListSelectionDialog(shell, labelProvider);
+ // dialog.setTitle("Gates of the CombinedFragment has");
+ // dialog.setMessage(CHOOSE_GATE_DIALOG_MSG);
+ // dialog.setMultipleSelection(false);
+ // List<Gate> gates = new ArrayList<Gate>();
+ // gates.add(newGate);
+ // for(Gate actualGate : cfragmentGates) {
+ // gates.add(actualGate);
+ // }
+ // //Reuse existing gates by default.
+ // if(!cfragmentGates.isEmpty()) {
+ // dialog.setInitialSelections(new Object[]{ cfragmentGates.get(0) });
+ // }
+ // dialog.setElements(gates.toArray());
+ // if(dialog.open() == Window.OK) {
+ // gate = (Gate)dialog.getFirstResult();
+ // if(gate == newGate) {
+ // gate = combinedFragment.createCfragmentGate(null);
+ // }
+ // } else { // cancel button
+ // throw new OperationCanceledException();
+ // }
+ // }
+ // } else if(element instanceof InteractionUse) {
+ // // remove connection feedbacks before opening dialog
+ // clearConnectionFeedback();
+ // Shell shell = Display.getCurrent().getActiveShell();
+ // InteractionUse interactionUse = (InteractionUse)element;
+ // if(interactionUse.getRefersTo() == null) {
+ // MessageDialog.openError(shell, NO_REFERENCED_INTERACTION_DIALOG_TITLE, NO_REFERENCED_INTERACTION_DIALOG_MSG);
+ // return null;
+ // }
+ // // ILabelProvider labelProvider = new AdapterFactoryLabelProvider(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory());
+ // // ElementListSelectionDialog dialog = new ElementListSelectionDialog(shell, labelProvider);
+ // // dialog.setTitle(CHOOSE_GATE_DIALOG_TITLE);
+ // // dialog.setMessage(CHOOSE_GATE_DIALOG_MSG);
+ // // dialog.setMultipleSelection(false);
+ // //
+ // // List<Gate> gates = new ArrayList<Gate>();
+ // // for(Gate actualGate : ((InteractionUse)element).getActualGates()) {
+ // // if(actualGate.getName().startsWith(direction.getName())) {
+ // // gates.add(actualGate);
+ // // }
+ // // }
+ // // dialog.setElements(gates.toArray());
+ // // if(dialog.open() == Window.OK) {
+ // // gate = (Gate)dialog.getFirstResult();
+ // // }
+ // /**
+ // * Quickly fixed: Try to create new gate every time.
+ // */
+ // Interaction refersTo = interactionUse.getRefersTo();
+ // String name = direction.toString().toLowerCase() + "_Gate";
+ // int index = 0;
+ // while(refersTo.getFormalGate(name) != null) {
+ // name = direction.toString().toLowerCase() + "_Gate" + index;
+ // index++;
+ // }
+ // Gate formalGate = UMLFactory.eINSTANCE.createGate();
+ // formalGate.setName(name);
+ // refersTo.getFormalGates().add(formalGate);
+ // gate = ((InteractionUse)element).getActualGate(formalGate.getName());
+ // } else {
+ // throw new IllegalArgumentException(WRONG_GATE_CONTAINER_TYPE_ERROR_MSG);
+ // }
+ if (gate != null && gate.getName() == null) {
ElementInitializers.init_NamedElement(gate, direction.toString().toLowerCase() + "_"); //$NON-NLS-1$
}
return gate;
@@ -900,44 +901,44 @@ public class CommandHelper {
/**
* Creates a message and manage the creation of a message from/to a CoRegion
- *
+ *
* @param interaction
- * the interaction containing the message.
+ * the interaction containing the message.
* @param messageSort
- * the messageSort of the message, it can be null
+ * the messageSort of the message, it can be null
* @param source
- * the source of the message, it can be null
+ * the source of the message, it can be null
* @param target
- * the target of the message, it can be null
+ * the target of the message, it can be null
* @param params
- * a map of params. It must at least contain the source and target container;
+ * a map of params. It must at least contain the source and target container;
* @return the created message.
*/
public static Message doCreateMessage(Interaction interaction, MessageSort messageSort, Element source, Element target, Map<Object, Object> params) {
- InteractionFragment sourceContainer = (InteractionFragment)params.get(SequenceRequestConstant.SOURCE_MODEL_CONTAINER);
- InteractionFragment targetContainer = (InteractionFragment)params.get(SequenceRequestConstant.TARGET_MODEL_CONTAINER);
- Lifeline lifeline = (Lifeline)params.get(SequenceRequestConstant.LIFELINE_GRAPHICAL_CONTAINER);
- if(lifeline != null) {
- if(source instanceof CombinedFragment) {
- CombinedFragment cf = (CombinedFragment)source;
- if(InteractionOperatorKind.PAR_LITERAL.equals(cf.getInteractionOperator())) {
+ InteractionFragment sourceContainer = (InteractionFragment) params.get(SequenceRequestConstant.SOURCE_MODEL_CONTAINER);
+ InteractionFragment targetContainer = (InteractionFragment) params.get(SequenceRequestConstant.TARGET_MODEL_CONTAINER);
+ Lifeline lifeline = (Lifeline) params.get(SequenceRequestConstant.LIFELINE_GRAPHICAL_CONTAINER);
+ if (lifeline != null) {
+ if (source instanceof CombinedFragment) {
+ CombinedFragment cf = (CombinedFragment) source;
+ if (InteractionOperatorKind.PAR_LITERAL.equals(cf.getInteractionOperator())) {
InteractionOperand interactionOperand = getCoRegionInteractionOperand(cf);
sourceContainer = interactionOperand;
targetContainer = interactionOperand;
source = lifeline;
- if(target instanceof Lifeline) {
- addCoveredLifelineToCombinedFragment((Lifeline)target, cf);
+ if (target instanceof Lifeline) {
+ addCoveredLifelineToCombinedFragment((Lifeline) target, cf);
}
}
- } else if(target instanceof CombinedFragment) {
- CombinedFragment cf = (CombinedFragment)target;
- if(InteractionOperatorKind.PAR_LITERAL.equals(cf.getInteractionOperator())) {
+ } else if (target instanceof CombinedFragment) {
+ CombinedFragment cf = (CombinedFragment) target;
+ if (InteractionOperatorKind.PAR_LITERAL.equals(cf.getInteractionOperator())) {
InteractionOperand interactionOperand = getCoRegionInteractionOperand(cf);
sourceContainer = interactionOperand;
targetContainer = interactionOperand;
target = lifeline;
- if(source instanceof Lifeline) {
- addCoveredLifelineToCombinedFragment((Lifeline)source, cf);
+ if (source instanceof Lifeline) {
+ addCoveredLifelineToCombinedFragment((Lifeline) source, cf);
}
}
}
@@ -947,7 +948,7 @@ public class CommandHelper {
private static void addCoveredLifelineToCombinedFragment(Lifeline coveredLifeline, CombinedFragment cf) {
cf.getCovereds().add(coveredLifeline);
- for(InteractionOperand io : cf.getOperands()) {
+ for (InteractionOperand io : cf.getOperands()) {
io.getCovereds().add(coveredLifeline);
}
}
@@ -958,14 +959,14 @@ public class CommandHelper {
public static InteractionOperand getCoRegionInteractionOperand(CombinedFragment cf) {
InteractionOperand interactionOperand = null;
// Search in the existing operands if there are any operand without fragments.
- for(InteractionOperand existingOperand : cf.getOperands()) {
- if(existingOperand.getFragments().isEmpty()) {
+ for (InteractionOperand existingOperand : cf.getOperands()) {
+ if (existingOperand.getFragments().isEmpty()) {
interactionOperand = existingOperand;
break;
}
}
// If the operand is still null, we create a new operand in the combinedFragment.
- if(interactionOperand == null) {
+ if (interactionOperand == null) {
interactionOperand = createCoRegionInteractionOperand(cf);
}
return interactionOperand;
@@ -980,15 +981,15 @@ public class CommandHelper {
/**
* Create a message. It also creates its message end, their corresponding events and updates the signature of the message.
- *
+ *
* @param container
- * the interaction containing the message.
+ * the interaction containing the message.
* @param messageSort
- * the messageSort of the message, it can be null
+ * the messageSort of the message, it can be null
* @param source
- * the source of the message, it can be null
+ * the source of the message, it can be null
* @param target
- * the target of the message, it can be null
+ * the target of the message, it can be null
* @return the created message
*/
public static Message doCreateMessage(Interaction container, MessageSort messageSort, Element source, Element target, InteractionFragment sourceContainer, InteractionFragment targetContainer) {
@@ -997,29 +998,29 @@ public class CommandHelper {
/**
* Create a message. It also creates its message end (if not provided), their corresponding events and updates the signature of the message.
- *
+ *
* @param container
- * the interaction containing the message.
+ * the interaction containing the message.
* @param messageSort
- * the messageSort of the message, it can be null
+ * the messageSort of the message, it can be null
* @param source
- * the source of the message, it can be null
+ * the source of the message, it can be null
* @param target
- * the target of the message, it can be null
+ * the target of the message, it can be null
* @param sendMessageEnd
- * the existing Send MessageEnd of the message
+ * the existing Send MessageEnd of the message
* @param receiveMessageEnd
- * the existing Receive MessageEnd of the message
+ * the existing Receive MessageEnd of the message
* @return the created message
*/
public static Message doCreateMessage(Interaction container, MessageSort messageSort, Element source, Element target, InteractionFragment sourceContainer, InteractionFragment targetContainer, MessageEnd sendMessageEnd, MessageEnd receiveMessageEnd) {
List<NamedElement> signatures = getSignature(container.getModel(), source, target, messageSort);
// If signatures == null, means the user click on cancel button during selection --> Cancel the whole process of creation
- if(signatures == null) {
+ if (signatures == null) {
return null;
}
NamedElement signature = null;
- if(!signatures.isEmpty()) {
+ if (!signatures.isEmpty()) {
signature = signatures.get(0);
}
// Get the correct MessageSort
@@ -1027,43 +1028,43 @@ public class CommandHelper {
// Create the message
Message message = doCreateMessage(container, messageSort, signature);
// Create the two message ends
- if(sendMessageEnd == null && source != null) {
+ if (sendMessageEnd == null && source != null) {
sendMessageEnd = createMessageEnd(sourceContainer, EventHelper.doCreateSendEvent(messageSort, container, signature), source, MessageDirection.OUT);
}
- if(receiveMessageEnd == null && target != null) {
+ if (receiveMessageEnd == null && target != null) {
receiveMessageEnd = createMessageEnd(targetContainer, EventHelper.doCreateReceiveEvent(messageSort, container, signature), target, MessageDirection.IN);
}
// Update the messages end with the message
- if(sendMessageEnd != null) {
+ if (sendMessageEnd != null) {
sendMessageEnd.setMessage(message);
- if(sendMessageEnd.getName() == null) {
+ if (sendMessageEnd.getName() == null) {
ElementInitializers.init_NamedElement(sendMessageEnd, "", message.getName(), "Send"); //$NON-NLS-1$ //$NON-NLS-2$
}
// Update the message with the messages end
message.setSendEvent(sendMessageEnd);
}
- if(receiveMessageEnd != null) {
+ if (receiveMessageEnd != null) {
receiveMessageEnd.setMessage(message);
- if(receiveMessageEnd.getName() == null) {
+ if (receiveMessageEnd.getName() == null) {
ElementInitializers.init_NamedElement(receiveMessageEnd, "", message.getName(), "Recv"); //$NON-NLS-1$ //$NON-NLS-2$
}
// Update the message with the messages end
message.setReceiveEvent(receiveMessageEnd);
}
- //If sendEvent is Gate and the Gate is a inner one of CombinedFragment, make the message name same as the outer one.
- if(sendMessageEnd instanceof Gate && GateHelper.isInnerCFGate((Gate)sendMessageEnd)) {
- Gate outerGate = GateHelper.getOuterCFGate((Gate)sendMessageEnd);
- if(outerGate != null && outerGate.getMessage() != null) {
+ // If sendEvent is Gate and the Gate is a inner one of CombinedFragment, make the message name same as the outer one.
+ if (sendMessageEnd instanceof Gate && GateHelper.isInnerCFGate((Gate) sendMessageEnd)) {
+ Gate outerGate = GateHelper.getOuterCFGate((Gate) sendMessageEnd);
+ if (outerGate != null && outerGate.getMessage() != null) {
message.setName(outerGate.getMessage().getName());
}
}
- if(receiveMessageEnd instanceof Gate && GateHelper.isInnerCFGate((Gate)receiveMessageEnd)) {
- Gate outerCFGate = GateHelper.getOuterCFGate((Gate)receiveMessageEnd);
- if(outerCFGate != null && outerCFGate.getMessage() != null) {
+ if (receiveMessageEnd instanceof Gate && GateHelper.isInnerCFGate((Gate) receiveMessageEnd)) {
+ Gate outerCFGate = GateHelper.getOuterCFGate((Gate) receiveMessageEnd);
+ if (outerCFGate != null && outerCFGate.getMessage() != null) {
message.setName(outerCFGate.getMessage().getName());
}
}
- //Suggest a name for gate with message.
+ // Suggest a name for gate with message.
GateHelper.updateGateWithMessage(message, false);
return message;
}
@@ -1071,16 +1072,16 @@ public class CommandHelper {
/**
* Get the messageSort of a message if it doesn't exist yet depending of the messageSignature.
* If no messageSort exists, and if the signature is null, then return a MessageSort.ASYNCH_CALL_LITERAL
- *
+ *
* @param signature
- * the signature of the message or null
+ * the signature of the message or null
* @param messageSort
- * a messageSort or null
+ * a messageSort or null
* @return the messageSort
*/
private static MessageSort getMessageSort(NamedElement signature, MessageSort messageSort) {
- if(messageSort == null) {
- if(signature instanceof Signal) {
+ if (messageSort == null) {
+ if (signature instanceof Signal) {
return MessageSort.ASYNCH_SIGNAL_LITERAL;
} else {
return MessageSort.ASYNCH_CALL_LITERAL;
@@ -1091,15 +1092,15 @@ public class CommandHelper {
/**
* A method to validate that both source and target of a request have valid container for the creation of a message.
- *
+ *
* @param request
- * the request
+ * the request
* @return false if the container of the source or the target is null and if the two container are not equals
*/
public static boolean hasValidContainer(IEditCommandRequest request) {
Object srcEndContainer = request.getParameter(SequenceRequestConstant.SOURCE_MODEL_CONTAINER);
Object tgtEndContainer = request.getParameter(SequenceRequestConstant.TARGET_MODEL_CONTAINER);
- if(srcEndContainer == null || tgtEndContainer == null) {
+ if (srcEndContainer == null || tgtEndContainer == null) {
return false;
}
/*
@@ -1109,49 +1110,49 @@ public class CommandHelper {
* or one is a gate and the other is a gate in a CF containing the first gate's CF.
*/
// into the same InteractionFragment
- if(srcEndContainer.equals(tgtEndContainer)) {
+ if (srcEndContainer.equals(tgtEndContainer)) {
return true;
}
// one is a gate
- if(request instanceof CreateRelationshipRequest) {
- EObject src = ((CreateRelationshipRequest)request).getSource();
- EObject tgt = ((CreateRelationshipRequest)request).getTarget();
- if(!(src instanceof Lifeline)) {
+ if (request instanceof CreateRelationshipRequest) {
+ EObject src = ((CreateRelationshipRequest) request).getSource();
+ EObject tgt = ((CreateRelationshipRequest) request).getTarget();
+ if (!(src instanceof Lifeline)) {
// send is a gate
- if(src instanceof InteractionOperand) {
+ if (src instanceof InteractionOperand) {
// consider the containing CF
src = src.eContainer();
- } else if(src instanceof Gate) {
- src = ((Gate)src).eContainer();
+ } else if (src instanceof Gate) {
+ src = ((Gate) src).eContainer();
}
- if(src instanceof InteractionFragment) {
+ if (src instanceof InteractionFragment) {
// check whether container of gate is in the target's fragment container
- if(tgtEndContainer instanceof Interaction) {
- if(((Interaction)tgtEndContainer).getFragments().contains(src)) {
+ if (tgtEndContainer instanceof Interaction) {
+ if (((Interaction) tgtEndContainer).getFragments().contains(src)) {
return true;
}
}
- if(tgtEndContainer instanceof InteractionOperand) {
- if(((InteractionOperand)tgtEndContainer).getFragments().contains(src)) {
+ if (tgtEndContainer instanceof InteractionOperand) {
+ if (((InteractionOperand) tgtEndContainer).getFragments().contains(src)) {
return true;
}
}
}
}
- if(!(tgt instanceof Lifeline)) {
+ if (!(tgt instanceof Lifeline)) {
// receive is a gate
- if(tgt instanceof InteractionOperand) {
+ if (tgt instanceof InteractionOperand) {
// consider the containing CF
tgt = tgt.eContainer();
- } else if(tgt instanceof Gate) {
- tgt = ((Gate)tgt).eContainer();
+ } else if (tgt instanceof Gate) {
+ tgt = ((Gate) tgt).eContainer();
}
- if(tgt instanceof InteractionFragment) {
+ if (tgt instanceof InteractionFragment) {
// check whether container of gate is in the source's fragment container
- if(srcEndContainer instanceof Interaction && ((Interaction)srcEndContainer).getFragments().contains(tgt)) {
+ if (srcEndContainer instanceof Interaction && ((Interaction) srcEndContainer).getFragments().contains(tgt)) {
return true;
}
- if(srcEndContainer instanceof InteractionOperand && ((InteractionOperand)srcEndContainer).getFragments().contains(tgt)) {
+ if (srcEndContainer instanceof InteractionOperand && ((InteractionOperand) srcEndContainer).getFragments().contains(tgt)) {
return true;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/DestructionOccurrenceUtil.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/DestructionOccurrenceUtil.java
index 24219a5fbca..53d1e7f18ee 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/DestructionOccurrenceUtil.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/DestructionOccurrenceUtil.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -29,9 +29,9 @@ public class DestructionOccurrenceUtil {
public static void reorderDestructionOccurrence(List<InteractionFragment> reorderedFragments) {
int size = reorderedFragments.size();
List<InteractionFragment> destructionOccurrenceList = new ArrayList<InteractionFragment>(size);
- for(int i = 0; i < size; i++) {
+ for (int i = 0; i < size; i++) {
InteractionFragment o = reorderedFragments.get(i);
- if(o instanceof DestructionOccurrenceSpecification) {
+ if (o instanceof DestructionOccurrenceSpecification) {
destructionOccurrenceList.add(o);
}
}
@@ -40,30 +40,33 @@ public class DestructionOccurrenceUtil {
}
public static void constraintDestructionOccurrence(Message mess, List<InteractionFragment> constraint) {
- if(mess.getMessageSort() != MessageSort.DELETE_MESSAGE_LITERAL)
+ if (mess.getMessageSort() != MessageSort.DELETE_MESSAGE_LITERAL) {
return;
+ }
addDestructionOccurrenceConstraint(mess.getReceiveEvent(), constraint);
addDestructionOccurrenceConstraint(mess.getSendEvent(), constraint);
}
public static void addDestructionOccurrenceConstraint(MessageEnd end, List<InteractionFragment> constraint) {
- if(end instanceof InteractionFragment) {
- InteractionFragment frag = (InteractionFragment)end;
- if(frag.getCovereds().size() > 0) {
- Lifeline lifeline = ((InteractionFragment)frag).getCovereds().get(0);
+ if (end instanceof InteractionFragment) {
+ InteractionFragment frag = (InteractionFragment) end;
+ if (frag.getCovereds().size() > 0) {
+ Lifeline lifeline = frag.getCovereds().get(0);
DestructionOccurrenceSpecification d = findDestructionOccurrence(lifeline);
- if(d != null)
+ if (d != null) {
constraint.add(d);
+ }
}
}
}
public static DestructionOccurrenceSpecification findDestructionOccurrence(Lifeline lifeline) {
EList<InteractionFragment> list = lifeline.getCoveredBys();
- for(InteractionFragment f : list)
- if(f instanceof DestructionOccurrenceSpecification) {
- return (DestructionOccurrenceSpecification)f;
+ for (InteractionFragment f : list) {
+ if (f instanceof DestructionOccurrenceSpecification) {
+ return (DestructionOccurrenceSpecification) f;
}
+ }
return null;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/DurationLinkConstraint.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/DurationLinkConstraint.java
index 8d23f202f40..a724044f542 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/DurationLinkConstraint.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/DurationLinkConstraint.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -31,10 +31,10 @@ public class DurationLinkConstraint extends org.eclipse.papyrus.infra.constraint
@Override
public boolean match(Object selection) {
- if(selection instanceof CommentAnnotatedElementEditPart) {
- CommentAnnotatedElementEditPart sel = (CommentAnnotatedElementEditPart)selection;
+ if (selection instanceof CommentAnnotatedElementEditPart) {
+ CommentAnnotatedElementEditPart sel = (CommentAnnotatedElementEditPart) selection;
EditPart source = sel.getSource();
- if(source != null && sourcePart != null) {
+ if (source != null && sourcePart != null) {
Class<?> clazz = ClassLoaderHelper.loadClass(sourcePart);
return clazz.isInstance(source);
}
@@ -44,18 +44,20 @@ public class DurationLinkConstraint extends org.eclipse.papyrus.infra.constraint
@Override
protected boolean equivalent(Constraint constraint) {
- if(constraint == null) {
+ if (constraint == null) {
return false;
}
- if(!(constraint instanceof DurationLinkConstraint)) {
+ if (!(constraint instanceof DurationLinkConstraint)) {
return false;
}
- DurationLinkConstraint other = (DurationLinkConstraint)constraint;
- if(sourcePart == null) {
- if(other.sourcePart != null)
+ DurationLinkConstraint other = (DurationLinkConstraint) constraint;
+ if (sourcePart == null) {
+ if (other.sourcePart != null) {
return false;
- } else if(!sourcePart.equals(other.sourcePart))
+ }
+ } else if (!sourcePart.equals(other.sourcePart)) {
return false;
+ }
return true;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/ElementIconUtil.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/ElementIconUtil.java
index 163210b3ef6..7c4844c751f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/ElementIconUtil.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/ElementIconUtil.java
@@ -18,16 +18,16 @@ public class ElementIconUtil {
public static Image getLabelIcon(GraphicalEditPart part) {
EObject parserElement = part.resolveSemanticElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, part.getViewer());
- for(View view : views) {
- if(!(view instanceof Diagram) && !(view.eContainer() instanceof View)) {
- continue;//there's a bug in SemanticElementHelper.findSemanticElement().
+ for (View view : views) {
+ if (!(view instanceof Diagram) && !(view.eContainer() instanceof View)) {
+ continue;// there's a bug in SemanticElementHelper.findSemanticElement().
}
- //if(NameLabelIconHelper.showLabelIcon(view)) {
- if(AppearanceHelper.showElementIcon(view)) {
+ // if(NameLabelIconHelper.showLabelIcon(view)) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -35,7 +35,7 @@ public class ElementIconUtil {
}
public static boolean isIconNotification(Notification event) {
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
return true;
}
return false;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/EventHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/EventHelper.java
index c15a0bec210..25dd92816ac 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/EventHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/EventHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -26,161 +26,161 @@ import org.eclipse.uml2.uml.UMLPackage;
/**
* An utility class to create event elements.
- *
+ *
*/
public class EventHelper {
/**
* Create an event
- *
+ *
* @param eventContainer
- * the container
+ * the container
* @return the event
*/
public static Event doCreateEvent(Package eventContainer, EClass eClass) {
- Event event = (Event)eventContainer.createPackagedElement(null, eClass);
+ Event event = (Event) eventContainer.createPackagedElement(null, eClass);
ElementInitializers.init_NamedElement(event);
return event;
}
/**
* Create an event
- *
+ *
* @param eventContainer
- * the container
+ * the container
* @return the event
*/
public static CallEvent doCreateCallEvent(Package eventContainer, Operation operation) {
- CallEvent event = (CallEvent)doCreateEvent(eventContainer, UMLPackage.eINSTANCE.getCallEvent());
+ CallEvent event = (CallEvent) doCreateEvent(eventContainer, UMLPackage.eINSTANCE.getCallEvent());
event.setOperation(operation);
return event;
}
/**
* Create a SendOperation event and initializes its name
- *
+ *
* @param eventContainer
- * the container
+ * the container
* @param operation
- * the operation of the event. Can't be null
+ * the operation of the event. Can't be null
* @return the sendOperation event
*/
- // Does not exist anymore in UML 2.4
- // public static SendOperationEvent doCreateSendOperationEvent(Package eventContainer, Operation operation) {
- // SendOperationEvent sendOperationEvent = (SendOperationEvent)doCreateEvent(eventContainer, UMLPackage.eINSTANCE.getSendOperationEvent());
- // sendOperationEvent.setOperation(operation);
- // return sendOperationEvent;
- // }
+ // Does not exist anymore in UML 2.4
+ // public static SendOperationEvent doCreateSendOperationEvent(Package eventContainer, Operation operation) {
+ // SendOperationEvent sendOperationEvent = (SendOperationEvent)doCreateEvent(eventContainer, UMLPackage.eINSTANCE.getSendOperationEvent());
+ // sendOperationEvent.setOperation(operation);
+ // return sendOperationEvent;
+ // }
/**
* Create a ReceiveOperation event and initializes its name
- *
+ *
* @param eventContainer
- * the container
+ * the container
* @param operation
- * the operation of the event. Can't be null
+ * the operation of the event. Can't be null
* @return the receiveOperation event
*/
- // Does not exist anymore in UML 2.4
- // public static ReceiveOperationEvent doCreateReceiveOperationEvent(Package eventContainer, Operation operation) {
- // ReceiveOperationEvent receiveOperationEvent = (ReceiveOperationEvent)doCreateEvent(eventContainer, UMLPackage.eINSTANCE.getReceiveOperationEvent());
- // receiveOperationEvent.setOperation(operation);
- // return receiveOperationEvent;
- // }
+ // Does not exist anymore in UML 2.4
+ // public static ReceiveOperationEvent doCreateReceiveOperationEvent(Package eventContainer, Operation operation) {
+ // ReceiveOperationEvent receiveOperationEvent = (ReceiveOperationEvent)doCreateEvent(eventContainer, UMLPackage.eINSTANCE.getReceiveOperationEvent());
+ // receiveOperationEvent.setOperation(operation);
+ // return receiveOperationEvent;
+ // }
/**
* Create a send signal event and initializes its name
- *
+ *
* @param eventContainer
- * the container
+ * the container
* @param signal
- * the signal of the event. Can't be null
+ * the signal of the event. Can't be null
* @return the send signal event
*/
- // Does not exist anymore in UML 2.4
- // public static SendSignalEvent doCreateSendSignalEvent(Package eventContainer, Signal signal) {
- // SendSignalEvent sendSignalEvent = (SendSignalEvent)doCreateEvent(eventContainer, UMLPackage.eINSTANCE.getSendSignalEvent());
- // sendSignalEvent.setSignal(signal);
- // return sendSignalEvent;
- // }
+ // Does not exist anymore in UML 2.4
+ // public static SendSignalEvent doCreateSendSignalEvent(Package eventContainer, Signal signal) {
+ // SendSignalEvent sendSignalEvent = (SendSignalEvent)doCreateEvent(eventContainer, UMLPackage.eINSTANCE.getSendSignalEvent());
+ // sendSignalEvent.setSignal(signal);
+ // return sendSignalEvent;
+ // }
/**
* Create a ReceiveSignal event and initializes its name
- *
+ *
* @param eventContainer
- * the container
+ * the container
* @param signal
- * the signal of the event. Can't be null
+ * the signal of the event. Can't be null
* @return the ReceiveSignal event
*/
- // Does not exist anymore in UML 2.4
- // public static ReceiveSignalEvent doCreateReceiveSignalEvent(Package eventContainer, Signal signal) {
- // ReceiveSignalEvent receiveSignalEvent = (ReceiveSignalEvent)doCreateEvent(eventContainer, UMLPackage.eINSTANCE.getReceiveSignalEvent());
- // receiveSignalEvent.setSignal(signal);
- // return receiveSignalEvent;
- // }
- // Does not exist anymore in UML 2.4
- // /**
- // * Create a receive signal event
- // *
- // * @param eventContainer
- // * the container
- // * @return the receive signal event
- // */
- // public static CreationEvent doCreateCreationEvent(Package eventContainer) {
- // return (CreationEvent)doCreateEvent(eventContainer, UMLPackage.eINSTANCE.getCreationEvent());
- // }
+ // Does not exist anymore in UML 2.4
+ // public static ReceiveSignalEvent doCreateReceiveSignalEvent(Package eventContainer, Signal signal) {
+ // ReceiveSignalEvent receiveSignalEvent = (ReceiveSignalEvent)doCreateEvent(eventContainer, UMLPackage.eINSTANCE.getReceiveSignalEvent());
+ // receiveSignalEvent.setSignal(signal);
+ // return receiveSignalEvent;
+ // }
+ // Does not exist anymore in UML 2.4
+ // /**
+ // * Create a receive signal event
+ // *
+ // * @param eventContainer
+ // * the container
+ // * @return the receive signal event
+ // */
+ // public static CreationEvent doCreateCreationEvent(Package eventContainer) {
+ // return (CreationEvent)doCreateEvent(eventContainer, UMLPackage.eINSTANCE.getCreationEvent());
+ // }
//
- // /**
- // * Create a destruction event
- // *
- // * @param eventContainer
- // * the container
- // * @return the destruction event
- // */
- // public static DestructionEvent doCreateDestructionEvent(Package eventContainer) {
- // return (DestructionEvent)doCreateEvent(eventContainer, UMLPackage.eINSTANCE.getDestructionEvent());
- // }
+ // /**
+ // * Create a destruction event
+ // *
+ // * @param eventContainer
+ // * the container
+ // * @return the destruction event
+ // */
+ // public static DestructionEvent doCreateDestructionEvent(Package eventContainer) {
+ // return (DestructionEvent)doCreateEvent(eventContainer, UMLPackage.eINSTANCE.getDestructionEvent());
+ // }
//
- // /**
- // * Create an execution event
- // *
- // * @param eventContainer
- // * the container
- // * @return the executionEvent
- // */
- // public static ExecutionEvent doCreateExecutionEvent(Package eventContainer) {
- // return (ExecutionEvent)doCreateEvent(eventContainer, UMLPackage.eINSTANCE.getExecutionEvent());
- // }
+ // /**
+ // * Create an execution event
+ // *
+ // * @param eventContainer
+ // * the container
+ // * @return the executionEvent
+ // */
+ // public static ExecutionEvent doCreateExecutionEvent(Package eventContainer) {
+ // return (ExecutionEvent)doCreateEvent(eventContainer, UMLPackage.eINSTANCE.getExecutionEvent());
+ // }
/**
* Create a receive event in the package containing the interaction
* If the messageSort is ASYNCH_SIGNAL, it creates a ReceiveSignalEvent
* If the messageSort is ASYNCH_CALL or SYNCH_CALL or REPLY_LITERAL, it creates a ReceiveOperationEvent
* If the messageSort is CREATE_MESSAGE, it creates a CreationEvent.
* If the messageSort is DELETE_MESSAGE, it creates a DestructionEvent.
- *
+ *
* @param messageSort
- * the messageSort
+ * the messageSort
* @param interaction
- * the interaction
+ * the interaction
* @param signature
- * the signature of the message
+ * the signature of the message
* @return the created receive event or null
*/
public static Event doCreateReceiveEvent(MessageSort messageSort, Interaction interaction, NamedElement signature) {
Package eventContainer = interaction.getNearestPackage();
Event event = null;
- switch(messageSort) {
+ switch (messageSort) {
case ASYNCH_SIGNAL_LITERAL:
- //event = doCreateReceiveSignalEvent(eventContainer, (Signal)signature);
+ // event = doCreateReceiveSignalEvent(eventContainer, (Signal)signature);
break;
case ASYNCH_CALL_LITERAL:
case SYNCH_CALL_LITERAL:
case REPLY_LITERAL:
- //event = doCreateReceiveOperationEvent(eventContainer, (Operation)signature);
+ // event = doCreateReceiveOperationEvent(eventContainer, (Operation)signature);
break;
case CREATE_MESSAGE_LITERAL:
- //event = doCreateCreationEvent(eventContainer);
+ // event = doCreateCreationEvent(eventContainer);
break;
case DELETE_MESSAGE_LITERAL:
- //event = doCreateDestructionEvent(eventContainer);
+ // event = doCreateDestructionEvent(eventContainer);
break;
default:
break;
@@ -192,28 +192,28 @@ public class EventHelper {
* Create a sending event in the package containing the interaction.
* If the messageSort is ASYNCH_SIGNAL, CREATE_MESSAGE, DELETE_MESSAGE, it creates a SendSignalEvent
* If the messageSort is ASYNCH_CALL, SYNCH_CALL, REPLY_LITERAL, it creates a SendOperationEvent.
- *
+ *
* @param messageSort
- * the messageSort
+ * the messageSort
* @param interaction
- * the interaction
+ * the interaction
* @param signature
- * the signature of the message
+ * the signature of the message
* @return the created send event or null
*/
public static Event doCreateSendEvent(MessageSort messageSort, Interaction interaction, NamedElement signature) {
Package eventContainer = interaction.getNearestPackage();
Event event = null;
- switch(messageSort) {
+ switch (messageSort) {
case ASYNCH_SIGNAL_LITERAL:
case CREATE_MESSAGE_LITERAL:
case DELETE_MESSAGE_LITERAL:
- //event = doCreateSendSignalEvent(eventContainer, (Signal)signature);
+ // event = doCreateSendSignalEvent(eventContainer, (Signal)signature);
break;
case ASYNCH_CALL_LITERAL:
case SYNCH_CALL_LITERAL:
case REPLY_LITERAL:
- //event = doCreateSendOperationEvent(eventContainer, (Operation)signature);
+ // event = doCreateSendOperationEvent(eventContainer, (Operation)signature);
break;
default:
break;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/FixGateViewOnOpening.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/FixGateViewOnOpening.java
index 41c6a79e657..c3c26ad1cf3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/FixGateViewOnOpening.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/FixGateViewOnOpening.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -29,6 +29,7 @@ import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
import org.eclipse.gmf.runtime.diagram.core.commands.SetConnectionAnchorsCommand;
import org.eclipse.gmf.runtime.diagram.core.commands.SetConnectionEndsCommand;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.BaseSlidableAnchor;
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.gmf.runtime.gef.ui.figures.SlidableAnchor;
import org.eclipse.gmf.runtime.notation.Anchor;
@@ -56,28 +57,28 @@ import org.eclipse.uml2.uml.Message;
/**
* This class fixes the missing view of gate for older version diagrams.
* It also redirect the messages' ends to the new gate view if existed.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class FixGateViewOnOpening {
public void fix(Diagram diagram) {
TreeIterator<EObject> contents = diagram.eAllContents();
- while(contents.hasNext()) {
+ while (contents.hasNext()) {
EObject next = contents.next();
- if(!(next instanceof Shape)) {
+ if (!(next instanceof Shape)) {
continue;
}
- Shape shape = (Shape)next;
+ Shape shape = (Shape) next;
EObject element = ViewUtil.resolveSemanticElement(shape);
- if(!isGateContainer(element)) {
+ if (!isGateContainer(element)) {
continue;
}
List<Gate> allGates = getAllGates(element);
- if(allGates.isEmpty()) {
+ if (allGates.isEmpty()) {
continue;
}
- for(Gate gate : allGates) {
+ for (Gate gate : allGates) {
doFix(diagram, shape, gate);
}
}
@@ -88,39 +89,39 @@ public class FixGateViewOnOpening {
* @param gate
*/
private void doFix(Diagram diagram, Shape parent, Gate gate) {
- //Ignore CoRegion.
- if(UMLVisualIDRegistry.getType(CombinedFragment2EditPart.VISUAL_ID).equals(parent.getType())) {
+ // Ignore CoRegion.
+ if (UMLVisualIDRegistry.getType(CombinedFragment2EditPart.VISUAL_ID).equals(parent.getType())) {
return;
}
View view = findPrimaryView(diagram, gate);
- if(view != null) {
+ if (view != null) {
return;
}
Message message = gate.getMessage();
- //NPE happens.
- if(message == null) {
+ // NPE happens.
+ if (message == null) {
return;
}
View messageView = findPrimaryView(diagram, message);
Edge edge = null;
- if(messageView instanceof Edge) {
- edge = ((Edge)messageView);
+ if (messageView instanceof Edge) {
+ edge = ((Edge) messageView);
}
Point location = null;
Rectangle rect = getBounds(parent);
- if(message != null && edge != null) {
- if(gate == message.getReceiveEvent() && parent == edge.getTarget()) {
+ if (message != null && edge != null) {
+ if (gate == message.getReceiveEvent() && parent == edge.getTarget()) {
location = getLocation(rect, edge.getTargetAnchor());
- } else if(gate == message.getSendEvent() && parent == edge.getSource()) {
+ } else if (gate == message.getSendEvent() && parent == edge.getSource()) {
location = getLocation(rect, edge.getSourceAnchor());
}
}
- if(location == null) {
+ if (location == null) {
int index = indexOfGate(gate);
- if(index != -1) {
- if(gate == message.getReceiveEvent()) {
+ if (index != -1) {
+ if (gate == message.getReceiveEvent()) {
location = new Point(rect.x, rect.y + GateEditPart.DEFAULT_SIZE.height * index + 2);
- } else if(gate == message.getSendEvent()) {
+ } else if (gate == message.getSendEvent()) {
location = new Point(rect.right(), rect.y + GateEditPart.DEFAULT_SIZE.height * index + 2);
}
}
@@ -129,22 +130,22 @@ public class FixGateViewOnOpening {
CompositeCommand fixCommands = new CompositeCommand("Fix Gate View");
CreateGateViewCommand command = new CreateGateViewCommand(editingDomain, new EObjectAdapter(parent), location, new EObjectAdapter(gate));
fixCommands.add(command);
- if(message != null && edge != null) {
+ if (message != null && edge != null) {
SetConnectionEndsCommand redirectCommand = new SetConnectionEndsCommand(editingDomain, "Reset Message End");
redirectCommand.setEdgeAdaptor(new EObjectAdapter(messageView));
SetConnectionAnchorsCommand repairAnchorsCommand = new SetConnectionAnchorsCommand(editingDomain, "Repair Anchors on Gate");
repairAnchorsCommand.setEdgeAdaptor(new EObjectAdapter(messageView));
- if(gate == message.getReceiveEvent() && parent == edge.getTarget()) {
+ if (gate == message.getReceiveEvent() && parent == edge.getTarget()) {
redirectCommand.setNewTargetAdaptor(command.getResult());
repairAnchorsCommand.setNewTargetTerminal("(0,0.5)");
- } else if(gate == message.getSendEvent() && parent == edge.getSource()) {
+ } else if (gate == message.getSendEvent() && parent == edge.getSource()) {
redirectCommand.setNewSourceAdaptor(command.getResult());
repairAnchorsCommand.setNewSourceTerminal("(1,0.5)");
}
- if(redirectCommand.canExecute()) {
+ if (redirectCommand.canExecute()) {
fixCommands.add(redirectCommand);
}
- if(repairAnchorsCommand.canExecute()) {
+ if (repairAnchorsCommand.canExecute()) {
fixCommands.add(repairAnchorsCommand);
}
}
@@ -152,30 +153,30 @@ public class FixGateViewOnOpening {
}
private int indexOfGate(Gate gate) {
- if(gate == null || gate.eContainer() == null) {
+ if (gate == null || gate.eContainer() == null) {
return -1;
}
EObject parent = gate.eContainer();
- if(parent instanceof CombinedFragment) {
- return ((CombinedFragment)parent).getCfragmentGates().indexOf(gate);
- } else if(parent instanceof InteractionUse) {
- return ((InteractionUse)parent).getActualGates().indexOf(gate);
- } else if(parent instanceof Interaction) {
- return ((Interaction)parent).getFormalGates().indexOf(gate);
+ if (parent instanceof CombinedFragment) {
+ return ((CombinedFragment) parent).getCfragmentGates().indexOf(gate);
+ } else if (parent instanceof InteractionUse) {
+ return ((InteractionUse) parent).getActualGates().indexOf(gate);
+ } else if (parent instanceof Interaction) {
+ return ((Interaction) parent).getFormalGates().indexOf(gate);
}
return -1;
}
private Rectangle getBounds(Shape parent) {
- int width = ((Integer)getStructuralFeatureValue(parent, NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(parent, NotationPackage.eINSTANCE.getSize_Height())).intValue();
- int x = ((Integer)getStructuralFeatureValue(parent, NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(parent, NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(parent, NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(parent, NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(parent, NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(parent, NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Dimension size = computePreferenceSize(parent);
- if(width <= 0) {
+ if (width <= 0) {
width = size.width;
}
- if(height <= 0) {
+ if (height <= 0) {
height = size.height;
}
return new Rectangle(x, y, width, height);
@@ -200,10 +201,10 @@ public class FixGateViewOnOpening {
* @return
*/
private Point getLocation(Rectangle rect, Anchor sourceAnchor) {
- if(sourceAnchor instanceof IdentityAnchor) {
- String terminal = ((IdentityAnchor)sourceAnchor).getId();
- PrecisionPoint precise = SlidableAnchor.parseTerminalString(terminal);
- if(precise != null) {
+ if (sourceAnchor instanceof IdentityAnchor) {
+ String terminal = ((IdentityAnchor) sourceAnchor).getId();
+ PrecisionPoint precise = BaseSlidableAnchor.parseTerminalString(terminal);
+ if (precise != null) {
return new PrecisionPoint(rect.x + rect.width * precise.preciseX(), rect.y + rect.height * precise.preciseY());
}
}
@@ -211,18 +212,18 @@ public class FixGateViewOnOpening {
}
private View findPrimaryView(Diagram diagram, EObject target) {
- if(diagram == null || target == null) {
+ if (diagram == null || target == null) {
return null;
}
TreeIterator<EObject> contents = diagram.eAllContents();
- while(contents.hasNext()) {
+ while (contents.hasNext()) {
EObject next = contents.next();
- if(!(next instanceof Shape || next instanceof Edge)) {
+ if (!(next instanceof Shape || next instanceof Edge)) {
continue;
}
- View view = (View)next;
+ View view = (View) next;
EObject element = ViewUtil.resolveSemanticElement(view);
- if(target == element) {
+ if (target == element) {
return findTopView(view, element);
}
}
@@ -231,10 +232,10 @@ public class FixGateViewOnOpening {
private View findTopView(View view, EObject element) {
EObject eContainer = view.eContainer();
- if(eContainer instanceof View) {
- View containerView = (View)eContainer;
+ if (eContainer instanceof View) {
+ View containerView = (View) eContainer;
EObject containerSemantic = ViewUtil.resolveSemanticElement(containerView);
- if(element == containerSemantic) {
+ if (element == containerSemantic) {
return findTopView(containerView, element);
}
}
@@ -242,12 +243,12 @@ public class FixGateViewOnOpening {
}
private List<Gate> getAllGates(EObject parent) {
- if(parent instanceof CombinedFragment) {
- return ((CombinedFragment)parent).getCfragmentGates();
- } else if(parent instanceof InteractionUse) {
- return ((InteractionUse)parent).getActualGates();
- } else if(parent instanceof Interaction) {
- return ((Interaction)parent).getFormalGates();
+ if (parent instanceof CombinedFragment) {
+ return ((CombinedFragment) parent).getCfragmentGates();
+ } else if (parent instanceof InteractionUse) {
+ return ((InteractionUse) parent).getActualGates();
+ } else if (parent instanceof Interaction) {
+ return ((Interaction) parent).getFormalGates();
}
return Collections.emptyList();
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/FixInteractionOperandsOnOpening.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/FixInteractionOperandsOnOpening.java
index 12ce64eafa5..b94bc6da1ea 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/FixInteractionOperandsOnOpening.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/FixInteractionOperandsOnOpening.java
@@ -7,7 +7,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
+ *
* CEA LIST - Initial API and implementation (ansgar.radermacher@cea.fr)
*
*****************************************************************************/
@@ -39,31 +39,31 @@ public class FixInteractionOperandsOnOpening {
/**
* This method fixes the bounds of interaction operands
- *
+ *
* @param diagram
- * the diagram
+ * the diagram
*/
public void fix(Diagram diagram) {
String IAO_ID = "" + InteractionOperandEditPart.VISUAL_ID;
// Parse diagram content
Iterator<EObject> it = diagram.eAllContents();
- while(it.hasNext()) {
+ while (it.hasNext()) {
EObject current = it.next();
// Select only shapes
- if(!(current instanceof Shape)) {
+ if (!(current instanceof Shape)) {
continue;
}
- String currentType = ((Shape)current).getType();
- if(IAO_ID.equals(currentType)) {
- Shape iaOperandShape = (Shape)current;
+ String currentType = ((Shape) current).getType();
+ if (IAO_ID.equals(currentType)) {
+ Shape iaOperandShape = (Shape) current;
View parentDecoration = ViewUtil.getViewContainer(iaOperandShape);
- if(parentDecoration != null) {
+ if (parentDecoration != null) {
View parentParentView = ViewUtil.getViewContainer(parentDecoration);
- if(parentParentView instanceof Shape) {
- Shape parentShape = (Shape)parentParentView;
- Bounds iaOperandShapeBounds = (Bounds)iaOperandShape.getLayoutConstraint();
- Bounds parentShapeBounds = (Bounds)parentShape.getLayoutConstraint();
- if((iaOperandShapeBounds.getX() == 0) && (iaOperandShapeBounds.getY() == 0) && (iaOperandShapeBounds.getWidth() == -1)) {
+ if (parentParentView instanceof Shape) {
+ Shape parentShape = (Shape) parentParentView;
+ Bounds iaOperandShapeBounds = (Bounds) iaOperandShape.getLayoutConstraint();
+ Bounds parentShapeBounds = (Bounds) parentShape.getLayoutConstraint();
+ if ((iaOperandShapeBounds.getX() == 0) && (iaOperandShapeBounds.getY() == 0) && (iaOperandShapeBounds.getWidth() == -1)) {
// distribute operands equally within the combined fragment.
int size = parentDecoration.getChildren().size();
int index = parentDecoration.getChildren().indexOf(iaOperandShape);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/FragmentsOrderer.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/FragmentsOrderer.java
index 511f6d62f9b..4cd6b664d76 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/FragmentsOrderer.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/FragmentsOrderer.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -49,7 +49,7 @@ import org.eclipse.uml2.uml.PartDecomposition;
/**
* Ordering InteractionFragments of Interaction or InteractionOperand.
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=403233
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class FragmentsOrderer {
@@ -73,32 +73,32 @@ public class FragmentsOrderer {
/**
* Constructor.
- *
+ *
*/
public FragmentsOrderer(IGraphicalEditPart fragmentRootEditPart) {
this.fragmentRootEditPart = fragmentRootEditPart;
}
public void addCachePosition(View view, Float[] position) {
- if(cachePositions == null) {
+ if (cachePositions == null) {
cachePositions = new HashMap<View, Float[]>(1);
}
cachePositions.put(view, position);
}
private boolean prepared() {
- if(fragmentRootEditPart == null) {
+ if (fragmentRootEditPart == null) {
return false;
}
EObject element = fragmentRootEditPart.resolveSemanticElement();
- if(element instanceof Interaction || element instanceof InteractionOperand) {
- fragmentRoot = (InteractionFragment)element;
+ if (element instanceof Interaction || element instanceof InteractionOperand) {
+ fragmentRoot = (InteractionFragment) element;
} else {
return false;
}
- //compute fragment position;
+ // compute fragment position;
fragmentPositions = new HashMap<InteractionFragment, Float>();
- //compute new indexes.
+ // compute new indexes.
fragmentIndexes = new HashMap<InteractionFragment, Integer>();
EList<InteractionFragment> orderingFragments = getOrderingFragments();
return orderingFragments != null && !orderingFragments.isEmpty();
@@ -113,20 +113,21 @@ public class FragmentsOrderer {
List<Entry<InteractionFragment, Float>> positionalEntries = new ArrayList<Map.Entry<InteractionFragment, Float>>(fragmentPositions.entrySet());
Collections.sort(positionalEntries, new Comparator<Map.Entry<InteractionFragment, Float>>() {
+ @Override
public int compare(Entry<InteractionFragment, Float> o1, Entry<InteractionFragment, Float> o2) {
Float v1 = o1.getValue();
Float v2 = o2.getValue();
- if(v1 != null && v2 != null) {
- if(v1 < v2) {
+ if (v1 != null && v2 != null) {
+ if (v1 < v2) {
return -1;
- } else if(v1 > v2) {
+ } else if (v1 > v2) {
return 1;
}
}
return 0;
}
});
- for(int i = 0; i < positionalEntries.size(); i++) {
+ for (int i = 0; i < positionalEntries.size(); i++) {
Entry<InteractionFragment, Float> entry = positionalEntries.get(i);
fragmentIndexes.put(entry.getKey(), i);
}
@@ -134,29 +135,29 @@ public class FragmentsOrderer {
private EList<InteractionFragment> getOrderingFragments() {
EList<InteractionFragment> fragments = null;
- if(fragmentRoot instanceof Interaction) {
- fragments = ((Interaction)fragmentRoot).getFragments();
- } else if(fragmentRoot instanceof InteractionOperand) {
- fragments = ((InteractionOperand)fragmentRoot).getFragments();
+ if (fragmentRoot instanceof Interaction) {
+ fragments = ((Interaction) fragmentRoot).getFragments();
+ } else if (fragmentRoot instanceof InteractionOperand) {
+ fragments = ((InteractionOperand) fragmentRoot).getFragments();
}
return fragments;
}
private View getGraphicalView(EObject eObj) {
- if(eObj instanceof ExecutionOccurrenceSpecification) {
- ExecutionSpecification execution = ((ExecutionOccurrenceSpecification)eObj).getExecution();
+ if (eObj instanceof ExecutionOccurrenceSpecification) {
+ ExecutionSpecification execution = ((ExecutionOccurrenceSpecification) eObj).getExecution();
return getGraphicalView(execution);
- } else if(eObj instanceof MessageOccurrenceSpecification) {
- return getGraphicalView(((MessageOccurrenceSpecification)eObj).getMessage());
- } else if(eObj instanceof PartDecomposition) {
- EList<Lifeline> covereds = ((PartDecomposition)eObj).getCovereds();
- if(covereds.size() == 1) {
+ } else if (eObj instanceof MessageOccurrenceSpecification) {
+ return getGraphicalView(((MessageOccurrenceSpecification) eObj).getMessage());
+ } else if (eObj instanceof PartDecomposition) {
+ EList<Lifeline> covereds = ((PartDecomposition) eObj).getCovereds();
+ if (covereds.size() == 1) {
return getGraphicalView(covereds.get(0));
}
- } else if(eObj != null) {
+ } else if (eObj != null) {
List<?> views = DiagramEditPartsUtil.getEObjectViews(eObj);
- if(views.size() == 1) {
- return (View)views.get(0);
+ if (views.size() == 1) {
+ return (View) views.get(0);
}
return null;
}
@@ -164,37 +165,37 @@ public class FragmentsOrderer {
}
private Float getPosition(InteractionFragment fragment) {
- if(fragment == null) {
+ if (fragment == null) {
return null;
}
View view = getGraphicalView(fragment);
- if(view == null) {
+ if (view == null) {
return null;
}
Float[] preferPosition = cachePositions != null ? cachePositions.get(view) : null;
EObject hostElement = ViewUtil.resolveSemanticElement(view);
EditPart editPart = DiagramEditPartsUtil.getEditPartFromView(view, fragmentRootEditPart);
- if(fragment instanceof MessageOccurrenceSpecification && hostElement instanceof Message && editPart instanceof ConnectionNodeEditPart) {
- boolean isStart = fragment == ((Message)hostElement).getSendEvent();
- Point location = getAbsoluteEdgeExtremity((ConnectionNodeEditPart)editPart, isStart, preferPosition);
- if(location != null) {
+ if (fragment instanceof MessageOccurrenceSpecification && hostElement instanceof Message && editPart instanceof ConnectionNodeEditPart) {
+ boolean isStart = fragment == ((Message) hostElement).getSendEvent();
+ Point location = getAbsoluteEdgeExtremity((ConnectionNodeEditPart) editPart, isStart, preferPosition);
+ if (location != null) {
return isStart ? location.y - HALF_UNIT : location.y + HALF_UNIT;
}
- } else if(fragment instanceof ExecutionOccurrenceSpecification && hostElement instanceof ExecutionSpecification && editPart instanceof IGraphicalEditPart) {
- Rectangle bounds = getAbsoluteBounds((IGraphicalEditPart)editPart, preferPosition);
- if(bounds != null) {
- if(bounds.height <= 0) {
- bounds.height = 50;//LifelineXYLayoutEditPolicy.EXECUTION_INIT_HEIGHT;
+ } else if (fragment instanceof ExecutionOccurrenceSpecification && hostElement instanceof ExecutionSpecification && editPart instanceof IGraphicalEditPart) {
+ Rectangle bounds = getAbsoluteBounds((IGraphicalEditPart) editPart, preferPosition);
+ if (bounds != null) {
+ if (bounds.height <= 0) {
+ bounds.height = 50;// LifelineXYLayoutEditPolicy.EXECUTION_INIT_HEIGHT;
}
- if(fragment == ((ExecutionSpecification)hostElement).getStart()) {
+ if (fragment == ((ExecutionSpecification) hostElement).getStart()) {
return bounds.y - HALF_UNIT;
} else {
return bounds.bottom() + HALF_UNIT;
}
}
- } else if(view instanceof Shape && editPart instanceof IGraphicalEditPart) {
- Rectangle bounds = getAbsoluteBounds((IGraphicalEditPart)editPart, preferPosition);
- if(bounds != null) {
+ } else if (view instanceof Shape && editPart instanceof IGraphicalEditPart) {
+ Rectangle bounds = getAbsoluteBounds((IGraphicalEditPart) editPart, preferPosition);
+ if (bounds != null) {
return bounds.y * CONVERT_UNIT;
}
}
@@ -202,16 +203,16 @@ public class FragmentsOrderer {
}
private Point getAbsoluteEdgeExtremity(ConnectionNodeEditPart editPart, boolean isStart, Float[] preferPosition) {
- if(editPart == null) {
+ if (editPart == null) {
return null;
}
PointList points = editPart.getConnectionFigure().getPoints().getCopy();
- if(points.size() == 2 && new Point(0, 0).equals(points.getFirstPoint()) && new Point(100, 100).equals(points.getLastPoint())) {
- //not display yet.
- if(preferPosition != null) {
- if(isStart && preferPosition[0] != null) {
+ if (points.size() == 2 && new Point(0, 0).equals(points.getFirstPoint()) && new Point(100, 100).equals(points.getLastPoint())) {
+ // not display yet.
+ if (preferPosition != null) {
+ if (isStart && preferPosition[0] != null) {
return new Point(0, preferPosition[0].intValue());
- } else if(!isStart && preferPosition[1] != null) {
+ } else if (!isStart && preferPosition[1] != null) {
return new Point(0, preferPosition[1].intValue());
}
}
@@ -221,33 +222,33 @@ public class FragmentsOrderer {
}
private Rectangle getAbsoluteBounds(IGraphicalEditPart editPart, Float[] preferPosition) {
- if(editPart == null) {
+ if (editPart == null) {
return null;
}
Rectangle rect = editPart.getFigure().getBounds().getCopy();
- if(rect.isEmpty() && rect.x == 0 && rect.y == 0) {//Not displayed yet.
+ if (rect.isEmpty() && rect.x == 0 && rect.y == 0) {// Not displayed yet.
View view = editPart.getNotationView();
- if(view instanceof Node) {
- LayoutConstraint constraint = ((Node)view).getLayoutConstraint();
- if(constraint instanceof Bounds) {
- Bounds bounds = (Bounds)constraint;
- if(bounds.getX() > 0) {
+ if (view instanceof Node) {
+ LayoutConstraint constraint = ((Node) view).getLayoutConstraint();
+ if (constraint instanceof Bounds) {
+ Bounds bounds = (Bounds) constraint;
+ if (bounds.getX() > 0) {
rect.x = bounds.getX();
}
- if(bounds.getY() > 0) {
+ if (bounds.getY() > 0) {
rect.y = bounds.getY();
- } else if(preferPosition != null && preferPosition.length > 0 && preferPosition[0] != null) {
+ } else if (preferPosition != null && preferPosition.length > 0 && preferPosition[0] != null) {
rect.y = preferPosition[0].intValue();
}
- if(bounds.getWidth() != -1) {
+ if (bounds.getWidth() != -1) {
rect.width = bounds.getWidth();
}
- if(bounds.getHeight() != -1) {
+ if (bounds.getHeight() != -1) {
rect.height = bounds.getHeight();
}
}
}
- Rectangle parentRect = getAbsoluteBounds((IGraphicalEditPart)editPart.getParent(), null);
+ Rectangle parentRect = getAbsoluteBounds((IGraphicalEditPart) editPart.getParent(), null);
rect.x += parentRect.x;
rect.y += parentRect.y;
} else {
@@ -257,7 +258,7 @@ public class FragmentsOrderer {
}
public void ordering() {
- if(prepared()) {
+ if (prepared()) {
safelyChangeOrder();
}
clear();
@@ -268,21 +269,21 @@ public class FragmentsOrderer {
*/
protected void computePositions() {
final EList<InteractionFragment> orderingFragments = getOrderingFragments();
- if(orderingFragments == null || orderingFragments.isEmpty()) {
+ if (orderingFragments == null || orderingFragments.isEmpty()) {
return;
}
- for(InteractionFragment fragment : orderingFragments) {
+ for (InteractionFragment fragment : orderingFragments) {
Float newPos = getPosition(fragment);
fragmentPositions.put(fragment, newPos);
}
}
private void clear() {
- if(fragmentIndexes != null) {
+ if (fragmentIndexes != null) {
fragmentIndexes.clear();
fragmentIndexes = null;
}
- if(fragmentPositions != null) {
+ if (fragmentPositions != null) {
fragmentPositions.clear();
fragmentPositions = null;
}
@@ -294,15 +295,15 @@ public class FragmentsOrderer {
*/
protected void safelyChangeOrder() {
EList<InteractionFragment> orderingFragments = getOrderingFragments();
- synchronized(orderingFragments) {
+ synchronized (orderingFragments) {
computeNewIndexes();
- for(InteractionFragment fragment : new ArrayList<InteractionFragment>(orderingFragments)) {
+ for (InteractionFragment fragment : new ArrayList<InteractionFragment>(orderingFragments)) {
int oldPos = orderingFragments.indexOf(fragment);
- if(oldPos == -1) {
+ if (oldPos == -1) {
continue;
}
Integer newPos = fragmentIndexes.get(fragment);
- if(newPos == null || oldPos == newPos.intValue() || newPos.intValue() < 0 || newPos.intValue() >= orderingFragments.size()) {
+ if (newPos == null || oldPos == newPos.intValue() || newPos.intValue() < 0 || newPos.intValue() >= orderingFragments.size()) {
continue;
}
orderingFragments.move(newPos.intValue(), oldPos);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/FragmentsOrdererHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/FragmentsOrdererHelper.java
index 273881d413c..85e860ecfaf 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/FragmentsOrdererHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/FragmentsOrdererHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -58,63 +58,63 @@ import org.eclipse.uml2.uml.OccurrenceSpecification;
/**
* Ordering InteractionFragments of Interaction or InteractionOperand.
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=403233
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class FragmentsOrdererHelper {
private static final List<String> INTERACTION_FRAGMENT_HINTS = new ArrayList<String>();
static {
- INTERACTION_FRAGMENT_HINTS.add(((IHintedType)UMLElementTypes.ActionExecutionSpecification_3006).getSemanticHint());
- INTERACTION_FRAGMENT_HINTS.add(((IHintedType)UMLElementTypes.BehaviorExecutionSpecification_3003).getSemanticHint());
- INTERACTION_FRAGMENT_HINTS.add(((IHintedType)UMLElementTypes.CombinedFragment_3004).getSemanticHint());
- INTERACTION_FRAGMENT_HINTS.add(((IHintedType)UMLElementTypes.CombinedFragment_3018).getSemanticHint());
- INTERACTION_FRAGMENT_HINTS.add(((IHintedType)UMLElementTypes.InteractionUse_3002).getSemanticHint());
- INTERACTION_FRAGMENT_HINTS.add(((IHintedType)UMLElementTypes.StateInvariant_3017).getSemanticHint());
+ INTERACTION_FRAGMENT_HINTS.add(((IHintedType) UMLElementTypes.ActionExecutionSpecification_3006).getSemanticHint());
+ INTERACTION_FRAGMENT_HINTS.add(((IHintedType) UMLElementTypes.BehaviorExecutionSpecification_3003).getSemanticHint());
+ INTERACTION_FRAGMENT_HINTS.add(((IHintedType) UMLElementTypes.CombinedFragment_3004).getSemanticHint());
+ INTERACTION_FRAGMENT_HINTS.add(((IHintedType) UMLElementTypes.CombinedFragment_3018).getSemanticHint());
+ INTERACTION_FRAGMENT_HINTS.add(((IHintedType) UMLElementTypes.InteractionUse_3002).getSemanticHint());
+ INTERACTION_FRAGMENT_HINTS.add(((IHintedType) UMLElementTypes.StateInvariant_3017).getSemanticHint());
}
/**
* Constructor.
- *
+ *
*/
private FragmentsOrdererHelper() {
}
private static boolean isCreatingFragments(EditPart parentEditPart, CreateViewAndElementRequest request) {
- if(request == null) {
+ if (request == null) {
return false;
}
ViewAndElementDescriptor desc = request.getViewAndElementDescriptor();
- if(desc == null) {
+ if (desc == null) {
return false;
}
String semanticHint = desc.getSemanticHint();
- if(semanticHint == null) {
+ if (semanticHint == null) {
return false;
}
- if(INTERACTION_FRAGMENT_HINTS.contains(semanticHint)) {
+ if (INTERACTION_FRAGMENT_HINTS.contains(semanticHint)) {
return true;
}
- //PartDecomposition
- else if(parentEditPart instanceof LifelineEditPart && ((IHintedType)UMLElementTypes.Lifeline_3001).getSemanticHint().equals(semanticHint)) {
+ // PartDecomposition
+ else if (parentEditPart instanceof LifelineEditPart && ((IHintedType) UMLElementTypes.Lifeline_3001).getSemanticHint().equals(semanticHint)) {
return true;
}
return false;
}
private static TransactionalEditingDomain getEditingDomain(EditPart editPart) {
- if(editPart == null) {
+ if (editPart == null) {
return null;
}
- IGraphicalEditPart graphicalEditPart = (IGraphicalEditPart)editPart.getAdapter(IGraphicalEditPart.class);
- if(graphicalEditPart != null) {
+ IGraphicalEditPart graphicalEditPart = (IGraphicalEditPart) editPart.getAdapter(IGraphicalEditPart.class);
+ if (graphicalEditPart != null) {
return graphicalEditPart.getEditingDomain();
}
return null;
}
public static Command createOrderingFragmentsCommand(final EditPart anyEditPart, final ReconnectRequest request) {
- if(anyEditPart == null || request == null || request.getConnectionEditPart() == null) {
+ if (anyEditPart == null || request == null || request.getConnectionEditPart() == null) {
return null;
}
return new ICommandProxy(new AbstractTransactionalCommand(getEditingDomain(anyEditPart), "", null) {
@@ -123,19 +123,19 @@ public class FragmentsOrdererHelper {
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
final Map<View, Float[]> viewPositions = new HashMap<View, Float[]>();
ConnectionEditPart conn = request.getConnectionEditPart();
- if(conn != null) {
- // View view = (View)conn.getAdapter(View.class);
- // if(RequestConstants.REQ_RECONNECT_SOURCE.equals(request.getType())) {
- // Point location = request.getLocation().getCopy();
- // Float[] positions = new Float[2];
- // positions[0] = Float.valueOf(location.y);
- // viewPositions.put(view, positions);
- // } else if(RequestConstants.REQ_RECONNECT_SOURCE.equals(request.getType())) {
- // Point location = request.getLocation().getCopy();
- // Float[] positions = new Float[2];
- // positions[1] = Float.valueOf(location.y);
- // viewPositions.put(view, positions);
- // }
+ if (conn != null) {
+ // View view = (View)conn.getAdapter(View.class);
+ // if(RequestConstants.REQ_RECONNECT_SOURCE.equals(request.getType())) {
+ // Point location = request.getLocation().getCopy();
+ // Float[] positions = new Float[2];
+ // positions[0] = Float.valueOf(location.y);
+ // viewPositions.put(view, positions);
+ // } else if(RequestConstants.REQ_RECONNECT_SOURCE.equals(request.getType())) {
+ // Point location = request.getLocation().getCopy();
+ // Float[] positions = new Float[2];
+ // positions[1] = Float.valueOf(location.y);
+ // viewPositions.put(view, positions);
+ // }
orderingFragments(conn, viewPositions);
}
return CommandResult.newOKCommandResult();
@@ -144,7 +144,7 @@ public class FragmentsOrdererHelper {
}
public static Command createOrderingFragmentsCommand(final EditPart anyEditPart, final CreateConnectionViewAndElementRequest request) {
- if(anyEditPart == null || request == null) {
+ if (anyEditPart == null || request == null) {
return null;
}
return new ICommandProxy(new AbstractTransactionalCommand(getEditingDomain(anyEditPart), "", null) {
@@ -153,15 +153,15 @@ public class FragmentsOrdererHelper {
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
final Map<View, Float[]> viewPositions = new HashMap<View, Float[]>();
ConnectionViewAndElementDescriptor desc = request.getConnectionViewAndElementDescriptor();
- if(desc != null) {
- View view = (View)desc.getAdapter(View.class);
- if(view instanceof Edge) {
+ if (desc != null) {
+ View view = (View) desc.getAdapter(View.class);
+ if (view instanceof Edge) {
Point location = request.getLocation().getCopy();
Float[] positions = new Float[2];
positions[1] = Float.valueOf(location.y);
Object sourceLoc = request.getExtendedData().get(SequenceRequestConstant.SOURCE_LOCATION_DATA);
- if(sourceLoc instanceof Point) {
- positions[0] = Float.valueOf(((Point)sourceLoc).y);
+ if (sourceLoc instanceof Point) {
+ positions[0] = Float.valueOf(((Point) sourceLoc).y);
}
viewPositions.put(view, positions);
}
@@ -173,7 +173,7 @@ public class FragmentsOrdererHelper {
}
public static ICommand createOrderingFragmentsCommand(final EditPart parentEditPart, final CreateViewAndElementRequest request) {
- if(parentEditPart == null || request == null || !isCreatingFragments(parentEditPart, request)) {
+ if (parentEditPart == null || request == null || !isCreatingFragments(parentEditPart, request)) {
return null;
}
return new AbstractTransactionalCommand(getEditingDomain(parentEditPart), "", null) {
@@ -182,15 +182,15 @@ public class FragmentsOrdererHelper {
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
final Map<View, Float[]> viewPositions = new HashMap<View, Float[]>();
ViewAndElementDescriptor desc = request.getViewAndElementDescriptor();
- if(desc != null) {
- View view = (View)desc.getAdapter(View.class);
- if(view != null) {
+ if (desc != null) {
+ View view = (View) desc.getAdapter(View.class);
+ if (view != null) {
Point location = request.getLocation().getCopy();
- if(parentEditPart instanceof IGraphicalEditPart) {
- ((IGraphicalEditPart)parentEditPart).getFigure().translateToRelative(location);
- location.y -= ((IGraphicalEditPart)parentEditPart).getFigure().getBounds().y;
+ if (parentEditPart instanceof IGraphicalEditPart) {
+ ((IGraphicalEditPart) parentEditPart).getFigure().translateToRelative(location);
+ location.y -= ((IGraphicalEditPart) parentEditPart).getFigure().getBounds().y;
}
- viewPositions.put(view, new Float[]{ Float.valueOf(location.y) });
+ viewPositions.put(view, new Float[] { Float.valueOf(location.y) });
}
}
orderingFragments(parentEditPart, viewPositions);
@@ -200,50 +200,50 @@ public class FragmentsOrdererHelper {
}
private static Set<IGraphicalEditPart> getFragmentRootEditPart(EditPart editPart) {
- if(editPart == null) {
+ if (editPart == null) {
return null;
}
- IGraphicalEditPart graphicalEditPart = (IGraphicalEditPart)editPart.getAdapter(IGraphicalEditPart.class);
- if(graphicalEditPart instanceof InteractionEditPart || graphicalEditPart instanceof InteractionOperandEditPart) {
+ IGraphicalEditPart graphicalEditPart = (IGraphicalEditPart) editPart.getAdapter(IGraphicalEditPart.class);
+ if (graphicalEditPart instanceof InteractionEditPart || graphicalEditPart instanceof InteractionOperandEditPart) {
Set<IGraphicalEditPart> rootEditParts = new HashSet<IGraphicalEditPart>();
rootEditParts.add(graphicalEditPart);
return rootEditParts;
- } else if(graphicalEditPart instanceof AbstractMessageEditPart) {
+ } else if (graphicalEditPart instanceof AbstractMessageEditPart) {
Set<IGraphicalEditPart> rootEditParts = new HashSet<IGraphicalEditPart>();
EObject element = graphicalEditPart.resolveSemanticElement();
Set<EObject> enclosingParents = new HashSet<EObject>();
- if(element instanceof Message) {
- MessageEnd receiveEvent = ((Message)element).getReceiveEvent();
- if(receiveEvent instanceof OccurrenceSpecification) {
- Interaction enclosingInteraction = ((OccurrenceSpecification)receiveEvent).getEnclosingInteraction();
- if(enclosingInteraction != null) {
+ if (element instanceof Message) {
+ MessageEnd receiveEvent = ((Message) element).getReceiveEvent();
+ if (receiveEvent instanceof OccurrenceSpecification) {
+ Interaction enclosingInteraction = ((OccurrenceSpecification) receiveEvent).getEnclosingInteraction();
+ if (enclosingInteraction != null) {
enclosingParents.add(enclosingInteraction);
}
- InteractionOperand enclosingOperand = ((OccurrenceSpecification)receiveEvent).getEnclosingOperand();
- if(enclosingOperand != null) {
+ InteractionOperand enclosingOperand = ((OccurrenceSpecification) receiveEvent).getEnclosingOperand();
+ if (enclosingOperand != null) {
enclosingParents.add(enclosingOperand);
}
}
- MessageEnd sendEvent = ((Message)element).getSendEvent();
- if(sendEvent instanceof OccurrenceSpecification) {
- Interaction enclosingInteraction = ((OccurrenceSpecification)sendEvent).getEnclosingInteraction();
- if(enclosingInteraction != null) {
+ MessageEnd sendEvent = ((Message) element).getSendEvent();
+ if (sendEvent instanceof OccurrenceSpecification) {
+ Interaction enclosingInteraction = ((OccurrenceSpecification) sendEvent).getEnclosingInteraction();
+ if (enclosingInteraction != null) {
enclosingParents.add(enclosingInteraction);
}
- InteractionOperand enclosingOperand = ((OccurrenceSpecification)sendEvent).getEnclosingOperand();
- if(enclosingOperand != null) {
+ InteractionOperand enclosingOperand = ((OccurrenceSpecification) sendEvent).getEnclosingOperand();
+ if (enclosingOperand != null) {
enclosingParents.add(enclosingOperand);
}
}
}
- if(enclosingParents != null) {
- for(EObject eObject : enclosingParents) {
+ if (enclosingParents != null) {
+ for (EObject eObject : enclosingParents) {
List<?> views = DiagramEditPartsUtil.getEObjectViews(eObject);
- for(Object object : views) {
- View view = (View)object;
+ for (Object object : views) {
+ View view = (View) object;
EditPart root = DiagramEditPartsUtil.getEditPartFromView(view, editPart);
- if(root instanceof IGraphicalEditPart) {
- rootEditParts.add((IGraphicalEditPart)root);
+ if (root instanceof IGraphicalEditPart) {
+ rootEditParts.add((IGraphicalEditPart) root);
}
}
}
@@ -255,14 +255,14 @@ public class FragmentsOrdererHelper {
public static void orderingFragments(EditPart anyEditPart, Map<View, Float[]> viewPositions) {
Set<IGraphicalEditPart> fragmentRootEditParts = getFragmentRootEditPart(anyEditPart);
- if(fragmentRootEditParts == null || fragmentRootEditParts.isEmpty()) {
+ if (fragmentRootEditParts == null || fragmentRootEditParts.isEmpty()) {
return;
}
- for(IGraphicalEditPart fragmentRootEditPart : fragmentRootEditParts) {
+ for (IGraphicalEditPart fragmentRootEditPart : fragmentRootEditParts) {
FragmentsOrderer fragmentsOrderer = new FragmentsOrderer(fragmentRootEditPart);
- if(viewPositions != null) {
+ if (viewPositions != null) {
Set<Entry<View, Float[]>> entrySet = viewPositions.entrySet();
- for(Entry<View, Float[]> entry : entrySet) {
+ for (Entry<View, Float[]> entry : entrySet) {
fragmentsOrderer.addCachePosition(entry.getKey(), entry.getValue());
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/GateHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/GateHelper.java
index 1999d44f5be..b64bb35e452 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/GateHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/GateHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -72,22 +72,22 @@ public class GateHelper {
/**
* Constructor.
- *
+ *
*/
private GateHelper() {
}
/**
* Create and add View for Gate.
- *
+ *
* @param containerView
* @param gate
* @param innerGate
- * for CombinedFragment.
+ * for CombinedFragment.
* @return
*/
public static View createView(View containerView, Gate gate) {
- if(containerView == null || gate == null) {
+ if (containerView == null || gate == null) {
return null;
}
Shape node = NotationFactory.eINSTANCE.createShape();
@@ -95,10 +95,10 @@ public class GateHelper {
node.setElement(gate);
node.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
ViewUtil.insertChildView(containerView, node, ViewUtil.APPEND, true);
- //label
+ // label
DecorationNode label = NotationFactory.eINSTANCE.createDecorationNode();
label.setType(GateNameEditPart.GATE_NAME_TYPE);
- //Add possible to move the label.
+ // Add possible to move the label.
label.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
ViewUtil.insertChildView(node, label, ViewUtil.APPEND, true);
return node;
@@ -112,28 +112,28 @@ public class GateHelper {
* from/to the CombinedFragment on its outside.
*/
public static Gate createGate(Element parent, boolean createInnerCFGate) {
- if(parent == null) {
+ if (parent == null) {
return null;
}
String name = generateGateName(parent, "gate");
Gate gate = null;
- if(parent instanceof Interaction) {
- gate = ((Interaction)parent).getFormalGate(name, false, true);
- } else if(parent instanceof CombinedFragment) {
- gate = ((CombinedFragment)parent).getCfragmentGate(name, false, true);
- if(createInnerCFGate) {
- Gate innerGate = ((CombinedFragment)parent).createCfragmentGate(generateGateName(parent, "gate"));
+ if (parent instanceof Interaction) {
+ gate = ((Interaction) parent).getFormalGate(name, false, true);
+ } else if (parent instanceof CombinedFragment) {
+ gate = ((CombinedFragment) parent).getCfragmentGate(name, false, true);
+ if (createInnerCFGate) {
+ Gate innerGate = ((CombinedFragment) parent).createCfragmentGate(generateGateName(parent, "gate"));
EAnnotation ann = innerGate.createEAnnotation(CF_GATE_DATA);
ann.getDetails().put(CF_GATE_OUTSIDE, getIdentification(gate));
ann = gate.createEAnnotation(CF_GATE_DATA);
ann.getDetails().put(CF_GATE_INSIDE, getIdentification(innerGate));
- // setVolatile(innerGate, true);
+ // setVolatile(innerGate, true);
}
- // setVolatile(gate, true);
- } else if(parent instanceof InteractionUse) {
- InteractionUse interactionUse = (InteractionUse)parent;
+ // setVolatile(gate, true);
+ } else if (parent instanceof InteractionUse) {
+ InteractionUse interactionUse = (InteractionUse) parent;
Interaction refersTo = interactionUse.getRefersTo();
- if(refersTo != null) {
+ if (refersTo != null) {
refersTo.getFormalGate(name, false, true);
}
gate = interactionUse.getActualGate(name, false, true);
@@ -142,10 +142,10 @@ public class GateHelper {
}
protected static String getIdentification(Gate gate) {
- if(gate == null) {
+ if (gate == null) {
return null;
}
- if(gate.eResource() != null) {
+ if (gate.eResource() != null) {
return gate.eResource().getURIFragment(gate);
} else {
return gate.getName();
@@ -153,25 +153,25 @@ public class GateHelper {
}
protected static Gate findGate(CombinedFragment cf, String identification) {
- if(cf == null || identification == null) {
+ if (cf == null || identification == null) {
return null;
}
- if(cf.eResource() != null) {
+ if (cf.eResource() != null) {
EObject eObject = cf.eResource().getEObject(identification);
- if(eObject instanceof Gate) {
- return (Gate)eObject;
+ if (eObject instanceof Gate) {
+ return (Gate) eObject;
}
}
return cf.getCfragmentGate(identification);
}
public static Gate getInnerCFGate(Gate outerGate) {
- if(outerGate == null || !(outerGate.eContainer() instanceof CombinedFragment)) {
+ if (outerGate == null || !(outerGate.eContainer() instanceof CombinedFragment)) {
return null;
}
- CombinedFragment cf = (CombinedFragment)outerGate.eContainer();
+ CombinedFragment cf = (CombinedFragment) outerGate.eContainer();
EAnnotation ann = outerGate.getEAnnotation(CF_GATE_DATA);
- if(ann != null) {
+ if (ann != null) {
String name = ann.getDetails().get(CF_GATE_INSIDE);
return findGate(cf, name);
}
@@ -179,12 +179,12 @@ public class GateHelper {
}
public static Gate getOuterCFGate(Gate innerGate) {
- if(innerGate == null || !(innerGate.eContainer() instanceof CombinedFragment)) {
+ if (innerGate == null || !(innerGate.eContainer() instanceof CombinedFragment)) {
return null;
}
- CombinedFragment cf = (CombinedFragment)innerGate.eContainer();
+ CombinedFragment cf = (CombinedFragment) innerGate.eContainer();
EAnnotation ann = innerGate.getEAnnotation(CF_GATE_DATA);
- if(ann != null) {
+ if (ann != null) {
String name = ann.getDetails().get(CF_GATE_OUTSIDE);
return findGate(cf, name);
}
@@ -192,12 +192,12 @@ public class GateHelper {
}
public static boolean isInnerCFGate(Gate gate) {
- if(gate == null || !(gate.eContainer() instanceof CombinedFragment)) {
+ if (gate == null || !(gate.eContainer() instanceof CombinedFragment)) {
return false;
}
- CombinedFragment cf = (CombinedFragment)gate.eContainer();
+ CombinedFragment cf = (CombinedFragment) gate.eContainer();
EAnnotation ann = gate.getEAnnotation(CF_GATE_DATA);
- if(ann != null) {
+ if (ann != null) {
String name = ann.getDetails().get(CF_GATE_OUTSIDE);
return findGate(cf, name) != null;
}
@@ -205,28 +205,28 @@ public class GateHelper {
}
public static Message getOuterCFMessage(Message message) {
- if(message == null) {
+ if (message == null) {
return null;
}
MessageEnd sendEvent = message.getSendEvent();
- if(sendEvent instanceof Gate) {
- Gate gate = (Gate)sendEvent;
- if(!isInnerCFGate(gate)) {
+ if (sendEvent instanceof Gate) {
+ Gate gate = (Gate) sendEvent;
+ if (!isInnerCFGate(gate)) {
return null;
}
Gate outerGate = getOuterCFGate(gate);
- if(outerGate != null) {
+ if (outerGate != null) {
return outerGate.getMessage();
}
}
MessageEnd receiveEvent = message.getReceiveEvent();
- if(receiveEvent instanceof Gate) {
- Gate gate = (Gate)receiveEvent;
- if(!isInnerCFGate(gate)) {
+ if (receiveEvent instanceof Gate) {
+ Gate gate = (Gate) receiveEvent;
+ if (!isInnerCFGate(gate)) {
return null;
}
Gate outerGate = getOuterCFGate(gate);
- if(outerGate != null) {
+ if (outerGate != null) {
return outerGate.getMessage();
}
}
@@ -234,14 +234,14 @@ public class GateHelper {
}
public static Gate getActualGate(Gate gate) {
- if(gate == null || !(gate.eContainer() instanceof Interaction)) {
+ if (gate == null || !(gate.eContainer() instanceof Interaction)) {
return null;
}
- Interaction interaction = (Interaction)gate.eContainer();
+ Interaction interaction = (Interaction) gate.eContainer();
List<InteractionUse> refersToBy = findRefersToBy(interaction);
- for(InteractionUse interactionUse : refersToBy) {
+ for (InteractionUse interactionUse : refersToBy) {
Gate actualGate = interactionUse.getActualGate(gate.getName());
- if(actualGate != null) {
+ if (actualGate != null) {
return actualGate;
}
}
@@ -249,41 +249,41 @@ public class GateHelper {
}
public static List<InteractionUse> findRefersToBy(Interaction interaction) {
- if(interaction == null) {
+ if (interaction == null) {
return Collections.emptyList();
}
List<InteractionUse> refersToBy = new ArrayList<InteractionUse>();
Resource eResource = interaction.eResource();
- if(eResource != null) {
+ if (eResource != null) {
ResourceSet resourceSet = eResource.getResourceSet();
- if(resourceSet != null) {
+ if (resourceSet != null) {
EList<Resource> resources = resourceSet.getResources();
- for(Resource resource : resources) {
+ for (Resource resource : resources) {
TreeIterator<EObject> contents = resource.getAllContents();
- while(contents.hasNext()) {
+ while (contents.hasNext()) {
EObject next = contents.next();
- if(next instanceof InteractionUse && interaction == ((InteractionUse)next).getRefersTo()) {
- refersToBy.add((InteractionUse)next);
+ if (next instanceof InteractionUse && interaction == ((InteractionUse) next).getRefersTo()) {
+ refersToBy.add((InteractionUse) next);
}
}
}
} else {
TreeIterator<EObject> contents = eResource.getAllContents();
- while(contents.hasNext()) {
+ while (contents.hasNext()) {
EObject next = contents.next();
- if(next instanceof InteractionUse && interaction == ((InteractionUse)next).getRefersTo()) {
- refersToBy.add((InteractionUse)next);
+ if (next instanceof InteractionUse && interaction == ((InteractionUse) next).getRefersTo()) {
+ refersToBy.add((InteractionUse) next);
}
}
}
} else {
EList<InteractionFragment> fragments = interaction.getFragments();
- for(InteractionFragment fragment : fragments) {
- if(!(fragment instanceof InteractionUse)) {
+ for (InteractionFragment fragment : fragments) {
+ if (!(fragment instanceof InteractionUse)) {
continue;
}
- if(interaction == ((InteractionUse)fragment).getRefersTo()) {
- refersToBy.add(((InteractionUse)fragment));
+ if (interaction == ((InteractionUse) fragment).getRefersTo()) {
+ refersToBy.add(((InteractionUse) fragment));
}
}
}
@@ -292,43 +292,43 @@ public class GateHelper {
/**
* Generate name for Gate.
- *
+ *
* @param container
* @param object
* @param direction
* @return
*/
public static String generateGateName(EObject container, String suffix) {
- //Update gate name to hold a global sequence number.
+ // Update gate name to hold a global sequence number.
int index = getTotalGatesNumber(container);
String name = suffix;
- if(container instanceof Interaction) {
- Interaction interaction = (Interaction)container;
- if(!"gate".equals(suffix) && interaction.getFormalGate(suffix) == null) {
+ if (container instanceof Interaction) {
+ Interaction interaction = (Interaction) container;
+ if (!"gate".equals(suffix) && interaction.getFormalGate(suffix) == null) {
return suffix;
}
String gateName = name + index;
- while(interaction.getFormalGate(gateName = name + index) != null) {
+ while (interaction.getFormalGate(gateName = name + index) != null) {
index++;
}
name = gateName;
- } else if(container instanceof InteractionUse) {
- InteractionUse iUse = (InteractionUse)container;
- if(!"gate".equals(suffix) && iUse.getActualGate(suffix) == null) {
+ } else if (container instanceof InteractionUse) {
+ InteractionUse iUse = (InteractionUse) container;
+ if (!"gate".equals(suffix) && iUse.getActualGate(suffix) == null) {
return suffix;
}
String gateName = name + index;
- while(iUse.getActualGate(gateName = name + index) != null) {
+ while (iUse.getActualGate(gateName = name + index) != null) {
index++;
}
name = gateName;
- } else if(container instanceof CombinedFragment) {
- CombinedFragment cf = (CombinedFragment)container;
- if(!"gate".equals(suffix) && cf.getCfragmentGate(suffix) == null) {
+ } else if (container instanceof CombinedFragment) {
+ CombinedFragment cf = (CombinedFragment) container;
+ if (!"gate".equals(suffix) && cf.getCfragmentGate(suffix) == null) {
return suffix;
}
String gateName = name + index;
- while(cf.getCfragmentGate(gateName = name + index) != null) {
+ while (cf.getCfragmentGate(gateName = name + index) != null) {
index++;
}
name = gateName;
@@ -337,15 +337,15 @@ public class GateHelper {
}
private static int getTotalGatesNumber(EObject parent) {
- //fixed bug: start count for each Interaction.
+ // fixed bug: start count for each Interaction.
Interaction interaction = getRootInteraction(parent);
- if(interaction == null) {
+ if (interaction == null) {
return 0;
}
int size = 0;
TreeIterator<EObject> allContents = interaction.eAllContents();
- while(allContents.hasNext()) {
- if(allContents.next() instanceof Gate) {
+ while (allContents.hasNext()) {
+ if (allContents.next() instanceof Gate) {
size++;
}
}
@@ -353,16 +353,16 @@ public class GateHelper {
}
private static Interaction getRootInteraction(EObject eObj) {
- if(eObj == null) {
+ if (eObj == null) {
return null;
- } else if(eObj instanceof Interaction) {
- return (Interaction)eObj;
+ } else if (eObj instanceof Interaction) {
+ return (Interaction) eObj;
}
return getRootInteraction(eObj.eContainer());
}
public static Point computeGateLocation(Point pt, IFigure hostFigure, IFigure gateFigure) {
- if(pt == null || hostFigure == null) {
+ if (pt == null || hostFigure == null) {
return pt;
}
Point location = pt.getCopy();
@@ -374,13 +374,13 @@ public class GateHelper {
}
public static void updateGateName(TransactionalEditingDomain editingDomain, final Gate gate, final String newName) {
- if(gate == null) {
+ if (gate == null) {
return;
}
String name = gate.getName();
- if(name == null && newName == null) {
+ if (name == null && newName == null) {
return;
- } else if(name != null && name.equals(newName)) {
+ } else if (name != null && name.equals(newName)) {
return;
} else {
AbstractTransactionalCommand cmd = new AbstractTransactionalCommand(editingDomain, "", null) {
@@ -393,9 +393,9 @@ public class GateHelper {
};
CommandStack commandStack = editingDomain.getCommandStack();
GMFtoEMFCommandWrapper command = new GMFtoEMFCommandWrapper(cmd);
- if(commandStack instanceof TransactionalCommandStack) {
+ if (commandStack instanceof TransactionalCommandStack) {
try {
- ((TransactionalCommandStack)commandStack).execute(command, Collections.singletonMap(Transaction.OPTION_UNPROTECTED, Boolean.TRUE));
+ ((TransactionalCommandStack) commandStack).execute(command, Collections.singletonMap(Transaction.OPTION_UNPROTECTED, Boolean.TRUE));
} catch (InterruptedException e) {
e.printStackTrace();
} catch (RollbackException e) {
@@ -409,15 +409,15 @@ public class GateHelper {
public static String getGateLabel(Gate gate) {
Message message = gate.getMessage();
- if(message != null) {
+ if (message != null) {
MessageDirection direction = null;
EObject parent = gate.eContainer();
- if(parent instanceof CombinedFragment) {
- CombinedFragment cf = ((CombinedFragment)parent);
- if(gate == message.getSendEvent()) {
+ if (parent instanceof CombinedFragment) {
+ CombinedFragment cf = ((CombinedFragment) parent);
+ if (gate == message.getSendEvent()) {
MessageEnd receiveEvent = message.getReceiveEvent();
Lifeline lifeline = getCoveredBy(receiveEvent);
- if(!cf.getCovereds().contains(lifeline)) {
+ if (!cf.getCovereds().contains(lifeline)) {
direction = MessageDirection.OUT;
} else {
direction = MessageDirection.IN;
@@ -425,27 +425,27 @@ public class GateHelper {
} else {
MessageEnd sendEvent = message.getSendEvent();
Lifeline coveredBy = getCoveredBy(sendEvent);
- if(!cf.getCovereds().contains(coveredBy)) {
+ if (!cf.getCovereds().contains(coveredBy)) {
direction = MessageDirection.IN;
} else {
direction = MessageDirection.OUT;
}
}
- } else if(parent instanceof Interaction) {
- if(gate == message.getSendEvent()) {
+ } else if (parent instanceof Interaction) {
+ if (gate == message.getSendEvent()) {
direction = MessageDirection.IN;
- } else if(gate == message.getReceiveEvent()) {
+ } else if (gate == message.getReceiveEvent()) {
direction = MessageDirection.OUT;
}
}
- if(direction == null) {
- if(gate == message.getSendEvent()) {
+ if (direction == null) {
+ if (gate == message.getSendEvent()) {
direction = MessageDirection.OUT;
- } else if(gate == message.getReceiveEvent()) {
+ } else if (gate == message.getReceiveEvent()) {
direction = MessageDirection.IN;
}
}
- if(direction != null) {
+ if (direction != null) {
StringBuffer buf = new StringBuffer();
buf.append(direction.getName() + "_");
buf.append(message.getName());
@@ -456,46 +456,46 @@ public class GateHelper {
}
private static Lifeline getCoveredBy(MessageEnd messageEnd) {
- if(messageEnd == null) {
+ if (messageEnd == null) {
return null;
}
- if(messageEnd instanceof OccurrenceSpecification) {
- return ((OccurrenceSpecification)messageEnd).getCovered();
+ if (messageEnd instanceof OccurrenceSpecification) {
+ return ((OccurrenceSpecification) messageEnd).getCovered();
}
return null;
}
public static void setVolatile(Gate gate, boolean value) {
- if(gate == null) {
+ if (gate == null) {
return;
}
EAnnotation annotation = gate.getEAnnotation(GATE_NAME_VOLATILE);
- if(true == value) {
- if(annotation == null) {
+ if (true == value) {
+ if (annotation == null) {
annotation = gate.createEAnnotation(GATE_NAME_VOLATILE);
}
annotation.getDetails().put(GATE_NAME_VOLATILE, Boolean.toString(value));
- } else if(annotation != null) {
+ } else if (annotation != null) {
gate.getEAnnotations().remove(annotation);
}
- if(gate.eContainer() instanceof InteractionUse) {
- Interaction refersTo = ((InteractionUse)gate.eContainer()).getRefersTo();
- if(refersTo != null) {
+ if (gate.eContainer() instanceof InteractionUse) {
+ Interaction refersTo = ((InteractionUse) gate.eContainer()).getRefersTo();
+ if (refersTo != null) {
Gate formalGate = refersTo.getFormalGate(gate.getName());
- if(formalGate != null) {
+ if (formalGate != null) {
setVolatile(formalGate, value);
}
}
- } else if(!GateHelper.isInnerCFGate(gate)) {
+ } else if (!GateHelper.isInnerCFGate(gate)) {
Gate innerGate = GateHelper.getInnerCFGate(gate);
- if(innerGate != null) {
+ if (innerGate != null) {
setVolatile(innerGate, value);
}
}
}
public static boolean isVolatile(Gate gate) {
- if(gate == null) {
+ if (gate == null) {
return false;
}
EAnnotation ann = gate.getEAnnotation(GATE_NAME_VOLATILE);
@@ -503,55 +503,55 @@ public class GateHelper {
}
public static void updateGateWithMessage(Message message, boolean force) {
- if(message == null) {
+ if (message == null) {
return;
}
MessageEnd sendEvent = message.getSendEvent();
MessageEnd receiveEvent = message.getReceiveEvent();
- //Suggest a name for gate with message.
- if(sendEvent instanceof Gate) {
- Gate gate = (Gate)sendEvent;
+ // Suggest a name for gate with message.
+ if (sendEvent instanceof Gate) {
+ Gate gate = (Gate) sendEvent;
updateGateName(gate, force);
}
- if(receiveEvent instanceof Gate) {
- Gate gate = (Gate)receiveEvent;
+ if (receiveEvent instanceof Gate) {
+ Gate gate = (Gate) receiveEvent;
updateGateName(gate, force);
}
}
protected static void updateGateName(Gate gate, boolean force) {
- if(gate == null) {
+ if (gate == null) {
return;
}
- if(gate.eContainer() instanceof InteractionUse) {
- Interaction refersTo = ((InteractionUse)gate.eContainer()).getRefersTo();
- if(refersTo != null) {
+ if (gate.eContainer() instanceof InteractionUse) {
+ Interaction refersTo = ((InteractionUse) gate.eContainer()).getRefersTo();
+ if (refersTo != null) {
Gate formalGate = refersTo.getFormalGate(gate.getName());
- if(formalGate != null && isVolatile(formalGate)) {
+ if (formalGate != null && isVolatile(formalGate)) {
formalGate.setName(GateHelper.getGateLabel(gate));
- if(force) {
+ if (force) {
setVolatile(formalGate, false);
}
}
- } else if(isVolatile(gate)) {
+ } else if (isVolatile(gate)) {
gate.setName(GateHelper.getGateLabel(gate));
- if(force) {
+ if (force) {
setVolatile(gate, false);
}
}
- } else if(!GateHelper.isInnerCFGate(gate)) {
+ } else if (!GateHelper.isInnerCFGate(gate)) {
String newName = GateHelper.getGateLabel(gate);
- if(isVolatile(gate)) {
+ if (isVolatile(gate)) {
gate.setName(newName);
}
Gate innerGate = GateHelper.getInnerCFGate(gate);
- if(innerGate != null && (isVolatile(innerGate))) {
+ if (innerGate != null && (isVolatile(innerGate))) {
innerGate.setName(newName);
- if(force) {
+ if (force) {
setVolatile(innerGate, false);
}
}
- if(force) {
+ if (force) {
setVolatile(gate, false);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/GateModelElementFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/GateModelElementFactory.java
index 0c9f1c21a43..38d8400c6a2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/GateModelElementFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/GateModelElementFactory.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013, 2014 CEA 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
@@ -39,7 +39,7 @@ public class GateModelElementFactory extends AnnotationModelElementFactory {
@Override
protected AnnotationModelElement doCreateFromSource(Object sourceElement, DataContextElement context) {
View source = NotationHelper.findView(sourceElement);
- if(source == null) {
+ if (source == null) {
Activator.log.warn("Unable to resolve the selected element to an EObject"); //$NON-NLS-1$
return null;
}
@@ -52,7 +52,7 @@ public class GateModelElementFactory extends AnnotationModelElementFactory {
@Override
protected Command getCommand(final Object value) {
- return new CreateEAnnotationCommand((TransactionalEditingDomain)domain, source, GATE_SHOW_NAME) {
+ return new CreateEAnnotationCommand((TransactionalEditingDomain) domain, source, GATE_SHOW_NAME) {
@Override
protected void doExecute() {
@@ -66,8 +66,8 @@ public class GateModelElementFactory extends AnnotationModelElementFactory {
@Override
protected Object doGetValue() {
Object value = super.doGetValue();
- if(value == null) {
- //By default, return true.
+ if (value == null) {
+ // By default, return true.
return "true";
}
return value;
@@ -78,17 +78,17 @@ public class GateModelElementFactory extends AnnotationModelElementFactory {
}
public static final boolean isShowNameChanged(Notification msg) {
- if(msg == null || !(msg.getNewValue() instanceof EAnnotation)) {
+ if (msg == null || !(msg.getNewValue() instanceof EAnnotation)) {
return false;
}
- EAnnotation anno = (EAnnotation)msg.getNewValue();
+ EAnnotation anno = (EAnnotation) msg.getNewValue();
return GATE_SHOW_NAME.equals(anno.getSource());
}
public static final boolean isShowName(View view) {
- if(view != null) {
+ if (view != null) {
EAnnotation anno = view.getEAnnotation(GATE_SHOW_NAME);
- if(anno != null) {
+ if (anno != null) {
return !"false".equalsIgnoreCase(anno.getDetails().get(GATE_SHOW_NAME));
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/HighlightUtil.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/HighlightUtil.java
index 5817026c644..c7a9a251d16 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/HighlightUtil.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/HighlightUtil.java
@@ -50,7 +50,7 @@ public class HighlightUtil {
/**
* Maybe this value can be managed by preferences.
- *
+ *
* @param bgColor
*/
private static Color getHighlightBackground(Color bgColor) {
@@ -59,7 +59,7 @@ public class HighlightUtil {
/**
* Maybe this value can be managed by preferences.
- *
+ *
* @param lineWidth
*/
private static int getHighlightLineWidth(int lineWidth) {
@@ -68,19 +68,19 @@ public class HighlightUtil {
private static List<IFigure> getHighlightFigures(EditPart host) {
List<IFigure> figures = new ArrayList<IFigure>();
- if(host instanceof LifelineEditPart) {
- LifelineEditPart part = (LifelineEditPart)host;
+ if (host instanceof LifelineEditPart) {
+ LifelineEditPart part = (LifelineEditPart) host;
figures.add(part.getPrimaryShape().getFigureLifelineNameContainerFigure());
figures.add(part.getPrimaryShape().getFigureLifelineDotLineFigure());
- } else if(host instanceof InteractionOperandEditPart) {
- InteractionOperandEditPart op = (InteractionOperandEditPart)host;
- CombinedFragmentEditPart cep = (CombinedFragmentEditPart)op.getParent().getParent();
+ } else if (host instanceof InteractionOperandEditPart) {
+ InteractionOperandEditPart op = (InteractionOperandEditPart) host;
+ CombinedFragmentEditPart cep = (CombinedFragmentEditPart) op.getParent().getParent();
figures.add(cep.getPrimaryShape());
- } else if(host != null) {
+ } else if (host != null) {
try {
Method getMethod = getGetPrimaryShapeMethod(host.getClass());
getMethod.setAccessible(true);
- figures.add((IFigure)getMethod.invoke(host));
+ figures.add((IFigure) getMethod.invoke(host));
} catch (Exception e) {
return getHighlightFigures(host.getParent());
}
@@ -90,20 +90,20 @@ public class HighlightUtil {
/**
* Fixed bug when introducing some sub class.
- *
+ *
* @param type
* @return getPrimaryShape()
* @throws Exception
*/
protected static Method getGetPrimaryShapeMethod(Class<?> type) throws Exception {
- if(type == null) {
+ if (type == null) {
throw new NoSuchMethodException("getPrimaryShape");
}
try {
return type.getDeclaredMethod("getPrimaryShape");
} catch (Exception e) {
Method method = getGetPrimaryShapeMethod(type.getSuperclass());
- if(method == null) {
+ if (method == null) {
throw e;
}
return method;
@@ -112,7 +112,7 @@ public class HighlightUtil {
/**
* Maybe this value can be managed by preferences.
- *
+ *
* @param fgColor
*/
private static Color getHighlightForeground(Color fgColor) {
@@ -121,13 +121,13 @@ public class HighlightUtil {
public static void highlight(EditPart host) {
List<IFigure> highlightFigures = getHighlightFigures(host);
- if(highlightFigures.isEmpty()) {
+ if (highlightFigures.isEmpty()) {
return;
}
- synchronized(figureState) {
- for(IFigure figure : highlightFigures) {
+ synchronized (figureState) {
+ for (IFigure figure : highlightFigures) {
FigureState fs = figureState.get(figure);
- if(fs == null) {
+ if (fs == null) {
fs = createFigureState(host, figure);
figureState.put(figure, fs);
}
@@ -140,24 +140,24 @@ public class HighlightUtil {
int lineWidth = 1;
Color bgColor = null, fgColor = null;
Object model = host.getModel();
- if(model instanceof LineStyle) {
- int modelLineWidth = ((LineStyle)model).getLineWidth();
- if(modelLineWidth != -1) {
+ if (model instanceof LineStyle) {
+ int modelLineWidth = ((LineStyle) model).getLineWidth();
+ if (modelLineWidth != -1) {
lineWidth = modelLineWidth;
}
- int lineColor = ((LineStyle)model).getLineColor();
+ int lineColor = ((LineStyle) model).getLineColor();
fgColor = DiagramColorRegistry.getInstance().getColor(Integer.valueOf(lineColor));
} else {
Border border = fig.getBorder();
- if(border instanceof LineBorder) {
- lineWidth = ((LineBorder)border).getWidth();
- } else if(fig instanceof Shape) {
- lineWidth = ((Shape)fig).getLineWidth();
+ if (border instanceof LineBorder) {
+ lineWidth = ((LineBorder) border).getWidth();
+ } else if (fig instanceof Shape) {
+ lineWidth = ((Shape) fig).getLineWidth();
}
fgColor = fig.getForegroundColor();
}
- if(model instanceof FillStyle) {
- int fillColor = ((FillStyle)model).getFillColor();
+ if (model instanceof FillStyle) {
+ int fillColor = ((FillStyle) model).getFillColor();
bgColor = DiagramColorRegistry.getInstance().getColor(Integer.valueOf(fillColor));
} else {
bgColor = fig.getBackgroundColor();
@@ -166,20 +166,20 @@ public class HighlightUtil {
}
public static void unhighlight() {
- if(figureState == null || figureState.isEmpty()) {
+ if (figureState == null || figureState.isEmpty()) {
return;
}
- synchronized(figureState) {
+ synchronized (figureState) {
Set<Entry<Object, FigureState>> entrySet = figureState.entrySet();
- for(Entry<Object, FigureState> entry : entrySet) {
+ for (Entry<Object, FigureState> entry : entrySet) {
Object key = entry.getKey();
FigureState value = entry.getValue();
- if(key instanceof IFigure) {
- IFigure fig = (IFigure)key;
+ if (key instanceof IFigure) {
+ IFigure fig = (IFigure) key;
updateFigure(fig, value.bgColor, value.fgColor, value.lineWidth);
- } else if(key instanceof EditPart) {
- List<IFigure> figures = getHighlightFigures((EditPart)key);
- for(IFigure fig : figures) {
+ } else if (key instanceof EditPart) {
+ List<IFigure> figures = getHighlightFigures((EditPart) key);
+ for (IFigure fig : figures) {
updateFigure(fig, value.bgColor, value.fgColor, value.lineWidth);
}
}
@@ -190,13 +190,13 @@ public class HighlightUtil {
public static void unhighlight(EditPart host) {
List<IFigure> highlightFigures = getHighlightFigures(host);
- if(highlightFigures.isEmpty()) {
+ if (highlightFigures.isEmpty()) {
return;
}
- synchronized(figureState) {
- for(IFigure figure : highlightFigures) {
+ synchronized (figureState) {
+ for (IFigure figure : highlightFigures) {
FigureState s = figureState.remove(figure);
- if(s == null) {
+ if (s == null) {
continue;
}
updateFigure(figure, s.bgColor, s.fgColor, s.lineWidth);
@@ -205,23 +205,23 @@ public class HighlightUtil {
}
private static void updateFigure(IFigure fig, Color bgColor, Color fgColor, int lineWidth) {
- if(fig == null) {
+ if (fig == null) {
return;
}
- synchronized(fig) {
- if(lineWidth > 0) {
+ synchronized (fig) {
+ if (lineWidth > 0) {
Border border = fig.getBorder();
- if(border != null && border instanceof LineBorder) {
- ((LineBorder)border).setWidth(lineWidth);
+ if (border != null && border instanceof LineBorder) {
+ ((LineBorder) border).setWidth(lineWidth);
}
- if(fig instanceof Shape) {
- ((Shape)fig).setLineWidth(lineWidth);
+ if (fig instanceof Shape) {
+ ((Shape) fig).setLineWidth(lineWidth);
}
- if(fig instanceof NodeFigure) {
- ((NodeFigure)fig).setLineWidth(lineWidth);
+ if (fig instanceof NodeFigure) {
+ ((NodeFigure) fig).setLineWidth(lineWidth);
}
- if(fig instanceof DestructionEventFigure) {
- ((DestructionEventFigure)fig).setLineWidth(lineWidth);
+ if (fig instanceof DestructionEventFigure) {
+ ((DestructionEventFigure) fig).setLineWidth(lineWidth);
}
}
// Safely don't modify these now.
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/InteractionOperandModelElementFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/InteractionOperandModelElementFactory.java
index c5b9df45aac..b766ed1f3db 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/InteractionOperandModelElementFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/InteractionOperandModelElementFactory.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010, 2014 CEA 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
@@ -34,9 +34,9 @@ import org.eclipse.papyrus.views.properties.modelelement.AnnotationModelElementF
/**
* Add the possibility to display or hide the guard of Operand
- *
+ *
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=402966
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class InteractionOperandModelElementFactory extends AnnotationModelElementFactory {
@@ -46,7 +46,7 @@ public class InteractionOperandModelElementFactory extends AnnotationModelElemen
@Override
protected AnnotationModelElement doCreateFromSource(Object sourceElement, DataContextElement context) {
View source = NotationHelper.findView(sourceElement);
- if(source == null) {
+ if (source == null) {
Activator.log.warn("Unable to resolve the selected element to an EObject"); //$NON-NLS-1$
return null;
}
@@ -59,7 +59,7 @@ public class InteractionOperandModelElementFactory extends AnnotationModelElemen
@Override
protected Command getCommand(final Object value) {
- return new CreateEAnnotationCommand((TransactionalEditingDomain)domain, source, GUARD_VISIBILITY_KEY) {
+ return new CreateEAnnotationCommand((TransactionalEditingDomain) domain, source, GUARD_VISIBILITY_KEY) {
@Override
protected void doExecute() {
@@ -73,8 +73,8 @@ public class InteractionOperandModelElementFactory extends AnnotationModelElemen
@Override
protected Object doGetValue() {
Object value = super.doGetValue();
- if(value == null) {
- //By default, return preference string value (The converter can not read boolean directly).
+ if (value == null) {
+ // By default, return preference string value (The converter can not read boolean directly).
return UMLDiagramEditorPlugin.getInstance().getPreferenceStore().getString(CustomInteractionOperandPreferencePage.GUARD_VISIBILITY);
}
return value;
@@ -85,17 +85,17 @@ public class InteractionOperandModelElementFactory extends AnnotationModelElemen
}
public static final boolean isGuardVisibilityChanged(Notification msg) {
- if(msg == null || !(msg.getNewValue() instanceof EAnnotation)) {
+ if (msg == null || !(msg.getNewValue() instanceof EAnnotation)) {
return false;
}
- EAnnotation anno = (EAnnotation)msg.getNewValue();
+ EAnnotation anno = (EAnnotation) msg.getNewValue();
return GUARD_VISIBILITY_KEY.equals(anno.getSource());
}
public static final boolean isGuardVisible(View view) {
- if(view != null) {
+ if (view != null) {
EAnnotation anno = view.getEAnnotation(GUARD_VISIBILITY_KEY);
- if(anno != null) {
+ if (anno != null) {
return "true".equalsIgnoreCase(anno.getDetails().get(GUARD_VISIBILITY_KEY));
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/InteractionOperatorKindCompatibleMapping.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/InteractionOperatorKindCompatibleMapping.java
index aca1208f31e..8c756e3fb52 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/InteractionOperatorKindCompatibleMapping.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/InteractionOperatorKindCompatibleMapping.java
@@ -28,7 +28,7 @@ public class InteractionOperatorKindCompatibleMapping {
/**
* Check if the InteractionOperator supports multi operand
- *
+ *
* @param kind
* @return
*/
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/InteractionUseUtil.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/InteractionUseUtil.java
index 5c47b80a60d..dccc58adff0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/InteractionUseUtil.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/InteractionUseUtil.java
@@ -15,10 +15,10 @@ public class InteractionUseUtil {
public static Diagram findDiagram(View view, Interaction refInteraction) {
Diagram diagram = view.getDiagram();
EList<EObject> list = diagram.eResource().getContents();
- for(EObject o : list) {
- if(o instanceof Diagram) {
- Diagram ref = (Diagram)o;
- if(refInteraction.equals(ref.getElement())) {
+ for (EObject o : list) {
+ if (o instanceof Diagram) {
+ Diagram ref = (Diagram) o;
+ if (refInteraction.equals(ref.getElement())) {
return ref;
}
}
@@ -35,12 +35,12 @@ public class InteractionUseUtil {
} catch (Exception e) {
return;
}
- if(pageManager != null) {
- if(pageManager.allPages().contains(diagram)) {
+ if (pageManager != null) {
+ if (pageManager.allPages().contains(diagram)) {
/**
* Close the diagram if it was already open
*/
- if(pageManager.isOpen(diagram)) {
+ if (pageManager.isOpen(diagram)) {
pageManager.selectPage(diagram);
} else {
editingDomain.getCommandStack().execute(new RecordingCommand(editingDomain, "Open diagram") {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineCoveredByUpdater.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineCoveredByUpdater.java
index 83e428f45c3..848ae437684 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineCoveredByUpdater.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineCoveredByUpdater.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -33,6 +33,7 @@ import org.eclipse.gmf.runtime.notation.Bounds;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.Shape;
import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.uml.diagram.common.commands.PreserveAnchorsPositionCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CustomLifelineEditPart.PreserveAnchorsPositionCommandEx;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionFragmentEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart;
@@ -43,9 +44,9 @@ import org.eclipse.uml2.uml.UMLPackage;
/**
* This class updates the property CoveredBy of Lifeline when a Lifeline gets created, moved/resize and also the resize of moving of each
* CombinedFragment
- *
+ *
* @author yyang
- *
+ *
*/
public class LifelineCoveredByUpdater {
@@ -67,10 +68,10 @@ public class LifelineCoveredByUpdater {
protected void init() {
editingDomain = this.context.getEditingDomain();
GraphicalEditPart parent = context;
- while(true) {
+ while (true) {
EditPart editPart = parent.getParent();
- if(editPart instanceof GraphicalEditPart) {
- parent = (GraphicalEditPart)editPart;
+ if (editPart instanceof GraphicalEditPart) {
+ parent = (GraphicalEditPart) editPart;
} else {
break;
}
@@ -79,22 +80,22 @@ public class LifelineCoveredByUpdater {
}
private void childrenCollect(GraphicalEditPart editPart) {
- if(editPart instanceof LifelineEditPart) {
+ if (editPart instanceof LifelineEditPart) {
IFigure figure = editPart.getFigure();
Rectangle childBounds = figure.getBounds().getCopy();
figure.translateToAbsolute(childBounds);
Rectangle centralLineBounds = new Rectangle(childBounds.x() + childBounds.width() / 2, childBounds.y(), 1, childBounds.height());
- lifelines.put((LifelineEditPart)editPart, centralLineBounds);
+ lifelines.put((LifelineEditPart) editPart, centralLineBounds);
}
- if(editPart instanceof InteractionFragmentEditPart) {
+ if (editPart instanceof InteractionFragmentEditPart) {
IFigure figure = editPart.getFigure();
Rectangle childBounds = figure.getBounds().getCopy();
figure.translateToAbsolute(childBounds);
- interactionFragments.put((InteractionFragmentEditPart)editPart, childBounds);
+ interactionFragments.put((InteractionFragmentEditPart) editPart, childBounds);
}
- for(Object child : editPart.getChildren()) {
- if(child instanceof GraphicalEditPart) {
- childrenCollect((GraphicalEditPart)child);
+ for (Object child : editPart.getChildren()) {
+ if (child instanceof GraphicalEditPart) {
+ childrenCollect((GraphicalEditPart) child);
}
}
}
@@ -102,7 +103,7 @@ public class LifelineCoveredByUpdater {
public void update(GraphicalEditPart context) {
this.context = context;
this.init();
- for(Map.Entry<LifelineEditPart, Rectangle> entry : lifelines.entrySet()) {
+ for (Map.Entry<LifelineEditPart, Rectangle> entry : lifelines.entrySet()) {
LifelineEditPart editPart = entry.getKey();
Rectangle childBounds = entry.getValue();
updateLifeline(editPart, childBounds);
@@ -110,48 +111,49 @@ public class LifelineCoveredByUpdater {
}
public void updateLifeline(LifelineEditPart lifelineEditpart, Rectangle rect) {
- Lifeline lifeline = (Lifeline)lifelineEditpart.resolveSemanticElement();
- if(lifeline == null) {
+ Lifeline lifeline = (Lifeline) lifelineEditpart.resolveSemanticElement();
+ if (lifeline == null) {
return;
}
EList<InteractionFragment> coveredByLifelines = lifeline.getCoveredBys();
coveredByLifelinesToAdd.clear();
coveredByLifelinesToRemove.clear();
- //Update height of Lifeline when coveredBy some InteractionFragments.
+ // Update height of Lifeline when coveredBy some InteractionFragments.
int bottom = 0;
- for(Map.Entry<InteractionFragmentEditPart, Rectangle> entry : interactionFragments.entrySet()) {
+ for (Map.Entry<InteractionFragmentEditPart, Rectangle> entry : interactionFragments.entrySet()) {
InteractionFragmentEditPart editPart = entry.getKey();
Rectangle childBounds = entry.getValue();
- InteractionFragment interactionFragment = (InteractionFragment)editPart.resolveSemanticElement();
- if(rect.intersects(childBounds)) {
- if(!coveredByLifelines.contains(interactionFragment)) {
+ InteractionFragment interactionFragment = (InteractionFragment) editPart.resolveSemanticElement();
+ if (rect.intersects(childBounds)) {
+ if (!coveredByLifelines.contains(interactionFragment)) {
coveredByLifelinesToAdd.add(interactionFragment);
bottom = Math.max(childBounds.bottom(), bottom);
}
- } else if(coveredByLifelines.contains(interactionFragment)) {
+ } else if (coveredByLifelines.contains(interactionFragment)) {
coveredByLifelinesToRemove.add(interactionFragment);
}
}
- if(!coveredByLifelinesToAdd.isEmpty()) {
+ if (!coveredByLifelinesToAdd.isEmpty()) {
CommandHelper.executeCommandWithoutHistory(editingDomain, AddCommand.create(editingDomain, lifeline, UMLPackage.eINSTANCE.getLifeline_CoveredBy(), coveredByLifelinesToAdd), true);
- //Update Lifeline height.
+ // Update Lifeline height.
int newHeight = bottom - rect.y;
- if(newHeight > rect.height) {
- Bounds bounds = (Bounds)((Shape)lifelineEditpart.getModel()).getLayoutConstraint();
+ if (newHeight > rect.height) {
+ Bounds bounds = (Bounds) ((Shape) lifelineEditpart.getModel()).getLayoutConstraint();
int height = bounds.getHeight();
- //Fixed bug when has default height(-1).
- if(height == -1) {
+ // Fixed bug when has default height(-1).
+ if (height == -1) {
height = lifelineEditpart.getPrimaryShape().getBounds().height;
}
int heightDelta = newHeight - height;
CommandHelper.executeCommandWithoutHistory(editingDomain, SetCommand.create(editingDomain, bounds, NotationPackage.Literals.SIZE__HEIGHT, newHeight), true);
- PreserveAnchorsPositionCommandEx preserveAnchorsCommand = new PreserveAnchorsPositionCommandEx(lifelineEditpart, new Dimension(0, heightDelta), PreserveAnchorsPositionCommandEx.PRESERVE_Y, lifelineEditpart.getPrimaryShape().getFigureLifelineDotLineFigure(), PositionConstants.SOUTH);
- if(preserveAnchorsCommand.canExecute()) {
+ PreserveAnchorsPositionCommandEx preserveAnchorsCommand = new PreserveAnchorsPositionCommandEx(lifelineEditpart, new Dimension(0, heightDelta), PreserveAnchorsPositionCommand.PRESERVE_Y, lifelineEditpart.getPrimaryShape()
+ .getFigureLifelineDotLineFigure(), PositionConstants.SOUTH);
+ if (preserveAnchorsCommand.canExecute()) {
CommandHelper.executeCommandWithoutHistory(editingDomain, new GMFtoEMFCommandWrapper(preserveAnchorsCommand), true);
}
}
}
- if(!coveredByLifelinesToRemove.isEmpty()) {
+ if (!coveredByLifelinesToRemove.isEmpty()) {
CommandHelper.executeCommandWithoutHistory(editingDomain, RemoveCommand.create(editingDomain, lifeline, UMLPackage.eINSTANCE.getLifeline_CoveredBy(), coveredByLifelinesToRemove), true);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineEditPartUtil.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineEditPartUtil.java
index 657ed7d2afc..cde04babf35 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineEditPartUtil.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineEditPartUtil.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -34,21 +34,21 @@ public class LifelineEditPartUtil {
/**
* This operation returns the ExecutionSpecification EditParts contained in the Lifeline
* EditPart
- *
+ *
* @return the list of ExecutionSpecification EditParts
*/
public static List<ShapeNodeEditPart> getChildShapeNodeEditPart(LifelineEditPart lifeline) {
- if(lifeline == null) {
+ if (lifeline == null) {
return Collections.emptyList();
}
List<ShapeNodeEditPart> executionSpecificationList = new ArrayList<ShapeNodeEditPart>();
- for(Object obj : lifeline.getChildren()) {
- if(obj instanceof BehaviorExecutionSpecificationEditPart) {
- executionSpecificationList.add((ShapeNodeEditPart)obj);
- } else if(obj instanceof ActionExecutionSpecificationEditPart) {
- executionSpecificationList.add((ShapeNodeEditPart)obj);
- } else if(obj instanceof CombinedFragment2EditPart) {
- executionSpecificationList.add((ShapeNodeEditPart)obj);
+ for (Object obj : lifeline.getChildren()) {
+ if (obj instanceof BehaviorExecutionSpecificationEditPart) {
+ executionSpecificationList.add((ShapeNodeEditPart) obj);
+ } else if (obj instanceof ActionExecutionSpecificationEditPart) {
+ executionSpecificationList.add((ShapeNodeEditPart) obj);
+ } else if (obj instanceof CombinedFragment2EditPart) {
+ executionSpecificationList.add((ShapeNodeEditPart) obj);
}
}
return executionSpecificationList;
@@ -57,37 +57,37 @@ public class LifelineEditPartUtil {
/**
* This operation returns the InnerConnectableElement EditParts contained in the Lifeline
* EditPart
- *
+ *
* @return the list of InnerConnectableElement EditParts
*/
public static List<LifelineEditPart> getInnerConnectableElementList(LifelineEditPart lifeline) {
- if(lifeline == null) {
+ if (lifeline == null) {
return Collections.emptyList();
}
List<LifelineEditPart> propertyList = new ArrayList<LifelineEditPart>();
- for(Object obj : lifeline.getChildren()) {
- if(obj instanceof LifelineEditPart) {
- propertyList.add((LifelineEditPart)obj);
+ for (Object obj : lifeline.getChildren()) {
+ if (obj instanceof LifelineEditPart) {
+ propertyList.add((LifelineEditPart) obj);
}
}
return propertyList;
}
public static NodeFigure getNodeFigure(LifelineEditPart lifelineEditPart) {
- if(lifelineEditPart == null) {
+ if (lifelineEditPart == null) {
return null;
}
IFigure contentPane = lifelineEditPart.getContentPane();
NodeFigure centerFigure = null;
- if(contentPane instanceof LifelineDotLineCustomFigure) {
- return ((LifelineDotLineCustomFigure)contentPane).getDashLineRectangle();
+ if (contentPane instanceof LifelineDotLineCustomFigure) {
+ return ((LifelineDotLineCustomFigure) contentPane).getDashLineRectangle();
}
return null;
}
/**
* Constructor.
- *
+ *
*/
private LifelineEditPartUtil() {
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineHeadUtil.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineHeadUtil.java
index 268206c35d4..b37fc386851 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineHeadUtil.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineHeadUtil.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -18,6 +18,7 @@ import java.util.List;
import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.draw2d.OrderedLayout;
import org.eclipse.draw2d.RectangleFigure;
import org.eclipse.draw2d.ToolbarLayout;
import org.eclipse.draw2d.geometry.Dimension;
@@ -35,6 +36,7 @@ import org.eclipse.gef.EditPartViewer;
import org.eclipse.gef.GraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.BaseSlidableAnchor;
import org.eclipse.gmf.runtime.gef.ui.figures.SlidableAnchor;
import org.eclipse.gmf.runtime.notation.Anchor;
import org.eclipse.gmf.runtime.notation.Edge;
@@ -67,26 +69,26 @@ import org.eclipse.uml2.uml.Lifeline;
public class LifelineHeadUtil {
public static int computeLifelineVerticalPosition(final EditPart parent) {
- if(parent instanceof GraphicalEditPart) {
+ if (parent instanceof GraphicalEditPart) {
List children = parent.getChildren();
int bottom = -1;
- for(Object object : children) {
- if(!(object instanceof LifelineEditPart)) {
+ for (Object object : children) {
+ if (!(object instanceof LifelineEditPart)) {
continue;
}
- LifelineEditPart lifeline = (LifelineEditPart)object;
+ LifelineEditPart lifeline = (LifelineEditPart) object;
LifelineFigure primaryShape = lifeline.getPrimaryShape();
RectangleFigure figure = primaryShape.getFigureLifelineNameContainerFigure();
Rectangle r = figure.getBounds().getCopy();
- if(!r.isEmpty()) {
+ if (!r.isEmpty()) {
bottom = Math.max(bottom, r.bottom());
}
}
- if(bottom != -1) {
+ if (bottom != -1) {
RectangleFigure figure = new RectangleFigure();
figure.setBorder(new MarginBorder(7));
ToolbarLayout layout = new ToolbarLayout();
- layout.setMinorAlignment(ToolbarLayout.ALIGN_CENTER);
+ layout.setMinorAlignment(OrderedLayout.ALIGN_CENTER);
Label label = new Label("Lifeline");
label.setFont(Display.getDefault().getSystemFont());
figure.add(label);
@@ -99,53 +101,53 @@ public class LifelineHeadUtil {
}
public static void updateHead(LifelineEditPart lifeline, int resized) {
- if(lifeline == null || resized == 0) {
+ if (lifeline == null || resized == 0) {
return;
}
List<LifelineEditPart> toMovedLifelines = new ArrayList<LifelineEditPart>();
collectLifelines(toMovedLifelines, lifeline);
List<ShapeNodeEditPart> children = LifelineEditPartUtil.getChildShapeNodeEditPart(lifeline);
- for(ShapeNodeEditPart child : children) {
+ for (ShapeNodeEditPart child : children) {
collectLifelines(toMovedLifelines, child);
}
EditPart parent = lifeline.getParent();
- while(parent instanceof LifelineEditPart) {
+ while (parent instanceof LifelineEditPart) {
parent = parent.getParent();
}
List childrenList = parent.getChildren();
- for(Object object : childrenList) {
- if(toMovedLifelines.contains(object) || !(object instanceof LifelineEditPart)) {
+ for (Object object : childrenList) {
+ if (toMovedLifelines.contains(object) || !(object instanceof LifelineEditPart)) {
continue;
}
- toMovedLifelines.add((LifelineEditPart)object);
+ toMovedLifelines.add((LifelineEditPart) object);
}
- if(toMovedLifelines.isEmpty()) {
+ if (toMovedLifelines.isEmpty()) {
return;
}
CompoundCommand command = new CompoundCommand();
computeUpdateHeadCommand(command, lifeline, false, resized, new ArrayList<EditPart>());
- if(command.canExecute()) {
+ if (command.canExecute()) {
CommandHelper.executeCommandWithoutHistory(lifeline.getEditingDomain(), command, true);
}
}
private static void computeUpdateHeadCommand(CompoundCommand commands, LifelineEditPart lifeline, boolean moveChildren, int moveDelta, List<EditPart> movedEditParts) {
- //1. move children of current lifeline.
- if(moveChildren) {
+ // 1. move children of current lifeline.
+ if (moveChildren) {
ShapeNodeEditPart nodeToMove = lifeline;
EditPart parent = lifeline.getParent();
- while(parent instanceof LifelineEditPart) {
- nodeToMove = (ShapeNodeEditPart)parent;
+ while (parent instanceof LifelineEditPart) {
+ nodeToMove = (ShapeNodeEditPart) parent;
parent = parent.getParent();
}
Command cmd = getVerticalMoveShapeCommand(nodeToMove, moveDelta, false);
commands.appendIfCanExecute(cmd);
} else {
View view = lifeline.getNotationView();
- LayoutConstraint constraint = ((Shape)view).getLayoutConstraint();
- if(constraint instanceof Size) {
- int height = ((Size)constraint).getHeight();
- if(height == -1) {
+ LayoutConstraint constraint = ((Shape) view).getLayoutConstraint();
+ if (constraint instanceof Size) {
+ int height = ((Size) constraint).getHeight();
+ if (height == -1) {
height = lifeline.getFigure().getBounds().height;
}
height += moveDelta;
@@ -154,50 +156,50 @@ public class LifelineHeadUtil {
}
movedEditParts.add(lifeline);
- //2. move covered CombinedFragment and InteractionUse
+ // 2. move covered CombinedFragment and InteractionUse
EObject elt = lifeline.resolveSemanticElement();
- if(elt instanceof Lifeline) {
- EList<InteractionFragment> coveredBys = ((Lifeline)elt).getCoveredBys();
+ if (elt instanceof Lifeline) {
+ EList<InteractionFragment> coveredBys = ((Lifeline) elt).getCoveredBys();
EditPartViewer viewer = lifeline.getViewer();
- for(InteractionFragment fragment : coveredBys) {
- if(!(fragment instanceof CombinedFragment || fragment instanceof InteractionUse)) {
+ for (InteractionFragment fragment : coveredBys) {
+ if (!(fragment instanceof CombinedFragment || fragment instanceof InteractionUse)) {
continue;
}
List<View> views = DiagramEditPartsUtil.findViews(fragment, viewer);
- if(views.isEmpty()) {
+ if (views.isEmpty()) {
continue;
}
- for(View view : views) {
- EditPart ep = (EditPart)viewer.getEditPartRegistry().get(view);
- if(ep == null) {
+ for (View view : views) {
+ EditPart ep = (EditPart) viewer.getEditPartRegistry().get(view);
+ if (ep == null) {
continue;
}
- if(movedEditParts.contains(ep)) {
+ if (movedEditParts.contains(ep)) {
continue;
}
EditPart parent = ep.getParent();
boolean parentMoved = false;
- while(parent != null) {
- if(movedEditParts.contains(parent)) {
+ while (parent != null) {
+ if (movedEditParts.contains(parent)) {
parentMoved = true;
break;
}
parent = parent.getParent();
}
- if(parentMoved) {
+ if (parentMoved) {
continue;
}
- if(ep instanceof CombinedFragmentEditPart || ep instanceof InteractionUseEditPart) {
- Command cmd = getVerticalMoveShapeCommand((ShapeNodeEditPart)ep, moveDelta, false);
+ if (ep instanceof CombinedFragmentEditPart || ep instanceof InteractionUseEditPart) {
+ Command cmd = getVerticalMoveShapeCommand((ShapeNodeEditPart) ep, moveDelta, false);
commands.appendIfCanExecute(cmd);
movedEditParts.add(ep);
List children = ep.getChildren();
- for(Object object : children) {
- if(movedEditParts.contains(object)) {
+ for (Object object : children) {
+ if (movedEditParts.contains(object)) {
continue;
}
- if(object instanceof GateEditPart) {
- GateEditPart gate = (GateEditPart)object;
+ if (object instanceof GateEditPart) {
+ GateEditPart gate = (GateEditPart) object;
Command command = getVerticalMoveShapeCommand(gate, moveDelta, false);
commands.appendIfCanExecute(command);
movedEditParts.add(gate);
@@ -209,33 +211,33 @@ public class LifelineHeadUtil {
}
}
- //3. move Gate if existed.
+ // 3. move Gate if existed.
fillMoveDownMessageEnds(commands, lifeline, moveDelta, movedEditParts);
List<ShapeNodeEditPart> childShapeNodeEditParts = LifelineEditPartUtil.getChildShapeNodeEditPart(lifeline);
- for(ShapeNodeEditPart shapeNodeEditPart : childShapeNodeEditParts) {
+ for (ShapeNodeEditPart shapeNodeEditPart : childShapeNodeEditParts) {
fillMoveDownMessageEnds(commands, shapeNodeEditPart, moveDelta, movedEditParts);
}
- //4. move children of linked lifelines.
+ // 4. move children of linked lifelines.
List<LifelineEditPart> toMovedLifelines = new ArrayList<LifelineEditPart>();
collectLifelines(toMovedLifelines, lifeline);
List<ShapeNodeEditPart> children = LifelineEditPartUtil.getChildShapeNodeEditPart(lifeline);
- for(ShapeNodeEditPart child : children) {
+ for (ShapeNodeEditPart child : children) {
collectLifelines(toMovedLifelines, child);
}
EditPart parent = lifeline.getParent();
- while(parent instanceof LifelineEditPart) {
+ while (parent instanceof LifelineEditPart) {
parent = parent.getParent();
}
List childrenList = parent.getChildren();
- for(Object object : childrenList) {
- if(toMovedLifelines.contains(object) || !(object instanceof LifelineEditPart)) {
+ for (Object object : childrenList) {
+ if (toMovedLifelines.contains(object) || !(object instanceof LifelineEditPart)) {
continue;
}
- toMovedLifelines.add((LifelineEditPart)object);
+ toMovedLifelines.add((LifelineEditPart) object);
}
- for(LifelineEditPart editPart : toMovedLifelines) {
- if(movedEditParts.contains(editPart)) {
+ for (LifelineEditPart editPart : toMovedLifelines) {
+ if (movedEditParts.contains(editPart)) {
continue;
}
computeUpdateHeadCommand(commands, editPart, true, moveDelta, movedEditParts);
@@ -244,26 +246,26 @@ public class LifelineHeadUtil {
private static void fillMoveDownMessageEnds(CompoundCommand commands, GraphicalEditPart editPart, int moveDelta, List<EditPart> movedEditParts) {
List sourceConnections = editPart.getSourceConnections();
- for(Object object : sourceConnections) {
- ConnectionEditPart conn = (ConnectionEditPart)object;
+ for (Object object : sourceConnections) {
+ ConnectionEditPart conn = (ConnectionEditPart) object;
EditPart target = conn.getTarget();
- if(target instanceof GateEditPart) {
- Command command = getVerticalMoveShapeCommand((GateEditPart)target, moveDelta, false);
+ if (target instanceof GateEditPart) {
+ Command command = getVerticalMoveShapeCommand((GateEditPart) target, moveDelta, false);
commands.appendIfCanExecute(command);
movedEditParts.add(target);
- } else if(object instanceof Message6EditPart) {
+ } else if (object instanceof Message6EditPart) {
Command command = getMoveAnchorCommand(conn, moveDelta, false);
commands.appendIfCanExecute(command);
}
}
List targetConnections = editPart.getTargetConnections();
- for(Object object : targetConnections) {
- ConnectionEditPart conn = (ConnectionEditPart)object;
- if(conn instanceof Message7EditPart) {
+ for (Object object : targetConnections) {
+ ConnectionEditPart conn = (ConnectionEditPart) object;
+ if (conn instanceof Message7EditPart) {
Command command = getMoveAnchorCommand(conn, moveDelta, true);
commands.appendIfCanExecute(command);
- } else if(conn.getSource() instanceof GateEditPart) {
- Command command = getVerticalMoveShapeCommand((GateEditPart)conn.getSource(), moveDelta, false);
+ } else if (conn.getSource() instanceof GateEditPart) {
+ Command command = getVerticalMoveShapeCommand((GateEditPart) conn.getSource(), moveDelta, false);
commands.appendIfCanExecute(command);
movedEditParts.add(conn.getSource());
}
@@ -272,25 +274,25 @@ public class LifelineHeadUtil {
private static Command getMoveAnchorCommand(ConnectionEditPart conn, int moveDelta, boolean moveSource) {
EditPart editPart = moveSource ? conn.getSource() : conn.getTarget();
- if(!(editPart instanceof IGraphicalEditPart)) {
+ if (!(editPart instanceof IGraphicalEditPart)) {
return null;
}
Object model = conn.getModel();
- if(!(model instanceof Edge)) {
+ if (!(model instanceof Edge)) {
return null;
}
- Edge edge = (Edge)model;
+ Edge edge = (Edge) model;
Anchor anchor = moveSource ? edge.getSourceAnchor() : edge.getTargetAnchor();
- if(!(anchor instanceof IdentityAnchor)) {
+ if (!(anchor instanceof IdentityAnchor)) {
return null;
}
- String terminal = ((IdentityAnchor)anchor).getId();
- PrecisionPoint pt = SlidableAnchor.parseTerminalString(terminal);
+ String terminal = ((IdentityAnchor) anchor).getId();
+ PrecisionPoint pt = BaseSlidableAnchor.parseTerminalString(terminal);
PrecisionPoint p = null;
- if(pt.preciseX() > 1 || pt.preciseY() > 1) {
+ if (pt.preciseX() > 1 || pt.preciseY() > 1) {
p = new PrecisionPoint(pt.preciseX(), pt.preciseY() + moveDelta);
} else {
- Rectangle bounds = SequenceUtil.getAbsoluteBounds((IGraphicalEditPart)editPart);
+ Rectangle bounds = SequenceUtil.getAbsoluteBounds((IGraphicalEditPart) editPart);
PrecisionPoint location = new PrecisionPoint(pt.preciseX() * bounds.preciseWidth() + bounds.preciseX(), pt.preciseY() * bounds.preciseHeight() + bounds.preciseY());
location.translate(0, moveDelta);
Dimension d = location.getDifference(bounds.getTopLeft());
@@ -302,66 +304,66 @@ public class LifelineHeadUtil {
s.append(','); // 1 char
s.append(p.preciseY()); // 10 chars
s.append(')');
- return SetCommand.create(getEditingDomain((GraphicalEditPart)editPart), anchor, NotationPackage.eINSTANCE.getIdentityAnchor_Id(), s.toString());
+ return SetCommand.create(getEditingDomain((GraphicalEditPart) editPart), anchor, NotationPackage.eINSTANCE.getIdentityAnchor_Id(), s.toString());
}
private static void collectLifelines(List<LifelineEditPart> toMovedLifelines, GraphicalEditPart editPart) {
- if(editPart == null) {
+ if (editPart == null) {
return;
}
- //1. links from current lifeline
+ // 1. links from current lifeline
List sourceConnections = editPart.getSourceConnections();
- for(Object object : sourceConnections) {
- ConnectionEditPart conn = (ConnectionEditPart)object;
+ for (Object object : sourceConnections) {
+ ConnectionEditPart conn = (ConnectionEditPart) object;
LifelineEditPart target = getLifeline(conn.getTarget());
- if(target == null || toMovedLifelines.contains(target) || editPart == target) {
+ if (target == null || toMovedLifelines.contains(target) || editPart == target) {
continue;
}
toMovedLifelines.add(target);
}
- //2. links to current lifeline.
+ // 2. links to current lifeline.
List targetConnections = editPart.getTargetConnections();
- for(Object object : targetConnections) {
- ConnectionEditPart conn = (ConnectionEditPart)object;
+ for (Object object : targetConnections) {
+ ConnectionEditPart conn = (ConnectionEditPart) object;
LifelineEditPart source = getLifeline(conn.getSource());
- if(source == null || toMovedLifelines.contains(source) || editPart == source) {
+ if (source == null || toMovedLifelines.contains(source) || editPart == source) {
continue;
}
toMovedLifelines.add(source);
}
- if(editPart instanceof CustomLifelineEditPart && ((CustomLifelineEditPart)editPart).isInlineMode()) {
- List children = ((CustomLifelineEditPart)editPart).getChildren();
- for(Object object : children) {
- if(object instanceof LifelineEditPart) {
- collectLifelines(toMovedLifelines, (LifelineEditPart)object);
+ if (editPart instanceof CustomLifelineEditPart && ((CustomLifelineEditPart) editPart).isInlineMode()) {
+ List children = ((CustomLifelineEditPart) editPart).getChildren();
+ for (Object object : children) {
+ if (object instanceof LifelineEditPart) {
+ collectLifelines(toMovedLifelines, (LifelineEditPart) object);
}
}
- if(toMovedLifelines.isEmpty()) {
- toMovedLifelines.add((LifelineEditPart)editPart);
+ if (toMovedLifelines.isEmpty()) {
+ toMovedLifelines.add((LifelineEditPart) editPart);
}
}
}
private static Command getVerticalMoveShapeCommand(GraphicalEditPart shapeEditPart, int moveDelta, boolean increaseHeight) {
- if(shapeEditPart == null || moveDelta == 0) {
+ if (shapeEditPart == null || moveDelta == 0) {
return null;
}
Object view = shapeEditPart.getModel();
- if(!(view instanceof Shape)) {
+ if (!(view instanceof Shape)) {
return null;
}
- LayoutConstraint constraint = ((Shape)view).getLayoutConstraint();
- if(!(constraint instanceof Location)) {
+ LayoutConstraint constraint = ((Shape) view).getLayoutConstraint();
+ if (!(constraint instanceof Location)) {
return null;
}
- int y = ((Location)constraint).getY();
+ int y = ((Location) constraint).getY();
int value = y + moveDelta;
Command command = SetCommand.create(getEditingDomain(shapeEditPart), constraint, NotationPackage.eINSTANCE.getLocation_Y(), value);
- if(increaseHeight && constraint instanceof Size) {
- int height = ((Size)constraint).getHeight();
- if(height == -1) {
+ if (increaseHeight && constraint instanceof Size) {
+ int height = ((Size) constraint).getHeight();
+ if (height == -1) {
height = shapeEditPart.getFigure().getBounds().height;
}
height += moveDelta;
@@ -371,18 +373,18 @@ public class LifelineHeadUtil {
}
private static EditingDomain getEditingDomain(GraphicalEditPart editPart) {
- if(editPart instanceof IGraphicalEditPart) {
- return ((IGraphicalEditPart)editPart).getEditingDomain();
+ if (editPart instanceof IGraphicalEditPart) {
+ return ((IGraphicalEditPart) editPart).getEditingDomain();
}
return null;
}
private static LifelineEditPart getLifeline(EditPart editPart) {
- if(editPart == null) {
+ if (editPart == null) {
return null;
}
- if(editPart instanceof LifelineEditPart) {
- return (LifelineEditPart)editPart;
+ if (editPart instanceof LifelineEditPart) {
+ return (LifelineEditPart) editPart;
}
return getLifeline(editPart.getParent());
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineLabelHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineLabelHelper.java
index d2628591f4e..80ba632ca3f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineLabelHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineLabelHelper.java
@@ -37,7 +37,7 @@ public class LifelineLabelHelper extends StereotypedElementLabelHelper {
* @return the singleton instance.
*/
public static LifelineLabelHelper getInstance() {
- if(labelHelper == null) {
+ if (labelHelper == null) {
labelHelper = new LifelineLabelHelper();
}
return labelHelper;
@@ -71,17 +71,17 @@ public class LifelineLabelHelper extends StereotypedElementLabelHelper {
*/
@Override
public Lifeline getUMLElement(GraphicalEditPart editPart) {
- return (Lifeline)UMLUtil.resolveUMLElement(editPart);
+ return (Lifeline) UMLUtil.resolveUMLElement(editPart);
}
@Override
protected String elementLabel(GraphicalEditPart editPart) {
- if(editPart instanceof LifelineNameEditPart) {
- editPart = (GraphicalEditPart)editPart.getParent();
+ if (editPart instanceof LifelineNameEditPart) {
+ editPart = (GraphicalEditPart) editPart.getParent();
}
Collection<String> displayValue = DEFAULT_LABEL_DISPLAY;
- IMaskManagedLabelEditPolicy policy = (IMaskManagedLabelEditPolicy)editPart.getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(policy != null) {
+ IMaskManagedLabelEditPolicy policy = (IMaskManagedLabelEditPolicy) editPart.getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if (policy != null) {
displayValue = policy.getCurrentDisplayValue();
}
return getCustomLabel(getUMLElement(editPart), displayValue);
@@ -91,15 +91,15 @@ public class LifelineLabelHelper extends StereotypedElementLabelHelper {
private static final String UNDEFINED = "<Undefined>";
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=383722
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=383722
private String getCustomLabel(Lifeline lifeline, Collection<String> displayValue) {
StringBuilder sb = new StringBuilder();
appendName(lifeline, displayValue, sb);
boolean displayType = displayValue.contains(SHOW_REPRESENT_TYPE);
- if(lifeline.getRepresents() == null || displayValue.contains(LifelineLabelHelper.SHOW_LIFELINE_NAME)) {
+ if (lifeline.getRepresents() == null || displayValue.contains(LifelineLabelHelper.SHOW_LIFELINE_NAME)) {
displayType = false;
}
- if(displayType) {
+ if (displayType) {
// handle represent type label
appendType(lifeline, displayValue, sb);
}
@@ -109,16 +109,16 @@ public class LifelineLabelHelper extends StereotypedElementLabelHelper {
protected void appendName(Lifeline lifeline, Collection<String> displayValue, StringBuilder sb) {
ConnectableElement element = lifeline.getRepresents();
String lifelineName = lifeline.getName();
- if(element == null || displayValue.contains(SHOW_LIFELINE_NAME)) {
+ if (element == null || displayValue.contains(SHOW_LIFELINE_NAME)) {
appendString(sb, lifelineName, UNAMED);
return;
} else {
// represents is not null
- if(displayValue.contains(SHOW_REPRESENT_NAME)) {
+ if (displayValue.contains(SHOW_REPRESENT_NAME)) {
appendString(sb, element.getName(), UNAMED);
}
- // if neither <1> or <2> are checked, show lifeline name (or <unnamed> when the lifeline has no name)
- else if(!displayValue.contains(SHOW_REPRESENT_TYPE)) {
+ // if neither <1> or <2> are checked, show lifeline name (or <unnamed> when the lifeline has no name)
+ else if (!displayValue.contains(SHOW_REPRESENT_TYPE)) {
appendString(sb, lifelineName, UNAMED);
}
}
@@ -126,13 +126,13 @@ public class LifelineLabelHelper extends StereotypedElementLabelHelper {
protected void appendType(Lifeline lifeline, Collection<String> displayValue, StringBuilder sb) {
ConnectableElement element = lifeline.getRepresents();
- if(element == null) {
+ if (element == null) {
return;
}
Type type = element.getType();
- if(displayValue.contains(SHOW_REPRESENT_TYPE)) {
- if(type == null) {
- if(displayValue.contains(SHOW_UNDEFINED_TYPE)) {
+ if (displayValue.contains(SHOW_REPRESENT_TYPE)) {
+ if (type == null) {
+ if (displayValue.contains(SHOW_UNDEFINED_TYPE)) {
sb.append(":").append(UNDEFINED);
}
} else {
@@ -142,7 +142,7 @@ public class LifelineLabelHelper extends StereotypedElementLabelHelper {
}
private void appendString(StringBuilder sb, String str, String defaultValue) {
- if(str != null) {
+ if (str != null) {
sb.append(str);
} else {
sb.append(defaultValue);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineMessageCreateHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineMessageCreateHelper.java
index 8ebc8f42807..d5a69fe5e59 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineMessageCreateHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineMessageCreateHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -51,8 +51,9 @@ public class LifelineMessageCreateHelper {
@Override
protected Command createDeleteViewCommand(GroupRequest deleteRequest) {
Command command = super.createDeleteViewCommand(deleteRequest);
- if(command != null && getHost() instanceof LifelineEditPart)
- command = restoreLifelineOnDelete(command, (LifelineEditPart)getHost());
+ if (command != null && getHost() instanceof LifelineEditPart) {
+ command = restoreLifelineOnDelete(command, (LifelineEditPart) getHost());
+ }
return command;
}
}
@@ -60,7 +61,7 @@ public class LifelineMessageCreateHelper {
public static ConnectionAnchor getCreateMessageAnchor(LifelineEditPart part, Request request, Point location) {
IFigure fig = part.getPrimaryShape().getFigureLifelineNameContainerFigure();
fig.translateToRelative(location);
- if(fig.containsPoint(location)) {// move to header
+ if (fig.containsPoint(location)) {// move to header
return new LifelineAnchor(part.getPrimaryShape().getFigureLifelineNameContainerFigure());
}
// move to dash line
@@ -69,38 +70,38 @@ public class LifelineMessageCreateHelper {
static ConnectionAnchor getTargetConnectionAnchor(LifelineEditPart part, Request request) {
NodeFigure nodeFigure = null;
- if(part instanceof CustomLifelineEditPart) {
- nodeFigure = ((CustomLifelineEditPart)part).getNodeFigure();
+ if (part instanceof CustomLifelineEditPart) {
+ nodeFigure = ((CustomLifelineEditPart) part).getNodeFigure();
} else {
- if(part.getContentPane() instanceof LifelineDotLineCustomFigure) {
- nodeFigure = ((LifelineDotLineCustomFigure)part.getContentPane()).getDashLineRectangle();
+ if (part.getContentPane() instanceof LifelineDotLineCustomFigure) {
+ nodeFigure = ((LifelineDotLineCustomFigure) part.getContentPane()).getDashLineRectangle();
}
}
- if(nodeFigure == null) {
+ if (nodeFigure == null) {
return null;
}
- if(request instanceof ReconnectRequest) {
- if(((DropRequest)request).getLocation() == null) {
+ if (request instanceof ReconnectRequest) {
+ if (((DropRequest) request).getLocation() == null) {
return nodeFigure.getTargetConnectionAnchorAt(null);
}
- Point pt = ((DropRequest)request).getLocation().getCopy();
+ Point pt = ((DropRequest) request).getLocation().getCopy();
return nodeFigure.getTargetConnectionAnchorAt(pt);
- } else if(request instanceof DropRequest) {
- return nodeFigure.getTargetConnectionAnchorAt(((DropRequest)request).getLocation());
+ } else if (request instanceof DropRequest) {
+ return nodeFigure.getTargetConnectionAnchorAt(((DropRequest) request).getLocation());
}
return nodeFigure.getTargetConnectionAnchorAt(null);
}
- //when a create message is deleted, move its target lifelines up
+ // when a create message is deleted, move its target lifelines up
public static Command restoreLifelineOnMessageDelete(Command commands, EditPart editPart) {
- if(editPart instanceof Message4EditPart) {
- Message4EditPart part = (Message4EditPart)editPart;
- if(part.getTarget() instanceof LifelineEditPart && LifelineMessageCreateHelper.getIncomingMessageCreate(part.getTarget()).size() == 1) {
- LifelineEditPart target = (LifelineEditPart)part.getTarget();
- if(target.getModel() instanceof Shape) {
- Shape view = (ShapeImpl)target.getModel();
- if(view.getLayoutConstraint() instanceof Bounds) {
- Bounds bounds = (Bounds)view.getLayoutConstraint();
+ if (editPart instanceof Message4EditPart) {
+ Message4EditPart part = (Message4EditPart) editPart;
+ if (part.getTarget() instanceof LifelineEditPart && LifelineMessageCreateHelper.getIncomingMessageCreate(part.getTarget()).size() == 1) {
+ LifelineEditPart target = (LifelineEditPart) part.getTarget();
+ if (target.getModel() instanceof Shape) {
+ Shape view = (ShapeImpl) target.getModel();
+ if (view.getLayoutConstraint() instanceof Bounds) {
+ Bounds bounds = (Bounds) view.getLayoutConstraint();
ICommand boundsCommand = new SetBoundsCommand(target.getEditingDomain(), DiagramUIMessages.SetLocationCommand_Label_Resize, new EObjectAdapter(view), new Point(bounds.getX(), SequenceUtil.LIFELINE_VERTICAL_OFFSET));
commands = commands.chain(new ICommandProxy(boundsCommand));
int dy = SequenceUtil.LIFELINE_VERTICAL_OFFSET - bounds.getY();
@@ -115,12 +116,12 @@ public class LifelineMessageCreateHelper {
// when a lifleine is deleted, move its created lifelines up
public static Command restoreLifelineOnDelete(Command command, LifelineEditPart part) {
List list = part.getSourceConnections();
- if(list != null && list.size() > 0) {
- for(Object l : list)
- if(l instanceof Message4EditPart) {
- EditPart target = ((Message4EditPart)l).getTarget();
- if(target instanceof LifelineEditPart && getIncomingMessageCreate(target).size() == 1) {
- LifelineEditPart lp = (LifelineEditPart)target;
+ if (list != null && list.size() > 0) {
+ for (Object l : list) {
+ if (l instanceof Message4EditPart) {
+ EditPart target = ((Message4EditPart) l).getTarget();
+ if (target instanceof LifelineEditPart && getIncomingMessageCreate(target).size() == 1) {
+ LifelineEditPart lp = (LifelineEditPart) target;
Rectangle bounds = lp.getPrimaryShape().getBounds();
Point location = new Point(bounds.x, SequenceUtil.LIFELINE_VERTICAL_OFFSET);
int dy = location.y - bounds.y;
@@ -129,16 +130,18 @@ public class LifelineMessageCreateHelper {
command = moveCascadeLifeline(lp, command, dy);
}
}
+ }
}
return command;
}
public static boolean hasMessageCreate(GraphicalEditPart sourceEditPart, EditPart targetEditPart) {
List list = sourceEditPart.getSourceConnections();
- for(Object o : list)
- if(o instanceof Message4EditPart && targetEditPart.equals(((Message4EditPart)o).getTarget())) {
+ for (Object o : list) {
+ if (o instanceof Message4EditPart && targetEditPart.equals(((Message4EditPart) o).getTarget())) {
return true;
}
+ }
return false;
}
@@ -148,36 +151,39 @@ public class LifelineMessageCreateHelper {
public static List getIncomingMessageCreate(EditPart target) {
List create = new ArrayList();
- if(target instanceof LifelineEditPart) {
- List list = ((LifelineEditPart)target).getTargetConnections();
- if(list != null && list.size() > 0) {
- for(Object l : list)
- if(l instanceof Message4EditPart) {
+ if (target instanceof LifelineEditPart) {
+ List list = ((LifelineEditPart) target).getTargetConnections();
+ if (list != null && list.size() > 0) {
+ for (Object l : list) {
+ if (l instanceof Message4EditPart) {
create.add(l);
}
+ }
}
}
return create;
}
public static boolean canReconnectMessageCreate(ReconnectRequest request) {
- Message4EditPart connPart = (Message4EditPart)request.getConnectionEditPart();
- if(request.isMovingStartAnchor()) { // reconnect source
- if(hasMessageCreate((GraphicalEditPart)request.getTarget(), (GraphicalEditPart)connPart.getTarget()))
+ Message4EditPart connPart = (Message4EditPart) request.getConnectionEditPart();
+ if (request.isMovingStartAnchor()) { // reconnect source
+ if (hasMessageCreate((GraphicalEditPart) request.getTarget(), (GraphicalEditPart) connPart.getTarget())) {
return false;
+ }
} else { // reconnect target
- if(hasMessageCreate((GraphicalEditPart)connPart.getSource(), request.getTarget()))
+ if (hasMessageCreate((GraphicalEditPart) connPart.getSource(), request.getTarget())) {
return false;
+ }
}
return true;
}
public static Command reconnectMessageCreateTarget(ReconnectRequest request, Command command) {
- LifelineEditPart oldTarget = (LifelineEditPart)request.getConnectionEditPart().getTarget();
- // LifelineEditPart source = (LifelineEditPart)request.getConnectionEditPart().getSource();
- LifelineEditPart newTarget = (LifelineEditPart)request.getTarget();
+ LifelineEditPart oldTarget = (LifelineEditPart) request.getConnectionEditPart().getTarget();
+ // LifelineEditPart source = (LifelineEditPart)request.getConnectionEditPart().getSource();
+ LifelineEditPart newTarget = (LifelineEditPart) request.getTarget();
// move up the original connection target lifeline, it has only one create message, which will be removed
- if(getIncomingMessageCreate(oldTarget).size() == 1) {
+ if (getIncomingMessageCreate(oldTarget).size() == 1) {
Rectangle bounds = oldTarget.getPrimaryShape().getBounds();
Point location = new Point(bounds.x, SequenceUtil.LIFELINE_VERTICAL_OFFSET);
int dy = location.y - bounds.y;
@@ -185,7 +191,7 @@ public class LifelineMessageCreateHelper {
command = command.chain(new ICommandProxy(boundsCommand));
command = moveCascadeLifeline(oldTarget, command, dy);
}
- //move down the new connection target lifeline
+ // move down the new connection target lifeline
command = moveLifelineDown(command, newTarget, request.getLocation().getCopy());
return command;
}
@@ -194,8 +200,8 @@ public class LifelineMessageCreateHelper {
IFigure fig = part.getFigure();
Rectangle bounds = fig.getBounds().getCopy();
int height = part.getPrimaryShape().getFigureLifelineNameContainerFigure().getBounds().height;
- //Fixed bug: When the Lifeline is created by MessageCreate at dynamic time(@see https://bugs.eclipse.org/bugs/show_bug.cgi?id=403134), the bounds would not be get when the Lifeline is not displayed yet.
- if(bounds.isEmpty()) {
+ // Fixed bug: When the Lifeline is created by MessageCreate at dynamic time(@see https://bugs.eclipse.org/bugs/show_bug.cgi?id=403134), the bounds would not be get when the Lifeline is not displayed yet.
+ if (bounds.isEmpty()) {
bounds = SequenceUtil.getAbsoluteBounds(part);
height = 29;
} else {
@@ -203,7 +209,7 @@ public class LifelineMessageCreateHelper {
}
Point location = new Point(bounds.x, Math.max(bounds.y, sourcePointCopy.y() - height / 2));
View targetView = part.getNotationView();
- if(location.y != bounds.y) {
+ if (location.y != bounds.y) {
int dy = location.y - bounds.y;
fig.translateToRelative(location);
fig.translateToParent(location);
@@ -217,18 +223,18 @@ public class LifelineMessageCreateHelper {
// move all lifelines which has incoming create link from part
public static Command moveCascadeLifeline(LifelineEditPart part, Command command, int dy) {
List list = part.getSourceConnections();
- if(list != null && list.size() > 0) {
- for(Object l : list)
- if(l instanceof Message4EditPart) {
- EditPart target = ((Message4EditPart)l).getTarget();
- if(target instanceof LifelineEditPart) {
- LifelineEditPart lp = (LifelineEditPart)target;
+ if (list != null && list.size() > 0) {
+ for (Object l : list) {
+ if (l instanceof Message4EditPart) {
+ EditPart target = ((Message4EditPart) l).getTarget();
+ if (target instanceof LifelineEditPart) {
+ LifelineEditPart lp = (LifelineEditPart) target;
Rectangle bounds = lp.getFigure().getBounds().getCopy();
View targetView = lp.getNotationView();
Point location = bounds.getLocation().getCopy().translate(0, dy);
Command boundsCommand = new ICommandProxy(new SetBoundsCommand(part.getEditingDomain(), DiagramUIMessages.SetLocationCommand_Label_Resize, new EObjectAdapter(targetView), location));
// Take care of the order of commands, to make sure target is always bellow the source.
- if(dy < 0) { // move up
+ if (dy < 0) { // move up
command = command == null ? boundsCommand : command.chain(boundsCommand);
command = moveCascadeLifeline(lp, command, dy);
} else { // move down
@@ -237,6 +243,7 @@ public class LifelineMessageCreateHelper {
}
}
}
+ }
}
return command;
}
@@ -245,27 +252,32 @@ public class LifelineMessageCreateHelper {
int halfHeight = child.getPrimaryShape().getFigureLifelineNameContainerFigure().getBounds().height / 2;
// check outgoing links
List list = child.getSourceConnections();
- if(list != null && list.size() > 0) {
- for(Object l : list)
- if(l instanceof Message4EditPart && ((Message4EditPart)l).getTarget() instanceof LifelineEditPart) {
- LifelineEditPart lowPart = (LifelineEditPart)((Message4EditPart)l).getTarget();
+ if (list != null && list.size() > 0) {
+ for (Object l : list) {
+ if (l instanceof Message4EditPart && ((Message4EditPart) l).getTarget() instanceof LifelineEditPart) {
+ LifelineEditPart lowPart = (LifelineEditPart) ((Message4EditPart) l).getTarget();
Rectangle outBounds = lowPart.getFigure().getBounds();
- if(outBounds.y - newBounds.y < halfHeight)
+ if (outBounds.y - newBounds.y < halfHeight) {
return false;
+ }
}
+ }
}
// check incoming links
list = child.getTargetConnections();
- if(list != null && list.size() > 0) {
- for(Object l : list)
- if(l instanceof Message4EditPart && ((Message4EditPart)l).getSource() instanceof LifelineEditPart) {
- LifelineEditPart highPart = (LifelineEditPart)((Message4EditPart)l).getSource();
+ if (list != null && list.size() > 0) {
+ for (Object l : list) {
+ if (l instanceof Message4EditPart && ((Message4EditPart) l).getSource() instanceof LifelineEditPart) {
+ LifelineEditPart highPart = (LifelineEditPart) ((Message4EditPart) l).getSource();
Rectangle inBounds = highPart.getFigure().getBounds();
- if(newBounds.y - inBounds.y < halfHeight)
+ if (newBounds.y - inBounds.y < halfHeight) {
return false;
- if(newBounds.y > inBounds.getBottom().y - halfHeight)
+ }
+ if (newBounds.y > inBounds.getBottom().y - halfHeight) {
return false;
+ }
}
+ }
}
return true;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineModelChildrenHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineModelChildrenHelper.java
index 9cdebde6534..af6e1f40ca2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineModelChildrenHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineModelChildrenHelper.java
@@ -17,13 +17,13 @@ public class LifelineModelChildrenHelper {
/**
* Try to fixed the bug about display ExecutionSpecifications(ES).
- *
+ *
* At some times, the child ES would be displayed under the parent ES.
- *
+ *
* Fixed to sort them with bounds in model before creating.
*/
public static List<View> getModelChildren(View lifeline) {
- if(lifeline == null) {
+ if (lifeline == null) {
return Collections.emptyList();
}
@SuppressWarnings("unchecked")
@@ -35,10 +35,10 @@ public class LifelineModelChildrenHelper {
private static List<View> sortChildren(List<View> children) {
List<View> result = new ArrayList<View>();
List<View> original = new ArrayList<View>(children);
- for(Iterator<View> iterator = original.iterator(); iterator.hasNext();) {
+ for (Iterator<View> iterator = original.iterator(); iterator.hasNext();) {
View view = iterator.next();
EObject elt = ViewUtil.resolveSemanticElement(view);
- if(!(elt instanceof ExecutionSpecification)) {
+ if (!(elt instanceof ExecutionSpecification)) {
result.add(view);
iterator.remove();
}
@@ -48,37 +48,37 @@ public class LifelineModelChildrenHelper {
}
private static List<View> doSortExecutionSpecifications(List<View> executionSpecifications) {
- if(executionSpecifications.isEmpty()) {
+ if (executionSpecifications.isEmpty()) {
return executionSpecifications;
}
List<View> views = new ArrayList<View>(executionSpecifications);
List<View> result = new ArrayList<View>(executionSpecifications.size());
int minX = -1;
- for(View view : views) {
+ for (View view : views) {
Rectangle rect = getViewBounds(view);
- if(minX == -1 || rect.x < minX) {
+ if (minX == -1 || rect.x < minX) {
minX = rect.x;
}
}
List<View> firstLevelViews = new ArrayList<View>();
- for(View view : views) {
+ for (View view : views) {
Rectangle rect = getViewBounds(view);
- if(rect.x >= minX - 2 && rect.x <= minX + 2) {
+ if (rect.x >= minX - 2 && rect.x <= minX + 2) {
firstLevelViews.add(view);
}
}
List<View> insertViews = doSortVertically(firstLevelViews);
- for(View view : insertViews) {
+ for (View view : insertViews) {
doInsert(view, result, views, new ArrayList<View>(insertViews));
}
List<View> remains = new ArrayList<View>();
- for(View view : views) {
- if(!result.contains(view)) {
+ for (View view : views) {
+ if (!result.contains(view)) {
remains.add(view);
}
}
insertViews = doSortVertically(remains);
- for(View view : remains) {
+ for (View view : remains) {
doInsert(view, result, views, new ArrayList<View>(insertViews));
}
return result;
@@ -87,37 +87,37 @@ public class LifelineModelChildrenHelper {
private static void doInsert(View view, List<View> result, List<View> allViews, List<View> ignoreViews) {
Rectangle r1 = getViewBounds(view);
r1.width = 16;
- if(!result.contains(view)) {
+ if (!result.contains(view)) {
result.add(view);
}
ignoreViews.add(view);
List<View> newLevelViews = new ArrayList<View>();
- for(View v : allViews) {
- if(ignoreViews.contains(v)) {
+ for (View v : allViews) {
+ if (ignoreViews.contains(v)) {
continue;
}
Rectangle r2 = getViewBounds(v);
r2.width = 16;
- if(r2.x > r1.x && r2.x < r1.right() && r2.y >= r1.y && r2.y <= r1.bottom()) {
+ if (r2.x > r1.x && r2.x < r1.right() && r2.y >= r1.y && r2.y <= r1.bottom()) {
newLevelViews.add(v);
}
}
newLevelViews = doSortVertically(newLevelViews);
ignoreViews.addAll(newLevelViews);
- for(View v : newLevelViews) {
+ for (View v : newLevelViews) {
doInsert(v, result, allViews, ignoreViews);
}
}
private static List<View> doSortVertically(List<View> views) {
List<View> insertViews = new ArrayList<View>();
- for(int i = 0; i < views.size(); i++) {
+ for (int i = 0; i < views.size(); i++) {
View current = views.get(i);
Rectangle r1 = getViewBounds(current);
int index = insertViews.size();
- for(int j = 0; j < insertViews.size(); j++) {
+ for (int j = 0; j < insertViews.size(); j++) {
Rectangle r2 = getViewBounds(insertViews.get(j));
- if(r1.y < r2.y) {
+ if (r1.y < r2.y) {
index = j;
}
}
@@ -127,23 +127,23 @@ public class LifelineModelChildrenHelper {
}
private static Rectangle getViewBounds(View view) {
- if(view == null) {
+ if (view == null) {
return null;
}
Integer x = getFeatureValue(view, NotationPackage.eINSTANCE.getLocation_X());
Integer y = getFeatureValue(view, NotationPackage.eINSTANCE.getLocation_Y());
Integer width = getFeatureValue(view, NotationPackage.eINSTANCE.getSize_Width());
Integer height = getFeatureValue(view, NotationPackage.eINSTANCE.getSize_Height());
- if(x == null && y == null && width == null && height == null) {
+ if (x == null && y == null && width == null && height == null) {
return null;
}
return new Rectangle(x == null ? 0 : x.intValue(), y == null ? 0 : y.intValue(), width == null ? -1 : width.intValue(), height == null ? -1 : height.intValue());
}
private static Integer getFeatureValue(View view, EStructuralFeature feature) {
- if(view == null || feature == null) {
+ if (view == null || feature == null) {
return null;
}
- return (Integer)ViewUtil.getPropertyValue(view, feature, feature.getEContainingClass());
+ return (Integer) ViewUtil.getPropertyValue(view, feature, feature.getEContainingClass());
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineResizeHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineResizeHelper.java
index e0c8746bca2..eaf940fbef1 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineResizeHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LifelineResizeHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -42,7 +42,7 @@ public class LifelineResizeHelper {
public static boolean isManualSize(LifelineEditPart lp) {
View view = lp.getNotationView();
EAnnotation oldAnnotation = view.getEAnnotation(CUSTOM_EXTENSION_INFO);
- if(oldAnnotation != null) {
+ if (oldAnnotation != null) {
String val = oldAnnotation.getDetails().get(MANUAL_LABEL_SIZE);
return "true".equalsIgnoreCase(val);
}
@@ -50,20 +50,20 @@ public class LifelineResizeHelper {
Dimension namePreSize = primaryShape.getFigureLifelineNameContainerFigure().getPreferredSize();
Rectangle childrenRect = null;
List<ShapeNodeEditPart> childShapeNodeEditPart = LifelineEditPartUtil.getChildShapeNodeEditPart(lp);
- for(ShapeNodeEditPart child : childShapeNodeEditPart) {
- if(!(child.resolveSemanticElement() instanceof ExecutionSpecification)) {
+ for (ShapeNodeEditPart child : childShapeNodeEditPart) {
+ if (!(child.resolveSemanticElement() instanceof ExecutionSpecification)) {
continue;
}
Rectangle rect = SequenceUtil.getAbsoluteBounds(child);
- if(childrenRect == null) {
+ if (childrenRect == null) {
childrenRect = rect;
} else {
childrenRect.union(rect);
}
}
- if(childrenRect != null) {
- //This will disable the auto expanding of Lifeline Bordered Figure.
- if(namePreSize.width / 2 < childrenRect.width - 8) {
+ if (childrenRect != null) {
+ // This will disable the auto expanding of Lifeline Bordered Figure.
+ if (namePreSize.width / 2 < childrenRect.width - 8) {
return true;
}
}
@@ -81,10 +81,11 @@ public class LifelineResizeHelper {
public static class ManualLabelSizeCommand extends AbstractTransactionalCommand {
public EModelElement getObject() {
- if(object != null)
+ if (object != null) {
return object;
- if(adapter != null) {
- return (View)adapter.getAdapter(View.class);
+ }
+ if (adapter != null) {
+ return (View) adapter.getAdapter(View.class);
}
return null;
}
@@ -122,7 +123,7 @@ public class LifelineResizeHelper {
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
EAnnotation oldAnnotation = getObject().getEAnnotation(eAnnotationName);
- if(oldAnnotation == null) {
+ if (oldAnnotation == null) {
oldAnnotation = createEAnnotation();
attachEannotation(oldAnnotation, getObject());
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LinkRouteModelElementFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LinkRouteModelElementFactory.java
index e083a906ea5..608e6d21986 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LinkRouteModelElementFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LinkRouteModelElementFactory.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013, 2014 CEA 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
@@ -54,9 +54,9 @@ public class LinkRouteModelElementFactory extends AnnotationModelElementFactory
@Override
protected AnnotationModelElement doCreateFromSource(Object sourceElement, DataContextElement context) {
View view = NotationHelper.findView(sourceElement);
- if(view != null && view instanceof Edge) {
+ if (view != null && view instanceof Edge) {
EditingDomain domain = EMFHelper.resolveEditingDomain(view);
- LinkRouteModelElement m = new LinkRouteModelElement((Edge)view, domain);
+ LinkRouteModelElement m = new LinkRouteModelElement((Edge) view, domain);
elements.put(view, m);
return m;
}
@@ -64,17 +64,17 @@ public class LinkRouteModelElementFactory extends AnnotationModelElementFactory
}
public static LinkRouteModelElement getElement(Object sourceElement) {
- if(elements.get(sourceElement) == null) {
+ if (elements.get(sourceElement) == null) {
View view = NotationHelper.findView(sourceElement);
EditingDomain domain = EMFHelper.resolveEditingDomain(view);
- LinkRouteModelElement m = new LinkRouteModelElement((Edge)view, domain);
+ LinkRouteModelElement m = new LinkRouteModelElement((Edge) view, domain);
elements.put(view, m);
}
return elements.get(sourceElement);
}
public static boolean isRoutingNotification(Notification event) {
- if(event.getNewValue() instanceof EAnnotation && LinkRouteModelElementFactory.ROUTING.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && LinkRouteModelElementFactory.ROUTING.equals(((EAnnotation) event.getNewValue()).getSource())) {
return true;
}
return false;
@@ -82,7 +82,7 @@ public class LinkRouteModelElementFactory extends AnnotationModelElementFactory
public static String getRoutingStyle(View view) {
EAnnotation ea = view.getEAnnotation(ROUTING);
- if(ea != null && ea.getDetails().containsKey(STYLE)) {
+ if (ea != null && ea.getDetails().containsKey(STYLE)) {
return ea.getDetails().get(STYLE);
}
return AUTOMATIC;
@@ -93,9 +93,9 @@ public class LinkRouteModelElementFactory extends AnnotationModelElementFactory
}
public static void switchToManualRouting(View edge) {
- if(LinkRouteModelElementFactory.isAutomaticRouting(edge)) {
+ if (LinkRouteModelElementFactory.isAutomaticRouting(edge)) {
LinkRouteModelElement element = LinkRouteModelElementFactory.getElement(edge);
- AnnotationObservableValue observable = (AnnotationObservableValue)element.getObservable(STYLE);
+ AnnotationObservableValue observable = (AnnotationObservableValue) element.getObservable(STYLE);
observable.setValue(LinkRouteModelElementFactory.MANUAL);
}
}
@@ -106,12 +106,14 @@ public class LinkRouteModelElementFactory extends AnnotationModelElementFactory
super(source, domain, ROUTING);
}
+ @Override
public IStaticContentProvider getContentProvider(String propertyPath) {
- if(propertyPath.equals(STYLE)) {
+ if (propertyPath.equals(STYLE)) {
return new AbstractStaticContentProvider() {
+ @Override
public Object[] getElements() {
- return new String[]{ AUTOMATIC, MANUAL };
+ return new String[] { AUTOMATIC, MANUAL };
}
};
@@ -119,16 +121,18 @@ public class LinkRouteModelElementFactory extends AnnotationModelElementFactory
return EmptyContentProvider.instance;
}
+ @Override
public ILabelProvider getLabelProvider(String propertyPath) {
return new org.eclipse.jface.viewers.LabelProvider();
}
+ @Override
public IObservable doGetObservable(String propertyPath) {
return new AnnotationObservableValue(source, domain, ROUTING, STYLE) {
@Override
protected Command getCommand(final Object value) {
- return new CreateEAnnotationCommand((TransactionalEditingDomain)domain, source, ROUTING) {
+ return new CreateEAnnotationCommand((TransactionalEditingDomain) domain, source, ROUTING) {
@Override
protected void doExecute() {
@@ -142,7 +146,7 @@ public class LinkRouteModelElementFactory extends AnnotationModelElementFactory
@Override
protected Object doGetValue() {
Object value = super.doGetValue();
- if(value == null) {
+ if (value == null) {
return AUTOMATIC;
}
return value;
@@ -153,7 +157,7 @@ public class LinkRouteModelElementFactory extends AnnotationModelElementFactory
Object oldValue = doGetValue();
Command emfCommand = getCommand(value);
- if(emfCommand != null) {
+ if (emfCommand != null) {
domain.getCommandStack().execute(emfCommand);
}
ValueDiff createValueDiff = Diffs.createValueDiff(oldValue, value);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LoopOperatorUtil.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LoopOperatorUtil.java
index 08c296b60b2..7ce250d6cf9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LoopOperatorUtil.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/LoopOperatorUtil.java
@@ -8,43 +8,43 @@ import org.eclipse.uml2.uml.InteractionConstraint;
* loop-operand ::= loop [ '(' min-int [ ',' max-int ] ')' ]
* min-int ::= non-negative-integer
* max-int ::= positive-integer | '*'
- *
+ *
* 1. If loop has no bounds specified, it means potentially infinite loop with zero as lower bound and infinite upper bound..
* 2. If only min-int is specified, it means that upper bound is equal to the lower bound, and loop will be executed exactly the specified
* number of times.
* 3. If max-int is specified, it should be greater than or equal to min-int. Loop will iterate minimum the min-int number of times and at
* most the max-int number of times.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class LoopOperatorUtil {
public static String getLoopCondition(InteractionConstraint guard) {
- if(guard == null) {
+ if (guard == null) {
return null;
}
Integer minint = InteractionConstraintUtil.getMinintValue(guard);
Integer maxint = InteractionConstraintUtil.getMaxintValue(guard);
- if(minint == null && maxint == null) {
+ if (minint == null && maxint == null) {
return "";
}
- //by default, minint==0;
- if(maxint == null && minint != null && minint.intValue() == 0) {
+ // by default, minint==0;
+ if (maxint == null && minint != null && minint.intValue() == 0) {
return "";
}
- //by default, maxint==1
- if(minint == null && maxint != null && maxint.intValue() == 1) {
+ // by default, maxint==1
+ if (minint == null && maxint != null && maxint.intValue() == 1) {
return "";
}
- if(minint == null) {
+ if (minint == null) {
minint = Integer.valueOf(0);
}
StringBuffer buf = new StringBuffer("(");
buf.append(minint.intValue());
- if(maxint != null) {
- if(maxint.intValue() != minint.intValue()) {
+ if (maxint != null) {
+ if (maxint.intValue() != minint.intValue()) {
buf.append(",");
- if(Integer.MAX_VALUE == maxint) {
+ if (Integer.MAX_VALUE == maxint) {
buf.append("*");
} else {
buf.append(maxint);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/MessageAnchorRepairer.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/MessageAnchorRepairer.java
index 594c94b8471..55f9a6deba9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/MessageAnchorRepairer.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/MessageAnchorRepairer.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -40,35 +40,35 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart;
public class MessageAnchorRepairer {
public static ICommand createPreserveMessageAnchorsCommand(ShapeNodeEditPart editPart, int heightDelta) {
- if(editPart == null || heightDelta == 0) {
+ if (editPart == null || heightDelta == 0) {
return null;
}
Dimension sizeDelta = new Dimension(0, heightDelta);
int preserveAxis = PreserveAnchorsPositionCommand.PRESERVE_Y;
- if(editPart instanceof LifelineEditPart) {
+ if (editPart instanceof LifelineEditPart) {
return new CustomLifelineEditPart.PreserveAnchorsPositionCommandEx(editPart, sizeDelta, preserveAxis);
}
return new PreserveAnchorsPositionCommand(editPart, sizeDelta, preserveAxis);
}
public static ICommand preserveMessageAnchorsCommand(ShapeNodeEditPart editPart, int heightDelta, int direction) {
- if(editPart == null || heightDelta == 0) {
+ if (editPart == null || heightDelta == 0) {
return null;
}
Dimension sizeDelta = new Dimension(0, heightDelta);
- if(editPart instanceof LifelineEditPart) {
+ if (editPart instanceof LifelineEditPart) {
return new CustomLifelineEditPart.PreserveAnchorsPositionCommandEx(editPart, sizeDelta, PreserveAnchorsPositionCommand.PRESERVE_Y, editPart.getFigure(), direction);
}
return new PreserveAnchorsPositionCommand(editPart, sizeDelta, PreserveAnchorsPositionCommand.PRESERVE_Y, editPart.getFigure(), direction);
}
public static int computeResizeDelta(ShapeNodeEditPart editPart, Rectangle newChildBounds) {
- if(editPart == null || newChildBounds == null) {
+ if (editPart == null || newChildBounds == null) {
return -1;
}
IFigure figure = editPart.getFigure();
Rectangle rect = figure.getBounds().getCopy();
- if(rect.contains(newChildBounds)) {
+ if (rect.contains(newChildBounds)) {
return -1;
}
Rectangle result = rect.getUnion(newChildBounds);
@@ -77,43 +77,43 @@ public class MessageAnchorRepairer {
/**
* Update anchor of linked messages for Lifeline and CombinedFragment.
- *
+ *
* @param newHeight
* @param oldHeight
*/
public static void repair(NodeEditPart editPart, int oldHeight, int newHeight) {
- if(editPart == null || !(editPart instanceof LifelineEditPart || editPart instanceof CombinedFragmentEditPart)) {
+ if (editPart == null || !(editPart instanceof LifelineEditPart || editPart instanceof CombinedFragmentEditPart)) {
return;
}
- Rectangle bounds = ((GraphicalEditPart)editPart).getFigure().getBounds();
- if(oldHeight < 0) {
+ Rectangle bounds = ((GraphicalEditPart) editPart).getFigure().getBounds();
+ if (oldHeight < 0) {
oldHeight = bounds.height;
}
- if(newHeight < 0) {
+ if (newHeight < 0) {
newHeight = bounds.height;
}
- if(oldHeight == newHeight) {
+ if (oldHeight == newHeight) {
return;
}
- EditingDomain editingDomain = ((GraphicalEditPart)editPart).getEditingDomain();
+ EditingDomain editingDomain = ((GraphicalEditPart) editPart).getEditingDomain();
List sourceConnections = editPart.getSourceConnections();
- for(Object object : sourceConnections) {
- if(!(object instanceof AbstractMessageEditPart)) {
+ for (Object object : sourceConnections) {
+ if (!(object instanceof AbstractMessageEditPart)) {
continue;
}
- AbstractMessageEditPart conn = (AbstractMessageEditPart)object;
- Edge edge = (Edge)conn.getModel();
- final IdentityAnchor anchor = (IdentityAnchor)edge.getSourceAnchor();
+ AbstractMessageEditPart conn = (AbstractMessageEditPart) object;
+ Edge edge = (Edge) conn.getModel();
+ final IdentityAnchor anchor = (IdentityAnchor) edge.getSourceAnchor();
updateAnchorTerminal(editingDomain, anchor, oldHeight, newHeight);
}
List targetConnections = editPart.getTargetConnections();
- for(Object object : targetConnections) {
- if(!(object instanceof AbstractMessageEditPart)) {
+ for (Object object : targetConnections) {
+ if (!(object instanceof AbstractMessageEditPart)) {
continue;
}
- AbstractMessageEditPart conn = (AbstractMessageEditPart)object;
- Edge edge = (Edge)conn.getModel();
- final IdentityAnchor anchor = (IdentityAnchor)edge.getTargetAnchor();
+ AbstractMessageEditPart conn = (AbstractMessageEditPart) object;
+ Edge edge = (Edge) conn.getModel();
+ final IdentityAnchor anchor = (IdentityAnchor) edge.getTargetAnchor();
updateAnchorTerminal(editingDomain, anchor, oldHeight, newHeight);
}
}
@@ -121,16 +121,17 @@ public class MessageAnchorRepairer {
private static void updateAnchorTerminal(EditingDomain editingDomain, final IdentityAnchor anchor, int oldHeight, int newHeight) {
final String oldTerminal = anchor.getId();
PrecisionPoint pp = BaseSlidableAnchor.parseTerminalString(oldTerminal);
- int yPos = (int)Math.round(oldHeight * pp.preciseY());
- pp.setPreciseY((double)yPos / newHeight);
- if(pp.preciseY() > 1.0) {
+ int yPos = (int) Math.round(oldHeight * pp.preciseY());
+ pp.setPreciseY((double) yPos / newHeight);
+ if (pp.preciseY() > 1.0) {
pp.setPreciseY(1.0);
- } else if(pp.preciseY() < 0.0) {
+ } else if (pp.preciseY() < 0.0) {
pp.setPreciseY(0.0);
}
final String newTerminal = (new BaseSlidableAnchor(null, pp)).getTerminal();
CommandHelper.executeCommandWithoutHistory(editingDomain, new AbstractCommand("Update Target Anchors") {
+ @Override
public void redo() {
execute();
}
@@ -140,6 +141,7 @@ public class MessageAnchorRepairer {
return false;
}
+ @Override
public void execute() {
anchor.setId(newTerminal);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/MessageConnectionHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/MessageConnectionHelper.java
index a0fa1d15bb1..af5b3fc2901 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/MessageConnectionHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/MessageConnectionHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -28,7 +28,7 @@ import org.eclipse.uml2.uml.OccurrenceSpecification;
/**
* Helper class for determine the message connections. Both for connecting and reconnecting.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class MessageConnectionHelper {
@@ -39,67 +39,67 @@ public class MessageConnectionHelper {
}
public static boolean canReorientSource(Message message, Element newSource) {
- if(message == null || newSource == null) {
+ if (message == null || newSource == null) {
return false;
}
Element target = null;
MessageEnd receiveEvent = message.getReceiveEvent();
- if(receiveEvent instanceof OccurrenceSpecification) {
- EList<Lifeline> covereds = ((OccurrenceSpecification)receiveEvent).getCovereds();
- if(!covereds.isEmpty()) {
+ if (receiveEvent instanceof OccurrenceSpecification) {
+ EList<Lifeline> covereds = ((OccurrenceSpecification) receiveEvent).getCovereds();
+ if (!covereds.isEmpty()) {
target = covereds.get(0);
}
- } else if(receiveEvent instanceof Gate) {
- target = ((Gate)receiveEvent).getOwner();
+ } else if (receiveEvent instanceof Gate) {
+ target = ((Gate) receiveEvent).getOwner();
}
return canExist(message, newSource, target);
}
public static boolean canReorientTarget(Message message, Element newTarget) {
- if(message == null || newTarget == null) {
+ if (message == null || newTarget == null) {
return false;
}
Element source = null;
MessageEnd sendEvent = message.getSendEvent();
- if(sendEvent instanceof OccurrenceSpecification) {
- EList<Lifeline> covereds = ((OccurrenceSpecification)sendEvent).getCovereds();
- if(!covereds.isEmpty()) {
+ if (sendEvent instanceof OccurrenceSpecification) {
+ EList<Lifeline> covereds = ((OccurrenceSpecification) sendEvent).getCovereds();
+ if (!covereds.isEmpty()) {
source = covereds.get(0);
}
- } else if(sendEvent instanceof Gate) {
- source = ((Gate)sendEvent).getOwner();
+ } else if (sendEvent instanceof Gate) {
+ source = ((Gate) sendEvent).getOwner();
}
return canExist(message, source, newTarget);
}
public static boolean canExist(Message message, Element source, Element target) {
MessageSort messageSort = null;
- if(message != null) {
+ if (message != null) {
messageSort = message.getMessageSort();
}
return canExist(message, messageSort, source, target);
}
public static boolean canExist(Message message, MessageSort messageSort, Element source, Element target) {
- if(debug) {
+ if (debug) {
print(messageSort, source, target);
}
- if(MessageSort.ASYNCH_CALL_LITERAL == messageSort) {
+ if (MessageSort.ASYNCH_CALL_LITERAL == messageSort) {
return canExistAsynchMessage(message, source, target);
- } else if(MessageSort.ASYNCH_SIGNAL_LITERAL == messageSort) {
- if(source == null) {
+ } else if (MessageSort.ASYNCH_SIGNAL_LITERAL == messageSort) {
+ if (source == null) {
return canExistFoundMessage(message, target);
}
- if(target == null) {
+ if (target == null) {
return canExistLostMessage(message, source);
}
- } else if(MessageSort.SYNCH_CALL_LITERAL == messageSort) {
+ } else if (MessageSort.SYNCH_CALL_LITERAL == messageSort) {
return canExistSynchMessage(message, source, target);
- } else if(MessageSort.CREATE_MESSAGE_LITERAL == messageSort) {
+ } else if (MessageSort.CREATE_MESSAGE_LITERAL == messageSort) {
return canExistCreateMessage(message, source, target);
- } else if(MessageSort.DELETE_MESSAGE_LITERAL == messageSort) {
+ } else if (MessageSort.DELETE_MESSAGE_LITERAL == messageSort) {
return canExistDeleteMessage(message, source, target);
- } else if(MessageSort.REPLY_LITERAL == messageSort) {
+ } else if (MessageSort.REPLY_LITERAL == messageSort) {
return canExistReplyMessage(message, source, target);
}
return false;
@@ -111,27 +111,27 @@ public class MessageConnectionHelper {
private static void print(MessageSort messageSort, Element source, Element target) {
StringBuffer buf = new StringBuffer();
- if(messageSort != null) {
+ if (messageSort != null) {
buf.append(messageSort.getName());
buf.append("[");
}
buf.append("Source: ");
- if(source != null) {
+ if (source != null) {
buf.append(source.eClass().getName());
- if(source instanceof NamedElement) {
+ if (source instanceof NamedElement) {
buf.append("(");
- buf.append(((NamedElement)source).getName());
+ buf.append(((NamedElement) source).getName());
buf.append(")");
}
} else {
buf.append("null");
}
buf.append(", Target: ");
- if(target != null) {
+ if (target != null) {
buf.append(target.eClass().getName());
- if(target instanceof NamedElement) {
+ if (target instanceof NamedElement) {
buf.append("(");
- buf.append(((NamedElement)target).getName());
+ buf.append(((NamedElement) target).getName());
buf.append(")");
}
} else {
@@ -142,17 +142,17 @@ public class MessageConnectionHelper {
}
public static boolean canExistReplyMessage(Message message, Element source, Element target) {
- if(target instanceof Message) {
+ if (target instanceof Message) {
return false;
}
- if(source instanceof ExecutionSpecification && target instanceof Lifeline) {
- if(((ExecutionSpecification)source).getCovereds().contains(target)) {
+ if (source instanceof ExecutionSpecification && target instanceof Lifeline) {
+ if (((ExecutionSpecification) source).getCovereds().contains(target)) {
return false;
}
}
- if(target instanceof Gate) {
- Message ownMessage = ((Gate)target).getMessage();
- if(ownMessage == null) {
+ if (target instanceof Gate) {
+ Message ownMessage = ((Gate) target).getMessage();
+ if (ownMessage == null) {
return true;
}
return ownMessage == message;
@@ -165,11 +165,11 @@ public class MessageConnectionHelper {
}
public static boolean canExistCreateMessage(Message message, Element source, Element target) {
- if(target != null) {
- if(false == target instanceof Lifeline) {
+ if (target != null) {
+ if (false == target instanceof Lifeline) {
return false;
}
- if(target == source) {
+ if (target == source) {
return false;
}
}
@@ -177,19 +177,19 @@ public class MessageConnectionHelper {
}
public static boolean canExistSynchMessage(Message message, Element source, Element target) {
- if(source != null && !(source instanceof ExecutionSpecification || source instanceof Lifeline || source instanceof ExecutionOccurrenceSpecification)) {
+ if (source != null && !(source instanceof ExecutionSpecification || source instanceof Lifeline || source instanceof ExecutionOccurrenceSpecification)) {
return false;
}
- if(target != null && !(target instanceof ExecutionSpecification || target instanceof Lifeline || target instanceof ExecutionOccurrenceSpecification)) {
+ if (target != null && !(target instanceof ExecutionSpecification || target instanceof Lifeline || target instanceof ExecutionOccurrenceSpecification)) {
return false;
}
return true;
}
public static boolean canExistLostMessage(Message message, Element source) {
- if(source instanceof Gate) {
- Message ownMessage = ((Gate)source).getMessage();
- if(ownMessage == null) {
+ if (source instanceof Gate) {
+ Message ownMessage = ((Gate) source).getMessage();
+ if (ownMessage == null) {
return true;
}
return ownMessage == message;
@@ -198,26 +198,26 @@ public class MessageConnectionHelper {
}
public static boolean canExistFoundMessage(Message message, Element target) {
- if(target instanceof Gate) {
- return message == null ? ((Gate)target).getMessage() == null : message == ((Gate)target).getMessage();
+ if (target instanceof Gate) {
+ return message == null ? ((Gate) target).getMessage() == null : message == ((Gate) target).getMessage();
}
return true;
}
public static boolean canExistAsynchMessage(Message message, Element source, Element target) {
- if(target instanceof Message) {
+ if (target instanceof Message) {
return false;
}
- //Only available for ExecutionSpecification and Lifeline.
- if(target != null && !(target instanceof ExecutionSpecification || target instanceof Lifeline || target instanceof InteractionFragment || target instanceof MessageEnd)) {
+ // Only available for ExecutionSpecification and Lifeline.
+ if (target != null && !(target instanceof ExecutionSpecification || target instanceof Lifeline || target instanceof InteractionFragment || target instanceof MessageEnd)) {
return false;
}
- if(source instanceof Gate) {
- Message ownerMessage = ((Gate)source).getMessage();
+ if (source instanceof Gate) {
+ Message ownerMessage = ((Gate) source).getMessage();
return ownerMessage == null ? true : ownerMessage == message;
}
- if(target instanceof Gate) {
- Message ownerMessage = ((Gate)target).getMessage();
+ if (target instanceof Gate) {
+ Message ownerMessage = ((Gate) target).getMessage();
return ownerMessage == null ? true : ownerMessage == message;
}
return true;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/MessageStyleElementFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/MessageStyleElementFactory.java
index 35893c76684..83877d8e33e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/MessageStyleElementFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/MessageStyleElementFactory.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2012, 2014 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
@@ -9,7 +9,7 @@
* Contributors:
* CEA LIST - Initial API and implementation
* Christian W. Damus (CEA) - bug 417409
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.sequence.util;
@@ -32,19 +32,19 @@ public class MessageStyleElementFactory extends AbstractModelElementFactory<Mess
@Override
protected MessageStyleModelElement doCreateFromSource(Object sourceElement, DataContextElement context) {
View view = NotationHelper.findView(sourceElement);
- if(view != null && view instanceof Edge) {
- return new MessageStyleModelElement((Edge)view, context);
+ if (view != null && view instanceof Edge) {
+ return new MessageStyleModelElement((Edge) view, context);
}
return null;
}
-
+
@Override
protected void updateModelElement(MessageStyleModelElement modelElement, Object newSourceElement) {
View view = NotationHelper.findView(newSourceElement);
- if(!(view instanceof Edge)) {
+ if (!(view instanceof Edge)) {
throw new IllegalArgumentException("Cannot resolve Edge selection: " + newSourceElement);
}
- modelElement.source = (Edge)view;
+ modelElement.source = (Edge) view;
}
static class MessageStyleModelElement extends AbstractModelElement {
@@ -62,12 +62,12 @@ public class MessageStyleElementFactory extends AbstractModelElementFactory<Mess
protected IObservable doGetObservable(String propertyPath) {
EditingDomain domain = AdapterFactoryEditingDomain.getEditingDomainFor(source);
Style style = null;
- if(context.getName().equals("LineStyle")) {
+ if (context.getName().equals("LineStyle")) {
style = source.getStyle(NotationPackage.Literals.LINE_STYLE);
- } else if(context.getName().equals("FontStyle")) {
+ } else if (context.getName().equals("FontStyle")) {
style = source.getStyle(NotationPackage.Literals.FONT_STYLE);
}
- if(style != null) {
+ if (style != null) {
EStructuralFeature feature = style.eClass().getEStructuralFeature(propertyPath);
return new PapyrusObservableValue(style, feature, domain);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/NotificationHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/NotificationHelper.java
index 9b42502a41c..53b3bdba6eb 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/NotificationHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/NotificationHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -31,13 +31,13 @@ public class NotificationHelper {
/**
* Add listener on a element
- *
+ *
* @param element
- * The object to listen
+ * The object to listen
*/
public void listenObject(Notifier element) {
// Only listen the object if it isn't yet listened
- if(element != null && !element.eAdapters().contains(modelListener)) {
+ if (element != null && !element.eAdapters().contains(modelListener)) {
element.eAdapters().add(modelListener);
listeners.add(element);
}
@@ -45,13 +45,13 @@ public class NotificationHelper {
/**
* Remove listener on a element
- *
+ *
* @param element
- * The object to unlisten
+ * The object to unlisten
*/
public void unlistenObject(Notifier element) {
// Only listen the object if it isn't yet listened
- if(element != null && element.eAdapters().contains(modelListener)) {
+ if (element != null && element.eAdapters().contains(modelListener)) {
element.eAdapters().remove(modelListener);
}
listeners.remove(element);
@@ -61,9 +61,9 @@ public class NotificationHelper {
* Remove all listeners
*/
public void unlistenAll() {
- if(listeners.size() > 0) {
- for(Notifier listener : listeners) {
- if(listener != null && listener.eAdapters().contains(modelListener)) {
+ if (listeners.size() > 0) {
+ for (Notifier listener : listeners) {
+ if (listener != null && listener.eAdapters().contains(modelListener)) {
listener.eAdapters().remove(modelListener);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/OccurrenceSpecificationHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/OccurrenceSpecificationHelper.java
index 26f41eccbfe..89261bad068 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/OccurrenceSpecificationHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/OccurrenceSpecificationHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013, 2014 Soyatec, CEA, 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
@@ -35,39 +35,39 @@ import org.eclipse.uml2.uml.UMLPackage;
/**
* Update execution ends to message ends for Sync and Reply message, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=402975
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class OccurrenceSpecificationHelper {
/**
* Constructor.
- *
+ *
*/
private OccurrenceSpecificationHelper() {
}
public static boolean resetExecutionStart(ExecutionSpecification execution, Element newStart) {
- if(!(newStart instanceof OccurrenceSpecification)) {
+ if (!(newStart instanceof OccurrenceSpecification)) {
return false;
}
- return resetExecutionEnd(execution, (OccurrenceSpecification)newStart, true);
+ return resetExecutionEnd(execution, (OccurrenceSpecification) newStart, true);
}
public static boolean resetExecutionFinish(ExecutionSpecification execution, Element newFinish) {
- if(!(newFinish instanceof OccurrenceSpecification)) {
+ if (!(newFinish instanceof OccurrenceSpecification)) {
return false;
}
- return resetExecutionEnd(execution, (OccurrenceSpecification)newFinish, false);
+ return resetExecutionEnd(execution, (OccurrenceSpecification) newFinish, false);
}
private static void copyInfo(OccurrenceSpecification fromOS, OccurrenceSpecification toOS) {
- if(fromOS == null || toOS == null) {
+ if (fromOS == null || toOS == null) {
return;
}
EList<Lifeline> covereds = fromOS.getCovereds();
- for(Lifeline lifeline : covereds) {
- if(toOS.getCovereds().contains(lifeline)) {
+ for (Lifeline lifeline : covereds) {
+ if (toOS.getCovereds().contains(lifeline)) {
continue;
}
toOS.getCovereds().add(lifeline);
@@ -75,35 +75,35 @@ public class OccurrenceSpecificationHelper {
}
public static boolean resetExecutionEnd(ExecutionSpecification execution, OccurrenceSpecification newEnd, boolean isStart) {
- if(execution == null || newEnd == null) {
+ if (execution == null || newEnd == null) {
return false;
}
OccurrenceSpecification oldEnd = isStart ? execution.getStart() : execution.getFinish();
- if(newEnd.eContainer() == null) {
+ if (newEnd.eContainer() == null) {
EObject eContainer = oldEnd != null ? oldEnd.eContainer() : execution.eContainer();
- if(eContainer instanceof Interaction) {
- newEnd.setEnclosingInteraction((Interaction)eContainer);
- } else if(eContainer instanceof InteractionOperand) {
- newEnd.setEnclosingOperand((InteractionOperand)eContainer);
+ if (eContainer instanceof Interaction) {
+ newEnd.setEnclosingInteraction((Interaction) eContainer);
+ } else if (eContainer instanceof InteractionOperand) {
+ newEnd.setEnclosingOperand((InteractionOperand) eContainer);
}
}
- if(newEnd.getName() == null) {
- if(isStart) {
+ if (newEnd.getName() == null) {
+ if (isStart) {
newEnd.setName(execution.getName() + "Start");
} else {
newEnd.setName(execution.getName() + "Finish");
}
}
copyInfo(oldEnd, newEnd);
- if(newEnd instanceof ExecutionOccurrenceSpecification) {
- ((ExecutionOccurrenceSpecification)newEnd).setExecution(execution);
+ if (newEnd instanceof ExecutionOccurrenceSpecification) {
+ ((ExecutionOccurrenceSpecification) newEnd).setExecution(execution);
}
- if(isStart) {
+ if (isStart) {
execution.setStart(newEnd);
} else {
execution.setFinish(newEnd);
}
- if(canBeRemoved(oldEnd, newEnd, isStart)) {
+ if (canBeRemoved(oldEnd, newEnd, isStart)) {
EcoreUtil.remove(oldEnd);
}
return true;
@@ -111,23 +111,23 @@ public class OccurrenceSpecificationHelper {
/**
* The given <code>Occurrence Specification</code> object can be removed without any references.
- *
+ *
* @param isStart
*/
private static boolean canBeRemoved(OccurrenceSpecification os, OccurrenceSpecification copy, boolean isStart) {
- if(os == null || copy == null || os instanceof MessageOccurrenceSpecification) {
+ if (os == null || copy == null || os instanceof MessageOccurrenceSpecification) {
return false;
}
Collection<Setting> usages = EMFHelper.getUsages(os);
- for(Setting setting : usages) {
+ for (Setting setting : usages) {
Object osValue = setting.get(true);
- if(osValue instanceof List<?> && ((List<?>)osValue).contains(copy)) {
+ if (osValue instanceof List<?> && ((List<?>) osValue).contains(copy)) {
continue;
}
EStructuralFeature feature = setting.getEStructuralFeature();
- if(isStart && UMLPackage.eINSTANCE.getExecutionSpecification_Start() == feature) {
+ if (isStart && UMLPackage.eINSTANCE.getExecutionSpecification_Start() == feature) {
continue;
- } else if(!isStart && UMLPackage.eINSTANCE.getExecutionSpecification_Finish() == feature) {
+ } else if (!isStart && UMLPackage.eINSTANCE.getExecutionSpecification_Finish() == feature) {
continue;
}
}
@@ -138,17 +138,17 @@ public class OccurrenceSpecificationHelper {
* Find an Execution with the given end.
*/
public static ExecutionSpecification findExecutionWith(OccurrenceSpecification end, boolean isStart) {
- if(end instanceof ExecutionOccurrenceSpecification) {
- return ((ExecutionOccurrenceSpecification)end).getExecution();
+ if (end instanceof ExecutionOccurrenceSpecification) {
+ return ((ExecutionOccurrenceSpecification) end).getExecution();
}
Collection<Setting> usages = EMFHelper.getUsages(end);
- for(Setting setting : usages) {
+ for (Setting setting : usages) {
EObject eObject = setting.getEObject();
EStructuralFeature feature = setting.getEStructuralFeature();
- if(isStart && UMLPackage.eINSTANCE.getExecutionSpecification_Start() == feature) {
- return (ExecutionSpecification)eObject;
- } else if(!isStart && UMLPackage.eINSTANCE.getExecutionSpecification_Finish() == feature) {
- return (ExecutionSpecification)eObject;
+ if (isStart && UMLPackage.eINSTANCE.getExecutionSpecification_Start() == feature) {
+ return (ExecutionSpecification) eObject;
+ } else if (!isStart && UMLPackage.eINSTANCE.getExecutionSpecification_Finish() == feature) {
+ return (ExecutionSpecification) eObject;
}
}
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/OccurrenceSpecificationMoveHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/OccurrenceSpecificationMoveHelper.java
index 95e2a773b41..407962ce6b0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/OccurrenceSpecificationMoveHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/OccurrenceSpecificationMoveHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -80,67 +80,68 @@ import org.eclipse.uml2.uml.TimeObservation;
/**
* This Helper must be used for performing move/reconnect operations which modify the location of an OccurrenceSpecification.
- *
+ *
* @author vhemery
*/
public class OccurrenceSpecificationMoveHelper {
/**
* Get the complete command to move or reconnect all edit parts attached to one or two occurrence specification(s).
- *
+ *
* @param movedOccurrenceSpecification1
- * first moved occurrence specification
+ * first moved occurrence specification
* @param movedOccurrenceSpecification2
- * second moved occurrence specification (or null)
+ * second moved occurrence specification (or null)
* @param yLocation1
- * y location where first occurrence specification is moved
+ * y location where first occurrence specification is moved
* @param yLocation2
- * y location where second occurrence specification is moved (or -1)
+ * y location where second occurrence specification is moved (or -1)
* @param lifelinePart
- * lifeline edit part containing the moved element
+ * lifeline edit part containing the moved element
* @param notToMoveEditParts
- * list of edit parts which must not be moved in the created command
+ * list of edit parts which must not be moved in the created command
* @return command to move all edit parts linked to the occurrence specifications or null
*/
- public static Command getMoveOccurrenceSpecificationsCommand(OccurrenceSpecification movedOccurrenceSpecification1, OccurrenceSpecification movedOccurrenceSpecification2, int yLocation1, int yLocation2, LifelineEditPart lifelinePart, List<EditPart> notToMoveEditParts) {
+ public static Command getMoveOccurrenceSpecificationsCommand(OccurrenceSpecification movedOccurrenceSpecification1, OccurrenceSpecification movedOccurrenceSpecification2, int yLocation1, int yLocation2, LifelineEditPart lifelinePart,
+ List<EditPart> notToMoveEditParts) {
// the global command which shall be completed and returned
CompoundCommand globalCmd = new CompoundCommand();
// move the corresponding execution specification if necessary
Command command = getMoveExecutionSpecificationCommand(movedOccurrenceSpecification1, movedOccurrenceSpecification2, yLocation1, yLocation2, lifelinePart, notToMoveEditParts);
- if(command != null) {
+ if (command != null) {
globalCmd.add(command);
}
// reconnect the corresponding message(s) if necessary
- if(movedOccurrenceSpecification1 instanceof MessageOccurrenceSpecification) {
+ if (movedOccurrenceSpecification1 instanceof MessageOccurrenceSpecification) {
command = getReconnectMessageCommand(movedOccurrenceSpecification1, yLocation1, lifelinePart, notToMoveEditParts);
- if(command != null) {
+ if (command != null) {
globalCmd.add(command);
}
}
- if(movedOccurrenceSpecification2 instanceof MessageOccurrenceSpecification) {
+ if (movedOccurrenceSpecification2 instanceof MessageOccurrenceSpecification) {
command = getReconnectMessageCommand(movedOccurrenceSpecification2, yLocation2, lifelinePart, notToMoveEditParts);
- if(command != null) {
+ if (command != null) {
globalCmd.add(command);
}
}
// move the corresponding time/duration constraints/observations if necessary
command = getMoveTimeElementsCommand(movedOccurrenceSpecification1, movedOccurrenceSpecification2, yLocation1, yLocation2, lifelinePart, notToMoveEditParts);
- if(command != null) {
+ if (command != null) {
globalCmd.add(command);
}
// reconnect the corresponding general ordering(s) if necessary
command = getReconnectGeneralOrderingCommand(movedOccurrenceSpecification1, yLocation1, lifelinePart, notToMoveEditParts);
- if(command != null) {
+ if (command != null) {
globalCmd.add(command);
}
- if(movedOccurrenceSpecification2 != null) {
+ if (movedOccurrenceSpecification2 != null) {
command = getReconnectGeneralOrderingCommand(movedOccurrenceSpecification2, yLocation2, lifelinePart, notToMoveEditParts);
- if(command != null) {
+ if (command != null) {
globalCmd.add(command);
}
}
// return null rather than an empty non executable command
- if(globalCmd.isEmpty()) {
+ if (globalCmd.isEmpty()) {
return null;
}
return globalCmd;
@@ -148,15 +149,15 @@ public class OccurrenceSpecificationMoveHelper {
/**
* Get the command to reconnect general ordering attached to a moved occurrence specification
- *
+ *
* @param movedOccurrenceSpecification
- * moving occurrence specification
+ * moving occurrence specification
* @param yLocation
- * y location where occurrence specification is moved
+ * y location where occurrence specification is moved
* @param lifelinePart
- * lifeline edit part containing the moved element
+ * lifeline edit part containing the moved element
* @param notToMoveEditParts
- * list of edit parts which must not be moved in the created command
+ * list of edit parts which must not be moved in the created command
* @return command to reconnect general ordering edit parts linked to the occurrence specification or null
*/
private static Command getReconnectGeneralOrderingCommand(OccurrenceSpecification movedOccurrenceSpecification, int yLocation, LifelineEditPart lifelinePart, List<EditPart> notToMoveEditParts) {
@@ -165,22 +166,22 @@ public class OccurrenceSpecificationMoveHelper {
Point referencePoint = getReferencePoint(lifelinePart, movedOccurrenceSpecification, yLocation);
EditPart childToReconnectTo = SequenceUtil.findPartToReconnectTo(lifelinePart, referencePoint);
// if referencePoint is on a moved part, it must be translated with the location delta of this part
- if(!notToMoveEditParts.isEmpty() && childToReconnectTo != lifelinePart) {
+ if (!notToMoveEditParts.isEmpty() && childToReconnectTo != lifelinePart) {
Point oldLoc = SequenceUtil.findLocationOfEvent(lifelinePart, movedOccurrenceSpecification);
referencePoint.y = oldLoc.y;
}
// reconnect general ordering from the event
- for(GeneralOrdering go : movedOccurrenceSpecification.getToAfters()) {
+ for (GeneralOrdering go : movedOccurrenceSpecification.getToAfters()) {
Collection<Setting> settings = CacheAdapter.getInstance().getNonNavigableInverseReferences(go);
- for(Setting ref : settings) {
- if(NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
- View view = (View)ref.getEObject();
+ for (Setting ref : settings) {
+ if (NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
+ View view = (View) ref.getEObject();
EditPart part = DiagramEditPartsUtil.getEditPartFromView(view, lifelinePart);
// the general ordering part must start or finish on the lifeline (with the event)
- if(part instanceof ConnectionEditPart && !notToMoveEditParts.contains(part)) {
- Request reconnectRequest = makeReconnectRequest((ConnectionEditPart)part, true, referencePoint, childToReconnectTo);
+ if (part instanceof ConnectionEditPart && !notToMoveEditParts.contains(part)) {
+ Request reconnectRequest = makeReconnectRequest((ConnectionEditPart) part, true, referencePoint, childToReconnectTo);
Command reconnect = childToReconnectTo.getCommand(reconnectRequest);
- if(reconnect.canExecute()) {
+ if (reconnect.canExecute()) {
command.add(reconnect);
}
}
@@ -188,17 +189,17 @@ public class OccurrenceSpecificationMoveHelper {
}
}
// reconnect general ordering to the event
- for(GeneralOrdering go : movedOccurrenceSpecification.getToBefores()) {
+ for (GeneralOrdering go : movedOccurrenceSpecification.getToBefores()) {
Collection<Setting> settings = CacheAdapter.getInstance().getNonNavigableInverseReferences(go);
- for(Setting ref : settings) {
- if(NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
- View view = (View)ref.getEObject();
+ for (Setting ref : settings) {
+ if (NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
+ View view = (View) ref.getEObject();
EditPart part = DiagramEditPartsUtil.getEditPartFromView(view, lifelinePart);
// the general ordering part must start or finish on the lifeline (with the event)
- if(part instanceof ConnectionEditPart && !notToMoveEditParts.contains(part)) {
- Request reconnectRequest = makeReconnectRequest((ConnectionEditPart)part, false, referencePoint, childToReconnectTo);
+ if (part instanceof ConnectionEditPart && !notToMoveEditParts.contains(part)) {
+ Request reconnectRequest = makeReconnectRequest((ConnectionEditPart) part, false, referencePoint, childToReconnectTo);
Command reconnect = childToReconnectTo.getCommand(reconnectRequest);
- if(reconnect.canExecute()) {
+ if (reconnect.canExecute()) {
command.add(reconnect);
}
}
@@ -206,7 +207,7 @@ public class OccurrenceSpecificationMoveHelper {
}
}
// return null rather than an empty non executable command
- if(command.isEmpty()) {
+ if (command.isEmpty()) {
return null;
}
return command;
@@ -214,39 +215,39 @@ public class OccurrenceSpecificationMoveHelper {
/**
* Get the command to reconnect message attached to a moved occurrence specification
- *
+ *
* @param movedOccurrenceSpecification
- * moving occurrence specification
+ * moving occurrence specification
* @param yLocation
- * y location where occurrence specification is moved
+ * y location where occurrence specification is moved
* @param lifelinePart
- * lifeline edit part containing the moved element
+ * lifeline edit part containing the moved element
* @param notToMoveEditParts
- * list of edit parts which must not be moved in the created command
+ * list of edit parts which must not be moved in the created command
* @return command to reconnect message edit part linked to the occurrence specification or null
*/
private static Command getReconnectMessageCommand(OccurrenceSpecification movedOccurrenceSpecification, int yLocation, LifelineEditPart lifelinePart, List<EditPart> notToMoveEditParts) {
// the global command which shall be completed and returned
CompoundCommand command = new CompoundCommand();
- if(movedOccurrenceSpecification instanceof MessageOccurrenceSpecification) {
+ if (movedOccurrenceSpecification instanceof MessageOccurrenceSpecification) {
Point referencePoint = getReferencePoint(lifelinePart, movedOccurrenceSpecification, yLocation);
EditPart childToReconnectTo = SequenceUtil.findPartToReconnectTo(lifelinePart, referencePoint);
// reconnect message from the event
- Message message = ((MessageOccurrenceSpecification)movedOccurrenceSpecification).getMessage();
- if(message != null && movedOccurrenceSpecification.equals(message.getSendEvent())) {
+ Message message = ((MessageOccurrenceSpecification) movedOccurrenceSpecification).getMessage();
+ if (message != null && movedOccurrenceSpecification.equals(message.getSendEvent())) {
Collection<Setting> settings = CacheAdapter.getInstance().getNonNavigableInverseReferences(message);
- for(Setting ref : settings) {
- if(NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
- View view = (View)ref.getEObject();
+ for (Setting ref : settings) {
+ if (NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
+ View view = (View) ref.getEObject();
EditPart part = DiagramEditPartsUtil.getEditPartFromView(view, lifelinePart);
// the message part must start or finish on the lifeline (with the event)
- if(part instanceof ConnectionEditPart && !notToMoveEditParts.contains(part)) {
- Request reconnectRequest = makeReconnectRequest((ConnectionEditPart)part, true, referencePoint, childToReconnectTo);
+ if (part instanceof ConnectionEditPart && !notToMoveEditParts.contains(part)) {
+ Request reconnectRequest = makeReconnectRequest((ConnectionEditPart) part, true, referencePoint, childToReconnectTo);
Command reconnect = childToReconnectTo.getCommand(reconnectRequest);
command.add(reconnect);
// update enclosing interaction fragment
- Command updateIFrag = SequenceUtil.createUpdateEnclosingInteractionCommand((MessageOccurrenceSpecification)movedOccurrenceSpecification, referencePoint, lifelinePart);
- if(updateIFrag != null && updateIFrag.canExecute()) {
+ Command updateIFrag = SequenceUtil.createUpdateEnclosingInteractionCommand((MessageOccurrenceSpecification) movedOccurrenceSpecification, referencePoint, lifelinePart);
+ if (updateIFrag != null && updateIFrag.canExecute()) {
command.add(updateIFrag);
}
}
@@ -254,20 +255,20 @@ public class OccurrenceSpecificationMoveHelper {
}
}
// reconnect message to the event
- if(message != null && movedOccurrenceSpecification.equals(message.getReceiveEvent())) {
+ if (message != null && movedOccurrenceSpecification.equals(message.getReceiveEvent())) {
Collection<Setting> settings = CacheAdapter.getInstance().getNonNavigableInverseReferences(message);
- for(Setting ref : settings) {
- if(NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
- View view = (View)ref.getEObject();
+ for (Setting ref : settings) {
+ if (NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
+ View view = (View) ref.getEObject();
EditPart part = DiagramEditPartsUtil.getEditPartFromView(view, lifelinePart);
// the message part must start or finish on the lifeline (with the event)
- if(part instanceof ConnectionEditPart && !notToMoveEditParts.contains(part)) {
- Request reconnectRequest = makeReconnectRequest((ConnectionEditPart)part, false, referencePoint, childToReconnectTo);
+ if (part instanceof ConnectionEditPart && !notToMoveEditParts.contains(part)) {
+ Request reconnectRequest = makeReconnectRequest((ConnectionEditPart) part, false, referencePoint, childToReconnectTo);
Command reconnect = childToReconnectTo.getCommand(reconnectRequest);
command.add(reconnect);
// update enclosing interaction fragment
- Command updateIFrag = SequenceUtil.createUpdateEnclosingInteractionCommand((MessageOccurrenceSpecification)movedOccurrenceSpecification, referencePoint, lifelinePart);
- if(updateIFrag != null && updateIFrag.canExecute()) {
+ Command updateIFrag = SequenceUtil.createUpdateEnclosingInteractionCommand((MessageOccurrenceSpecification) movedOccurrenceSpecification, referencePoint, lifelinePart);
+ if (updateIFrag != null && updateIFrag.canExecute()) {
command.add(updateIFrag);
}
}
@@ -276,7 +277,7 @@ public class OccurrenceSpecificationMoveHelper {
}
}
// return null rather than an empty non executable command
- if(command.isEmpty()) {
+ if (command.isEmpty()) {
return null;
}
return command;
@@ -284,19 +285,19 @@ public class OccurrenceSpecificationMoveHelper {
/**
* Get the command to move time/duration observations/constraints attached to a moved occurrence specification
- *
+ *
* @param movedOccurrenceSpecification1
- * first moved occurrence specification
+ * first moved occurrence specification
* @param movedOccurrenceSpecification2
- * second moved occurrence specification (or null)
+ * second moved occurrence specification (or null)
* @param yLocation1
- * y location where first occurrence specification is moved
+ * y location where first occurrence specification is moved
* @param yLocation2
- * y location where second occurrence specification is moved (or -1)
+ * y location where second occurrence specification is moved (or -1)
* @param lifelinePart
- * lifeline edit part containing the moved element
+ * lifeline edit part containing the moved element
* @param notToMoveEditParts
- * list of edit parts which must not be moved in the created command
+ * list of edit parts which must not be moved in the created command
* @return command to move time edit parts linked to the occurrence specification or null
*/
private static Command getMoveTimeElementsCommand(OccurrenceSpecification movedOccurrenceSpecification1, OccurrenceSpecification movedOccurrenceSpecification2, int yLocation1, int yLocation2, LifelineEditPart lifelinePart, List<EditPart> notToMoveEditParts) {
@@ -304,30 +305,30 @@ public class OccurrenceSpecificationMoveHelper {
CompoundCommand globalCmd = new CompoundCommand();
IFigure lifelineFigure = lifelinePart.getFigure();
// relocate each linked time element contained within the lifeline part
- for(Object lifelineChild : lifelinePart.getChildren()) {
- if(lifelineChild instanceof IBorderItemEditPart && !notToMoveEditParts.contains(lifelineChild)) {
- final IBorderItemEditPart timePart = (IBorderItemEditPart)lifelineChild;
+ for (Object lifelineChild : lifelinePart.getChildren()) {
+ if (lifelineChild instanceof IBorderItemEditPart && !notToMoveEditParts.contains(lifelineChild)) {
+ final IBorderItemEditPart timePart = (IBorderItemEditPart) lifelineChild;
Command cmd = getMoveSingleTimeRelatedElementCommand(timePart, movedOccurrenceSpecification1, movedOccurrenceSpecification2, yLocation1, yLocation2, lifelinePart);
- if(cmd != null) {
+ if (cmd != null) {
globalCmd.add(cmd);
}
}
}
// relocate each observation linked time element
- for(Object targetConnection : lifelinePart.getTargetConnections()) {
- if(targetConnection instanceof ObservationLinkEditPart) {
- Command cmd = getMoveSingleTimeRelatedElementCommand((ObservationLinkEditPart)targetConnection, movedOccurrenceSpecification1, movedOccurrenceSpecification2, yLocation1, yLocation2, lifelinePart);
- if(cmd != null) {
+ for (Object targetConnection : lifelinePart.getTargetConnections()) {
+ if (targetConnection instanceof ObservationLinkEditPart) {
+ Command cmd = getMoveSingleTimeRelatedElementCommand((ObservationLinkEditPart) targetConnection, movedOccurrenceSpecification1, movedOccurrenceSpecification2, yLocation1, yLocation2, lifelinePart);
+ if (cmd != null) {
globalCmd.add(cmd);
}
}
}
// refresh layout commands :
// one before the commands for the undo and one after for classic execution
- if(!globalCmd.isEmpty() && lifelineFigure instanceof BorderedNodeFigure) {
- Command relayout = getReLayoutCmd((BorderedNodeFigure)lifelineFigure, false);
- Command relayoutUndo = getReLayoutCmd((BorderedNodeFigure)lifelineFigure, true);
- if(relayout != null && relayoutUndo != null) {
+ if (!globalCmd.isEmpty() && lifelineFigure instanceof BorderedNodeFigure) {
+ Command relayout = getReLayoutCmd((BorderedNodeFigure) lifelineFigure, false);
+ Command relayoutUndo = getReLayoutCmd((BorderedNodeFigure) lifelineFigure, true);
+ if (relayout != null && relayoutUndo != null) {
CompoundCommand commandWithRelayout = new CompoundCommand();
commandWithRelayout.add(relayoutUndo);
commandWithRelayout.add(globalCmd);
@@ -336,14 +337,15 @@ public class OccurrenceSpecificationMoveHelper {
}
}
// return null rather than an empty non executable command
- if(globalCmd.isEmpty()) {
+ if (globalCmd.isEmpty()) {
return null;
}
return globalCmd;
}
- private static Command getMoveSingleTimeRelatedElementCommand(final ObservationLinkEditPart targetConnection, final OccurrenceSpecification movedOccurrenceSpecification1, final OccurrenceSpecification movedOccurrenceSpecification2, final int yLocation1, final int yLocation2, final LifelineEditPart lifelinePart) {
- AbstractTransactionalCommand updateTargetAnchorCommand = new AbstractTransactionalCommand(((IGraphicalEditPart)targetConnection).getEditingDomain(), "update target anchor", null) {
+ private static Command getMoveSingleTimeRelatedElementCommand(final ObservationLinkEditPart targetConnection, final OccurrenceSpecification movedOccurrenceSpecification1, final OccurrenceSpecification movedOccurrenceSpecification2, final int yLocation1,
+ final int yLocation2, final LifelineEditPart lifelinePart) {
+ AbstractTransactionalCommand updateTargetAnchorCommand = new AbstractTransactionalCommand(((IGraphicalEditPart) targetConnection).getEditingDomain(), "update target anchor", null) {
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
@@ -352,31 +354,31 @@ public class OccurrenceSpecificationMoveHelper {
Point referencePoint2 = getReferencePoint(lifelinePart, movedOccurrenceSpecification2, yLocation2);
int position1 = PositionConstants.NONE;
int position2 = PositionConstants.NONE;
- TimeObservationLabelEditPart tolEP = (TimeObservationLabelEditPart)targetConnection.getSource();
- if(tolEP == null) {
+ TimeObservationLabelEditPart tolEP = (TimeObservationLabelEditPart) targetConnection.getSource();
+ if (tolEP == null) {
return CommandResult.newCancelledCommandResult();
}
- if(movedOccurrenceSpecification1 != null) {
+ if (movedOccurrenceSpecification1 != null) {
position1 = SequenceUtil.positionWhereEventIsLinkedToPart(movedOccurrenceSpecification1, tolEP);
}
- if(movedOccurrenceSpecification2 != null) {
+ if (movedOccurrenceSpecification2 != null) {
position2 = SequenceUtil.positionWhereEventIsLinkedToPart(movedOccurrenceSpecification2, tolEP);
}
ConnectionAnchor targetAnchor = null;
- if(position1 == PositionConstants.CENTER) {
+ if (position1 == PositionConstants.CENTER) {
targetAnchor = LifelineEditPartUtil.getNodeFigure(lifelinePart).getSourceConnectionAnchorAt(referencePoint1);
- } else if(position2 == PositionConstants.CENTER) {
+ } else if (position2 == PositionConstants.CENTER) {
targetAnchor = LifelineEditPartUtil.getNodeFigure(lifelinePart).getSourceConnectionAnchorAt(referencePoint2);
}
- if(targetAnchor != null) {
+ if (targetAnchor != null) {
String newTargetTerminal = lifelinePart.mapConnectionAnchorToTerminal(targetAnchor);
- ConnectorImpl c = (ConnectorImpl)targetConnection.getModel();
- if(newTargetTerminal != null) {
- if(newTargetTerminal.length() == 0) {
+ ConnectorImpl c = (ConnectorImpl) targetConnection.getModel();
+ if (newTargetTerminal != null) {
+ if (newTargetTerminal.length() == 0) {
c.setTargetAnchor(null);
} else {
- IdentityAnchor a = (IdentityAnchor)c.getTargetAnchor();
- if(a == null) {
+ IdentityAnchor a = (IdentityAnchor) c.getTargetAnchor();
+ if (a == null) {
a = NotationFactory.eINSTANCE.createIdentityAnchor();
}
a.setId(newTargetTerminal);
@@ -394,35 +396,36 @@ public class OccurrenceSpecificationMoveHelper {
/**
* Get a command to move the time related element's edit part
- *
+ *
* @param timePart
- * time related element's edit part to move
+ * time related element's edit part to move
* @param movedOccurrenceSpecification1
- * first moved occurrence specification
+ * first moved occurrence specification
* @param movedOccurrenceSpecification2
- * second moved occurrence specification (or null)
+ * second moved occurrence specification (or null)
* @param yLocation1
- * y location where first occurrence specification is moved
+ * y location where first occurrence specification is moved
* @param yLocation2
- * y location where second occurrence specification is moved (or -1)
+ * y location where second occurrence specification is moved (or -1)
* @param lifelinePart
- * lifeline edit part containing the moved element
+ * lifeline edit part containing the moved element
* @return
*/
- private static Command getMoveSingleTimeRelatedElementCommand(IBorderItemEditPart timePart, OccurrenceSpecification movedOccurrenceSpecification1, OccurrenceSpecification movedOccurrenceSpecification2, int yLocation1, int yLocation2, LifelineEditPart lifelinePart) {
+ private static Command getMoveSingleTimeRelatedElementCommand(IBorderItemEditPart timePart, OccurrenceSpecification movedOccurrenceSpecification1, OccurrenceSpecification movedOccurrenceSpecification2, int yLocation1, int yLocation2,
+ LifelineEditPart lifelinePart) {
IFigure lifelineFigure = lifelinePart.getFigure();
// get positions where edit part is attached to events
int position1 = PositionConstants.NONE;
int position2 = PositionConstants.NONE;
- if(movedOccurrenceSpecification1 != null) {
+ if (movedOccurrenceSpecification1 != null) {
position1 = SequenceUtil.positionWhereEventIsLinkedToPart(movedOccurrenceSpecification1, timePart);
}
- if(movedOccurrenceSpecification2 != null) {
+ if (movedOccurrenceSpecification2 != null) {
position2 = SequenceUtil.positionWhereEventIsLinkedToPart(movedOccurrenceSpecification2, timePart);
}
// move necessary bounds
Rectangle newBounds = null;
- if(position1 != PositionConstants.NONE && position2 != PositionConstants.NONE) {
+ if (position1 != PositionConstants.NONE && position2 != PositionConstants.NONE) {
// both bounds may have changed
Point referencePoint1 = getReferencePoint(lifelinePart, movedOccurrenceSpecification1, yLocation1);
Point referencePoint2 = getReferencePoint(lifelinePart, movedOccurrenceSpecification2, yLocation2);
@@ -432,80 +435,80 @@ public class OccurrenceSpecificationMoveHelper {
int oldY = timePart.getFigure().getBounds().getLocation().y - lifelineFigure.getBounds().getLocation().y;
int oldHeight = timePart.getFigure().getSize().height;
// Compute new bounds of the time element
- if(position1 == PositionConstants.CENTER || position2 == PositionConstants.CENTER) {
+ if (position1 == PositionConstants.CENTER || position2 == PositionConstants.CENTER) {
// should not happen, except if both events are merged at the same location
newBounds = new Rectangle(referencePoint1.x, referencePoint1.y - oldHeight / 2, -1, oldHeight);
} else {
int top = oldY;
int bottom = oldY + oldHeight;
// bound is based on two events. Recompute it according to moved event(s).
- if(position1 == PositionConstants.TOP) {
+ if (position1 == PositionConstants.TOP) {
top = referencePoint1.y;
- } else if(position1 == PositionConstants.BOTTOM) {
+ } else if (position1 == PositionConstants.BOTTOM) {
bottom = referencePoint1.y;
}
- if(position2 == PositionConstants.TOP) {
+ if (position2 == PositionConstants.TOP) {
top = referencePoint2.y;
- } else if(position2 == PositionConstants.BOTTOM) {
+ } else if (position2 == PositionConstants.BOTTOM) {
bottom = referencePoint2.y;
}
// top and bottom may have been inverted during the move.
// restore x position, fix time duration always move to east
- int viewX = (Integer)ViewUtil.getPropertyValue((View)timePart.getModel(), NotationPackage.eINSTANCE.getLocation_X(), NotationPackage.eINSTANCE.getLocation_X().getEContainingClass());
+ int viewX = (Integer) ViewUtil.getPropertyValue((View) timePart.getModel(), NotationPackage.eINSTANCE.getLocation_X(), NotationPackage.eINSTANCE.getLocation_X().getEContainingClass());
newBounds = new Rectangle(viewX, Math.min(top, bottom), -1, Math.abs(bottom - top));
- // newBounds = new Rectangle(referencePoint1.x, Math.min(top, bottom), -1, Math.abs(bottom - top));
+ // newBounds = new Rectangle(referencePoint1.x, Math.min(top, bottom), -1, Math.abs(bottom - top));
}
- } else if(position1 != PositionConstants.NONE) {
+ } else if (position1 != PositionConstants.NONE) {
Point referencePoint1 = getReferencePoint(lifelinePart, movedOccurrenceSpecification1, yLocation1);
makeRelativeToLifeline(referencePoint1, lifelinePart, false);
// Get old bounds information by consulting old figure
int oldY = timePart.getFigure().getBounds().getLocation().y - lifelineFigure.getBounds().getLocation().y;
int oldHeight = timePart.getFigure().getSize().height;
// Compute new bounds of the time element
- if(position1 == PositionConstants.CENTER) {
+ if (position1 == PositionConstants.CENTER) {
newBounds = new Rectangle(referencePoint1.x, referencePoint1.y - oldHeight / 2, -1, oldHeight);
} else {
int top = oldY;
int bottom = oldY + oldHeight;
// bound is based on two events. Recompute it according to moved event(s).
- if(position1 == PositionConstants.TOP) {
+ if (position1 == PositionConstants.TOP) {
top = referencePoint1.y;
- } else if(position1 == PositionConstants.BOTTOM) {
+ } else if (position1 == PositionConstants.BOTTOM) {
bottom = referencePoint1.y;
}
// top and bottom may have been inverted during the move.
newBounds = new Rectangle(referencePoint1.x, Math.min(top, bottom), -1, Math.abs(bottom - top));
}
- } else if(position2 != PositionConstants.NONE) {
+ } else if (position2 != PositionConstants.NONE) {
Point referencePoint2 = getReferencePoint(lifelinePart, movedOccurrenceSpecification2, yLocation2);
makeRelativeToLifeline(referencePoint2, lifelinePart, false);
// Get old bounds information by consulting old figure
int oldY = timePart.getFigure().getBounds().getLocation().y - lifelineFigure.getBounds().getLocation().y;
int oldHeight = timePart.getFigure().getSize().height;
// Compute new bounds of the time element
- if(position2 == PositionConstants.CENTER) {
+ if (position2 == PositionConstants.CENTER) {
newBounds = new Rectangle(referencePoint2.x, referencePoint2.y - oldHeight / 2, -1, oldHeight);
} else {
int top = oldY;
int bottom = oldY + oldHeight;
// bound is based on two events. Recompute it according to moved event(s).
- if(position2 == PositionConstants.TOP) {
+ if (position2 == PositionConstants.TOP) {
top = referencePoint2.y;
- } else if(position2 == PositionConstants.BOTTOM) {
+ } else if (position2 == PositionConstants.BOTTOM) {
bottom = referencePoint2.y;
}
// top and bottom may have been inverted during the move.
newBounds = new Rectangle(referencePoint2.x, Math.min(top, bottom), -1, Math.abs(bottom - top));
}
}
- if(newBounds != null) {
+ if (newBounds != null) {
TransactionalEditingDomain editingDomain = timePart.getEditingDomain();
- if(timePart instanceof CustomDurationConstraintEditPart) {
- CustomDurationConstraintEditPart dcep = (CustomDurationConstraintEditPart)timePart;
+ if (timePart instanceof CustomDurationConstraintEditPart) {
+ CustomDurationConstraintEditPart dcep = (CustomDurationConstraintEditPart) timePart;
newBounds = dcep.updateMoveBounds(newBounds);
}
// return the resize command
- ICommandProxy resize = new ICommandProxy(new SetBoundsCommand(editingDomain, DiagramUIMessages.SetLocationCommand_Label_Resize, new EObjectAdapter((View)timePart.getModel()), newBounds));
+ ICommandProxy resize = new ICommandProxy(new SetBoundsCommand(editingDomain, DiagramUIMessages.SetLocationCommand_Label_Resize, new EObjectAdapter((View) timePart.getModel()), newBounds));
return resize;
}
return null;
@@ -513,15 +516,15 @@ public class OccurrenceSpecificationMoveHelper {
/**
* Make an absolute point relative to a lifeline figure.
- *
+ *
* @param absolutePoint
- * the absolute point to translate
+ * the absolute point to translate
* @param lifelinePart
- * the containing lifeline edit part
+ * the containing lifeline edit part
*/
private static void makeRelativeToLifeline(Point absolutePoint, LifelineEditPart lifelinePart, boolean relativeToContentPane) {
IFigure figure;
- if(relativeToContentPane) {
+ if (relativeToContentPane) {
figure = lifelinePart.getContentPane();
} else {
figure = lifelinePart.getFigure();
@@ -532,47 +535,48 @@ public class OccurrenceSpecificationMoveHelper {
/**
* Get the command to move execution specification(s) attached to moved occurrence specification(s)
- *
+ *
* @param movedOccurrenceSpecification1
- * first moved occurrence specification
+ * first moved occurrence specification
* @param movedOccurrenceSpecification2
- * second moved occurrence specification (or null)
+ * second moved occurrence specification (or null)
* @param yLocation1
- * y location where first occurrence specification is moved
+ * y location where first occurrence specification is moved
* @param yLocation2
- * y location where second occurrence specification is moved (or -1)
+ * y location where second occurrence specification is moved (or -1)
* @param lifelinePart
- * lifeline edit part containing the moved element
+ * lifeline edit part containing the moved element
* @param notToMoveEditParts
- * list of edit parts which must not be moved in the created command
+ * list of edit parts which must not be moved in the created command
* @return command to move execution specification edit part linked to the occurrence specification or null
*/
- private static Command getMoveExecutionSpecificationCommand(OccurrenceSpecification movedOccurrenceSpecification1, OccurrenceSpecification movedOccurrenceSpecification2, int yLocation1, int yLocation2, LifelineEditPart lifelinePart, List<EditPart> notToMoveEditParts) {
+ private static Command getMoveExecutionSpecificationCommand(OccurrenceSpecification movedOccurrenceSpecification1, OccurrenceSpecification movedOccurrenceSpecification2, int yLocation1, int yLocation2, LifelineEditPart lifelinePart,
+ List<EditPart> notToMoveEditParts) {
// the global command which shall be completed and returned
CompoundCommand globalCmd = new CompoundCommand();
// execution(s) linked to the event must be resized
EditPart node1 = null;
- if(movedOccurrenceSpecification1 != null) {
+ if (movedOccurrenceSpecification1 != null) {
node1 = SequenceUtil.getLinkedEditPart(lifelinePart, movedOccurrenceSpecification1);
}
EditPart node2 = null;
- if(movedOccurrenceSpecification2 != null) {
+ if (movedOccurrenceSpecification2 != null) {
node2 = SequenceUtil.getLinkedEditPart(lifelinePart, movedOccurrenceSpecification2);
}
- if(node1 instanceof GraphicalEditPart && !notToMoveEditParts.contains(node1)) {
- Command cmd = getMoveSingleExecutionSpecificationCommand((GraphicalEditPart)node1, movedOccurrenceSpecification1, movedOccurrenceSpecification2, yLocation1, yLocation2, lifelinePart);
- if(cmd != null) {
+ if (node1 instanceof GraphicalEditPart && !notToMoveEditParts.contains(node1)) {
+ Command cmd = getMoveSingleExecutionSpecificationCommand((GraphicalEditPart) node1, movedOccurrenceSpecification1, movedOccurrenceSpecification2, yLocation1, yLocation2, lifelinePart);
+ if (cmd != null) {
globalCmd.add(cmd);
}
}
- if(node2 != node1 && node2 instanceof GraphicalEditPart && !notToMoveEditParts.contains(node2)) {
- Command cmd = getMoveSingleExecutionSpecificationCommand((GraphicalEditPart)node2, movedOccurrenceSpecification2, null, yLocation2, -1, lifelinePart);
- if(cmd != null) {
+ if (node2 != node1 && node2 instanceof GraphicalEditPart && !notToMoveEditParts.contains(node2)) {
+ Command cmd = getMoveSingleExecutionSpecificationCommand((GraphicalEditPart) node2, movedOccurrenceSpecification2, null, yLocation2, -1, lifelinePart);
+ if (cmd != null) {
globalCmd.add(cmd);
}
}
// return null rather than an empty non executable command
- if(globalCmd.isEmpty()) {
+ if (globalCmd.isEmpty()) {
return null;
}
return globalCmd;
@@ -580,45 +584,46 @@ public class OccurrenceSpecificationMoveHelper {
/**
* Get the command to move an execution specification attached to moved occurrence specification(s)
- *
+ *
* @param executionSpecificationPart
- * the execution specification edit part to move
+ * the execution specification edit part to move
* @param movedOccurrenceSpecification1
- * first moved occurrence specification
+ * first moved occurrence specification
* @param movedOccurrenceSpecification2
- * second moved occurrence specification (or null)
+ * second moved occurrence specification (or null)
* @param yLocation1
- * y location where first occurrence specification is moved
+ * y location where first occurrence specification is moved
* @param yLocation2
- * y location where second occurrence specification is moved (or -1)
+ * y location where second occurrence specification is moved (or -1)
* @param lifelinePart
- * lifeline edit part containing the moved element
+ * lifeline edit part containing the moved element
* @return command to move the execution specification edit part or null
*/
- private static Command getMoveSingleExecutionSpecificationCommand(GraphicalEditPart executionSpecificationPart, OccurrenceSpecification movedOccurrenceSpecification1, OccurrenceSpecification movedOccurrenceSpecification2, int yLocation1, int yLocation2, LifelineEditPart lifelinePart) {
+ private static Command getMoveSingleExecutionSpecificationCommand(GraphicalEditPart executionSpecificationPart, OccurrenceSpecification movedOccurrenceSpecification1, OccurrenceSpecification movedOccurrenceSpecification2, int yLocation1, int yLocation2,
+ LifelineEditPart lifelinePart) {
// execution linked to the event must be resized
EObject execution = executionSpecificationPart.resolveSemanticElement();
- if(execution instanceof ExecutionSpecification) {
+ if (execution instanceof ExecutionSpecification) {
// finish or start events of the execution have been moved
// get positions where execution edit part is attached to events
int position1 = PositionConstants.NONE;
int position2 = PositionConstants.NONE;
- OccurrenceSpecification start = ((ExecutionSpecification)execution).getStart();
- OccurrenceSpecification finish = ((ExecutionSpecification)execution).getFinish();
- if(start != null && start.equals(movedOccurrenceSpecification1)) {
+ OccurrenceSpecification start = ((ExecutionSpecification) execution).getStart();
+ OccurrenceSpecification finish = ((ExecutionSpecification) execution).getFinish();
+ if (start != null && start.equals(movedOccurrenceSpecification1)) {
position1 = PositionConstants.TOP;
- } else if(finish != null && finish.equals(movedOccurrenceSpecification1)) {
+ } else if (finish != null && finish.equals(movedOccurrenceSpecification1)) {
position1 = PositionConstants.BOTTOM;
}
- if(start != null && start.equals(movedOccurrenceSpecification2)) {
+ if (start != null && start.equals(movedOccurrenceSpecification2)) {
position2 = PositionConstants.TOP;
- } else if(finish != null && finish.equals(movedOccurrenceSpecification2)) {
+ } else if (finish != null && finish.equals(movedOccurrenceSpecification2)) {
position2 = PositionConstants.BOTTOM;
}
// move necessary bounds
Rectangle newBounds = null;
int heighDelta = 0;
- if(position1 != PositionConstants.NONE && position2 != PositionConstants.NONE) {
+ if (position1 != PositionConstants.NONE && position2 != PositionConstants.NONE) {
// both bounds have changed
Point referencePoint1 = getReferencePoint(lifelinePart, movedOccurrenceSpecification1, yLocation1);
Point referencePoint2 = getReferencePoint(lifelinePart, movedOccurrenceSpecification2, yLocation2);
@@ -637,19 +642,19 @@ public class OccurrenceSpecificationMoveHelper {
int top = oldY;
int bottom = oldY + oldHeight;
// bound is based on two events. Recompute it according to moved event(s).
- if(position1 == PositionConstants.TOP) {
+ if (position1 == PositionConstants.TOP) {
top = referencePoint1.y;
- } else if(position1 == PositionConstants.BOTTOM) {
+ } else if (position1 == PositionConstants.BOTTOM) {
bottom = referencePoint1.y;
}
- if(position2 == PositionConstants.TOP) {
+ if (position2 == PositionConstants.TOP) {
top = referencePoint2.y;
- } else if(position2 == PositionConstants.BOTTOM) {
+ } else if (position2 == PositionConstants.BOTTOM) {
bottom = referencePoint2.y;
}
// top and bottom may have been inverted during the move.
newBounds = new Rectangle(oldX, Math.min(top, bottom), oldWidth, Math.abs(bottom - top));
- } else if(position1 != PositionConstants.NONE) {
+ } else if (position1 != PositionConstants.NONE) {
Point referencePoint1 = getReferencePoint(lifelinePart, movedOccurrenceSpecification1, yLocation1);
makeRelativeToLifeline(referencePoint1, lifelinePart, true);
// Get old bounds information by consulting old figure
@@ -665,14 +670,14 @@ public class OccurrenceSpecificationMoveHelper {
int top = oldY;
int bottom = oldY + oldHeight;
// bound is based on two events. Recompute it according to moved event(s).
- if(position1 == PositionConstants.TOP) {
+ if (position1 == PositionConstants.TOP) {
top = referencePoint1.y;
- } else if(position1 == PositionConstants.BOTTOM) {
+ } else if (position1 == PositionConstants.BOTTOM) {
bottom = referencePoint1.y;
}
// top and bottom may have been inverted during the move.
newBounds = new Rectangle(oldX, Math.min(top, bottom), oldWidth, Math.abs(bottom - top));
- } else if(position2 != PositionConstants.NONE) {
+ } else if (position2 != PositionConstants.NONE) {
Point referencePoint2 = getReferencePoint(lifelinePart, movedOccurrenceSpecification2, yLocation2);
makeRelativeToLifeline(referencePoint2, lifelinePart, true);
// Get old bounds information by consulting old figure
@@ -688,19 +693,19 @@ public class OccurrenceSpecificationMoveHelper {
int top = oldY;
int bottom = oldY + oldHeight;
// bound is based on two events. Recompute it according to moved event(s).
- if(position2 == PositionConstants.TOP) {
+ if (position2 == PositionConstants.TOP) {
top = referencePoint2.y;
- } else if(position2 == PositionConstants.BOTTOM) {
+ } else if (position2 == PositionConstants.BOTTOM) {
bottom = referencePoint2.y;
}
// top and bottom may have been inverted during the move.
newBounds = new Rectangle(oldX, Math.min(top, bottom), oldWidth, Math.abs(bottom - top));
}
- if(newBounds != null) {
+ if (newBounds != null) {
// adjust bounds for execution specification
newBounds.height -= heighDelta;
// return the resize command
- return getChangeBoundsCommand((AbstractExecutionSpecificationEditPart)executionSpecificationPart, newBounds);
+ return getChangeBoundsCommand((AbstractExecutionSpecificationEditPart) executionSpecificationPart, newBounds);
}
}
return null;
@@ -712,31 +717,31 @@ public class OccurrenceSpecificationMoveHelper {
private static Command getChangeBoundsCommand(AbstractExecutionSpecificationEditPart editPart, Rectangle newBounds) {
Rectangle oldBounds = SequenceUtil.getAbsoluteBounds(editPart);
Point location = oldBounds.getLocation();
- makeRelativeToLifeline(location, (LifelineEditPart)editPart.getParent(), true);
+ makeRelativeToLifeline(location, (LifelineEditPart) editPart.getParent(), true);
oldBounds.setLocation(location);
Point moveDelta = new Point(newBounds.x - oldBounds.x, newBounds.y - oldBounds.y);
ChangeBoundsRequest req = new ChangeBoundsRequest();
req.setMoveDelta(moveDelta);
req.setEditParts(editPart);
- //Make sure do not coming again to update duration constraints...
+ // Make sure do not coming again to update duration constraints...
req.getExtendedData().put(SequenceRequestConstant.DO_NOT_MOVE_EDIT_PARTS, true);
- return LifelineXYLayoutEditPolicy.getResizeOrMoveChildrenCommand((LifelineEditPart)editPart.getParent(), req, true, false, true);
+ return LifelineXYLayoutEditPolicy.getResizeOrMoveChildrenCommand((LifelineEditPart) editPart.getParent(), req, true, false, true);
}
/**
* Get the reference point to reconnect or resize edit parts at the given y location
- *
+ *
* @param lifelinePart
- * lifeline edit part containing the moved element
+ * lifeline edit part containing the moved element
* @param movedOccurrenceSpecification
- * the moving occurrence specification which a reference point is searched for
+ * the moving occurrence specification which a reference point is searched for
* @param yLocation
- * y location
+ * y location
* @return reference point on the lifeline
*/
private static Point getReferencePoint(LifelineEditPart lifelinePart, OccurrenceSpecification movedOccurrenceSpecification, int yLocation) {
Point referencePoint = SequenceUtil.findLocationOfEvent(lifelinePart, movedOccurrenceSpecification);
- if(referencePoint == null) {
+ if (referencePoint == null) {
referencePoint = lifelinePart.getFigure().getBounds().getCenter().getCopy();
}
referencePoint.y = yLocation;
@@ -745,17 +750,17 @@ public class OccurrenceSpecificationMoveHelper {
/**
* Chain the commands to move associated parts when a connection end is reconnected.
- *
+ *
* @param command
- * existing reconnection command
+ * existing reconnection command
* @param request
- * the reconnection request
+ * the reconnection request
* @param connectableNode
- * the node edit part connected to the moved connection
+ * the node edit part connected to the moved connection
* @return the completed command
*/
public static Command completeReconnectConnectionCommand(Command command, ReconnectRequest request, INodeEditPart connectableNode) {
- if(chainEffectIsDisabled(request)) {
+ if (chainEffectIsDisabled(request)) {
return command;
}
CompoundCommand globalCmd = new CompoundCommand();
@@ -765,16 +770,16 @@ public class OccurrenceSpecificationMoveHelper {
// move time related elements linked with the event
LifelineEditPart lifelinePart = SequenceUtil.getParentLifelinePart(connectableNode);
MessageEnd event = getMessageEndFromReconnectMessage(request);
- if(event instanceof OccurrenceSpecification) {
- Command cmd = getMoveOccurrenceSpecificationsCommand((OccurrenceSpecification)event, null, request.getLocation().y, -1, lifelinePart, notToMoveEditParts);
- if(cmd != null) {
+ if (event instanceof OccurrenceSpecification) {
+ Command cmd = getMoveOccurrenceSpecificationsCommand((OccurrenceSpecification) event, null, request.getLocation().y, -1, lifelinePart, notToMoveEditParts);
+ if (cmd != null) {
globalCmd.add(cmd);
}
}
OccurrenceSpecification event2 = getOccurrenceSpecificationFromReconnectGeneralOrdering(request);
- if(event2 instanceof OccurrenceSpecification) {
+ if (event2 instanceof OccurrenceSpecification) {
Command cmd = getMoveOccurrenceSpecificationsCommand(event2, null, request.getLocation().y, -1, lifelinePart, notToMoveEditParts);
- if(cmd != null) {
+ if (cmd != null) {
globalCmd.add(cmd);
}
}
@@ -783,9 +788,9 @@ public class OccurrenceSpecificationMoveHelper {
/**
* Check if moving chain effect has been disabled to avoid an infinite loop.
- *
+ *
* @param request
- * the request wich initiated the move
+ * the request wich initiated the move
* @return true if no additional command must be performed.
*/
private static boolean chainEffectIsDisabled(Request request) {
@@ -795,24 +800,24 @@ public class OccurrenceSpecificationMoveHelper {
/**
* Complete a command to move time/duration constraints/observation which are linked to the moved edit part
- *
+ *
* @param compoundCmd
- * existing command to complete
+ * existing command to complete
* @param executionSpecificationEP
- * the moved edit part representing an execution specification
+ * the moved edit part representing an execution specification
* @param newBounds
- * the new part's bounds (relative to the figure's parent)
+ * the new part's bounds (relative to the figure's parent)
* @param request
- * the change bounds request which originated this move
+ * the change bounds request which originated this move
* @return the updated parameter compoundCmd for convenience
*/
public static CompoundCommand completeMoveExecutionSpecificationCommand(CompoundCommand compoundCmd, ShapeNodeEditPart executionSpecificationEP, Rectangle newBounds, ChangeBoundsRequest request) {
- if(chainEffectIsDisabled(request)) {
+ if (chainEffectIsDisabled(request)) {
return compoundCmd;
}
// Move events delimiting the ExecutionSpecification
EObject execSpec = executionSpecificationEP.resolveSemanticElement();
- if(execSpec instanceof ExecutionSpecification) {
+ if (execSpec instanceof ExecutionSpecification) {
LifelineEditPart lifelinePart = SequenceUtil.getParentLifelinePart(executionSpecificationEP);
// first, get absolute bounds
newBounds = newBounds.getCopy();
@@ -820,45 +825,45 @@ public class OccurrenceSpecificationMoveHelper {
parentFig.translateToAbsolute(newBounds);
newBounds.translate(parentFig.getBounds().getLocation());
// move start and finish events
- OccurrenceSpecification start = ((ExecutionSpecification)execSpec).getStart();
+ OccurrenceSpecification start = ((ExecutionSpecification) execSpec).getStart();
int startY = newBounds.getTop().y;
- OccurrenceSpecification finish = ((ExecutionSpecification)execSpec).getFinish();
+ OccurrenceSpecification finish = ((ExecutionSpecification) execSpec).getFinish();
int finishY = newBounds.getBottom().y;
List<EditPart> notToMoveEditParts = new ArrayList<EditPart>(1);
notToMoveEditParts.add(executionSpecificationEP);
- //Fixed bug for moving ExecutionSpecification, since fixed bug(https://bugs.eclipse.org/bugs/show_bug.cgi?id=402975)
- //The start and finish event may be a MessageOccurrenceSpecification, in case, we need ignore the message when moving.
- if(start instanceof MessageOccurrenceSpecification) {
+ // Fixed bug for moving ExecutionSpecification, since fixed bug(https://bugs.eclipse.org/bugs/show_bug.cgi?id=402975)
+ // The start and finish event may be a MessageOccurrenceSpecification, in case, we need ignore the message when moving.
+ if (start instanceof MessageOccurrenceSpecification) {
EditPart message = SequenceUtil.getLinkedEditPart(lifelinePart, start);
- if(message != null) {
+ if (message != null) {
notToMoveEditParts.add(message);
}
}
- if(finish instanceof MessageOccurrenceSpecification) {
+ if (finish instanceof MessageOccurrenceSpecification) {
EditPart message = SequenceUtil.getLinkedEditPart(lifelinePart, finish);
- if(message != null) {
+ if (message != null) {
notToMoveEditParts.add(message);
}
}
Command cmd = getMoveOccurrenceSpecificationsCommand(start, finish, startY, finishY, lifelinePart, notToMoveEditParts);
- if(cmd != null) {
+ if (cmd != null) {
compoundCmd.add(cmd);
}
- // if(request.getSizeDelta().height == 0) {
- // // move time elements for events between start and finish
- // InteractionFragment nextOccSpec = InteractionFragmentHelper.findNextFragment(start, start.eContainer());
- // while(nextOccSpec != null && nextOccSpec != finish) {
- // Point occSpecLocation = SequenceUtil.findLocationOfEvent(lifelinePart, nextOccSpec);
- // if(nextOccSpec instanceof OccurrenceSpecification && occSpecLocation != null) {
- // int occSpecY = occSpecLocation.y + request.getMoveDelta().y;
- // cmd = getMoveTimeElementsCommand((OccurrenceSpecification)nextOccSpec, null, occSpecY, -1, lifelinePart, notToMoveEditParts);
- // if(cmd != null) {
- // compoundCmd.add(cmd);
- // }
- // }
- // nextOccSpec = InteractionFragmentHelper.findNextFragment(nextOccSpec, start.eContainer());
- // }
- // }
+ // if(request.getSizeDelta().height == 0) {
+ // // move time elements for events between start and finish
+ // InteractionFragment nextOccSpec = InteractionFragmentHelper.findNextFragment(start, start.eContainer());
+ // while(nextOccSpec != null && nextOccSpec != finish) {
+ // Point occSpecLocation = SequenceUtil.findLocationOfEvent(lifelinePart, nextOccSpec);
+ // if(nextOccSpec instanceof OccurrenceSpecification && occSpecLocation != null) {
+ // int occSpecY = occSpecLocation.y + request.getMoveDelta().y;
+ // cmd = getMoveTimeElementsCommand((OccurrenceSpecification)nextOccSpec, null, occSpecY, -1, lifelinePart, notToMoveEditParts);
+ // if(cmd != null) {
+ // compoundCmd.add(cmd);
+ // }
+ // }
+ // nextOccSpec = InteractionFragmentHelper.findNextFragment(nextOccSpec, start.eContainer());
+ // }
+ // }
}
return compoundCmd;
}
@@ -866,20 +871,20 @@ public class OccurrenceSpecificationMoveHelper {
/**
* Prepare a request which is supposed to move a time/duration constraints/observation edit part.
* The request will be updated if some operations are forbidden.
- *
+ *
* @param request
- * the move request
+ * the move request
* @param movedTimePart
- * the moved time/duration constraints/observation edit part.
+ * the moved time/duration constraints/observation edit part.
*/
public static void prepareTimeRelatedElementMoveRequest(ChangeBoundsRequest request, IBorderItemEditPart movedTimePart) {
// Erase the y move if element can not be moved on y axe
- if(!canTimeElementPartBeYMoved(movedTimePart)) {
+ if (!canTimeElementPartBeYMoved(movedTimePart)) {
request.getMoveDelta().y = 0;
} else {
- //move to one direction at once.
+ // move to one direction at once.
Point moveDelta = request.getMoveDelta();
- if(Math.abs(moveDelta.x) > Math.abs(moveDelta.y)) {
+ if (Math.abs(moveDelta.x) > Math.abs(moveDelta.y)) {
moveDelta.y = 0;
} else {
moveDelta.x = 0;
@@ -889,76 +894,76 @@ public class OccurrenceSpecificationMoveHelper {
/**
* Complete the command to move an edit part representing a time/duration constraints/observation.
- *
+ *
* @param moveCommand
- * the move command to complete with chaining
+ * the move command to complete with chaining
* @param request
- * the request which initiated the move
+ * the request which initiated the move
* @param hostFigure
- * figure which is being moved
+ * figure which is being moved
* @param hostEditPart
- * edit part which is being moved
+ * edit part which is being moved
* @return the complete command.
*/
public static Command completeMoveTimeRelatedElementCommand(Command moveCommand, ChangeBoundsRequest request, EditPart hostEditPart, IFigure hostFigure) {
- if(chainEffectIsDisabled(request)) {
+ if (chainEffectIsDisabled(request)) {
return moveCommand;
}
Rectangle bounds = request.getTransformedRectangle(hostFigure.getBounds());
hostFigure.getParent().translateToAbsolute(bounds);
LifelineEditPart lifelinePart = SequenceUtil.getParentLifelinePart(hostEditPart);
- if(lifelinePart != null && hostEditPart instanceof IBorderItemEditPart) {
- IBorderItemEditPart timeElementEditPart = (IBorderItemEditPart)hostEditPart;
+ if (lifelinePart != null && hostEditPart instanceof IBorderItemEditPart) {
+ IBorderItemEditPart timeElementEditPart = (IBorderItemEditPart) hostEditPart;
EObject timeElement = timeElementEditPart.resolveSemanticElement();
OccurrenceSpecification occSpec1 = null;
int yLocation1 = -1;
OccurrenceSpecification occSpec2 = null;
int yLocation2 = -1;
// find occurrence specifications of the time element
- if(timeElement instanceof TimeConstraint) {
- Iterator<Element> it = ((TimeConstraint)timeElement).getConstrainedElements().iterator();
- while(it.hasNext() && occSpec1 == null) {
+ if (timeElement instanceof TimeConstraint) {
+ Iterator<Element> it = ((TimeConstraint) timeElement).getConstrainedElements().iterator();
+ while (it.hasNext() && occSpec1 == null) {
Element elem = it.next();
- if(elem instanceof OccurrenceSpecification) {
- int position1 = whereEventIsLinked((OccurrenceSpecification)elem, timeElementEditPart);
- if(position1 != PositionConstants.NONE) {
- occSpec1 = (OccurrenceSpecification)elem;
+ if (elem instanceof OccurrenceSpecification) {
+ int position1 = whereEventIsLinked((OccurrenceSpecification) elem, timeElementEditPart);
+ if (position1 != PositionConstants.NONE) {
+ occSpec1 = (OccurrenceSpecification) elem;
yLocation1 = getLocation(bounds, position1).y;
}
}
}
- } else if(timeElement instanceof TimeObservation) {
- NamedElement event = ((TimeObservation)timeElement).getEvent();
- if(event instanceof OccurrenceSpecification) {
- int position1 = whereEventIsLinked((OccurrenceSpecification)event, timeElementEditPart);
- if(position1 != PositionConstants.NONE) {
- occSpec1 = (OccurrenceSpecification)event;
+ } else if (timeElement instanceof TimeObservation) {
+ NamedElement event = ((TimeObservation) timeElement).getEvent();
+ if (event instanceof OccurrenceSpecification) {
+ int position1 = whereEventIsLinked((OccurrenceSpecification) event, timeElementEditPart);
+ if (position1 != PositionConstants.NONE) {
+ occSpec1 = (OccurrenceSpecification) event;
yLocation1 = getLocation(bounds, position1).y;
}
}
- } else if(timeElement instanceof DurationConstraint) {
- Iterator<Element> it = ((DurationConstraint)timeElement).getConstrainedElements().iterator();
- while(it.hasNext() && (occSpec1 == null || occSpec2 == null)) {
+ } else if (timeElement instanceof DurationConstraint) {
+ Iterator<Element> it = ((DurationConstraint) timeElement).getConstrainedElements().iterator();
+ while (it.hasNext() && (occSpec1 == null || occSpec2 == null)) {
Element elem = it.next();
- if(elem instanceof OccurrenceSpecification && occSpec1 != null) {
- int position2 = whereEventIsLinked((OccurrenceSpecification)elem, timeElementEditPart);
- if(position2 != PositionConstants.NONE) {
- occSpec2 = (OccurrenceSpecification)elem;
+ if (elem instanceof OccurrenceSpecification && occSpec1 != null) {
+ int position2 = whereEventIsLinked((OccurrenceSpecification) elem, timeElementEditPart);
+ if (position2 != PositionConstants.NONE) {
+ occSpec2 = (OccurrenceSpecification) elem;
yLocation2 = getLocation(bounds, position2).y;
}
- } else if(elem instanceof OccurrenceSpecification) {
- int position1 = whereEventIsLinked((OccurrenceSpecification)elem, timeElementEditPart);
- if(position1 != PositionConstants.NONE) {
- occSpec1 = (OccurrenceSpecification)elem;
+ } else if (elem instanceof OccurrenceSpecification) {
+ int position1 = whereEventIsLinked((OccurrenceSpecification) elem, timeElementEditPart);
+ if (position1 != PositionConstants.NONE) {
+ occSpec1 = (OccurrenceSpecification) elem;
yLocation1 = getLocation(bounds, position1).y;
}
}
}
}
- if(occSpec1 != null) {
+ if (occSpec1 != null) {
List<EditPart> notToMoveEditParts = Collections.singletonList(hostEditPart);
Command cmd = getMoveOccurrenceSpecificationsCommand(occSpec1, occSpec2, yLocation1, yLocation2, lifelinePart, notToMoveEditParts);
- if(cmd != null) {
+ if (cmd != null) {
return moveCommand.chain(cmd);
}
}
@@ -968,15 +973,15 @@ public class OccurrenceSpecificationMoveHelper {
/**
* Make the request to reconnect the connection
- *
+ *
* @param connection
- * connection part
+ * connection part
* @param isSource
- * true if the source must be reconnect, false for target
+ * true if the source must be reconnect, false for target
* @param location
- * the location where to reconnect
+ * the location where to reconnect
* @param partToReconnectTo
- * the part which the connection must be reconnected to (or null if unknown or of no importance)
+ * the part which the connection must be reconnected to (or null if unknown or of no importance)
* @return the reconnection request
*/
@SuppressWarnings("unchecked")
@@ -984,14 +989,14 @@ public class OccurrenceSpecificationMoveHelper {
// Obtain the target edit part
EditPart targetEP = partToReconnectTo;
String type;
- if(isSource) {
+ if (isSource) {
type = RequestConstants.REQ_RECONNECT_SOURCE;
- if(targetEP == null) {
+ if (targetEP == null) {
targetEP = connection.getSource();
}
} else {
type = RequestConstants.REQ_RECONNECT_TARGET;
- if(targetEP == null) {
+ if (targetEP == null) {
targetEP = connection.getTarget();
}
}
@@ -1009,19 +1014,19 @@ public class OccurrenceSpecificationMoveHelper {
/**
* Get the location on the bounds
- *
+ *
* @param bounds
- * the rectangle bounds
+ * the rectangle bounds
* @param position
- * one of {@link PositionConstants#TOP}, {@link PositionConstants#CENTER}, {@link PositionConstants#BOTTOM}
+ * one of {@link PositionConstants#TOP}, {@link PositionConstants#CENTER}, {@link PositionConstants#BOTTOM}
* @return the point at the given position or null if position is incorrect
*/
private static Point getLocation(Rectangle bounds, int position) {
- if(position == PositionConstants.TOP) {
+ if (position == PositionConstants.TOP) {
return bounds.getTop();
- } else if(position == PositionConstants.CENTER) {
+ } else if (position == PositionConstants.CENTER) {
return bounds.getCenter();
- } else if(position == PositionConstants.BOTTOM) {
+ } else if (position == PositionConstants.BOTTOM) {
return bounds.getBottom();
}
return null;
@@ -1029,36 +1034,35 @@ public class OccurrenceSpecificationMoveHelper {
/**
* The position of the host where the event is linked
- *
+ *
* @param event
- * the occurrence specification
+ * the occurrence specification
* @param hostEditPart
- * the host edit part which is linked to the occurrence specification
- * @return one of {@link PositionConstants#TOP}, {@link PositionConstants#CENTER}, {@link PositionConstants#BOTTOM},
- * {@link PositionConstants#NONE}
+ * the host edit part which is linked to the occurrence specification
+ * @return one of {@link PositionConstants#TOP}, {@link PositionConstants#CENTER}, {@link PositionConstants#BOTTOM}, {@link PositionConstants#NONE}
*/
private static int whereEventIsLinked(OccurrenceSpecification event, EditPart hostEditPart) {
- if(hostEditPart instanceof IBorderItemEditPart) {
- return SequenceUtil.positionWhereEventIsLinkedToPart(event, (IBorderItemEditPart)hostEditPart);
+ if (hostEditPart instanceof IBorderItemEditPart) {
+ return SequenceUtil.positionWhereEventIsLinkedToPart(event, (IBorderItemEditPart) hostEditPart);
}
return PositionConstants.NONE;
}
/**
* Get the occurrence specification which correspond to the moved general ordering end
- *
+ *
* @param request
- * the general odering reconnection request
+ * the general odering reconnection request
* @return moved OccurrenceSpecification or null
*/
private static OccurrenceSpecification getOccurrenceSpecificationFromReconnectGeneralOrdering(ReconnectRequest request) {
- if(request.getConnectionEditPart() instanceof ConnectionEditPart) {
- EObject generalOrdering = ((ConnectionEditPart)request.getConnectionEditPart()).resolveSemanticElement();
- if(generalOrdering instanceof GeneralOrdering) {
- if(RequestConstants.REQ_RECONNECT_SOURCE.equals(request.getType())) {
- return ((GeneralOrdering)generalOrdering).getBefore();
- } else if(RequestConstants.REQ_RECONNECT_TARGET.equals(request.getType())) {
- return ((GeneralOrdering)generalOrdering).getAfter();
+ if (request.getConnectionEditPart() instanceof ConnectionEditPart) {
+ EObject generalOrdering = ((ConnectionEditPart) request.getConnectionEditPart()).resolveSemanticElement();
+ if (generalOrdering instanceof GeneralOrdering) {
+ if (RequestConstants.REQ_RECONNECT_SOURCE.equals(request.getType())) {
+ return ((GeneralOrdering) generalOrdering).getBefore();
+ } else if (RequestConstants.REQ_RECONNECT_TARGET.equals(request.getType())) {
+ return ((GeneralOrdering) generalOrdering).getAfter();
}
}
}
@@ -1067,19 +1071,19 @@ public class OccurrenceSpecificationMoveHelper {
/**
* Get the message end which correspond to the moved message end
- *
+ *
* @param request
- * the message reconnection request
+ * the message reconnection request
* @return moved MessageEnd or null
*/
private static MessageEnd getMessageEndFromReconnectMessage(ReconnectRequest request) {
- if(request.getConnectionEditPart() instanceof ConnectionEditPart) {
- EObject message = ((ConnectionEditPart)request.getConnectionEditPart()).resolveSemanticElement();
- if(message instanceof Message) {
- if(RequestConstants.REQ_RECONNECT_SOURCE.equals(request.getType())) {
- return ((Message)message).getSendEvent();
- } else if(RequestConstants.REQ_RECONNECT_TARGET.equals(request.getType())) {
- return ((Message)message).getReceiveEvent();
+ if (request.getConnectionEditPart() instanceof ConnectionEditPart) {
+ EObject message = ((ConnectionEditPart) request.getConnectionEditPart()).resolveSemanticElement();
+ if (message instanceof Message) {
+ if (RequestConstants.REQ_RECONNECT_SOURCE.equals(request.getType())) {
+ return ((Message) message).getSendEvent();
+ } else if (RequestConstants.REQ_RECONNECT_TARGET.equals(request.getType())) {
+ return ((Message) message).getReceiveEvent();
}
}
}
@@ -1089,23 +1093,23 @@ public class OccurrenceSpecificationMoveHelper {
/**
* Know whether this time element part can be moved within the lifeline or not.
* Parts linked with a destruction event can not be moved since the destruction event is always at the end.
- *
+ *
* @param timeElementPart
- * the part representing a time/duration constraint/observation
+ * the part representing a time/duration constraint/observation
* @return true if the part can be moved
*/
public static boolean canTimeElementPartBeYMoved(IBorderItemEditPart timeElementPart) {
EObject timeElement = timeElementPart.resolveSemanticElement();
List<? extends Element> occurrences = Collections.emptyList();
- if(timeElement instanceof TimeObservation) {
- NamedElement occurence = ((TimeObservation)timeElement).getEvent();
+ if (timeElement instanceof TimeObservation) {
+ NamedElement occurence = ((TimeObservation) timeElement).getEvent();
occurrences = Collections.singletonList(occurence);
- } else if(timeElement instanceof TimeConstraint || timeElement instanceof DurationConstraint) {
- occurrences = ((IntervalConstraint)timeElement).getConstrainedElements();
+ } else if (timeElement instanceof TimeConstraint || timeElement instanceof DurationConstraint) {
+ occurrences = ((IntervalConstraint) timeElement).getConstrainedElements();
}
// check whether one of the time occurrences correspond to a DestructionEvent
- for(Element occurrence : occurrences) {
- if(occurrence instanceof DestructionOccurrenceSpecification) {
+ for (Element occurrence : occurrences) {
+ if (occurrence instanceof DestructionOccurrenceSpecification) {
return false;
}
}
@@ -1114,17 +1118,17 @@ public class OccurrenceSpecificationMoveHelper {
/**
* Get a command which refreshes the bordered layout of the node.
- *
+ *
* @param node
- * the node figure with bordered items (including time-related parts)
+ * the node figure with bordered items (including time-related parts)
* @param onUndo
- * if true the relayout will be done on undo only, if false it will be done on classic execute only
+ * if true the relayout will be done on undo only, if false it will be done on classic execute only
* @return the refresh command
*/
private static Command getReLayoutCmd(BorderedNodeFigure node, boolean onUndo) {
// relayout the border container figure so that time elements are refreshed
final IFigure container = node.getBorderItemContainer();
- if(onUndo) {
+ if (onUndo) {
return new Command() {
@Override
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/OperandBoundsComputeHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/OperandBoundsComputeHelper.java
index 3ae225e36c3..d9b8b405fe4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/OperandBoundsComputeHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/OperandBoundsComputeHelper.java
@@ -107,16 +107,16 @@ public class OperandBoundsComputeHelper {
/**
* Find first Interaction Operand EditpPart of CombinedFragmentCombinedFragmentCompartmentEditPart
- *
+ *
* @param compartEP
* @return InteractionOperandEditPart
*/
public static InteractionOperandEditPart findFirstIOEP(CombinedFragmentCombinedFragmentCompartmentEditPart compartEP) {
InteractionOperandEditPart firstIOEP = null;
List children = compartEP.getChildren();
- for(int i = 0; i < children.size(); i++) {
- if(children.get(i) instanceof InteractionOperandEditPart) {
- firstIOEP = (InteractionOperandEditPart)children.get(i);
+ for (int i = 0; i < children.size(); i++) {
+ if (children.get(i) instanceof InteractionOperandEditPart) {
+ firstIOEP = (InteractionOperandEditPart) children.get(i);
break;
}
}
@@ -125,16 +125,16 @@ public class OperandBoundsComputeHelper {
/**
* Find Last Interaction Operand EditpPart of CombinedFragmentCombinedFragmentCompartmentEditPart
- *
+ *
* @param compartEP
* @return InteractionOperandEditPart
*/
public static InteractionOperandEditPart findLastIOEP(CombinedFragmentCombinedFragmentCompartmentEditPart compartEP) {
InteractionOperandEditPart lastIOEP = null;
List children = compartEP.getChildren();
- for(int i = children.size() - 1; i >= 0; i--) {
- if(children.get(i) instanceof InteractionOperandEditPart) {
- lastIOEP = (InteractionOperandEditPart)children.get(i);
+ for (int i = children.size() - 1; i >= 0; i--) {
+ if (children.get(i) instanceof InteractionOperandEditPart) {
+ lastIOEP = (InteractionOperandEditPart) children.get(i);
break;
}
}
@@ -143,7 +143,7 @@ public class OperandBoundsComputeHelper {
/**
* Find Previous Interaction Operand EditpPart of current given InteractionOperandEditPart
- *
+ *
* @param compartEP
* @param currentIOEP
* @return InteractionOperandEditPart
@@ -151,12 +151,12 @@ public class OperandBoundsComputeHelper {
public static InteractionOperandEditPart findPreviousIOEP(CombinedFragmentCombinedFragmentCompartmentEditPart compartEP, InteractionOperandEditPart currentIOEP) {
InteractionOperandEditPart previousIOEP = null;
List children = compartEP.getChildren();
- for(int i = 0; i < children.size() - 1; i++) {
- if(children.get(i) instanceof InteractionOperandEditPart) {
- if(children.get(i) == currentIOEP) {
+ for (int i = 0; i < children.size() - 1; i++) {
+ if (children.get(i) instanceof InteractionOperandEditPart) {
+ if (children.get(i) == currentIOEP) {
break;
} else {
- previousIOEP = (InteractionOperandEditPart)children.get(i);
+ previousIOEP = (InteractionOperandEditPart) children.get(i);
}
}
}
@@ -165,7 +165,7 @@ public class OperandBoundsComputeHelper {
/**
* Find Latter Interaction Operand EditpPart of current given InteractionOperandEditPart
- *
+ *
* @param compartEP
* @param currentIOEP
* @return InteractionOperandEditPart
@@ -173,12 +173,12 @@ public class OperandBoundsComputeHelper {
public static InteractionOperandEditPart findLatterIOEP(CombinedFragmentCombinedFragmentCompartmentEditPart compartEP, InteractionOperandEditPart currentIOEP) {
InteractionOperandEditPart latterIOEP = null;
List children = compartEP.getChildren();
- for(int i = children.size() - 1; i > 0; i--) {
- if(children.get(i) instanceof InteractionOperandEditPart) {
- if(children.get(i) == currentIOEP) {
+ for (int i = children.size() - 1; i > 0; i--) {
+ if (children.get(i) instanceof InteractionOperandEditPart) {
+ if (children.get(i) == currentIOEP) {
break;
} else {
- latterIOEP = (InteractionOperandEditPart)children.get(i);
+ latterIOEP = (InteractionOperandEditPart) children.get(i);
}
}
}
@@ -187,15 +187,15 @@ public class OperandBoundsComputeHelper {
/**
* Update EditPart bounds using new rect
- *
+ *
* @param parent
* @param rect
*/
public static void updateEditPartBounds(GraphicalEditPart editpart, final Rectangle rect) {
- if(editpart.getModel() instanceof Node) {
- Node node = (Node)editpart.getModel();
- if(node.getLayoutConstraint() instanceof Bounds) {
- Bounds bounds = (Bounds)node.getLayoutConstraint();
+ if (editpart.getModel() instanceof Node) {
+ Node node = (Node) editpart.getModel();
+ if (node.getLayoutConstraint() instanceof Bounds) {
+ Bounds bounds = (Bounds) node.getLayoutConstraint();
updateBounds(bounds, rect, editpart.getEditingDomain());
}
}
@@ -203,7 +203,7 @@ public class OperandBoundsComputeHelper {
/**
* Update EditPart bounds using new rect
- *
+ *
* @param parent
* @param rect
*/
@@ -212,10 +212,10 @@ public class OperandBoundsComputeHelper {
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(editpart.getModel() instanceof Node) {
- Node node = (Node)editpart.getModel();
- if(node.getLayoutConstraint() instanceof Bounds) {
- Bounds bounds = (Bounds)node.getLayoutConstraint();
+ if (editpart.getModel() instanceof Node) {
+ Node node = (Node) editpart.getModel();
+ if (node.getLayoutConstraint() instanceof Bounds) {
+ Bounds bounds = (Bounds) node.getLayoutConstraint();
fillBounds(bounds, rect);
}
}
@@ -227,21 +227,21 @@ public class OperandBoundsComputeHelper {
/**
* Create command for updating Interaction Operand EditpPart bounds after the CombinedFragment to be created.
- *
+ *
* @param editPart
* @param request
* @return ICommand
*/
public static ICommand createUpdateCFAndIOBoundsForCFCreationCommand(final EditPart editPart, final CreateViewRequest request) {
- if(!(editPart instanceof GraphicalEditPart)) {
+ if (!(editPart instanceof GraphicalEditPart)) {
return null;
}
- GraphicalEditPart graphicalEditPart = (GraphicalEditPart)editPart;
+ GraphicalEditPart graphicalEditPart = (GraphicalEditPart) editPart;
ICommand cmd = new AbstractTransactionalCommand(graphicalEditPart.getEditingDomain(), "Create update operand bounds command", null) {
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- OperandBoundsComputeHelper.updateCFAndIOBoundsForCFCreation((GraphicalEditPart)editPart, request);
+ OperandBoundsComputeHelper.updateCFAndIOBoundsForCFCreation((GraphicalEditPart) editPart, request);
return CommandResult.newOKCommandResult();
}
};
@@ -250,28 +250,28 @@ public class OperandBoundsComputeHelper {
/**
* Update Interaction Operand EditpPart bounds after the CombinedFragment to be created.
- *
+ *
* @param parent
* @param request
* @param selectionRect
*/
private static void updateCFAndIOBoundsForCFCreation(GraphicalEditPart parent, CreateViewRequest request) {
Object subEditPart = null;
- if(parent instanceof InteractionInteractionCompartmentEditPart) {
- InteractionInteractionCompartmentEditPart interactionInteractionCompartmentEditPart = (InteractionInteractionCompartmentEditPart)parent;
+ if (parent instanceof InteractionInteractionCompartmentEditPart) {
+ InteractionInteractionCompartmentEditPart interactionInteractionCompartmentEditPart = (InteractionInteractionCompartmentEditPart) parent;
subEditPart = interactionInteractionCompartmentEditPart.getChildren().get(interactionInteractionCompartmentEditPart.getChildren().size() - 1);
- } else if(parent instanceof InteractionOperandEditPart) {
- InteractionOperandEditPart interactionOperandEditPart = (InteractionOperandEditPart)parent;
+ } else if (parent instanceof InteractionOperandEditPart) {
+ InteractionOperandEditPart interactionOperandEditPart = (InteractionOperandEditPart) parent;
subEditPart = interactionOperandEditPart.getChildren().get(interactionOperandEditPart.getChildren().size() - 1);
}
- if(subEditPart != null && subEditPart instanceof CombinedFragmentEditPart) {
- CombinedFragmentEditPart combinedFragmentEditPart = (CombinedFragmentEditPart)subEditPart;
+ if (subEditPart != null && subEditPart instanceof CombinedFragmentEditPart) {
+ CombinedFragmentEditPart combinedFragmentEditPart = (CombinedFragmentEditPart) subEditPart;
// set bounds for CombinedFragmentEditPart
Rectangle cfEPAbsoluteRect = null;
int labelContainerHeight = computeCombinedFragementHeaderHeight(combinedFragmentEditPart);
- Shape cfEPShape = (Shape)combinedFragmentEditPart.getModel();
- if(cfEPShape.getLayoutConstraint() instanceof Bounds) {
- if(request.getSize() == null) {
+ Shape cfEPShape = (Shape) combinedFragmentEditPart.getModel();
+ if (cfEPShape.getLayoutConstraint() instanceof Bounds) {
+ if (request.getSize() == null) {
Dimension cfEPDefaultSize = new Dimension();
cfEPDefaultSize.setWidth(DEFAULT_INTERACTION_OPERAND_WIDTH + COMBINED_FRAGMENT_FIGURE_BORDER * 2);
cfEPDefaultSize.setHeight(DEFAULT_INTERACTION_OPERAND_HEIGHT + labelContainerHeight + COMBINED_FRAGMENT_FIGURE_BORDER * 2);
@@ -281,14 +281,15 @@ public class OperandBoundsComputeHelper {
}
Rectangle cfEPRelativeRect = cfEPAbsoluteRect.getCopy();
combinedFragmentEditPart.getFigure().translateToRelative(cfEPRelativeRect);
- Bounds cfEPBounds = (Bounds)cfEPShape.getLayoutConstraint();
+ Bounds cfEPBounds = (Bounds) cfEPShape.getLayoutConstraint();
fillBounds(cfEPBounds, cfEPRelativeRect);
}
// set bounds for new added Operand
- InteractionOperandEditPart lastOperand = OperandBoundsComputeHelper.findLastIOEP((CombinedFragmentCombinedFragmentCompartmentEditPart)combinedFragmentEditPart.getChildBySemanticHint(UMLVisualIDRegistry.getType(CombinedFragmentCombinedFragmentCompartmentEditPart.VISUAL_ID)));
- Shape shape = (Shape)lastOperand.getModel();
- if(shape.getLayoutConstraint() instanceof Bounds) {
- Bounds bounds = (Bounds)shape.getLayoutConstraint();
+ InteractionOperandEditPart lastOperand = OperandBoundsComputeHelper.findLastIOEP((CombinedFragmentCombinedFragmentCompartmentEditPart) combinedFragmentEditPart.getChildBySemanticHint(UMLVisualIDRegistry
+ .getType(CombinedFragmentCombinedFragmentCompartmentEditPart.VISUAL_ID)));
+ Shape shape = (Shape) lastOperand.getModel();
+ if (shape.getLayoutConstraint() instanceof Bounds) {
+ Bounds bounds = (Bounds) shape.getLayoutConstraint();
Rectangle rect = new Rectangle(bounds.getX(), bounds.getY(), cfEPAbsoluteRect.width() - COMBINED_FRAGMENT_FIGURE_BORDER * 2, cfEPAbsoluteRect.height() - labelContainerHeight - COMBINED_FRAGMENT_FIGURE_BORDER * 2);
fillBounds(bounds, rect);
}
@@ -297,69 +298,69 @@ public class OperandBoundsComputeHelper {
/**
* Create command for updating Interaction Operand EditpPart bounds after CombinedFragment to be resized.
- *
+ *
* @param compoundCmd
* @param request
* @param combinedFragmentEditPart
* @return Command
*/
public static Command createUpdateIOBoundsForCFResizeCommand(CompoundCommand compoundCmd, final ChangeBoundsRequest request, CombinedFragmentEditPart combinedFragmentEditPart) {
- if(combinedFragmentEditPart.getChildren().size() > 0 && combinedFragmentEditPart.getChildren().get(0) instanceof CombinedFragmentCombinedFragmentCompartmentEditPart) {
- CombinedFragmentCombinedFragmentCompartmentEditPart compartment = (CombinedFragmentCombinedFragmentCompartmentEditPart)combinedFragmentEditPart.getChildren().get(0);
- CombinedFragment cf = (CombinedFragment)combinedFragmentEditPart.resolveSemanticElement();
+ if (combinedFragmentEditPart.getChildren().size() > 0 && combinedFragmentEditPart.getChildren().get(0) instanceof CombinedFragmentCombinedFragmentCompartmentEditPart) {
+ CombinedFragmentCombinedFragmentCompartmentEditPart compartment = (CombinedFragmentCombinedFragmentCompartmentEditPart) combinedFragmentEditPart.getChildren().get(0);
+ CombinedFragment cf = (CombinedFragment) combinedFragmentEditPart.resolveSemanticElement();
InteractionOperandEditPart targetIOEP = null;
- if((request.getResizeDirection() & PositionConstants.NORTH) != 0) {
+ if ((request.getResizeDirection() & PositionConstants.NORTH) != 0) {
targetIOEP = findFirstIOEP(compartment);
- } else if((request.getResizeDirection() & PositionConstants.SOUTH) != 0) {
+ } else if ((request.getResizeDirection() & PositionConstants.SOUTH) != 0) {
targetIOEP = findLastIOEP(compartment);
}
- updateIOBoundsForCFResize(request, compoundCmd, compartment.getChildren(), cf, targetIOEP != null ? (InteractionOperand)targetIOEP.resolveSemanticElement() : null, request.getSizeDelta(), request.getResizeDirection());
- if(targetIOEP != null && request.getSizeDelta().height != 0) {
+ updateIOBoundsForCFResize(request, compoundCmd, compartment.getChildren(), cf, targetIOEP != null ? (InteractionOperand) targetIOEP.resolveSemanticElement() : null, request.getSizeDelta(), request.getResizeDirection());
+ if (targetIOEP != null && request.getSizeDelta().height != 0) {
int heightDelta = request.getSizeDelta().height;
int movedY = heightDelta;
Bounds bounds = getInteractionOperandEPBounds(targetIOEP);
Rectangle currentIOEPRect = OperandBoundsComputeHelper.fillRectangle(bounds);
- if((request.getResizeDirection() & PositionConstants.NORTH) != 0) {
+ if ((request.getResizeDirection() & PositionConstants.NORTH) != 0) {
movedY = -heightDelta;
currentIOEPRect.setY(currentIOEPRect.y() - heightDelta);
- } else if((request.getResizeDirection() & PositionConstants.SOUTH) != 0) {
+ } else if ((request.getResizeDirection() & PositionConstants.SOUTH) != 0) {
}
currentIOEPRect.setHeight(bounds.getHeight() + heightDelta);
int minHeight = getMinimumHeightFor(targetIOEP);
- if(currentIOEPRect.height < minHeight) {
+ if (currentIOEPRect.height < minHeight) {
compoundCmd.add(UnexecutableCommand.INSTANCE);
return UnexecutableCommand.INSTANCE;
} else {
Command shiftEnclosedExecutions = getShiftEnclosedFragmentsCommand(targetIOEP, currentIOEPRect, movedY);
- if(shiftEnclosedExecutions != null) {
+ if (shiftEnclosedExecutions != null) {
compoundCmd.add(shiftEnclosedExecutions);
}
}
}
}
- //Append command for expand covered Lifelines when moving CombinedFragment.
+ // Append command for expand covered Lifelines when moving CombinedFragment.
Point moveDelta = request.getMoveDelta();
- //Update also happens with resize.
+ // Update also happens with resize.
Dimension sizeDelta = request.getSizeDelta();
- if(moveDelta.y > 0 || sizeDelta.height > 0) {
- if(combinedFragmentEditPart.getModel() instanceof Node) {
- Node node = (Node)combinedFragmentEditPart.getModel();
- if(node.getLayoutConstraint() instanceof Bounds) {
- Bounds containerBounds = (Bounds)node.getLayoutConstraint();
+ if (moveDelta.y > 0 || sizeDelta.height > 0) {
+ if (combinedFragmentEditPart.getModel() instanceof Node) {
+ Node node = (Node) combinedFragmentEditPart.getModel();
+ if (node.getLayoutConstraint() instanceof Bounds) {
+ Bounds containerBounds = (Bounds) node.getLayoutConstraint();
Dimension preferredSize = combinedFragmentEditPart.getFigure().getPreferredSize();
int width = containerBounds.getWidth() != -1 ? containerBounds.getWidth() : preferredSize.width();
int height = containerBounds.getHeight() != -1 ? containerBounds.getHeight() : preferredSize.height();
int x = containerBounds.getX();
int y = containerBounds.getY();
- if(moveDelta.y > 0) {
+ if (moveDelta.y > 0) {
y += moveDelta.y;
}
- if(sizeDelta.height > 0) {
+ if (sizeDelta.height > 0) {
height += sizeDelta.height;
}
Rectangle newBounds = new Rectangle(x, y, width, height);
ICommand command = getExpandCoveredsCommand(combinedFragmentEditPart, newBounds);
- if(command != null && command.canExecute()) {
+ if (command != null && command.canExecute()) {
compoundCmd.add(new ICommandProxy(command));
}
}
@@ -370,7 +371,7 @@ public class OperandBoundsComputeHelper {
/**
* Update Interaction Operand EditpPart bounds after CombinedFragment to be resized.
- *
+ *
* @param request
* @param compoundCmd
* @param combinedFragmentChildrenEditParts
@@ -381,14 +382,14 @@ public class OperandBoundsComputeHelper {
*/
private static void updateIOBoundsForCFResize(final ChangeBoundsRequest request, CompoundCommand compoundCmd, List<EditPart> combinedFragmentChildrenEditParts, CombinedFragment cf, InteractionOperand targetOperand, final Dimension sizeDelta, int direction) {
InteractionOperandEditPart targetOperandEditPart = findTargetOperandEditPart(cf, targetOperand, combinedFragmentChildrenEditParts);
- for(EditPart ep : combinedFragmentChildrenEditParts) {
- if(ep instanceof InteractionOperandEditPart) {
- InteractionOperandEditPart ioEP = (InteractionOperandEditPart)ep;
+ for (EditPart ep : combinedFragmentChildrenEditParts) {
+ if (ep instanceof InteractionOperandEditPart) {
+ InteractionOperandEditPart ioEP = (InteractionOperandEditPart) ep;
Object ioEPModel = ioEP.getModel();
- if(ioEPModel instanceof Shape) {
- Shape ioEPShape = (Shape)ioEPModel;
- if(ioEPShape.getLayoutConstraint() instanceof Bounds) {
- final Bounds ioEPOriginalBounds = (Bounds)ioEPShape.getLayoutConstraint();
+ if (ioEPModel instanceof Shape) {
+ Shape ioEPShape = (Shape) ioEPModel;
+ if (ioEPShape.getLayoutConstraint() instanceof Bounds) {
+ final Bounds ioEPOriginalBounds = (Bounds) ioEPShape.getLayoutConstraint();
ICommand cmd = new UpdateIOBoundsForCFResizeCommand(ioEP.getEditingDomain(), "Update operand bounds interaction command", ioEPOriginalBounds, request, sizeDelta, ioEP == targetOperandEditPart, direction);
compoundCmd.add(new ICommandProxy(cmd));
}
@@ -399,13 +400,13 @@ public class OperandBoundsComputeHelper {
/**
* Update bounds using new rect
- *
+ *
* @param bounds
* @param rect
* @param transactionalEditingDomain
*/
public static void updateBounds(final Bounds bounds, final Rectangle rect, TransactionalEditingDomain transactionalEditingDomain) {
- if(bounds != null) {
+ if (bounds != null) {
final Rectangle originalBounds = new Rectangle();
originalBounds.setX(bounds.getX());
originalBounds.setY(bounds.getY());
@@ -418,10 +419,12 @@ public class OperandBoundsComputeHelper {
return true;
}
+ @Override
public void execute() {
exec(rect);
}
+ @Override
public void redo() {
execute();
}
@@ -446,22 +449,22 @@ public class OperandBoundsComputeHelper {
/**
* Get InteractionOperandEditPart from its model object InteractionOperand.
- *
+ *
* @param cf
* @param targetOperand
* @param combinedFragmentChildrenEditParts
* @return InteractionOperandEditPart
*/
public static InteractionOperandEditPart findTargetOperandEditPart(CombinedFragment cf, InteractionOperand targetOperand, List<EditPart> combinedFragmentChildrenEditParts) {
- if(targetOperand == null) {
+ if (targetOperand == null) {
return null;
}
- for(EditPart ep : combinedFragmentChildrenEditParts) {
- if(ep instanceof InteractionOperandEditPart) {
- InteractionOperandEditPart ioEP = (InteractionOperandEditPart)ep;
+ for (EditPart ep : combinedFragmentChildrenEditParts) {
+ if (ep instanceof InteractionOperandEditPart) {
+ InteractionOperandEditPart ioEP = (InteractionOperandEditPart) ep;
EObject io = ioEP.resolveSemanticElement();
- if(cf.getOperands().contains(io)) {
- if(targetOperand.equals(io)) {
+ if (cf.getOperands().contains(io)) {
+ if (targetOperand.equals(io)) {
return ioEP;
}
}
@@ -472,15 +475,15 @@ public class OperandBoundsComputeHelper {
/**
* Get graphical edit part bounds
- *
+ *
* @param editPart
* @return
*/
public static Bounds getEditPartBounds(GraphicalEditPart editPart) {
- if(editPart.getModel() instanceof Node) {
- Node node = (Node)editPart.getModel();
- if(node.getLayoutConstraint() instanceof Bounds) {
- Bounds bounds = (Bounds)node.getLayoutConstraint();
+ if (editPart.getModel() instanceof Node) {
+ Node node = (Node) editPart.getModel();
+ if (node.getLayoutConstraint() instanceof Bounds) {
+ Bounds bounds = (Bounds) node.getLayoutConstraint();
return bounds;
}
}
@@ -489,12 +492,12 @@ public class OperandBoundsComputeHelper {
/**
* Fill data from Bounds to Rectangle
- *
+ *
* @param source
* @return Rectangle
*/
public static Rectangle fillRectangle(Bounds source) {
- if(source == null) {
+ if (source == null) {
return null;
}
Rectangle target = new Rectangle();
@@ -507,13 +510,13 @@ public class OperandBoundsComputeHelper {
/**
* Fill data from Rectangle to Bounds
- *
+ *
* @param bounds
* @param source
* @return Bounds
*/
public static Bounds fillBounds(Bounds bounds, Rectangle source) {
- if(bounds == null || source == null) {
+ if (bounds == null || source == null) {
return null;
}
bounds.setX(source.x());
@@ -525,16 +528,16 @@ public class OperandBoundsComputeHelper {
/**
* Get interaction operand bounds
- *
+ *
* @param operandEP
* @return Bounds
*/
public static Bounds getInteractionOperandEPBounds(GraphicalEditPart operandEP) {
Object lastChildModel = operandEP.getModel();
- if(lastChildModel instanceof Shape) {
- Shape lastOperandShape = (Shape)lastChildModel;
- if(lastOperandShape.getLayoutConstraint() instanceof Bounds) {
- return (Bounds)lastOperandShape.getLayoutConstraint();
+ if (lastChildModel instanceof Shape) {
+ Shape lastOperandShape = (Shape) lastChildModel;
+ if (lastOperandShape.getLayoutConstraint() instanceof Bounds) {
+ return (Bounds) lastOperandShape.getLayoutConstraint();
}
}
return null;
@@ -542,7 +545,7 @@ public class OperandBoundsComputeHelper {
/**
* Create interaction operand resize command
- *
+ *
* @param currentIOEP
* @param heightDelta
* @param compartEP
@@ -551,55 +554,55 @@ public class OperandBoundsComputeHelper {
*/
public static Command createIOEPResizeCommand(InteractionOperandEditPart currentIOEP, int heightDelta, CombinedFragmentCombinedFragmentCompartmentEditPart compartEP, int direction) {
Bounds currentIOEPBounds = OperandBoundsComputeHelper.getEditPartBounds(currentIOEP);
- if(currentIOEPBounds == null) {
+ if (currentIOEPBounds == null) {
return null;
}
InteractionOperandEditPart targetIOEP = null;
- if((direction & PositionConstants.NORTH) != 0) {
+ if ((direction & PositionConstants.NORTH) != 0) {
targetIOEP = OperandBoundsComputeHelper.findPreviousIOEP(compartEP, currentIOEP);
- } else if((direction & PositionConstants.SOUTH) != 0) {
+ } else if ((direction & PositionConstants.SOUTH) != 0) {
targetIOEP = OperandBoundsComputeHelper.findLatterIOEP(compartEP, currentIOEP);
}
CompositeCommand compositeCommand = new CompositeCommand("Resize Operand");
// if last operand
- if(targetIOEP == null) {
- if(heightDelta < 0) {
- if(currentIOEPBounds.getHeight() - Math.abs(heightDelta) < OperandBoundsComputeHelper.MIN_INTERACTION_OPERAND_HEIGHT) {
+ if (targetIOEP == null) {
+ if (heightDelta < 0) {
+ if (currentIOEPBounds.getHeight() - Math.abs(heightDelta) < OperandBoundsComputeHelper.MIN_INTERACTION_OPERAND_HEIGHT) {
return null;
}
}
Rectangle currentIOEPRect = OperandBoundsComputeHelper.fillRectangle(currentIOEPBounds);
currentIOEPRect.setHeight(currentIOEPBounds.getHeight() + heightDelta);
int minHeight = getMinimumHeightFor(currentIOEP);
- if(currentIOEPRect.height < minHeight) {
+ if (currentIOEPRect.height < minHeight) {
return UnexecutableCommand.INSTANCE;
}
ICommand currentIOEPCommand = OperandBoundsComputeHelper.createUpdateEditPartBoundsCommand(currentIOEP, currentIOEPRect);
compositeCommand.add(currentIOEPCommand);
Command shiftPreviousExecutions = getShiftEnclosedFragmentsCommand(currentIOEP, currentIOEPRect, heightDelta);
- if(shiftPreviousExecutions != null) {
+ if (shiftPreviousExecutions != null) {
compositeCommand.add(new EMFtoGMFCommandWrapper(new GEFtoEMFCommandWrapper(shiftPreviousExecutions)));
}
// auto update CombinedFragmentEditPart bounds after resize the last operand
- if(compartEP.getParent() instanceof CombinedFragmentEditPart) {
- CombinedFragmentEditPart parent = (CombinedFragmentEditPart)compartEP.getParent();
- if(parent.getModel() instanceof Node) {
- Node node = (Node)parent.getModel();
- if(node.getLayoutConstraint() instanceof Bounds) {
- Bounds containerBounds = (Bounds)node.getLayoutConstraint();
+ if (compartEP.getParent() instanceof CombinedFragmentEditPart) {
+ CombinedFragmentEditPart parent = (CombinedFragmentEditPart) compartEP.getParent();
+ if (parent.getModel() instanceof Node) {
+ Node node = (Node) parent.getModel();
+ if (node.getLayoutConstraint() instanceof Bounds) {
+ Bounds containerBounds = (Bounds) node.getLayoutConstraint();
Dimension preferredSize = parent.getFigure().getPreferredSize();
int width = containerBounds.getWidth() != -1 ? containerBounds.getWidth() : preferredSize.width();
int height = containerBounds.getHeight() != -1 ? containerBounds.getHeight() : preferredSize.height();
height = height + heightDelta;
Rectangle containerRect = new Rectangle(containerBounds.getX(), containerBounds.getY(), width, height);
compositeCommand.add(OperandBoundsComputeHelper.createUpdateEditPartBoundsCommand(parent, containerRect));
- //Preserve Message anchors.
+ // Preserve Message anchors.
ICommand preserveMessageAnchorsCommand = MessageAnchorRepairer.createPreserveMessageAnchorsCommand(parent, heightDelta);
- if(preserveMessageAnchorsCommand != null && preserveMessageAnchorsCommand.canExecute()) {
+ if (preserveMessageAnchorsCommand != null && preserveMessageAnchorsCommand.canExecute()) {
compositeCommand.add(preserveMessageAnchorsCommand);
}
- ICommand expandCoveredsCommand = getExpandCoveredsCommand((CombinedFragmentEditPart)compartEP.getParent(), containerRect);
- if(expandCoveredsCommand != null) {
+ ICommand expandCoveredsCommand = getExpandCoveredsCommand((CombinedFragmentEditPart) compartEP.getParent(), containerRect);
+ if (expandCoveredsCommand != null) {
compositeCommand.add(expandCoveredsCommand);
}
}
@@ -607,15 +610,15 @@ public class OperandBoundsComputeHelper {
}
} else {
Bounds targetIOEPBounds = OperandBoundsComputeHelper.getEditPartBounds(targetIOEP);
- if(targetIOEPBounds == null) {
+ if (targetIOEPBounds == null) {
return null;
}
- if(heightDelta > 0) {
- if(targetIOEPBounds.getHeight() - heightDelta < OperandBoundsComputeHelper.MIN_INTERACTION_OPERAND_HEIGHT) {
+ if (heightDelta > 0) {
+ if (targetIOEPBounds.getHeight() - heightDelta < OperandBoundsComputeHelper.MIN_INTERACTION_OPERAND_HEIGHT) {
return null;
}
} else {
- if(currentIOEPBounds.getHeight() - Math.abs(heightDelta) < OperandBoundsComputeHelper.MIN_INTERACTION_OPERAND_HEIGHT) {
+ if (currentIOEPBounds.getHeight() - Math.abs(heightDelta) < OperandBoundsComputeHelper.MIN_INTERACTION_OPERAND_HEIGHT) {
return null;
}
}
@@ -624,34 +627,34 @@ public class OperandBoundsComputeHelper {
targetIOEPRect.setHeight(targetIOEPBounds.getHeight() - heightDelta);
currentIOEPRect.setHeight(currentIOEPBounds.getHeight() + heightDelta);
int shiftY = 0;
- if((direction & PositionConstants.NORTH) != 0) {
+ if ((direction & PositionConstants.NORTH) != 0) {
currentIOEPRect.setY(currentIOEPRect.y() - heightDelta);
shiftY = -heightDelta;
- } else if((direction & PositionConstants.SOUTH) != 0) {
+ } else if ((direction & PositionConstants.SOUTH) != 0) {
targetIOEPRect.setY(targetIOEPRect.y() + heightDelta);
shiftY = heightDelta;
}
int minHeightOfTargetOperand = getMinimumHeightFor(targetIOEP);
- if(targetIOEPRect.height < minHeightOfTargetOperand) {
+ if (targetIOEPRect.height < minHeightOfTargetOperand) {
return null;
}
ICommand previousIOEPCommand = OperandBoundsComputeHelper.createUpdateEditPartBoundsCommand(targetIOEP, targetIOEPRect);
compositeCommand.add(previousIOEPCommand);
- if((shiftY < 0 && targetIOEPRect.y < currentIOEPRect.y) || shiftY > 0 && (targetIOEPRect.y > currentIOEPRect.y)) {
+ if ((shiftY < 0 && targetIOEPRect.y < currentIOEPRect.y) || shiftY > 0 && (targetIOEPRect.y > currentIOEPRect.y)) {
Command shiftPreviousExecutions = getShiftEnclosedFragmentsCommand(targetIOEP, targetIOEPRect, shiftY);
- if(shiftPreviousExecutions != null) {
+ if (shiftPreviousExecutions != null) {
compositeCommand.add(new EMFtoGMFCommandWrapper(new GEFtoEMFCommandWrapper(shiftPreviousExecutions)));
}
}
int minHeughtOfCurrentOperand = getMinimumHeightFor(currentIOEP);
- if(currentIOEPRect.height < minHeughtOfCurrentOperand) {
+ if (currentIOEPRect.height < minHeughtOfCurrentOperand) {
return null;
}
ICommand currentIOEPCommand = OperandBoundsComputeHelper.createUpdateEditPartBoundsCommand(currentIOEP, currentIOEPRect);
compositeCommand.add(currentIOEPCommand);
- if((shiftY < 0 && currentIOEPRect.y < targetIOEPRect.y) || (shiftY > 0 && currentIOEPRect.y > targetIOEPRect.y)) {
+ if ((shiftY < 0 && currentIOEPRect.y < targetIOEPRect.y) || (shiftY > 0 && currentIOEPRect.y > targetIOEPRect.y)) {
Command shiftCurrentExecutions = getShiftEnclosedFragmentsCommand(currentIOEP, currentIOEPRect, shiftY);
- if(shiftCurrentExecutions != null) {
+ if (shiftCurrentExecutions != null) {
compositeCommand.add(new EMFtoGMFCommandWrapper(new GEFtoEMFCommandWrapper(shiftCurrentExecutions)));
}
}
@@ -660,47 +663,48 @@ public class OperandBoundsComputeHelper {
}
private static int getMinimumHeightFor(InteractionOperandEditPart operand) {
- if(operand == null) {
+ if (operand == null) {
return MIN_INTERACTION_OPERAND_HEIGHT;
}
List<OperandBlock> operandBlocks = getOperandBlocks(operand);
- if(!operandBlocks.isEmpty()) {
- //1. Sort with y location.
+ if (!operandBlocks.isEmpty()) {
+ // 1. Sort with y location.
Collections.sort(operandBlocks, new Comparator<OperandBlock>() {
+ @Override
public int compare(OperandBlock o1, OperandBlock o2) {
Rectangle r1 = o1.getBounds();
Rectangle r2 = o2.getBounds();
- if(r1.y < r2.y) {
+ if (r1.y < r2.y) {
return -1;
- } else if(r1.y > r2.y) {
+ } else if (r1.y > r2.y) {
return 1;
}
return 0;
}
});
- //2. Compute max area of all blocks, make sure all blocks will be contained in this area.
+ // 2. Compute max area of all blocks, make sure all blocks will be contained in this area.
Rectangle maxArea = null;
- for(OperandBlock blk : operandBlocks) {
+ for (OperandBlock blk : operandBlocks) {
Rectangle r = blk.getBounds();
- if(maxArea == null) {
+ if (maxArea == null) {
maxArea = r;
} else {
maxArea.union(r);
}
}
- //3. Compute min area for all blocks, this will remove all margins.
+ // 3. Compute min area for all blocks, this will remove all margins.
Map<OperandBlock, Rectangle> constraints = new HashMap<OperandBoundsComputeHelper.OperandBlock, Rectangle>();
OperandBlock topBlock = operandBlocks.get(0);
Rectangle minArea = new Rectangle(topBlock.getBounds());
- minArea.height += EXECUTION_VERTICAL_MARGIN;//margin
- for(int i = 1; i < operandBlocks.size(); i++) {
+ minArea.height += EXECUTION_VERTICAL_MARGIN;// margin
+ for (int i = 1; i < operandBlocks.size(); i++) {
OperandBlock nextBlock = operandBlocks.get(i);
Rectangle r = nextBlock.getBounds();
- if(!minArea.touches(r) && r.y > maxArea.y) {
- for(int y = r.y; y >= maxArea.y; y--) {
+ if (!minArea.touches(r) && r.y > maxArea.y) {
+ for (int y = r.y; y >= maxArea.y; y--) {
Rectangle movedRect = new Rectangle(r).setY(y);
- if(minArea.touches(movedRect)) {
+ if (minArea.touches(movedRect)) {
break;
} else {
constraints.put(nextBlock, movedRect);
@@ -708,11 +712,11 @@ public class OperandBoundsComputeHelper {
}
}
Rectangle newBounds = constraints.get(nextBlock);
- if(newBounds == null) {
+ if (newBounds == null) {
newBounds = r;
}
minArea.union(newBounds);
- minArea.height += EXECUTION_VERTICAL_MARGIN;//margin
+ minArea.height += EXECUTION_VERTICAL_MARGIN;// margin
}
return minArea.height;
}
@@ -721,7 +725,7 @@ public class OperandBoundsComputeHelper {
/**
* Once there are messages between two execution of a Operand, consider them as a group.
- *
+ *
* @param currentExecutionPart
* @param toCheckExecutions
* @return
@@ -729,25 +733,25 @@ public class OperandBoundsComputeHelper {
@SuppressWarnings({ "rawtypes", "unchecked" })
protected static Rectangle getExecutionGroupBounds(IGraphicalEditPart currentExecutionPart, List<ExecutionSpecification> toCheckExecutions) {
Rectangle groupRect = SequenceUtil.getAbsoluteBounds(currentExecutionPart);
- if(toCheckExecutions.isEmpty()) {
+ if (toCheckExecutions.isEmpty()) {
return groupRect;
}
List connections = new ArrayList();
connections.addAll(currentExecutionPart.getSourceConnections());
connections.addAll(currentExecutionPart.getTargetConnections());
- for(Object object : connections) {
- IGraphicalEditPart source = (IGraphicalEditPart)object;
- View model = (View)source.getModel();
+ for (Object object : connections) {
+ IGraphicalEditPart source = (IGraphicalEditPart) object;
+ View model = (View) source.getModel();
EObject element = model.getElement();
- if(toCheckExecutions.contains(element)) {
+ if (toCheckExecutions.contains(element)) {
List<ExecutionSpecification> myCheckingList = new ArrayList<ExecutionSpecification>(toCheckExecutions);
myCheckingList.remove(element);
Rectangle rect = getExecutionGroupBounds(source, myCheckingList);
groupRect.union(rect);
}
}
- List<ShapeNodeEditPart> affixedExecutionSpecificationEditParts = LifelineXYLayoutEditPolicy.getAffixedExecutionSpecificationEditParts((ShapeNodeEditPart)currentExecutionPart);
- for(ShapeNodeEditPart shapeNodeEditPart : affixedExecutionSpecificationEditParts) {
+ List<ShapeNodeEditPart> affixedExecutionSpecificationEditParts = LifelineXYLayoutEditPolicy.getAffixedExecutionSpecificationEditParts((ShapeNodeEditPart) currentExecutionPart);
+ for (ShapeNodeEditPart shapeNodeEditPart : affixedExecutionSpecificationEditParts) {
List<ExecutionSpecification> myCheckingList = new ArrayList<ExecutionSpecification>(toCheckExecutions);
myCheckingList.remove(shapeNodeEditPart);
Rectangle rect = getExecutionGroupBounds(shapeNodeEditPart, myCheckingList);
@@ -757,11 +761,11 @@ public class OperandBoundsComputeHelper {
}
public static Command getShiftEnclosedFragmentsCommand(InteractionOperandEditPart editPart, Rectangle newBounds, int movedY) {
- if(editPart == null || newBounds == null || movedY == 0) {
+ if (editPart == null || newBounds == null || movedY == 0) {
return null;
}
List<OperandBlock> operandBlocks = getOperandBlocks(editPart);
- if(operandBlocks.isEmpty()) {
+ if (operandBlocks.isEmpty()) {
return null;
}
OperandBlockLayout layout = new OperandBlockLayout(operandBlocks);
@@ -772,14 +776,14 @@ public class OperandBoundsComputeHelper {
layout.layout(newArea, movedY > 0 ? true : false);
final Map<OperandBlock, Integer> blockToMove = new HashMap<OperandBoundsComputeHelper.OperandBlock, Integer>();
- for(OperandBlock blk : operandBlocks) {
+ for (OperandBlock blk : operandBlocks) {
int moveDelta = layout.getMoveDelta(blk);
- if(moveDelta == 0) {
+ if (moveDelta == 0) {
continue;
}
blockToMove.put(blk, moveDelta);
}
- if(blockToMove.isEmpty()) {
+ if (blockToMove.isEmpty()) {
return null;
}
return new ICommandProxy(new MoveOperandBlockCommand(editPart.getEditingDomain(), blockToMove));
@@ -788,12 +792,12 @@ public class OperandBoundsComputeHelper {
private static ICommand getMoveAnchorCommand(int yDelta, Rectangle figureBounds, IdentityAnchor gmfAnchor) {
String oldTerminal = gmfAnchor.getId();
PrecisionPoint pp = BaseSlidableAnchor.parseTerminalString(oldTerminal);
- int yPos = (int)Math.round(figureBounds.height * pp.preciseY);
+ int yPos = (int) Math.round(figureBounds.height * pp.preciseY);
yPos += yDelta;
- pp.preciseY = (double)yPos / figureBounds.height;
- if(pp.preciseY > 1.0) {
+ pp.preciseY = (double) yPos / figureBounds.height;
+ if (pp.preciseY > 1.0) {
pp.preciseY = 1.0;
- } else if(pp.preciseY < 0.0) {
+ } else if (pp.preciseY < 0.0) {
pp.preciseY = 0.0;
}
String newTerminal = (new BaseSlidableAnchor(null, pp)).getTerminal();
@@ -802,14 +806,14 @@ public class OperandBoundsComputeHelper {
/**
* Compute CombinedFragement's header height
- *
+ *
* @param combinedFragmentEditPart
* @return int
*/
public static int computeCombinedFragementHeaderHeight(CombinedFragmentEditPart combinedFragmentEditPart) {
int headerHeight = 0;
IFigure labelContainer = combinedFragmentEditPart.getPrimaryShape().getHeaderContainer();
- if(labelContainer != null) {
+ if (labelContainer != null) {
headerHeight = labelContainer.getPreferredSize().height();
}
return headerHeight;
@@ -817,30 +821,30 @@ public class OperandBoundsComputeHelper {
/**
* Check if operation resizing on CombinedFragment is allowed
- *
+ *
* @param request
* @param child
* @return boolean
*/
public static boolean checkRedistrictOnCFResize(ChangeBoundsRequest request, EditPart child) {
- if(child instanceof CombinedFragmentEditPart) {
- if((request.getResizeDirection() & PositionConstants.NORTH_SOUTH) != 0) {
- CombinedFragmentEditPart combinedFragmentEditPart = (CombinedFragmentEditPart)child;
- if(combinedFragmentEditPart.getChildren().size() > 0 && combinedFragmentEditPart.getChildren().get(0) instanceof CombinedFragmentCombinedFragmentCompartmentEditPart) {
- CombinedFragmentCombinedFragmentCompartmentEditPart compartment = (CombinedFragmentCombinedFragmentCompartmentEditPart)combinedFragmentEditPart.getChildren().get(0);
+ if (child instanceof CombinedFragmentEditPart) {
+ if ((request.getResizeDirection() & PositionConstants.NORTH_SOUTH) != 0) {
+ CombinedFragmentEditPart combinedFragmentEditPart = (CombinedFragmentEditPart) child;
+ if (combinedFragmentEditPart.getChildren().size() > 0 && combinedFragmentEditPart.getChildren().get(0) instanceof CombinedFragmentCombinedFragmentCompartmentEditPart) {
+ CombinedFragmentCombinedFragmentCompartmentEditPart compartment = (CombinedFragmentCombinedFragmentCompartmentEditPart) combinedFragmentEditPart.getChildren().get(0);
List<EditPart> combinedFragmentChildrenEditParts = compartment.getChildren();
- CombinedFragment cf = (CombinedFragment)combinedFragmentEditPart.resolveSemanticElement();
+ CombinedFragment cf = (CombinedFragment) combinedFragmentEditPart.resolveSemanticElement();
InteractionOperand targetOperand = null;
- if((request.getResizeDirection() & PositionConstants.NORTH) != 0) {
+ if ((request.getResizeDirection() & PositionConstants.NORTH) != 0) {
targetOperand = cf.getOperands().get(0);
- } else if((request.getResizeDirection() & PositionConstants.SOUTH) != 0) {
+ } else if ((request.getResizeDirection() & PositionConstants.SOUTH) != 0) {
targetOperand = cf.getOperands().get(cf.getOperands().size() - 1);
}
InteractionOperandEditPart targetOperandEditPart = OperandBoundsComputeHelper.findTargetOperandEditPart(cf, targetOperand, combinedFragmentChildrenEditParts);
int heightDelta = request.getSizeDelta().height();
- if(targetOperandEditPart != null && heightDelta < 0) {
+ if (targetOperandEditPart != null && heightDelta < 0) {
int height = targetOperandEditPart.getFigure().getBounds().height();
- if(height - Math.abs(heightDelta) < OperandBoundsComputeHelper.MIN_INTERACTION_OPERAND_HEIGHT) {
+ if (height - Math.abs(heightDelta) < OperandBoundsComputeHelper.MIN_INTERACTION_OPERAND_HEIGHT) {
return false;
}
}
@@ -852,32 +856,32 @@ public class OperandBoundsComputeHelper {
/**
* Add command for updating adjacent interaction operand bounds after deleting a interaction operand
- *
+ *
* @param editPart
* @param cmd
*/
public static void addUpdateBoundsCommandForOperandDelelete(EditPart editPart, ICompositeCommand cmd) {
- if(editPart instanceof InteractionOperandEditPart) {
- if(editPart.getParent() instanceof CombinedFragmentCombinedFragmentCompartmentEditPart) {
- CombinedFragmentCombinedFragmentCompartmentEditPart compartment = (CombinedFragmentCombinedFragmentCompartmentEditPart)editPart.getParent();
- if(compartment.getParent() instanceof CombinedFragmentEditPart) {
+ if (editPart instanceof InteractionOperandEditPart) {
+ if (editPart.getParent() instanceof CombinedFragmentCombinedFragmentCompartmentEditPart) {
+ CombinedFragmentCombinedFragmentCompartmentEditPart compartment = (CombinedFragmentCombinedFragmentCompartmentEditPart) editPart.getParent();
+ if (compartment.getParent() instanceof CombinedFragmentEditPart) {
List<EditPart> combinedFragmentChildrenEditParts = compartment.getChildren();
InteractionOperandEditPart previousIOEP = null;
InteractionOperandEditPart latterIOEP = null;
boolean isFirstOperand = false;
- InteractionOperandEditPart currentioEP = (InteractionOperandEditPart)editPart;
+ InteractionOperandEditPart currentioEP = (InteractionOperandEditPart) editPart;
final Rectangle currentioEPBounds = currentioEP.getFigure().getBounds();
- for(int i = 0; i < combinedFragmentChildrenEditParts.size(); i++) {
+ for (int i = 0; i < combinedFragmentChildrenEditParts.size(); i++) {
EditPart ep = combinedFragmentChildrenEditParts.get(i);
- if(ep instanceof InteractionOperandEditPart) {
- InteractionOperandEditPart ioEP = (InteractionOperandEditPart)ep;
- if(currentioEP == ioEP) {
- if(previousIOEP != null) {
+ if (ep instanceof InteractionOperandEditPart) {
+ InteractionOperandEditPart ioEP = (InteractionOperandEditPart) ep;
+ if (currentioEP == ioEP) {
+ if (previousIOEP != null) {
Object previousIOEPModel = previousIOEP.getModel();
- if(previousIOEPModel instanceof Shape) {
- Shape previousIOEPShape = (Shape)previousIOEPModel;
- if(previousIOEPShape.getLayoutConstraint() instanceof Bounds) {
- final Bounds previousIOEPOriginalBounds = (Bounds)previousIOEPShape.getLayoutConstraint();
+ if (previousIOEPModel instanceof Shape) {
+ Shape previousIOEPShape = (Shape) previousIOEPModel;
+ if (previousIOEPShape.getLayoutConstraint() instanceof Bounds) {
+ final Bounds previousIOEPOriginalBounds = (Bounds) previousIOEPShape.getLayoutConstraint();
ICommand command = new AbstractTransactionalCommand(previousIOEP.getEditingDomain(), "Merge operand bounds command", null) {
@Override
@@ -897,18 +901,18 @@ public class OperandBoundsComputeHelper {
} else {
previousIOEP = ioEP;
}
- if(isFirstOperand) {
+ if (isFirstOperand) {
latterIOEP = ioEP;
break;
}
}
}
- if(isFirstOperand && latterIOEP != null) {
+ if (isFirstOperand && latterIOEP != null) {
Object latterIOEPModel = latterIOEP.getModel();
- if(latterIOEPModel instanceof Shape) {
- Shape latterIOEPShape = (Shape)latterIOEPModel;
- if(latterIOEPShape.getLayoutConstraint() instanceof Bounds) {
- final Bounds latterIOEPOriginalBounds = (Bounds)latterIOEPShape.getLayoutConstraint();
+ if (latterIOEPModel instanceof Shape) {
+ Shape latterIOEPShape = (Shape) latterIOEPModel;
+ if (latterIOEPShape.getLayoutConstraint() instanceof Bounds) {
+ final Bounds latterIOEPOriginalBounds = (Bounds) latterIOEPShape.getLayoutConstraint();
ICommand command = new AbstractTransactionalCommand(previousIOEP.getEditingDomain(), "Merge operand bounds command", null) {
@Override
@@ -929,44 +933,44 @@ public class OperandBoundsComputeHelper {
/**
* Add update InteractionOperand bounds command after IO is created
- *
+ *
* @param compartment
* @param request
* @param command
*/
public static void addUpdateBoundsForIOCreationCommand(CombinedFragmentCombinedFragmentCompartmentEditPart compartment, ViewDescriptor viewDescriptor, CompositeCommand command) {
List children = compartment.getChildren();
- if(children != null && children.size() > 0) {
+ if (children != null && children.size() > 0) {
InteractionOperandEditPart lastOperandEP = OperandBoundsComputeHelper.findLastIOEP(compartment);
// update bounds
- if(lastOperandEP != null) {
+ if (lastOperandEP != null) {
Bounds lastOperandBounds = OperandBoundsComputeHelper.getInteractionOperandEPBounds(lastOperandEP);
- if(lastOperandBounds != null) {
+ if (lastOperandBounds != null) {
Rectangle rect = new Rectangle(lastOperandBounds.getX(), lastOperandBounds.getY() + lastOperandBounds.getHeight(), lastOperandBounds.getWidth(), OperandBoundsComputeHelper.DEFAULT_INTERACTION_OPERAND_HEIGHT);
// auto update CombinedFragmentEditPart bounds after added new operand
- if(compartment.getParent() instanceof CombinedFragmentEditPart) {
- CombinedFragmentEditPart parent = (CombinedFragmentEditPart)compartment.getParent();
- if(parent.getModel() instanceof Node) {
- Node node = (Node)parent.getModel();
- if(node.getLayoutConstraint() instanceof Bounds) {
- Bounds containerBounds = (Bounds)node.getLayoutConstraint();
+ if (compartment.getParent() instanceof CombinedFragmentEditPart) {
+ CombinedFragmentEditPart parent = (CombinedFragmentEditPart) compartment.getParent();
+ if (parent.getModel() instanceof Node) {
+ Node node = (Node) parent.getModel();
+ if (node.getLayoutConstraint() instanceof Bounds) {
+ Bounds containerBounds = (Bounds) node.getLayoutConstraint();
Dimension preferredSize = parent.getFigure().getPreferredSize();
int width = containerBounds.getWidth() != -1 ? containerBounds.getWidth() : preferredSize.width();
int height = containerBounds.getHeight() != -1 ? containerBounds.getHeight() : preferredSize.height();
height = height + OperandBoundsComputeHelper.DEFAULT_INTERACTION_OPERAND_HEIGHT;
- View shapeView = (View)parent.getModel();
+ View shapeView = (View) parent.getModel();
Rectangle newBounds = new Rectangle(containerBounds.getX(), containerBounds.getY(), width, height);
ICommand setParentBoundsCmd = new SetBoundsCommand(compartment.getEditingDomain(), DiagramUIMessages.SetLocationCommand_Label_Resize, new EObjectAdapter(shapeView), newBounds);
command.add(setParentBoundsCmd);
- //Preserve Message anchors.
+ // Preserve Message anchors.
ICommand preserveMessageAnchorsCommand = MessageAnchorRepairer.createPreserveMessageAnchorsCommand(parent, OperandBoundsComputeHelper.DEFAULT_INTERACTION_OPERAND_HEIGHT);
- if(preserveMessageAnchorsCommand != null && preserveMessageAnchorsCommand.canExecute()) {
+ if (preserveMessageAnchorsCommand != null && preserveMessageAnchorsCommand.canExecute()) {
command.add(preserveMessageAnchorsCommand);
}
- CombinedFragment combinedFragment = (CombinedFragment)parent.resolveSemanticElement();
- if(!combinedFragment.getCovereds().isEmpty()) {
+ CombinedFragment combinedFragment = (CombinedFragment) parent.resolveSemanticElement();
+ if (!combinedFragment.getCovereds().isEmpty()) {
ICommand cmd = getExpandCoveredsCommand(parent, newBounds);
- if(cmd != null) {
+ if (cmd != null) {
command.add(cmd);
}
}
@@ -977,17 +981,18 @@ public class OperandBoundsComputeHelper {
}
}
} else { // first add operand
- if(compartment.getParent() instanceof CombinedFragmentEditPart) {
- CombinedFragmentEditPart parent = (CombinedFragmentEditPart)compartment.getParent();
- if(parent.getModel() instanceof Node) {
- Node node = (Node)parent.getModel();
- if(node.getLayoutConstraint() instanceof Bounds) {
- Bounds containerBounds = (Bounds)node.getLayoutConstraint();
+ if (compartment.getParent() instanceof CombinedFragmentEditPart) {
+ CombinedFragmentEditPart parent = (CombinedFragmentEditPart) compartment.getParent();
+ if (parent.getModel() instanceof Node) {
+ Node node = (Node) parent.getModel();
+ if (node.getLayoutConstraint() instanceof Bounds) {
+ Bounds containerBounds = (Bounds) node.getLayoutConstraint();
Dimension preferredSize = parent.getFigure().getPreferredSize();
int width = containerBounds.getWidth() != -1 ? containerBounds.getWidth() : preferredSize.width();
int height = containerBounds.getHeight() != -1 ? containerBounds.getHeight() : preferredSize.height();
height = height - computeCombinedFragementHeaderHeight(parent);
- command.add(new SetBoundsCommand(compartment.getEditingDomain(), DiagramUIMessages.SetLocationCommand_Label_Resize, viewDescriptor, new Rectangle(0, 0, width - COMBINED_FRAGMENT_FIGURE_BORDER * 2, height - COMBINED_FRAGMENT_FIGURE_BORDER * 2)));
+ command.add(new SetBoundsCommand(compartment.getEditingDomain(), DiagramUIMessages.SetLocationCommand_Label_Resize, viewDescriptor, new Rectangle(0, 0, width - COMBINED_FRAGMENT_FIGURE_BORDER * 2, height
+ - COMBINED_FRAGMENT_FIGURE_BORDER * 2)));
}
}
}
@@ -996,33 +1001,33 @@ public class OperandBoundsComputeHelper {
/**
* Expand Lifelines to new Bounds when adding InteractionOperands.
- *
+ *
* @param parent
* @param newBounds
* @return
*/
private static ICommand getExpandCoveredsCommand(CombinedFragmentEditPart parent, Rectangle newBounds) {
- CombinedFragment combinedFragment = (CombinedFragment)parent.resolveSemanticElement();
+ CombinedFragment combinedFragment = (CombinedFragment) parent.resolveSemanticElement();
CompositeCommand command = new CompositeCommand("Expand covered Lifeline by CombinedFragment");
EList<Lifeline> covereds = combinedFragment.getCovereds();
- for(Lifeline lifeline : covereds) {
+ for (Lifeline lifeline : covereds) {
Collection<Setting> settings = CacheAdapter.getInstance().getNonNavigableInverseReferences(lifeline);
- for(Setting ref : settings) {
- if(NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
- View view = (View)ref.getEObject();
+ for (Setting ref : settings) {
+ if (NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
+ View view = (View) ref.getEObject();
EditPart part = DiagramEditPartsUtil.getEditPartFromView(view, parent);
- if(view instanceof Node && part instanceof LifelineEditPart) {
- Bounds bounds = (Bounds)((Node)view).getLayoutConstraint();
+ if (view instanceof Node && part instanceof LifelineEditPart) {
+ Bounds bounds = (Bounds) ((Node) view).getLayoutConstraint();
Rectangle rect = new Rectangle(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight());
int height = newBounds.bottom() - rect.y;
- if(rect.height == -1) {
- rect.height = ((LifelineEditPart)part).getFigure().getPreferredSize().height;
+ if (rect.height == -1) {
+ rect.height = ((LifelineEditPart) part).getFigure().getPreferredSize().height;
}
- if(height > rect.height) {
+ if (height > rect.height) {
int heightDelta = height - rect.height;
rect.height = height;
command.add(new SetBoundsCommand(parent.getEditingDomain(), "Expand covered Lifeline by CombinedFragment", new EObjectAdapter(view), rect));
- command.add(MessageAnchorRepairer.createPreserveMessageAnchorsCommand((LifelineEditPart)part, heightDelta));
+ command.add(MessageAnchorRepairer.createPreserveMessageAnchorsCommand((LifelineEditPart) part, heightDelta));
}
break;
}
@@ -1034,16 +1039,16 @@ public class OperandBoundsComputeHelper {
/**
* Check if it is a combined fragment.
- *
+ *
* @param hint
- * the semantic hint
+ * the semantic hint
* @return
*/
public static boolean isDerivedCombinedFragment(String hint) {
- if(((IHintedType)UMLElementTypes.CombinedFragment_3004).getSemanticHint().equals(hint)) {
+ if (((IHintedType) UMLElementTypes.CombinedFragment_3004).getSemanticHint().equals(hint)) {
return true;
}
- if(((IHintedType)UMLElementTypes.ConsiderIgnoreFragment_3007).getSemanticHint().equals(hint)) {
+ if (((IHintedType) UMLElementTypes.ConsiderIgnoreFragment_3007).getSemanticHint().equals(hint)) {
return true;
}
return false;
@@ -1051,7 +1056,7 @@ public class OperandBoundsComputeHelper {
/**
* Command class for updating Interaction Operand EditpPart bounds after CombinedFragment to be resized.
- *
+ *
*/
private static final class UpdateIOBoundsForCFResizeCommand extends AbstractTransactionalCommand {
@@ -1076,12 +1081,12 @@ public class OperandBoundsComputeHelper {
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(updateHeight) {
+ if (updateHeight) {
ioEPOriginalBounds.setHeight(ioEPOriginalBounds.getHeight() + sizeDelta.height());
- } else if((direction & PositionConstants.NORTH) != 0) {
+ } else if ((direction & PositionConstants.NORTH) != 0) {
ioEPOriginalBounds.setY(ioEPOriginalBounds.getY() + sizeDelta.height());
}
- if((request.getResizeDirection() & PositionConstants.EAST_WEST) != 0) {
+ if ((request.getResizeDirection() & PositionConstants.EAST_WEST) != 0) {
ioEPOriginalBounds.setWidth(ioEPOriginalBounds.getWidth() + sizeDelta.width());
}
return CommandResult.newOKCommandResult();
@@ -1090,45 +1095,45 @@ public class OperandBoundsComputeHelper {
private static List<OperandBlock> getOperandBlocks(InteractionOperandEditPart editPart) {
List<OperandBlock> blocks = new ArrayList<OperandBoundsComputeHelper.OperandBlock>();
- if(editPart != null) {
- InteractionOperand interactionOperand = (InteractionOperand)editPart.resolveSemanticElement();
+ if (editPart != null) {
+ InteractionOperand interactionOperand = (InteractionOperand) editPart.resolveSemanticElement();
Set<ExecutionSpecification> executions = new HashSet<ExecutionSpecification>();
Set<Message> messages = new HashSet<Message>();
EList<InteractionFragment> fragments = interactionOperand.getFragments();
- for(InteractionFragment fragment : fragments) {
- if(fragment instanceof ExecutionSpecification) {
- executions.add((ExecutionSpecification)fragment);
- } else if(fragment instanceof ExecutionOccurrenceSpecification) {
- ExecutionSpecification execution = ((ExecutionOccurrenceSpecification)fragment).getExecution();
- if(execution != null) {
+ for (InteractionFragment fragment : fragments) {
+ if (fragment instanceof ExecutionSpecification) {
+ executions.add((ExecutionSpecification) fragment);
+ } else if (fragment instanceof ExecutionOccurrenceSpecification) {
+ ExecutionSpecification execution = ((ExecutionOccurrenceSpecification) fragment).getExecution();
+ if (execution != null) {
executions.add(execution);
}
- } else if(fragment instanceof MessageOccurrenceSpecification) {
- Message message = ((MessageOccurrenceSpecification)fragment).getMessage();
- if(message != null) {
+ } else if (fragment instanceof MessageOccurrenceSpecification) {
+ Message message = ((MessageOccurrenceSpecification) fragment).getMessage();
+ if (message != null) {
messages.add(message);
}
}
}
final EditPartViewer viewer = editPart.getViewer();
- if(!executions.isEmpty()) {
- for(ExecutionSpecification execution : executions) {
+ if (!executions.isEmpty()) {
+ for (ExecutionSpecification execution : executions) {
List<View> existingViews = DiagramEditPartsUtil.findViews(execution, viewer);
- if(existingViews.isEmpty()) {
+ if (existingViews.isEmpty()) {
continue;
} else {
- for(View view : existingViews) {
+ for (View view : existingViews) {
Object object = viewer.getEditPartRegistry().get(view);
- if(object instanceof ShapeNodeEditPart) {
- ShapeNodeEditPart child = (ShapeNodeEditPart)object;
+ if (object instanceof ShapeNodeEditPart) {
+ ShapeNodeEditPart child = (ShapeNodeEditPart) object;
boolean visited = false;
- for(OperandBlock blk : blocks) {
- if(blk.contains(child)) {
+ for (OperandBlock blk : blocks) {
+ if (blk.contains(child)) {
visited = true;
break;
}
}
- if(visited) {
+ if (visited) {
break;
} else {
OperandBlock newBlock = new ExecutionOperandBlock(child, executions);
@@ -1139,32 +1144,32 @@ public class OperandBoundsComputeHelper {
}
}
}
- if(!messages.isEmpty()) {
- for(Message msg : messages) {
+ if (!messages.isEmpty()) {
+ for (Message msg : messages) {
List<View> existingViews = DiagramEditPartsUtil.findViews(msg, viewer);
- if(existingViews.isEmpty()) {
+ if (existingViews.isEmpty()) {
continue;
} else {
- for(View view : existingViews) {
+ for (View view : existingViews) {
Object object = viewer.getEditPartRegistry().get(view);
- if(object instanceof ConnectionNodeEditPart) {
- ConnectionNodeEditPart child = (ConnectionNodeEditPart)object;
+ if (object instanceof ConnectionNodeEditPart) {
+ ConnectionNodeEditPart child = (ConnectionNodeEditPart) object;
EditPart source = child.getSource();
- if(source instanceof AbstractExecutionSpecificationEditPart && executions.contains(((AbstractExecutionSpecificationEditPart)source).resolveSemanticElement())) {
+ if (source instanceof AbstractExecutionSpecificationEditPart && executions.contains(((AbstractExecutionSpecificationEditPart) source).resolveSemanticElement())) {
continue;
}
EditPart target = child.getTarget();
- if(target instanceof AbstractExecutionSpecificationEditPart && executions.contains(((AbstractExecutionSpecificationEditPart)target).resolveSemanticElement())) {
+ if (target instanceof AbstractExecutionSpecificationEditPart && executions.contains(((AbstractExecutionSpecificationEditPart) target).resolveSemanticElement())) {
continue;
}
boolean visited = false;
- for(OperandBlock blk : blocks) {
- if(blk.contains(child)) {
+ for (OperandBlock blk : blocks) {
+ if (blk.contains(child)) {
visited = true;
break;
}
}
- if(visited) {
+ if (visited) {
break;
} else {
OperandBlock newBlock = new MessageOperandBlock(child);
@@ -1181,13 +1186,13 @@ public class OperandBoundsComputeHelper {
/**
* OperandBlock means the a group with ExecutionSpecifications contained in a InteractionOperand.
- *
+ *
* 1. All children of an execution should be contained.
* 2. The parent of an execution should be contained.
* 3. All ends of connected links which contained in the operand should be contained.
- *
+ *
* 4. All children would be moved together.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
private static class ExecutionOperandBlock extends OperandBlock {
@@ -1198,40 +1203,41 @@ public class OperandBoundsComputeHelper {
}
private void fillWith(ShapeNodeEditPart child, Set<ExecutionSpecification> executions) {
- if(children.contains(child) || child == null || executions == null || executions.isEmpty()) {
+ if (children.contains(child) || child == null || executions == null || executions.isEmpty()) {
return;
}
children.add(child);
List<ExecutionSpecification> toCheckExecutions = new ArrayList<ExecutionSpecification>(executions);
toCheckExecutions.remove(child.resolveSemanticElement());
Set<ShapeNodeEditPart> executionGroups = getExecutionGroups(child, toCheckExecutions);
- if(executionGroups != null && !executionGroups.isEmpty()) {
- for(ShapeNodeEditPart group : executionGroups) {
+ if (executionGroups != null && !executionGroups.isEmpty()) {
+ for (ShapeNodeEditPart group : executionGroups) {
fillWith(group, executions);
}
}
- LifelineEditPart parent = (LifelineEditPart)child.getParent();
- //1. parent bar
+ LifelineEditPart parent = (LifelineEditPart) child.getParent();
+ // 1. parent bar
List<ShapeNodeEditPart> childShapeNodeEditPart = LifelineEditPartUtil.getChildShapeNodeEditPart(parent);
childShapeNodeEditPart.remove(child);
ShapeNodeEditPart parentNode = LifelineXYLayoutEditPolicy.getParent(parent, child.getFigure().getBounds().getCopy(), childShapeNodeEditPart);
- if(parentNode != null) {
+ if (parentNode != null) {
fillWith(parentNode, executions);
}
- //2. children
+ // 2. children
List<ShapeNodeEditPart> affixedEditParts = LifelineXYLayoutEditPolicy.getAffixedExecutionSpecificationEditParts(child);
- for(ShapeNodeEditPart affixedChild : affixedEditParts) {
- if(executions.contains(affixedChild.resolveSemanticElement())) {
+ for (ShapeNodeEditPart affixedChild : affixedEditParts) {
+ if (executions.contains(affixedChild.resolveSemanticElement())) {
fillWith(affixedChild, executions);
}
}
}
+ @Override
protected Rectangle computeBounds() {
Rectangle bounds = null;
- for(EditPart child : children) {
- Rectangle rect = SequenceUtil.getAbsoluteBounds((IGraphicalEditPart)child);
- if(bounds == null) {
+ for (EditPart child : children) {
+ Rectangle rect = SequenceUtil.getAbsoluteBounds((IGraphicalEditPart) child);
+ if (bounds == null) {
bounds = rect;
} else {
bounds.union(rect);
@@ -1242,27 +1248,27 @@ public class OperandBoundsComputeHelper {
@SuppressWarnings({ "unchecked", "rawtypes" })
private Set<ShapeNodeEditPart> getExecutionGroups(ShapeNodeEditPart executionEditPart, List<ExecutionSpecification> toCheckExecutions) {
- if(toCheckExecutions == null || toCheckExecutions.isEmpty()) {
+ if (toCheckExecutions == null || toCheckExecutions.isEmpty()) {
return null;
}
Set<ShapeNodeEditPart> executionGroups = new HashSet<ShapeNodeEditPart>();
List connections = new ArrayList();
connections.addAll(executionEditPart.getSourceConnections());
connections.addAll(executionEditPart.getTargetConnections());
- for(Object object : connections) {
- org.eclipse.gef.ConnectionEditPart conn = (org.eclipse.gef.ConnectionEditPart)object;
- IGraphicalEditPart source = (IGraphicalEditPart)conn.getSource();
- if(executionEditPart == conn.getSource()) {
- source = (IGraphicalEditPart)conn.getTarget();
+ for (Object object : connections) {
+ org.eclipse.gef.ConnectionEditPart conn = (org.eclipse.gef.ConnectionEditPart) object;
+ IGraphicalEditPart source = (IGraphicalEditPart) conn.getSource();
+ if (executionEditPart == conn.getSource()) {
+ source = (IGraphicalEditPart) conn.getTarget();
}
- View model = (View)source.getModel();
+ View model = (View) source.getModel();
EObject element = model.getElement();
- if(toCheckExecutions.contains(element)) {
- executionGroups.add((ShapeNodeEditPart)source);
+ if (toCheckExecutions.contains(element)) {
+ executionGroups.add((ShapeNodeEditPart) source);
List<ExecutionSpecification> myCheckingList = new ArrayList<ExecutionSpecification>(toCheckExecutions);
myCheckingList.remove(element);
- Set<ShapeNodeEditPart> myGroups = getExecutionGroups((ShapeNodeEditPart)source, myCheckingList);
- if(myGroups != null) {
+ Set<ShapeNodeEditPart> myGroups = getExecutionGroups((ShapeNodeEditPart) source, myCheckingList);
+ if (myGroups != null) {
executionGroups.addAll(myGroups);
}
}
@@ -1273,9 +1279,9 @@ public class OperandBoundsComputeHelper {
public List<ShapeNodeEditPart> getShapeNodeChildren() {
List<ShapeNodeEditPart> shapes = new ArrayList<ShapeNodeEditPart>();
List<EditPart> children = getChildren();
- for(EditPart editPart : children) {
- if(editPart instanceof ShapeNodeEditPart) {
- shapes.add((ShapeNodeEditPart)editPart);
+ for (EditPart editPart : children) {
+ if (editPart instanceof ShapeNodeEditPart) {
+ shapes.add((ShapeNodeEditPart) editPart);
}
}
return shapes;
@@ -1287,7 +1293,7 @@ public class OperandBoundsComputeHelper {
/**
* Constructor.
- *
+ *
* @param child
* @param messages
*/
@@ -1298,23 +1304,23 @@ public class OperandBoundsComputeHelper {
@Override
protected Rectangle computeBounds() {
ConnectionNodeEditPart message = getMessageChild();
- if(message == null) {
+ if (message == null) {
return null;
}
Point start = SequenceUtil.getAbsoluteEdgeExtremity(message, true);
Point end = SequenceUtil.getAbsoluteEdgeExtremity(message, false);
Rectangle bounds = new Rectangle(start, end);
- if(message.getSource() instanceof GateEditPart || message.getTarget() instanceof GateEditPart) {
+ if (message.getSource() instanceof GateEditPart || message.getTarget() instanceof GateEditPart) {
bounds.expand(0, Math.round((GateEditPart.DEFAULT_SIZE.height - bounds.height) / 2.0));
}
- if(bounds.height < EXECUTION_VERTICAL_MARGIN) {
+ if (bounds.height < EXECUTION_VERTICAL_MARGIN) {
bounds.height = EXECUTION_VERTICAL_MARGIN;
}
return bounds;
}
public ConnectionNodeEditPart getMessageChild() {
- return (ConnectionNodeEditPart)(children.isEmpty() ? null : children.get(0));
+ return (ConnectionNodeEditPart) (children.isEmpty() ? null : children.get(0));
}
}
@@ -1348,12 +1354,12 @@ public class OperandBoundsComputeHelper {
/**
* Constructor.
- *
+ *
*/
public OperandBlockLayout(List<OperandBlock> blocks) {
- if(blocks != null) {
- for(OperandBlock blk : blocks) {
- if(blk.getBounds() != null) {
+ if (blocks != null) {
+ for (OperandBlock blk : blocks) {
+ if (blk.getBounds() != null) {
fBlocks.add(blk);
}
}
@@ -1366,12 +1372,13 @@ public class OperandBoundsComputeHelper {
private void sortBlocks() {
Collections.sort(fBlocks, new Comparator<OperandBlock>() {
+ @Override
public int compare(OperandBlock o1, OperandBlock o2) {
Rectangle r1 = o1.getBounds();
Rectangle r2 = o2.getBounds();
- if(r1.y < r2.y) {
+ if (r1.y < r2.y) {
return -1;
- } else if(r1.y > r2.y) {
+ } else if (r1.y > r2.y) {
return 1;
}
return 0;
@@ -1383,7 +1390,7 @@ public class OperandBoundsComputeHelper {
constraints.clear();
validBlocks.clear();
sortBlocks();
- if(!moveDown) {
+ if (!moveDown) {
Collections.reverse(fBlocks);
}
doLayout(newArea, fBlocks, moveDown);
@@ -1391,7 +1398,7 @@ public class OperandBoundsComputeHelper {
public int getMoveDelta(OperandBlock block) {
Rectangle rect = constraints.get(block);
- if(rect == null) {
+ if (rect == null) {
return 0;
}
Rectangle bounds = block.getBounds();
@@ -1400,40 +1407,40 @@ public class OperandBoundsComputeHelper {
private Rectangle getConstraint(OperandBlock blk) {
Rectangle rect = constraints.get(blk);
- if(rect == null) {
+ if (rect == null) {
rect = blk.getBounds();
}
return rect;
}
private boolean doLayout(Rectangle area, List<OperandBlock> blocks, boolean moveDown) {
- if(blocks.isEmpty()) {
+ if (blocks.isEmpty()) {
return false;
}
OperandBlock invalidBlock = blocks.get(0);
- if(isValidBlock(area, invalidBlock)) {
+ if (isValidBlock(area, invalidBlock)) {
return false;
}
- if(invalidBlock == null) {
+ if (invalidBlock == null) {
return false;
}
- //layout...
- //1. Near the full area.
+ // layout...
+ // 1. Near the full area.
Rectangle rect = invalidBlock.getBounds();
Rectangle newRect = new Rectangle(rect);
- if(moveDown) {
+ if (moveDown) {
int start = rect.y > area.y ? rect.y : area.y;
- for(int y = start; y < area.bottom() - rect.height; y++) {
+ for (int y = start; y < area.bottom() - rect.height; y++) {
newRect.setY(y);
- if(isValidBlock(area, newRect.getExpanded(0, EXECUTION_VERTICAL_MARGIN))) {
+ if (isValidBlock(area, newRect.getExpanded(0, EXECUTION_VERTICAL_MARGIN))) {
break;
}
}
} else {
int start = rect.bottom() < area.bottom() ? rect.y : area.bottom() - rect.height;
- for(int y = start; y > area.y; y--) {
+ for (int y = start; y > area.y; y--) {
newRect.setY(y);
- if(isValidBlock(area, newRect.getExpanded(0, EXECUTION_VERTICAL_MARGIN))) {
+ if (isValidBlock(area, newRect.getExpanded(0, EXECUTION_VERTICAL_MARGIN))) {
break;
}
}
@@ -1452,11 +1459,11 @@ public class OperandBoundsComputeHelper {
}
private boolean isValidBlock(Rectangle area, Rectangle block) {
- if(area.y > block.y || area.bottom() < block.bottom()) {
+ if (area.y > block.y || area.bottom() < block.bottom()) {
return false;
}
- for(Rectangle validRect : validBlocks) {
- if(block.intersects(validRect)) {
+ for (Rectangle validRect : validBlocks) {
+ if (block.intersects(validRect)) {
return false;
}
}
@@ -1471,7 +1478,7 @@ public class OperandBoundsComputeHelper {
/**
* Constructor.
- *
+ *
* @param domain
* @param label
* @param affectedFiles
@@ -1482,9 +1489,8 @@ public class OperandBoundsComputeHelper {
}
/**
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.core.runtime.IAdaptable)
- *
+ * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+ *
* @param monitor
* @param info
* @return
@@ -1496,20 +1502,21 @@ public class OperandBoundsComputeHelper {
List<OperandBlock> blocks = new ArrayList<OperandBoundsComputeHelper.OperandBlock>(blockToMove.keySet());
Collections.sort(blocks, new Comparator<OperandBlock>() {
+ @Override
public int compare(OperandBlock o1, OperandBlock o2) {
int m1 = Math.abs(blockToMove.get(o1).intValue());
int m2 = Math.abs(blockToMove.get(o2).intValue());
- if(m1 < m2) {
+ if (m1 < m2) {
return -1;
- } else if(m1 > m2) {
+ } else if (m1 > m2) {
return 1;
- } else if(m1 == m2) {
- if(m1 > 0) {
+ } else if (m1 == m2) {
+ if (m1 > 0) {
int y1 = o1.getBounds().y;
int y2 = o2.getBounds().y;
- if(y1 > y2) {
+ if (y1 > y2) {
return -1;
- } else if(y1 < y2) {
+ } else if (y1 < y2) {
return 1;
}
}
@@ -1517,11 +1524,11 @@ public class OperandBoundsComputeHelper {
return 0;
}
});
- for(int i = 0; i < blocks.size(); i++) {
+ for (int i = 0; i < blocks.size(); i++) {
OperandBlock block = blocks.get(i);
int moveDelta = blockToMove.get(block);
Command command = getMoveOperandBlockCommand(block, moveDelta);
- if(command != null && command.canExecute()) {
+ if (command != null && command.canExecute()) {
command.execute();
}
}
@@ -1530,13 +1537,13 @@ public class OperandBoundsComputeHelper {
}
private Command getMoveOperandBlockCommand(OperandBlock block, int moveDelta) {
- if(block == null || moveDelta == 0) {
+ if (block == null || moveDelta == 0) {
return null;
}
CompoundCommand commands = new CompoundCommand();
- if(block instanceof ExecutionOperandBlock) {
- List<ShapeNodeEditPart> children = ((ExecutionOperandBlock)block).getShapeNodeChildren();
- for(ShapeNodeEditPart child : children) {
+ if (block instanceof ExecutionOperandBlock) {
+ List<ShapeNodeEditPart> children = ((ExecutionOperandBlock) block).getShapeNodeChildren();
+ for (ShapeNodeEditPart child : children) {
Bounds bounds = getInteractionOperandEPBounds(child);
Rectangle newBounds = fillRectangle(bounds);
newBounds.y += moveDelta;
@@ -1545,42 +1552,42 @@ public class OperandBoundsComputeHelper {
moveCommand.add(new ICommandProxy(cmd));
moveCommand = OccurrenceSpecificationMoveHelper.completeMoveExecutionSpecificationCommand(moveCommand, child, newBounds, new ChangeBoundsRequest());
List targetConnections = child.getTargetConnections();
- for(Object object : targetConnections) {
- if(!(object instanceof AbstractMessageEditPart)) {
+ for (Object object : targetConnections) {
+ if (!(object instanceof AbstractMessageEditPart)) {
continue;
}
- AbstractMessageEditPart conn = (AbstractMessageEditPart)object;
+ AbstractMessageEditPart conn = (AbstractMessageEditPart) object;
EditPart source = conn.getSource();
- if(!(source instanceof AbstractExecutionSpecificationEditPart)) {
- Edge edge = (Edge)conn.getNotationView();
+ if (!(source instanceof AbstractExecutionSpecificationEditPart)) {
+ Edge edge = (Edge) conn.getNotationView();
Connection connectionFigure = conn.getConnectionFigure();
ConnectionAnchor sourceAnchor = connectionFigure.getSourceAnchor();
Rectangle figureBounds = sourceAnchor.getOwner().getBounds();
Anchor gmfTargetAnchor = edge.getSourceAnchor();
- if(gmfTargetAnchor instanceof IdentityAnchor) {
- ICommand moveAnchorCommand = getMoveAnchorCommand(moveDelta, figureBounds, (IdentityAnchor)gmfTargetAnchor);
- if(moveAnchorCommand != null && moveAnchorCommand.canExecute()) {
+ if (gmfTargetAnchor instanceof IdentityAnchor) {
+ ICommand moveAnchorCommand = getMoveAnchorCommand(moveDelta, figureBounds, (IdentityAnchor) gmfTargetAnchor);
+ if (moveAnchorCommand != null && moveAnchorCommand.canExecute()) {
commands.add(new ICommandProxy(moveAnchorCommand));
}
}
}
}
List sourceConnections = child.getSourceConnections();
- for(Object object : sourceConnections) {
- if(!(object instanceof AbstractMessageEditPart)) {
+ for (Object object : sourceConnections) {
+ if (!(object instanceof AbstractMessageEditPart)) {
continue;
}
- AbstractMessageEditPart conn = (AbstractMessageEditPart)object;
+ AbstractMessageEditPart conn = (AbstractMessageEditPart) object;
EditPart target = conn.getTarget();
- if(!(target instanceof AbstractExecutionSpecificationEditPart)) {
- Edge edge = (Edge)conn.getNotationView();
+ if (!(target instanceof AbstractExecutionSpecificationEditPart)) {
+ Edge edge = (Edge) conn.getNotationView();
Connection connectionFigure = conn.getConnectionFigure();
ConnectionAnchor targetAnchor = connectionFigure.getTargetAnchor();
Rectangle figureBounds = targetAnchor.getOwner().getBounds();
Anchor gmfTargetAnchor = edge.getTargetAnchor();
- if(gmfTargetAnchor instanceof IdentityAnchor) {
- ICommand moveAnchorCommand = getMoveAnchorCommand(moveDelta, figureBounds, (IdentityAnchor)gmfTargetAnchor);
- if(moveAnchorCommand != null && moveAnchorCommand.canExecute()) {
+ if (gmfTargetAnchor instanceof IdentityAnchor) {
+ ICommand moveAnchorCommand = getMoveAnchorCommand(moveDelta, figureBounds, (IdentityAnchor) gmfTargetAnchor);
+ if (moveAnchorCommand != null && moveAnchorCommand.canExecute()) {
commands.add(new ICommandProxy(moveAnchorCommand));
}
}
@@ -1588,38 +1595,38 @@ public class OperandBoundsComputeHelper {
}
commands.add(moveCommand);
}
- } else if(block instanceof MessageOperandBlock) {
- ConnectionNodeEditPart message = ((MessageOperandBlock)block).getMessageChild();
- if(message != null) {
- Edge edge = (Edge)message.getModel();
+ } else if (block instanceof MessageOperandBlock) {
+ ConnectionNodeEditPart message = ((MessageOperandBlock) block).getMessageChild();
+ if (message != null) {
+ Edge edge = (Edge) message.getModel();
Connection msgFigure = message.getConnectionFigure();
- if(message.getSource() instanceof GateEditPart) {
- GateEditPart gate = (GateEditPart)message.getSource();
- Location layout = (Location)((Shape)gate.getNotationView()).getLayoutConstraint();
+ if (message.getSource() instanceof GateEditPart) {
+ GateEditPart gate = (GateEditPart) message.getSource();
+ Location layout = (Location) ((Shape) gate.getNotationView()).getLayoutConstraint();
Point location = new Point(layout.getX(), layout.getY());
location.y += moveDelta;
SetBoundsCommand command = new SetBoundsCommand(getEditingDomain(), "", gate, location);
commands.add(new ICommandProxy(command));
} else {
ConnectionAnchor sourceAnchor = msgFigure.getSourceAnchor();
- IdentityAnchor gmfSourceAnchor = (IdentityAnchor)edge.getSourceAnchor();
+ IdentityAnchor gmfSourceAnchor = (IdentityAnchor) edge.getSourceAnchor();
Rectangle figureBounds = sourceAnchor.getOwner().getBounds();
- if(gmfSourceAnchor != null) {
+ if (gmfSourceAnchor != null) {
commands.add(new ICommandProxy(getMoveAnchorCommand(moveDelta, figureBounds, gmfSourceAnchor)));
}
}
- if(message.getTarget() instanceof GateEditPart) {
- GateEditPart gate = (GateEditPart)message.getTarget();
- Location layout = (Location)((Shape)gate.getNotationView()).getLayoutConstraint();
+ if (message.getTarget() instanceof GateEditPart) {
+ GateEditPart gate = (GateEditPart) message.getTarget();
+ Location layout = (Location) ((Shape) gate.getNotationView()).getLayoutConstraint();
Point location = new Point(layout.getX(), layout.getY());
location.y += moveDelta;
SetBoundsCommand command = new SetBoundsCommand(getEditingDomain(), "", gate, location);
commands.add(new ICommandProxy(command));
} else {
- IdentityAnchor gmfTargetAnchor = (IdentityAnchor)edge.getTargetAnchor();
+ IdentityAnchor gmfTargetAnchor = (IdentityAnchor) edge.getTargetAnchor();
ConnectionAnchor targetAnchor = msgFigure.getTargetAnchor();
Rectangle figureBounds = targetAnchor.getOwner().getBounds();
- if(gmfTargetAnchor != null) {
+ if (gmfTargetAnchor != null) {
commands.add(new ICommandProxy(getMoveAnchorCommand(moveDelta, figureBounds, gmfTargetAnchor)));
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/OperationUtil.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/OperationUtil.java
index e00ab984b1c..8bdbe346175 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/OperationUtil.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/OperationUtil.java
@@ -25,61 +25,61 @@ public class OperationUtil {
StringBuffer buffer = new StringBuffer();
// visibility
buffer.append(" ");
- if(displayValue.contains(ICustomAppearance.DISP_VISIBILITY)) {
+ if (displayValue.contains(ICustomAppearance.DISP_VISIBILITY)) {
buffer.append(NamedElementUtil.getVisibilityAsSign(parameter));
}
// direction property
- if(displayValue.contains(ICustomAppearance.DISP_PARAMETER_DIRECTION)) {
+ if (displayValue.contains(ICustomAppearance.DISP_PARAMETER_DIRECTION)) {
buffer.append(" ");
buffer.append(parameter.getDirection().getLiteral());
}
boolean showEqualMark = false;
// name
- if(displayValue.contains(ICustomAppearance.DISP_PARAMETER_NAME)) {
+ if (displayValue.contains(ICustomAppearance.DISP_PARAMETER_NAME)) {
buffer.append(" ");
String name = StringHelper.trimToEmpty(parameter.getName());
- if(name.trim().length() > 0) {
+ if (name.trim().length() > 0) {
showEqualMark = true;
}
buffer.append(name);
}
- if(displayValue.contains(ICustomAppearance.DISP_PARAMETER_TYPE)) {
+ if (displayValue.contains(ICustomAppearance.DISP_PARAMETER_TYPE)) {
// type
- if(parameter.getType() != null) {
+ if (parameter.getType() != null) {
buffer.append(": " + StringHelper.trimToEmpty(parameter.getType().getName()));
} else {
buffer.append(": " + TypeUtil.UNDEFINED_TYPE_NAME);
}
showEqualMark = true;
}
- if(displayValue.contains(ICustomAppearance.DISP_PARAMETER_MULTIPLICITY)) {
+ if (displayValue.contains(ICustomAppearance.DISP_PARAMETER_MULTIPLICITY)) {
// multiplicity -> do not display [1]
String multiplicity = MultiplicityElementUtil.getMultiplicityAsString(parameter);
buffer.append(multiplicity);
}
- if(displayValue.contains(ICustomAppearance.DISP_DERIVE)) {
+ if (displayValue.contains(ICustomAppearance.DISP_DERIVE)) {
String value = getValue(e, paramIndex, parameter);
- if(value != null) {
- if(showEqualMark) {
+ if (value != null) {
+ if (showEqualMark) {
buffer.append(" = ");
}
buffer.append(value);
}
- } else if(displayValue.contains(ICustomAppearance.DISP_PARAMETER_DEFAULT)) {
+ } else if (displayValue.contains(ICustomAppearance.DISP_PARAMETER_DEFAULT)) {
// default value
- if(parameter.getDefault() != null) {
- if(showEqualMark) {
+ if (parameter.getDefault() != null) {
+ if (showEqualMark) {
buffer.append(" = ");
}
buffer.append(parameter.getDefault());
}
}
- if(displayValue.contains(ICustomAppearance.DISP_MODIFIERS)) {
+ if (displayValue.contains(ICustomAppearance.DISP_MODIFIERS)) {
boolean multiLine = displayValue.contains(ICustomAppearance.DISP_MULTI_LINE);
// property modifiers
String modifiers = ParameterUtil.getModifiersAsString(parameter, multiLine);
- if(!modifiers.equals("")) {
- if(multiLine) {
+ if (!modifiers.equals("")) {
+ if (multiLine) {
buffer.append("\n");
}
buffer.append(modifiers);
@@ -91,7 +91,7 @@ public class OperationUtil {
private static String getValue(Message e, int paramIndex, Parameter parameter) {
try {
EList<ValueSpecification> arguments = e.getArguments();
- if(arguments.size() > paramIndex) {
+ if (arguments.size() > paramIndex) {
return ValueSpecificationUtil.getSpecificationValue(arguments.get(paramIndex));
}
} catch (Exception e1) {
@@ -103,11 +103,11 @@ public class OperationUtil {
StringBuffer buffer = new StringBuffer();
buffer.append(" "); // adds " " first for correct display considerations
// visibility
- if(displayValue.contains(ICustomAppearance.DISP_VISIBILITY)) {
+ if (displayValue.contains(ICustomAppearance.DISP_VISIBILITY)) {
buffer.append(NamedElementUtil.getVisibilityAsSign(operation));
}
// name
- if(displayValue.contains(ICustomAppearance.DISP_NAME)) {
+ if (displayValue.contains(ICustomAppearance.DISP_NAME)) {
buffer.append(" ");
buffer.append(StringHelper.trimToEmpty(operation.getName()));
}
@@ -117,13 +117,13 @@ public class OperationUtil {
buffer.append(getParametersAsString(message, operation, displayValue));
buffer.append(")");
// return type
- if(displayValue.contains(ICustomAppearance.DISP_RT_TYPE) || displayValue.contains(ICustomAppearance.DISP_TYPE)) {
+ if (displayValue.contains(ICustomAppearance.DISP_RT_TYPE) || displayValue.contains(ICustomAppearance.DISP_TYPE)) {
buffer.append(getReturnTypeAsString(operation, displayValue));
}
// modifiers
- if(displayValue.contains(ICustomAppearance.DISP_MODIFIERS)) {
+ if (displayValue.contains(ICustomAppearance.DISP_MODIFIERS)) {
String modifiers = getModifiersAsString(operation);
- if(!modifiers.equals("")) {
+ if (!modifiers.equals("")) {
buffer.append("{");
buffer.append(modifiers);
buffer.append("}");
@@ -134,7 +134,7 @@ public class OperationUtil {
/**
* Returns operation modifiers as string, separated with comma.
- *
+ *
* @return a string containing the modifiers
*/
private static String getModifiersAsString(Operation operation) {
@@ -142,15 +142,15 @@ public class OperationUtil {
boolean needsComma = false;
// Return parameter modifiers
Parameter returnParameter = OperationUtil.getReturnParameter(operation);
- if(returnParameter != null) {
+ if (returnParameter != null) {
// non unique parameter
- if(!returnParameter.isUnique()) {
+ if (!returnParameter.isUnique()) {
buffer.append("nonunique");
needsComma = true;
}
// return parameter has ordered values
- if(returnParameter.isOrdered()) {
- if(needsComma) {
+ if (returnParameter.isOrdered()) {
+ if (needsComma) {
buffer.append(", ");
}
buffer.append("ordered");
@@ -158,8 +158,8 @@ public class OperationUtil {
}
}
// is the operation a query ?
- if(operation.isQuery()) {
- if(needsComma) {
+ if (operation.isQuery()) {
+ if (needsComma) {
buffer.append(", ");
}
buffer.append("query");
@@ -167,9 +167,9 @@ public class OperationUtil {
}
// is the operation redefining another operation ?
Iterator<Operation> it = operation.getRedefinedOperations().iterator();
- while(it.hasNext()) {
+ while (it.hasNext()) {
Operation currentOperation = it.next();
- if(needsComma) {
+ if (needsComma) {
buffer.append(", ");
}
buffer.append("redefines ");
@@ -178,12 +178,12 @@ public class OperationUtil {
}
// has the operation a constraint ?
Iterator<Constraint> it2 = operation.getOwnedRules().iterator();
- while(it2.hasNext()) {
+ while (it2.hasNext()) {
Constraint constraint = it2.next();
- if(needsComma) {
+ if (needsComma) {
buffer.append(", ");
}
- if(constraint.getSpecification() != null) {
+ if (constraint.getSpecification() != null) {
buffer.append(constraint.getSpecification().stringValue());
}
needsComma = true;
@@ -193,9 +193,9 @@ public class OperationUtil {
/**
* Returns return parameter label as a string, string parametrized with a style mask.
- *
+ *
* @param style
- * the mask that indicates which element to display
+ * the mask that indicates which element to display
* @return a string containing the return parameter type
*/
private static String getReturnTypeAsString(Operation operation, Collection<String> displayValue) {
@@ -205,16 +205,16 @@ public class OperationUtil {
// Retrieve the return parameter (assume to be unique if defined)
Parameter returnParameter = getReturnParameter(operation);
// Create the string for the return type
- if(returnParameter == null) {
+ if (returnParameter == null) {
// no-operation: label = ""
- } else if(!displayType && !displayMultiplicity) {
+ } else if (!displayType && !displayMultiplicity) {
// no-operation: label = ""
} else {
label.append(": ");
- if(displayType) {
+ if (displayType) {
label.append(TypedElementUtil.getTypeAsString(returnParameter));
}
- if(displayMultiplicity) {
+ if (displayMultiplicity) {
label.append(MultiplicityElementUtil.getMultiplicityAsString(returnParameter));
}
}
@@ -223,16 +223,16 @@ public class OperationUtil {
/**
* Gives the return parameter for this operation, or <code>null</code> if none exists.
- *
+ *
* @return the return parameter of the operation or <code>null</code>
*/
private static Parameter getReturnParameter(Operation operation) {
// Retrieve the return parameter (assume to be unique if defined)
Parameter returnParameter = null;
Iterator<Parameter> it = operation.getOwnedParameters().iterator();
- while((returnParameter == null) && (it.hasNext())) {
+ while ((returnParameter == null) && (it.hasNext())) {
Parameter parameter = it.next();
- if(parameter.getDirection().equals(ParameterDirectionKind.RETURN_LITERAL)) {
+ if (parameter.getDirection().equals(ParameterDirectionKind.RETURN_LITERAL)) {
returnParameter = parameter;
}
}
@@ -241,9 +241,9 @@ public class OperationUtil {
/**
* Returns operation parameters as a string, the label is customized using a bit mask
- *
+ *
* @param e
- *
+ *
* @return a string containing all parameters separated by commas
*/
private static String getParametersAsString(Message e, Operation operation, Collection<String> displayValue) {
@@ -251,15 +251,15 @@ public class OperationUtil {
Iterator<Parameter> paramIterator = operation.getOwnedParameters().iterator();
boolean firstParameter = true;
int paramIndex = 0;
- while(paramIterator.hasNext()) {
+ while (paramIterator.hasNext()) {
Parameter parameter = paramIterator.next();
// Do not include return parameters
- if(!parameter.getDirection().equals(ParameterDirectionKind.RETURN_LITERAL)) {
+ if (!parameter.getDirection().equals(ParameterDirectionKind.RETURN_LITERAL)) {
// get the label for this parameter
String parameterString = getCustomLabel(e, paramIndex, parameter, displayValue).trim();
paramIndex++;
- if(!parameterString.equals("")) {
- if(!firstParameter) {
+ if (!parameterString.equals("")) {
+ if (!firstParameter) {
paramString.append(", ");
}
paramString.append(parameterString);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/PreferencesModelElementFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/PreferencesModelElementFactory.java
index 6de72de94a0..9b68a9e51ca 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/PreferencesModelElementFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/PreferencesModelElementFactory.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2012, 2014 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
@@ -9,7 +9,7 @@
* Contributors:
* CEA LIST - Initial API and implementation
* Christian W. Damus (CEA) - bug 417409
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.sequence.util;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/ReconnectMessageHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/ReconnectMessageHelper.java
index 94408205d41..9264ff085fd 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/ReconnectMessageHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/ReconnectMessageHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -40,7 +40,7 @@ public class ReconnectMessageHelper {
/**
* Update Message :
* - Update its signature
- *
+ *
* @param message
*/
public static void updateMessage(Message message) {
@@ -49,57 +49,57 @@ public class ReconnectMessageHelper {
/**
* Update the message end :
- *
+ *
* @param messageEnd
* @param oldElement
* @param newElement
*/
public static void updateMessageEnd(MessageEnd messageEnd, Element oldElement, Element newElement) {
- if(messageEnd instanceof MessageOccurrenceSpecification) {
- updateMos((MessageOccurrenceSpecification)messageEnd, oldElement, newElement);
- } else if(messageEnd instanceof Gate) {
- updateGate((Gate)messageEnd, oldElement, newElement);
+ if (messageEnd instanceof MessageOccurrenceSpecification) {
+ updateMos((MessageOccurrenceSpecification) messageEnd, oldElement, newElement);
+ } else if (messageEnd instanceof Gate) {
+ updateGate((Gate) messageEnd, oldElement, newElement);
}
- //Update old executions.
- if(oldElement instanceof ExecutionSpecification && oldElement != newElement) {
- ExecutionSpecification execution = (ExecutionSpecification)oldElement;
- if(messageEnd == execution.getStart()) {
+ // Update old executions.
+ if (oldElement instanceof ExecutionSpecification && oldElement != newElement) {
+ ExecutionSpecification execution = (ExecutionSpecification) oldElement;
+ if (messageEnd == execution.getStart()) {
OccurrenceSpecificationHelper.resetExecutionStart(execution, UMLFactory.eINSTANCE.createExecutionOccurrenceSpecification());
- } else if(messageEnd == execution.getFinish()) {
+ } else if (messageEnd == execution.getFinish()) {
OccurrenceSpecificationHelper.resetExecutionFinish(execution, UMLFactory.eINSTANCE.createExecutionOccurrenceSpecification());
}
}
}
public static void updateGate(Gate messageEnd, Element oldElement, Element newElement) {
- if(newElement instanceof Gate && messageEnd != newElement) {
- Gate newEnd = (Gate)newElement;
+ if (newElement instanceof Gate && messageEnd != newElement) {
+ Gate newEnd = (Gate) newElement;
Message message = messageEnd.getMessage();
- if(message != null) {
- if(messageEnd == message.getSendEvent()) {
+ if (message != null) {
+ if (messageEnd == message.getSendEvent()) {
message.setSendEvent(newEnd);
- } else if(messageEnd == message.getReceiveEvent()) {
+ } else if (messageEnd == message.getReceiveEvent()) {
message.setReceiveEvent(newEnd);
}
newEnd.setMessage(message);
messageEnd.setMessage(null);
}
} else {
- if(newElement instanceof Lifeline && !(oldElement instanceof CombinedFragment && InteractionOperatorKind.PAR_LITERAL.equals(((CombinedFragment)oldElement).getInteractionOperator()))) {
+ if (newElement instanceof Lifeline && !(oldElement instanceof CombinedFragment && InteractionOperatorKind.PAR_LITERAL.equals(((CombinedFragment) oldElement).getInteractionOperator()))) {
Message message = messageEnd.getMessage();
MessageOccurrenceSpecification newMessageEnd = UMLFactory.eINSTANCE.createMessageOccurrenceSpecification();
- newMessageEnd.setCovered((Lifeline)newElement);
- updateOccurenceSpecification(newMessageEnd, (Lifeline)newElement);
- if(message != null) {
- if(messageEnd == message.getSendEvent()) {
- if(newMessageEnd.getName() == null) {
+ newMessageEnd.setCovered((Lifeline) newElement);
+ updateOccurenceSpecification(newMessageEnd, (Lifeline) newElement);
+ if (message != null) {
+ if (messageEnd == message.getSendEvent()) {
+ if (newMessageEnd.getName() == null) {
newMessageEnd.setName(message.getName() + "Send");
}
message.setSendEvent(newMessageEnd);
MessageEnd receivedMessageEnd = message.getReceiveEvent();
updateMosEnclosingNamespace(newMessageEnd, receivedMessageEnd);
- } else if(messageEnd == message.getReceiveEvent()) {
- if(newMessageEnd.getName() == null) {
+ } else if (messageEnd == message.getReceiveEvent()) {
+ if (newMessageEnd.getName() == null) {
newMessageEnd.setName(message.getName() + "Recv");
}
message.setReceiveEvent(newMessageEnd);
@@ -115,61 +115,61 @@ public class ReconnectMessageHelper {
/**
* Update Message occurrence specification with the enclosing Interaction or Operand
- *
+ *
* @param mos
- * the message occurrence specification to update
+ * the message occurrence specification to update
* @param oppositeMessageEnd
- * the opposite message end
+ * the opposite message end
*/
public static void updateMosEnclosingNamespace(MessageOccurrenceSpecification mos, MessageEnd oppositeMessageEnd) {
- if(oppositeMessageEnd instanceof MessageOccurrenceSpecification) {
- MessageOccurrenceSpecification oppositeMos = (MessageOccurrenceSpecification)oppositeMessageEnd;
+ if (oppositeMessageEnd instanceof MessageOccurrenceSpecification) {
+ MessageOccurrenceSpecification oppositeMos = (MessageOccurrenceSpecification) oppositeMessageEnd;
Interaction interaction = oppositeMos.getEnclosingInteraction();
InteractionOperand operand = oppositeMos.getEnclosingOperand();
- if(interaction != null) {
+ if (interaction != null) {
mos.setEnclosingInteraction(interaction);
- } else if(operand != null) {
+ } else if (operand != null) {
mos.setEnclosingOperand(operand);
}
- } else if(oppositeMessageEnd instanceof Gate) {
- Gate oppositeGate = (Gate)oppositeMessageEnd;
+ } else if (oppositeMessageEnd instanceof Gate) {
+ Gate oppositeGate = (Gate) oppositeMessageEnd;
Namespace namespace = oppositeGate.getNamespace();
- if(namespace instanceof Interaction) {
- mos.setEnclosingInteraction((Interaction)namespace);
- } else if(namespace instanceof InteractionOperand) {
- mos.setEnclosingOperand((InteractionOperand)namespace);
+ if (namespace instanceof Interaction) {
+ mos.setEnclosingInteraction((Interaction) namespace);
+ } else if (namespace instanceof InteractionOperand) {
+ mos.setEnclosingOperand((InteractionOperand) namespace);
}
}
}
public static void updateMos(MessageOccurrenceSpecification messageEnd, Element oldElement, Element newElement) {
- if(newElement instanceof Lifeline && !(oldElement instanceof CombinedFragment && InteractionOperatorKind.PAR_LITERAL.equals(((CombinedFragment)oldElement).getInteractionOperator()))) {
- updateOccurenceSpecification(messageEnd, (Lifeline)newElement);
- } else if(newElement instanceof ExecutionSpecification && !(oldElement instanceof CombinedFragment && InteractionOperatorKind.PAR_LITERAL.equals(((CombinedFragment)oldElement).getInteractionOperator()))) {
- Lifeline lifeline = CommandHelper.getExecutionSpecificationLifeline((ExecutionSpecification)newElement);
- if(lifeline != null) {
+ if (newElement instanceof Lifeline && !(oldElement instanceof CombinedFragment && InteractionOperatorKind.PAR_LITERAL.equals(((CombinedFragment) oldElement).getInteractionOperator()))) {
+ updateOccurenceSpecification(messageEnd, (Lifeline) newElement);
+ } else if (newElement instanceof ExecutionSpecification && !(oldElement instanceof CombinedFragment && InteractionOperatorKind.PAR_LITERAL.equals(((CombinedFragment) oldElement).getInteractionOperator()))) {
+ Lifeline lifeline = CommandHelper.getExecutionSpecificationLifeline((ExecutionSpecification) newElement);
+ if (lifeline != null) {
updateOccurenceSpecification(messageEnd, lifeline);
}
- } else if(newElement instanceof CombinedFragment && InteractionOperatorKind.PAR_LITERAL.equals(((CombinedFragment)newElement).getInteractionOperator())) {
+ } else if (newElement instanceof CombinedFragment && InteractionOperatorKind.PAR_LITERAL.equals(((CombinedFragment) newElement).getInteractionOperator())) {
// handle reorient on coregion
- CombinedFragment cf = (CombinedFragment)newElement;
+ CombinedFragment cf = (CombinedFragment) newElement;
InteractionOperand io = CommandHelper.getCoRegionInteractionOperand(cf);
messageEnd.setEnclosingOperand(io);
// try to find and put in the operand the other mos of the message
MessageEnd messageEnd2 = findSecondMessageEnd(messageEnd);
- if(messageEnd2 instanceof MessageOccurrenceSpecification) {
- ((MessageOccurrenceSpecification)messageEnd2).setEnclosingOperand(io);
+ if (messageEnd2 instanceof MessageOccurrenceSpecification) {
+ ((MessageOccurrenceSpecification) messageEnd2).setEnclosingOperand(io);
}
// update interaction operands covered lifelines
updateCoveredLifelinesOfCoregionOperand(cf);
- } else if(oldElement instanceof CombinedFragment && InteractionOperatorKind.PAR_LITERAL.equals(((CombinedFragment)oldElement).getInteractionOperator())) {
+ } else if (oldElement instanceof CombinedFragment && InteractionOperatorKind.PAR_LITERAL.equals(((CombinedFragment) oldElement).getInteractionOperator())) {
// handle reorient from coregion
- CombinedFragment cf = (CombinedFragment)oldElement;
+ CombinedFragment cf = (CombinedFragment) oldElement;
Element backInteraction = cf.getOwner();
SequenceUtil.setEnclosingInteraction(messageEnd, backInteraction, true);
MessageEnd messageEnd2 = findSecondMessageEnd(messageEnd);
- if(messageEnd2 instanceof MessageOccurrenceSpecification) {
- SequenceUtil.setEnclosingInteraction((MessageOccurrenceSpecification)messageEnd2, backInteraction, true);
+ if (messageEnd2 instanceof MessageOccurrenceSpecification) {
+ SequenceUtil.setEnclosingInteraction((MessageOccurrenceSpecification) messageEnd2, backInteraction, true);
}
// update interaction operands covered lifelines
updateCoveredLifelinesOfCoregionOperand(cf);
@@ -179,8 +179,8 @@ public class ReconnectMessageHelper {
public static MessageEnd findSecondMessageEnd(MessageEnd messageEnd) {
Message msg = messageEnd.getMessage();
MessageEnd messageEnd2 = null;
- if(msg != null) {
- if(messageEnd.equals(msg.getSendEvent())) {
+ if (msg != null) {
+ if (messageEnd.equals(msg.getSendEvent())) {
messageEnd2 = msg.getReceiveEvent();
} else {
messageEnd2 = msg.getSendEvent();
@@ -191,19 +191,19 @@ public class ReconnectMessageHelper {
/**
* OccurrenceSpecification cover a unique lifeline.
- *
+ *
* @param os
- * the occurrence specification to update
+ * the occurrence specification to update
* @param newLifeline
- * the new lifeline covered by the OS
+ * the new lifeline covered by the OS
*/
public static void updateOccurenceSpecification(OccurrenceSpecification os, Lifeline newLifeline) {
// An occurrence specification covers a unique lifeline
EList<Lifeline> covereds = os.getCovereds();
- if(covereds.isEmpty()) {
+ if (covereds.isEmpty()) {
covereds.add(newLifeline);
- } else if(covereds.size() == 1) {
- if(newLifeline != covereds.get(0)) {
+ } else if (covereds.size() == 1) {
+ if (newLifeline != covereds.get(0)) {
os.setCovered(newLifeline);
}
} else {
@@ -215,16 +215,16 @@ public class ReconnectMessageHelper {
/**
* Update the list of lifelines covered by the Interaction Operands of a coregion.
* These are the lifelines covered by all contained Message Occurrence Specifications.
- *
+ *
* @param coregion
- * the coregion to update operands
+ * the coregion to update operands
*/
public static void updateCoveredLifelinesOfCoregionOperand(CombinedFragment coregion) {
coregion.getCovereds().clear();
- for(InteractionOperand operand : coregion.getOperands()) {
+ for (InteractionOperand operand : coregion.getOperands()) {
operand.getCovereds().clear();
- for(InteractionFragment fragment : operand.getFragments()) {
- if(fragment instanceof MessageOccurrenceSpecification) {
+ for (InteractionFragment fragment : operand.getFragments()) {
+ if (fragment instanceof MessageOccurrenceSpecification) {
operand.getCovereds().addAll(fragment.getCovereds());
coregion.getCovereds().addAll(fragment.getCovereds());
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SelectOrCreateDialog.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SelectOrCreateDialog.java
index f997af2ac28..c1e69ad08f5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SelectOrCreateDialog.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SelectOrCreateDialog.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -52,6 +52,7 @@ import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.dialogs.ElementListSelectionDialog;
import org.eclipse.ui.forms.FormDialog;
import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.ui.forms.widgets.Section;
@@ -113,26 +114,27 @@ public class SelectOrCreateDialog extends FormDialog {
private List<Type> types;
/**
- *
+ *
* @param shell
- * parent shell
+ * parent shell
* @param title
- * The title of the dialog
+ * The title of the dialog
* @param typeLabelProvider
- * The label provider to generate type label
+ * The label provider to generate type label
* @param elementLabelProvider
- * The label provider to generate elements label
+ * The label provider to generate elements label
* @param transactionalEditingDomain
- * The domain where to create the element if necessary.
+ * The domain where to create the element if necessary.
* @param existingElements
- * The list of existing elements that can be selected.
+ * The list of existing elements that can be selected.
* @param mapTypesPossibleParents
- * The map of possible types for the element
- * and the possible parents where the element
- * can be created.
+ * The map of possible types for the element
+ * and the possible parents where the element
+ * can be created.
* @param types
*/
- public SelectOrCreateDialog(Shell shell, String title, ILabelProvider typeLabelProvider, ILabelProvider elementLabelProvider, TransactionalEditingDomain transactionalEditingDomain, Collection<EObject> existingElements, LinkedHashMap<EClass, List<EObject>> mapTypesPossibleParents, List<Type> types) {
+ public SelectOrCreateDialog(Shell shell, String title, ILabelProvider typeLabelProvider, ILabelProvider elementLabelProvider, TransactionalEditingDomain transactionalEditingDomain, Collection<EObject> existingElements,
+ LinkedHashMap<EClass, List<EObject>> mapTypesPossibleParents, List<Type> types) {
super(shell);
this.typeLabelProvider = typeLabelProvider;
this.elementLabelProvider = elementLabelProvider;
@@ -145,9 +147,9 @@ public class SelectOrCreateDialog extends FormDialog {
/**
* Adds buttons to this dialog's button bar.
- *
+ *
* @param parent
- * the button bar composite
+ * the button bar composite
*/
@Override
protected void createButtonsForButtonBar(Composite parent) {
@@ -157,11 +159,11 @@ public class SelectOrCreateDialog extends FormDialog {
/**
* Create the form to :
- *
+ *
* - ask the user to select or create an element.
- *
+ *
* - decide whether the action is synchronous.
- *
+ *
* @see org.eclipse.ui.forms.FormDialog#createFormContent(org.eclipse.ui.forms.IManagedForm)
*/
@Override
@@ -186,7 +188,7 @@ public class SelectOrCreateDialog extends FormDialog {
private void createNothingSection(Composite pParent, FormToolkit pToolkit) {
// create the section
- Section lSection = pToolkit.createSection(pParent, Section.EXPANDED | Section.TITLE_BAR);
+ Section lSection = pToolkit.createSection(pParent, ExpandableComposite.EXPANDED | ExpandableComposite.TITLE_BAR);
lSection.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));
ScrolledForm lInsideScrolledForm = pToolkit.createScrolledForm(lSection);
lInsideScrolledForm.setExpandHorizontal(true);
@@ -203,15 +205,15 @@ public class SelectOrCreateDialog extends FormDialog {
/**
* Create the section to ask the user to select or create an element.
- *
+ *
* @param pParent
- * the section's parent widget
+ * the section's parent widget
* @param pToolkit
- * the form toolkit
+ * the form toolkit
*/
private void createSelectionSection(Composite pParent, FormToolkit pToolkit) {
// create the section
- Section lSection = pToolkit.createSection(pParent, Section.EXPANDED | Section.TITLE_BAR);
+ Section lSection = pToolkit.createSection(pParent, ExpandableComposite.EXPANDED | ExpandableComposite.TITLE_BAR);
lSection.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));
ScrolledForm lInsideScrolledForm = pToolkit.createScrolledForm(lSection);
lInsideScrolledForm.setExpandHorizontal(true);
@@ -226,11 +228,11 @@ public class SelectOrCreateDialog extends FormDialog {
selectionText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
selectionButton = pToolkit.createButton(lBody, "...", SWT.FLAT); //$NON-NLS-1$
// find the first non null eobject and use its associated image
- if(existingElements != null) {
+ if (existingElements != null) {
Iterator<EObject> it = existingElements.iterator();
- while(it.hasNext()) {
+ while (it.hasNext()) {
EObject next = it.next();
- if(next != null) {
+ if (next != null) {
selectionButton.setImage(UMLElementTypes.getImage(next.eClass()));
break;
}
@@ -244,15 +246,15 @@ public class SelectOrCreateDialog extends FormDialog {
/**
* Create the section to ask the user to select or create an element.
- *
+ *
* @param pParent
- * the section's parent widget
+ * the section's parent widget
* @param pToolkit
- * the form toolkit
+ * the form toolkit
*/
private void createCreationSection(Composite pParent, FormToolkit pToolkit) {
// create the section
- Section lSection = pToolkit.createSection(pParent, Section.EXPANDED | Section.TITLE_BAR);
+ Section lSection = pToolkit.createSection(pParent, ExpandableComposite.EXPANDED | ExpandableComposite.TITLE_BAR);
lSection.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));
ScrolledForm lInsideScrolledForm = pToolkit.createScrolledForm(lSection);
lInsideScrolledForm.setExpandHorizontal(true);
@@ -267,8 +269,8 @@ public class SelectOrCreateDialog extends FormDialog {
Set<EClass> possibleTypes = mapTypesPossibleParents.keySet();
// only create the type selection buttons if more than one type
// is possible
- if(possibleTypes.size() == 1) {
- defaultType = (EClass)possibleTypes.toArray()[0];
+ if (possibleTypes.size() == 1) {
+ defaultType = (EClass) possibleTypes.toArray()[0];
} else {
pToolkit.createLabel(lBody, CustomMessages.SelectOrCreateDialog_TypeLabel, SWT.NONE);
creationTypeCombo = new Combo(lBody, SWT.DROP_DOWN | SWT.READ_ONLY);
@@ -277,9 +279,9 @@ public class SelectOrCreateDialog extends FormDialog {
creationTypeCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
typeComboViewer.setLabelProvider(typeLabelProvider);
typeComboViewer.add(possibleTypes.toArray());
- if(possibleTypes.size() > 1) {
+ if (possibleTypes.size() > 1) {
// initialize selection
- defaultType = (EClass)possibleTypes.toArray()[0];
+ defaultType = (EClass) possibleTypes.toArray()[0];
typeComboViewer.setSelection(new StructuredSelection(defaultType));
}
}
@@ -327,19 +329,20 @@ public class SelectOrCreateDialog extends FormDialog {
}
};
selectionButton.addSelectionListener(selectBtnListener);
- if(creationTypeCombo != null && typeComboViewer != null) {
+ if (creationTypeCombo != null && typeComboViewer != null) {
// listener to select invocation type
ModifyListener lTypeListener = new ModifyListener() {
/**
* @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
*/
+ @Override
public void modifyText(ModifyEvent e) {
ISelection sel = typeComboViewer.getSelection();
- if(sel instanceof StructuredSelection) {
- Object type = ((StructuredSelection)sel).getFirstElement();
- if(type instanceof EClass) {
- setType((EClass)type);
+ if (sel instanceof StructuredSelection) {
+ Object type = ((StructuredSelection) sel).getFirstElement();
+ if (type instanceof EClass) {
+ setType((EClass) type);
} else {
setType(null);
}
@@ -356,6 +359,7 @@ public class SelectOrCreateDialog extends FormDialog {
/**
* @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
*/
+ @Override
public void modifyText(ModifyEvent e) {
selectedName = creationNameText.getText();
refreshOkButton();
@@ -381,10 +385,10 @@ public class SelectOrCreateDialog extends FormDialog {
*/
private void refreshOkButton() {
Button okButton = getButton(IDialogConstants.OK_ID);
- if(okButton != null && !okButton.isDisposed()) {
- if(selectionRadio.getSelection()) {
+ if (okButton != null && !okButton.isDisposed()) {
+ if (selectionRadio.getSelection()) {
okButton.setEnabled(selectedElement != null);
- } else if(nothingRadio.getSelection()) {
+ } else if (nothingRadio.getSelection()) {
okButton.setEnabled(true);
} else {
okButton.setEnabled(selectedType != null && selectedParent != null && selectedName != null && !"".equals(selectedName)); //$NON-NLS-1$
@@ -398,7 +402,7 @@ public class SelectOrCreateDialog extends FormDialog {
protected void addElementInParent(EObject selectedParent, EObject createdElement) {
// Let the command find the relation on its own.
Command addCmd = AddCommand.create(transactionalEditingDomain, selectedParent, null, Collections.singleton(createdElement));
- if(addCmd.canExecute()) {
+ if (addCmd.canExecute()) {
addCmd.execute();
}
}
@@ -406,20 +410,20 @@ public class SelectOrCreateDialog extends FormDialog {
/**
* Set correctly the element, by creating it if needed.
* Then, notifies that the ok button of this dialog has been pressed.
- *
+ *
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
- *
+ *
*/
@Override
protected void okPressed() {
// create element if needed
- if(creationRadio.getSelection()) {
+ if (creationRadio.getSelection()) {
selectedElement = UMLFactory.eINSTANCE.create(selectedType);
- if(selectedElement instanceof NamedElement) {
- ((NamedElement)selectedElement).setName(selectedName);
+ if (selectedElement instanceof NamedElement) {
+ ((NamedElement) selectedElement).setName(selectedName);
}
addElementInParent(selectedParent, selectedElement);
- } else if(nothingRadio.getSelection()) {
+ } else if (nothingRadio.getSelection()) {
selectedElement = null;
}
super.okPressed();
@@ -427,86 +431,93 @@ public class SelectOrCreateDialog extends FormDialog {
/**
* Open the dialog to choose the existing element to select
- *
+ *
*/
private void handleSelectElement() {
ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), elementLabelProvider);
dialog.setMessage(CustomMessages.SelectOrCreateDialog_SelectLabel);
dialog.setMultipleSelection(false);
dialog.setElements(filterElements(existingElements));
- if(dialog.open() == Window.OK) {
- setElementSelection((EObject)dialog.getFirstResult());
+ if (dialog.open() == Window.OK) {
+ setElementSelection((EObject) dialog.getFirstResult());
}
}
private Set<Signal> getAllSignals(List<Type> types) {
Set<Signal> accept = new HashSet<Signal>();
Set<Classifier> collected = new HashSet<Classifier>();
- for(Type t : types)
- if(t instanceof Classifier) {
- Classifier c = (Classifier)t;
+ for (Type t : types) {
+ if (t instanceof Classifier) {
+ Classifier c = (Classifier) t;
collectSignals(c, accept, collected);
}
+ }
return accept;
}
protected void collectSignals(Classifier c, Set<Signal> accept, Set<Classifier> collected) {
- if(collected.contains(c))
+ if (collected.contains(c)) {
return;
+ }
collected.add(c);
- if(c instanceof org.eclipse.uml2.uml.Class) {
- EList<Reception> receptions = ((org.eclipse.uml2.uml.Class)c).getOwnedReceptions();
- for(Reception r : receptions)
+ if (c instanceof org.eclipse.uml2.uml.Class) {
+ EList<Reception> receptions = ((org.eclipse.uml2.uml.Class) c).getOwnedReceptions();
+ for (Reception r : receptions) {
accept.add(r.getSignal());
+ }
}
EList<Property> attrs = c.getAllAttributes();
- for(Property p : attrs)
- if(p.getType() instanceof Signal) {
- accept.add((Signal)p.getType());
- } else if(p.getType() instanceof Classifier) {
- collectSignals((Classifier)p.getType(), accept, collected);
+ for (Property p : attrs) {
+ if (p.getType() instanceof Signal) {
+ accept.add((Signal) p.getType());
+ } else if (p.getType() instanceof Classifier) {
+ collectSignals((Classifier) p.getType(), accept, collected);
}
+ }
}
private Object[] filterElements(Collection<EObject> elements) {
- if(!filterSignalButton.getSelection() || types == null || types.isEmpty())
+ if (!filterSignalButton.getSelection() || types == null || types.isEmpty()) {
return elements.toArray(new EObject[elements.size()]);
+ }
Set<Signal> accept = getAllSignals(types);
List<EObject> result = new ArrayList<EObject>();
- for(EObject o : elements)
- if(!(o instanceof Signal))
+ for (EObject o : elements) {
+ if (!(o instanceof Signal)) {
result.add(o);
- else if(accept.contains(o))
+ } else if (accept.contains(o)) {
result.add(o);
+ }
+ }
return result.toArray(new EObject[result.size()]);
}
/**
* Open the dialog to choose the parent of element to create
- *
+ *
*/
private void handleSelectParent() {
ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), elementLabelProvider);
dialog.setMessage(CustomMessages.SelectOrCreateDialog_OwnerLabel);
dialog.setMultipleSelection(false);
List<EObject> possibleParents = mapTypesPossibleParents.get(selectedType);
- if(possibleParents != null) {
+ if (possibleParents != null) {
dialog.setElements(possibleParents.toArray());
}
- if(dialog.open() == Window.OK) {
- setParent((EObject)dialog.getFirstResult());
+ if (dialog.open() == Window.OK) {
+ setParent((EObject) dialog.getFirstResult());
}
}
/**
* Define the object in which element will be created (if creation mode is chosen)
- *
+ *
* @param parent
- * the selected parent
+ * the selected parent
*/
private void setParent(EObject parent) {
selectedParent = parent;
- if(selectedParent instanceof NamedElement) {
+ if (selectedParent instanceof NamedElement) {
creationParentText.setText(elementLabelProvider.getText(selectedParent));
creationParentButton.setImage(UMLElementTypes.getImage(parent.eClass()));
} else {
@@ -517,13 +528,13 @@ public class SelectOrCreateDialog extends FormDialog {
/**
* Define the name of the object that will be created by the action
- *
+ *
* @param name
- * the name of the element
+ * the name of the element
*/
private void setName(String name) {
selectedName = name;
- if(name != null) {
+ if (name != null) {
creationNameText.setText(name);
} else {
creationNameText.setText(""); //$NON-NLS-1$
@@ -533,14 +544,14 @@ public class SelectOrCreateDialog extends FormDialog {
/**
* Define the type of the object that will be created by the action
- *
+ *
* @param type
- * the type of the element
+ * the type of the element
*/
private void setType(EClass type) {
selectedType = type;
List<EObject> possibleParents = mapTypesPossibleParents.get(type);
- if(possibleParents != null && possibleParents.size() > 0) {
+ if (possibleParents != null && possibleParents.size() > 0) {
setParent(possibleParents.get(0));
} else {
setParent(null);
@@ -550,13 +561,13 @@ public class SelectOrCreateDialog extends FormDialog {
/**
* Define the object that will be returned by the action (if selection mode is chosen)
- *
+ *
* @param element
- * the selected element
+ * the selected element
*/
private void setElementSelection(EObject element) {
selectedElement = element;
- if(selectedElement instanceof NamedElement) {
+ if (selectedElement instanceof NamedElement) {
selectionText.setText(elementLabelProvider.getText(selectedElement));
} else {
selectionText.setText(""); //$NON-NLS-1$
@@ -566,15 +577,15 @@ public class SelectOrCreateDialog extends FormDialog {
/**
* Refresh the enabled and disabled elements in various sections
- *
+ *
*/
private void refreshSectionsEnable(Object radioObject) {
boolean nothingSelected = false;
boolean selectionSelected = false;
boolean creationSelected = false;
- if(selectionRadio.equals(radioObject)) {
+ if (selectionRadio.equals(radioObject)) {
selectionSelected = true;
- } else if(creationRadio.equals(radioObject)) {
+ } else if (creationRadio.equals(radioObject)) {
creationSelected = true;
} else {
nothingSelected = true;
@@ -585,7 +596,7 @@ public class SelectOrCreateDialog extends FormDialog {
selectionButton.setEnabled(selectionSelected);
// Creation widgets
creationRadio.setSelection(creationSelected);
- if(creationTypeCombo != null) {
+ if (creationTypeCombo != null) {
creationTypeCombo.setEnabled(creationSelected);
}
creationNameText.setEnabled(creationSelected);
@@ -597,7 +608,7 @@ public class SelectOrCreateDialog extends FormDialog {
/**
* Get the object that have been selected or created.
- *
+ *
* @return the object to use.
*/
public EObject getSelected() {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SelfMessageHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SelfMessageHelper.java
index bf64541b703..1b1989ab6bc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SelfMessageHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SelfMessageHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -30,14 +30,14 @@ import org.eclipse.papyrus.uml.diagram.sequence.locator.SelfMessageLabelLocator;
public class SelfMessageHelper {
private static Location getLocation(LabelEditPart label) {
- if(label == null) {
+ if (label == null) {
return null;
}
Object model = label.getModel();
- if(model instanceof Node) {
- LayoutConstraint layoutConstraint = ((Node)model).getLayoutConstraint();
- if(layoutConstraint instanceof Location) {
- return (Location)layoutConstraint;
+ if (model instanceof Node) {
+ LayoutConstraint layoutConstraint = ((Node) model).getLayoutConstraint();
+ if (layoutConstraint instanceof Location) {
+ return (Location) layoutConstraint;
}
}
return null;
@@ -47,38 +47,38 @@ public class SelfMessageHelper {
* This method only available for initialized location(x=1, y=-13).
*/
public static void updateLabelLocation(LabelEditPart label) {
- if(label == null || !(label.getParent() instanceof AbstractMessageEditPart)) {
+ if (label == null || !(label.getParent() instanceof AbstractMessageEditPart)) {
return;
}
- AbstractMessageEditPart message = (AbstractMessageEditPart)label.getParent();
- if(!isSelfLink(message)) {
+ AbstractMessageEditPart message = (AbstractMessageEditPart) label.getParent();
+ if (!isSelfLink(message)) {
return;
}
final Location location = getLocation(label);
- if(location == null) {
+ if (location == null) {
return;
}
final Point pt = new Point(location.getX(), location.getY());
- //Initialize value.
- if(pt.x == 1 && pt.y == -13) {
+ // Initialize value.
+ if (pt.x == 1 && pt.y == -13) {
message.setLayoutConstraint(label, label.getFigure(), new SelfMessageLabelLocator(message.getConnectionFigure(), label.getKeyPoint()));
}
}
public static boolean isSelfLink(AbstractMessageEditPart message) {
- if(message == null) {
+ if (message == null) {
return false;
}
EditPart source = message.getSource();
EditPart target = message.getTarget();
LifelineEditPart sourceLifeline = getLifeline(source);
LifelineEditPart targetLifeline = getLifeline(target);
- if(sourceLifeline != null) {
+ if (sourceLifeline != null) {
return sourceLifeline == targetLifeline;
}
- //Fixed bug about displaying label for gate to gate messages.
- if(source instanceof GateEditPart && target instanceof GateEditPart) {
- if(source.getParent() == target.getParent() && (source.getParent() instanceof LifelineEditPart)) {
+ // Fixed bug about displaying label for gate to gate messages.
+ if (source instanceof GateEditPart && target instanceof GateEditPart) {
+ if (source.getParent() == target.getParent() && (source.getParent() instanceof LifelineEditPart)) {
return true;
}
}
@@ -86,11 +86,11 @@ public class SelfMessageHelper {
}
private static LifelineEditPart getLifeline(EditPart editPart) {
- if(editPart == null) {
+ if (editPart == null) {
return null;
}
- if(editPart instanceof LifelineEditPart) {
- return (LifelineEditPart)editPart;
+ if (editPart instanceof LifelineEditPart) {
+ return (LifelineEditPart) editPart;
}
return getLifeline(editPart.getParent());
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceDeleteHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceDeleteHelper.java
index 0279a5db84a..b6d36d43e52 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceDeleteHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceDeleteHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -69,29 +69,29 @@ public class SequenceDeleteHelper {
/**
* Complete an ICommand which destroys an DestructionEvent element to also destroy dependent time/duration constraint/observation linked with
* these ends
- *
+ *
* @param deleteViewsCmd
- * the command to complete
+ * the command to complete
* @param editingDomain
- * the editing domain
+ * the editing domain
* @param destructionEventPart
- * the execution specification edit part on which the request is called
+ * the execution specification edit part on which the request is called
* @return the deletion command deleteViewsCmd for convenience
*/
public static CompoundCommand completeDeleteDestructionOccurenceViewCommand(CompoundCommand deleteViewsCmd, TransactionalEditingDomain editingDomain, EditPart destructionEventPart) {
- if(destructionEventPart instanceof IGraphicalEditPart) {
- EObject obj = ((IGraphicalEditPart)destructionEventPart).resolveSemanticElement();
- if(obj instanceof DestructionOccurrenceSpecification) {
+ if (destructionEventPart instanceof IGraphicalEditPart) {
+ EObject obj = ((IGraphicalEditPart) destructionEventPart).resolveSemanticElement();
+ if (obj instanceof DestructionOccurrenceSpecification) {
LifelineEditPart lifelinePart = SequenceUtil.getParentLifelinePart(destructionEventPart);
- if(lifelinePart != null) {
- for(Object lifelineChild : lifelinePart.getChildren()) {
- if(lifelineChild instanceof IBorderItemEditPart) {
- final IBorderItemEditPart timePart = (IBorderItemEditPart)lifelineChild;
- //At most one destruction event. Only parts linked to it can not move for now.
+ if (lifelinePart != null) {
+ for (Object lifelineChild : lifelinePart.getChildren()) {
+ if (lifelineChild instanceof IBorderItemEditPart) {
+ final IBorderItemEditPart timePart = (IBorderItemEditPart) lifelineChild;
+ // At most one destruction event. Only parts linked to it can not move for now.
boolean isNotLinked = OccurrenceSpecificationMoveHelper.canTimeElementPartBeYMoved(timePart);
- if(!isNotLinked) {
+ if (!isNotLinked) {
// time part is linked, delete the view
- Command deleteTimeViewCommand = new ICommandProxy(new DeleteCommand(editingDomain, (View)timePart.getModel()));
+ Command deleteTimeViewCommand = new ICommandProxy(new DeleteCommand(editingDomain, (View) timePart.getModel()));
deleteViewsCmd.add(deleteTimeViewCommand);
}
}
@@ -105,32 +105,32 @@ public class SequenceDeleteHelper {
/**
* Complete an ICommand which destroys an ExecutionSpecification element to also destroy dependent finish and start events and time/duration
* constraint/observation linked with these ends
- *
+ *
* @param deleteViewsCmd
- * the command to complete
+ * the command to complete
* @param editingDomain
- * the editing domain
+ * the editing domain
* @param executionPart
- * the execution specification edit part on which the request is called
+ * the execution specification edit part on which the request is called
* @return the deletion command deleteViewsCmd for convenience
*/
public static CompoundCommand completeDeleteMessageViewCommand(CompoundCommand deleteViewsCmd, TransactionalEditingDomain editingDomain, EditPart messagePart) {
- if(messagePart instanceof IGraphicalEditPart) {
- EObject obj = ((IGraphicalEditPart)messagePart).resolveSemanticElement();
- if(obj instanceof Message) {
- Message message = (Message)obj;
- LifelineEditPart srcLifelinePart = SequenceUtil.getParentLifelinePart(((ConnectionNodeEditPart)messagePart).getSource());
+ if (messagePart instanceof IGraphicalEditPart) {
+ EObject obj = ((IGraphicalEditPart) messagePart).resolveSemanticElement();
+ if (obj instanceof Message) {
+ Message message = (Message) obj;
+ LifelineEditPart srcLifelinePart = SequenceUtil.getParentLifelinePart(((ConnectionNodeEditPart) messagePart).getSource());
MessageEnd send = message.getSendEvent();
addDeleteRelatedTimePartsToCommand(deleteViewsCmd, editingDomain, srcLifelinePart, send);
- LifelineEditPart tgtLifelinePart = SequenceUtil.getParentLifelinePart(((ConnectionNodeEditPart)messagePart).getTarget());
+ LifelineEditPart tgtLifelinePart = SequenceUtil.getParentLifelinePart(((ConnectionNodeEditPart) messagePart).getTarget());
MessageEnd receive = message.getReceiveEvent();
addDeleteRelatedTimePartsToCommand(deleteViewsCmd, editingDomain, tgtLifelinePart, receive);
// also delete time observation links which are related to message end
- if(send instanceof OccurrenceSpecification) {
- addDeleteRelatedTimeObservationLinkCommand(deleteViewsCmd, editingDomain, (OccurrenceSpecification)send, srcLifelinePart, false);
+ if (send instanceof OccurrenceSpecification) {
+ addDeleteRelatedTimeObservationLinkCommand(deleteViewsCmd, editingDomain, (OccurrenceSpecification) send, srcLifelinePart, false);
}
- if(receive instanceof OccurrenceSpecification) {
- addDeleteRelatedTimeObservationLinkCommand(deleteViewsCmd, editingDomain, (OccurrenceSpecification)receive, tgtLifelinePart, false);
+ if (receive instanceof OccurrenceSpecification) {
+ addDeleteRelatedTimeObservationLinkCommand(deleteViewsCmd, editingDomain, (OccurrenceSpecification) receive, tgtLifelinePart, false);
}
}
}
@@ -138,14 +138,14 @@ public class SequenceDeleteHelper {
}
private static void addDeleteRelatedTimePartsToCommand(CompoundCommand deleteViewsCmd, TransactionalEditingDomain editingDomain, LifelineEditPart lifelineEP, MessageEnd messageEnd) {
- if(lifelineEP != null && messageEnd instanceof OccurrenceSpecification) {
- for(Object lifelineChild : lifelineEP.getChildren()) {
- if(lifelineChild instanceof IBorderItemEditPart) {
- final IBorderItemEditPart timePart = (IBorderItemEditPart)lifelineChild;
- int positionForEvent = SequenceUtil.positionWhereEventIsLinkedToPart((OccurrenceSpecification)messageEnd, timePart);
- if(positionForEvent != PositionConstants.NONE) {
+ if (lifelineEP != null && messageEnd instanceof OccurrenceSpecification) {
+ for (Object lifelineChild : lifelineEP.getChildren()) {
+ if (lifelineChild instanceof IBorderItemEditPart) {
+ final IBorderItemEditPart timePart = (IBorderItemEditPart) lifelineChild;
+ int positionForEvent = SequenceUtil.positionWhereEventIsLinkedToPart((OccurrenceSpecification) messageEnd, timePart);
+ if (positionForEvent != PositionConstants.NONE) {
// time part is linked, delete the view
- Command deleteTimeViewCommand = new ICommandProxy(new DeleteCommand(editingDomain, (View)timePart.getModel()));
+ Command deleteTimeViewCommand = new ICommandProxy(new DeleteCommand(editingDomain, (View) timePart.getModel()));
deleteViewsCmd.add(deleteTimeViewCommand);
}
}
@@ -156,52 +156,52 @@ public class SequenceDeleteHelper {
/**
* Complete an ICommand which destroys an ExecutionSpecification element to also destroy dependent finish and start events and time/duration
* constraint/observation linked with these ends
- *
+ *
* @param deleteViewsCmd
- * the command to complete
+ * the command to complete
* @param editingDomain
- * the editing domain
+ * the editing domain
* @param executionPart
- * the execution specification edit part on which the request is called
+ * the execution specification edit part on which the request is called
* @return the deletion command deleteViewsCmd for convenience
*/
public static CompoundCommand completeDeleteExecutionSpecificationViewCommand(CompoundCommand deleteViewsCmd, TransactionalEditingDomain editingDomain, EditPart executionPart) {
- if(executionPart instanceof IGraphicalEditPart) {
- EObject obj = ((IGraphicalEditPart)executionPart).resolveSemanticElement();
- if(obj instanceof ExecutionSpecification) {
- ExecutionSpecification execution = (ExecutionSpecification)obj;
+ if (executionPart instanceof IGraphicalEditPart) {
+ EObject obj = ((IGraphicalEditPart) executionPart).resolveSemanticElement();
+ if (obj instanceof ExecutionSpecification) {
+ ExecutionSpecification execution = (ExecutionSpecification) obj;
LifelineEditPart lifelinePart = SequenceUtil.getParentLifelinePart(executionPart);
- if(lifelinePart != null) {
- for(Object lifelineChild : lifelinePart.getChildren()) {
- if(lifelineChild instanceof IBorderItemEditPart) {
- final IBorderItemEditPart timePart = (IBorderItemEditPart)lifelineChild;
+ if (lifelinePart != null) {
+ for (Object lifelineChild : lifelinePart.getChildren()) {
+ if (lifelineChild instanceof IBorderItemEditPart) {
+ final IBorderItemEditPart timePart = (IBorderItemEditPart) lifelineChild;
OccurrenceSpecification start = execution.getStart();
OccurrenceSpecification finish = execution.getStart();
int positionForStart = SequenceUtil.positionWhereEventIsLinkedToPart(start, timePart);
int positionForFinish = SequenceUtil.positionWhereEventIsLinkedToPart(finish, timePart);
- if(positionForStart != PositionConstants.NONE || positionForFinish != PositionConstants.NONE) {
+ if (positionForStart != PositionConstants.NONE || positionForFinish != PositionConstants.NONE) {
// time part is linked, delete the view
- Command deleteTimeViewCommand = new ICommandProxy(new DeleteCommand(editingDomain, (View)timePart.getModel()));
+ Command deleteTimeViewCommand = new ICommandProxy(new DeleteCommand(editingDomain, (View) timePart.getModel()));
deleteViewsCmd.add(deleteTimeViewCommand);
}
}
}
// delete each observation linked time element
- for(Object targetConnection : lifelinePart.getTargetConnections()) {
- if(targetConnection instanceof ObservationLinkEditPart) {
- ObservationLinkEditPart observationLinkEditPart = (ObservationLinkEditPart)targetConnection;
- TimeObservationLabelEditPart source = (TimeObservationLabelEditPart)observationLinkEditPart.getSource();
+ for (Object targetConnection : lifelinePart.getTargetConnections()) {
+ if (targetConnection instanceof ObservationLinkEditPart) {
+ ObservationLinkEditPart observationLinkEditPart = (ObservationLinkEditPart) targetConnection;
+ TimeObservationLabelEditPart source = (TimeObservationLabelEditPart) observationLinkEditPart.getSource();
OccurrenceSpecification start = execution.getStart();
OccurrenceSpecification finish = execution.getFinish();
int positionForStart = SequenceUtil.positionWhereEventIsLinkedToPart(start, source);
int positionForFinish = SequenceUtil.positionWhereEventIsLinkedToPart(finish, source);
- if(positionForStart != PositionConstants.NONE) {
+ if (positionForStart != PositionConstants.NONE) {
// time part is linked, delete the view
- //Command deleteTimeViewCommand = new ICommandProxy(new DeleteCommand(editingDomain, (View)source.getModel()));
- //deleteViewsCmd.add(deleteTimeViewCommand);
+ // Command deleteTimeViewCommand = new ICommandProxy(new DeleteCommand(editingDomain, (View)source.getModel()));
+ // deleteViewsCmd.add(deleteTimeViewCommand);
addDeleteRelatedTimeObservationLinkCommand(deleteViewsCmd, editingDomain, start, lifelinePart, false);
}
- if(positionForFinish != PositionConstants.NONE) {
+ if (positionForFinish != PositionConstants.NONE) {
addDeleteRelatedTimeObservationLinkCommand(deleteViewsCmd, editingDomain, finish, lifelinePart, false);
}
}
@@ -214,44 +214,44 @@ public class SequenceDeleteHelper {
/**
* Delete the views associated with a list of elements.
- *
+ *
* @param cmd
- * the CompositeTransactionalCommand
+ * the CompositeTransactionalCommand
* @param element
- * the list of model elements
+ * the list of model elements
* @param editingDomain
- * the editing domain to use.
+ * the editing domain to use.
*/
public static void deleteView(CompositeTransactionalCommand cmd, List<Element> elements, TransactionalEditingDomain editingDomain) {
- for(Element element : elements) {
+ for (Element element : elements) {
deleteView(cmd, element, editingDomain);
}
}
/**
* Delete the views associated with an element.
- *
+ *
* @param cmd
- * the CompositeTransactionalCommand
+ * the CompositeTransactionalCommand
* @param element
- * the model element referenced by the views
+ * the model element referenced by the views
* @param editingDomain
- * the editing domain to use.
+ * the editing domain to use.
*/
public static void deleteView(CompositeTransactionalCommand cmd, Element element, TransactionalEditingDomain editingDomain) {
// Destroy its views
@SuppressWarnings("rawtypes")
List views = DiagramEditPartsUtil.getEObjectViews(element);
- for(Object object : views) {
- if(object instanceof View) {
- cmd.add(new DeleteCommand(editingDomain, (View)object));
+ for (Object object : views) {
+ if (object instanceof View) {
+ cmd.add(new DeleteCommand(editingDomain, (View) object));
}
}
}
/**
* Add complete delete message command
- *
+ *
* @param req
* @param editPart
* @return Command
@@ -259,20 +259,20 @@ public class SequenceDeleteHelper {
public static Command completeDeleteMessageCommand(DestroyElementRequest req, EditPart editPart) {
EObject selectedEObject = req.getElementToDestroy();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
+ if (provider != null) {
// Retrieve delete command from the Element Edit service
ICommand deleteCommand = provider.getEditCommand(req);
- if(deleteCommand != null) {
+ if (deleteCommand != null) {
CompositeCommand command = new CompositeCommand(deleteCommand.getLabel());
command.add(deleteCommand);
- Message message = (Message)selectedEObject;
+ Message message = (Message) selectedEObject;
MessageEnd receiveEvent = message.getReceiveEvent();
- if(receiveEvent != null) {
+ if (receiveEvent != null) {
DestroyElementRequest myReq = new DestroyElementRequest(req.getEditingDomain(), receiveEvent, false);
command.add(new DestroyElementCommand(myReq));
}
MessageEnd sendEvent = message.getSendEvent();
- if(sendEvent != null) {
+ if (sendEvent != null) {
DestroyElementRequest myReq = new DestroyElementRequest(req.getEditingDomain(), sendEvent, false);
command.add(new DestroyElementCommand(myReq));
}
@@ -292,11 +292,11 @@ public class SequenceDeleteHelper {
DestroyElementRequest delEnd = new DestroyElementRequest(req.getEditingDomain(), es.getFinish(), false);
deleteElementsCommand.add(new ICommandProxy(new DestroyElementCommand(delEnd)));
destroyMessageEvents(deleteElementsCommand, host, req.getEditingDomain());
- if(host.getParent() instanceof LifelineEditPart) {
+ if (host.getParent() instanceof LifelineEditPart) {
List<OccurrenceSpecification> oss = new ArrayList<OccurrenceSpecification>();
oss.add(es.getStart());
oss.add(es.getFinish());
- SequenceDeleteHelper.addDeleteRelatedTimeObservationLinkCommand(deleteElementsCommand, req.getEditingDomain(), (LifelineEditPart)host.getParent(), oss, true);
+ SequenceDeleteHelper.addDeleteRelatedTimeObservationLinkCommand(deleteElementsCommand, req.getEditingDomain(), (LifelineEditPart) host.getParent(), oss, true);
}
SequenceDeleteHelper.addDestroyExecutionSpecificationChildrenCommand(deleteElementsCommand, req.getEditingDomain(), host);
}
@@ -307,32 +307,32 @@ public class SequenceDeleteHelper {
}
static void destroyMessageEvents(CompoundCommand deleteElementsCommand, List list, TransactionalEditingDomain transactionalEditingDomain) {
- for(Object o : list)
- if(o instanceof ConnectionEditPart) {
- EObject model = ((ConnectionEditPart)o).resolveSemanticElement();
- if(model instanceof Message) {
- Message message = (Message)model;
+ for (Object o : list) {
+ if (o instanceof ConnectionEditPart) {
+ EObject model = ((ConnectionEditPart) o).resolveSemanticElement();
+ if (model instanceof Message) {
+ Message message = (Message) model;
MessageEnd receiveEvent = message.getReceiveEvent();
- if(receiveEvent != null) {
+ if (receiveEvent != null) {
DestroyElementRequest myReq = new DestroyElementRequest(transactionalEditingDomain, receiveEvent, false);
- //Sometimes, the message end is also the end of a execution.
+ // Sometimes, the message end is also the end of a execution.
RestoreExecutionEndAdvice provider = new RestoreExecutionEndAdvice();
- if(provider != null) {
+ if (provider != null) {
ICommand editCommand = provider.getAfterEditCommand(myReq);
- if(editCommand != null && editCommand.canExecute()) {
+ if (editCommand != null && editCommand.canExecute()) {
deleteElementsCommand.add(new ICommandProxy(editCommand));
}
}
deleteElementsCommand.add(new ICommandProxy(new DestroyElementCommand(myReq)));
}
MessageEnd sendEvent = message.getSendEvent();
- if(sendEvent != null) {
+ if (sendEvent != null) {
DestroyElementRequest myReq = new DestroyElementRequest(transactionalEditingDomain, sendEvent, false);
- //Sometimes, the message end is also the end of a execution.
+ // Sometimes, the message end is also the end of a execution.
RestoreExecutionEndAdvice provider = new RestoreExecutionEndAdvice();
- if(provider != null) {
+ if (provider != null) {
ICommand editCommand = provider.getAfterEditCommand(myReq);
- if(editCommand != null && editCommand.canExecute()) {
+ if (editCommand != null && editCommand.canExecute()) {
deleteElementsCommand.add(new ICommandProxy(editCommand));
}
}
@@ -340,11 +340,12 @@ public class SequenceDeleteHelper {
}
}
}
+ }
}
static void addDestroyExecutionSpecificationChildrenCommand(CompoundCommand deleteElementsCommand, TransactionalEditingDomain editingDomain, ShapeNodeEditPart part) {
List<ShapeNodeEditPart> list = LifelineXYLayoutEditPolicy.getAffixedExecutionSpecificationEditParts(part);
- for(ShapeNodeEditPart p : list) {
+ for (ShapeNodeEditPart p : list) {
Request request = new EditCommandRequestWrapper(new DestroyElementRequest(p.resolveSemanticElement(), false));
deleteElementsCommand.add(p.getCommand(request));
destroyMessageEvents(deleteElementsCommand, p.getSourceConnections(), editingDomain);
@@ -354,7 +355,7 @@ public class SequenceDeleteHelper {
/**
* Add delete message related time observation link command
- *
+ *
* @param editingDomain
* @param editPart
* @param command
@@ -362,12 +363,12 @@ public class SequenceDeleteHelper {
* @param deleteRelatedEvent
*/
static void addDeleteMessageRelatedTimeObservationLinkCommand(TransactionalEditingDomain editingDomain, EditPart editPart, CompoundCommand compoundCommand, MessageEnd messageEnd, boolean deleteRelatedEvent) {
- //Bug fix: messageEnd maybe a Gate instance.
- if(messageEnd != null && messageEnd instanceof OccurrenceSpecification) {
- OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification)messageEnd;
+ // Bug fix: messageEnd maybe a Gate instance.
+ if (messageEnd != null && messageEnd instanceof OccurrenceSpecification) {
+ OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification) messageEnd;
EList<Lifeline> receiveCovereds = occurrenceSpecification.getCovereds();
- if(receiveCovereds.size() > 0) {
- LifelineEditPart srcLifelinePart = (LifelineEditPart)SequenceUtil.getEditPart(editPart, receiveCovereds.get(0), LifelineEditPart.class);
+ if (receiveCovereds.size() > 0) {
+ LifelineEditPart srcLifelinePart = (LifelineEditPart) SequenceUtil.getEditPart(editPart, receiveCovereds.get(0), LifelineEditPart.class);
addDeleteRelatedTimeObservationLinkCommand(compoundCommand, editingDomain, occurrenceSpecification, srcLifelinePart, deleteRelatedEvent);
}
}
@@ -375,7 +376,7 @@ public class SequenceDeleteHelper {
/**
* Add command for deleting time observation link which related to occurence specification
- *
+ *
* @param deleteViewsCmd
* @param editingDomain
* @param os
@@ -390,7 +391,7 @@ public class SequenceDeleteHelper {
/**
* Add command for deleting time observation link which related to occurence specification
- *
+ *
* @param deleteViewsCmd
* @param editingDomain
* @param srcLifelinePart
@@ -399,19 +400,19 @@ public class SequenceDeleteHelper {
*/
public static void addDeleteRelatedTimeObservationLinkCommand(CompoundCommand deleteViewsCmd, TransactionalEditingDomain editingDomain, LifelineEditPart srcLifelinePart, List<OccurrenceSpecification> oss, boolean deleteRelatedEvent) {
List<TimeObservationLabelEditPart> timeObservationEditParts = SequenceUtil.findOccurenceSpecificationRelatedTimeObservationPart(srcLifelinePart, oss);
- for(final TimeObservationLabelEditPart timeObservationEditPart : timeObservationEditParts) {
- View view = (View)timeObservationEditPart.getModel();
+ for (final TimeObservationLabelEditPart timeObservationEditPart : timeObservationEditParts) {
+ View view = (View) timeObservationEditPart.getModel();
EList sourceEdges = view.getSourceEdges();
- for(Object sourceEdge : sourceEdges) {
- Command deleteTimeViewCommand = new ICommandProxy(new DeleteCommand(editingDomain, (View)sourceEdge));
+ for (Object sourceEdge : sourceEdges) {
+ Command deleteTimeViewCommand = new ICommandProxy(new DeleteCommand(editingDomain, (View) sourceEdge));
deleteViewsCmd.add(deleteTimeViewCommand);
}
- if(deleteRelatedEvent) {
+ if (deleteRelatedEvent) {
deleteViewsCmd.add(new ICommandProxy(new AbstractTransactionalCommand(editingDomain, "Remove TimeObservation related event", null) {
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- TimeObservation timeObservation = (TimeObservation)(timeObservationEditPart.resolveSemanticElement());
+ TimeObservation timeObservation = (TimeObservation) (timeObservationEditPart.resolveSemanticElement());
timeObservation.setEvent(null);
return CommandResult.newOKCommandResult();
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceLinkMappingHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceLinkMappingHelper.java
index 95252400b20..7ec62c53163 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceLinkMappingHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceLinkMappingHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -31,7 +31,7 @@ import org.eclipse.uml2.uml.OccurrenceSpecification;
/**
* A link mapping helper used for dNd.
- *
+ *
* See {@link CustomDiagramDragDropEditPolicy}
*/
public class SequenceLinkMappingHelper implements ILinkMappingHelper {
@@ -46,7 +46,7 @@ public class SequenceLinkMappingHelper implements ILinkMappingHelper {
/**
* Gets the single instance of ClassLinkMappingHelper.
- *
+ *
* @return single instance of ClassLinkMappingHelper
*/
public static SequenceLinkMappingHelper getInstance() {
@@ -63,18 +63,19 @@ public class SequenceLinkMappingHelper implements ILinkMappingHelper {
/**
* {@inheritDoc}
*/
+ @Override
public Collection<?> getSource(Element link) {
return LinkMappingHelper.getSource(link, new CommonSourceUMLSwitch() {
@Override
public java.util.Collection<?> caseMessage(org.eclipse.uml2.uml.Message object) {
- if(object.getSendEvent() != null) {
+ if (object.getSendEvent() != null) {
MessageEnd messageEnd = object.getSendEvent();
- if(messageEnd instanceof MessageOccurrenceSpecification) {
- return ((MessageOccurrenceSpecification)messageEnd).getCovereds();
- } else if(messageEnd instanceof Gate) {
+ if (messageEnd instanceof MessageOccurrenceSpecification) {
+ return ((MessageOccurrenceSpecification) messageEnd).getCovereds();
+ } else if (messageEnd instanceof Gate) {
ArrayList<Element> sources = new ArrayList<Element>();
- sources.add(((Gate)messageEnd)/* .getOwner() */);//The gate view is available now.
+ sources.add((messageEnd)/* .getOwner() */);// The gate view is available now.
return sources;
}
} else {
@@ -85,7 +86,7 @@ public class SequenceLinkMappingHelper implements ILinkMappingHelper {
@Override
public Collection<?> caseGeneralOrdering(GeneralOrdering object) {
- if(object.getBefore() != null) {
+ if (object.getBefore() != null) {
OccurrenceSpecification before = object.getBefore();
return before.getCovereds();
}
@@ -97,18 +98,19 @@ public class SequenceLinkMappingHelper implements ILinkMappingHelper {
/**
* {@inheritDoc}
*/
+ @Override
public Collection<?> getTarget(Element link) {
return LinkMappingHelper.getTarget(link, new CommonTargetUMLSwitch() {
@Override
public java.util.Collection<?> caseMessage(org.eclipse.uml2.uml.Message object) {
- if(object.getReceiveEvent() != null) {
+ if (object.getReceiveEvent() != null) {
MessageEnd messageEnd = object.getReceiveEvent();
- if(messageEnd instanceof MessageOccurrenceSpecification) {
- return ((MessageOccurrenceSpecification)messageEnd).getCovereds();
- } else if(messageEnd instanceof Gate) {
+ if (messageEnd instanceof MessageOccurrenceSpecification) {
+ return ((MessageOccurrenceSpecification) messageEnd).getCovereds();
+ } else if (messageEnd instanceof Gate) {
ArrayList<Element> sources = new ArrayList<Element>();
- sources.add(((Gate)messageEnd)/* .getOwner() */);//The gate view is available now.
+ sources.add((messageEnd)/* .getOwner() */);// The gate view is available now.
return sources;
}
} else {
@@ -119,7 +121,7 @@ public class SequenceLinkMappingHelper implements ILinkMappingHelper {
@Override
public Collection<?> caseGeneralOrdering(GeneralOrdering object) {
- if(object.getAfter() != null) {
+ if (object.getAfter() != null) {
OccurrenceSpecification after = object.getAfter();
return after.getCovereds();
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceRequestConstant.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceRequestConstant.java
index 60fb0cbcd77..a2419e0e645 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceRequestConstant.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceRequestConstant.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -29,7 +29,7 @@ public interface SequenceRequestConstant {
public static final String TARGET_MODEL_CONTAINER = "Target model container"; //$NON-NLS-1$
/** A key used in the creation of a CORegion to identify the lifeline graphically containing the CoRegion */
- public static final String LIFELINE_GRAPHICAL_CONTAINER = "Lifeline graphical container"; //$NON-NLS-1$
+ public static final String LIFELINE_GRAPHICAL_CONTAINER = "Lifeline graphical container"; //$NON-NLS-1$
/** The occurrence specification(s) which are the nearest from a creation request */
public static final String NEAREST_OCCURRENCE_SPECIFICATION = "Nearest occurrence specification"; //$NON-NLS-1$
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceUtil.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceUtil.java
index de8d138f3bf..e8520fc6e21 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceUtil.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceUtil.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -168,9 +168,9 @@ public class SequenceUtil {
* Find the container interaction fragment at the given location.
* The elements are drawn under the lifeline, but their model container is an interaction.
* It can be of type Interaction or InteractionOperand.
- *
+ *
* @param location
- * the location
+ * the location
* @return the interaction or null
*/
public static InteractionFragment findInteractionFragmentContainerAt(Point location, EditPart hostEditPart) {
@@ -183,76 +183,76 @@ public class SequenceUtil {
* Find the container interaction fragment for the given bounds.
* The elements are drawn under the lifeline, but their model container is an interaction.
* It can be of type Interaction or InteractionOperand.
- *
+ *
* @param bounds
- * the bounds
+ * the bounds
* @param hostEditPart
- * any adit part in the corresponding diagram
+ * any adit part in the corresponding diagram
* @return the interaction or null
*/
@SuppressWarnings("unchecked")
public static InteractionFragment findInteractionFragmentContainerAt(Rectangle bounds, EditPart hostEditPart) {
- if(hostEditPart == null) {
+ if (hostEditPart == null) {
return null;
}
InteractionFragment container = null;
Set<InteractionFragment> coveredInteractions = new HashSet<InteractionFragment>();
Set<CombinedFragment> coveredCF = new HashSet<CombinedFragment>();
Set<Entry<Object, EditPart>> allEditPartEntries = hostEditPart.getViewer().getEditPartRegistry().entrySet();
- for(Entry<Object, EditPart> epEntry : allEditPartEntries) {
+ for (Entry<Object, EditPart> epEntry : allEditPartEntries) {
EditPart ep = epEntry.getValue();
- if(ep instanceof ShapeEditPart) {
- ShapeEditPart sep = (ShapeEditPart)ep;
+ if (ep instanceof ShapeEditPart) {
+ ShapeEditPart sep = (ShapeEditPart) ep;
EObject eObject = sep.resolveSemanticElement();
- if(eObject instanceof Interaction || eObject instanceof InteractionOperand) {
+ if (eObject instanceof Interaction || eObject instanceof InteractionOperand) {
Rectangle figureBounds = getAbsoluteBounds(sep);
- if(figureBounds.contains(bounds)) {
- coveredInteractions.add((InteractionFragment)eObject);
+ if (figureBounds.contains(bounds)) {
+ coveredInteractions.add((InteractionFragment) eObject);
}
- } else if(eObject instanceof CombinedFragment) {
+ } else if (eObject instanceof CombinedFragment) {
// handle case when the figure is located in the CF header as if it were in the first Interaction Operand
Rectangle figureBounds = getAbsoluteBounds(sep);
- if(figureBounds.contains(bounds)) {
- coveredCF.add((CombinedFragment)eObject);
+ if (figureBounds.contains(bounds)) {
+ coveredCF.add((CombinedFragment) eObject);
}
}
}
}
// inspect coveredCF to ensure at least on child operand is in coveredInteractions list
- for(CombinedFragment cf : coveredCF) {
+ for (CombinedFragment cf : coveredCF) {
List<InteractionOperand> operands = cf.getOperands();
- if(operands.size() > 0 && Collections.disjoint(operands, coveredInteractions)) {
+ if (operands.size() > 0 && Collections.disjoint(operands, coveredInteractions)) {
// bounds are in the header, add the first operand
coveredInteractions.add(operands.get(0));
}
}
// for each interaction verify if its children list does not contain an other covered interaction
// if it doesn't we have found the top-level interaction
- for(InteractionFragment ift : coveredInteractions) {
+ for (InteractionFragment ift : coveredInteractions) {
boolean subiftFounded = false;
- if(ift instanceof Interaction) {
- for(InteractionFragment subift : ((Interaction)ift).getFragments()) {
- if(subift instanceof CombinedFragment) {
- for(InteractionOperand io : ((CombinedFragment)subift).getOperands()) {
- if(coveredInteractions.contains(io)) {
+ if (ift instanceof Interaction) {
+ for (InteractionFragment subift : ((Interaction) ift).getFragments()) {
+ if (subift instanceof CombinedFragment) {
+ for (InteractionOperand io : ((CombinedFragment) subift).getOperands()) {
+ if (coveredInteractions.contains(io)) {
subiftFounded = true;
}
}
}
}
}
- if(!subiftFounded && ift instanceof InteractionOperand) {
- for(InteractionFragment subift : ((InteractionOperand)ift).getFragments()) {
- if(subift instanceof CombinedFragment) {
- for(InteractionOperand io : ((CombinedFragment)subift).getOperands()) {
- if(coveredInteractions.contains(io)) {
+ if (!subiftFounded && ift instanceof InteractionOperand) {
+ for (InteractionFragment subift : ((InteractionOperand) ift).getFragments()) {
+ if (subift instanceof CombinedFragment) {
+ for (InteractionOperand io : ((CombinedFragment) subift).getOperands()) {
+ if (coveredInteractions.contains(io)) {
subiftFounded = true;
}
}
}
}
}
- if(!subiftFounded) {
+ if (!subiftFounded) {
container = ift;
break;
}
@@ -262,11 +262,11 @@ public class SequenceUtil {
/**
* Find the location on the lifeline of an interaction fragment
- *
+ *
* @param lifelineEditPart
- * the lifeline edit part
+ * the lifeline edit part
* @param fragment
- * the searched interaction fragment
+ * the searched interaction fragment
* @return the absolute location or null if not found
*/
public static Point findLocationOfEvent(LifelineEditPart lifelineEditPart, InteractionFragment fragment) {
@@ -274,113 +274,113 @@ public class SequenceUtil {
}
public static Point findLocationOfEvent(LifelineEditPart lifelineEditPart, InteractionFragment fragment, boolean relyOnMessageFigure) {
- if(lifelineEditPart == null) {
+ if (lifelineEditPart == null) {
return null;
}
// Search for corresponding node edit part out of the lifeline.
- if(fragment instanceof CombinedFragment || fragment instanceof Continuation || fragment instanceof InteractionOperand || fragment instanceof InteractionUse || fragment instanceof Interaction) {
+ if (fragment instanceof CombinedFragment || fragment instanceof Continuation || fragment instanceof InteractionOperand || fragment instanceof InteractionUse || fragment instanceof Interaction) {
List<View> views = DiagramEditPartsUtil.findViews(fragment, lifelineEditPart.getViewer());
- for(View view : views) {
+ for (View view : views) {
EditPart part = DiagramEditPartsUtil.getEditPartFromView(view, lifelineEditPart);
boolean isCombinedFragment = part instanceof CombinedFragmentEditPart || part instanceof CombinedFragment2EditPart;
boolean isContinuation = part instanceof ContinuationEditPart;
boolean isInteractionOperand = part instanceof InteractionOperandEditPart;
boolean isInteractionUse = part instanceof InteractionUseEditPart;
boolean isInteraction = part instanceof InteractionEditPart;
- if(isCombinedFragment || isContinuation || isInteractionOperand || isInteractionUse || isInteraction) {
- Rectangle bounds = getAbsoluteBounds((GraphicalEditPart)part);
+ if (isCombinedFragment || isContinuation || isInteractionOperand || isInteractionUse || isInteraction) {
+ Rectangle bounds = getAbsoluteBounds((GraphicalEditPart) part);
return bounds.getTop();
}
}
} else {
// search on graphical children of the lifeline
List<?> children = lifelineEditPart.getChildren();
- for(Object child : children) {
+ for (Object child : children) {
// check destruction event
- if(child instanceof DestructionOccurrenceSpecificationEditPart) {
- EObject destructionOccurence = ((GraphicalEditPart)child).resolveSemanticElement();
+ if (child instanceof DestructionOccurrenceSpecificationEditPart) {
+ EObject destructionOccurence = ((GraphicalEditPart) child).resolveSemanticElement();
EObject lifeline = lifelineEditPart.resolveSemanticElement();
- if(destructionOccurence instanceof DestructionOccurrenceSpecification && lifeline instanceof Lifeline && fragment instanceof DestructionOccurrenceSpecification) {
- DestructionOccurrenceSpecification destEvent = ((DestructionOccurrenceSpecification)fragment);
- if(destEvent != null && destEvent.equals(destructionOccurence)) {
- Rectangle bounds = getAbsoluteBounds((GraphicalEditPart)child);
+ if (destructionOccurence instanceof DestructionOccurrenceSpecification && lifeline instanceof Lifeline && fragment instanceof DestructionOccurrenceSpecification) {
+ DestructionOccurrenceSpecification destEvent = ((DestructionOccurrenceSpecification) fragment);
+ if (destEvent != null && destEvent.equals(destructionOccurence)) {
+ Rectangle bounds = getAbsoluteBounds((GraphicalEditPart) child);
return bounds.getCenter();
}
}
}
// check in children executions
- if(child instanceof ActionExecutionSpecificationEditPart || child instanceof BehaviorExecutionSpecificationEditPart) {
- if(fragment instanceof ExecutionSpecification) {
+ if (child instanceof ActionExecutionSpecificationEditPart || child instanceof BehaviorExecutionSpecificationEditPart) {
+ if (fragment instanceof ExecutionSpecification) {
// check the execution
- EObject element = ((GraphicalEditPart)child).resolveSemanticElement();
- if(element instanceof ExecutionSpecification) {
- if(fragment.equals(element)) {
- Rectangle bounds = getAbsoluteBounds((GraphicalEditPart)child);
+ EObject element = ((GraphicalEditPart) child).resolveSemanticElement();
+ if (element instanceof ExecutionSpecification) {
+ if (fragment.equals(element)) {
+ Rectangle bounds = getAbsoluteBounds((GraphicalEditPart) child);
return bounds.getTop();
}
}
- } else if(fragment instanceof ExecutionOccurrenceSpecification) {
+ } else if (fragment instanceof ExecutionOccurrenceSpecification) {
// check start and finish events of the execution
- EObject element = ((GraphicalEditPart)child).resolveSemanticElement();
- if(element instanceof ExecutionSpecification) {
- if(fragment.equals(((ExecutionSpecification)element).getStart())) {
- Rectangle bounds = getAbsoluteBounds((GraphicalEditPart)child);
+ EObject element = ((GraphicalEditPart) child).resolveSemanticElement();
+ if (element instanceof ExecutionSpecification) {
+ if (fragment.equals(((ExecutionSpecification) element).getStart())) {
+ Rectangle bounds = getAbsoluteBounds((GraphicalEditPart) child);
return bounds.getTop();
- } else if(fragment.equals(((ExecutionSpecification)element).getFinish())) {
- Rectangle bounds = getAbsoluteBounds((GraphicalEditPart)child);
+ } else if (fragment.equals(((ExecutionSpecification) element).getFinish())) {
+ Rectangle bounds = getAbsoluteBounds((GraphicalEditPart) child);
return bounds.getBottom();
}
}
- } else if(fragment instanceof MessageOccurrenceSpecification) {
+ } else if (fragment instanceof MessageOccurrenceSpecification) {
// check messages to and from the execution
- Point loc = findLocationOfMessageOccurrence((GraphicalEditPart)child, (MessageOccurrenceSpecification)fragment, relyOnMessageFigure);
- if(loc != null) {
+ Point loc = findLocationOfMessageOccurrence((GraphicalEditPart) child, (MessageOccurrenceSpecification) fragment, relyOnMessageFigure);
+ if (loc != null) {
return loc;
}
}
}
// check in children StateInvariant
- if(child instanceof StateInvariantEditPart) {
- if(fragment instanceof StateInvariant) {
+ if (child instanceof StateInvariantEditPart) {
+ if (fragment instanceof StateInvariant) {
// check the StateInvariant
- EObject element = ((GraphicalEditPart)child).resolveSemanticElement();
- if(element instanceof StateInvariant) {
- if(fragment.equals(element)) {
- Rectangle bounds = getAbsoluteBounds((GraphicalEditPart)child);
+ EObject element = ((GraphicalEditPart) child).resolveSemanticElement();
+ if (element instanceof StateInvariant) {
+ if (fragment.equals(element)) {
+ Rectangle bounds = getAbsoluteBounds((GraphicalEditPart) child);
return bounds.getTop();
}
}
- } else if(fragment instanceof MessageOccurrenceSpecification) {
+ } else if (fragment instanceof MessageOccurrenceSpecification) {
// check messages to and from the execution
- Point loc = findLocationOfMessageOccurrence((GraphicalEditPart)child, (MessageOccurrenceSpecification)fragment, relyOnMessageFigure);
- if(loc != null) {
+ Point loc = findLocationOfMessageOccurrence((GraphicalEditPart) child, (MessageOccurrenceSpecification) fragment, relyOnMessageFigure);
+ if (loc != null) {
return loc;
}
}
}
}
- if(fragment instanceof MessageOccurrenceSpecification) {
+ if (fragment instanceof MessageOccurrenceSpecification) {
// check messages to and from the lifeline
- Point loc = findLocationOfMessageOccurrence(lifelineEditPart, (MessageOccurrenceSpecification)fragment, relyOnMessageFigure);
- if(loc != null) {
+ Point loc = findLocationOfMessageOccurrence(lifelineEditPart, (MessageOccurrenceSpecification) fragment, relyOnMessageFigure);
+ if (loc != null) {
return loc;
}
}
}
// If we found nothing, this may be a sync message receive
- if(fragment instanceof MessageOccurrenceSpecification) {
- boolean isSync = ((MessageOccurrenceSpecification)fragment).getMessage() != null && MessageSort.SYNCH_CALL_LITERAL.equals(((MessageOccurrenceSpecification)fragment).getMessage().getMessageSort());
- if(isSync) {
+ if (fragment instanceof MessageOccurrenceSpecification) {
+ boolean isSync = ((MessageOccurrenceSpecification) fragment).getMessage() != null && MessageSort.SYNCH_CALL_LITERAL.equals(((MessageOccurrenceSpecification) fragment).getMessage().getMessageSort());
+ if (isSync) {
// sync message should trigger an execution specification start. Find and return the corresponding start.
EObject container = fragment.eContainer();
EObject lifeline = lifelineEditPart.resolveSemanticElement();
InteractionFragment nextFragment = InteractionFragmentHelper.findNextFragment(fragment, container);
- while(nextFragment != null && nextFragment.getCovereds().contains(lifeline)) {
- if(nextFragment.getCovereds().contains(lifeline)) {
+ while (nextFragment != null && nextFragment.getCovereds().contains(lifeline)) {
+ if (nextFragment.getCovereds().contains(lifeline)) {
// Found next event of lifeline. Check if it really is a start.
- if(nextFragment instanceof ExecutionOccurrenceSpecification) {
- ExecutionSpecification exe = ((ExecutionOccurrenceSpecification)nextFragment).getExecution();
- if(exe != null && EcoreUtil.equals(exe.getStart(), nextFragment)) {
+ if (nextFragment instanceof ExecutionOccurrenceSpecification) {
+ ExecutionSpecification exe = ((ExecutionOccurrenceSpecification) nextFragment).getExecution();
+ if (exe != null && EcoreUtil.equals(exe.getStart(), nextFragment)) {
// return location of the start.
return findLocationOfEvent(lifelineEditPart, nextFragment);
}
@@ -397,31 +397,31 @@ public class SequenceUtil {
/**
* Get the bounds of an edit part
- *
+ *
* @param part
- * edit part to find bounds
+ * edit part to find bounds
* @return part's bounds in absolute coordinates
*/
public static Rectangle getAbsoluteBounds(IGraphicalEditPart part) {
// take bounds from figure
Rectangle bounds = part.getFigure().getBounds().getCopy();
- if(part.getNotationView() instanceof Node) {
+ if (part.getNotationView() instanceof Node) {
// rather update with up to date model bounds
- Node node = (Node)part.getNotationView();
+ Node node = (Node) part.getNotationView();
LayoutConstraint cst = node.getLayoutConstraint();
- if(cst instanceof Bounds) {
- Bounds b = (Bounds)cst;
+ if (cst instanceof Bounds) {
+ Bounds b = (Bounds) cst;
Point parentLoc = part.getFigure().getParent().getBounds().getLocation();
- if(b.getX() > 0) {
+ if (b.getX() > 0) {
bounds.x = b.getX() + parentLoc.x;
}
- if(b.getY() > 0) {
+ if (b.getY() > 0) {
bounds.y = b.getY() + parentLoc.y;
}
- if(b.getHeight() != -1) {
+ if (b.getHeight() != -1) {
bounds.height = b.getHeight();
}
- if(b.getWidth() != -1) {
+ if (b.getWidth() != -1) {
bounds.width = b.getWidth();
}
}
@@ -432,11 +432,11 @@ public class SequenceUtil {
/**
* Get the extremity of a connection edit part
- *
+ *
* @param connection
- * the connection edit part to find extremity
+ * the connection edit part to find extremity
* @param isStart
- * true to find the start, false for the end
+ * true to find the start, false for the end
* @return connection's extremity in absolute coordinates or null
*/
public static Point getAbsoluteEdgeExtremity(ConnectionNodeEditPart connection, boolean isStart) {
@@ -445,50 +445,50 @@ public class SequenceUtil {
static Point getAbsoluteEdgeExtremity(ConnectionNodeEditPart connection, boolean isStart, boolean relyOnMessageFigure) {
Connection msgFigure = connection.getConnectionFigure();
- if(connection.getNotationView() instanceof Edge && !relyOnMessageFigure) {
+ if (connection.getNotationView() instanceof Edge && !relyOnMessageFigure) {
// rather take up to date model information
- Edge edge = (Edge)connection.getNotationView();
+ Edge edge = (Edge) connection.getNotationView();
Anchor idAnchor = null;
ConnectionAnchor conAnchor = null;
Object part = null;
- if(isStart && connection.getSource() instanceof IGraphicalEditPart) {
+ if (isStart && connection.getSource() instanceof IGraphicalEditPart) {
View linkedFigure = edge.getSource();
// connection.getSource() may be not up to date, get part for linkedFigure
part = connection.getSource().getViewer().getEditPartRegistry().get(linkedFigure);
idAnchor = edge.getSourceAnchor();
conAnchor = msgFigure.getSourceAnchor();
- } else if(!isStart && connection.getTarget() instanceof IGraphicalEditPart) {
+ } else if (!isStart && connection.getTarget() instanceof IGraphicalEditPart) {
View linkedFigure = edge.getTarget();
// connection.getTarget() may be not up to date, get part for linkedFigure
part = connection.getTarget().getViewer().getEditPartRegistry().get(linkedFigure);
idAnchor = edge.getTargetAnchor();
conAnchor = msgFigure.getTargetAnchor();
}
- if(part instanceof IGraphicalEditPart && idAnchor instanceof IdentityAnchor && conAnchor != null) {
+ if (part instanceof IGraphicalEditPart && idAnchor instanceof IdentityAnchor && conAnchor != null) {
// take up to date bounds of the linked part in case it is moved
- Rectangle linkedPartBounds = getAbsoluteBounds((IGraphicalEditPart)part);
+ Rectangle linkedPartBounds = getAbsoluteBounds((IGraphicalEditPart) part);
IFigure anchorOwningFigure = conAnchor.getOwner();
- IFigure partFigure = ((IGraphicalEditPart)part).getFigure();
+ IFigure partFigure = ((IGraphicalEditPart) part).getFigure();
Dimension delta = anchorOwningFigure.getBounds().getLocation().getDifference(partFigure.getBounds().getLocation());
// get position from anchor id
- String oldTerminal = ((IdentityAnchor)idAnchor).getId();
+ String oldTerminal = ((IdentityAnchor) idAnchor).getId();
PrecisionPoint pp = BaseSlidableAnchor.parseTerminalString(oldTerminal);
- if(pp.preciseX() <= 1 && pp.preciseX() >= 0 && pp.preciseY() >= 0 && pp.preciseY() <= 1) {
- int xPos = linkedPartBounds.x + delta.width + (int)Math.round(anchorOwningFigure.getBounds().width * pp.preciseX);
- int yPos = linkedPartBounds.y + delta.height + (int)Math.round(anchorOwningFigure.getBounds().height * pp.preciseY);
+ if (pp.preciseX() <= 1 && pp.preciseX() >= 0 && pp.preciseY() >= 0 && pp.preciseY() <= 1) {
+ int xPos = linkedPartBounds.x + delta.width + (int) Math.round(anchorOwningFigure.getBounds().width * pp.preciseX);
+ int yPos = linkedPartBounds.y + delta.height + (int) Math.round(anchorOwningFigure.getBounds().height * pp.preciseY);
return new Point(xPos, yPos);
}
}
}
// can not get from model, rely on figure
- if(msgFigure instanceof AbstractPointListShape) {
+ if (msgFigure instanceof AbstractPointListShape) {
Point extremity;
- if(isStart) {
+ if (isStart) {
// start event of the message
- extremity = ((AbstractPointListShape)msgFigure).getStart().getCopy();
+ extremity = ((AbstractPointListShape) msgFigure).getStart().getCopy();
} else {
// finish event of the message
- extremity = ((AbstractPointListShape)msgFigure).getEnd().getCopy();
+ extremity = ((AbstractPointListShape) msgFigure).getEnd().getCopy();
}
msgFigure.getParent().translateToAbsolute(extremity);
return extremity;
@@ -498,11 +498,11 @@ public class SequenceUtil {
/**
* Find the location on a node of a message occurrence specification
- *
+ *
* @param nodeEditPart
- * the node edit part which to check incoming and outgoing messages
+ * the node edit part which to check incoming and outgoing messages
* @param event
- * the message occurrence specification
+ * the message occurrence specification
* @return the absolute location or null
*/
public static Point findLocationOfMessageOccurrence(GraphicalEditPart nodeEditPart, MessageOccurrenceSpecification event) {
@@ -512,28 +512,28 @@ public class SequenceUtil {
static Point findLocationOfMessageOccurrence(GraphicalEditPart nodeEditPart, MessageOccurrenceSpecification event, boolean relyOnMessageFigure) {
// messages to the node
List<?> targetConnections = nodeEditPart.getTargetConnections();
- for(Object conn : targetConnections) {
- if(conn instanceof ConnectionNodeEditPart) {
- EObject element = ((ConnectionNodeEditPart)conn).resolveSemanticElement();
- if(element instanceof Message && event.equals(((Message)element).getReceiveEvent())) {
+ for (Object conn : targetConnections) {
+ if (conn instanceof ConnectionNodeEditPart) {
+ EObject element = ((ConnectionNodeEditPart) conn).resolveSemanticElement();
+ if (element instanceof Message && event.equals(((Message) element).getReceiveEvent())) {
// finish event of the message
- IFigure figure = ((ConnectionNodeEditPart)conn).getFigure();
- if(figure instanceof AbstractPointListShape) {
- return getAbsoluteEdgeExtremity((ConnectionNodeEditPart)conn, false, relyOnMessageFigure);
+ IFigure figure = ((ConnectionNodeEditPart) conn).getFigure();
+ if (figure instanceof AbstractPointListShape) {
+ return getAbsoluteEdgeExtremity((ConnectionNodeEditPart) conn, false, relyOnMessageFigure);
}
}
}
}
// messages from the node
List<?> sourceConnections = nodeEditPart.getSourceConnections();
- for(Object conn : sourceConnections) {
- if(conn instanceof ConnectionNodeEditPart) {
- EObject element = ((ConnectionNodeEditPart)conn).resolveSemanticElement();
- if(element instanceof Message && event.equals(((Message)element).getSendEvent())) {
+ for (Object conn : sourceConnections) {
+ if (conn instanceof ConnectionNodeEditPart) {
+ EObject element = ((ConnectionNodeEditPart) conn).resolveSemanticElement();
+ if (element instanceof Message && event.equals(((Message) element).getSendEvent())) {
// start event of the message
- IFigure figure = ((ConnectionNodeEditPart)conn).getFigure();
- if(figure instanceof AbstractPointListShape) {
- return getAbsoluteEdgeExtremity((ConnectionNodeEditPart)conn, true, relyOnMessageFigure);
+ IFigure figure = ((ConnectionNodeEditPart) conn).getFigure();
+ if (figure instanceof AbstractPointListShape) {
+ return getAbsoluteEdgeExtremity((ConnectionNodeEditPart) conn, true, relyOnMessageFigure);
}
}
}
@@ -543,38 +543,38 @@ public class SequenceUtil {
/**
* Find the location on a node of a execution occurrence specification
- *
+ *
* @param nodeEditPart
- * the node edit part which to check incoming and outgoing messages
+ * the node edit part which to check incoming and outgoing messages
* @param event
- * the execution occurrence specification
+ * the execution occurrence specification
* @return the absolute location or null
*/
public static Point findLocationOfExecutionOccurrence(GraphicalEditPart nodeEditPart, ExecutionOccurrenceSpecification event) {
// child to the node
List<?> children = nodeEditPart.getChildren();
- for(Object child : children) {
- if(child instanceof ActionExecutionSpecificationEditPart) {
- EObject element = ((ActionExecutionSpecificationEditPart)child).resolveSemanticElement();
- if(element != null && element instanceof ExecutionSpecification) {
- IFigure figure = ((ActionExecutionSpecificationEditPart)child).getFigure();
+ for (Object child : children) {
+ if (child instanceof ActionExecutionSpecificationEditPart) {
+ EObject element = ((ActionExecutionSpecificationEditPart) child).resolveSemanticElement();
+ if (element != null && element instanceof ExecutionSpecification) {
+ IFigure figure = ((ActionExecutionSpecificationEditPart) child).getFigure();
Rectangle copy = figure.getBounds().getCopy();
figure.translateToAbsolute(copy);
- if(event.equals(((ExecutionSpecification)element).getStart())) {
+ if (event.equals(((ExecutionSpecification) element).getStart())) {
return copy.getTop();
- } else if(event.equals(((ExecutionSpecification)element).getFinish())) {
+ } else if (event.equals(((ExecutionSpecification) element).getFinish())) {
return copy.getBottom();
}
}
- } else if(child instanceof BehaviorExecutionSpecificationEditPart) {
- EObject element = ((BehaviorExecutionSpecificationEditPart)child).resolveSemanticElement();
- if(element != null && element instanceof ExecutionSpecification) {
- IFigure figure = ((BehaviorExecutionSpecificationEditPart)child).getFigure();
+ } else if (child instanceof BehaviorExecutionSpecificationEditPart) {
+ EObject element = ((BehaviorExecutionSpecificationEditPart) child).resolveSemanticElement();
+ if (element != null && element instanceof ExecutionSpecification) {
+ IFigure figure = ((BehaviorExecutionSpecificationEditPart) child).getFigure();
Rectangle copy = figure.getBounds().getCopy();
figure.translateToAbsolute(copy);
- if(event.equals(((ExecutionSpecification)element).getStart())) {
+ if (event.equals(((ExecutionSpecification) element).getStart())) {
return copy.getTop();
- } else if(event.equals(((ExecutionSpecification)element).getFinish())) {
+ } else if (event.equals(((ExecutionSpecification) element).getFinish())) {
return copy.getBottom();
}
}
@@ -586,84 +586,84 @@ public class SequenceUtil {
/**
* Find the occurrence specification covering the lifeline near the given location.
* If none is close enough, null is returned.
- *
+ *
* @param location
- * the location
+ * the location
* @param lifelineEditPart
- * the Lifeline edit part
+ * the Lifeline edit part
* @return an entry with the nearest OccurrenceSpecification(s) and its corresponding location or null if none is close enough
*/
public static Entry<Point, List<OccurrenceSpecification>> findNearestEvent(Point location, LifelineEditPart lifelineEditPart) {
- if(lifelineEditPart == null) {
+ if (lifelineEditPart == null) {
return null;
}
// Map referencing children occurrences by their location on the lifeline.
Map<Point, List<OccurrenceSpecification>> occurrences = new HashMap<Point, List<OccurrenceSpecification>>();
- // //Find message end directly.
- // EditPart editPart = lifelineEditPart.getViewer().findObjectAt(location);
- // if (editPart instanceof MessageEndEditPart){
- // MessageEndEditPart messageEnd = (MessageEndEditPart)editPart;
- // IFigure figure = messageEnd.getFigure();
- // Rectangle bounds = figure.getBounds().getCopy();
- // figure.translateToAbsolute(bounds);
- // EObject element = messageEnd.resolveSemanticElement();
- // if (element instanceof MessageOccurrenceSpecification){
- // ArrayList<OccurrenceSpecification> arrayList = new ArrayList<OccurrenceSpecification>();
- // arrayList.add((MessageOccurrenceSpecification)element);
- // occurrences.put(bounds.getCenter(), arrayList);
- // return occurrences.entrySet().iterator().next();
- // }
- // } else if(editPart instanceof ExecutionSpecificationEndEditPart) {
- // ExecutionSpecificationEndEditPart end = (ExecutionSpecificationEndEditPart)editPart;
- // OccurrenceSpecification event = (OccurrenceSpecification)end.resolveSemanticElement();
- // AbstractExecutionSpecificationEditPart parent = (AbstractExecutionSpecificationEditPart)end.getParent();
- // ExecutionSpecification es = (ExecutionSpecification)parent.resolveSemanticElement();
- // Rectangle bounds = getAbsoluteBounds(parent);
- // ArrayList<OccurrenceSpecification> arrayList = new ArrayList<OccurrenceSpecification>();
- // arrayList.add((OccurrenceSpecification)event);
- // if(event == es.getStart()) {
- // occurrences.put(bounds.getTop(), arrayList);
- // } else {
- // occurrences.put(bounds.getBottom(), arrayList);
- // }
- // return occurrences.entrySet().iterator().next();
- // }
+ // //Find message end directly.
+ // EditPart editPart = lifelineEditPart.getViewer().findObjectAt(location);
+ // if (editPart instanceof MessageEndEditPart){
+ // MessageEndEditPart messageEnd = (MessageEndEditPart)editPart;
+ // IFigure figure = messageEnd.getFigure();
+ // Rectangle bounds = figure.getBounds().getCopy();
+ // figure.translateToAbsolute(bounds);
+ // EObject element = messageEnd.resolveSemanticElement();
+ // if (element instanceof MessageOccurrenceSpecification){
+ // ArrayList<OccurrenceSpecification> arrayList = new ArrayList<OccurrenceSpecification>();
+ // arrayList.add((MessageOccurrenceSpecification)element);
+ // occurrences.put(bounds.getCenter(), arrayList);
+ // return occurrences.entrySet().iterator().next();
+ // }
+ // } else if(editPart instanceof ExecutionSpecificationEndEditPart) {
+ // ExecutionSpecificationEndEditPart end = (ExecutionSpecificationEndEditPart)editPart;
+ // OccurrenceSpecification event = (OccurrenceSpecification)end.resolveSemanticElement();
+ // AbstractExecutionSpecificationEditPart parent = (AbstractExecutionSpecificationEditPart)end.getParent();
+ // ExecutionSpecification es = (ExecutionSpecification)parent.resolveSemanticElement();
+ // Rectangle bounds = getAbsoluteBounds(parent);
+ // ArrayList<OccurrenceSpecification> arrayList = new ArrayList<OccurrenceSpecification>();
+ // arrayList.add((OccurrenceSpecification)event);
+ // if(event == es.getStart()) {
+ // occurrences.put(bounds.getTop(), arrayList);
+ // } else {
+ // occurrences.put(bounds.getBottom(), arrayList);
+ // }
+ // return occurrences.entrySet().iterator().next();
+ // }
// graphical children of the lifeline
List<?> children = lifelineEditPart.getChildren();
- for(Object child : children) {
+ for (Object child : children) {
// children executions
- if(child instanceof ActionExecutionSpecificationEditPart || child instanceof BehaviorExecutionSpecificationEditPart) {
- EObject element = ((GraphicalEditPart)child).resolveSemanticElement();
- if(element instanceof ExecutionSpecification) {
+ if (child instanceof ActionExecutionSpecificationEditPart || child instanceof BehaviorExecutionSpecificationEditPart) {
+ EObject element = ((GraphicalEditPart) child).resolveSemanticElement();
+ if (element instanceof ExecutionSpecification) {
// find start and finish events of the execution
- Rectangle bounds = getAbsoluteBounds((GraphicalEditPart)child);
- if(!occurrences.containsKey(bounds.getTop())) {
+ Rectangle bounds = getAbsoluteBounds((GraphicalEditPart) child);
+ if (!occurrences.containsKey(bounds.getTop())) {
// there should be at most 2 occurrences (with starting message)
occurrences.put(bounds.getTop(), new ArrayList<OccurrenceSpecification>(2));
}
- occurrences.get(bounds.getTop()).add(((ExecutionSpecification)element).getStart());
- if(!occurrences.containsKey(bounds.getBottom())) {
+ occurrences.get(bounds.getTop()).add(((ExecutionSpecification) element).getStart());
+ if (!occurrences.containsKey(bounds.getBottom())) {
occurrences.put(bounds.getBottom(), new ArrayList<OccurrenceSpecification>(1));
}
- occurrences.get(bounds.getBottom()).add(((ExecutionSpecification)element).getFinish());
+ occurrences.get(bounds.getBottom()).add(((ExecutionSpecification) element).getFinish());
// messages to and from the execution
- completeOccurrencesMapWithMessages((GraphicalEditPart)child, occurrences);
+ completeOccurrencesMapWithMessages((GraphicalEditPart) child, occurrences);
}
}
// destruction event
- if(child instanceof DestructionOccurrenceSpecificationEditPart) {
- EObject destructionOccurence = ((GraphicalEditPart)child).resolveSemanticElement();
+ if (child instanceof DestructionOccurrenceSpecificationEditPart) {
+ EObject destructionOccurence = ((GraphicalEditPart) child).resolveSemanticElement();
EObject lifeline = lifelineEditPart.resolveSemanticElement();
- if(destructionOccurence instanceof DestructionOccurrenceSpecification && lifeline instanceof Lifeline) {
- for(InteractionFragment occurence : ((Lifeline)lifeline).getCoveredBys()) {
- if(occurence instanceof DestructionOccurrenceSpecification) {
- DestructionOccurrenceSpecification currentOccurence = ((DestructionOccurrenceSpecification)occurence);
- if(destructionOccurence.equals(currentOccurence)) {
- Rectangle bounds = getAbsoluteBounds((GraphicalEditPart)child);
- if(!occurrences.containsKey(bounds.getCenter())) {
+ if (destructionOccurence instanceof DestructionOccurrenceSpecification && lifeline instanceof Lifeline) {
+ for (InteractionFragment occurence : ((Lifeline) lifeline).getCoveredBys()) {
+ if (occurence instanceof DestructionOccurrenceSpecification) {
+ DestructionOccurrenceSpecification currentOccurence = ((DestructionOccurrenceSpecification) occurence);
+ if (destructionOccurence.equals(currentOccurence)) {
+ Rectangle bounds = getAbsoluteBounds((GraphicalEditPart) child);
+ if (!occurrences.containsKey(bounds.getCenter())) {
occurrences.put(bounds.getCenter(), new ArrayList<OccurrenceSpecification>(2));
}
- occurrences.get(bounds.getCenter()).add((OccurrenceSpecification)occurence);
+ occurrences.get(bounds.getCenter()).add((OccurrenceSpecification) occurence);
break;
}
}
@@ -671,8 +671,8 @@ public class SequenceUtil {
}
}
// CoRegion
- if(child instanceof CombinedFragment2EditPart) {
- completeOccurrencesMapWithMessages((GraphicalEditPart)child, occurrences);
+ if (child instanceof CombinedFragment2EditPart) {
+ completeOccurrencesMapWithMessages((GraphicalEditPart) child, occurrences);
}
}
// messages to and from the lifeline
@@ -680,15 +680,15 @@ public class SequenceUtil {
// Find the nearest object within acceptable distance
double smallerDistance = MAXIMAL_DISTANCE_FROM_EVENT;
Entry<Point, List<OccurrenceSpecification>> nearestObject = null;
- for(Entry<Point, List<OccurrenceSpecification>> entry : occurrences.entrySet()) {
+ for (Entry<Point, List<OccurrenceSpecification>> entry : occurrences.entrySet()) {
double distance = location.getDistance(entry.getKey());
- if(distance < smallerDistance) {
+ if (distance < smallerDistance) {
smallerDistance = distance;
nearestObject = entry;
- } else if(distance == smallerDistance && nearestObject != null) {
+ } else if (distance == smallerDistance && nearestObject != null) {
// two events at the exact same distance.
// Keep both so the best one can be used
- if(entry.getValue() instanceof MessageOccurrenceSpecification) {
+ if (entry.getValue() instanceof MessageOccurrenceSpecification) {
nearestObject.getValue().addAll(entry.getValue());
}
}
@@ -698,45 +698,45 @@ public class SequenceUtil {
/**
* Complete the map of occurrences and their location, by taking in account messages from and to the node edit part
- *
+ *
* @param nodeEditPart
- * part to consider message around
+ * part to consider message around
* @param occurrencesMap
- * the map to complete
+ * the map to complete
*/
private static void completeOccurrencesMapWithMessages(GraphicalEditPart nodeEditPart, Map<Point, List<OccurrenceSpecification>> occurrencesMap) {
// messages to the node
List<?> targetConnections = nodeEditPart.getTargetConnections();
- for(Object conn : targetConnections) {
- if(conn instanceof ConnectionNodeEditPart) {
- EObject element = ((ConnectionNodeEditPart)conn).resolveSemanticElement();
- if(element instanceof Message && ((Message)element).getReceiveEvent() instanceof MessageOccurrenceSpecification) {
+ for (Object conn : targetConnections) {
+ if (conn instanceof ConnectionNodeEditPart) {
+ EObject element = ((ConnectionNodeEditPart) conn).resolveSemanticElement();
+ if (element instanceof Message && ((Message) element).getReceiveEvent() instanceof MessageOccurrenceSpecification) {
// finish events of the message
- IFigure figure = ((ConnectionNodeEditPart)conn).getFigure();
- if(figure instanceof AbstractPointListShape) {
- Point end = getAbsoluteEdgeExtremity((ConnectionNodeEditPart)conn, false);
- if(!occurrencesMap.containsKey(end)) {
+ IFigure figure = ((ConnectionNodeEditPart) conn).getFigure();
+ if (figure instanceof AbstractPointListShape) {
+ Point end = getAbsoluteEdgeExtremity((ConnectionNodeEditPart) conn, false);
+ if (!occurrencesMap.containsKey(end)) {
occurrencesMap.put(end, new ArrayList<OccurrenceSpecification>(1));
}
- occurrencesMap.get(end).add((MessageOccurrenceSpecification)((Message)element).getReceiveEvent());
+ occurrencesMap.get(end).add((MessageOccurrenceSpecification) ((Message) element).getReceiveEvent());
}
}
}
}
// messages from the node
List<?> sourceConnections = nodeEditPart.getSourceConnections();
- for(Object conn : sourceConnections) {
- if(conn instanceof ConnectionNodeEditPart) {
- EObject element = ((ConnectionNodeEditPart)conn).resolveSemanticElement();
- if(element instanceof Message && ((Message)element).getSendEvent() instanceof MessageOccurrenceSpecification) {
+ for (Object conn : sourceConnections) {
+ if (conn instanceof ConnectionNodeEditPart) {
+ EObject element = ((ConnectionNodeEditPart) conn).resolveSemanticElement();
+ if (element instanceof Message && ((Message) element).getSendEvent() instanceof MessageOccurrenceSpecification) {
// start events of the message
- IFigure figure = ((ConnectionNodeEditPart)conn).getFigure();
- if(figure instanceof AbstractPointListShape) {
- Point start = getAbsoluteEdgeExtremity((ConnectionNodeEditPart)conn, true);
- if(!occurrencesMap.containsKey(start)) {
+ IFigure figure = ((ConnectionNodeEditPart) conn).getFigure();
+ if (figure instanceof AbstractPointListShape) {
+ Point start = getAbsoluteEdgeExtremity((ConnectionNodeEditPart) conn, true);
+ if (!occurrencesMap.containsKey(start)) {
occurrencesMap.put(start, new ArrayList<OccurrenceSpecification>(1));
}
- occurrencesMap.get(start).add((MessageOccurrenceSpecification)((Message)element).getSendEvent());
+ occurrencesMap.get(start).add((MessageOccurrenceSpecification) ((Message) element).getSendEvent());
}
}
}
@@ -745,44 +745,43 @@ public class SequenceUtil {
/**
* The position of the part where the event is linked
- *
+ *
* @param occSpec
- * the occurrence specification
+ * the occurrence specification
* @param timeElementPart
- * the part representing time element (duration/time constraint/observation)
- * @return one of {@link PositionConstants#TOP}, {@link PositionConstants#CENTER}, {@link PositionConstants#BOTTOM},
- * {@link PositionConstants#NONE}
+ * the part representing time element (duration/time constraint/observation)
+ * @return one of {@link PositionConstants#TOP}, {@link PositionConstants#CENTER}, {@link PositionConstants#BOTTOM}, {@link PositionConstants#NONE}
*/
public static int positionWhereEventIsLinkedToPart(OccurrenceSpecification occSpec, IBorderItemEditPart timeElementPart) {
EObject timeElement = timeElementPart.resolveSemanticElement();
- if(timeElement instanceof TimeObservation) {
- if(occSpec.equals(((TimeObservation)timeElement).getEvent())) {
+ if (timeElement instanceof TimeObservation) {
+ if (occSpec.equals(((TimeObservation) timeElement).getEvent())) {
return PositionConstants.CENTER;
} else {
return PositionConstants.NONE;
}
- } else if(timeElement instanceof TimeConstraint) {
- if(((TimeConstraint)timeElement).getConstrainedElements().contains(occSpec)) {
+ } else if (timeElement instanceof TimeConstraint) {
+ if (((TimeConstraint) timeElement).getConstrainedElements().contains(occSpec)) {
return PositionConstants.CENTER;
} else {
return PositionConstants.NONE;
}
- } else if(timeElement instanceof DurationConstraint) {
- if(((DurationConstraint)timeElement).getConstrainedElements().contains(occSpec)) {
- List<Element> events = ((DurationConstraint)timeElement).getConstrainedElements();
+ } else if (timeElement instanceof DurationConstraint) {
+ if (((DurationConstraint) timeElement).getConstrainedElements().contains(occSpec)) {
+ List<Element> events = ((DurationConstraint) timeElement).getConstrainedElements();
LifelineEditPart lifelinePart = getParentLifelinePart(timeElementPart);
- if(lifelinePart != null && events.size() >= 2) {
+ if (lifelinePart != null && events.size() >= 2) {
OccurrenceSpecification otherEvent = null;
- if(!occSpec.equals(events.get(0)) && events.get(0) instanceof OccurrenceSpecification) {
- otherEvent = (OccurrenceSpecification)events.get(0);
- } else if(!occSpec.equals(events.get(1)) && events.get(1) instanceof OccurrenceSpecification) {
- otherEvent = (OccurrenceSpecification)events.get(1);
+ if (!occSpec.equals(events.get(0)) && events.get(0) instanceof OccurrenceSpecification) {
+ otherEvent = (OccurrenceSpecification) events.get(0);
+ } else if (!occSpec.equals(events.get(1)) && events.get(1) instanceof OccurrenceSpecification) {
+ otherEvent = (OccurrenceSpecification) events.get(1);
}
- if(otherEvent != null) {
+ if (otherEvent != null) {
Point otherLoc = findLocationOfEvent(lifelinePart, otherEvent);
Point thisLoc = findLocationOfEvent(lifelinePart, occSpec);
- if(otherLoc != null && thisLoc != null) {
- if(otherLoc.y > thisLoc.y) {
+ if (otherLoc != null && thisLoc != null) {
+ if (otherLoc.y > thisLoc.y) {
return PositionConstants.TOP;
} else {
return PositionConstants.BOTTOM;
@@ -799,16 +798,16 @@ public class SequenceUtil {
/**
* Return the lifeline edit part containing this part (directly or indirectly)
- *
+ *
* @param nodeEditPart
- * the contained edit part or itself
+ * the contained edit part or itself
* @return lifeline edit part or null
*/
public static LifelineEditPart getParentLifelinePart(EditPart nodeEditPart) {
EditPart parent = nodeEditPart;
- while(parent != null) {
- if(parent instanceof LifelineEditPart) {
- return (LifelineEditPart)parent;
+ while (parent != null) {
+ if (parent instanceof LifelineEditPart) {
+ return (LifelineEditPart) parent;
} else {
parent = parent.getParent();
}
@@ -818,66 +817,66 @@ public class SequenceUtil {
/**
* Get the edit part (message, execution, or destruction event) which starts or finishes with the event on the given lifeline part
- *
+ *
* @param lifelinePart
- * the lifeline edit part on which the event is located
+ * the lifeline edit part on which the event is located
* @param event
- * the event
+ * the event
* @return the edit part of which an end is defined by event on the lifelinePart edit part
*/
public static EditPart getLinkedEditPart(EditPart lifelinePart, OccurrenceSpecification event) {
- if(event instanceof MessageOccurrenceSpecification) {
+ if (event instanceof MessageOccurrenceSpecification) {
// get parts representing the message linked with the event
- Message message = ((MessageOccurrenceSpecification)event).getMessage();
- if(message == null) {
+ Message message = ((MessageOccurrenceSpecification) event).getMessage();
+ if (message == null) {
return null;
}
Collection<Setting> settings = CacheAdapter.getInstance().getNonNavigableInverseReferences(message);
- for(Setting ref : settings) {
- if(NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
- View view = (View)ref.getEObject();
+ for (Setting ref : settings) {
+ if (NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
+ View view = (View) ref.getEObject();
EditPart part = DiagramEditPartsUtil.getEditPartFromView(view, lifelinePart);
// the message part must start or finish on the lifeline (with the event)
- if(part instanceof ConnectionEditPart) {
+ if (part instanceof ConnectionEditPart) {
EditPart lifelineChild = null;
- if(event.equals(message.getSendEvent())) {
- lifelineChild = ((ConnectionEditPart)part).getSource();
- } else if(event.equals(message.getReceiveEvent())) {
- lifelineChild = ((ConnectionEditPart)part).getTarget();
+ if (event.equals(message.getSendEvent())) {
+ lifelineChild = ((ConnectionEditPart) part).getSource();
+ } else if (event.equals(message.getReceiveEvent())) {
+ lifelineChild = ((ConnectionEditPart) part).getTarget();
}
LifelineEditPart parentLifeline = getParentLifelinePart(lifelineChild);
- if(lifelinePart.equals(parentLifeline)) {
+ if (lifelinePart.equals(parentLifeline)) {
return part;
}
}
}
}
- } else if(event instanceof ExecutionOccurrenceSpecification) {
+ } else if (event instanceof ExecutionOccurrenceSpecification) {
// get parts representing the execution linked with the event
- ExecutionSpecification execution = ((ExecutionOccurrenceSpecification)event).getExecution();
- if(execution == null) {
+ ExecutionSpecification execution = ((ExecutionOccurrenceSpecification) event).getExecution();
+ if (execution == null) {
return null;
}
Collection<Setting> settings = CacheAdapter.getInstance().getNonNavigableInverseReferences(execution);
- for(Setting ref : settings) {
- if(NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
- View view = (View)ref.getEObject();
+ for (Setting ref : settings) {
+ if (NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
+ View view = (View) ref.getEObject();
EditPart part = DiagramEditPartsUtil.getEditPartFromView(view, lifelinePart);
// the execution part must be on the lifeline
EditPart lifelineChild = part;
LifelineEditPart parentLifeline = getParentLifelinePart(lifelineChild);
- if(lifelinePart.equals(parentLifeline)) {
+ if (lifelinePart.equals(parentLifeline)) {
return part;
}
}
}
} else {
// get parts representing the destruction event linked with the event
- for(Object lifelineChild : lifelinePart.getChildren()) {
- if(lifelineChild instanceof DestructionOccurrenceSpecificationEditPart) {
- EObject destr = ((DestructionOccurrenceSpecificationEditPart)lifelineChild).resolveSemanticElement();
- if(destr instanceof DestructionOccurrenceSpecification && destr.equals(event)) {
- return (EditPart)lifelineChild;
+ for (Object lifelineChild : lifelinePart.getChildren()) {
+ if (lifelineChild instanceof DestructionOccurrenceSpecificationEditPart) {
+ EObject destr = ((DestructionOccurrenceSpecificationEditPart) lifelineChild).resolveSemanticElement();
+ if (destr instanceof DestructionOccurrenceSpecification && destr.equals(event)) {
+ return (EditPart) lifelineChild;
}
}
}
@@ -887,18 +886,18 @@ public class SequenceUtil {
/**
* Get the object safely casted as a list of OccurrenceSpecification
- *
+ *
* @param occurrenceSpecificationList
- * the object which is supposed to be a list of OccurrenceSpecification
+ * the object which is supposed to be a list of OccurrenceSpecification
*/
public static List<OccurrenceSpecification> getAsOccSpecList(Object occurrenceSpecificationList) {
- if(occurrenceSpecificationList instanceof List<?>) {
- List<?> list = (List<?>)occurrenceSpecificationList;
- if(!list.isEmpty()) {
+ if (occurrenceSpecificationList instanceof List<?>) {
+ List<?> list = (List<?>) occurrenceSpecificationList;
+ if (!list.isEmpty()) {
List<OccurrenceSpecification> newList = new ArrayList<OccurrenceSpecification>(list.size());
- for(Object elt : list) {
- if(elt instanceof OccurrenceSpecification) {
- newList.add((OccurrenceSpecification)elt);
+ for (Object elt : list) {
+ if (elt instanceof OccurrenceSpecification) {
+ newList.add((OccurrenceSpecification) elt);
}
}
return newList;
@@ -909,43 +908,43 @@ public class SequenceUtil {
/**
* Get the pair of OccurrenceSpecification which a duration constraint or observation should be created between
- *
+ *
* @param occ1List
- * the list of occurrences at the same time, among which the first one must be chosen
+ * the list of occurrences at the same time, among which the first one must be chosen
* @param occ2List
- * the list of occurrences at the same time, among which the second one must be chosen
+ * the list of occurrences at the same time, among which the second one must be chosen
* @return size two array of OccurrenceSpecification which can be linked or null
*/
public static OccurrenceSpecification[] getPairOfCorrespondingOccSpec(List<OccurrenceSpecification> occ1List, List<OccurrenceSpecification> occ2List) {
// check for occurrences linked by a message
- for(OccurrenceSpecification occ1 : occ1List) {
- for(OccurrenceSpecification occ2 : occ2List) {
- if(DurationConstraintHelper.endsOfSameMessage(occ1, occ2)) {
+ for (OccurrenceSpecification occ1 : occ1List) {
+ for (OccurrenceSpecification occ2 : occ2List) {
+ if (DurationConstraintHelper.endsOfSameMessage(occ1, occ2)) {
// we must link occurrences of a message
- return new OccurrenceSpecification[]{ occ1, occ2 };
+ return new OccurrenceSpecification[] { occ1, occ2 };
}
}
}
// check for occurrences on a same lifeline
- for(OccurrenceSpecification occ1 : occ1List) {
- if(occ1 instanceof MessageOccurrenceSpecification) {
- Message mess = ((MessageOccurrenceSpecification)occ1).getMessage();
- if(mess.getReceiveEvent().equals(occ1) && MessageSort.SYNCH_CALL_LITERAL.equals(mess.getMessageSort())) {
+ for (OccurrenceSpecification occ1 : occ1List) {
+ if (occ1 instanceof MessageOccurrenceSpecification) {
+ Message mess = ((MessageOccurrenceSpecification) occ1).getMessage();
+ if (mess.getReceiveEvent().equals(occ1) && MessageSort.SYNCH_CALL_LITERAL.equals(mess.getMessageSort())) {
// filter receive event, we prefer the corresponding start event at the same location
continue;
}
}
- for(OccurrenceSpecification occ2 : occ2List) {
- if(occ2 instanceof MessageOccurrenceSpecification) {
- Message mess = ((MessageOccurrenceSpecification)occ2).getMessage();
- if(mess.getReceiveEvent().equals(occ2) && MessageSort.SYNCH_CALL_LITERAL.equals(mess.getMessageSort())) {
+ for (OccurrenceSpecification occ2 : occ2List) {
+ if (occ2 instanceof MessageOccurrenceSpecification) {
+ Message mess = ((MessageOccurrenceSpecification) occ2).getMessage();
+ if (mess.getReceiveEvent().equals(occ2) && MessageSort.SYNCH_CALL_LITERAL.equals(mess.getMessageSort())) {
// filter receive event, we prefer the corresponding start event at the same location
continue;
}
}
- if(DurationConstraintHelper.coversSameLifeline(occ1, occ2)) {
+ if (DurationConstraintHelper.coversSameLifeline(occ1, occ2)) {
// we must link occurrences on a same lifeline
- return new OccurrenceSpecification[]{ occ1, occ2 };
+ return new OccurrenceSpecification[] { occ1, occ2 };
}
}
}
@@ -954,7 +953,7 @@ public class SequenceUtil {
public static List<Element> getCombinedFragmentAssociatedElement(CombinedFragment cf) {
List<Element> elements = new LinkedList<Element>();
- for(InteractionOperand operand : cf.getOperands()) {
+ for (InteractionOperand operand : cf.getOperands()) {
// Add all elements related to this operand
elements.addAll(getInteractionOperandAssociatedElement(operand));
// Add this operand
@@ -965,15 +964,15 @@ public class SequenceUtil {
public static List<Element> getInteractionOperandAssociatedElement(InteractionOperand interactionOperand) {
List<Element> elements = new LinkedList<Element>();
- for(InteractionFragment itf : interactionOperand.getFragments()) {
- if(itf instanceof CombinedFragment) {
+ for (InteractionFragment itf : interactionOperand.getFragments()) {
+ if (itf instanceof CombinedFragment) {
// add the combinedFragment
- elements.addAll(getCombinedFragmentAssociatedElement((CombinedFragment)itf));
+ elements.addAll(getCombinedFragmentAssociatedElement((CombinedFragment) itf));
}
elements.add(itf);
- if(itf instanceof MessageOccurrenceSpecification) {
- MessageOccurrenceSpecification mos = (MessageOccurrenceSpecification)itf;
- if(mos.getMessage() != null) {
+ if (itf instanceof MessageOccurrenceSpecification) {
+ MessageOccurrenceSpecification mos = (MessageOccurrenceSpecification) itf;
+ if (mos.getMessage() != null) {
elements.add(mos.getMessage());
}
}
@@ -982,16 +981,16 @@ public class SequenceUtil {
}
public static void handleMessageSortChange(EditingDomain editingDomain, Notification notification, Message message, MessageSort expectedMessageSort) {
- //This restriction isn't needed anymore, as the Property View offers a refactoring
- //facility for the MessageSort. The refactoring is only available for AsynchCall to
- //AsynchSignal and vice-versa.
- //However, the modification of the MessageSort from the "Advanced" property view should still be forbidden.
+ // This restriction isn't needed anymore, as the Property View offers a refactoring
+ // facility for the MessageSort. The refactoring is only available for AsynchCall to
+ // AsynchSignal and vice-versa.
+ // However, the modification of the MessageSort from the "Advanced" property view should still be forbidden.
Object feature = notification.getFeature();
- if(UMLPackage.eINSTANCE.getMessage_MessageSort().equals(feature) && !expectedMessageSort.equals(notification.getNewValue())) {
+ if (UMLPackage.eINSTANCE.getMessage_MessageSort().equals(feature) && !expectedMessageSort.equals(notification.getNewValue())) {
Object oldValue = notification.getOldValue();
Object newValue = notification.getNewValue();
- if(oldValue instanceof MessageSort) {
- if(!((oldValue == MessageSort.ASYNCH_CALL_LITERAL && newValue == MessageSort.ASYNCH_SIGNAL_LITERAL) || (oldValue == MessageSort.ASYNCH_SIGNAL_LITERAL && newValue == MessageSort.ASYNCH_CALL_LITERAL))) {
+ if (oldValue instanceof MessageSort) {
+ if (!((oldValue == MessageSort.ASYNCH_CALL_LITERAL && newValue == MessageSort.ASYNCH_SIGNAL_LITERAL) || (oldValue == MessageSort.ASYNCH_SIGNAL_LITERAL && newValue == MessageSort.ASYNCH_CALL_LITERAL))) {
MessageDialog.openWarning(Display.getCurrent().getActiveShell(), BLOCK_SORT_MODIFICATION_TITLE, BLOCK_SORT_MODIFICATION_MSG);
CommandHelper.executeCommandWithoutHistory(editingDomain, SetCommand.create(editingDomain, message, feature, notification.getOldValue()), true);
return;
@@ -1005,15 +1004,15 @@ public class SequenceUtil {
Set<Lifeline> coveredLifelines = new HashSet<Lifeline>();
// retrieve all the edit parts in the registry
Set<Entry<Object, EditPart>> allEditPartEntries = hostEditPart.getViewer().getEditPartRegistry().entrySet();
- for(Entry<Object, EditPart> epEntry : allEditPartEntries) {
+ for (Entry<Object, EditPart> epEntry : allEditPartEntries) {
EditPart ep = epEntry.getValue();
- if(ep instanceof ShapeEditPart) {
- ShapeEditPart sep = (ShapeEditPart)ep;
+ if (ep instanceof ShapeEditPart) {
+ ShapeEditPart sep = (ShapeEditPart) ep;
EObject elem = sep.getNotationView().getElement();
- if(elem instanceof Lifeline) {
+ if (elem instanceof Lifeline) {
Rectangle figureBounds = getAbsoluteBounds(sep);
- if(selectionRect.intersects(figureBounds)) {
- coveredLifelines.add((Lifeline)elem);
+ if (selectionRect.intersects(figureBounds)) {
+ coveredLifelines.add((Lifeline) elem);
}
}
}
@@ -1024,67 +1023,67 @@ public class SequenceUtil {
/**
* retrieve all the interaction fragments and their related ift at least partially covered by the rectangle, including sub ift like
* interaction operands in combined fragment.
- *
+ *
* @param selectionRect
- * the rectangle where to look for ift.
+ * the rectangle where to look for ift.
* @param hostEditPart
- * the host edit part used to retrieve all the edit parts in the registry.
+ * the host edit part used to retrieve all the edit parts in the registry.
* @param ignoreSet
- * a set of ift to ignore.
+ * a set of ift to ignore.
* @return
* a set containing the covered ift or null if an ift not ignored is not fully covered.
*/
@SuppressWarnings("unchecked")
public static Set<InteractionFragment> getCoveredInteractionFragments(Rectangle selectionRect, EditPart hostEditPart, Set<InteractionFragment> ignoreSet) {
Set<InteractionFragment> coveredInteractionFragments = new HashSet<InteractionFragment>();
- if(ignoreSet == null) {
+ if (ignoreSet == null) {
ignoreSet = new HashSet<InteractionFragment>();
}
// retrieve all the edit parts in the registry
Set<Entry<Object, EditPart>> allEditPartEntries = hostEditPart.getViewer().getEditPartRegistry().entrySet();
- for(Entry<Object, EditPart> epEntry : allEditPartEntries) {
+ for (Entry<Object, EditPart> epEntry : allEditPartEntries) {
EditPart ep = epEntry.getValue();
- if(ep instanceof ShapeEditPart) {
- ShapeEditPart sep = (ShapeEditPart)ep;
+ if (ep instanceof ShapeEditPart) {
+ ShapeEditPart sep = (ShapeEditPart) ep;
EObject elem = sep.getNotationView().getElement();
- if(elem instanceof InteractionFragment && !ignoreSet.contains(elem)) {
+ if (elem instanceof InteractionFragment && !ignoreSet.contains(elem)) {
Rectangle figureBounds = getAbsoluteBounds(sep);
// keep the fragment if its figure is completely in the selection
// if it is inside but not completely this method return null
- if(selectionRect.contains(figureBounds)) {
- coveredInteractionFragments.add((InteractionFragment)elem);
- if(elem instanceof ExecutionSpecification) {
- ExecutionSpecification es = (ExecutionSpecification)elem;
+ if (selectionRect.contains(figureBounds)) {
+ coveredInteractionFragments.add((InteractionFragment) elem);
+ if (elem instanceof ExecutionSpecification) {
+ ExecutionSpecification es = (ExecutionSpecification) elem;
coveredInteractionFragments.add(es.getStart());
coveredInteractionFragments.add(es.getFinish());
}
} else {
Rectangle intersection = selectionRect.getIntersection(figureBounds);
- if(!intersection.equals(new Rectangle()) && !intersection.equals(selectionRect)) {
+ if (!intersection.equals(new Rectangle()) && !intersection.equals(selectionRect)) {
return null;
}
}
}
- } else if(ep instanceof ConnectionEditPart) {
- ConnectionEditPart cep = (ConnectionEditPart)ep;
+ } else if (ep instanceof ConnectionEditPart) {
+ ConnectionEditPart cep = (ConnectionEditPart) ep;
EObject elem = cep.getNotationView().getElement();
// for connections, messages have ends that are ift but don't have theirs own edit parts
// => use anchors to determine if they should be included in the set
- if(elem instanceof Message) {
- Message msg = (Message)elem;
+ if (elem instanceof Message) {
+ Message msg = (Message) elem;
Connection msgFigure = cep.getConnectionFigure();
Point sourcePoint = msgFigure.getSourceAnchor().getReferencePoint();
Point targetPoint = msgFigure.getTargetAnchor().getReferencePoint();
- if(selectionRect.contains(sourcePoint)) {
+ if (selectionRect.contains(sourcePoint)) {
MessageEnd msgSendEnd = msg.getSendEvent();
- if(msgSendEnd instanceof InteractionFragment) {
- coveredInteractionFragments.add((InteractionFragment)msgSendEnd);
+ if (msgSendEnd instanceof InteractionFragment) {
+ coveredInteractionFragments.add((InteractionFragment) msgSendEnd);
}
}
- if(selectionRect.contains(targetPoint)) {
+ if (selectionRect.contains(targetPoint)) {
MessageEnd msgReceiveEnd = msg.getReceiveEvent();
- if(msgReceiveEnd instanceof InteractionFragment) {
- coveredInteractionFragments.add((InteractionFragment)msgReceiveEnd);
+ if (msgReceiveEnd instanceof InteractionFragment) {
+ coveredInteractionFragments.add((InteractionFragment) msgReceiveEnd);
}
}
}
@@ -1095,13 +1094,13 @@ public class SequenceUtil {
/**
* return a command to set the enclosing interaction or interaction operand of an interaction fragment.
- *
+ *
* @param ed
- * The transactional editing domain.
+ * The transactional editing domain.
* @param ift
- * The interaction fragment.
+ * The interaction fragment.
* @param io
- * the new enclosing interaction.
+ * the new enclosing interaction.
* @return The command.
*/
public static ICommand getSetEnclosingInteractionCommand(final TransactionalEditingDomain ed, final InteractionFragment ift, final EObject interaction) {
@@ -1117,37 +1116,37 @@ public class SequenceUtil {
/**
* Set the interaction or interaction operand which contains a fragment
- *
+ *
* @param ift
- * fragment to update container
+ * fragment to update container
* @param interaction
- * new containing interaction or interaction operand
+ * new containing interaction or interaction operand
* @param forceIfCoregion
- * force the set even if fragment belong to a coregion. Use true only when you are sure the fragment no longer belongs to a coregion's
- * operand.
+ * force the set even if fragment belong to a coregion. Use true only when you are sure the fragment no longer belongs to a coregion's
+ * operand.
*/
public static void setEnclosingInteraction(InteractionFragment ift, EObject interaction, boolean forceIfCoregion) {
- if(ift != null) {
- if(interaction instanceof Interaction) {
- if(!interaction.equals(ift.getEnclosingInteraction())) {
+ if (ift != null) {
+ if (interaction instanceof Interaction) {
+ if (!interaction.equals(ift.getEnclosingInteraction())) {
// check case when mos looks outside but is in a coregion.
- if(!forceIfCoregion && ift instanceof MessageOccurrenceSpecification) {
+ if (!forceIfCoregion && ift instanceof MessageOccurrenceSpecification) {
InteractionOperand operand = ift.getEnclosingOperand();
- if(operand != null) {
+ if (operand != null) {
Element cf = operand.getOwner();
- if(cf instanceof CombinedFragment && InteractionOperatorKind.PAR_LITERAL.equals(((CombinedFragment)cf).getInteractionOperator())) {
+ if (cf instanceof CombinedFragment && InteractionOperatorKind.PAR_LITERAL.equals(((CombinedFragment) cf).getInteractionOperator())) {
// was in a coregion. Check whether other mos is still in the coregion
- Message mess = ((MessageOccurrenceSpecification)ift).getMessage();
+ Message mess = ((MessageOccurrenceSpecification) ift).getMessage();
// find other mos
MessageOccurrenceSpecification otherMos = null;
- if(ift.equals(mess.getSendEvent()) && mess.getReceiveEvent() instanceof MessageOccurrenceSpecification) {
- otherMos = (MessageOccurrenceSpecification)mess.getReceiveEvent();
- } else if(ift.equals(mess.getReceiveEvent()) && mess.getSendEvent() instanceof MessageOccurrenceSpecification) {
- otherMos = (MessageOccurrenceSpecification)mess.getSendEvent();
+ if (ift.equals(mess.getSendEvent()) && mess.getReceiveEvent() instanceof MessageOccurrenceSpecification) {
+ otherMos = (MessageOccurrenceSpecification) mess.getReceiveEvent();
+ } else if (ift.equals(mess.getReceiveEvent()) && mess.getSendEvent() instanceof MessageOccurrenceSpecification) {
+ otherMos = (MessageOccurrenceSpecification) mess.getSendEvent();
}
- if(otherMos != null) {
+ if (otherMos != null) {
// check that it is in a coregion (specific code is in charge of taking it out in ReconnectMessageHelper)
- if(operand.equals(otherMos.getEnclosingOperand())) {
+ if (operand.equals(otherMos.getEnclosingOperand())) {
return;
}
}
@@ -1155,12 +1154,12 @@ public class SequenceUtil {
}
}
ift.setEnclosingOperand(null);
- ift.setEnclosingInteraction((Interaction)interaction);
+ ift.setEnclosingInteraction((Interaction) interaction);
}
- } else if(interaction instanceof InteractionOperand) {
- if(!interaction.equals(ift.getEnclosingOperand())) {
+ } else if (interaction instanceof InteractionOperand) {
+ if (!interaction.equals(ift.getEnclosingOperand())) {
ift.setEnclosingInteraction(null);
- ift.setEnclosingOperand((InteractionOperand)interaction);
+ ift.setEnclosingOperand((InteractionOperand) interaction);
}
}
}
@@ -1168,13 +1167,13 @@ public class SequenceUtil {
/**
* return a command to add a covered lifeline to an interaction fragment.
- *
+ *
* @param ed
- * The transactional editing domain.
+ * The transactional editing domain.
* @param ift
- * The interaction fragment.
+ * The interaction fragment.
* @param lifeline
- * the lifeline.
+ * the lifeline.
* @return The command.
*/
public static ICommand getAddCoveredLifelineCommand(final TransactionalEditingDomain ed, final InteractionFragment ift, final Lifeline lifeline) {
@@ -1190,13 +1189,13 @@ public class SequenceUtil {
/**
* return a command to remove a previously covered lifeline of an interaction fragment.
- *
+ *
* @param ed
- * The transactional editing domain.
+ * The transactional editing domain.
* @param ift
- * The interaction fragment.
+ * The interaction fragment.
* @param lifeline
- * the lifeline.
+ * the lifeline.
* @return The command.
*/
public static ICommand getRemoveCoveredLifelineCommand(final TransactionalEditingDomain ed, final InteractionFragment ift, final Lifeline lifeline) {
@@ -1212,85 +1211,85 @@ public class SequenceUtil {
/**
* Create a command to update the enclosing interaction of a message end according to its new location.
- *
+ *
* @param movedMos
- * the moved Message Occurrence Specification
+ * the moved Message Occurrence Specification
* @param newLocation
- * the new absolute location
+ * the new absolute location
* @param editPart
- * any adit part of the corresponding diagram
+ * any adit part of the corresponding diagram
* @return the command or null if nothing changes
*/
- //@SuppressWarnings("unchecked")
+ // @SuppressWarnings("unchecked")
public static Command createUpdateEnclosingInteractionCommand(MessageOccurrenceSpecification movedMos, Point newLocation, GraphicalEditPart editPart) {
- // // calculate new bounds for the execution specification
- // Rectangle absoluteNewBounds = executionSpecificationEP.getFigure().getBounds().getCopy();
+ // // calculate new bounds for the execution specification
+ // Rectangle absoluteNewBounds = executionSpecificationEP.getFigure().getBounds().getCopy();
//
- // executionSpecificationEP.getFigure().getParent().translateToAbsolute(absoluteNewBounds);
+ // executionSpecificationEP.getFigure().getParent().translateToAbsolute(absoluteNewBounds);
//
- // absoluteNewBounds.translate(moveDelta);
- // absoluteNewBounds.resize(sizeDelta);
+ // absoluteNewBounds.translate(moveDelta);
+ // absoluteNewBounds.resize(sizeDelta);
//
- // int xCenter = absoluteNewBounds.getCenter().x;
+ // int xCenter = absoluteNewBounds.getCenter().x;
//
- // Rectangle top = new Rectangle(xCenter, absoluteNewBounds.y, 0, 0);
- // Rectangle bottom = new Rectangle(xCenter, absoluteNewBounds.bottom(), 0, 0);
+ // Rectangle top = new Rectangle(xCenter, absoluteNewBounds.y, 0, 0);
+ // Rectangle bottom = new Rectangle(xCenter, absoluteNewBounds.bottom(), 0, 0);
//
- // // associate es with its bounds, and start and finish event with the top and bottom of the bounds
+ // // associate es with its bounds, and start and finish event with the top and bottom of the bounds
HashMap<InteractionFragment, Rectangle> iftToCheckForUpdate = new HashMap<InteractionFragment, Rectangle>();
//
- // ExecutionSpecification es = (ExecutionSpecification)executionSpecificationEP.resolveSemanticElement();
+ // ExecutionSpecification es = (ExecutionSpecification)executionSpecificationEP.resolveSemanticElement();
iftToCheckForUpdate.put(movedMos, new Rectangle(newLocation, new Dimension()));
- // iftToCheckForUpdate.put(es.getStart(), top);
+ // iftToCheckForUpdate.put(es.getStart(), top);
//
- // iftToCheckForUpdate.put(es.getFinish(), bottom);
+ // iftToCheckForUpdate.put(es.getFinish(), bottom);
//
- // List<ConnectionEditPart> sourceConnectionEPs = executionSpecificationEP.getSourceConnections();
+ // List<ConnectionEditPart> sourceConnectionEPs = executionSpecificationEP.getSourceConnections();
//
- // // find possible ifts associated with messages connected to the moved es
- // for(ConnectionEditPart sourceConnectionEP : sourceConnectionEPs) {
- // EObject elem = sourceConnectionEP.getNotationView().getElement();
+ // // find possible ifts associated with messages connected to the moved es
+ // for(ConnectionEditPart sourceConnectionEP : sourceConnectionEPs) {
+ // EObject elem = sourceConnectionEP.getNotationView().getElement();
//
- // // for connections, messages have ends that can be ift but don't have theirs own edit parts
- // // => use anchors to determine position
- // if(elem instanceof Message) {
- // Message msg = (Message)elem;
- // MessageEnd sendEvent = msg.getSendEvent();
- // if(sendEvent instanceof InteractionFragment) {
- // Connection msgFigure = sourceConnectionEP.getConnectionFigure();
+ // // for connections, messages have ends that can be ift but don't have theirs own edit parts
+ // // => use anchors to determine position
+ // if(elem instanceof Message) {
+ // Message msg = (Message)elem;
+ // MessageEnd sendEvent = msg.getSendEvent();
+ // if(sendEvent instanceof InteractionFragment) {
+ // Connection msgFigure = sourceConnectionEP.getConnectionFigure();
//
- // Point sourcePoint = msgFigure.getSourceAnchor().getLocation(msgFigure.getTargetAnchor().getReferencePoint());
+ // Point sourcePoint = msgFigure.getSourceAnchor().getLocation(msgFigure.getTargetAnchor().getReferencePoint());
//
- // iftToCheckForUpdate.put((InteractionFragment)sendEvent, new Rectangle(sourcePoint.x + moveDelta.x, sourcePoint.y + moveDelta.y, 0, 0));
- // }
- // }
- // }
+ // iftToCheckForUpdate.put((InteractionFragment)sendEvent, new Rectangle(sourcePoint.x + moveDelta.x, sourcePoint.y + moveDelta.y, 0, 0));
+ // }
+ // }
+ // }
//
- // List<ConnectionEditPart> targetConnectionEPs = executionSpecificationEP.getTargetConnections();
+ // List<ConnectionEditPart> targetConnectionEPs = executionSpecificationEP.getTargetConnections();
//
- // for(ConnectionEditPart targetConnectionEP : targetConnectionEPs) {
- // EObject elem = targetConnectionEP.getNotationView().getElement();
+ // for(ConnectionEditPart targetConnectionEP : targetConnectionEPs) {
+ // EObject elem = targetConnectionEP.getNotationView().getElement();
//
- // if(elem instanceof Message) {
- // Message msg = (Message)elem;
- // MessageEnd receiveEvent = msg.getReceiveEvent();
- // if(receiveEvent instanceof InteractionFragment) {
- // Connection msgFigure = targetConnectionEP.getConnectionFigure();
+ // if(elem instanceof Message) {
+ // Message msg = (Message)elem;
+ // MessageEnd receiveEvent = msg.getReceiveEvent();
+ // if(receiveEvent instanceof InteractionFragment) {
+ // Connection msgFigure = targetConnectionEP.getConnectionFigure();
//
- // Point targetPoint = msgFigure.getTargetAnchor().getLocation(msgFigure.getSourceAnchor().getReferencePoint());
+ // Point targetPoint = msgFigure.getTargetAnchor().getLocation(msgFigure.getSourceAnchor().getReferencePoint());
//
- // iftToCheckForUpdate.put((InteractionFragment)receiveEvent, new Rectangle(targetPoint.x + moveDelta.x, targetPoint.y + moveDelta.y, 0, 0));
- // }
- // }
- // }
+ // iftToCheckForUpdate.put((InteractionFragment)receiveEvent, new Rectangle(targetPoint.x + moveDelta.x, targetPoint.y + moveDelta.y, 0, 0));
+ // }
+ // }
+ // }
CompoundCommand cmd = new CompoundCommand();
- for(Map.Entry<InteractionFragment, Rectangle> entry : iftToCheckForUpdate.entrySet()) {
+ for (Map.Entry<InteractionFragment, Rectangle> entry : iftToCheckForUpdate.entrySet()) {
InteractionFragment newEnclosingInteraction = findInteractionFragmentContainerAt(entry.getValue(), editPart);
- if(newEnclosingInteraction != null) {
+ if (newEnclosingInteraction != null) {
cmd.add(new ICommandProxy(getSetEnclosingInteractionCommand(editPart.getEditingDomain(), entry.getKey(), newEnclosingInteraction)));
}
}
- if(!cmd.isEmpty()) {
+ if (!cmd.isEmpty()) {
return cmd;
} else {
return null;
@@ -1299,11 +1298,11 @@ public class SequenceUtil {
/**
* Create a command to update the enclosing interaction of an execution specification according to its new bounds.
- *
+ *
* @param executionSpecificationEP
- * the edit part of the execution specification
+ * the edit part of the execution specification
* @param absoluteNewBounds
- * the new absolute bounds
+ * the new absolute bounds
* @return the command or null if nothing changes
*/
@SuppressWarnings("unchecked")
@@ -1318,47 +1317,47 @@ public class SequenceUtil {
Rectangle bottom = new Rectangle(xCenter, absoluteNewBounds.bottom(), 0, 0);
// associate es with its bounds, and start and finish event with the top and bottom of the bounds
HashMap<InteractionFragment, Rectangle> iftToCheckForUpdate = new HashMap<InteractionFragment, Rectangle>();
- ExecutionSpecification es = (ExecutionSpecification)executionSpecificationEP.resolveSemanticElement();
+ ExecutionSpecification es = (ExecutionSpecification) executionSpecificationEP.resolveSemanticElement();
iftToCheckForUpdate.put(es, absoluteNewBounds);
iftToCheckForUpdate.put(es.getStart(), top);
iftToCheckForUpdate.put(es.getFinish(), bottom);
List<ConnectionEditPart> sourceConnectionEPs = executionSpecificationEP.getSourceConnections();
// find possible ifts associated with messages connected to the moved es
- for(ConnectionEditPart sourceConnectionEP : sourceConnectionEPs) {
+ for (ConnectionEditPart sourceConnectionEP : sourceConnectionEPs) {
EObject elem = sourceConnectionEP.getNotationView().getElement();
// for connections, messages have ends that can be ift but don't have theirs own edit parts
// => use anchors to determine position
- if(elem instanceof Message) {
- Message msg = (Message)elem;
+ if (elem instanceof Message) {
+ Message msg = (Message) elem;
MessageEnd sendEvent = msg.getSendEvent();
- if(sendEvent instanceof InteractionFragment) {
+ if (sendEvent instanceof InteractionFragment) {
Connection msgFigure = sourceConnectionEP.getConnectionFigure();
Point sourcePoint = msgFigure.getSourceAnchor().getLocation(msgFigure.getTargetAnchor().getReferencePoint());
- iftToCheckForUpdate.put((InteractionFragment)sendEvent, new Rectangle(sourcePoint.x + moveDelta.x, sourcePoint.y + moveDelta.y, 0, 0));
+ iftToCheckForUpdate.put((InteractionFragment) sendEvent, new Rectangle(sourcePoint.x + moveDelta.x, sourcePoint.y + moveDelta.y, 0, 0));
}
}
}
List<ConnectionEditPart> targetConnectionEPs = executionSpecificationEP.getTargetConnections();
- for(ConnectionEditPart targetConnectionEP : targetConnectionEPs) {
+ for (ConnectionEditPart targetConnectionEP : targetConnectionEPs) {
EObject elem = targetConnectionEP.getNotationView().getElement();
- if(elem instanceof Message) {
- Message msg = (Message)elem;
+ if (elem instanceof Message) {
+ Message msg = (Message) elem;
MessageEnd receiveEvent = msg.getReceiveEvent();
- if(receiveEvent instanceof InteractionFragment) {
+ if (receiveEvent instanceof InteractionFragment) {
Connection msgFigure = targetConnectionEP.getConnectionFigure();
Point targetPoint = msgFigure.getTargetAnchor().getLocation(msgFigure.getSourceAnchor().getReferencePoint());
- iftToCheckForUpdate.put((InteractionFragment)receiveEvent, new Rectangle(targetPoint.x + moveDelta.x, targetPoint.y + moveDelta.y, 0, 0));
+ iftToCheckForUpdate.put((InteractionFragment) receiveEvent, new Rectangle(targetPoint.x + moveDelta.x, targetPoint.y + moveDelta.y, 0, 0));
}
}
}
CompoundCommand cmd = new CompoundCommand();
- for(Map.Entry<InteractionFragment, Rectangle> entry : iftToCheckForUpdate.entrySet()) {
+ for (Map.Entry<InteractionFragment, Rectangle> entry : iftToCheckForUpdate.entrySet()) {
InteractionFragment newEnclosingInteraction = findInteractionFragmentContainerAt(entry.getValue(), executionSpecificationEP);
- if(newEnclosingInteraction != null) {
+ if (newEnclosingInteraction != null) {
cmd.add(new ICommandProxy(getSetEnclosingInteractionCommand(executionSpecificationEP.getEditingDomain(), entry.getKey(), newEnclosingInteraction)));
}
}
- if(!cmd.isEmpty()) {
+ if (!cmd.isEmpty()) {
return cmd;
} else {
return null;
@@ -1367,11 +1366,11 @@ public class SequenceUtil {
/**
* Find the edit part a connection should be reconnected to at a given reference point on a lifeline
- *
+ *
* @param lifelinePart
- * lifeline part on which the reconnection must be performed
+ * lifeline part on which the reconnection must be performed
* @param referencePoint
- * the reference point
+ * the reference point
* @return lifeline or execution specification edit part to reconnect to (the most external in the lifeline)
*/
public static GraphicalEditPart findPartToReconnectTo(LifelineEditPart lifelinePart, Point referencePoint) {
@@ -1380,24 +1379,24 @@ public class SequenceUtil {
List<?> children = lifelinePart.getChildren();
GraphicalEditPart adequateExecutionPart = null;
int maxDeltaWithMiddle = 0;
- for(Object child : children) {
+ for (Object child : children) {
// children executions
- if(child instanceof ActionExecutionSpecificationEditPart || child instanceof BehaviorExecutionSpecificationEditPart || child instanceof CombinedFragment2EditPart) {
- GraphicalEditPart childPart = (GraphicalEditPart)child;
+ if (child instanceof ActionExecutionSpecificationEditPart || child instanceof BehaviorExecutionSpecificationEditPart || child instanceof CombinedFragment2EditPart) {
+ GraphicalEditPart childPart = (GraphicalEditPart) child;
Rectangle absoluteBounds = getAbsoluteBounds(childPart);
// enlarge absolute bounds to contain also the right and bottom edges.
absoluteBounds.expand(1, 1);
- if(absoluteBounds.contains(referencePoint)) {
+ if (absoluteBounds.contains(referencePoint)) {
// this is an adequate execution part, take the most external one
int deltaWithMiddle = Math.abs(absoluteBounds.getTop().x - absoluteLifelineBounds.getTop().x);
- if(deltaWithMiddle >= maxDeltaWithMiddle) {
+ if (deltaWithMiddle >= maxDeltaWithMiddle) {
maxDeltaWithMiddle = deltaWithMiddle;
adequateExecutionPart = childPart;
}
}
}
}
- if(adequateExecutionPart != null) {
+ if (adequateExecutionPart != null) {
return adequateExecutionPart;
}
return lifelinePart;
@@ -1405,11 +1404,11 @@ public class SequenceUtil {
/**
* Find the range of possible locations an occurrence specification should be drawn in.
- *
+ *
* @param lifelineEditPart
- * the lifeline on which the occurrence specification appears.
+ * the lifeline on which the occurrence specification appears.
* @param occSpec
- * the occurrence specification to find locations for.
+ * the occurrence specification to find locations for.
* @return rectangle within which the occurrence specification must be drawn (width is not significative)
*/
public static Rectangle findPossibleLocationsForEvent(LifelineEditPart lifelineEditPart, OccurrenceSpecification occSpec) {
@@ -1419,7 +1418,7 @@ public class SequenceUtil {
// find the containing pane
IGraphicalEditPart containerPart = findDrawnContainerEditPart(lifelineEditPart, occSpec);
IFigure drawnContentPane = getContentPaneThatCanContainFragments(containerPart);
- if(drawnContentPane != null) {
+ if (drawnContentPane != null) {
// content pane is the smallest drawn owning rectangle
Rectangle bounds = drawnContentPane.getBounds().getCopy();
drawnContentPane.getParent().translateToAbsolute(bounds);
@@ -1430,9 +1429,9 @@ public class SequenceUtil {
EObject uppestContainerToSearchInto = containerPart.resolveSemanticElement();
InteractionFragment after = InteractionFragmentHelper.findNextFragment(occSpec, uppestContainerToSearchInto);
boolean foundNextFragment = false;
- while(!foundNextFragment && after != null) {
+ while (!foundNextFragment && after != null) {
Point bottom = findLocationOfEvent(lifelineEditPart, after);
- if(bottom != null && result.contains(bottom)) {
+ if (bottom != null && result.contains(bottom)) {
int diff = bottom.y - result.bottom();
result.resize(0, diff);
foundNextFragment = true;
@@ -1443,9 +1442,9 @@ public class SequenceUtil {
}
InteractionFragment before = InteractionFragmentHelper.findPreviousFragment(occSpec, uppestContainerToSearchInto);
boolean foundPreviousFragment = false;
- while(!foundPreviousFragment && before != null) {
+ while (!foundPreviousFragment && before != null) {
Point top = findLocationOfEvent(lifelineEditPart, before);
- if(top != null && result.contains(top)) {
+ if (top != null && result.contains(top)) {
int diff = top.y - result.y;
result.translate(0, diff);
result.resize(0, -diff);
@@ -1467,31 +1466,31 @@ public class SequenceUtil {
/**
* Reduce the possible bounds by removing the area of an eventual interaction operand or combined fragment which contains the fragment "before"
* and not the occurrence specification for which we search a location.
- *
+ *
* @param possibleBounds
- * bounds to reduce, in which the location will be possible
+ * bounds to reduce, in which the location will be possible
* @param before
- * the fragment which happens before
+ * the fragment which happens before
* @param occSpec
- * the occurrence specification for which we search a location
+ * the occurrence specification for which we search a location
* @param lifelineEditPart
- * the lifeline on which the occurrence specification appears.
+ * the lifeline on which the occurrence specification appears.
*/
private static void reduceByNodeContainingBefore(Rectangle possibleBounds, InteractionFragment before, OccurrenceSpecification occSpec, LifelineEditPart lifelineEditPart) {
Element eventualNodeElement = before;
// inspect each container of before, until it is common with occSpec
- while(!EcoreUtil.isAncestor(eventualNodeElement, occSpec)) {
+ while (!EcoreUtil.isAncestor(eventualNodeElement, occSpec)) {
// test if eventualNodeElement has bounds excluding occSpec
// search for the eventualNodeElement's edit part
List<View> views = DiagramEditPartsUtil.findViews(eventualNodeElement, lifelineEditPart.getViewer());
- for(View view : views) {
+ for (View view : views) {
EditPart part = DiagramEditPartsUtil.getEditPartFromView(view, lifelineEditPart);
// test if edit part is an adequate node
- if(part instanceof IGraphicalEditPart && getContentPaneThatCanContainFragments(part) != null) {
- Rectangle bounds = getAbsoluteBounds((IGraphicalEditPart)part);
+ if (part instanceof IGraphicalEditPart && getContentPaneThatCanContainFragments(part) != null) {
+ Rectangle bounds = getAbsoluteBounds((IGraphicalEditPart) part);
// reduce so that the bounds are excluded
int newPossibleTop = bounds.bottom();
- if(possibleBounds.y < newPossibleTop) {
+ if (possibleBounds.y < newPossibleTop) {
int diff = newPossibleTop - possibleBounds.y;
possibleBounds.translate(0, diff);
possibleBounds.resize(0, -diff);
@@ -1504,49 +1503,49 @@ public class SequenceUtil {
/**
* Get the content pane of an edit part that can directly or indirectly contain interaction fragments (this excludes lifeline, which references)
- *
+ *
* @param containerPart
- * container edit part
+ * container edit part
* @return its content pane if the container can contain fragments, null otherwise.
*/
private static IFigure getContentPaneThatCanContainFragments(EditPart containerPart) {
// test all owner edit parts which can contain an interaction fragment
- if(containerPart instanceof InteractionOperandEditPart) {
- return ((InteractionOperandEditPart)containerPart).getContentPane();
- } else if(containerPart instanceof CombinedFragmentEditPart) {
- return ((CombinedFragmentEditPart)containerPart).getContentPane();
- } else if(containerPart instanceof CombinedFragment2EditPart) {
- return ((CombinedFragment2EditPart)containerPart).getContentPane();
- } else if(containerPart instanceof ContinuationEditPart) {
- return ((ContinuationEditPart)containerPart).getContentPane();
- } else if(containerPart instanceof InteractionUseEditPart) {
- return ((InteractionUseEditPart)containerPart).getContentPane();
- } else if(containerPart instanceof InteractionEditPart) {
- return ((InteractionEditPart)containerPart).getContentPane();
+ if (containerPart instanceof InteractionOperandEditPart) {
+ return ((InteractionOperandEditPart) containerPart).getContentPane();
+ } else if (containerPart instanceof CombinedFragmentEditPart) {
+ return ((CombinedFragmentEditPart) containerPart).getContentPane();
+ } else if (containerPart instanceof CombinedFragment2EditPart) {
+ return ((CombinedFragment2EditPart) containerPart).getContentPane();
+ } else if (containerPart instanceof ContinuationEditPart) {
+ return ((ContinuationEditPart) containerPart).getContentPane();
+ } else if (containerPart instanceof InteractionUseEditPart) {
+ return ((InteractionUseEditPart) containerPart).getContentPane();
+ } else if (containerPart instanceof InteractionEditPart) {
+ return ((InteractionEditPart) containerPart).getContentPane();
}
return null;
}
/**
* Find the smallest drawn edit part containing the occurrence specification.
- *
+ *
* @param lifelineEditPart
- * support lifeline edit part
+ * support lifeline edit part
* @param occSpec
- * occurrence specification to localize
+ * occurrence specification to localize
* @return a drawn edit part which element contains the occurrence specification or null
*/
private static IGraphicalEditPart findDrawnContainerEditPart(LifelineEditPart lifelineEditPart, OccurrenceSpecification occSpec) {
// find containing drawn edit parts
Element owner = occSpec.getOwner();
- while(owner != null) {
+ while (owner != null) {
// search for the owner's edit part
List<View> views = DiagramEditPartsUtil.findViews(owner, lifelineEditPart.getViewer());
- for(View view : views) {
+ for (View view : views) {
EditPart part = DiagramEditPartsUtil.getEditPartFromView(view, lifelineEditPart);
// test if edit part can contain the occurrence specification
- if(part instanceof IGraphicalEditPart && getContentPaneThatCanContainFragments(part) != null) {
- return (IGraphicalEditPart)part;
+ if (part instanceof IGraphicalEditPart && getContentPaneThatCanContainFragments(part) != null) {
+ return (IGraphicalEditPart) part;
}
}
owner = owner.getOwner();
@@ -1556,16 +1555,16 @@ public class SequenceUtil {
/**
* Check whether the Lifeline is Create Message's target node
- *
+ *
* @param lifelineEP
* @return boolean
*/
public static boolean isCreateMessageEndLifeline(LifelineEditPart lifelineEP) {
List<Object> targetConnections = lifelineEP.getTargetConnections();
- if(targetConnections != null && targetConnections.size() > 0) {
- for(int i = 0; i < targetConnections.size(); i++) {
+ if (targetConnections != null && targetConnections.size() > 0) {
+ for (int i = 0; i < targetConnections.size(); i++) {
Object connection = targetConnections.get(i);
- if(connection instanceof Message4EditPart) {
+ if (connection instanceof Message4EditPart) {
return true;
}
}
@@ -1575,25 +1574,25 @@ public class SequenceUtil {
/**
* Find Time Observations editpart which are related to specific OccurenceSpecification
- *
+ *
* @param lifelinePart
* @param oss
* @return List<TimeObservationLabelEditPart>
*/
public static List<TimeObservationLabelEditPart> findOccurenceSpecificationRelatedTimeObservationPart(LifelineEditPart lifelinePart, List<OccurrenceSpecification> oss) {
List<TimeObservationLabelEditPart> list = new ArrayList<TimeObservationLabelEditPart>();
- if(oss == null || oss.size() == 0) {
+ if (oss == null || oss.size() == 0) {
return list;
}
- if(lifelinePart != null && lifelinePart.getTargetConnections().size() > 0) {
- for(Object targetConnection : lifelinePart.getTargetConnections()) {
- if(targetConnection instanceof ObservationLinkEditPart) {
- ObservationLinkEditPart observationLinkEditPart = (ObservationLinkEditPart)targetConnection;
- if(observationLinkEditPart.getSource() instanceof TimeObservationLabelEditPart) {
- TimeObservationLabelEditPart source = (TimeObservationLabelEditPart)observationLinkEditPart.getSource();
+ if (lifelinePart != null && lifelinePart.getTargetConnections().size() > 0) {
+ for (Object targetConnection : lifelinePart.getTargetConnections()) {
+ if (targetConnection instanceof ObservationLinkEditPart) {
+ ObservationLinkEditPart observationLinkEditPart = (ObservationLinkEditPart) targetConnection;
+ if (observationLinkEditPart.getSource() instanceof TimeObservationLabelEditPart) {
+ TimeObservationLabelEditPart source = (TimeObservationLabelEditPart) observationLinkEditPart.getSource();
EObject timeElement = source.resolveSemanticElement();
- if(timeElement instanceof TimeObservation) {
- if(oss.contains(((TimeObservation)timeElement).getEvent())) {
+ if (timeElement instanceof TimeObservation) {
+ if (oss.contains(((TimeObservation) timeElement).getEvent())) {
list.add(source);
}
}
@@ -1606,7 +1605,7 @@ public class SequenceUtil {
/**
* Find Time Observations editpart which are related to specific OccurenceSpecification
- *
+ *
* @param lifelinePart
* @param os
* @return List<TimeObservationLabelEditPart>
@@ -1619,28 +1618,28 @@ public class SequenceUtil {
/**
* Find specific editpart by semantic model
- *
+ *
* @param editPart
* @param targetElement
* @param targetClass
* @return EditPart
*/
public static EditPart getEditPart(EditPart editPart, EObject targetElement, Class targetClass) {
- if(editPart == null || targetElement == null || targetClass == null) {
+ if (editPart == null || targetElement == null || targetClass == null) {
return null;
}
Map<?, ?> map = editPart.getViewer().getEditPartRegistry();
- for(Entry<?, ?> entry : map.entrySet()) {
+ for (Entry<?, ?> entry : map.entrySet()) {
Object key = entry.getKey();
- if(!(key instanceof View)) {
+ if (!(key instanceof View)) {
continue;
}
- View view = (View)key;
+ View view = (View) key;
EObject tempElement = view.getElement();
- if(targetElement.equals(tempElement)) {
+ if (targetElement.equals(tempElement)) {
Object value = entry.getValue();
- if(value.getClass() == targetClass) {
- return (EditPart)value;
+ if (value.getClass() == targetClass) {
+ return (EditPart) value;
}
}
}
@@ -1649,22 +1648,25 @@ public class SequenceUtil {
/**
* Intall observation link policy to specific editpart
- *
+ *
* @param editPart
*/
public static void installObservationLinkPolicy(EditPart editPart) {
String editPolicy = "observationlink";
- if(editPart instanceof LifelineEditPart || editPart instanceof TimeObservationLabelEditPart) {
+ if (editPart instanceof LifelineEditPart || editPart instanceof TimeObservationLabelEditPart) {
editPart.installEditPolicy(editPolicy, new ObservationLinkPolicy(editPart));
}
- if(editPart instanceof DurationObservationEditPart) {
+ if (editPart instanceof DurationObservationEditPart) {
editPart.installEditPolicy(editPolicy, new ObservationLinkPolicy(editPart));
}
- if(editPart instanceof MessageEditPart || editPart instanceof Message2EditPart || editPart instanceof Message3EditPart || editPart instanceof Message4EditPart || editPart instanceof Message5EditPart || editPart instanceof Message6EditPart || editPart instanceof Message7EditPart) {
+ if (editPart instanceof MessageEditPart || editPart instanceof Message2EditPart || editPart instanceof Message3EditPart || editPart instanceof Message4EditPart || editPart instanceof Message5EditPart || editPart instanceof Message6EditPart
+ || editPart instanceof Message7EditPart) {
editPart.installEditPolicy(editPolicy, new ObservationLinkPolicy(editPart));
- } else if(editPart instanceof MessageNameEditPart || editPart instanceof MessageName2EditPart || editPart instanceof MessageName3EditPart || editPart instanceof MessageName4EditPart || editPart instanceof MessageName5EditPart || editPart instanceof MessageName6EditPart || editPart instanceof MessageName7EditPart) {
+ } else if (editPart instanceof MessageNameEditPart || editPart instanceof MessageName2EditPart || editPart instanceof MessageName3EditPart || editPart instanceof MessageName4EditPart || editPart instanceof MessageName5EditPart
+ || editPart instanceof MessageName6EditPart || editPart instanceof MessageName7EditPart) {
editPart.getParent().installEditPolicy(editPolicy, new ObservationLinkPolicy(editPart));
- } else if(editPart instanceof MessageSyncAppliedStereotypeEditPart || editPart instanceof MessageAsyncAppliedStereotypeEditPart || editPart instanceof MessageReplyAppliedStereotypeEditPart || editPart instanceof MessageCreateAppliedStereotypeEditPart || editPart instanceof MessageDeleteAppliedStereotypeEditPart || editPart instanceof MessageLostAppliedStereotypeEditPart || editPart instanceof MessageFoundAppliedStereotypeEditPart) {
+ } else if (editPart instanceof MessageSyncAppliedStereotypeEditPart || editPart instanceof MessageAsyncAppliedStereotypeEditPart || editPart instanceof MessageReplyAppliedStereotypeEditPart || editPart instanceof MessageCreateAppliedStereotypeEditPart
+ || editPart instanceof MessageDeleteAppliedStereotypeEditPart || editPart instanceof MessageLostAppliedStereotypeEditPart || editPart instanceof MessageFoundAppliedStereotypeEditPart) {
editPart.getParent().installEditPolicy(editPolicy, new ObservationLinkPolicy(editPart));
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SignalUtil.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SignalUtil.java
index 529cf21f86a..85455e8c609 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SignalUtil.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SignalUtil.java
@@ -21,65 +21,65 @@ public class SignalUtil {
StringBuffer buffer = new StringBuffer();
// visibility
buffer.append(" ");
- if(displayValue.contains(ICustomAppearance.DISP_VISIBILITY)) {
+ if (displayValue.contains(ICustomAppearance.DISP_VISIBILITY)) {
buffer.append(NamedElementUtil.getVisibilityAsSign(property));
}
// derived property
- if(displayValue.contains(ICustomAppearance.DISP_DERIVE)) {
- if(property.isDerived()) {
+ if (displayValue.contains(ICustomAppearance.DISP_DERIVE)) {
+ if (property.isDerived()) {
buffer.append("/");
}
}
boolean showEqualMark = false;
// name
- if(displayValue.contains(ICustomAppearance.DISP_PARAMETER_NAME)) {
+ if (displayValue.contains(ICustomAppearance.DISP_PARAMETER_NAME)) {
buffer.append(" ");
String name = StringHelper.trimToEmpty(property.getName());
- if(name.trim().length() > 0) {
+ if (name.trim().length() > 0) {
showEqualMark = true;
}
buffer.append(name);
}
- if(displayValue.contains(ICustomAppearance.DISP_PARAMETER_TYPE)) {
+ if (displayValue.contains(ICustomAppearance.DISP_PARAMETER_TYPE)) {
// type
- if(property.getType() != null) {
+ if (property.getType() != null) {
buffer.append(": " + StringHelper.trimToEmpty(property.getType().getName()));
} else {
buffer.append(": " + TypeUtil.UNDEFINED_TYPE_NAME);
}
showEqualMark = true;
}
- if(displayValue.contains(ICustomAppearance.DISP_MULTIPLICITY)) {
+ if (displayValue.contains(ICustomAppearance.DISP_MULTIPLICITY)) {
// multiplicity -> do not display [1]
String multiplicity = MultiplicityElementUtil.getMultiplicityAsString(property);
buffer.append(multiplicity);
}
- if(displayValue.contains(ICustomAppearance.DISP_DERIVE)) {
+ if (displayValue.contains(ICustomAppearance.DISP_DERIVE)) {
String value = getValue(e, property);
- if(value != null) {
- if(showEqualMark) {
+ if (value != null) {
+ if (showEqualMark) {
buffer.append(" = ");
}
buffer.append(value);
}
- } else if(displayValue.contains(ICustomAppearance.DISP_PARAMETER_DEFAULT)) {
+ } else if (displayValue.contains(ICustomAppearance.DISP_PARAMETER_DEFAULT)) {
// default value
- if(property.getDefault() != null) {
- if(showEqualMark) {
+ if (property.getDefault() != null) {
+ if (showEqualMark) {
buffer.append(" = ");
}
buffer.append(property.getDefault());
}
}
- if(displayValue.contains(ICustomAppearance.DISP_MODIFIERS)) {
+ if (displayValue.contains(ICustomAppearance.DISP_MODIFIERS)) {
boolean multiLine = displayValue.contains(ICustomAppearance.DISP_MULTI_LINE);
// property modifiers
String modifiers = PropertyUtil.getModifiersAsString(property, multiLine);
- if(!modifiers.equals("")) {
- if(multiLine) {
+ if (!modifiers.equals("")) {
+ if (multiLine) {
buffer.append("\n");
}
- if(!buffer.toString().endsWith(" ")) {
+ if (!buffer.toString().endsWith(" ")) {
buffer.append(" ");
}
buffer.append(modifiers);
@@ -90,10 +90,10 @@ public class SignalUtil {
private static String getValue(Message e, Property property) {
try {
- Signal signal = (Signal)property.getOwner();
+ Signal signal = (Signal) property.getOwner();
int index = signal.getOwnedAttributes().indexOf(property);
EList<ValueSpecification> arguments = e.getArguments();
- if(arguments.size() > index) {
+ if (arguments.size() > index) {
return ValueSpecificationUtil.getSpecificationValue(arguments.get(index));
}
} catch (Exception e1) {
@@ -107,7 +107,7 @@ public class SignalUtil {
* @param message
*
* @param style
- * the integer representing the style of the label
+ * the integer representing the style of the label
*
* @return the string corresponding to the label of the signal
*/
@@ -115,11 +115,11 @@ public class SignalUtil {
StringBuffer buffer = new StringBuffer();
buffer.append(" "); // adds " " first for correct display considerations
// visibility
- if(displayValue.contains(ICustomAppearance.DISP_VISIBILITY)) {
+ if (displayValue.contains(ICustomAppearance.DISP_VISIBILITY)) {
buffer.append(NamedElementUtil.getVisibilityAsSign(signal));
}
// name
- if(displayValue.contains(ICustomAppearance.DISP_NAME)) {
+ if (displayValue.contains(ICustomAppearance.DISP_NAME)) {
buffer.append(" ");
buffer.append(StringHelper.trimToEmpty(signal.getName()));
}
@@ -139,11 +139,11 @@ public class SignalUtil {
private static String getPropertiesAsString(Message e, Signal signal, Collection<String> displayValue) {
StringBuffer propertiesString = new StringBuffer();
boolean firstProperty = true;
- for(Property property : signal.getOwnedAttributes()) {
+ for (Property property : signal.getOwnedAttributes()) {
// get the label for this property
String propertyString = getCustomPropertyLabel(e, property, displayValue).trim();
- if(!propertyString.equals("")) {
- if(!firstProperty) {
+ if (!propertyString.equals("")) {
+ if (!firstProperty) {
propertiesString.append(", ");
}
propertiesString.append(propertyString);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/TooltipHook.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/TooltipHook.java
index 60401529975..316e8c64f9a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/TooltipHook.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/TooltipHook.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -51,7 +51,7 @@ public class TooltipHook {
/**
* Constructor.
- *
+ *
*/
public TooltipHook(EditPartViewer viewer) {
this.viewer = viewer;
@@ -59,42 +59,44 @@ public class TooltipHook {
}
public boolean isHooked(EditPartViewer viewer) {
- if(viewer == null) {
+ if (viewer == null) {
return false;
}
return viewer == this.viewer;
}
private void hookViewer() {
- if(viewer == null) {
+ if (viewer == null) {
return;
}
try {
Method m = GraphicalViewerImpl.class.getDeclaredMethod("getLightweightSystem");
m.setAccessible(true);
- LightweightSystem lws = (LightweightSystem)m.invoke(viewer);
+ LightweightSystem lws = (LightweightSystem) m.invoke(viewer);
Field f = LightweightSystem.class.getDeclaredField("dispatcher");
f.setAccessible(true);
- EventDispatcher dispatcher = (EventDispatcher)f.get(lws);
- if(dispatcher instanceof SWTEventDispatcher) {
+ EventDispatcher dispatcher = (EventDispatcher) f.get(lws);
+ if (dispatcher instanceof SWTEventDispatcher) {
Field df = SWTEventDispatcher.class.getDeclaredField("toolTipHelper");
df.setAccessible(true);
- toolTipHelper = (ToolTipHelper)df.get(dispatcher);
+ toolTipHelper = (ToolTipHelper) df.get(dispatcher);
}
- if(toolTipHelper == null) {
+ if (toolTipHelper == null) {
return;
}
Method m2 = PopUpHelper.class.getDeclaredMethod("getShell");
m2.setAccessible(true);
- toolTipShell = (Shell)m2.invoke(toolTipHelper);
+ toolTipShell = (Shell) m2.invoke(toolTipHelper);
} catch (Exception e) {
}
- if(toolTipShell != null) {
+ if (toolTipShell != null) {
toolTipShell.addListener(SWT.Hide, hideListener = new Listener() {
+ @Override
public void handleEvent(Event event) {
event.display.asyncExec(new Runnable() {
+ @Override
public void run() {
manageToolTip();
}
@@ -103,9 +105,11 @@ public class TooltipHook {
});
toolTipShell.addListener(SWT.Show, showListener = new Listener() {
+ @Override
public void handleEvent(Event event) {
event.display.asyncExec(new Runnable() {
+ @Override
public void run() {
toolTipSource = getToolTipSource();
}
@@ -116,27 +120,27 @@ public class TooltipHook {
}
private IFigure getToolTipSource() {
- if(toolTipHelper == null) {
+ if (toolTipHelper == null) {
return null;
}
try {
Field f = ToolTipHelper.class.getDeclaredField("currentTipSource");
f.setAccessible(true);
- return (IFigure)f.get(toolTipHelper);
+ return (IFigure) f.get(toolTipHelper);
} catch (Exception e) {
return null;
}
}
private void manageToolTip() {
- if(toolTipSource == null) {
+ if (toolTipSource == null) {
hideToolTip();
return;
}
IFigure currentToolTipSource = getToolTipSource();
- if(toolTipSource != currentToolTipSource) {
+ if (toolTipSource != currentToolTipSource) {
hideToolTip();
- } else if(toolTipShell != null && !toolTipShell.isDisposed() && !toolTipShell.isVisible()) {
+ } else if (toolTipShell != null && !toolTipShell.isDisposed() && !toolTipShell.isVisible()) {
displayToolTip();
}
}
@@ -152,7 +156,7 @@ public class TooltipHook {
}
private void hideToolTip() {
- if(toolTipDisplayed) {
+ if (toolTipDisplayed) {
toolTipShell.removeListener(SWT.Hide, hideListener);
toolTipShell.setVisible(false);
toolTipShell.addListener(SWT.Hide, hideListener);
@@ -164,7 +168,7 @@ public class TooltipHook {
public void dispose() {
toolTipSource = null;
toolTipHelper = null;
- if(toolTipShell != null && !toolTipShell.isDisposed()) {
+ if (toolTipShell != null && !toolTipShell.isDisposed()) {
hideToolTip();
toolTipShell.removeListener(SWT.Hide, hideListener);
toolTipShell.removeListener(SWT.Show, showListener);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/TooltipUtil.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/TooltipUtil.java
index d161016dff0..e2dbbbca40f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/TooltipUtil.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/TooltipUtil.java
@@ -88,13 +88,13 @@ public class TooltipUtil {
}
public static void manageTooltipEditPolicy(EditPart editPart) {
- if(editPart == null || !(editPart instanceof GraphicalEditPart)) {
+ if (editPart == null || !(editPart instanceof GraphicalEditPart)) {
return;
}
- IFigure figure = ((GraphicalEditPart)editPart).getFigure();
+ IFigure figure = ((GraphicalEditPart) editPart).getFigure();
EClass semanticElementType = getSemanticElementType(editPart);
- if(supportTooltips(semanticElementType)) {
- editPart.installEditPolicy(TOOLTIP_ROLE, new TooltipEditPolicy(new EditPartTooltipUpdater((GraphicalEditPart)editPart)));
+ if (supportTooltips(semanticElementType)) {
+ editPart.installEditPolicy(TOOLTIP_ROLE, new TooltipEditPolicy(new EditPartTooltipUpdater((GraphicalEditPart) editPart)));
} else {
editPart.removeEditPolicy(TOOLTIP_ROLE);
figure.setToolTip(null);
@@ -102,14 +102,14 @@ public class TooltipUtil {
}
private static boolean supportTooltips(EClass semanticType) {
- if(semanticType == null) {
+ if (semanticType == null) {
return false;
}
- if(ELEMENT_SUPPORT_TOOLTIPS.contains(semanticType)) {
+ if (ELEMENT_SUPPORT_TOOLTIPS.contains(semanticType)) {
return true;
}
- for(EClass type : ELEMENT_SUPPORT_TOOLTIPS) {
- if(type.isSuperTypeOf(semanticType)) {
+ for (EClass type : ELEMENT_SUPPORT_TOOLTIPS) {
+ if (type.isSuperTypeOf(semanticType)) {
return true;
}
}
@@ -122,29 +122,29 @@ public class TooltipUtil {
}
private static EObject getSemanticElement(EditPart editPart) {
- if(editPart == null) {
+ if (editPart == null) {
return null;
}
Object model = editPart.getModel();
- if(model instanceof View) {
- return ViewUtil.resolveSemanticElement((View)model);
+ if (model instanceof View) {
+ return ViewUtil.resolveSemanticElement((View) model);
}
return null;
}
public static View getTopNodeView(Object model, EObject semanticElement) {
- if(model == null || !(model instanceof View)) {
+ if (model == null || !(model instanceof View)) {
return null;
}
- View view = (View)model;
+ View view = (View) model;
EObject elt = ViewUtil.resolveSemanticElement(view);
- if(elt == null || elt != semanticElement) {
+ if (elt == null || elt != semanticElement) {
return null;
}
View containerView = ViewUtil.getContainerView(view);
- if(containerView != null) {
+ if (containerView != null) {
EObject containerElement = ViewUtil.resolveSemanticElement(containerView);
- if(containerElement == null || containerElement != semanticElement) {
+ if (containerElement == null || containerElement != semanticElement) {
return view;
}
}
@@ -180,12 +180,12 @@ public class TooltipUtil {
tooltipFigure.update();
}
});
- if(getHost() instanceof LifelineEditPart) {
- ((LifelineEditPart)getHost()).getPrimaryView().eAdapters().add(modelListener = new AdapterImpl() {
+ if (getHost() instanceof LifelineEditPart) {
+ ((LifelineEditPart) getHost()).getPrimaryView().eAdapters().add(modelListener = new AdapterImpl() {
@Override
public void notifyChanged(Notification msg) {
- if(msg.isTouch()) {
+ if (msg.isTouch()) {
return;
}
tooltipFigure.update();
@@ -198,8 +198,8 @@ public class TooltipUtil {
public void deactivate() {
super.deactivate();
getHostFigure().removeMouseMotionListener(updateListener);
- if(getHost() instanceof LifelineEditPart) {
- ((LifelineEditPart)getHost()).getPrimaryView().eAdapters().remove(modelListener);
+ if (getHost() instanceof LifelineEditPart) {
+ ((LifelineEditPart) getHost()).getPrimaryView().eAdapters().remove(modelListener);
}
}
}
@@ -229,7 +229,7 @@ public class TooltipUtil {
namePage.add(nameFigure = new TextFlow());
add(namePage);
namePage.setFont(JFaceResources.getBannerFont());
- //description
+ // description
FlowPage descPage = new FlowPage();
descPage.setOpaque(true);
descPage.add(descriptionFigure = new TextFlow());
@@ -247,8 +247,8 @@ public class TooltipUtil {
@Override
public Dimension getPreferredSize(int wHint, int hHint) {
Dimension d = super.getPreferredSize(-1, -1);
- // if(d.width > 150)
- // d = super.getPreferredSize(150, -1);
+ // if(d.width > 150)
+ // d = super.getPreferredSize(150, -1);
return d;
}
@@ -277,7 +277,7 @@ public class TooltipUtil {
}
public void update() {
- if(updater == null) {
+ if (updater == null) {
return;
}
setName(updater.getTooltipName());
@@ -312,21 +312,20 @@ public class TooltipUtil {
*/
@Override
public String getTooltipName() {
- if(editPart instanceof CombinedFragment2EditPart) {
+ if (editPart instanceof CombinedFragment2EditPart) {
return "Co Region";
}
EObject semanticElement = getSemanticElement(editPart);
- if(semanticElement instanceof Message) {
- Message message = (Message)semanticElement;
+ if (semanticElement instanceof Message) {
+ Message message = (Message) semanticElement;
MessageSort messageSort = message.getMessageSort();
- switch(messageSort) {
+ switch (messageSort) {
case ASYNCH_CALL_LITERAL:
return "Asynchronous Message";
- case ASYNCH_SIGNAL_LITERAL:
- {
- if(message.getSendEvent() == null) {
+ case ASYNCH_SIGNAL_LITERAL: {
+ if (message.getSendEvent() == null) {
return "Found Message";
- } else if(message.getReceiveEvent() == null) {
+ } else if (message.getReceiveEvent() == null) {
return "Lost Message";
}
}
@@ -339,10 +338,10 @@ public class TooltipUtil {
case SYNCH_CALL_LITERAL:
return "Synchronous Message";
}
- } else if(semanticElement instanceof DestructionOccurrenceSpecification) {
+ } else if (semanticElement instanceof DestructionOccurrenceSpecification) {
return "Destruction Event";
}
- if(semanticElement != null) {
+ if (semanticElement != null) {
return getDisplayName(semanticElement.eClass().getName());
}
return null;
@@ -351,8 +350,8 @@ public class TooltipUtil {
private String getDisplayName(String name) {
StringBuffer displayName = new StringBuffer();
char[] charArray = name.toCharArray();
- for(int i = 0; i < charArray.length; i++) {
- if(Character.isUpperCase(charArray[i])) {
+ for (int i = 0; i < charArray.length; i++) {
+ if (Character.isUpperCase(charArray[i])) {
displayName.append(" ");
}
displayName.append(charArray[i]);
@@ -367,97 +366,97 @@ public class TooltipUtil {
*/
@Override
public String getTooltipDescription() {
- //CoRegion
- // if(editPart instanceof CombinedFragment2EditPart) {
- // return null;
- // }
+ // CoRegion
+ // if(editPart instanceof CombinedFragment2EditPart) {
+ // return null;
+ // }
EObject semanticElement = getSemanticElement(editPart);
- if(semanticElement instanceof StateInvariant || semanticElement instanceof DestructionOccurrenceSpecification || semanticElement instanceof GeneralOrdering) {
+ if (semanticElement instanceof StateInvariant || semanticElement instanceof DestructionOccurrenceSpecification || semanticElement instanceof GeneralOrdering) {
return null;
}
StringBuffer descBuf = new StringBuffer();
- // if(semanticElement instanceof Lifeline) {
- // descBuf.append("label: ");
- // } else {
+ // if(semanticElement instanceof Lifeline) {
+ // descBuf.append("label: ");
+ // } else {
descBuf.append("name: ");
- // }
+ // }
UMLNavigatorLabelProvider labelProvider = new UMLNavigatorLabelProvider();
Object model = editPart.getModel();
String label = null;
View topNodeView = getTopNodeView(model, semanticElement);
- if(topNodeView != null) {
+ if (topNodeView != null) {
label = labelProvider.getText(topNodeView);
- if(label.startsWith("<UnknownElement")) {
+ if (label.startsWith("<UnknownElement")) {
label = null;
}
}
- //Try to use the real name of InteractionUse.
- if(semanticElement instanceof InteractionUse) {
- label = ((InteractionUse)semanticElement).getLabel();
- } else if(semanticElement instanceof Lifeline) {
- label = ((Lifeline)semanticElement).getLabel();
+ // Try to use the real name of InteractionUse.
+ if (semanticElement instanceof InteractionUse) {
+ label = ((InteractionUse) semanticElement).getLabel();
+ } else if (semanticElement instanceof Lifeline) {
+ label = ((Lifeline) semanticElement).getLabel();
}
- if((label == null) && semanticElement instanceof NamedElement) {
- label = ((NamedElement)semanticElement).getLabel();
+ if ((label == null) && semanticElement instanceof NamedElement) {
+ label = ((NamedElement) semanticElement).getLabel();
}
descBuf.append(label);
descBuf.append("\n");
- if(semanticElement instanceof CombinedFragment && !(editPart instanceof CombinedFragment2EditPart)) {
+ if (semanticElement instanceof CombinedFragment && !(editPart instanceof CombinedFragment2EditPart)) {
descBuf.append("operator: ");
- InteractionOperatorKind operator = ((CombinedFragment)semanticElement).getInteractionOperator();
- if(operator != null) {
+ InteractionOperatorKind operator = ((CombinedFragment) semanticElement).getInteractionOperator();
+ if (operator != null) {
descBuf.append(operator.getName());
}
descBuf.append("\n");
- } else if(semanticElement instanceof InteractionOperand) {
+ } else if (semanticElement instanceof InteractionOperand) {
descBuf.append("parent:name: ");
- InteractionOperand interactionOperand = (InteractionOperand)semanticElement;
+ InteractionOperand interactionOperand = (InteractionOperand) semanticElement;
Element owner = interactionOperand.getOwner();
- while(owner != null && !(owner instanceof CombinedFragment)) {
+ while (owner != null && !(owner instanceof CombinedFragment)) {
owner = owner.getOwner();
}
- CombinedFragment parent = (CombinedFragment)owner;
- if(parent != null) {
+ CombinedFragment parent = (CombinedFragment) owner;
+ if (parent != null) {
descBuf.append(parent.getLabel());
}
descBuf.append("\n");
descBuf.append("parent:operator: ");
- if(parent != null) {
+ if (parent != null) {
InteractionOperatorKind operator = parent.getInteractionOperator();
- if(operator != null) {
+ if (operator != null) {
descBuf.append(operator.getName());
}
}
descBuf.append("\n");
- } else if(semanticElement instanceof InteractionUse) {
- Interaction refersTo = ((InteractionUse)semanticElement).getRefersTo();
- if(refersTo != null) {
+ } else if (semanticElement instanceof InteractionUse) {
+ Interaction refersTo = ((InteractionUse) semanticElement).getRefersTo();
+ if (refersTo != null) {
descBuf.append("ref: ");
descBuf.append(refersTo.getLabel());
descBuf.append("\n");
}
}
- if(semanticElement instanceof Lifeline) {
- //Bug 417396
- //FIXME: Refactored the displayValue as-is (int -> Collection<String>), although it is not used anymore to configure the tooltip. Remove?
+ if (semanticElement instanceof Lifeline) {
+ // Bug 417396
+ // FIXME: Refactored the displayValue as-is (int -> Collection<String>), although it is not used anymore to configure the tooltip. Remove?
Collection<String> displayValue = LifelineLabelHelper.DEFAULT_LABEL_DISPLAY;
IMaskManagedLabelEditPolicy policy = null;
- if(editPart instanceof LifelineEditPart) {
- policy = (IMaskManagedLabelEditPolicy)editPart.getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- } else if(editPart instanceof LifelineNameEditPart) {
- policy = (IMaskManagedLabelEditPolicy)editPart.getParent().getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if (editPart instanceof LifelineEditPart) {
+ policy = (IMaskManagedLabelEditPolicy) editPart.getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ } else if (editPart instanceof LifelineNameEditPart) {
+ policy = (IMaskManagedLabelEditPolicy) editPart.getParent().getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
}
- if(policy != null) {
+ if (policy != null) {
displayValue = policy.getCurrentDisplayValue();
}
- Lifeline lifeline = (Lifeline)semanticElement;
+ Lifeline lifeline = (Lifeline) semanticElement;
ConnectableElement represents = lifeline.getRepresents();
- if(represents != null) {
+ if (represents != null) {
descBuf.append("represent: ");
descBuf.append(represents.getLabel());
descBuf.append("\n");
Type type = represents.getType();
- if(type != null) {
+ if (type != null) {
descBuf.append("represent type: ");
descBuf.append(type.getLabel());
descBuf.append("\n");
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/validation/FragmentOrderingKeeper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/validation/FragmentOrderingKeeper.java
index 22e4c5b41f3..55c1fe26c1d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/validation/FragmentOrderingKeeper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/validation/FragmentOrderingKeeper.java
@@ -49,19 +49,18 @@ import org.eclipse.uml2.uml.OccurrenceSpecification;
* In the order Interaction's fragment property, the order is kept as a valid trace,
* </ul>
* <ul>
- * Or at least, when there is no valid trace, that the order is kept for each lifeline (not to loose sequence information on a lifeline, which is
- * contained only graphically otherwise).
+ * Or at least, when there is no valid trace, that the order is kept for each lifeline (not to loose sequence information on a lifeline, which is contained only graphically otherwise).
* </ul>
* </li> <br/>
* Note that this class contains an algorithm which computes a valid trace. With little adaptation, it could easily provide all valid traces, hence,
* compare two lifelines to know whether they are equivalent.
- *
+ *
* @author vhemery
*/
public class FragmentOrderingKeeper {
/** A constant equals to half the smallest location delta */
- private static final float HALF_UNIT = (float)0.5;
+ private static final float HALF_UNIT = (float) 0.5;
/** Format for displaying an element's name */
private static final String NAME_FORMAT = "<{0}> {1}";
@@ -88,36 +87,36 @@ public class FragmentOrderingKeeper {
/**
* Validate modification and update the interaction's fragments order if necessary.
- *
+ *
* @see org.eclipse.emf.validation.AbstractModelConstraint#validate(org.eclipse.emf.validation.IValidationContext)
- *
+ *
* @param target
- * the target to validate
+ * the target to validate
* @param ctx
- * validation context
+ * validation context
* @return status
*/
public IStatus validate(EObject target, IValidationContext ctx) {
- if(target instanceof Interaction) {
- Interaction interaction = (Interaction)target;
+ if (target instanceof Interaction) {
+ Interaction interaction = (Interaction) target;
boolean valid = validateOrder(interaction);
- if(!valid) {
+ if (!valid) {
IStatus status = ctx.createFailureStatus(getConflictingFragmentsFormattedString());
removeModelReferences();
return status;
}
- } else if(target instanceof InteractionOperand) {
- InteractionOperand interactionOp = (InteractionOperand)target;
+ } else if (target instanceof InteractionOperand) {
+ InteractionOperand interactionOp = (InteractionOperand) target;
boolean valid = validateOrder(interactionOp);
- if(!valid) {
+ if (!valid) {
IStatus status = ctx.createFailureStatus(getConflictingFragmentsFormattedString());
removeModelReferences();
return status;
}
- } else if(target instanceof InteractionFragment) {
- InteractionFragment fragment = (InteractionFragment)target;
+ } else if (target instanceof InteractionFragment) {
+ InteractionFragment fragment = (InteractionFragment) target;
boolean valid = validateOrder(fragment.getEnclosingInteraction());
- if(!valid) {
+ if (!valid) {
IStatus status = ctx.createFailureStatus(getConflictingFragmentsFormattedString());
removeModelReferences();
return status;
@@ -129,12 +128,12 @@ public class FragmentOrderingKeeper {
/**
* Get a formatted string with names of all conflicting fragments
- *
+ *
* @return formatted string
*/
private String getConflictingFragmentsFormattedString() {
StringBuffer buff = new StringBuffer();
- for(InteractionFragment frag : conflictingFragments) {
+ for (InteractionFragment frag : conflictingFragments) {
buff.append(System.getProperty("line.separator"));
String name = NLS.bind(NAME_FORMAT, frag.eClass().getName(), frag.getQualifiedName());
buff.append(name);
@@ -149,35 +148,35 @@ public class FragmentOrderingKeeper {
// orderedFragments is an EList, hence, we must not empty it.
orderedFragments = null;
// other lists can be cleared.
- if(constrainingLifelineParts != null) {
+ if (constrainingLifelineParts != null) {
constrainingLifelineParts.clear();
}
- if(constrainingMessages != null) {
+ if (constrainingMessages != null) {
constrainingMessages.clear();
}
- if(constrainingExecutions != null) {
+ if (constrainingExecutions != null) {
constrainingExecutions.clear();
}
- if(constrainingGeneralOrderings != null) {
+ if (constrainingGeneralOrderings != null) {
constrainingGeneralOrderings.clear();
}
- //constrainingCombinedFragments.clear();
- if(orderConstraints != null) {
+ // constrainingCombinedFragments.clear();
+ if (orderConstraints != null) {
orderConstraints.clear();
}
- if(conflictingFragments != null) {
+ if (conflictingFragments != null) {
conflictingFragments.clear();
}
- if(optionallyOrderedFragments != null) {
+ if (optionallyOrderedFragments != null) {
optionallyOrderedFragments.clear();
}
}
/**
* Validate the order of interaction operand's fragments
- *
+ *
* @param interactionOperand
- * the interaction operand
+ * the interaction operand
* @return true if a valid trace has been computed, false if none exists
*/
private boolean validateOrder(InteractionOperand interactionOperand) {
@@ -188,9 +187,9 @@ public class FragmentOrderingKeeper {
/**
* Validate the order of interaction's fragments
- *
+ *
* @param interaction
- * the interaction
+ * the interaction
* @return true if a valid trace has been computed, false if none exists
*/
private boolean validateOrder(Interaction interaction) {
@@ -222,8 +221,8 @@ public class FragmentOrderingKeeper {
private void computeConstraints() {
IEditorPart editor = MDTUtil.getActiveEditor();
DiagramEditPart diagram = null;
- if(editor instanceof IDiagramWorkbenchPart) {
- diagram = ((IDiagramWorkbenchPart)editor).getDiagramEditPart();
+ if (editor instanceof IDiagramWorkbenchPart) {
+ diagram = ((IDiagramWorkbenchPart) editor).getDiagramEditPart();
}
// reset constraints
constrainingNotRepresentedLifelines = new HashSet<Lifeline>();
@@ -233,24 +232,24 @@ public class FragmentOrderingKeeper {
constrainingExecutions = new HashSet<ExecutionSpecification>();
constrainingGeneralOrderings = new HashSet<GeneralOrdering>();
// get new constraining objects
- for(InteractionFragment fragment : orderedFragments) {
+ for (InteractionFragment fragment : orderedFragments) {
// get Lifelines
- for(Lifeline lifeline : fragment.getCovereds()) {
+ for (Lifeline lifeline : fragment.getCovereds()) {
boolean lifelineRepresented = false;
List<?> lifelineViews = DiagramEditPartsUtil.getEObjectViews(lifeline);
- for(Object lifelineView : lifelineViews) {
- if(lifelineView instanceof View && diagram != null) {
- int visualID = UMLVisualIDRegistry.getVisualID((View)lifelineView);
- if(visualID == LifelineEditPart.VISUAL_ID) {
- EditPart part = DiagramEditPartsUtil.getEditPartFromView((View)lifelineView, diagram);
- if(part instanceof LifelineEditPart) {
- constrainingLifelineParts.add((LifelineEditPart)part);
+ for (Object lifelineView : lifelineViews) {
+ if (lifelineView instanceof View && diagram != null) {
+ int visualID = UMLVisualIDRegistry.getVisualID((View) lifelineView);
+ if (visualID == LifelineEditPart.VISUAL_ID) {
+ EditPart part = DiagramEditPartsUtil.getEditPartFromView((View) lifelineView, diagram);
+ if (part instanceof LifelineEditPart) {
+ constrainingLifelineParts.add((LifelineEditPart) part);
lifelineRepresented = true;
}
}
}
}
- if(!lifelineRepresented) {
+ if (!lifelineRepresented) {
// rely on old order for the lifeline
constrainingNotRepresentedLifelines.add(lifeline);
}
@@ -269,26 +268,26 @@ public class FragmentOrderingKeeper {
* }
*/
// get Messages
- if(fragment instanceof MessageOccurrenceSpecification) {
- Message mess = ((MessageOccurrenceSpecification)fragment).getMessage();
- if(mess != null) {
+ if (fragment instanceof MessageOccurrenceSpecification) {
+ Message mess = ((MessageOccurrenceSpecification) fragment).getMessage();
+ if (mess != null) {
constrainingMessages.add(mess);
}
}
// get ExecutionSpecifications
- if(fragment instanceof ExecutionSpecification) {
- constrainingExecutions.add((ExecutionSpecification)fragment);
- } else if(fragment instanceof ExecutionOccurrenceSpecification) {
- ExecutionSpecification exe = ((ExecutionOccurrenceSpecification)fragment).getExecution();
- if(exe != null) {
+ if (fragment instanceof ExecutionSpecification) {
+ constrainingExecutions.add((ExecutionSpecification) fragment);
+ } else if (fragment instanceof ExecutionOccurrenceSpecification) {
+ ExecutionSpecification exe = ((ExecutionOccurrenceSpecification) fragment).getExecution();
+ if (exe != null) {
constrainingExecutions.add(exe);
}
}
// get General Orderings
- if(fragment instanceof OccurrenceSpecification) {
- EList<GeneralOrdering> orderings = ((OccurrenceSpecification)fragment).getToAfters();
+ if (fragment instanceof OccurrenceSpecification) {
+ EList<GeneralOrdering> orderings = ((OccurrenceSpecification) fragment).getToAfters();
constrainingGeneralOrderings.addAll(orderings);
- orderings = ((OccurrenceSpecification)fragment).getToBefores();
+ orderings = ((OccurrenceSpecification) fragment).getToBefores();
constrainingGeneralOrderings.addAll(orderings);
}
}
@@ -324,11 +323,11 @@ public class FragmentOrderingKeeper {
orderConstraints = new ArrayList<List<InteractionFragment>>(numberOfConstraints);
int indexConstraint = 0;
// construct lifelines constraints (model only)
- for(Lifeline lifeline : constrainingNotRepresentedLifelines) {
+ for (Lifeline lifeline : constrainingNotRepresentedLifelines) {
List<InteractionFragment> constraint = new ArrayList<InteractionFragment>();
- //fill constraint : previous order for elements of lifeline not drawn
- for(InteractionFragment fragment : orderedFragments) {
- if(lifeline.getCoveredBys().contains(fragment)) {
+ // fill constraint : previous order for elements of lifeline not drawn
+ for (InteractionFragment fragment : orderedFragments) {
+ if (lifeline.getCoveredBys().contains(fragment)) {
constraint.add(fragment);
}
}
@@ -338,9 +337,9 @@ public class FragmentOrderingKeeper {
indexConstraint++;
}
// construct lifelines constraints (graphical and model)
- for(LifelineEditPart part : constrainingLifelineParts) {
+ for (LifelineEditPart part : constrainingLifelineParts) {
TreeMap<Float, InteractionFragment> constraint = new TreeMap<Float, InteractionFragment>();
- //fill constraint : graphical location and previous order of elements not drawn
+ // fill constraint : graphical location and previous order of elements not drawn
fillConstraintWithLifelineEvents(constraint, part, indexConstraint);
// store constraint
ArrayList<InteractionFragment> list = new ArrayList<InteractionFragment>(constraint.values());
@@ -361,16 +360,16 @@ public class FragmentOrderingKeeper {
* }
*/
// construct messages constraints
- for(Message mess : constrainingMessages) {
+ for (Message mess : constrainingMessages) {
List<InteractionFragment> constraint = new ArrayList<InteractionFragment>(2);
- //fill constraint : send > receive
+ // fill constraint : send > receive
MessageEnd frag = mess.getSendEvent();
- if(frag instanceof InteractionFragment && orderedFragments.contains(frag)) {
- constraint.add((InteractionFragment)frag);
+ if (frag instanceof InteractionFragment && orderedFragments.contains(frag)) {
+ constraint.add((InteractionFragment) frag);
}
frag = mess.getReceiveEvent();
- if(frag instanceof InteractionFragment && orderedFragments.contains(frag)) {
- constraint.add((InteractionFragment)frag);
+ if (frag instanceof InteractionFragment && orderedFragments.contains(frag)) {
+ constraint.add((InteractionFragment) frag);
}
DestructionOccurrenceUtil.constraintDestructionOccurrence(mess, constraint);
// store constraint
@@ -378,19 +377,19 @@ public class FragmentOrderingKeeper {
indexConstraint++;
}
// construct executions constraints
- for(ExecutionSpecification exe : constrainingExecutions) {
+ for (ExecutionSpecification exe : constrainingExecutions) {
List<InteractionFragment> constraint = new ArrayList<InteractionFragment>(3);
- //fill constraint : start > execution > finish
+ // fill constraint : start > execution > finish
InteractionFragment frag = exe.getStart();
- if(frag != null && orderedFragments.contains(frag)) {
+ if (frag != null && orderedFragments.contains(frag)) {
constraint.add(frag);
}
frag = exe;
- if(orderedFragments.contains(frag)) {
+ if (orderedFragments.contains(frag)) {
constraint.add(frag);
}
frag = exe.getFinish();
- if(frag != null && orderedFragments.contains(frag)) {
+ if (frag != null && orderedFragments.contains(frag)) {
constraint.add(frag);
}
// store constraint
@@ -398,15 +397,15 @@ public class FragmentOrderingKeeper {
indexConstraint++;
}
// construct general orderings constraints
- for(GeneralOrdering genOrd : constrainingGeneralOrderings) {
+ for (GeneralOrdering genOrd : constrainingGeneralOrderings) {
List<InteractionFragment> constraint = new ArrayList<InteractionFragment>(2);
- //fill constraint : before > after
+ // fill constraint : before > after
InteractionFragment frag = genOrd.getBefore();
- if(frag != null && orderedFragments.contains(frag)) {
+ if (frag != null && orderedFragments.contains(frag)) {
constraint.add(frag);
}
frag = genOrd.getAfter();
- if(frag != null && orderedFragments.contains(frag)) {
+ if (frag != null && orderedFragments.contains(frag)) {
constraint.add(frag);
}
// store constraint
@@ -417,23 +416,23 @@ public class FragmentOrderingKeeper {
/**
* Fill the constraint imposed by a lifeline
- *
+ *
* @param constraint
- * the tree map for hosting the constraint
+ * the tree map for hosting the constraint
* @param lifelinePart
- * the lifeline edit part
+ * the lifeline edit part
* @param indexConstraint
- * index of constraint
+ * index of constraint
*/
private void fillConstraintWithLifelineEvents(TreeMap<Float, InteractionFragment> constraint, LifelineEditPart lifelinePart, int indexConstraint) {
EObject lifeline = lifelinePart.resolveSemanticElement();
- if(lifeline instanceof Lifeline) {
+ if (lifeline instanceof Lifeline) {
List<InteractionFragment> nonLocalizedEvents = new ArrayList<InteractionFragment>();
// sort fragments according to their location on the lifeline
- for(InteractionFragment event : ((Lifeline)lifeline).getCoveredBys()) {
- if(orderedFragments.contains(event)) {
+ for (InteractionFragment event : ((Lifeline) lifeline).getCoveredBys()) {
+ if (orderedFragments.contains(event)) {
Point loc = SequenceUtil.findLocationOfEvent(lifelinePart, event);
- if(loc != null) {
+ if (loc != null) {
float index = findNonConflictingYIndexOnLifeline(loc.y, constraint, event);
constraint.put(index, event);
} else {
@@ -445,23 +444,23 @@ public class FragmentOrderingKeeper {
optionallyOrderedFragments.put(indexConstraint, nonLocalizedEvents);
// add not drawn events according to their old order in the valid trace
InteractionFragment lastMetSortedFragment = null;
- for(InteractionFragment fragment : orderedFragments) {
- if(((Lifeline)lifeline).getCoveredBys().contains(fragment)) {
+ for (InteractionFragment fragment : orderedFragments) {
+ if (((Lifeline) lifeline).getCoveredBys().contains(fragment)) {
// this is a fragment of the lifeline.
- if(constraint.containsValue(fragment)) {
+ if (constraint.containsValue(fragment)) {
lastMetSortedFragment = fragment;
- } else if(nonLocalizedEvents.contains(fragment) && lastMetSortedFragment == null) {
+ } else if (nonLocalizedEvents.contains(fragment) && lastMetSortedFragment == null) {
// insert it at the very beginning
- constraint.put((float)0, fragment);
+ constraint.put((float) 0, fragment);
lastMetSortedFragment = fragment;
- } else if(nonLocalizedEvents.contains(fragment)) {
+ } else if (nonLocalizedEvents.contains(fragment)) {
// insert it just after lastMetSortedFragment
Iterator<Entry<Float, InteractionFragment>> entryIt = constraint.entrySet().iterator();
// find float key of lastMetSortedFragment
- while(entryIt.hasNext()) {
+ while (entryIt.hasNext()) {
Entry<Float, InteractionFragment> entry = entryIt.next();
- if(entry.getValue().equals(lastMetSortedFragment)) {
- if(entryIt.hasNext()) {
+ if (entry.getValue().equals(lastMetSortedFragment)) {
+ if (entryIt.hasNext()) {
// insert between the two fragments
float key = (entry.getKey() + entryIt.next().getKey()) / 2;
constraint.put(key, fragment);
@@ -484,21 +483,21 @@ public class FragmentOrderingKeeper {
/**
* Find a float index corresponding approximatively to the location of event on the lifeline.
- *
+ *
* @param y
- * real location of event on the lifeline
+ * real location of event on the lifeline
* @param eventsMap
- * map containing other events of the lifeline
+ * map containing other events of the lifeline
* @param event
- * event to find a float index for
+ * event to find a float index for
* @return unused float index for the map
*/
private float findNonConflictingYIndexOnLifeline(int y, TreeMap<Float, InteractionFragment> eventsMap, InteractionFragment event) {
float index = Integer.valueOf(y).floatValue();
float delta = HALF_UNIT;
- while(eventsMap.containsKey(index)) {
+ while (eventsMap.containsKey(index)) {
InteractionFragment otherEvent = eventsMap.get(index);
- if(simulatenousEventsHappenInThisOrder(otherEvent, event)) {
+ if (simulatenousEventsHappenInThisOrder(otherEvent, event)) {
// other event must happen before the event
index += delta;
} else {
@@ -512,53 +511,53 @@ public class FragmentOrderingKeeper {
/**
* Gives the order between two fragments which virtually happen at the same time
- *
+ *
* @param firstFragment
- * first InteractionFragment
+ * first InteractionFragment
* @param secondFragment
- * second InteractionFragment
+ * second InteractionFragment
* @return true if firstEvent should happen before secondEvent, false if the contrary.
*/
private boolean simulatenousEventsHappenInThisOrder(InteractionFragment firstFragment, InteractionFragment secondFragment) {
// DestructionEvent comes last
- if(firstFragment instanceof DestructionOccurrenceSpecification) {
+ if (firstFragment instanceof DestructionOccurrenceSpecification) {
return false;
- } else if(secondFragment instanceof DestructionOccurrenceSpecification) {
+ } else if (secondFragment instanceof DestructionOccurrenceSpecification) {
return true;
}
// a receiving message event should trigger any other event
- if(firstFragment instanceof MessageOccurrenceSpecification && EcoreUtil.equals(((MessageOccurrenceSpecification)firstFragment).getMessage().getReceiveEvent(), firstFragment)) {
+ if (firstFragment instanceof MessageOccurrenceSpecification && EcoreUtil.equals(((MessageOccurrenceSpecification) firstFragment).getMessage().getReceiveEvent(), firstFragment)) {
return true;
}
- if(secondFragment instanceof MessageOccurrenceSpecification && EcoreUtil.equals(((MessageOccurrenceSpecification)secondFragment).getMessage().getReceiveEvent(), secondFragment)) {
+ if (secondFragment instanceof MessageOccurrenceSpecification && EcoreUtil.equals(((MessageOccurrenceSpecification) secondFragment).getMessage().getReceiveEvent(), secondFragment)) {
return false;
}
// a starting execution event should happen before subsequent execution's events (except creation message receive)
- if(firstFragment instanceof ExecutionOccurrenceSpecification && EcoreUtil.equals(((ExecutionOccurrenceSpecification)firstFragment).getExecution().getStart(), firstFragment)) {
+ if (firstFragment instanceof ExecutionOccurrenceSpecification && EcoreUtil.equals(((ExecutionOccurrenceSpecification) firstFragment).getExecution().getStart(), firstFragment)) {
return true;
}
- if(secondFragment instanceof ExecutionOccurrenceSpecification && EcoreUtil.equals(((ExecutionOccurrenceSpecification)secondFragment).getExecution().getStart(), secondFragment)) {
+ if (secondFragment instanceof ExecutionOccurrenceSpecification && EcoreUtil.equals(((ExecutionOccurrenceSpecification) secondFragment).getExecution().getStart(), secondFragment)) {
return false;
}
// an execution event should happen before subsequent execution's events (except starting)
- if(firstFragment instanceof ExecutionSpecification) {
+ if (firstFragment instanceof ExecutionSpecification) {
return true;
}
- if(secondFragment instanceof ExecutionSpecification) {
+ if (secondFragment instanceof ExecutionSpecification) {
return false;
}
// a finishing execution event should happen after terminated execution's events
- if(firstFragment instanceof ExecutionOccurrenceSpecification && EcoreUtil.equals(((ExecutionOccurrenceSpecification)firstFragment).getExecution().getFinish(), firstFragment)) {
+ if (firstFragment instanceof ExecutionOccurrenceSpecification && EcoreUtil.equals(((ExecutionOccurrenceSpecification) firstFragment).getExecution().getFinish(), firstFragment)) {
return false;
}
- if(secondFragment instanceof ExecutionOccurrenceSpecification && EcoreUtil.equals(((ExecutionOccurrenceSpecification)secondFragment).getExecution().getFinish(), secondFragment)) {
+ if (secondFragment instanceof ExecutionOccurrenceSpecification && EcoreUtil.equals(((ExecutionOccurrenceSpecification) secondFragment).getExecution().getFinish(), secondFragment)) {
return true;
}
// a sending message event should happen preferably after an unspecified event
- if(firstFragment instanceof MessageOccurrenceSpecification && EcoreUtil.equals(((MessageOccurrenceSpecification)firstFragment).getMessage().getSendEvent(), firstFragment)) {
+ if (firstFragment instanceof MessageOccurrenceSpecification && EcoreUtil.equals(((MessageOccurrenceSpecification) firstFragment).getMessage().getSendEvent(), firstFragment)) {
return false;
}
- if(secondFragment instanceof MessageOccurrenceSpecification && EcoreUtil.equals(((MessageOccurrenceSpecification)secondFragment).getMessage().getSendEvent(), secondFragment)) {
+ if (secondFragment instanceof MessageOccurrenceSpecification && EcoreUtil.equals(((MessageOccurrenceSpecification) secondFragment).getMessage().getSendEvent(), secondFragment)) {
return true;
}
// otherwise, no importance
@@ -567,9 +566,9 @@ public class FragmentOrderingKeeper {
/**
* Reorder the fragments according to constraints to make a valid trace.
- *
+ *
* NOTE : this algorithm could easily be adapted to compute all valid traces.
- *
+ *
* @return true if a valid trace has been computed, false if there is no valid trace
*/
private boolean reorderFragmentsInAValidTrace() {
@@ -586,56 +585,56 @@ public class FragmentOrderingKeeper {
// pointers to first elements to handle in each constraint list
int[] pointers = new int[n];
Arrays.fill(pointers, 0);
- while(getFragmentToInspect(-1, pointers) != null) {
+ while (getFragmentToInspect(-1, pointers) != null) {
// inspect each constraint list to know whether fragment is mature enough, in such a case, store it with constraint index
Map<Integer, InteractionFragment> matureFragments = new HashMap<Integer, InteractionFragment>(n);
- for(int i = 0; i < n; i++) {
+ for (int i = 0; i < n; i++) {
InteractionFragment fragmentToInspect = getFragmentToInspect(i, pointers);
// if no more fragment in this constraint (fragmentToInspect == null), nothing to do
- if(fragmentToInspect != null) {
+ if (fragmentToInspect != null) {
/*
* Check whether fragment is mature enough :
* Fragment can happen only if other constraints do not impose it to happen after their current fragment.
*/
boolean wait = false;
- for(int j = 0; j < n; j++) {
- if(i != j) {
+ for (int j = 0; j < n; j++) {
+ if (i != j) {
// check that current fragment of constraint j must not occur before
- if(pointers[j] < orderConstraints.get(j).size()) {
+ if (pointers[j] < orderConstraints.get(j).size()) {
List<InteractionFragment> waitingList = orderConstraints.get(j).subList(pointers[j] + 1, orderConstraints.get(j).size());
- if(waitingList.contains(fragmentToInspect)) {
+ if (waitingList.contains(fragmentToInspect)) {
wait = true;
break;
}
}
}
}
- if(!wait) {
- //Fragment is ready to happen.
+ if (!wait) {
+ // Fragment is ready to happen.
matureFragments.put(i, fragmentToInspect);
}
}
}
- if(matureFragments.isEmpty()) {
- //FIXME duplicated code : try again, without optional order
+ if (matureFragments.isEmpty()) {
+ // FIXME duplicated code : try again, without optional order
// inspect each constraint list to know whether fragment is mature enough, in such a case, store it with constraint index
matureFragments = new HashMap<Integer, InteractionFragment>(n);
- for(int i = 0; i < n; i++) {
+ for (int i = 0; i < n; i++) {
InteractionFragment fragmentToInspect = getFragmentToInspect(i, pointers);
// if no more fragment in this constraint (fragmentToInspect == null), nothing to do
- if(fragmentToInspect != null) {
+ if (fragmentToInspect != null) {
/*
* Check whether fragment is mature enough :
* Fragment can happen only if other constraints do not impose it to happen after their current fragment.
*/
boolean wait = false;
- for(int j = 0; j < n; j++) {
- if(i != j) {
+ for (int j = 0; j < n; j++) {
+ if (i != j) {
// check that current fragment of constraint j must not occur before
- if(pointers[j] < orderConstraints.get(j).size()) {
+ if (pointers[j] < orderConstraints.get(j).size()) {
// only difference : ignore order for fragments in optionallyOrderedFragments
int updatedPointer = pointers[j];
- if(optionallyOrderedFragments.containsKey(j)) {
+ if (optionallyOrderedFragments.containsKey(j)) {
List<InteractionFragment> ignore = optionallyOrderedFragments.get(j);
/*
* // hack for coregion
@@ -646,32 +645,32 @@ public class FragmentOrderingKeeper {
* updatedPointer++;
* }
*/
- while(ignore.contains(orderConstraints.get(j).get(updatedPointer))) {
+ while (ignore.contains(orderConstraints.get(j).get(updatedPointer))) {
updatedPointer++;
}
}
List<InteractionFragment> waitingList = orderConstraints.get(j).subList(updatedPointer + 1, orderConstraints.get(j).size());
- if(waitingList.contains(fragmentToInspect)) {
+ if (waitingList.contains(fragmentToInspect)) {
wait = true;
break;
}
}
}
}
- if(!wait) {
- //Fragment is ready to happen.
+ if (!wait) {
+ // Fragment is ready to happen.
matureFragments.put(i, fragmentToInspect);
}
}
}
- if(matureFragments.isEmpty()) {
+ if (matureFragments.isEmpty()) {
// no valid trace.
- if(valid) {
+ if (valid) {
// store first conflicting fragments for user explanation
conflictingFragments = new HashSet<InteractionFragment>(n);
- for(int k = 0; k < n; k++) {
+ for (int k = 0; k < n; k++) {
InteractionFragment frag = getFragmentToInspect(k, pointers);
- if(frag != null) {
+ if (frag != null) {
conflictingFragments.add(frag);
}
}
@@ -684,9 +683,9 @@ public class FragmentOrderingKeeper {
InteractionFragment addedFragment = getFragmentToInspect(-1, pointers);
reorderedFragments.add(addedFragment);
// increment pointers of constraints whose fragment has been added.
- for(int k = 0; k < n; k++) {
+ for (int k = 0; k < n; k++) {
InteractionFragment frag = getFragmentToInspect(k, pointers);
- while(reorderedFragments.contains(frag)) {
+ while (reorderedFragments.contains(frag)) {
// either frag == addedFragment and has just been added, or it has been added earlier after a conflict
pointers[k]++;
frag = getFragmentToInspect(k, pointers);
@@ -701,42 +700,42 @@ public class FragmentOrderingKeeper {
Set<InteractionFragment> fragmentsSet = new HashSet<InteractionFragment>(matureFragments.values());
reorderedFragments.addAll(fragmentsSet);
// increment pointers of constraints whose fragment has been added.
- for(int incrementingPointerIndex : matureFragments.keySet()) {
+ for (int incrementingPointerIndex : matureFragments.keySet()) {
InteractionFragment frag = getFragmentToInspect(incrementingPointerIndex, pointers);
- while(reorderedFragments.contains(frag)) {
+ while (reorderedFragments.contains(frag)) {
// either frag == addedFragment and has just been added, or it has been added earlier after a conflict
pointers[incrementingPointerIndex]++;
frag = getFragmentToInspect(incrementingPointerIndex, pointers);
}
}
}
- // // no valid trace.
- // if(valid) {
- // // store first conflicting fragments for user explanation
- // conflictingFragments = new HashSet<InteractionFragment>(n);
- // for(int k = 0; k < n; k++) {
- // InteractionFragment frag = getFragmentToInspect(k, pointers);
- // if(frag != null) {
- // conflictingFragments.add(frag);
- // }
- // }
- // }
- // valid = false;
- // /*
- // * We must at least keep order of constraints with higher priority.
- // * Take the next event in the first available constraint.
- // */
- // InteractionFragment addedFragment = getFragmentToInspect(-1, pointers);
- // reorderedFragments.add(addedFragment);
- // // increment pointers of constraints whose fragment has been added.
- // for(int k = 0; k < n; k++) {
- // InteractionFragment frag = getFragmentToInspect(k, pointers);
- // while(reorderedFragments.contains(frag)) {
- // // either frag == addedFragment and has just been added, or it has been added earlier after a conflict
- // pointers[k]++;
- // frag = getFragmentToInspect(k, pointers);
- // }
- // }
+ // // no valid trace.
+ // if(valid) {
+ // // store first conflicting fragments for user explanation
+ // conflictingFragments = new HashSet<InteractionFragment>(n);
+ // for(int k = 0; k < n; k++) {
+ // InteractionFragment frag = getFragmentToInspect(k, pointers);
+ // if(frag != null) {
+ // conflictingFragments.add(frag);
+ // }
+ // }
+ // }
+ // valid = false;
+ // /*
+ // * We must at least keep order of constraints with higher priority.
+ // * Take the next event in the first available constraint.
+ // */
+ // InteractionFragment addedFragment = getFragmentToInspect(-1, pointers);
+ // reorderedFragments.add(addedFragment);
+ // // increment pointers of constraints whose fragment has been added.
+ // for(int k = 0; k < n; k++) {
+ // InteractionFragment frag = getFragmentToInspect(k, pointers);
+ // while(reorderedFragments.contains(frag)) {
+ // // either frag == addedFragment and has just been added, or it has been added earlier after a conflict
+ // pointers[k]++;
+ // frag = getFragmentToInspect(k, pointers);
+ // }
+ // }
} else {
/*
* NOTE : to compute every traces, fork here by making fragmentsSet.size() branches, adding only one mature fragment for each
@@ -746,9 +745,9 @@ public class FragmentOrderingKeeper {
Set<InteractionFragment> fragmentsSet = new HashSet<InteractionFragment>(matureFragments.values());
reorderedFragments.addAll(fragmentsSet);
// increment pointers of constraints whose fragment has been added.
- for(int incrementingPointerIndex : matureFragments.keySet()) {
+ for (int incrementingPointerIndex : matureFragments.keySet()) {
InteractionFragment frag = getFragmentToInspect(incrementingPointerIndex, pointers);
- while(reorderedFragments.contains(frag)) {
+ while (reorderedFragments.contains(frag)) {
// either frag == addedFragment and has just been added, or it has been added earlier after a conflict
pointers[incrementingPointerIndex]++;
frag = getFragmentToInspect(incrementingPointerIndex, pointers);
@@ -768,7 +767,7 @@ public class FragmentOrderingKeeper {
* Only move operations must be performed on the EList, since others strongly affect the model.
*/
int size = reorderedFragments.size();
- for(int i = 0; i < size; i++) {
+ for (int i = 0; i < size; i++) {
orderedFragments.move(i, reorderedFragments.get(i));
}
return valid;
@@ -776,31 +775,31 @@ public class FragmentOrderingKeeper {
/**
* Get the fragment to inspect for the trace computing algorithm.
- *
+ *
* @param i
- * index of constraint to take in account, or -1 for taking the first available one with the highest priority
+ * index of constraint to take in account, or -1 for taking the first available one with the highest priority
* @param pointers
- * pointers indicating fragments to inspect in each constraint
+ * pointers indicating fragments to inspect in each constraint
* @return fragment which must be inspected or null if none left
*/
private InteractionFragment getFragmentToInspect(int i, int[] pointers) {
- if(orderConstraints.size() != pointers.length) {
+ if (orderConstraints.size() != pointers.length) {
// should not happen, incorrect pointers argument
return null;
}
- if(i < 0 || i >= orderConstraints.size()) {
+ if (i < 0 || i >= orderConstraints.size()) {
i = -1;
// compute best i with highest priority
int j = 0;
- while(j < orderConstraints.size() && i == -1) {
- if(pointers[j] < orderConstraints.get(j).size()) {
+ while (j < orderConstraints.size() && i == -1) {
+ if (pointers[j] < orderConstraints.get(j).size()) {
// elements left in constraint j. Best constraint index found.
i = j;
}
j++;
}
}
- if(0 <= i && i < orderConstraints.size() && pointers[i] < orderConstraints.get(i).size()) {
+ if (0 <= i && i < orderConstraints.size() && pointers[i] < orderConstraints.get(i).size()) {
// return next fragment in constraint
return orderConstraints.get(i).get(pointers[i]);
} else {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/validation/UMLValidationHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/validation/UMLValidationHelper.java
index 0477d488eb5..665e57d38e7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/validation/UMLValidationHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/validation/UMLValidationHelper.java
@@ -16,47 +16,47 @@ import org.eclipse.uml2.uml.MessageEnd;
/**
* This helper performs non generated validation tasks.
- *
+ *
* @author vhemery
*/
public class UMLValidationHelper {
/**
* Validate modification and update the interaction operand's or interaction's fragments order if necessary.
- *
+ *
* @see org.eclipse.emf.validation.AbstractModelConstraint#validate(org.eclipse.emf.validation.IValidationContext)
- *
+ *
* @param context
- * object on which update is performed
+ * object on which update is performed
* @param ctx
- * validation context
+ * validation context
* @return status
*/
public static IStatus validateFragmentsOrder(EObject context, IValidationContext ctx) {
- if(context instanceof View) {
- return validateFragmentsOrder(((View)context).getElement(), ctx);
- } else if(context instanceof Bounds) {
- return validateFragmentsOrder(((Bounds)context).eContainer(), ctx);
- } else if(context instanceof Interaction) {
- return validateFragmentsOrder((Interaction)context, ctx);
- } else if(context instanceof InteractionOperand) {
- return validateFragmentsOrder((InteractionOperand)context, ctx);
- } else if(context instanceof InteractionFragment) {
- return validateFragmentsOrder(((InteractionFragment)context).getOwner(), ctx);
- } else if(context instanceof Message) {
+ if (context instanceof View) {
+ return validateFragmentsOrder(((View) context).getElement(), ctx);
+ } else if (context instanceof Bounds) {
+ return validateFragmentsOrder(((Bounds) context).eContainer(), ctx);
+ } else if (context instanceof Interaction) {
+ return validateFragmentsOrder((Interaction) context, ctx);
+ } else if (context instanceof InteractionOperand) {
+ return validateFragmentsOrder((InteractionOperand) context, ctx);
+ } else if (context instanceof InteractionFragment) {
+ return validateFragmentsOrder(((InteractionFragment) context).getOwner(), ctx);
+ } else if (context instanceof Message) {
// both events are in the same container, but they may not exist
- MessageEnd sendEvent = ((Message)context).getSendEvent();
+ MessageEnd sendEvent = ((Message) context).getSendEvent();
EObject sendFragmentContainer = sendEvent != null ? sendEvent.eContainer() : null;
- MessageEnd receiveEvent = ((Message)context).getReceiveEvent();
+ MessageEnd receiveEvent = ((Message) context).getReceiveEvent();
EObject receiveFragmentContainer = receiveEvent != null ? receiveEvent.eContainer() : null;
- if(sendFragmentContainer != null) {
+ if (sendFragmentContainer != null) {
return validateFragmentsOrder(sendFragmentContainer, ctx);
- } else if(receiveFragmentContainer != null) {
+ } else if (receiveFragmentContainer != null) {
return validateFragmentsOrder(receiveFragmentContainer, ctx);
}
- } else if(context instanceof Lifeline) {
+ } else if (context instanceof Lifeline) {
// events may have changed of container while lifeline was moving
- return validateFragmentsOrder(((Lifeline)context).getInteraction(), ctx);
+ return validateFragmentsOrder(((Lifeline) context).getInteraction(), ctx);
}
// no implementation for this element
return ctx.createSuccessStatus();
@@ -64,13 +64,13 @@ public class UMLValidationHelper {
/**
* Validate modification and update the interaction's fragments order if necessary.
- *
+ *
* @see org.eclipse.emf.validation.AbstractModelConstraint#validate(org.eclipse.emf.validation.IValidationContext)
- *
+ *
* @param context
- * element on which update is performed
+ * element on which update is performed
* @param ctx
- * validation context
+ * validation context
* @return status
*/
public static IStatus validateFragmentsOrder(Interaction context, IValidationContext ctx) {
@@ -86,13 +86,13 @@ public class UMLValidationHelper {
/**
* Validate modification and update the interaction operand's fragments order if necessary.
- *
+ *
* @see org.eclipse.emf.validation.AbstractModelConstraint#validate(org.eclipse.emf.validation.IValidationContext)
- *
+ *
* @param context
- * element on which update is performed
+ * element on which update is performed
* @param ctx
- * validation context
+ * validation context
* @return status
*/
public static IStatus validateFragmentsOrder(InteractionOperand context, IValidationContext ctx) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/Activator.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/Activator.java
index 01cac1e6396..8c2a1043758 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/Activator.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/Activator.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -38,6 +38,7 @@ public class Activator extends AbstractUIPlugin {
*
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext )
*/
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
@@ -48,6 +49,7 @@ public class Activator extends AbstractUIPlugin {
*
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext )
*/
+ @Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
@@ -55,7 +57,7 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the shared instance
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ActionExecutionSpecificationCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ActionExecutionSpecificationCreateCommand.java
index c5c64281966..6e3d7062210 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ActionExecutionSpecificationCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ActionExecutionSpecificationCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -16,7 +16,6 @@ package org.eclipse.papyrus.uml.diagram.sequence.edit.commands;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
@@ -74,16 +73,16 @@ public class ActionExecutionSpecificationCreateCommand extends EditElementComman
/**
* FIXME: replace with setElementToEdit()
- *
+ *
* @generated
*/
@Override
protected EObject getElementToEdit() {
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
+ EObject container = ((CreateElementRequest) getRequest()).getContainer();
+ if (container instanceof View) {
+ container = ((View) container).getElement();
}
- if(container != null) {
+ if (container != null) {
return container;
}
return eObject;
@@ -101,7 +100,7 @@ public class ActionExecutionSpecificationCreateCommand extends EditElementComman
/**
* To add the lifeline to the attribute covered of the AES
- *
+ *
* @generated
*/
@Override
@@ -109,19 +108,20 @@ public class ActionExecutionSpecificationCreateCommand extends EditElementComman
ActionExecutionSpecification newElement = UMLFactory.eINSTANCE.createActionExecutionSpecification();
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
- if(data.isPermitted()) {
- if(data.isPathDefined()) {
- if(!data.execute(target, newElement))
+ if (data.isPermitted()) {
+ if (data.isPathDefined()) {
+ if (!data.execute(target, newElement)) {
return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ }
} else {
- Interaction qualifiedTarget = (Interaction)target;
+ Interaction qualifiedTarget = (Interaction) target;
qualifiedTarget.getFragments().add(newElement);
}
} else {
return CommandResult.newErrorCommandResult("The active policy restricts the addition of this element");
}
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -129,12 +129,12 @@ public class ActionExecutionSpecificationCreateCommand extends EditElementComman
* @generated
*/
protected void doConfigure(ActionExecutionSpecification newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
+ if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/BehaviorExecutionSpecificationCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/BehaviorExecutionSpecificationCreateCommand.java
index 62d12593c89..dd0fb407d06 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/BehaviorExecutionSpecificationCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/BehaviorExecutionSpecificationCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -16,7 +16,6 @@ package org.eclipse.papyrus.uml.diagram.sequence.edit.commands;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
@@ -74,16 +73,16 @@ public class BehaviorExecutionSpecificationCreateCommand extends EditElementComm
/**
* FIXME: replace with setElementToEdit()
- *
+ *
* @generated
*/
@Override
protected EObject getElementToEdit() {
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
+ EObject container = ((CreateElementRequest) getRequest()).getContainer();
+ if (container instanceof View) {
+ container = ((View) container).getElement();
}
- if(container != null) {
+ if (container != null) {
return container;
}
return eObject;
@@ -101,7 +100,7 @@ public class BehaviorExecutionSpecificationCreateCommand extends EditElementComm
/**
* To add the lifeline to the attribute covered of the AES
- *
+ *
* @generated
*/
@Override
@@ -109,19 +108,20 @@ public class BehaviorExecutionSpecificationCreateCommand extends EditElementComm
BehaviorExecutionSpecification newElement = UMLFactory.eINSTANCE.createBehaviorExecutionSpecification();
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
- if(data.isPermitted()) {
- if(data.isPathDefined()) {
- if(!data.execute(target, newElement))
+ if (data.isPermitted()) {
+ if (data.isPathDefined()) {
+ if (!data.execute(target, newElement)) {
return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ }
} else {
- Interaction qualifiedTarget = (Interaction)target;
+ Interaction qualifiedTarget = (Interaction) target;
qualifiedTarget.getFragments().add(newElement);
}
} else {
return CommandResult.newErrorCommandResult("The active policy restricts the addition of this element");
}
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -129,12 +129,12 @@ public class BehaviorExecutionSpecificationCreateCommand extends EditElementComm
* @generated
*/
protected void doConfigure(BehaviorExecutionSpecification newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
+ if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/CombinedFragment2CreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/CombinedFragment2CreateCommand.java
index 40bde3d8c77..cebfdf38626 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/CombinedFragment2CreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/CombinedFragment2CreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -16,7 +16,6 @@ package org.eclipse.papyrus.uml.diagram.sequence.edit.commands;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
@@ -75,15 +74,16 @@ public class CombinedFragment2CreateCommand extends EditElementCommand {
/**
* FIXME: replace with setElementToEdit()
- *
+ *
* @generated
*/
+ @Override
protected EObject getElementToEdit() {
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
+ EObject container = ((CreateElementRequest) getRequest()).getContainer();
+ if (container instanceof View) {
+ container = ((View) container).getElement();
}
- if(container != null) {
+ if (container != null) {
return container;
}
return eObject;
@@ -92,6 +92,7 @@ public class CombinedFragment2CreateCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
public boolean canExecute() {
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getCombinedFragment());
@@ -102,19 +103,21 @@ public class CombinedFragment2CreateCommand extends EditElementCommand {
* Create a CoRegion :
* - creates two operands
* - set the Interaction Operator to parallel
- *
+ *
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
CombinedFragment newElement = UMLFactory.eINSTANCE.createCombinedFragment();
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
- if(data.isPermitted()) {
- if(data.isPathDefined()) {
- if(!data.execute(target, newElement))
+ if (data.isPermitted()) {
+ if (data.isPathDefined()) {
+ if (!data.execute(target, newElement)) {
return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ }
} else {
- Interaction qualifiedTarget = (Interaction)target;
+ Interaction qualifiedTarget = (Interaction) target;
qualifiedTarget.getFragments().add(newElement);
}
} else {
@@ -122,7 +125,7 @@ public class CombinedFragment2CreateCommand extends EditElementCommand {
}
ElementInitializers.getInstance().init_CombinedFragment_3018(newElement);
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -130,12 +133,12 @@ public class CombinedFragment2CreateCommand extends EditElementCommand {
* @generated
*/
protected void doConfigure(CombinedFragment newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
+ if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/CombinedFragmentCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/CombinedFragmentCreateCommand.java
index 89e0d665e23..3dc84546d08 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/CombinedFragmentCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/CombinedFragmentCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -16,7 +16,6 @@ package org.eclipse.papyrus.uml.diagram.sequence.edit.commands;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
@@ -75,15 +74,16 @@ public class CombinedFragmentCreateCommand extends EditElementCommand {
/**
* FIXME: replace with setElementToEdit()
- *
+ *
* @generated
*/
+ @Override
protected EObject getElementToEdit() {
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
+ EObject container = ((CreateElementRequest) getRequest()).getContainer();
+ if (container instanceof View) {
+ container = ((View) container).getElement();
}
- if(container != null) {
+ if (container != null) {
return container;
}
return eObject;
@@ -91,9 +91,10 @@ public class CombinedFragmentCreateCommand extends EditElementCommand {
/**
* The creation command can only be executed if the elementToEdit (i.e the container) is an Interaction or an InteractionOperand
- *
+ *
* @generated
*/
+ @Override
public boolean canExecute() {
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getCombinedFragment());
@@ -102,20 +103,22 @@ public class CombinedFragmentCreateCommand extends EditElementCommand {
/**
* Handle creation on InteractionOperand
- *
+ *
* @generated
*/
+ @Override
@SuppressWarnings("unchecked")
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
CombinedFragment newElement = UMLFactory.eINSTANCE.createCombinedFragment();
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
- if(data.isPermitted()) {
- if(data.isPathDefined()) {
- if(!data.execute(target, newElement))
+ if (data.isPermitted()) {
+ if (data.isPathDefined()) {
+ if (!data.execute(target, newElement)) {
return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ }
} else {
- Interaction qualifiedTarget = (Interaction)target;
+ Interaction qualifiedTarget = (Interaction) target;
qualifiedTarget.getFragments().add(newElement);
}
} else {
@@ -123,7 +126,7 @@ public class CombinedFragmentCreateCommand extends EditElementCommand {
}
ElementInitializers.getInstance().init_CombinedFragment_3004(newElement);
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -131,12 +134,12 @@ public class CombinedFragmentCreateCommand extends EditElementCommand {
* @generated
*/
protected void doConfigure(CombinedFragment newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
+ if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/CommentAnnotatedElementCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/CommentAnnotatedElementCreateCommand.java
index da675a68f5c..92417727310 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/CommentAnnotatedElementCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/CommentAnnotatedElementCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -51,17 +51,18 @@ public class CommentAnnotatedElementCreateCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
public boolean canExecute() {
- if(source == null && target == null) {
+ if (source == null && target == null) {
return false;
}
- if(source != null && false == source instanceof Comment) {
+ if (source != null && false == source instanceof Comment) {
return false;
}
- if(target != null && false == target instanceof Element) {
+ if (target != null && false == target instanceof Element) {
return false;
}
- if(getSource() == null) {
+ if (getSource() == null) {
return true; // link creation is in progress; source is not defined yet
}
// target may be null here but it's possible to check constraint
@@ -71,11 +72,12 @@ public class CommentAnnotatedElementCreateCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
}
- if(getSource() != null && getTarget() != null) {
+ if (getSource() != null && getTarget() != null) {
getSource().getAnnotatedElements().add(getTarget());
}
return CommandResult.newOKCommandResult();
@@ -84,6 +86,7 @@ public class CommentAnnotatedElementCreateCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
protected void setElementToEdit(EObject element) {
throw new UnsupportedOperationException();
}
@@ -92,13 +95,13 @@ public class CommentAnnotatedElementCreateCommand extends EditElementCommand {
* @generated
*/
protected Comment getSource() {
- return (Comment)source;
+ return (Comment) source;
}
/**
* @generated
*/
protected Element getTarget() {
- return (Element)target;
+ return (Element) target;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/CommentAnnotatedElementReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/CommentAnnotatedElementReorientCommand.java
index d64689f4783..b65b2f15cc0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/CommentAnnotatedElementReorientCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/CommentAnnotatedElementReorientCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -21,6 +21,7 @@ import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
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.emf.type.core.requests.ReorientRequest;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.UMLBaseItemSemanticEditPolicy;
import org.eclipse.uml2.uml.Comment;
import org.eclipse.uml2.uml.Element;
@@ -64,14 +65,15 @@ public class CommentAnnotatedElementReorientCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
public boolean canExecute() {
- if(false == referenceOwner instanceof Comment) {
+ if (false == referenceOwner instanceof Comment) {
return false;
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return canReorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return canReorientTarget();
}
return false;
@@ -81,7 +83,7 @@ public class CommentAnnotatedElementReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientSource() {
- if(!(oldEnd instanceof Element && newEnd instanceof Comment)) {
+ if (!(oldEnd instanceof Element && newEnd instanceof Comment)) {
return false;
}
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistCommentAnnotatedElement_4010(getNewSource(), getOldTarget());
@@ -91,7 +93,7 @@ public class CommentAnnotatedElementReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientTarget() {
- if(!(oldEnd instanceof Element && newEnd instanceof Element)) {
+ if (!(oldEnd instanceof Element && newEnd instanceof Element)) {
return false;
}
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistCommentAnnotatedElement_4010(getOldSource(), getNewTarget());
@@ -100,14 +102,15 @@ public class CommentAnnotatedElementReorientCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return reorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return reorientTarget();
}
throw new IllegalStateException();
@@ -135,27 +138,27 @@ public class CommentAnnotatedElementReorientCommand extends EditElementCommand {
* @generated
*/
protected Comment getOldSource() {
- return (Comment)referenceOwner;
+ return (Comment) referenceOwner;
}
/**
* @generated
*/
protected Comment getNewSource() {
- return (Comment)newEnd;
+ return (Comment) newEnd;
}
/**
* @generated
*/
protected Element getOldTarget() {
- return (Element)oldEnd;
+ return (Element) oldEnd;
}
/**
* @generated
*/
protected Element getNewTarget() {
- return (Element)newEnd;
+ return (Element) newEnd;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/CommentCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/CommentCreateCommand.java
index 0a283d990ff..d0b7feb4e67 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/CommentCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/CommentCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -16,7 +16,6 @@ package org.eclipse.papyrus.uml.diagram.sequence.edit.commands;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
@@ -75,15 +74,16 @@ public class CommentCreateCommand extends EditElementCommand {
/**
* FIXME: replace with setElementToEdit()
- *
+ *
* @generated
*/
+ @Override
protected EObject getElementToEdit() {
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
+ EObject container = ((CreateElementRequest) getRequest()).getContainer();
+ if (container instanceof View) {
+ container = ((View) container).getElement();
}
- if(container != null) {
+ if (container != null) {
return container;
}
return eObject;
@@ -92,6 +92,7 @@ public class CommentCreateCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
public boolean canExecute() {
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getComment());
@@ -101,16 +102,18 @@ public class CommentCreateCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
Comment newElement = UMLFactory.eINSTANCE.createComment();
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
- if(data.isPermitted()) {
- if(data.isPathDefined()) {
- if(!data.execute(target, newElement))
+ if (data.isPermitted()) {
+ if (data.isPathDefined()) {
+ if (!data.execute(target, newElement)) {
return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ }
} else {
- Element qualifiedTarget = (Element)target;
+ Element qualifiedTarget = (Element) target;
qualifiedTarget.getOwnedComments().add(newElement);
}
} else {
@@ -118,7 +121,7 @@ public class CommentCreateCommand extends EditElementCommand {
}
ElementInitializers.getInstance().init_Comment_3009(newElement);
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -126,12 +129,12 @@ public class CommentCreateCommand extends EditElementCommand {
* @generated
*/
protected void doConfigure(Comment newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
+ if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ConsiderIgnoreFragmentCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ConsiderIgnoreFragmentCreateCommand.java
index 6bc342886bb..096f06d9b3f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ConsiderIgnoreFragmentCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ConsiderIgnoreFragmentCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -16,7 +16,6 @@ package org.eclipse.papyrus.uml.diagram.sequence.edit.commands;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
@@ -75,15 +74,16 @@ public class ConsiderIgnoreFragmentCreateCommand extends EditElementCommand {
/**
* FIXME: replace with setElementToEdit()
- *
+ *
* @generated
*/
+ @Override
protected EObject getElementToEdit() {
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
+ EObject container = ((CreateElementRequest) getRequest()).getContainer();
+ if (container instanceof View) {
+ container = ((View) container).getElement();
}
- if(container != null) {
+ if (container != null) {
return container;
}
return eObject;
@@ -91,9 +91,10 @@ public class ConsiderIgnoreFragmentCreateCommand extends EditElementCommand {
/**
* The creation command can only be executed if the elementToEdit (i.e the container) is an Interaction or an InteractionOperand
- *
+ *
* @generated
*/
+ @Override
public boolean canExecute() {
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getConsiderIgnoreFragment());
@@ -102,20 +103,22 @@ public class ConsiderIgnoreFragmentCreateCommand extends EditElementCommand {
/**
* Handle creation on InteractionOperand
- *
+ *
* @generated
*/
+ @Override
@SuppressWarnings("unchecked")
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
ConsiderIgnoreFragment newElement = UMLFactory.eINSTANCE.createConsiderIgnoreFragment();
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
- if(data.isPermitted()) {
- if(data.isPathDefined()) {
- if(!data.execute(target, newElement))
+ if (data.isPermitted()) {
+ if (data.isPathDefined()) {
+ if (!data.execute(target, newElement)) {
return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ }
} else {
- Interaction qualifiedTarget = (Interaction)target;
+ Interaction qualifiedTarget = (Interaction) target;
qualifiedTarget.getFragments().add(newElement);
}
} else {
@@ -123,7 +126,7 @@ public class ConsiderIgnoreFragmentCreateCommand extends EditElementCommand {
}
ElementInitializers.getInstance().init_ConsiderIgnoreFragment_3007(newElement);
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -131,12 +134,12 @@ public class ConsiderIgnoreFragmentCreateCommand extends EditElementCommand {
* @generated
*/
protected void doConfigure(ConsiderIgnoreFragment newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
+ if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ConstraintConstrainedElementCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ConstraintConstrainedElementCreateCommand.java
index b0d5d6cf10a..892519c5460 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ConstraintConstrainedElementCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ConstraintConstrainedElementCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -51,17 +51,18 @@ public class ConstraintConstrainedElementCreateCommand extends EditElementComman
/**
* @generated
*/
+ @Override
public boolean canExecute() {
- if(source == null && target == null) {
+ if (source == null && target == null) {
return false;
}
- if(source != null && false == source instanceof Constraint) {
+ if (source != null && false == source instanceof Constraint) {
return false;
}
- if(target != null && false == target instanceof Element) {
+ if (target != null && false == target instanceof Element) {
return false;
}
- if(getSource() == null) {
+ if (getSource() == null) {
return true; // link creation is in progress; source is not defined yet
}
// target may be null here but it's possible to check constraint
@@ -71,11 +72,12 @@ public class ConstraintConstrainedElementCreateCommand extends EditElementComman
/**
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
}
- if(getSource() != null && getTarget() != null) {
+ if (getSource() != null && getTarget() != null) {
getSource().getConstrainedElements().add(getTarget());
}
return CommandResult.newOKCommandResult();
@@ -84,6 +86,7 @@ public class ConstraintConstrainedElementCreateCommand extends EditElementComman
/**
* @generated
*/
+ @Override
protected void setElementToEdit(EObject element) {
throw new UnsupportedOperationException();
}
@@ -92,13 +95,13 @@ public class ConstraintConstrainedElementCreateCommand extends EditElementComman
* @generated
*/
protected Constraint getSource() {
- return (Constraint)source;
+ return (Constraint) source;
}
/**
* @generated
*/
protected Element getTarget() {
- return (Element)target;
+ return (Element) target;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ConstraintConstrainedElementReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ConstraintConstrainedElementReorientCommand.java
index 55252c71e2e..d9412526bd4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ConstraintConstrainedElementReorientCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ConstraintConstrainedElementReorientCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -21,6 +21,7 @@ import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
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.emf.type.core.requests.ReorientRequest;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.UMLBaseItemSemanticEditPolicy;
import org.eclipse.uml2.uml.Constraint;
import org.eclipse.uml2.uml.Element;
@@ -64,14 +65,15 @@ public class ConstraintConstrainedElementReorientCommand extends EditElementComm
/**
* @generated
*/
+ @Override
public boolean canExecute() {
- if(false == referenceOwner instanceof Constraint) {
+ if (false == referenceOwner instanceof Constraint) {
return false;
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return canReorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return canReorientTarget();
}
return false;
@@ -81,7 +83,7 @@ public class ConstraintConstrainedElementReorientCommand extends EditElementComm
* @generated
*/
protected boolean canReorientSource() {
- if(!(oldEnd instanceof Element && newEnd instanceof Constraint)) {
+ if (!(oldEnd instanceof Element && newEnd instanceof Constraint)) {
return false;
}
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistConstraintConstrainedElement_4011(getNewSource(), getOldTarget());
@@ -91,7 +93,7 @@ public class ConstraintConstrainedElementReorientCommand extends EditElementComm
* @generated
*/
protected boolean canReorientTarget() {
- if(!(oldEnd instanceof Element && newEnd instanceof Element)) {
+ if (!(oldEnd instanceof Element && newEnd instanceof Element)) {
return false;
}
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistConstraintConstrainedElement_4011(getOldSource(), getNewTarget());
@@ -100,14 +102,15 @@ public class ConstraintConstrainedElementReorientCommand extends EditElementComm
/**
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return reorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return reorientTarget();
}
throw new IllegalStateException();
@@ -135,27 +138,27 @@ public class ConstraintConstrainedElementReorientCommand extends EditElementComm
* @generated
*/
protected Constraint getOldSource() {
- return (Constraint)referenceOwner;
+ return (Constraint) referenceOwner;
}
/**
* @generated
*/
protected Constraint getNewSource() {
- return (Constraint)newEnd;
+ return (Constraint) newEnd;
}
/**
* @generated
*/
protected Element getOldTarget() {
- return (Element)oldEnd;
+ return (Element) oldEnd;
}
/**
* @generated
*/
protected Element getNewTarget() {
- return (Element)newEnd;
+ return (Element) newEnd;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ConstraintCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ConstraintCreateCommand.java
index 19314dc2af7..054077bcdfa 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ConstraintCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ConstraintCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -16,7 +16,6 @@ package org.eclipse.papyrus.uml.diagram.sequence.edit.commands;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
@@ -75,15 +74,16 @@ public class ConstraintCreateCommand extends EditElementCommand {
/**
* FIXME: replace with setElementToEdit()
- *
+ *
* @generated
*/
+ @Override
protected EObject getElementToEdit() {
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
+ EObject container = ((CreateElementRequest) getRequest()).getContainer();
+ if (container instanceof View) {
+ container = ((View) container).getElement();
}
- if(container != null) {
+ if (container != null) {
return container;
}
return eObject;
@@ -92,6 +92,7 @@ public class ConstraintCreateCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
public boolean canExecute() {
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getConstraint());
@@ -101,16 +102,18 @@ public class ConstraintCreateCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
Constraint newElement = UMLFactory.eINSTANCE.createConstraint();
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
- if(data.isPermitted()) {
- if(data.isPathDefined()) {
- if(!data.execute(target, newElement))
+ if (data.isPermitted()) {
+ if (data.isPathDefined()) {
+ if (!data.execute(target, newElement)) {
return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ }
} else {
- Namespace qualifiedTarget = (Namespace)target;
+ Namespace qualifiedTarget = (Namespace) target;
qualifiedTarget.getOwnedRules().add(newElement);
}
} else {
@@ -118,7 +121,7 @@ public class ConstraintCreateCommand extends EditElementCommand {
}
ElementInitializers.getInstance().init_Constraint_3008(newElement);
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -126,12 +129,12 @@ public class ConstraintCreateCommand extends EditElementCommand {
* @generated
*/
protected void doConfigure(Constraint newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
+ if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ContextLinkCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ContextLinkCreateCommand.java
index 719b0e1e68c..95c15dce05c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ContextLinkCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ContextLinkCreateCommand.java
@@ -38,17 +38,18 @@ public class ContextLinkCreateCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
public boolean canExecute() {
- if(source == null && target == null) {
+ if (source == null && target == null) {
return false;
}
- if(source != null && false == source instanceof Constraint) {
+ if (source != null && false == source instanceof Constraint) {
return false;
}
- if(target != null && false == target instanceof Namespace) {
+ if (target != null && false == target instanceof Namespace) {
return false;
}
- if(getSource() == null) {
+ if (getSource() == null) {
return true; // link creation is in progress; source is not defined yet
}
// target may be null here but it's possible to check constraint
@@ -58,11 +59,12 @@ public class ContextLinkCreateCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
}
- if(getSource() != null && getTarget() != null) {
+ if (getSource() != null && getTarget() != null) {
getSource().setContext(getTarget());
}
return CommandResult.newOKCommandResult();
@@ -71,6 +73,7 @@ public class ContextLinkCreateCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
protected void setElementToEdit(EObject element) {
throw new UnsupportedOperationException();
}
@@ -79,13 +82,13 @@ public class ContextLinkCreateCommand extends EditElementCommand {
* @generated
*/
protected Constraint getSource() {
- return (Constraint)source;
+ return (Constraint) source;
}
/**
* @generated
*/
protected Namespace getTarget() {
- return (Namespace)target;
+ return (Namespace) target;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ContextLinkReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ContextLinkReorientCommand.java
index deb9423e0b5..f8ac5a31f02 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ContextLinkReorientCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ContextLinkReorientCommand.java
@@ -8,6 +8,7 @@ import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
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.emf.type.core.requests.ReorientRequest;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.UMLBaseItemSemanticEditPolicy;
import org.eclipse.uml2.uml.Constraint;
import org.eclipse.uml2.uml.Namespace;
@@ -51,14 +52,15 @@ public class ContextLinkReorientCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
public boolean canExecute() {
- if(false == referenceOwner instanceof Constraint) {
+ if (false == referenceOwner instanceof Constraint) {
return false;
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return canReorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return canReorientTarget();
}
return false;
@@ -68,7 +70,7 @@ public class ContextLinkReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientSource() {
- if(!(oldEnd instanceof Namespace && newEnd instanceof Constraint)) {
+ if (!(oldEnd instanceof Namespace && newEnd instanceof Constraint)) {
return false;
}
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistConstraintContext_8500(getNewSource(), getOldTarget());
@@ -78,7 +80,7 @@ public class ContextLinkReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientTarget() {
- if(!(oldEnd instanceof Namespace && newEnd instanceof Namespace)) {
+ if (!(oldEnd instanceof Namespace && newEnd instanceof Namespace)) {
return false;
}
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistConstraintContext_8500(getOldSource(), getNewTarget());
@@ -87,14 +89,15 @@ public class ContextLinkReorientCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return reorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return reorientTarget();
}
throw new IllegalStateException();
@@ -121,27 +124,27 @@ public class ContextLinkReorientCommand extends EditElementCommand {
* @generated
*/
protected Constraint getOldSource() {
- return (Constraint)referenceOwner;
+ return (Constraint) referenceOwner;
}
/**
* @generated
*/
protected Constraint getNewSource() {
- return (Constraint)newEnd;
+ return (Constraint) newEnd;
}
/**
* @generated
*/
protected Namespace getOldTarget() {
- return (Namespace)oldEnd;
+ return (Namespace) oldEnd;
}
/**
* @generated
*/
protected Namespace getNewTarget() {
- return (Namespace)newEnd;
+ return (Namespace) newEnd;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ContinuationCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ContinuationCreateCommand.java
index 58052e7ed05..986792db742 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ContinuationCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ContinuationCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -16,7 +16,6 @@ package org.eclipse.papyrus.uml.diagram.sequence.edit.commands;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
@@ -75,15 +74,16 @@ public class ContinuationCreateCommand extends EditElementCommand {
/**
* FIXME: replace with setElementToEdit()
- *
+ *
* @generated
*/
+ @Override
protected EObject getElementToEdit() {
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
+ EObject container = ((CreateElementRequest) getRequest()).getContainer();
+ if (container instanceof View) {
+ container = ((View) container).getElement();
}
- if(container != null) {
+ if (container != null) {
return container;
}
return eObject;
@@ -92,6 +92,7 @@ public class ContinuationCreateCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
public boolean canExecute() {
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getContinuation());
@@ -100,19 +101,21 @@ public class ContinuationCreateCommand extends EditElementCommand {
/**
* Generated not to handle the constraint on covered lifelines.
- *
+ *
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
Continuation newElement = UMLFactory.eINSTANCE.createContinuation();
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
- if(data.isPermitted()) {
- if(data.isPathDefined()) {
- if(!data.execute(target, newElement))
+ if (data.isPermitted()) {
+ if (data.isPathDefined()) {
+ if (!data.execute(target, newElement)) {
return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ }
} else {
- InteractionOperand qualifiedTarget = (InteractionOperand)target;
+ InteractionOperand qualifiedTarget = (InteractionOperand) target;
qualifiedTarget.getFragments().add(newElement);
}
} else {
@@ -120,7 +123,7 @@ public class ContinuationCreateCommand extends EditElementCommand {
}
ElementInitializers.getInstance().init_Continuation_3016(newElement);
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -128,12 +131,12 @@ public class ContinuationCreateCommand extends EditElementCommand {
* @generated
*/
protected void doConfigure(Continuation newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
+ if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/DestructionOccurrenceSpecificationCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/DestructionOccurrenceSpecificationCreateCommand.java
index 86f3dd6385b..5190c7e9473 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/DestructionOccurrenceSpecificationCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/DestructionOccurrenceSpecificationCreateCommand.java
@@ -3,7 +3,6 @@ package org.eclipse.papyrus.uml.diagram.sequence.edit.commands;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
@@ -62,15 +61,16 @@ public class DestructionOccurrenceSpecificationCreateCommand extends EditElement
/**
* FIXME: replace with setElementToEdit()
- *
+ *
* @generated
*/
+ @Override
protected EObject getElementToEdit() {
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
+ EObject container = ((CreateElementRequest) getRequest()).getContainer();
+ if (container instanceof View) {
+ container = ((View) container).getElement();
}
- if(container != null) {
+ if (container != null) {
return container;
}
return eObject;
@@ -78,9 +78,10 @@ public class DestructionOccurrenceSpecificationCreateCommand extends EditElement
/**
* A DestructionEvent on a lifeline can only be created if it doesn't exist yet a destructionEvent on that lifeline.
- *
+ *
* @generated
*/
+ @Override
public boolean canExecute() {
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getDestructionOccurrenceSpecification());
@@ -90,16 +91,18 @@ public class DestructionOccurrenceSpecificationCreateCommand extends EditElement
/**
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
DestructionOccurrenceSpecification newElement = UMLFactory.eINSTANCE.createDestructionOccurrenceSpecification();
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
- if(data.isPermitted()) {
- if(data.isPathDefined()) {
- if(!data.execute(target, newElement))
+ if (data.isPermitted()) {
+ if (data.isPathDefined()) {
+ if (!data.execute(target, newElement)) {
return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ }
} else {
- Interaction qualifiedTarget = (Interaction)target;
+ Interaction qualifiedTarget = (Interaction) target;
qualifiedTarget.getFragments().add(newElement);
}
} else {
@@ -107,7 +110,7 @@ public class DestructionOccurrenceSpecificationCreateCommand extends EditElement
}
ElementInitializers.getInstance().init_DestructionOccurrenceSpecification_3022(newElement);
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -115,12 +118,12 @@ public class DestructionOccurrenceSpecificationCreateCommand extends EditElement
* @generated
*/
protected void doConfigure(DestructionOccurrenceSpecification newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
+ if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/DurationConstraintCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/DurationConstraintCreateCommand.java
index e6fa027b189..b7920cef3c3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/DurationConstraintCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/DurationConstraintCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -16,7 +16,6 @@ package org.eclipse.papyrus.uml.diagram.sequence.edit.commands;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
@@ -75,15 +74,16 @@ public class DurationConstraintCreateCommand extends EditElementCommand {
/**
* FIXME: replace with setElementToEdit()
- *
+ *
* @generated
*/
+ @Override
protected EObject getElementToEdit() {
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
+ EObject container = ((CreateElementRequest) getRequest()).getContainer();
+ if (container instanceof View) {
+ container = ((View) container).getElement();
}
- if(container != null) {
+ if (container != null) {
return container;
}
return eObject;
@@ -92,6 +92,7 @@ public class DurationConstraintCreateCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
public boolean canExecute() {
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getDurationConstraint());
@@ -101,16 +102,18 @@ public class DurationConstraintCreateCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
DurationConstraint newElement = UMLFactory.eINSTANCE.createDurationConstraint();
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
- if(data.isPermitted()) {
- if(data.isPathDefined()) {
- if(!data.execute(target, newElement))
+ if (data.isPermitted()) {
+ if (data.isPathDefined()) {
+ if (!data.execute(target, newElement)) {
return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ }
} else {
- Namespace qualifiedTarget = (Namespace)target;
+ Namespace qualifiedTarget = (Namespace) target;
qualifiedTarget.getOwnedRules().add(newElement);
}
} else {
@@ -118,7 +121,7 @@ public class DurationConstraintCreateCommand extends EditElementCommand {
}
ElementInitializers.getInstance().init_DurationConstraint_3021(newElement);
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -126,12 +129,12 @@ public class DurationConstraintCreateCommand extends EditElementCommand {
* @generated
*/
protected void doConfigure(DurationConstraint newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
+ if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/DurationConstraintInMessageCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/DurationConstraintInMessageCreateCommand.java
index 49b831c4d55..b56c9d46577 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/DurationConstraintInMessageCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/DurationConstraintInMessageCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -16,7 +16,6 @@ package org.eclipse.papyrus.uml.diagram.sequence.edit.commands;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
@@ -75,15 +74,16 @@ public class DurationConstraintInMessageCreateCommand extends EditElementCommand
/**
* FIXME: replace with setElementToEdit()
- *
+ *
* @generated
*/
+ @Override
protected EObject getElementToEdit() {
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
+ EObject container = ((CreateElementRequest) getRequest()).getContainer();
+ if (container instanceof View) {
+ container = ((View) container).getElement();
}
- if(container != null) {
+ if (container != null) {
return container;
}
return eObject;
@@ -92,6 +92,7 @@ public class DurationConstraintInMessageCreateCommand extends EditElementCommand
/**
* @generated
*/
+ @Override
public boolean canExecute() {
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getDurationConstraint());
@@ -101,16 +102,18 @@ public class DurationConstraintInMessageCreateCommand extends EditElementCommand
/**
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
DurationConstraint newElement = UMLFactory.eINSTANCE.createDurationConstraint();
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
- if(data.isPermitted()) {
- if(data.isPathDefined()) {
- if(!data.execute(target, newElement))
+ if (data.isPermitted()) {
+ if (data.isPathDefined()) {
+ if (!data.execute(target, newElement)) {
return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ }
} else {
- Namespace qualifiedTarget = (Namespace)target;
+ Namespace qualifiedTarget = (Namespace) target;
qualifiedTarget.getOwnedRules().add(newElement);
}
} else {
@@ -118,7 +121,7 @@ public class DurationConstraintInMessageCreateCommand extends EditElementCommand
}
ElementInitializers.getInstance().init_DurationConstraint_3023(newElement);
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -126,12 +129,12 @@ public class DurationConstraintInMessageCreateCommand extends EditElementCommand
* @generated
*/
protected void doConfigure(DurationConstraint newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
+ if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/DurationObservationCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/DurationObservationCreateCommand.java
index b0b4c95e7d4..387d1ced01f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/DurationObservationCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/DurationObservationCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -16,7 +16,6 @@ package org.eclipse.papyrus.uml.diagram.sequence.edit.commands;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
@@ -75,15 +74,16 @@ public class DurationObservationCreateCommand extends EditElementCommand {
/**
* FIXME: replace with setElementToEdit()
- *
+ *
* @generated
*/
+ @Override
protected EObject getElementToEdit() {
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
+ EObject container = ((CreateElementRequest) getRequest()).getContainer();
+ if (container instanceof View) {
+ container = ((View) container).getElement();
}
- if(container != null) {
+ if (container != null) {
return container;
}
return eObject;
@@ -92,6 +92,7 @@ public class DurationObservationCreateCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
public boolean canExecute() {
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getDurationObservation());
@@ -101,16 +102,18 @@ public class DurationObservationCreateCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
DurationObservation newElement = UMLFactory.eINSTANCE.createDurationObservation();
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
- if(data.isPermitted()) {
- if(data.isPathDefined()) {
- if(!data.execute(target, newElement))
+ if (data.isPermitted()) {
+ if (data.isPathDefined()) {
+ if (!data.execute(target, newElement)) {
return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ }
} else {
- Package qualifiedTarget = (Package)target;
+ Package qualifiedTarget = (Package) target;
qualifiedTarget.getPackagedElements().add(newElement);
}
} else {
@@ -118,7 +121,7 @@ public class DurationObservationCreateCommand extends EditElementCommand {
}
ElementInitializers.getInstance().init_DurationObservation_3024(newElement);
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -126,12 +129,12 @@ public class DurationObservationCreateCommand extends EditElementCommand {
* @generated
*/
protected void doConfigure(DurationObservation newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
+ if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/GeneralOrderingCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/GeneralOrderingCreateCommand.java
index 136ec566576..9f4190c95fb 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/GeneralOrderingCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/GeneralOrderingCreateCommand.java
@@ -40,7 +40,7 @@ public class GeneralOrderingCreateCommand extends EditElementCommand {
/**
* Non generated, completely redefined to find correct ends and correct container
- *
+ *
* @generated
*/
public GeneralOrderingCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
@@ -53,21 +53,22 @@ public class GeneralOrderingCreateCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
public boolean canExecute() {
- if(source == null && target == null) {
+ if (source == null && target == null) {
return false;
}
- if(source != null && false == source instanceof OccurrenceSpecification) {
+ if (source != null && false == source instanceof OccurrenceSpecification) {
return false;
}
- if(target != null && false == target instanceof OccurrenceSpecification) {
+ if (target != null && false == target instanceof OccurrenceSpecification) {
return false;
}
- if(getSource() == null) {
+ if (getSource() == null) {
return true; // link creation is in progress; source is not defined yet
}
// target may be null here but it's possible to check constraint
- if(getContainer() == null) {
+ if (getContainer() == null) {
return false;
}
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateGeneralOrdering_4012(getContainer(), getSource(), getTarget());
@@ -76,8 +77,9 @@ public class GeneralOrderingCreateCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
}
GeneralOrdering newElement = UMLFactory.eINSTANCE.createGeneralOrdering();
@@ -86,7 +88,7 @@ public class GeneralOrderingCreateCommand extends EditElementCommand {
newElement.setAfter(getTarget());
ElementInitializers.getInstance().init_GeneralOrdering_4012(newElement);
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -94,14 +96,14 @@ public class GeneralOrderingCreateCommand extends EditElementCommand {
* @generated
*/
protected void doConfigure(GeneralOrdering newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
configureRequest.setParameter(CreateRelationshipRequest.SOURCE, getSource());
configureRequest.setParameter(CreateRelationshipRequest.TARGET, getTarget());
ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
+ if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
@@ -109,6 +111,7 @@ public class GeneralOrderingCreateCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
protected void setElementToEdit(EObject element) {
throw new UnsupportedOperationException();
}
@@ -117,14 +120,14 @@ public class GeneralOrderingCreateCommand extends EditElementCommand {
* @generated
*/
protected OccurrenceSpecification getSource() {
- return (OccurrenceSpecification)source;
+ return (OccurrenceSpecification) source;
}
/**
* @generated
*/
protected OccurrenceSpecification getTarget() {
- return (OccurrenceSpecification)target;
+ return (OccurrenceSpecification) target;
}
/**
@@ -137,16 +140,16 @@ public class GeneralOrderingCreateCommand extends EditElementCommand {
/**
* Default approach is to traverse ancestors of the source to find instance of container.
* Modify with appropriate logic.
- *
+ *
* @generated
*/
protected InteractionFragment deduceContainer(EObject source, EObject target) {
// Find container element for the new link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null; element = element.eContainer()) {
- if(element instanceof InteractionFragment) {
- return (InteractionFragment)element;
+ for (EObject element = source; element != null; element = element.eContainer()) {
+ if (element instanceof InteractionFragment) {
+ return (InteractionFragment) element;
}
}
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/GeneralOrderingReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/GeneralOrderingReorientCommand.java
index 2fad8bf5376..1d13b0e07a9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/GeneralOrderingReorientCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/GeneralOrderingReorientCommand.java
@@ -7,6 +7,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.UMLBaseItemSemanticEditPolicy;
import org.eclipse.uml2.uml.GeneralOrdering;
import org.eclipse.uml2.uml.InteractionFragment;
@@ -45,14 +46,15 @@ public class GeneralOrderingReorientCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
public boolean canExecute() {
- if(false == getElementToEdit() instanceof GeneralOrdering) {
+ if (false == getElementToEdit() instanceof GeneralOrdering) {
return false;
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return canReorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return canReorientTarget();
}
return false;
@@ -62,14 +64,14 @@ public class GeneralOrderingReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientSource() {
- if(!(oldEnd instanceof OccurrenceSpecification && newEnd instanceof OccurrenceSpecification)) {
+ if (!(oldEnd instanceof OccurrenceSpecification && newEnd instanceof OccurrenceSpecification)) {
return false;
}
OccurrenceSpecification target = getLink().getAfter();
- if(!(getLink().eContainer() instanceof InteractionFragment)) {
+ if (!(getLink().eContainer() instanceof InteractionFragment)) {
return false;
}
- InteractionFragment container = (InteractionFragment)getLink().eContainer();
+ InteractionFragment container = (InteractionFragment) getLink().eContainer();
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistGeneralOrdering_4012(container, getLink(), getNewSource(), target);
}
@@ -77,28 +79,29 @@ public class GeneralOrderingReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientTarget() {
- if(!(oldEnd instanceof OccurrenceSpecification && newEnd instanceof OccurrenceSpecification)) {
+ if (!(oldEnd instanceof OccurrenceSpecification && newEnd instanceof OccurrenceSpecification)) {
return false;
}
OccurrenceSpecification source = getLink().getBefore();
- if(!(getLink().eContainer() instanceof InteractionFragment)) {
+ if (!(getLink().eContainer() instanceof InteractionFragment)) {
return false;
}
- InteractionFragment container = (InteractionFragment)getLink().eContainer();
+ InteractionFragment container = (InteractionFragment) getLink().eContainer();
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistGeneralOrdering_4012(container, getLink(), source, getNewTarget());
}
/**
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return reorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return reorientTarget();
}
throw new IllegalStateException();
@@ -124,34 +127,34 @@ public class GeneralOrderingReorientCommand extends EditElementCommand {
* @generated
*/
protected GeneralOrdering getLink() {
- return (GeneralOrdering)getElementToEdit();
+ return (GeneralOrdering) getElementToEdit();
}
/**
* @generated
*/
protected OccurrenceSpecification getOldSource() {
- return (OccurrenceSpecification)oldEnd;
+ return (OccurrenceSpecification) oldEnd;
}
/**
* @generated
*/
protected OccurrenceSpecification getNewSource() {
- return (OccurrenceSpecification)newEnd;
+ return (OccurrenceSpecification) newEnd;
}
/**
* @generated
*/
protected OccurrenceSpecification getOldTarget() {
- return (OccurrenceSpecification)oldEnd;
+ return (OccurrenceSpecification) oldEnd;
}
/**
* @generated
*/
protected OccurrenceSpecification getNewTarget() {
- return (OccurrenceSpecification)newEnd;
+ return (OccurrenceSpecification) newEnd;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/InteractionCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/InteractionCreateCommand.java
index b72ab7a1611..b8054cb96a5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/InteractionCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/InteractionCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -16,7 +16,6 @@ package org.eclipse.papyrus.uml.diagram.sequence.edit.commands;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
@@ -75,15 +74,16 @@ public class InteractionCreateCommand extends EditElementCommand {
/**
* FIXME: replace with setElementToEdit()
- *
+ *
* @generated
*/
+ @Override
protected EObject getElementToEdit() {
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
+ EObject container = ((CreateElementRequest) getRequest()).getContainer();
+ if (container instanceof View) {
+ container = ((View) container).getElement();
}
- if(container != null) {
+ if (container != null) {
return container;
}
return eObject;
@@ -92,6 +92,7 @@ public class InteractionCreateCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
public boolean canExecute() {
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getInteraction());
@@ -101,16 +102,18 @@ public class InteractionCreateCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
Interaction newElement = UMLFactory.eINSTANCE.createInteraction();
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
- if(data.isPermitted()) {
- if(data.isPathDefined()) {
- if(!data.execute(target, newElement))
+ if (data.isPermitted()) {
+ if (data.isPathDefined()) {
+ if (!data.execute(target, newElement)) {
return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ }
} else {
- Package qualifiedTarget = (Package)target;
+ Package qualifiedTarget = (Package) target;
qualifiedTarget.getPackagedElements().add(newElement);
}
} else {
@@ -118,7 +121,7 @@ public class InteractionCreateCommand extends EditElementCommand {
}
ElementInitializers.getInstance().init_Interaction_2001(newElement);
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -126,12 +129,12 @@ public class InteractionCreateCommand extends EditElementCommand {
* @generated
*/
protected void doConfigure(Interaction newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
+ if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/InteractionOperandCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/InteractionOperandCreateCommand.java
index ecf8d1819c2..1d89779f94e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/InteractionOperandCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/InteractionOperandCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -16,7 +16,6 @@ package org.eclipse.papyrus.uml.diagram.sequence.edit.commands;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
@@ -74,15 +73,16 @@ public class InteractionOperandCreateCommand extends EditElementCommand {
/**
* FIXME: replace with setElementToEdit()
- *
+ *
* @generated
*/
+ @Override
protected EObject getElementToEdit() {
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
+ EObject container = ((CreateElementRequest) getRequest()).getContainer();
+ if (container instanceof View) {
+ container = ((View) container).getElement();
}
- if(container != null) {
+ if (container != null) {
return container;
}
return eObject;
@@ -91,6 +91,7 @@ public class InteractionOperandCreateCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
public boolean canExecute() {
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getInteractionOperand());
@@ -99,27 +100,29 @@ public class InteractionOperandCreateCommand extends EditElementCommand {
/**
* Generated not for add combined fragment's covered lifelines on interaction operand
- *
+ *
* @generated
*/
+ @Override
@SuppressWarnings({ "unchecked" })
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
InteractionOperand newElement = UMLFactory.eINSTANCE.createInteractionOperand();
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
- if(data.isPermitted()) {
- if(data.isPathDefined()) {
- if(!data.execute(target, newElement))
+ if (data.isPermitted()) {
+ if (data.isPathDefined()) {
+ if (!data.execute(target, newElement)) {
return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ }
} else {
- CombinedFragment qualifiedTarget = (CombinedFragment)target;
+ CombinedFragment qualifiedTarget = (CombinedFragment) target;
qualifiedTarget.getOperands().add(newElement);
}
} else {
return CommandResult.newErrorCommandResult("The active policy restricts the addition of this element");
}
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -127,12 +130,12 @@ public class InteractionOperandCreateCommand extends EditElementCommand {
* @generated
*/
protected void doConfigure(InteractionOperand newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
+ if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/InteractionUseCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/InteractionUseCreateCommand.java
index 5227bb793f8..00f8dc9735d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/InteractionUseCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/InteractionUseCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -16,7 +16,6 @@ package org.eclipse.papyrus.uml.diagram.sequence.edit.commands;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
@@ -75,15 +74,16 @@ public class InteractionUseCreateCommand extends EditElementCommand {
/**
* FIXME: replace with setElementToEdit()
- *
+ *
* @generated
*/
+ @Override
protected EObject getElementToEdit() {
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
+ EObject container = ((CreateElementRequest) getRequest()).getContainer();
+ if (container instanceof View) {
+ container = ((View) container).getElement();
}
- if(container != null) {
+ if (container != null) {
return container;
}
return eObject;
@@ -91,9 +91,10 @@ public class InteractionUseCreateCommand extends EditElementCommand {
/**
* The creation command can only be executed if the elementToEdit (i.e the container) is an Interaction or an InteractionOperand
- *
+ *
* @generated
*/
+ @Override
public boolean canExecute() {
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getInteractionUse());
@@ -102,19 +103,21 @@ public class InteractionUseCreateCommand extends EditElementCommand {
/**
* Handle creation on InteractionOperand
- *
+ *
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
InteractionUse newElement = UMLFactory.eINSTANCE.createInteractionUse();
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
- if(data.isPermitted()) {
- if(data.isPathDefined()) {
- if(!data.execute(target, newElement))
+ if (data.isPermitted()) {
+ if (data.isPathDefined()) {
+ if (!data.execute(target, newElement)) {
return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ }
} else {
- Interaction qualifiedTarget = (Interaction)target;
+ Interaction qualifiedTarget = (Interaction) target;
qualifiedTarget.getFragments().add(newElement);
}
} else {
@@ -122,7 +125,7 @@ public class InteractionUseCreateCommand extends EditElementCommand {
}
ElementInitializers.getInstance().init_InteractionUse_3002(newElement);
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -130,12 +133,12 @@ public class InteractionUseCreateCommand extends EditElementCommand {
* @generated
*/
protected void doConfigure(InteractionUse newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
+ if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/LifelineCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/LifelineCreateCommand.java
index 17a81a96219..793560704ab 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/LifelineCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/LifelineCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -16,7 +16,6 @@ package org.eclipse.papyrus.uml.diagram.sequence.edit.commands;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
@@ -75,15 +74,16 @@ public class LifelineCreateCommand extends EditElementCommand {
/**
* FIXME: replace with setElementToEdit()
- *
+ *
* @generated
*/
+ @Override
protected EObject getElementToEdit() {
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
+ EObject container = ((CreateElementRequest) getRequest()).getContainer();
+ if (container instanceof View) {
+ container = ((View) container).getElement();
}
- if(container != null) {
+ if (container != null) {
return container;
}
return eObject;
@@ -91,9 +91,10 @@ public class LifelineCreateCommand extends EditElementCommand {
/**
* Add generated NOT to constrain the creation of a lifeline
- *
+ *
* @generated
*/
+ @Override
public boolean canExecute() {
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getLifeline());
@@ -102,19 +103,21 @@ public class LifelineCreateCommand extends EditElementCommand {
/**
* Generated not for add lifelines on lifeline
- *
+ *
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
Lifeline newElement = UMLFactory.eINSTANCE.createLifeline();
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
- if(data.isPermitted()) {
- if(data.isPathDefined()) {
- if(!data.execute(target, newElement))
+ if (data.isPermitted()) {
+ if (data.isPathDefined()) {
+ if (!data.execute(target, newElement)) {
return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ }
} else {
- Interaction qualifiedTarget = (Interaction)target;
+ Interaction qualifiedTarget = (Interaction) target;
qualifiedTarget.getLifelines().add(newElement);
}
} else {
@@ -122,7 +125,7 @@ public class LifelineCreateCommand extends EditElementCommand {
}
ElementInitializers.getInstance().init_Lifeline_3001(newElement);
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -130,12 +133,12 @@ public class LifelineCreateCommand extends EditElementCommand {
* @generated
*/
protected void doConfigure(Lifeline newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
+ if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message2CreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message2CreateCommand.java
index 71db1b990a1..bbaad5000f2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message2CreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message2CreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -61,25 +61,25 @@ public class Message2CreateCommand extends EditElementCommand {
/**
* Add a condition on the MOS container
- *
+ *
* @generated
*/
@Override
public boolean canExecute() {
- if(source == null && target == null) {
+ if (source == null && target == null) {
return false;
}
- if(source != null && false == source instanceof Element) {
+ if (source != null && false == source instanceof Element) {
return false;
}
- if(target != null && false == target instanceof Element) {
+ if (target != null && false == target instanceof Element) {
return false;
}
- if(getSource() == null) {
+ if (getSource() == null) {
return true; // link creation is in progress; source is not defined yet
}
// target may be null here but it's possible to check constraint
- if(getContainer() == null) {
+ if (getContainer() == null) {
return false;
}
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateMessage_4004(getContainer(), getSource(), getTarget());
@@ -87,12 +87,12 @@ public class Message2CreateCommand extends EditElementCommand {
/**
* added code to create the gate , message occurence and event when a Async message is created.
- *
+ *
* @generated
*/
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
}
throw new UnsupportedOperationException();
@@ -102,14 +102,14 @@ public class Message2CreateCommand extends EditElementCommand {
* @generated
*/
protected void doConfigure(Message newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
configureRequest.setParameter(CreateRelationshipRequest.SOURCE, getSource());
configureRequest.setParameter(CreateRelationshipRequest.TARGET, getTarget());
ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
+ if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
@@ -126,14 +126,14 @@ public class Message2CreateCommand extends EditElementCommand {
* @generated
*/
protected Element getSource() {
- return (Element)source;
+ return (Element) source;
}
/**
* @generated
*/
protected Element getTarget() {
- return (Element)target;
+ return (Element) target;
}
/**
@@ -146,16 +146,16 @@ public class Message2CreateCommand extends EditElementCommand {
/**
* Default approach is to traverse ancestors of the source to find instance of container. Modify
* with appropriate logic.
- *
+ *
* @generated
*/
protected Interaction deduceContainer(EObject source, EObject target) {
// Find container element for the new link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null; element = element.eContainer()) {
- if(element instanceof Interaction) {
- return (Interaction)element;
+ for (EObject element = source; element != null; element = element.eContainer()) {
+ if (element instanceof Interaction) {
+ return (Interaction) element;
}
}
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message2ReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message2ReorientCommand.java
index 3d5640300d1..b2d37a47672 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message2ReorientCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message2ReorientCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -20,6 +20,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.UMLBaseItemSemanticEditPolicy;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Interaction;
@@ -58,14 +59,15 @@ public class Message2ReorientCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
public boolean canExecute() {
- if(false == getElementToEdit() instanceof Message) {
+ if (false == getElementToEdit() instanceof Message) {
return false;
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return canReorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return canReorientTarget();
}
return false;
@@ -75,17 +77,17 @@ public class Message2ReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientSource() {
- if(!(oldEnd instanceof Element && newEnd instanceof Element)) {
+ if (!(oldEnd instanceof Element && newEnd instanceof Element)) {
return false;
}
- if(getLink().getOwnedElements().size() != 1) {
+ if (getLink().getOwnedElements().size() != 1) {
return false;
}
- Element target = (Element)getLink().getOwnedElements().get(0);
- if(!(getLink().eContainer() instanceof Interaction)) {
+ Element target = getLink().getOwnedElements().get(0);
+ if (!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- Interaction container = (Interaction)getLink().eContainer();
+ Interaction container = (Interaction) getLink().eContainer();
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4004(container, getLink(), getNewSource(), target);
}
@@ -93,28 +95,29 @@ public class Message2ReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientTarget() {
- if(!(oldEnd instanceof Element && newEnd instanceof Element)) {
+ if (!(oldEnd instanceof Element && newEnd instanceof Element)) {
return false;
}
Element source = getLink().getOwner();
- if(!(getLink().eContainer() instanceof Interaction)) {
+ if (!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- Interaction container = (Interaction)getLink().eContainer();
+ Interaction container = (Interaction) getLink().eContainer();
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4004(container, getLink(), source, getNewTarget());
}
/**
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return reorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return reorientTarget();
}
throw new IllegalStateException();
@@ -138,34 +141,34 @@ public class Message2ReorientCommand extends EditElementCommand {
* @generated
*/
protected Message getLink() {
- return (Message)getElementToEdit();
+ return (Message) getElementToEdit();
}
/**
* @generated
*/
protected Element getOldSource() {
- return (Element)oldEnd;
+ return (Element) oldEnd;
}
/**
* @generated
*/
protected Element getNewSource() {
- return (Element)newEnd;
+ return (Element) newEnd;
}
/**
* @generated
*/
protected Element getOldTarget() {
- return (Element)oldEnd;
+ return (Element) oldEnd;
}
/**
* @generated
*/
protected Element getNewTarget() {
- return (Element)newEnd;
+ return (Element) newEnd;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message3CreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message3CreateCommand.java
index 8b94dcf2856..7025c6a6cd8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message3CreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message3CreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -61,25 +61,25 @@ public class Message3CreateCommand extends EditElementCommand {
/**
* Add a condition on the MOS container
- *
+ *
* @generated
*/
@Override
public boolean canExecute() {
- if(source == null && target == null) {
+ if (source == null && target == null) {
return false;
}
- if(source != null && false == source instanceof Element) {
+ if (source != null && false == source instanceof Element) {
return false;
}
- if(target != null && false == target instanceof Element) {
+ if (target != null && false == target instanceof Element) {
return false;
}
- if(getSource() == null) {
+ if (getSource() == null) {
return true; // link creation is in progress; source is not defined yet
}
// target may be null here but it's possible to check constraint
- if(getContainer() == null) {
+ if (getContainer() == null) {
return false;
}
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateMessage_4005(getContainer(), getSource(), getTarget());
@@ -87,12 +87,12 @@ public class Message3CreateCommand extends EditElementCommand {
/**
* Create a MessageOccurenceSpecification and the call event when a message is created
- *
+ *
* @generated
*/
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
}
throw new UnsupportedOperationException();
@@ -102,14 +102,14 @@ public class Message3CreateCommand extends EditElementCommand {
* @generated
*/
protected void doConfigure(Message newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
configureRequest.setParameter(CreateRelationshipRequest.SOURCE, getSource());
configureRequest.setParameter(CreateRelationshipRequest.TARGET, getTarget());
ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
+ if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
@@ -126,14 +126,14 @@ public class Message3CreateCommand extends EditElementCommand {
* @generated
*/
protected Element getSource() {
- return (Element)source;
+ return (Element) source;
}
/**
* @generated
*/
protected Element getTarget() {
- return (Element)target;
+ return (Element) target;
}
/**
@@ -146,16 +146,16 @@ public class Message3CreateCommand extends EditElementCommand {
/**
* Default approach is to traverse ancestors of the source to find instance of container. Modify
* with appropriate logic.
- *
+ *
* @generated
*/
protected Interaction deduceContainer(EObject source, EObject target) {
// Find container element for the new link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null; element = element.eContainer()) {
- if(element instanceof Interaction) {
- return (Interaction)element;
+ for (EObject element = source; element != null; element = element.eContainer()) {
+ if (element instanceof Interaction) {
+ return (Interaction) element;
}
}
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message3ReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message3ReorientCommand.java
index 80858170828..6e3238c5767 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message3ReorientCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message3ReorientCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -20,6 +20,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.UMLBaseItemSemanticEditPolicy;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Interaction;
@@ -58,14 +59,15 @@ public class Message3ReorientCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
public boolean canExecute() {
- if(false == getElementToEdit() instanceof Message) {
+ if (false == getElementToEdit() instanceof Message) {
return false;
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return canReorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return canReorientTarget();
}
return false;
@@ -75,17 +77,17 @@ public class Message3ReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientSource() {
- if(!(oldEnd instanceof Element && newEnd instanceof Element)) {
+ if (!(oldEnd instanceof Element && newEnd instanceof Element)) {
return false;
}
- if(getLink().getOwnedElements().size() != 1) {
+ if (getLink().getOwnedElements().size() != 1) {
return false;
}
- Element target = (Element)getLink().getOwnedElements().get(0);
- if(!(getLink().eContainer() instanceof Interaction)) {
+ Element target = getLink().getOwnedElements().get(0);
+ if (!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- Interaction container = (Interaction)getLink().eContainer();
+ Interaction container = (Interaction) getLink().eContainer();
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4005(container, getLink(), getNewSource(), target);
}
@@ -93,28 +95,29 @@ public class Message3ReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientTarget() {
- if(!(oldEnd instanceof Element && newEnd instanceof Element)) {
+ if (!(oldEnd instanceof Element && newEnd instanceof Element)) {
return false;
}
Element source = getLink().getOwner();
- if(!(getLink().eContainer() instanceof Interaction)) {
+ if (!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- Interaction container = (Interaction)getLink().eContainer();
+ Interaction container = (Interaction) getLink().eContainer();
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4005(container, getLink(), source, getNewTarget());
}
/**
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return reorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return reorientTarget();
}
throw new IllegalStateException();
@@ -138,34 +141,34 @@ public class Message3ReorientCommand extends EditElementCommand {
* @generated
*/
protected Message getLink() {
- return (Message)getElementToEdit();
+ return (Message) getElementToEdit();
}
/**
* @generated
*/
protected Element getOldSource() {
- return (Element)oldEnd;
+ return (Element) oldEnd;
}
/**
* @generated
*/
protected Element getNewSource() {
- return (Element)newEnd;
+ return (Element) newEnd;
}
/**
* @generated
*/
protected Element getOldTarget() {
- return (Element)oldEnd;
+ return (Element) oldEnd;
}
/**
* @generated
*/
protected Element getNewTarget() {
- return (Element)newEnd;
+ return (Element) newEnd;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message4CreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message4CreateCommand.java
index 7c06bed8b8a..0bbf69788fc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message4CreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message4CreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -61,25 +61,25 @@ public class Message4CreateCommand extends EditElementCommand {
/**
* Add a condition on the MOS container
- *
+ *
* @generated
*/
@Override
public boolean canExecute() {
- if(source == null && target == null) {
+ if (source == null && target == null) {
return false;
}
- if(source != null && false == source instanceof Element) {
+ if (source != null && false == source instanceof Element) {
return false;
}
- if(target != null && false == target instanceof Element) {
+ if (target != null && false == target instanceof Element) {
return false;
}
- if(getSource() == null) {
+ if (getSource() == null) {
return true; // link creation is in progress; source is not defined yet
}
// target may be null here but it's possible to check constraint
- if(getContainer() == null) {
+ if (getContainer() == null) {
return false;
}
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateMessage_4006(getContainer(), getSource(), getTarget());
@@ -87,12 +87,12 @@ public class Message4CreateCommand extends EditElementCommand {
/**
* Create a MessageOccurenceSpecification and the call event when a message is created
- *
+ *
* @generated
*/
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
}
throw new UnsupportedOperationException();
@@ -102,14 +102,14 @@ public class Message4CreateCommand extends EditElementCommand {
* @generated
*/
protected void doConfigure(Message newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
configureRequest.setParameter(CreateRelationshipRequest.SOURCE, getSource());
configureRequest.setParameter(CreateRelationshipRequest.TARGET, getTarget());
ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
+ if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
@@ -126,14 +126,14 @@ public class Message4CreateCommand extends EditElementCommand {
* @generated
*/
protected Element getSource() {
- return (Element)source;
+ return (Element) source;
}
/**
* @generated
*/
protected Element getTarget() {
- return (Element)target;
+ return (Element) target;
}
/**
@@ -146,16 +146,16 @@ public class Message4CreateCommand extends EditElementCommand {
/**
* Default approach is to traverse ancestors of the source to find instance of container. Modify
* with appropriate logic.
- *
+ *
* @generated
*/
protected Interaction deduceContainer(EObject source, EObject target) {
// Find container element for the new link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null; element = element.eContainer()) {
- if(element instanceof Interaction) {
- return (Interaction)element;
+ for (EObject element = source; element != null; element = element.eContainer()) {
+ if (element instanceof Interaction) {
+ return (Interaction) element;
}
}
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message4ReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message4ReorientCommand.java
index 6d1d87a0e12..20eaed5bb77 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message4ReorientCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message4ReorientCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -20,6 +20,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.UMLBaseItemSemanticEditPolicy;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Interaction;
@@ -58,14 +59,15 @@ public class Message4ReorientCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
public boolean canExecute() {
- if(false == getElementToEdit() instanceof Message) {
+ if (false == getElementToEdit() instanceof Message) {
return false;
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return canReorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return canReorientTarget();
}
return false;
@@ -75,17 +77,17 @@ public class Message4ReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientSource() {
- if(!(oldEnd instanceof Element && newEnd instanceof Element)) {
+ if (!(oldEnd instanceof Element && newEnd instanceof Element)) {
return false;
}
- if(getLink().getOwnedElements().size() != 1) {
+ if (getLink().getOwnedElements().size() != 1) {
return false;
}
- Element target = (Element)getLink().getOwnedElements().get(0);
- if(!(getLink().eContainer() instanceof Interaction)) {
+ Element target = getLink().getOwnedElements().get(0);
+ if (!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- Interaction container = (Interaction)getLink().eContainer();
+ Interaction container = (Interaction) getLink().eContainer();
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4006(container, getLink(), getNewSource(), target);
}
@@ -93,28 +95,29 @@ public class Message4ReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientTarget() {
- if(!(oldEnd instanceof Element && newEnd instanceof Element)) {
+ if (!(oldEnd instanceof Element && newEnd instanceof Element)) {
return false;
}
Element source = getLink().getOwner();
- if(!(getLink().eContainer() instanceof Interaction)) {
+ if (!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- Interaction container = (Interaction)getLink().eContainer();
+ Interaction container = (Interaction) getLink().eContainer();
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4006(container, getLink(), source, getNewTarget());
}
/**
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return reorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return reorientTarget();
}
throw new IllegalStateException();
@@ -138,34 +141,34 @@ public class Message4ReorientCommand extends EditElementCommand {
* @generated
*/
protected Message getLink() {
- return (Message)getElementToEdit();
+ return (Message) getElementToEdit();
}
/**
* @generated
*/
protected Element getOldSource() {
- return (Element)oldEnd;
+ return (Element) oldEnd;
}
/**
* @generated
*/
protected Element getNewSource() {
- return (Element)newEnd;
+ return (Element) newEnd;
}
/**
* @generated
*/
protected Element getOldTarget() {
- return (Element)oldEnd;
+ return (Element) oldEnd;
}
/**
* @generated
*/
protected Element getNewTarget() {
- return (Element)newEnd;
+ return (Element) newEnd;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message5CreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message5CreateCommand.java
index 3ac67df5053..d64aa8ec65f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message5CreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message5CreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -61,25 +61,25 @@ public class Message5CreateCommand extends EditElementCommand {
/**
* Add a condition on the MOS container
- *
+ *
* @generated
*/
@Override
public boolean canExecute() {
- if(source == null && target == null) {
+ if (source == null && target == null) {
return false;
}
- if(source != null && false == source instanceof Element) {
+ if (source != null && false == source instanceof Element) {
return false;
}
- if(target != null && false == target instanceof Element) {
+ if (target != null && false == target instanceof Element) {
return false;
}
- if(getSource() == null) {
+ if (getSource() == null) {
return true; // link creation is in progress; source is not defined yet
}
// target may be null here but it's possible to check constraint
- if(getContainer() == null) {
+ if (getContainer() == null) {
return false;
}
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateMessage_4007(getContainer(), getSource(), getTarget());
@@ -87,12 +87,12 @@ public class Message5CreateCommand extends EditElementCommand {
/**
* Create a MessageOccurenceSpecification and the call event when a message is created
- *
+ *
* @generated
*/
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
}
throw new UnsupportedOperationException();
@@ -102,14 +102,14 @@ public class Message5CreateCommand extends EditElementCommand {
* @generated
*/
protected void doConfigure(Message newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
configureRequest.setParameter(CreateRelationshipRequest.SOURCE, getSource());
configureRequest.setParameter(CreateRelationshipRequest.TARGET, getTarget());
ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
+ if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
@@ -126,14 +126,14 @@ public class Message5CreateCommand extends EditElementCommand {
* @generated
*/
protected Element getSource() {
- return (Element)source;
+ return (Element) source;
}
/**
* @generated
*/
protected Element getTarget() {
- return (Element)target;
+ return (Element) target;
}
/**
@@ -146,16 +146,16 @@ public class Message5CreateCommand extends EditElementCommand {
/**
* Default approach is to traverse ancestors of the source to find instance of container. Modify
* with appropriate logic.
- *
+ *
* @generated
*/
protected Interaction deduceContainer(EObject source, EObject target) {
// Find container element for the new link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null; element = element.eContainer()) {
- if(element instanceof Interaction) {
- return (Interaction)element;
+ for (EObject element = source; element != null; element = element.eContainer()) {
+ if (element instanceof Interaction) {
+ return (Interaction) element;
}
}
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message5ReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message5ReorientCommand.java
index 6ffdd970d97..b4277f95591 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message5ReorientCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message5ReorientCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -20,6 +20,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.UMLBaseItemSemanticEditPolicy;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Interaction;
@@ -58,14 +59,15 @@ public class Message5ReorientCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
public boolean canExecute() {
- if(false == getElementToEdit() instanceof Message) {
+ if (false == getElementToEdit() instanceof Message) {
return false;
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return canReorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return canReorientTarget();
}
return false;
@@ -75,17 +77,17 @@ public class Message5ReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientSource() {
- if(!(oldEnd instanceof Element && newEnd instanceof Element)) {
+ if (!(oldEnd instanceof Element && newEnd instanceof Element)) {
return false;
}
- if(getLink().getOwnedElements().size() != 1) {
+ if (getLink().getOwnedElements().size() != 1) {
return false;
}
- Element target = (Element)getLink().getOwnedElements().get(0);
- if(!(getLink().eContainer() instanceof Interaction)) {
+ Element target = getLink().getOwnedElements().get(0);
+ if (!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- Interaction container = (Interaction)getLink().eContainer();
+ Interaction container = (Interaction) getLink().eContainer();
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4007(container, getLink(), getNewSource(), target);
}
@@ -93,28 +95,29 @@ public class Message5ReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientTarget() {
- if(!(oldEnd instanceof Element && newEnd instanceof Element)) {
+ if (!(oldEnd instanceof Element && newEnd instanceof Element)) {
return false;
}
Element source = getLink().getOwner();
- if(!(getLink().eContainer() instanceof Interaction)) {
+ if (!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- Interaction container = (Interaction)getLink().eContainer();
+ Interaction container = (Interaction) getLink().eContainer();
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4007(container, getLink(), source, getNewTarget());
}
/**
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return reorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return reorientTarget();
}
throw new IllegalStateException();
@@ -138,34 +141,34 @@ public class Message5ReorientCommand extends EditElementCommand {
* @generated
*/
protected Message getLink() {
- return (Message)getElementToEdit();
+ return (Message) getElementToEdit();
}
/**
* @generated
*/
protected Element getOldSource() {
- return (Element)oldEnd;
+ return (Element) oldEnd;
}
/**
* @generated
*/
protected Element getNewSource() {
- return (Element)newEnd;
+ return (Element) newEnd;
}
/**
* @generated
*/
protected Element getOldTarget() {
- return (Element)oldEnd;
+ return (Element) oldEnd;
}
/**
* @generated
*/
protected Element getNewTarget() {
- return (Element)newEnd;
+ return (Element) newEnd;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message6CreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message6CreateCommand.java
index 11eec601783..5ffda66cb4b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message6CreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message6CreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -61,25 +61,25 @@ public class Message6CreateCommand extends EditElementCommand {
/**
* Add a condition on the MOS container
- *
+ *
* @generated
*/
@Override
public boolean canExecute() {
- if(source == null && target == null) {
+ if (source == null && target == null) {
return false;
}
- if(source != null && false == source instanceof Element) {
+ if (source != null && false == source instanceof Element) {
return false;
}
- if(target != null && false == target instanceof Element) {
+ if (target != null && false == target instanceof Element) {
return false;
}
- if(getSource() == null) {
+ if (getSource() == null) {
return true; // link creation is in progress; source is not defined yet
}
// target may be null here but it's possible to check constraint
- if(getContainer() == null) {
+ if (getContainer() == null) {
return false;
}
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateMessage_4008(getContainer(), getSource(), getTarget());
@@ -87,12 +87,12 @@ public class Message6CreateCommand extends EditElementCommand {
/**
* Create a MessageOccurenceSpecification and the call event when a message is created
- *
+ *
* @generated
*/
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
}
throw new UnsupportedOperationException();
@@ -102,14 +102,14 @@ public class Message6CreateCommand extends EditElementCommand {
* @generated
*/
protected void doConfigure(Message newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
configureRequest.setParameter(CreateRelationshipRequest.SOURCE, getSource());
configureRequest.setParameter(CreateRelationshipRequest.TARGET, getTarget());
ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
+ if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
@@ -126,14 +126,14 @@ public class Message6CreateCommand extends EditElementCommand {
* @generated
*/
protected Element getSource() {
- return (Element)source;
+ return (Element) source;
}
/**
* @generated
*/
protected Element getTarget() {
- return (Element)target;
+ return (Element) target;
}
/**
@@ -146,16 +146,16 @@ public class Message6CreateCommand extends EditElementCommand {
/**
* Default approach is to traverse ancestors of the source to find instance of container. Modify
* with appropriate logic.
- *
+ *
* @generated
*/
protected Interaction deduceContainer(EObject source, EObject target) {
// Find container element for the new link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null; element = element.eContainer()) {
- if(element instanceof Interaction) {
- return (Interaction)element;
+ for (EObject element = source; element != null; element = element.eContainer()) {
+ if (element instanceof Interaction) {
+ return (Interaction) element;
}
}
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message6ReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message6ReorientCommand.java
index fb88f30f66d..05264bef8ae 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message6ReorientCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message6ReorientCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -20,6 +20,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.UMLBaseItemSemanticEditPolicy;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Interaction;
@@ -57,17 +58,18 @@ public class Message6ReorientCommand extends EditElementCommand {
/**
* Block reorient target
- *
+ *
* @generated
*/
+ @Override
public boolean canExecute() {
- if(false == getElementToEdit() instanceof Message) {
+ if (false == getElementToEdit() instanceof Message) {
return false;
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return canReorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return canReorientTarget();
}
return false;
@@ -77,17 +79,17 @@ public class Message6ReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientSource() {
- if(!(oldEnd instanceof Element && newEnd instanceof Element)) {
+ if (!(oldEnd instanceof Element && newEnd instanceof Element)) {
return false;
}
- if(getLink().getOwnedElements().size() != 1) {
+ if (getLink().getOwnedElements().size() != 1) {
return false;
}
- Element target = (Element)getLink().getOwnedElements().get(0);
- if(!(getLink().eContainer() instanceof Interaction)) {
+ Element target = getLink().getOwnedElements().get(0);
+ if (!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- Interaction container = (Interaction)getLink().eContainer();
+ Interaction container = (Interaction) getLink().eContainer();
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4008(container, getLink(), getNewSource(), target);
}
@@ -95,28 +97,29 @@ public class Message6ReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientTarget() {
- if(!(oldEnd instanceof Element && newEnd instanceof Element)) {
+ if (!(oldEnd instanceof Element && newEnd instanceof Element)) {
return false;
}
Element source = getLink().getOwner();
- if(!(getLink().eContainer() instanceof Interaction)) {
+ if (!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- Interaction container = (Interaction)getLink().eContainer();
+ Interaction container = (Interaction) getLink().eContainer();
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4008(container, getLink(), source, getNewTarget());
}
/**
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return reorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return reorientTarget();
}
throw new IllegalStateException();
@@ -140,34 +143,34 @@ public class Message6ReorientCommand extends EditElementCommand {
* @generated
*/
protected Message getLink() {
- return (Message)getElementToEdit();
+ return (Message) getElementToEdit();
}
/**
* @generated
*/
protected Element getOldSource() {
- return (Element)oldEnd;
+ return (Element) oldEnd;
}
/**
* @generated
*/
protected Element getNewSource() {
- return (Element)newEnd;
+ return (Element) newEnd;
}
/**
* @generated
*/
protected Element getOldTarget() {
- return (Element)oldEnd;
+ return (Element) oldEnd;
}
/**
* @generated
*/
protected Element getNewTarget() {
- return (Element)newEnd;
+ return (Element) newEnd;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message7CreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message7CreateCommand.java
index c44150c215c..7b337585048 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message7CreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message7CreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -61,25 +61,25 @@ public class Message7CreateCommand extends EditElementCommand {
/**
* Add a condition on the MOS container
- *
+ *
* @generated
*/
@Override
public boolean canExecute() {
- if(source == null && target == null) {
+ if (source == null && target == null) {
return false;
}
- if(source != null && false == source instanceof Element) {
+ if (source != null && false == source instanceof Element) {
return false;
}
- if(target != null && false == target instanceof Element) {
+ if (target != null && false == target instanceof Element) {
return false;
}
- if(getSource() == null) {
+ if (getSource() == null) {
return true; // link creation is in progress; source is not defined yet
}
// target may be null here but it's possible to check constraint
- if(getContainer() == null) {
+ if (getContainer() == null) {
return false;
}
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateMessage_4009(getContainer(), getSource(), getTarget());
@@ -87,12 +87,12 @@ public class Message7CreateCommand extends EditElementCommand {
/**
* Create a MessageOccurenceSpecification and the call event when a message is created
- *
+ *
* @generated
*/
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
}
throw new UnsupportedOperationException();
@@ -102,14 +102,14 @@ public class Message7CreateCommand extends EditElementCommand {
* @generated
*/
protected void doConfigure(Message newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
configureRequest.setParameter(CreateRelationshipRequest.SOURCE, getSource());
configureRequest.setParameter(CreateRelationshipRequest.TARGET, getTarget());
ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
+ if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
@@ -126,14 +126,14 @@ public class Message7CreateCommand extends EditElementCommand {
* @generated
*/
protected Element getSource() {
- return (Element)source;
+ return (Element) source;
}
/**
* @generated
*/
protected Element getTarget() {
- return (Element)target;
+ return (Element) target;
}
/**
@@ -146,16 +146,16 @@ public class Message7CreateCommand extends EditElementCommand {
/**
* Default approach is to traverse ancestors of the source to find instance of container. Modify
* with appropriate logic.
- *
+ *
* @generated
*/
protected Interaction deduceContainer(EObject source, EObject target) {
// Find container element for the new link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null; element = element.eContainer()) {
- if(element instanceof Interaction) {
- return (Interaction)element;
+ for (EObject element = source; element != null; element = element.eContainer()) {
+ if (element instanceof Interaction) {
+ return (Interaction) element;
}
}
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message7ReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message7ReorientCommand.java
index efc0832a93d..96ba17fdce4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message7ReorientCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/Message7ReorientCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -20,6 +20,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.UMLBaseItemSemanticEditPolicy;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Interaction;
@@ -57,17 +58,18 @@ public class Message7ReorientCommand extends EditElementCommand {
/**
* Block reorient source
- *
+ *
* @generated
*/
+ @Override
public boolean canExecute() {
- if(false == getElementToEdit() instanceof Message) {
+ if (false == getElementToEdit() instanceof Message) {
return false;
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return canReorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return canReorientTarget();
}
return false;
@@ -77,17 +79,17 @@ public class Message7ReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientSource() {
- if(!(oldEnd instanceof Element && newEnd instanceof Element)) {
+ if (!(oldEnd instanceof Element && newEnd instanceof Element)) {
return false;
}
- if(getLink().getOwnedElements().size() != 1) {
+ if (getLink().getOwnedElements().size() != 1) {
return false;
}
- Element target = (Element)getLink().getOwnedElements().get(0);
- if(!(getLink().eContainer() instanceof Interaction)) {
+ Element target = getLink().getOwnedElements().get(0);
+ if (!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- Interaction container = (Interaction)getLink().eContainer();
+ Interaction container = (Interaction) getLink().eContainer();
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4009(container, getLink(), getNewSource(), target);
}
@@ -95,28 +97,29 @@ public class Message7ReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientTarget() {
- if(!(oldEnd instanceof Element && newEnd instanceof Element)) {
+ if (!(oldEnd instanceof Element && newEnd instanceof Element)) {
return false;
}
Element source = getLink().getOwner();
- if(!(getLink().eContainer() instanceof Interaction)) {
+ if (!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- Interaction container = (Interaction)getLink().eContainer();
+ Interaction container = (Interaction) getLink().eContainer();
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4009(container, getLink(), source, getNewTarget());
}
/**
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return reorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return reorientTarget();
}
throw new IllegalStateException();
@@ -140,34 +143,34 @@ public class Message7ReorientCommand extends EditElementCommand {
* @generated
*/
protected Message getLink() {
- return (Message)getElementToEdit();
+ return (Message) getElementToEdit();
}
/**
* @generated
*/
protected Element getOldSource() {
- return (Element)oldEnd;
+ return (Element) oldEnd;
}
/**
* @generated
*/
protected Element getNewSource() {
- return (Element)newEnd;
+ return (Element) newEnd;
}
/**
* @generated
*/
protected Element getOldTarget() {
- return (Element)oldEnd;
+ return (Element) oldEnd;
}
/**
* @generated
*/
protected Element getNewTarget() {
- return (Element)newEnd;
+ return (Element) newEnd;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/MessageCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/MessageCreateCommand.java
index 0434c484f94..fa047f1b42c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/MessageCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/MessageCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -61,25 +61,25 @@ public class MessageCreateCommand extends EditElementCommand {
/**
* Add a condition on the MOS container
- *
+ *
* @generated
*/
@Override
public boolean canExecute() {
- if(source == null && target == null) {
+ if (source == null && target == null) {
return false;
}
- if(source != null && false == source instanceof Element) {
+ if (source != null && false == source instanceof Element) {
return false;
}
- if(target != null && false == target instanceof Element) {
+ if (target != null && false == target instanceof Element) {
return false;
}
- if(getSource() == null) {
+ if (getSource() == null) {
return true; // link creation is in progress; source is not defined yet
}
// target may be null here but it's possible to check constraint
- if(getContainer() == null) {
+ if (getContainer() == null) {
return false;
}
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateMessage_4003(getContainer(), getSource(), getTarget());
@@ -87,12 +87,12 @@ public class MessageCreateCommand extends EditElementCommand {
/**
* Create a MessageOccurenceSpecification and the call event when a message is created
- *
+ *
* @generated
*/
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
}
throw new UnsupportedOperationException();
@@ -102,14 +102,14 @@ public class MessageCreateCommand extends EditElementCommand {
* @generated
*/
protected void doConfigure(Message newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
configureRequest.setParameter(CreateRelationshipRequest.SOURCE, getSource());
configureRequest.setParameter(CreateRelationshipRequest.TARGET, getTarget());
ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
+ if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
@@ -126,14 +126,14 @@ public class MessageCreateCommand extends EditElementCommand {
* @generated
*/
protected Element getSource() {
- return (Element)source;
+ return (Element) source;
}
/**
* @generated
*/
protected Element getTarget() {
- return (Element)target;
+ return (Element) target;
}
/**
@@ -146,16 +146,16 @@ public class MessageCreateCommand extends EditElementCommand {
/**
* Default approach is to traverse ancestors of the source to find instance of container. Modify
* with appropriate logic.
- *
+ *
* @generated
*/
protected Interaction deduceContainer(EObject source, EObject target) {
// Find container element for the new link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null; element = element.eContainer()) {
- if(element instanceof Interaction) {
- return (Interaction)element;
+ for (EObject element = source; element != null; element = element.eContainer()) {
+ if (element instanceof Interaction) {
+ return (Interaction) element;
}
}
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/MessageReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/MessageReorientCommand.java
index 4e81a7f41ae..393cb513428 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/MessageReorientCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/MessageReorientCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -20,6 +20,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.UMLBaseItemSemanticEditPolicy;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Interaction;
@@ -58,14 +59,15 @@ public class MessageReorientCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
public boolean canExecute() {
- if(false == getElementToEdit() instanceof Message) {
+ if (false == getElementToEdit() instanceof Message) {
return false;
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return canReorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return canReorientTarget();
}
return false;
@@ -75,17 +77,17 @@ public class MessageReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientSource() {
- if(!(oldEnd instanceof Element && newEnd instanceof Element)) {
+ if (!(oldEnd instanceof Element && newEnd instanceof Element)) {
return false;
}
- if(getLink().getOwnedElements().size() != 1) {
+ if (getLink().getOwnedElements().size() != 1) {
return false;
}
- Element target = (Element)getLink().getOwnedElements().get(0);
- if(!(getLink().eContainer() instanceof Interaction)) {
+ Element target = getLink().getOwnedElements().get(0);
+ if (!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- Interaction container = (Interaction)getLink().eContainer();
+ Interaction container = (Interaction) getLink().eContainer();
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4003(container, getLink(), getNewSource(), target);
}
@@ -93,28 +95,29 @@ public class MessageReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientTarget() {
- if(!(oldEnd instanceof Element && newEnd instanceof Element)) {
+ if (!(oldEnd instanceof Element && newEnd instanceof Element)) {
return false;
}
Element source = getLink().getOwner();
- if(!(getLink().eContainer() instanceof Interaction)) {
+ if (!(getLink().eContainer() instanceof Interaction)) {
return false;
}
- Interaction container = (Interaction)getLink().eContainer();
+ Interaction container = (Interaction) getLink().eContainer();
return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistMessage_4003(container, getLink(), source, getNewTarget());
}
/**
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return reorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return reorientTarget();
}
throw new IllegalStateException();
@@ -138,34 +141,34 @@ public class MessageReorientCommand extends EditElementCommand {
* @generated
*/
protected Message getLink() {
- return (Message)getElementToEdit();
+ return (Message) getElementToEdit();
}
/**
* @generated
*/
protected Element getOldSource() {
- return (Element)oldEnd;
+ return (Element) oldEnd;
}
/**
* @generated
*/
protected Element getNewSource() {
- return (Element)newEnd;
+ return (Element) newEnd;
}
/**
* @generated
*/
protected Element getOldTarget() {
- return (Element)oldEnd;
+ return (Element) oldEnd;
}
/**
* @generated
*/
protected Element getNewTarget() {
- return (Element)newEnd;
+ return (Element) newEnd;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/StateInvariantCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/StateInvariantCreateCommand.java
index dd427a5c91e..e084aa2b0ad 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/StateInvariantCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/StateInvariantCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -16,7 +16,6 @@ package org.eclipse.papyrus.uml.diagram.sequence.edit.commands;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
@@ -75,15 +74,16 @@ public class StateInvariantCreateCommand extends EditElementCommand {
/**
* FIXME: replace with setElementToEdit()
- *
+ *
* @generated
*/
+ @Override
protected EObject getElementToEdit() {
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
+ EObject container = ((CreateElementRequest) getRequest()).getContainer();
+ if (container instanceof View) {
+ container = ((View) container).getElement();
}
- if(container != null) {
+ if (container != null) {
return container;
}
return eObject;
@@ -92,6 +92,7 @@ public class StateInvariantCreateCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
public boolean canExecute() {
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getStateInvariant());
@@ -100,19 +101,21 @@ public class StateInvariantCreateCommand extends EditElementCommand {
/**
* The StateInvariant is created on the lifeline and not on its container
- *
+ *
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
StateInvariant newElement = UMLFactory.eINSTANCE.createStateInvariant();
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
- if(data.isPermitted()) {
- if(data.isPathDefined()) {
- if(!data.execute(target, newElement))
+ if (data.isPermitted()) {
+ if (data.isPathDefined()) {
+ if (!data.execute(target, newElement)) {
return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ }
} else {
- Interaction qualifiedTarget = (Interaction)target;
+ Interaction qualifiedTarget = (Interaction) target;
qualifiedTarget.getFragments().add(newElement);
}
} else {
@@ -120,7 +123,7 @@ public class StateInvariantCreateCommand extends EditElementCommand {
}
ElementInitializers.getInstance().init_StateInvariant_3017(newElement);
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -128,12 +131,12 @@ public class StateInvariantCreateCommand extends EditElementCommand {
* @generated
*/
protected void doConfigure(StateInvariant newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
+ if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/TimeConstraintCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/TimeConstraintCreateCommand.java
index 1d2c0f726e3..d0fcea7ba0f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/TimeConstraintCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/TimeConstraintCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -16,7 +16,6 @@ package org.eclipse.papyrus.uml.diagram.sequence.edit.commands;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
@@ -75,15 +74,16 @@ public class TimeConstraintCreateCommand extends EditElementCommand {
/**
* FIXME: replace with setElementToEdit()
- *
+ *
* @generated
*/
+ @Override
protected EObject getElementToEdit() {
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
+ EObject container = ((CreateElementRequest) getRequest()).getContainer();
+ if (container instanceof View) {
+ container = ((View) container).getElement();
}
- if(container != null) {
+ if (container != null) {
return container;
}
return eObject;
@@ -92,6 +92,7 @@ public class TimeConstraintCreateCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
public boolean canExecute() {
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getTimeConstraint());
@@ -101,16 +102,18 @@ public class TimeConstraintCreateCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
TimeConstraint newElement = UMLFactory.eINSTANCE.createTimeConstraint();
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
- if(data.isPermitted()) {
- if(data.isPathDefined()) {
- if(!data.execute(target, newElement))
+ if (data.isPermitted()) {
+ if (data.isPathDefined()) {
+ if (!data.execute(target, newElement)) {
return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ }
} else {
- Namespace qualifiedTarget = (Namespace)target;
+ Namespace qualifiedTarget = (Namespace) target;
qualifiedTarget.getOwnedRules().add(newElement);
}
} else {
@@ -118,7 +121,7 @@ public class TimeConstraintCreateCommand extends EditElementCommand {
}
ElementInitializers.getInstance().init_TimeConstraint_3019(newElement);
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -126,12 +129,12 @@ public class TimeConstraintCreateCommand extends EditElementCommand {
* @generated
*/
protected void doConfigure(TimeConstraint newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
+ if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/TimeObservationCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/TimeObservationCreateCommand.java
index 4c1553279d3..67e25505653 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/TimeObservationCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/TimeObservationCreateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -16,7 +16,6 @@ package org.eclipse.papyrus.uml.diagram.sequence.edit.commands;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
@@ -75,15 +74,16 @@ public class TimeObservationCreateCommand extends EditElementCommand {
/**
* FIXME: replace with setElementToEdit()
- *
+ *
* @generated
*/
+ @Override
protected EObject getElementToEdit() {
- EObject container = ((CreateElementRequest)getRequest()).getContainer();
- if(container instanceof View) {
- container = ((View)container).getElement();
+ EObject container = ((CreateElementRequest) getRequest()).getContainer();
+ if (container instanceof View) {
+ container = ((View) container).getElement();
}
- if(container != null) {
+ if (container != null) {
return container;
}
return eObject;
@@ -92,6 +92,7 @@ public class TimeObservationCreateCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
public boolean canExecute() {
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getTimeObservation());
@@ -101,16 +102,18 @@ public class TimeObservationCreateCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
TimeObservation newElement = UMLFactory.eINSTANCE.createTimeObservation();
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
- if(data.isPermitted()) {
- if(data.isPathDefined()) {
- if(!data.execute(target, newElement))
+ if (data.isPermitted()) {
+ if (data.isPathDefined()) {
+ if (!data.execute(target, newElement)) {
return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
+ }
} else {
- Package qualifiedTarget = (Package)target;
+ Package qualifiedTarget = (Package) target;
qualifiedTarget.getPackagedElements().add(newElement);
}
} else {
@@ -118,7 +121,7 @@ public class TimeObservationCreateCommand extends EditElementCommand {
}
ElementInitializers.getInstance().init_TimeObservation_3020(newElement);
doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -126,12 +129,12 @@ public class TimeObservationCreateCommand extends EditElementCommand {
* @generated
*/
protected void doConfigure(TimeObservation newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest)getRequest()).getElementType();
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest)getRequest()).getClientContext());
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if(configureCommand != null && configureCommand.canExecute()) {
+ if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/UMLReorientConnectionViewCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/UMLReorientConnectionViewCommand.java
index 6ff765514d8..210c62b627f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/UMLReorientConnectionViewCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/UMLReorientConnectionViewCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -43,9 +43,10 @@ public class UMLReorientConnectionViewCommand extends AbstractTransactionalComma
/**
* @generated
*/
+ @Override
public List getAffectedFiles() {
- View view = (View)edgeAdaptor.getAdapter(View.class);
- if(view != null) {
+ View view = (View) edgeAdaptor.getAdapter(View.class);
+ if (view != null) {
return getWorkspaceFiles(view);
}
return super.getAffectedFiles();
@@ -68,9 +69,10 @@ public class UMLReorientConnectionViewCommand extends AbstractTransactionalComma
/**
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) {
assert null != edgeAdaptor : "Null child in UMLReorientConnectionViewCommand"; //$NON-NLS-1$
- Edge edge = (Edge)getEdgeAdaptor().getAdapter(Edge.class);
+ Edge edge = (Edge) getEdgeAdaptor().getAdapter(Edge.class);
assert null != edge : "Null edge in UMLReorientConnectionViewCommand"; //$NON-NLS-1$
View tempView = edge.getSource();
edge.setSource(edge.getTarget());
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/ActionExecutionSpecificationEditHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/ActionExecutionSpecificationEditHelper.java
index 1f7e2033b0f..bbe8c490ae2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/ActionExecutionSpecificationEditHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/ActionExecutionSpecificationEditHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/BehaviorExecutionSpecificationEditHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/BehaviorExecutionSpecificationEditHelper.java
index 632e5169635..8798e11d537 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/BehaviorExecutionSpecificationEditHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/BehaviorExecutionSpecificationEditHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/CombinedFragmentEditHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/CombinedFragmentEditHelper.java
index bd95d17d287..163db250ae6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/CombinedFragmentEditHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/CombinedFragmentEditHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/CommentEditHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/CommentEditHelper.java
index 14b0ed26794..dbae12d5ba0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/CommentEditHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/CommentEditHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/ConsiderIgnoreFragmentEditHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/ConsiderIgnoreFragmentEditHelper.java
index 820de4da51d..3ccd2241568 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/ConsiderIgnoreFragmentEditHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/ConsiderIgnoreFragmentEditHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/ConstraintEditHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/ConstraintEditHelper.java
index 146c842b412..aaa49d1a1f2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/ConstraintEditHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/ConstraintEditHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/ContinuationEditHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/ContinuationEditHelper.java
index beb13efa889..ab18408700d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/ContinuationEditHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/ContinuationEditHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/DestructionEventEditHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/DestructionEventEditHelper.java
index 89f03153df4..f59a4183fad 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/DestructionEventEditHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/DestructionEventEditHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/DurationConstraintEditHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/DurationConstraintEditHelper.java
index bfc2643c00c..d4e543b07f0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/DurationConstraintEditHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/DurationConstraintEditHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/DurationConstraintInMessageEditHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/DurationConstraintInMessageEditHelper.java
index ed0fc1a49a1..f5ec0b3d030 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/DurationConstraintInMessageEditHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/DurationConstraintInMessageEditHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/DurationObservationEditHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/DurationObservationEditHelper.java
index 63c6e4e092b..a8248f76e8b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/DurationObservationEditHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/DurationObservationEditHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/InteractionEditHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/InteractionEditHelper.java
index 9859e4b0b9c..bfcb5a3ae2b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/InteractionEditHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/InteractionEditHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/InteractionOperandEditHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/InteractionOperandEditHelper.java
index a4e911c7042..506af37b50f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/InteractionOperandEditHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/InteractionOperandEditHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/InteractionUseEditHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/InteractionUseEditHelper.java
index df0a5499ac6..2fa9accdbf2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/InteractionUseEditHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/InteractionUseEditHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/LifelineEditHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/LifelineEditHelper.java
index 96b9be45a9e..6e478c87adf 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/LifelineEditHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/LifelineEditHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/MessageEditHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/MessageEditHelper.java
index de5e06b32c7..2f10385cfe3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/MessageEditHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/MessageEditHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/MessageOccurrenceSpecificationEditHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/MessageOccurrenceSpecificationEditHelper.java
index 85093014dda..79a7e4a8720 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/MessageOccurrenceSpecificationEditHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/MessageOccurrenceSpecificationEditHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/PackageEditHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/PackageEditHelper.java
index 71336a0a8a5..fa9a72504c1 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/PackageEditHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/PackageEditHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/StateInvariantEditHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/StateInvariantEditHelper.java
index f33dc2536d6..7435eb98b8f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/StateInvariantEditHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/StateInvariantEditHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/TimeConstraintEditHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/TimeConstraintEditHelper.java
index 3991142022f..0f80b723a66 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/TimeConstraintEditHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/TimeConstraintEditHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/TimeObservationEditHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/TimeObservationEditHelper.java
index 418bc5d6a01..1d351c04388 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/TimeObservationEditHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/TimeObservationEditHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/UMLBaseEditHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/UMLBaseEditHelper.java
index 715cbdae3f0..af5d84ab8ae 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/UMLBaseEditHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/UMLBaseEditHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -25,11 +25,12 @@ import org.eclipse.uml2.uml.Element;
*/
public class UMLBaseEditHelper extends GeneratedEditHelperBase {
+ @Override
protected ICommand getDestroyElementCommand(DestroyElementRequest req) {
EObject elementToDestroy = req.getElementToDestroy();
- if(elementToDestroy instanceof Element) {
- UnapplyAllStereotypesCommand command = new UnapplyAllStereotypesCommand(req.getEditingDomain(), req.getLabel(), (Element)elementToDestroy);
- if(!command.isEmpty()) {
+ if (elementToDestroy instanceof Element) {
+ UnapplyAllStereotypesCommand command = new UnapplyAllStereotypesCommand(req.getEditingDomain(), req.getLabel(), (Element) elementToDestroy);
+ if (!command.isEmpty()) {
return command;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ActionExecutionSpecificationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ActionExecutionSpecificationEditPart.java
index 6e0c09bed61..f744d94cf7d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ActionExecutionSpecificationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ActionExecutionSpecificationEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -94,9 +94,10 @@ public class ActionExecutionSpecificationEditPart extends AbstractExecutionSpeci
/**
* Papyrus codeGen
- *
+ *
* @generated
**/
+ @Override
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
}
@@ -107,18 +108,21 @@ public class ActionExecutionSpecificationEditPart extends AbstractExecutionSpeci
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) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
}
+ @Override
protected Command getMoveChildrenCommand(Request request) {
return null;
}
+ @Override
protected Command getCreateCommand(CreateRequest request) {
return null;
}
@@ -136,16 +140,18 @@ public class ActionExecutionSpecificationEditPart extends AbstractExecutionSpeci
/**
* @generated
*/
+ @Override
public AbstractExecutionSpecificationEditPart.ExecutionSpecificationRectangleFigure getPrimaryShape() {
- return (AbstractExecutionSpecificationEditPart.ExecutionSpecificationRectangleFigure)primaryShape;
+ return (AbstractExecutionSpecificationEditPart.ExecutionSpecificationRectangleFigure) primaryShape;
}
/**
* Overrides to disable the defaultAnchorArea. The edge is now more stuck with the middle of the
* figure.
- *
+ *
* @generated
*/
+ @Override
protected NodeFigure createNodePlate() {
String prefElementId = "ActionExecutionSpecification";
IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
@@ -161,8 +167,8 @@ public class ActionExecutionSpecificationEditPart extends AbstractExecutionSpeci
@Override
public EditPolicy getPrimaryDragEditPolicy() {
EditPolicy result = super.getPrimaryDragEditPolicy();
- if(result instanceof ResizableEditPolicy) {
- ResizableEditPolicy ep = (ResizableEditPolicy)result;
+ if (result instanceof ResizableEditPolicy) {
+ ResizableEditPolicy ep = (ResizableEditPolicy) result;
ep.setResizeDirections(PositionConstants.NORTH | PositionConstants.SOUTH);
}
return result;
@@ -170,10 +176,10 @@ public class ActionExecutionSpecificationEditPart extends AbstractExecutionSpeci
/**
* 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
@@ -189,9 +195,9 @@ public class ActionExecutionSpecificationEditPart extends AbstractExecutionSpeci
/**
* Default implementation treats passed figure as content pane. Respects layout one may have set
* for generated figure.
- *
+ *
* @param nodeShape
- * instance of generated figure class
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
@@ -203,7 +209,7 @@ public class ActionExecutionSpecificationEditPart extends AbstractExecutionSpeci
*/
@Override
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -214,7 +220,7 @@ public class ActionExecutionSpecificationEditPart extends AbstractExecutionSpeci
*/
@Override
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -222,28 +228,29 @@ public class ActionExecutionSpecificationEditPart extends AbstractExecutionSpeci
/**
* @generated
*/
+ @Override
protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineWidth(width);
}
}
- // /**
- // * @generated
- // */
- // @Override
- // protected void setLineWidth(int width) {
- // if(primaryShape instanceof Shape) {
- // ((Shape)primaryShape).setLineWidth(width);
- // }
- // }
+ // /**
+ // * @generated
+ // */
+ // @Override
+ // protected void setLineWidth(int width) {
+ // if(primaryShape instanceof Shape) {
+ // ((Shape)primaryShape).setLineWidth(width);
+ // }
+ // }
/**
* @generated
*/
@Override
protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineStyle(style);
}
}
@@ -267,403 +274,403 @@ public class ActionExecutionSpecificationEditPart extends AbstractExecutionSpeci
*/
public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
return types;
@@ -674,7 +681,7 @@ public class ActionExecutionSpecificationEditPart extends AbstractExecutionSpeci
*/
public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -694,7 +701,7 @@ public class ActionExecutionSpecificationEditPart extends AbstractExecutionSpeci
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -714,7 +721,7 @@ public class ActionExecutionSpecificationEditPart extends AbstractExecutionSpeci
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -734,7 +741,7 @@ public class ActionExecutionSpecificationEditPart extends AbstractExecutionSpeci
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -754,7 +761,7 @@ public class ActionExecutionSpecificationEditPart extends AbstractExecutionSpeci
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -774,7 +781,7 @@ public class ActionExecutionSpecificationEditPart extends AbstractExecutionSpeci
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -794,7 +801,7 @@ public class ActionExecutionSpecificationEditPart extends AbstractExecutionSpeci
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -840,7 +847,7 @@ public class ActionExecutionSpecificationEditPart extends AbstractExecutionSpeci
*/
public List<IElementType> getMATypesForSource(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -860,7 +867,7 @@ public class ActionExecutionSpecificationEditPart extends AbstractExecutionSpeci
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -880,7 +887,7 @@ public class ActionExecutionSpecificationEditPart extends AbstractExecutionSpeci
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -900,7 +907,7 @@ public class ActionExecutionSpecificationEditPart extends AbstractExecutionSpeci
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -920,7 +927,7 @@ public class ActionExecutionSpecificationEditPart extends AbstractExecutionSpeci
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -940,7 +947,7 @@ public class ActionExecutionSpecificationEditPart extends AbstractExecutionSpeci
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -960,7 +967,7 @@ public class ActionExecutionSpecificationEditPart extends AbstractExecutionSpeci
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -980,9 +987,9 @@ public class ActionExecutionSpecificationEditPart extends AbstractExecutionSpeci
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
+ } else if (relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
types.add(UMLElementTypes.Comment_3009);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
+ } else if (relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
types.add(UMLElementTypes.TimeConstraint_3019);
types.add(UMLElementTypes.DurationConstraint_3021);
types.add(UMLElementTypes.Constraint_3008);
@@ -991,47 +998,47 @@ public class ActionExecutionSpecificationEditPart extends AbstractExecutionSpeci
return types;
}
- // /**
- // * @generated
- // */
- // public class ExecutionSpecificationRectangleFigure extends RectangleFigure {
+ // /**
+ // * @generated
+ // */
+ // public class ExecutionSpecificationRectangleFigure extends RectangleFigure {
//
- // /**
- // * @generated
- // */
- // public ExecutionSpecificationRectangleFigure() {
- // this.setPreferredSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(60)));
- // this.setMinimumSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(20)));
- // }
+ // /**
+ // * @generated
+ // */
+ // public ExecutionSpecificationRectangleFigure() {
+ // this.setPreferredSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(60)));
+ // this.setMinimumSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(20)));
+ // }
//
- // }
+ // }
/**
* @generated
*/
@Override
public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ IPreferenceStore preferenceStore = (IPreferenceStore) getDiagramPreferencesHint().getPreferenceStore();
Object result = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("ActionExecutionSpecification", PreferencesConstantsHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("ActionExecutionSpecification", PreferencesConstantsHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("ActionExecutionSpecification", PreferencesConstantsHelper.COLOR_FILL);
}
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor(preferenceStore, prefColor));
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
String prefGradient = PreferencesConstantsHelper.getElementConstant("ActionExecutionSpecification", PreferencesConstantsHelper.COLOR_GRADIENT);
GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
result = gradientPreferenceConverter.getGradientData();
}
}
- if(result == null) {
+ if (result == null) {
result = getStructuralFeatureValue(feature);
}
return result;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ActionExecutionSpecificationNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ActionExecutionSpecificationNameEditPart.java
index 163d4ac8b09..88bae6589e8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ActionExecutionSpecificationNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ActionExecutionSpecificationNameEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -120,23 +120,27 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableEditPolicy() {
+ @Override
protected List createSelectionHandles() {
List handles = new ArrayList();
- NonResizableHandleKit.addMoveHandle((GraphicalEditPart)getHost(), handles);
- ((MoveHandle)handles.get(0)).setBorder(null);
+ NonResizableHandleKit.addMoveHandle((GraphicalEditPart) getHost(), handles);
+ ((MoveHandle) handles.get(0)).setBorder(null);
return handles;
}
+ @Override
public Command getCommand(Request request) {
return null;
}
+ @Override
public boolean understandsRequest(Request request) {
return false;
}
@@ -147,10 +151,10 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,10 +162,10 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -169,10 +173,10 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -180,10 +184,10 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -201,6 +205,7 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -208,6 +213,7 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -232,10 +238,10 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -244,23 +250,25 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -276,21 +284,24 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -304,8 +315,9 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -314,6 +326,7 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -321,8 +334,9 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.ActionExecutionSpecification_3006, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ActionExecutionSpecificationNameEditPart.VISUAL_ID));
}
return parser;
@@ -332,7 +346,7 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -356,8 +370,8 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager().getClass() == TextDirectEditManager.class) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -365,8 +379,8 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -375,23 +389,24 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@@ -409,13 +424,14 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -435,6 +451,7 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -449,17 +466,17 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -467,9 +484,9 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
}
@@ -477,18 +494,19 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -497,6 +515,7 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -504,12 +523,13 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -519,9 +539,10 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -532,10 +553,12 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -553,17 +576,17 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see
* org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
// not a named element. no specific editor => do nothing
@@ -572,12 +595,12 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -585,7 +608,7 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -595,13 +618,13 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -614,31 +637,32 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -654,6 +678,7 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
/**
* @generated
*/
+ @Override
protected void addNotationalListeners() {
super.addNotationalListeners();
addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
@@ -662,6 +687,7 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
/**
* @generated
*/
+ @Override
protected void removeNotationalListeners() {
super.removeNotationalListeners();
removeListenerFilter("PrimaryView"); //$NON-NLS-1$
@@ -670,27 +696,29 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -703,6 +731,7 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
@@ -713,6 +742,7 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
/**
* @generated
*/
+ @Override
public void activate() {
super.activate();
addOwnerElementListeners();
@@ -722,12 +752,13 @@ public class ActionExecutionSpecificationNameEditPart extends CompartmentEditPar
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
}
/**
* @generated
*/
+ @Override
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/BehaviorExecutionSpecificationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/BehaviorExecutionSpecificationEditPart.java
index 88a0058398a..bbe81425cf0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/BehaviorExecutionSpecificationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/BehaviorExecutionSpecificationEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -94,9 +94,10 @@ public class BehaviorExecutionSpecificationEditPart extends AbstractExecutionSpe
/**
* Papyrus codeGen
- *
+ *
* @generated
**/
+ @Override
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
}
@@ -107,18 +108,21 @@ public class BehaviorExecutionSpecificationEditPart extends AbstractExecutionSpe
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) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
}
+ @Override
protected Command getMoveChildrenCommand(Request request) {
return null;
}
+ @Override
protected Command getCreateCommand(CreateRequest request) {
return null;
}
@@ -136,16 +140,18 @@ public class BehaviorExecutionSpecificationEditPart extends AbstractExecutionSpe
/**
* @generated
*/
+ @Override
public AbstractExecutionSpecificationEditPart.ExecutionSpecificationRectangleFigure getPrimaryShape() {
- return (AbstractExecutionSpecificationEditPart.ExecutionSpecificationRectangleFigure)primaryShape;
+ return (AbstractExecutionSpecificationEditPart.ExecutionSpecificationRectangleFigure) primaryShape;
}
/**
* Overrides to disable the defaultAnchorArea. The edge is no more stuck with the middle of the
* figure.
- *
+ *
* @generated
*/
+ @Override
protected NodeFigure createNodePlate() {
String prefElementId = "BehaviorExecutionSpecification";
IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
@@ -161,8 +167,8 @@ public class BehaviorExecutionSpecificationEditPart extends AbstractExecutionSpe
@Override
public EditPolicy getPrimaryDragEditPolicy() {
EditPolicy result = super.getPrimaryDragEditPolicy();
- if(result instanceof ResizableEditPolicy) {
- ResizableEditPolicy ep = (ResizableEditPolicy)result;
+ if (result instanceof ResizableEditPolicy) {
+ ResizableEditPolicy ep = (ResizableEditPolicy) result;
ep.setResizeDirections(PositionConstants.NORTH | PositionConstants.SOUTH);
}
return result;
@@ -170,10 +176,10 @@ public class BehaviorExecutionSpecificationEditPart extends AbstractExecutionSpe
/**
* 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
@@ -189,9 +195,9 @@ public class BehaviorExecutionSpecificationEditPart extends AbstractExecutionSpe
/**
* Default implementation treats passed figure as content pane. Respects layout one may have set
* for generated figure.
- *
+ *
* @param nodeShape
- * instance of generated figure class
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
@@ -203,7 +209,7 @@ public class BehaviorExecutionSpecificationEditPart extends AbstractExecutionSpe
*/
@Override
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -214,7 +220,7 @@ public class BehaviorExecutionSpecificationEditPart extends AbstractExecutionSpe
*/
@Override
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -222,28 +228,29 @@ public class BehaviorExecutionSpecificationEditPart extends AbstractExecutionSpe
/**
* @generated
*/
+ @Override
protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineWidth(width);
}
}
- // /**
- // * @generated
- // */
- // @Override
- // protected void setLineWidth(int width) {
- // if(primaryShape instanceof Shape) {
- // ((Shape)primaryShape).setLineWidth(width);
- // }
- // }
+ // /**
+ // * @generated
+ // */
+ // @Override
+ // protected void setLineWidth(int width) {
+ // if(primaryShape instanceof Shape) {
+ // ((Shape)primaryShape).setLineWidth(width);
+ // }
+ // }
/**
* @generated
*/
@Override
protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineStyle(style);
}
}
@@ -267,403 +274,403 @@ public class BehaviorExecutionSpecificationEditPart extends AbstractExecutionSpe
*/
public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
return types;
@@ -674,7 +681,7 @@ public class BehaviorExecutionSpecificationEditPart extends AbstractExecutionSpe
*/
public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -694,7 +701,7 @@ public class BehaviorExecutionSpecificationEditPart extends AbstractExecutionSpe
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -714,7 +721,7 @@ public class BehaviorExecutionSpecificationEditPart extends AbstractExecutionSpe
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -734,7 +741,7 @@ public class BehaviorExecutionSpecificationEditPart extends AbstractExecutionSpe
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -754,7 +761,7 @@ public class BehaviorExecutionSpecificationEditPart extends AbstractExecutionSpe
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -774,7 +781,7 @@ public class BehaviorExecutionSpecificationEditPart extends AbstractExecutionSpe
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -794,7 +801,7 @@ public class BehaviorExecutionSpecificationEditPart extends AbstractExecutionSpe
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -840,7 +847,7 @@ public class BehaviorExecutionSpecificationEditPart extends AbstractExecutionSpe
*/
public List<IElementType> getMATypesForSource(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -860,7 +867,7 @@ public class BehaviorExecutionSpecificationEditPart extends AbstractExecutionSpe
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -880,7 +887,7 @@ public class BehaviorExecutionSpecificationEditPart extends AbstractExecutionSpe
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -900,7 +907,7 @@ public class BehaviorExecutionSpecificationEditPart extends AbstractExecutionSpe
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -920,7 +927,7 @@ public class BehaviorExecutionSpecificationEditPart extends AbstractExecutionSpe
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -940,7 +947,7 @@ public class BehaviorExecutionSpecificationEditPart extends AbstractExecutionSpe
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -960,7 +967,7 @@ public class BehaviorExecutionSpecificationEditPart extends AbstractExecutionSpe
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -980,9 +987,9 @@ public class BehaviorExecutionSpecificationEditPart extends AbstractExecutionSpe
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
+ } else if (relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
types.add(UMLElementTypes.Comment_3009);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
+ } else if (relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
types.add(UMLElementTypes.TimeConstraint_3019);
types.add(UMLElementTypes.DurationConstraint_3021);
types.add(UMLElementTypes.Constraint_3008);
@@ -991,47 +998,47 @@ public class BehaviorExecutionSpecificationEditPart extends AbstractExecutionSpe
return types;
}
- // /**
- // * @generated
- // */
- // public class ExecutionSpecificationRectangleFigure extends RectangleFigure {
+ // /**
+ // * @generated
+ // */
+ // public class ExecutionSpecificationRectangleFigure extends RectangleFigure {
//
- // /**
- // * @generated
- // */
- // public ExecutionSpecificationRectangleFigure() {
- // this.setPreferredSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(60)));
- // this.setMinimumSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(20)));
- // }
+ // /**
+ // * @generated
+ // */
+ // public ExecutionSpecificationRectangleFigure() {
+ // this.setPreferredSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(60)));
+ // this.setMinimumSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(20)));
+ // }
//
- // }
+ // }
/**
* @generated
*/
@Override
public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ IPreferenceStore preferenceStore = (IPreferenceStore) getDiagramPreferencesHint().getPreferenceStore();
Object result = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("BehaviorExecutionSpecification", PreferencesConstantsHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("BehaviorExecutionSpecification", PreferencesConstantsHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("BehaviorExecutionSpecification", PreferencesConstantsHelper.COLOR_FILL);
}
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor(preferenceStore, prefColor));
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
String prefGradient = PreferencesConstantsHelper.getElementConstant("BehaviorExecutionSpecification", PreferencesConstantsHelper.COLOR_GRADIENT);
GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
result = gradientPreferenceConverter.getGradientData();
}
}
- if(result == null) {
+ if (result == null) {
result = getStructuralFeatureValue(feature);
}
return result;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CombinedFragment2EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CombinedFragment2EditPart.java
index b472cb1130f..b2e702e23ba 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CombinedFragment2EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CombinedFragment2EditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -79,6 +79,7 @@ public class CombinedFragment2EditPart extends ShapeNodeEditPart {
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CombinedFragment2ItemSemanticEditPolicy());
@@ -94,18 +95,21 @@ public class CombinedFragment2EditPart extends ShapeNodeEditPart {
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) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
}
+ @Override
protected Command getMoveChildrenCommand(Request request) {
return null;
}
+ @Override
protected Command getCreateCommand(CreateRequest request) {
return null;
}
@@ -124,7 +128,7 @@ public class CombinedFragment2EditPart extends ShapeNodeEditPart {
* @generated
*/
public CoRegionCombinedFragmentFigure getPrimaryShape() {
- return (CoRegionCombinedFragmentFigure)primaryShape;
+ return (CoRegionCombinedFragmentFigure) primaryShape;
}
/**
@@ -141,12 +145,13 @@ public class CombinedFragment2EditPart extends ShapeNodeEditPart {
/**
* 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() {
NodeFigure figure = createNodePlate();
figure.setLayoutManager(new StackLayout());
@@ -159,9 +164,9 @@ public class CombinedFragment2EditPart extends ShapeNodeEditPart {
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- *
+ *
* @param nodeShape
- * instance of generated figure class
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
@@ -171,8 +176,9 @@ public class CombinedFragment2EditPart extends ShapeNodeEditPart {
/**
* @generated
*/
+ @Override
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -181,8 +187,9 @@ public class CombinedFragment2EditPart extends ShapeNodeEditPart {
/**
* @generated
*/
+ @Override
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -190,18 +197,20 @@ public class CombinedFragment2EditPart extends ShapeNodeEditPart {
/**
* @generated
*/
+ @Override
protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineWidth(width);
}
}
/**
* @generated
*/
+ @Override
protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineStyle(style);
}
}
@@ -225,403 +234,403 @@ public class CombinedFragment2EditPart extends ShapeNodeEditPart {
*/
public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragment2EditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragment2EditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragment2EditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragment2EditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragment2EditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragment2EditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragment2EditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
return types;
@@ -632,7 +641,7 @@ public class CombinedFragment2EditPart extends ShapeNodeEditPart {
*/
public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -652,7 +661,7 @@ public class CombinedFragment2EditPart extends ShapeNodeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -672,7 +681,7 @@ public class CombinedFragment2EditPart extends ShapeNodeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -692,7 +701,7 @@ public class CombinedFragment2EditPart extends ShapeNodeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -712,7 +721,7 @@ public class CombinedFragment2EditPart extends ShapeNodeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -732,7 +741,7 @@ public class CombinedFragment2EditPart extends ShapeNodeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -752,7 +761,7 @@ public class CombinedFragment2EditPart extends ShapeNodeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -798,7 +807,7 @@ public class CombinedFragment2EditPart extends ShapeNodeEditPart {
*/
public List<IElementType> getMATypesForSource(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -818,7 +827,7 @@ public class CombinedFragment2EditPart extends ShapeNodeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -838,7 +847,7 @@ public class CombinedFragment2EditPart extends ShapeNodeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -858,7 +867,7 @@ public class CombinedFragment2EditPart extends ShapeNodeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -878,7 +887,7 @@ public class CombinedFragment2EditPart extends ShapeNodeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -898,7 +907,7 @@ public class CombinedFragment2EditPart extends ShapeNodeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -918,7 +927,7 @@ public class CombinedFragment2EditPart extends ShapeNodeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -938,9 +947,9 @@ public class CombinedFragment2EditPart extends ShapeNodeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
+ } else if (relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
types.add(UMLElementTypes.Comment_3009);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
+ } else if (relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
types.add(UMLElementTypes.TimeConstraint_3019);
types.add(UMLElementTypes.DurationConstraint_3021);
types.add(UMLElementTypes.Constraint_3008);
@@ -954,28 +963,28 @@ public class CombinedFragment2EditPart extends ShapeNodeEditPart {
*/
@Override
public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ IPreferenceStore preferenceStore = (IPreferenceStore) getDiagramPreferencesHint().getPreferenceStore();
Object result = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("CombinedFragment", PreferencesConstantsHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("CombinedFragment", PreferencesConstantsHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("CombinedFragment", PreferencesConstantsHelper.COLOR_FILL);
}
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor(preferenceStore, prefColor));
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
String prefGradient = PreferencesConstantsHelper.getElementConstant("CombinedFragment", PreferencesConstantsHelper.COLOR_GRADIENT);
GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
result = gradientPreferenceConverter.getGradientData();
}
}
- if(result == null) {
+ if (result == null) {
result = getStructuralFeatureValue(feature);
}
return result;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CombinedFragmentCombinedFragmentCompartmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CombinedFragmentCombinedFragmentCompartmentEditPart.java
index e8cf98635b8..0f39c80f10c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CombinedFragmentCombinedFragmentCompartmentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CombinedFragmentCombinedFragmentCompartmentEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -51,6 +51,7 @@ public class CombinedFragmentCombinedFragmentCompartmentEditPart extends ListCom
/**
* @generated
*/
+ @Override
protected boolean hasModelChildrenChanged(Notification evt) {
return false;
}
@@ -58,41 +59,45 @@ public class CombinedFragmentCombinedFragmentCompartmentEditPart extends ListCom
/**
* @generated
*/
+ @Override
public String getCompartmentName() {
return Messages.CombinedFragmentCombinedFragmentCompartmentEditPart_title;
}
/**
* Not generated for delete borders add stretch children figures.
- *
+ *
* @generated
*/
+ @Override
public IFigure createFigure() {
- ResizableCompartmentFigure result = (ResizableCompartmentFigure)super.createFigure();
+ ResizableCompartmentFigure result = (ResizableCompartmentFigure) super.createFigure();
result.setTitleVisibility(false);
return result;
}
/**
* Add RemoveOrphanView role
- *
+ *
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CombinedFragmentCombinedFragmentCompartmentItemSemanticEditPolicy());
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new PapyrusCreationEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(DuplicatePasteEditPolicy.PASTE_ROLE, new DuplicatePasteEditPolicy());
- //in Papyrus diagrams are not strongly synchronised
- //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.sequence.edit.policies.CombinedFragmentCombinedFragmentCompartmentCanonicalEditPolicy());
+ // in Papyrus diagrams are not strongly synchronised
+ // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.sequence.edit.policies.CombinedFragmentCombinedFragmentCompartmentCanonicalEditPolicy());
}
/**
* @generated
*/
+ @Override
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -100,9 +105,10 @@ public class CombinedFragmentCombinedFragmentCompartmentEditPart extends ListCom
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -112,18 +118,19 @@ public class CombinedFragmentCombinedFragmentCompartmentEditPart extends ListCom
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
}
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshBounds();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CombinedFragmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CombinedFragmentEditPart.java
index 41d17cc3814..dd9ee802dd9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CombinedFragmentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CombinedFragmentEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -86,6 +86,7 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new PapyrusCreationEditPolicy());
super.createDefaultEditPolicies();
@@ -100,9 +101,10 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
/**
* Papyrus codeGen
- *
+ *
* @generated
**/
+ @Override
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
}
@@ -113,18 +115,21 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
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) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
}
+ @Override
protected Command getMoveChildrenCommand(Request request) {
return null;
}
+ @Override
protected Command getCreateCommand(CreateRequest request) {
return null;
}
@@ -134,7 +139,7 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
/**
* Generated not for handle operator kind
- *
+ *
* @generated
*/
protected IFigure createNodeShape() {
@@ -145,17 +150,17 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
* @generated
*/
public CombinedFragmentFigure getPrimaryShape() {
- return (CombinedFragmentFigure)primaryShape;
+ return (CombinedFragmentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CombinedFragmentCombinedFragmentCompartmentEditPart) {
+ if (childEditPart instanceof CombinedFragmentCombinedFragmentCompartmentEditPart) {
IFigure pane = getPrimaryShape().getCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((CombinedFragmentCombinedFragmentCompartmentEditPart)childEditPart).getFigure());
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((CombinedFragmentCombinedFragmentCompartmentEditPart) childEditPart).getFigure());
return true;
}
return false;
@@ -165,9 +170,9 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CombinedFragmentCombinedFragmentCompartmentEditPart) {
+ if (childEditPart instanceof CombinedFragmentCombinedFragmentCompartmentEditPart) {
IFigure pane = getPrimaryShape().getCompartmentFigure();
- pane.remove(((CombinedFragmentCombinedFragmentCompartmentEditPart)childEditPart).getFigure());
+ pane.remove(((CombinedFragmentCombinedFragmentCompartmentEditPart) childEditPart).getFigure());
return true;
}
return false;
@@ -176,8 +181,9 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
/**
* @generated
*/
+ @Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -186,8 +192,9 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
/**
* @generated
*/
+ @Override
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -196,8 +203,9 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
/**
* @generated
*/
+ @Override
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof CombinedFragmentCombinedFragmentCompartmentEditPart) {
+ if (editPart instanceof CombinedFragmentCombinedFragmentCompartmentEditPart) {
return getPrimaryShape().getCompartmentFigure();
}
return getContentPane();
@@ -217,12 +225,13 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
/**
* 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() {
NodeFigure figure = createNodePlate();
figure.setLayoutManager(new StackLayout());
@@ -235,13 +244,13 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
/**
* Default implementation treats passed figure as content pane. Respects layout one may have set
* for generated figure.
- *
+ *
* @param nodeShape
- * instance of generated figure class
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -252,8 +261,9 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
/**
* @generated
*/
+ @Override
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -262,8 +272,9 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
/**
* @generated
*/
+ @Override
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -271,18 +282,20 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
/**
* @generated
*/
+ @Override
protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineWidth(width);
}
}
/**
* @generated
*/
+ @Override
protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineStyle(style);
}
}
@@ -291,28 +304,28 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
*/
@Override
public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ IPreferenceStore preferenceStore = (IPreferenceStore) getDiagramPreferencesHint().getPreferenceStore();
Object result = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("CombinedFragment", PreferencesConstantsHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("CombinedFragment", PreferencesConstantsHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("CombinedFragment", PreferencesConstantsHelper.COLOR_FILL);
}
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor(preferenceStore, prefColor));
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
String prefGradient = PreferencesConstantsHelper.getElementConstant("CombinedFragment", PreferencesConstantsHelper.COLOR_GRADIENT);
GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
result = gradientPreferenceConverter.getGradientData();
}
}
- if(result == null) {
+ if (result == null) {
result = getStructuralFeatureValue(feature);
}
return result;
@@ -338,403 +351,403 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
*/
public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
return types;
@@ -745,7 +758,7 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
*/
public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -765,7 +778,7 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -785,7 +798,7 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -805,7 +818,7 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -825,7 +838,7 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -845,7 +858,7 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -865,7 +878,7 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -911,7 +924,7 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
*/
public List<IElementType> getMATypesForSource(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -931,7 +944,7 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -951,7 +964,7 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -971,7 +984,7 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -991,7 +1004,7 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1011,7 +1024,7 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1031,7 +1044,7 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1051,9 +1064,9 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
+ } else if (relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
types.add(UMLElementTypes.Comment_3009);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
+ } else if (relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
types.add(UMLElementTypes.TimeConstraint_3019);
types.add(UMLElementTypes.DurationConstraint_3021);
types.add(UMLElementTypes.Constraint_3008);
@@ -1065,11 +1078,12 @@ public class CombinedFragmentEditPart extends InteractionFragmentEditPart {
/**
* @generated
*/
+ @Override
public EditPart getTargetEditPart(Request request) {
- if(request instanceof CreateViewAndElementRequest) {
- CreateElementRequestAdapter adapter = ((CreateViewAndElementRequest)request).getViewAndElementDescriptor().getCreateElementRequestAdapter();
- IElementType type = (IElementType)adapter.getAdapter(IElementType.class);
- if(type == UMLElementTypes.InteractionOperand_3005) {
+ if (request instanceof CreateViewAndElementRequest) {
+ CreateElementRequestAdapter adapter = ((CreateViewAndElementRequest) request).getViewAndElementDescriptor().getCreateElementRequestAdapter();
+ IElementType type = (IElementType) adapter.getAdapter(IElementType.class);
+ if (type == UMLElementTypes.InteractionOperand_3005) {
return getChildBySemanticHint(UMLVisualIDRegistry.getType(CombinedFragmentCombinedFragmentCompartmentEditPart.VISUAL_ID));
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CommentAnnotatedElementEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CommentAnnotatedElementEditPart.java
index 4e1ad7fa184..f09c78c1dee 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CommentAnnotatedElementEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CommentAnnotatedElementEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -39,6 +39,7 @@ public class CommentAnnotatedElementEditPart extends AnnotatedLinkEditPart imple
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CommentAnnotatedElementItemSemanticEditPolicy());
@@ -46,12 +47,13 @@ public class CommentAnnotatedElementEditPart extends AnnotatedLinkEditPart imple
/**
* 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 Connection createConnectionFigure() {
return new AnnotatedLinkEditPart.AnnotatedLinkDescriptor();
}
@@ -59,7 +61,8 @@ public class CommentAnnotatedElementEditPart extends AnnotatedLinkEditPart imple
/**
* @generated
*/
+ @Override
public AnnotatedLinkEditPart.AnnotatedLinkDescriptor getPrimaryShape() {
- return (AnnotatedLinkEditPart.AnnotatedLinkDescriptor)getFigure();
+ return (AnnotatedLinkEditPart.AnnotatedLinkDescriptor) getFigure();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CommentBodyEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CommentBodyEditPart.java
index 3b6b5f042b9..950694277ba 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CommentBodyEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CommentBodyEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -109,14 +109,14 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -131,6 +131,7 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
@@ -142,12 +143,12 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -155,12 +156,12 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -168,12 +169,12 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -181,12 +182,12 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -204,6 +205,7 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -211,6 +213,7 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -235,10 +238,10 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -247,23 +250,25 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -279,21 +284,24 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -307,8 +315,9 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -317,6 +326,7 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -324,8 +334,9 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Comment_3009, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentBodyEditPart.VISUAL_ID));
}
return parser;
@@ -335,7 +346,7 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -359,8 +370,8 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -368,8 +379,8 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -378,41 +389,42 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -424,13 +436,14 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -450,6 +463,7 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -464,17 +478,17 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -482,15 +496,15 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -499,18 +513,19 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -519,6 +534,7 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -526,12 +542,13 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -541,9 +558,10 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -554,10 +572,12 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -570,21 +590,21 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
private View getFontStyleOwnerView() {
- return (View)getModel();
+ return (View) getModel();
}
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
// not a named element. no specific editor => do nothing
@@ -593,12 +613,12 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -606,7 +626,7 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -616,13 +636,13 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -632,23 +652,23 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -656,13 +676,14 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -678,6 +699,7 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
protected void addNotationalListeners() {
super.addNotationalListeners();
addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
@@ -686,6 +708,7 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
protected void removeNotationalListeners() {
super.removeNotationalListeners();
removeListenerFilter("PrimaryView"); //$NON-NLS-1$
@@ -694,27 +717,29 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -727,6 +752,7 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
@@ -740,6 +766,7 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
public void activate() {
super.activate();
addOwnerElementListeners();
@@ -749,12 +776,13 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
}
/**
* @generated
*/
+ @Override
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CommentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CommentEditPart.java
index 2be64d48b69..7995b27f533 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CommentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CommentEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -83,6 +83,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CommentItemSemanticEditPolicy());
@@ -95,9 +96,10 @@ public class CommentEditPart extends AbstractCommentEditPart {
/**
* Papyrus codeGen
- *
+ *
* @generated
**/
+ @Override
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
}
@@ -108,18 +110,21 @@ public class CommentEditPart extends AbstractCommentEditPart {
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) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
}
+ @Override
protected Command getMoveChildrenCommand(Request request) {
return null;
}
+ @Override
protected Command getCreateCommand(CreateRequest request) {
return null;
}
@@ -130,6 +135,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
/**
* @generated
*/
+ @Override
protected IFigure createNodeShape() {
return primaryShape = new HTMLCornerBentFigure();
}
@@ -137,16 +143,17 @@ public class CommentEditPart extends AbstractCommentEditPart {
/**
* @generated
*/
+ @Override
public HTMLCornerBentFigure getPrimaryShape() {
- return (HTMLCornerBentFigure)primaryShape;
+ return (HTMLCornerBentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CommentBodyEditPart) {
- ((CommentBodyEditPart)childEditPart).setLabel(getPrimaryShape().getCornerBentFigure());
+ if (childEditPart instanceof CommentBodyEditPart) {
+ ((CommentBodyEditPart) childEditPart).setLabel(getPrimaryShape().getCornerBentFigure());
return true;
}
return false;
@@ -156,7 +163,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CommentBodyEditPart) {
+ if (childEditPart instanceof CommentBodyEditPart) {
return true;
}
return false;
@@ -165,8 +172,9 @@ public class CommentEditPart extends AbstractCommentEditPart {
/**
* @generated
*/
+ @Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -175,8 +183,9 @@ public class CommentEditPart extends AbstractCommentEditPart {
/**
* @generated
*/
+ @Override
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -185,6 +194,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
/**
* @generated
*/
+ @Override
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
return getContentPane();
}
@@ -192,6 +202,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
/**
* @generated
*/
+ @Override
protected NodeFigure createNodePlate() {
String prefElementId = "Comment";
IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
@@ -203,12 +214,13 @@ public class CommentEditPart extends AbstractCommentEditPart {
/**
* 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() {
NodeFigure figure = createNodePlate();
figure.setLayoutManager(new StackLayout());
@@ -221,13 +233,14 @@ public class CommentEditPart extends AbstractCommentEditPart {
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- *
+ *
* @param nodeShape
- * instance of generated figure class
+ * instance of generated figure class
* @generated
*/
+ @Override
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -238,8 +251,9 @@ public class CommentEditPart extends AbstractCommentEditPart {
/**
* @generated
*/
+ @Override
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -248,8 +262,9 @@ public class CommentEditPart extends AbstractCommentEditPart {
/**
* @generated
*/
+ @Override
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -257,24 +272,27 @@ public class CommentEditPart extends AbstractCommentEditPart {
/**
* @generated
*/
+ @Override
protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineWidth(width);
}
}
/**
* @generated
*/
+ @Override
protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineStyle(style);
}
}
/**
* @generated
*/
+ @Override
public EditPart getPrimaryChildEditPart() {
return getChildBySemanticHint(UMLVisualIDRegistry.getType(CommentBodyEditPart.VISUAL_ID));
}
@@ -300,460 +318,460 @@ public class CommentEditPart extends AbstractCommentEditPart {
*/
public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.CommentAnnotatedElement_4010);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.CommentAnnotatedElement_4010);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.CommentAnnotatedElement_4010);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.CommentAnnotatedElement_4010);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.CommentAnnotatedElement_4010);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.CommentAnnotatedElement_4010);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.CommentAnnotatedElement_4010);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.CommentAnnotatedElement_4010);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.CommentAnnotatedElement_4010);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.CommentAnnotatedElement_4010);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.CommentAnnotatedElement_4010);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.CommentAnnotatedElement_4010);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.CommentAnnotatedElement_4010);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.CommentAnnotatedElement_4010);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.CommentAnnotatedElement_4010);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.CommentAnnotatedElement_4010);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentEditPart) {
types.add(UMLElementTypes.CommentAnnotatedElement_4010);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.CommentAnnotatedElement_4010);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.CommentAnnotatedElement_4010);
}
return types;
@@ -764,7 +782,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
*/
public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -784,7 +802,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -804,7 +822,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -824,7 +842,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -844,7 +862,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -864,7 +882,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -884,7 +902,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -904,7 +922,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
+ } else if (relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -950,7 +968,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
*/
public List<IElementType> getMATypesForSource(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -970,7 +988,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -990,7 +1008,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1010,7 +1028,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1030,7 +1048,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1050,7 +1068,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1070,7 +1088,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1090,9 +1108,9 @@ public class CommentEditPart extends AbstractCommentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
+ } else if (relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
types.add(UMLElementTypes.Comment_3009);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
+ } else if (relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
types.add(UMLElementTypes.TimeConstraint_3019);
types.add(UMLElementTypes.DurationConstraint_3021);
types.add(UMLElementTypes.Constraint_3008);
@@ -1106,28 +1124,28 @@ public class CommentEditPart extends AbstractCommentEditPart {
*/
@Override
public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ IPreferenceStore preferenceStore = (IPreferenceStore) getDiagramPreferencesHint().getPreferenceStore();
Object result = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("Comment", PreferencesConstantsHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("Comment", PreferencesConstantsHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("Comment", PreferencesConstantsHelper.COLOR_FILL);
}
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor(preferenceStore, prefColor));
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
String prefGradient = PreferencesConstantsHelper.getElementConstant("Comment", PreferencesConstantsHelper.COLOR_GRADIENT);
GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
result = gradientPreferenceConverter.getGradientData();
}
}
- if(result == null) {
+ if (result == null) {
result = getStructuralFeatureValue(feature);
}
return result;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConsiderIgnoreFragmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConsiderIgnoreFragmentEditPart.java
index 200663382c3..1b31bec2e53 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConsiderIgnoreFragmentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConsiderIgnoreFragmentEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -80,6 +80,7 @@ public class ConsiderIgnoreFragmentEditPart extends CombinedFragmentEditPart {
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ConsiderIgnoreFragmentItemSemanticEditPolicy());
@@ -92,9 +93,10 @@ public class ConsiderIgnoreFragmentEditPart extends CombinedFragmentEditPart {
/**
* Papyrus codeGen
- *
+ *
* @generated
**/
+ @Override
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
}
@@ -102,21 +104,25 @@ public class ConsiderIgnoreFragmentEditPart extends CombinedFragmentEditPart {
/**
* @generated
*/
+ @Override
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) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
}
+ @Override
protected Command getMoveChildrenCommand(Request request) {
return null;
}
+ @Override
protected Command getCreateCommand(CreateRequest request) {
return null;
}
@@ -126,25 +132,28 @@ public class ConsiderIgnoreFragmentEditPart extends CombinedFragmentEditPart {
/**
* {@inheritDoc}
- *
+ *
* @generated
*/
+ @Override
protected IFigure createNodeShape() {
return primaryShape = new CombinedFragmentFigure();
}
/**
* {@inheritDoc}
- *
+ *
* @generated
*/
+ @Override
public CombinedFragmentFigure getPrimaryShape() {
- return (CombinedFragmentFigure)primaryShape;
+ return (CombinedFragmentFigure) primaryShape;
}
/**
* @generated
*/
+ @Override
protected NodeFigure createNodePlate() {
String prefElementId = "ConsiderIgnoreFragment";
IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
@@ -156,12 +165,13 @@ public class ConsiderIgnoreFragmentEditPart extends CombinedFragmentEditPart {
/**
* 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() {
NodeFigure figure = createNodePlate();
figure.setLayoutManager(new StackLayout());
@@ -174,11 +184,12 @@ public class ConsiderIgnoreFragmentEditPart extends CombinedFragmentEditPart {
/**
* Default implementation treats passed figure as content pane. Respects layout one may have set
* for generated figure.
- *
+ *
* @param nodeShape
- * instance of generated figure class
+ * instance of generated figure class
* @generated
*/
+ @Override
protected IFigure setupContentPane(IFigure nodeShape) {
return nodeShape; // use nodeShape itself as contentPane
}
@@ -186,8 +197,9 @@ public class ConsiderIgnoreFragmentEditPart extends CombinedFragmentEditPart {
/**
* @generated
*/
+ @Override
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -196,8 +208,9 @@ public class ConsiderIgnoreFragmentEditPart extends CombinedFragmentEditPart {
/**
* @generated
*/
+ @Override
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -205,24 +218,27 @@ public class ConsiderIgnoreFragmentEditPart extends CombinedFragmentEditPart {
/**
* @generated
*/
+ @Override
protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineWidth(width);
}
}
/**
* @generated
*/
+ @Override
protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineStyle(style);
}
}
/**
* @generated
*/
+ @Override
public List<IElementType> getMARelTypesOnSource() {
ArrayList<IElementType> types = new ArrayList<IElementType>(7);
types.add(UMLElementTypes.Message_4003);
@@ -238,405 +254,406 @@ public class ConsiderIgnoreFragmentEditPart extends CombinedFragmentEditPart {
/**
* @generated
*/
+ @Override
public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
return types;
@@ -645,9 +662,10 @@ public class ConsiderIgnoreFragmentEditPart extends CombinedFragmentEditPart {
/**
* @generated
*/
+ @Override
public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -667,7 +685,7 @@ public class ConsiderIgnoreFragmentEditPart extends CombinedFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -687,7 +705,7 @@ public class ConsiderIgnoreFragmentEditPart extends CombinedFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -707,7 +725,7 @@ public class ConsiderIgnoreFragmentEditPart extends CombinedFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -727,7 +745,7 @@ public class ConsiderIgnoreFragmentEditPart extends CombinedFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -747,7 +765,7 @@ public class ConsiderIgnoreFragmentEditPart extends CombinedFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -767,7 +785,7 @@ public class ConsiderIgnoreFragmentEditPart extends CombinedFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -794,6 +812,7 @@ public class ConsiderIgnoreFragmentEditPart extends CombinedFragmentEditPart {
/**
* @generated
*/
+ @Override
public List<IElementType> getMARelTypesOnTarget() {
ArrayList<IElementType> types = new ArrayList<IElementType>(9);
types.add(UMLElementTypes.Message_4003);
@@ -811,9 +830,10 @@ public class ConsiderIgnoreFragmentEditPart extends CombinedFragmentEditPart {
/**
* @generated
*/
+ @Override
public List<IElementType> getMATypesForSource(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -833,7 +853,7 @@ public class ConsiderIgnoreFragmentEditPart extends CombinedFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -853,7 +873,7 @@ public class ConsiderIgnoreFragmentEditPart extends CombinedFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -873,7 +893,7 @@ public class ConsiderIgnoreFragmentEditPart extends CombinedFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -893,7 +913,7 @@ public class ConsiderIgnoreFragmentEditPart extends CombinedFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -913,7 +933,7 @@ public class ConsiderIgnoreFragmentEditPart extends CombinedFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -933,7 +953,7 @@ public class ConsiderIgnoreFragmentEditPart extends CombinedFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -953,9 +973,9 @@ public class ConsiderIgnoreFragmentEditPart extends CombinedFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
+ } else if (relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
types.add(UMLElementTypes.Comment_3009);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
+ } else if (relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
types.add(UMLElementTypes.TimeConstraint_3019);
types.add(UMLElementTypes.DurationConstraint_3021);
types.add(UMLElementTypes.Constraint_3008);
@@ -969,28 +989,28 @@ public class ConsiderIgnoreFragmentEditPart extends CombinedFragmentEditPart {
*/
@Override
public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ IPreferenceStore preferenceStore = (IPreferenceStore) getDiagramPreferencesHint().getPreferenceStore();
Object result = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("ConsiderIgnoreFragment", PreferencesConstantsHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("ConsiderIgnoreFragment", PreferencesConstantsHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("ConsiderIgnoreFragment", PreferencesConstantsHelper.COLOR_FILL);
}
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor(preferenceStore, prefColor));
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
String prefGradient = PreferencesConstantsHelper.getElementConstant("ConsiderIgnoreFragment", PreferencesConstantsHelper.COLOR_GRADIENT);
GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
result = gradientPreferenceConverter.getGradientData();
}
}
- if(result == null) {
+ if (result == null) {
result = getStructuralFeatureValue(feature);
}
return result;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Constraint2EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Constraint2EditPart.java
index a55a8a5edd1..b5b21b03723 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Constraint2EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Constraint2EditPart.java
@@ -96,14 +96,14 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -118,6 +118,7 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
@@ -129,12 +130,12 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -142,12 +143,12 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -155,12 +156,12 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -168,12 +169,12 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -191,6 +192,7 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -198,6 +200,7 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -222,10 +225,10 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -234,23 +237,25 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -266,21 +271,24 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -294,8 +302,9 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -304,6 +313,7 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -311,8 +321,9 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Constraint_3008, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Constraint2EditPart.VISUAL_ID));
}
return parser;
@@ -322,7 +333,7 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -346,8 +357,8 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -355,8 +366,8 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -365,41 +376,42 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -411,13 +423,14 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -437,6 +450,7 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -451,17 +465,17 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -469,15 +483,15 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -486,18 +500,19 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -506,6 +521,7 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -513,12 +529,13 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -528,9 +545,10 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -541,10 +559,12 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -562,16 +582,16 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
// not a named element. no specific editor => do nothing
@@ -580,12 +600,12 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -593,7 +613,7 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -603,13 +623,13 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -619,23 +639,23 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -643,13 +663,14 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -665,6 +686,7 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
protected void addNotationalListeners() {
super.addNotationalListeners();
addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
@@ -673,6 +695,7 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
protected void removeNotationalListeners() {
super.removeNotationalListeners();
removeListenerFilter("PrimaryView"); //$NON-NLS-1$
@@ -681,27 +704,29 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -714,6 +739,7 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
@@ -727,6 +753,7 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
/**
* @generated
*/
+ @Override
public void activate() {
super.activate();
addOwnerElementListeners();
@@ -736,12 +763,13 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
}
/**
* @generated
*/
+ @Override
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintConstrainedElementEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintConstrainedElementEditPart.java
index 2a2b38d3bce..2c117a811ca 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintConstrainedElementEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintConstrainedElementEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -39,6 +39,7 @@ public class ConstraintConstrainedElementEditPart extends AnnotatedLinkEditPart
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ConstraintConstrainedElementItemSemanticEditPolicy());
@@ -46,12 +47,13 @@ public class ConstraintConstrainedElementEditPart extends AnnotatedLinkEditPart
/**
* 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 Connection createConnectionFigure() {
return new AnnotatedLinkEditPart.AnnotatedLinkDescriptor();
}
@@ -59,7 +61,8 @@ public class ConstraintConstrainedElementEditPart extends AnnotatedLinkEditPart
/**
* @generated
*/
+ @Override
public AnnotatedLinkEditPart.AnnotatedLinkDescriptor getPrimaryShape() {
- return (AnnotatedLinkEditPart.AnnotatedLinkDescriptor)getFigure();
+ return (AnnotatedLinkEditPart.AnnotatedLinkDescriptor) getFigure();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintContextAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintContextAppliedStereotypeEditPart.java
index e22f4a431d0..2658427208c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintContextAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintContextAppliedStereotypeEditPart.java
@@ -97,14 +97,14 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -125,6 +125,7 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
@@ -136,6 +137,7 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
/**
* @generated
*/
+ @Override
public int getKeyPoint() {
return ConnectionLocator.MIDDLE;
}
@@ -144,12 +146,12 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -157,12 +159,12 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -170,12 +172,12 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -183,12 +185,12 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -206,6 +208,7 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -213,6 +216,7 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -237,10 +241,10 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -249,23 +253,25 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -281,21 +287,24 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -309,8 +318,9 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -319,6 +329,7 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -326,8 +337,9 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.ConstraintContext_8500, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintContextAppliedStereotypeEditPart.VISUAL_ID));
}
return parser;
@@ -337,7 +349,7 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -361,8 +373,8 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -370,8 +382,8 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -380,41 +392,42 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -426,13 +439,14 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -452,6 +466,7 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -466,17 +481,17 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -484,15 +499,15 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -501,18 +516,19 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -521,6 +537,7 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -528,12 +545,13 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -543,9 +561,10 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -556,10 +575,12 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -577,7 +598,7 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
@@ -588,12 +609,12 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -601,7 +622,7 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -611,13 +632,13 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -627,23 +648,23 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -651,13 +672,14 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -673,26 +695,28 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -705,6 +729,7 @@ public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEdit
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintEditPart.java
index 2da68dc045a..a0a15668995 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -83,6 +83,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ConstraintItemSemanticEditPolicy());
@@ -94,9 +95,10 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
/**
* Papyrus codeGen
- *
+ *
* @generated
**/
+ @Override
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
}
@@ -107,18 +109,21 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
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) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
}
+ @Override
protected Command getMoveChildrenCommand(Request request) {
return null;
}
+ @Override
protected Command getCreateCommand(CreateRequest request) {
return null;
}
@@ -129,6 +134,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
/**
* @generated
*/
+ @Override
protected IFigure createNodeShape() {
return primaryShape = new ConstraintFigure();
}
@@ -136,20 +142,21 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
/**
* @generated
*/
+ @Override
public ConstraintFigure getPrimaryShape() {
- return (ConstraintFigure)primaryShape;
+ return (ConstraintFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ConstraintNameEditPart) {
- ((ConstraintNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof ConstraintNameEditPart) {
+ ((ConstraintNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof Constraint2EditPart) {
- ((Constraint2EditPart)childEditPart).setLabel(getPrimaryShape().getConstraintFigure());
+ if (childEditPart instanceof Constraint2EditPart) {
+ ((Constraint2EditPart) childEditPart).setLabel(getPrimaryShape().getConstraintFigure());
return true;
}
return false;
@@ -159,10 +166,10 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ConstraintNameEditPart) {
+ if (childEditPart instanceof ConstraintNameEditPart) {
return true;
}
- if(childEditPart instanceof Constraint2EditPart) {
+ if (childEditPart instanceof Constraint2EditPart) {
return true;
}
return false;
@@ -171,8 +178,9 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
/**
* @generated
*/
+ @Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -181,8 +189,9 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
/**
* @generated
*/
+ @Override
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -191,6 +200,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
/**
* @generated
*/
+ @Override
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
return getContentPane();
}
@@ -198,6 +208,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
/**
* @generated
*/
+ @Override
protected NodeFigure createNodePlate() {
String prefElementId = "Constraint";
IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
@@ -209,12 +220,13 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
/**
* 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() {
NodeFigure figure = createNodePlate();
figure.setLayoutManager(new StackLayout());
@@ -227,13 +239,14 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- *
+ *
* @param nodeShape
- * instance of generated figure class
+ * instance of generated figure class
* @generated
*/
+ @Override
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -244,8 +257,9 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
/**
* @generated
*/
+ @Override
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -254,8 +268,9 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
/**
* @generated
*/
+ @Override
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -263,24 +278,27 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
/**
* @generated
*/
+ @Override
protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineWidth(width);
}
}
/**
* @generated
*/
+ @Override
protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineStyle(style);
}
}
/**
* @generated
*/
+ @Override
public EditPart getPrimaryChildEditPart() {
return getChildBySemanticHint(UMLVisualIDRegistry.getType(ConstraintNameEditPart.VISUAL_ID));
}
@@ -307,466 +325,466 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
*/
public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.ConstraintContext_8500);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.ConstraintContext_8500);
}
return types;
@@ -777,7 +795,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
*/
public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -797,7 +815,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -817,7 +835,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -837,7 +855,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -857,7 +875,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -877,7 +895,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -897,7 +915,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -917,7 +935,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
+ } else if (relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -937,7 +955,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.ConstraintContext_8500) {
+ } else if (relationshipType == UMLElementTypes.ConstraintContext_8500) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.InteractionOperand_3005);
}
@@ -966,7 +984,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
*/
public List<IElementType> getMATypesForSource(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -986,7 +1004,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1006,7 +1024,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1026,7 +1044,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1046,7 +1064,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1066,7 +1084,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1086,7 +1104,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1106,9 +1124,9 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
+ } else if (relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
types.add(UMLElementTypes.Comment_3009);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
+ } else if (relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
types.add(UMLElementTypes.TimeConstraint_3019);
types.add(UMLElementTypes.DurationConstraint_3021);
types.add(UMLElementTypes.Constraint_3008);
@@ -1122,28 +1140,28 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
*/
@Override
public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ IPreferenceStore preferenceStore = (IPreferenceStore) getDiagramPreferencesHint().getPreferenceStore();
Object result = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("Constraint", PreferencesConstantsHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("Constraint", PreferencesConstantsHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("Constraint", PreferencesConstantsHelper.COLOR_FILL);
}
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor(preferenceStore, prefColor));
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
String prefGradient = PreferencesConstantsHelper.getElementConstant("Constraint", PreferencesConstantsHelper.COLOR_GRADIENT);
GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
result = gradientPreferenceConverter.getGradientData();
}
}
- if(result == null) {
+ if (result == null) {
result = getStructuralFeatureValue(feature);
}
return result;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintNameEditPart.java
index e87b247976c..913dd6def13 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintNameEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -108,14 +108,14 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -130,6 +130,7 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
@@ -141,12 +142,12 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -154,12 +155,12 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -167,12 +168,12 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -180,12 +181,12 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -203,6 +204,7 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -210,6 +212,7 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -234,10 +237,10 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -246,23 +249,25 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -278,21 +283,24 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -306,8 +314,9 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -316,6 +325,7 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -323,8 +333,9 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Constraint_3008, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintNameEditPart.VISUAL_ID));
}
return parser;
@@ -334,7 +345,7 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -358,8 +369,8 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -367,8 +378,8 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -377,41 +388,42 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -423,13 +435,14 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -449,6 +462,7 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -463,17 +477,17 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -481,15 +495,15 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -498,18 +512,19 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -518,6 +533,7 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -525,12 +541,13 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -540,9 +557,10 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -553,10 +571,12 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -569,21 +589,21 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
private View getFontStyleOwnerView() {
- return (View)getModel();
+ return (View) getModel();
}
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
// not a named element. no specific editor => do nothing
@@ -592,12 +612,12 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -605,7 +625,7 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -615,13 +635,13 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -631,23 +651,23 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -655,13 +675,14 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -677,6 +698,7 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
/**
* @generated
*/
+ @Override
protected void addNotationalListeners() {
super.addNotationalListeners();
addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
@@ -685,6 +707,7 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
/**
* @generated
*/
+ @Override
protected void removeNotationalListeners() {
super.removeNotationalListeners();
removeListenerFilter("PrimaryView"); //$NON-NLS-1$
@@ -693,27 +716,29 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -726,6 +751,7 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
@@ -739,6 +765,7 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
/**
* @generated
*/
+ @Override
public void activate() {
super.activate();
addOwnerElementListeners();
@@ -748,12 +775,13 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
}
/**
* @generated
*/
+ @Override
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ContextLinkEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ContextLinkEditPart.java
index bd735ac85a2..4b9f3ebcbc0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ContextLinkEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ContextLinkEditPart.java
@@ -6,6 +6,7 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.gmfdiag.common.editpart.ConnectionEditPart;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.ContextLinkItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.CustomAppliedStereotypeContextLinkLabelDisplayEditPolicy;
@@ -31,18 +32,19 @@ public class ContextLinkEditPart extends ConnectionEditPart implements ITreeBran
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ContextLinkItemSemanticEditPolicy());
- installEditPolicy(AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new CustomAppliedStereotypeContextLinkLabelDisplayEditPolicy());
+ installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new CustomAppliedStereotypeContextLinkLabelDisplayEditPolicy());
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ConstraintContextAppliedStereotypeEditPart) {
- ((ConstraintContextAppliedStereotypeEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
+ if (childEditPart instanceof ConstraintContextAppliedStereotypeEditPart) {
+ ((ConstraintContextAppliedStereotypeEditPart) childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
return true;
}
return false;
@@ -51,8 +53,9 @@ public class ContextLinkEditPart extends ConnectionEditPart implements ITreeBran
/**
* @generated
*/
+ @Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -62,7 +65,7 @@ public class ContextLinkEditPart extends ConnectionEditPart implements ITreeBran
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ConstraintContextAppliedStereotypeEditPart) {
+ if (childEditPart instanceof ConstraintContextAppliedStereotypeEditPart) {
return true;
}
return false;
@@ -71,8 +74,9 @@ public class ContextLinkEditPart extends ConnectionEditPart implements ITreeBran
/**
* @generated
*/
+ @Override
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -80,12 +84,13 @@ public class ContextLinkEditPart extends ConnectionEditPart implements ITreeBran
/**
* 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 Connection createConnectionFigure() {
return new CustomContextLinkFigure();
}
@@ -93,7 +98,8 @@ public class ContextLinkEditPart extends ConnectionEditPart implements ITreeBran
/**
* @generated
*/
+ @Override
public CustomContextLinkFigure getPrimaryShape() {
- return (CustomContextLinkFigure)getFigure();
+ return (CustomContextLinkFigure) getFigure();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ContinuationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ContinuationEditPart.java
index 0cf61fa2092..9f20805605e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ContinuationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ContinuationEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -99,18 +99,21 @@ public class ContinuationEditPart extends AbstractBorderItemEditPart {
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) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
}
+ @Override
protected Command getMoveChildrenCommand(Request request) {
return null;
}
+ @Override
protected Command getCreateCommand(CreateRequest request) {
return null;
}
@@ -129,15 +132,15 @@ public class ContinuationEditPart extends AbstractBorderItemEditPart {
* @generated
*/
public ContinuationFigure getPrimaryShape() {
- return (ContinuationFigure)primaryShape;
+ return (ContinuationFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ContinuationNameEditPart) {
- ((ContinuationNameEditPart)childEditPart).setLabel(getPrimaryShape().getFigureContinuationNameLabel());
+ if (childEditPart instanceof ContinuationNameEditPart) {
+ ((ContinuationNameEditPart) childEditPart).setLabel(getPrimaryShape().getFigureContinuationNameLabel());
return true;
}
return false;
@@ -147,7 +150,7 @@ public class ContinuationEditPart extends AbstractBorderItemEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ContinuationNameEditPart) {
+ if (childEditPart instanceof ContinuationNameEditPart) {
return true;
}
return false;
@@ -158,7 +161,7 @@ public class ContinuationEditPart extends AbstractBorderItemEditPart {
*/
@Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -169,7 +172,7 @@ public class ContinuationEditPart extends AbstractBorderItemEditPart {
*/
@Override
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -192,17 +195,17 @@ public class ContinuationEditPart extends AbstractBorderItemEditPart {
String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferencesConstantsHelper.WIDTH);
String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferencesConstantsHelper.HEIGHT);
DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
- //FIXME: workaround for #154536
+ // FIXME: workaround for #154536
result.getBounds().setSize(result.getPreferredSize());
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
@@ -218,13 +221,13 @@ public class ContinuationEditPart extends AbstractBorderItemEditPart {
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- *
+ *
* @param nodeShape
- * instance of generated figure class
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -237,7 +240,7 @@ public class ContinuationEditPart extends AbstractBorderItemEditPart {
*/
@Override
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -248,7 +251,7 @@ public class ContinuationEditPart extends AbstractBorderItemEditPart {
*/
@Override
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -260,16 +263,17 @@ public class ContinuationEditPart extends AbstractBorderItemEditPart {
protected void setLineWidth(int width) {
/**
* Bug 437605 - Export Sequence Diagram to Images
- *
+ *
* Guard against negative line width
+ *
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.ResizableCompartmentEditPart#setLineWidth(int width)
*/
if (width < 0) {
width = 1;
}
-
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
+
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineWidth(width);
}
}
@@ -278,8 +282,8 @@ public class ContinuationEditPart extends AbstractBorderItemEditPart {
*/
@Override
protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineStyle(style);
}
}
@@ -311,403 +315,403 @@ public class ContinuationEditPart extends AbstractBorderItemEditPart {
*/
public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContinuationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContinuationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContinuationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContinuationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContinuationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContinuationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContinuationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContinuationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContinuationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContinuationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContinuationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContinuationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContinuationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContinuationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
return types;
@@ -718,7 +722,7 @@ public class ContinuationEditPart extends AbstractBorderItemEditPart {
*/
public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -738,7 +742,7 @@ public class ContinuationEditPart extends AbstractBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -758,7 +762,7 @@ public class ContinuationEditPart extends AbstractBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -778,7 +782,7 @@ public class ContinuationEditPart extends AbstractBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -798,7 +802,7 @@ public class ContinuationEditPart extends AbstractBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -818,7 +822,7 @@ public class ContinuationEditPart extends AbstractBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -838,7 +842,7 @@ public class ContinuationEditPart extends AbstractBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -884,7 +888,7 @@ public class ContinuationEditPart extends AbstractBorderItemEditPart {
*/
public List<IElementType> getMATypesForSource(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -904,7 +908,7 @@ public class ContinuationEditPart extends AbstractBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -924,7 +928,7 @@ public class ContinuationEditPart extends AbstractBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -944,7 +948,7 @@ public class ContinuationEditPart extends AbstractBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -964,7 +968,7 @@ public class ContinuationEditPart extends AbstractBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -984,7 +988,7 @@ public class ContinuationEditPart extends AbstractBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1004,7 +1008,7 @@ public class ContinuationEditPart extends AbstractBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1024,9 +1028,9 @@ public class ContinuationEditPart extends AbstractBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
+ } else if (relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
types.add(UMLElementTypes.Comment_3009);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
+ } else if (relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
types.add(UMLElementTypes.TimeConstraint_3019);
types.add(UMLElementTypes.DurationConstraint_3021);
types.add(UMLElementTypes.Constraint_3008);
@@ -1076,28 +1080,28 @@ public class ContinuationEditPart extends AbstractBorderItemEditPart {
*/
@Override
public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ IPreferenceStore preferenceStore = (IPreferenceStore) getDiagramPreferencesHint().getPreferenceStore();
Object result = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("Continuation", PreferencesConstantsHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("Continuation", PreferencesConstantsHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("Continuation", PreferencesConstantsHelper.COLOR_FILL);
}
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor(preferenceStore, prefColor));
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
String prefGradient = PreferencesConstantsHelper.getElementConstant("Continuation", PreferencesConstantsHelper.COLOR_GRADIENT);
GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
result = gradientPreferenceConverter.getGradientData();
}
}
- if(result == null) {
+ if (result == null) {
result = getStructuralFeatureValue(feature);
}
return result;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ContinuationNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ContinuationNameEditPart.java
index 5e763ccf3e5..78bcdb81771 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ContinuationNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ContinuationNameEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -113,14 +113,14 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -135,6 +135,7 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
@@ -146,12 +147,12 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -159,12 +160,12 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -172,12 +173,12 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -185,12 +186,12 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -208,6 +209,7 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -215,6 +217,7 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -231,12 +234,12 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(NameLabelIconHelper.showLabelIcon(view)) {
+ for (View view : views) {
+ if (NameLabelIconHelper.showLabelIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -249,10 +252,10 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -261,23 +264,25 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -293,21 +298,24 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -321,8 +329,9 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -331,6 +340,7 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -338,8 +348,9 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Continuation_3016, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContinuationNameEditPart.VISUAL_ID));
}
return parser;
@@ -349,7 +360,7 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -373,8 +384,8 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -382,8 +393,8 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -392,41 +403,42 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -438,13 +450,14 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -464,6 +477,7 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -478,17 +492,17 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -496,15 +510,15 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -513,18 +527,19 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -533,6 +548,7 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -540,12 +556,13 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -555,9 +572,10 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -568,10 +586,12 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -589,16 +609,16 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
// not a named element. no specific editor => do nothing
@@ -607,12 +627,12 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -620,7 +640,7 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -630,13 +650,13 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -646,23 +666,23 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -670,13 +690,14 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -692,6 +713,7 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
/**
* @generated
*/
+ @Override
protected void addNotationalListeners() {
super.addNotationalListeners();
addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
@@ -700,6 +722,7 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
/**
* @generated
*/
+ @Override
protected void removeNotationalListeners() {
super.removeNotationalListeners();
removeListenerFilter("PrimaryView"); //$NON-NLS-1$
@@ -708,34 +731,36 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -744,6 +769,7 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
@@ -757,6 +783,7 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
/**
* @generated
*/
+ @Override
public void activate() {
super.activate();
addOwnerElementListeners();
@@ -766,12 +793,13 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
}
/**
* @generated
*/
+ @Override
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DestructionOccurrenceSpecificationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DestructionOccurrenceSpecificationEditPart.java
index ba899cdde5e..763a7faeaaf 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DestructionOccurrenceSpecificationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DestructionOccurrenceSpecificationEditPart.java
@@ -68,6 +68,7 @@ public class DestructionOccurrenceSpecificationEditPart extends AbstractBorderIt
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, getPrimaryDragEditPolicy());
@@ -84,18 +85,21 @@ public class DestructionOccurrenceSpecificationEditPart extends AbstractBorderIt
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) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
}
+ @Override
protected Command getMoveChildrenCommand(Request request) {
return null;
}
+ @Override
protected Command getCreateCommand(CreateRequest request) {
return null;
}
@@ -114,7 +118,7 @@ public class DestructionOccurrenceSpecificationEditPart extends AbstractBorderIt
* @generated
*/
public DestructionEventFigure getPrimaryShape() {
- return (DestructionEventFigure)primaryShape;
+ return (DestructionEventFigure) primaryShape;
}
/**
@@ -126,7 +130,7 @@ public class DestructionOccurrenceSpecificationEditPart extends AbstractBorderIt
String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferencesConstantsHelper.WIDTH);
String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferencesConstantsHelper.HEIGHT);
DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
- //FIXME: workaround for #154536
+ // FIXME: workaround for #154536
result.getBounds().setSize(result.getPreferredSize());
return result;
}
@@ -134,10 +138,11 @@ public class DestructionOccurrenceSpecificationEditPart extends AbstractBorderIt
/**
* @generated
*/
+ @Override
public EditPolicy getPrimaryDragEditPolicy() {
EditPolicy result = super.getPrimaryDragEditPolicy();
- if(result instanceof ResizableEditPolicy) {
- ResizableEditPolicy ep = (ResizableEditPolicy)result;
+ if (result instanceof ResizableEditPolicy) {
+ ResizableEditPolicy ep = (ResizableEditPolicy) result;
ep.setResizeDirections(PositionConstants.NONE);
}
return result;
@@ -145,12 +150,13 @@ public class DestructionOccurrenceSpecificationEditPart extends AbstractBorderIt
/**
* 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() {
NodeFigure figure = createNodePlate();
figure.setLayoutManager(new StackLayout());
@@ -163,9 +169,9 @@ public class DestructionOccurrenceSpecificationEditPart extends AbstractBorderIt
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- *
+ *
* @param nodeShape
- * instance of generated figure class
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
@@ -175,8 +181,9 @@ public class DestructionOccurrenceSpecificationEditPart extends AbstractBorderIt
/**
* @generated
*/
+ @Override
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -185,8 +192,9 @@ public class DestructionOccurrenceSpecificationEditPart extends AbstractBorderIt
/**
* @generated
*/
+ @Override
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -194,18 +202,20 @@ public class DestructionOccurrenceSpecificationEditPart extends AbstractBorderIt
/**
* @generated
*/
+ @Override
protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineWidth(width);
}
}
/**
* @generated
*/
+ @Override
protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineStyle(style);
}
}
@@ -230,406 +240,406 @@ public class DestructionOccurrenceSpecificationEditPart extends AbstractBorderIt
*/
public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.GeneralOrdering_4012);
}
return types;
@@ -640,7 +650,7 @@ public class DestructionOccurrenceSpecificationEditPart extends AbstractBorderIt
*/
public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -660,7 +670,7 @@ public class DestructionOccurrenceSpecificationEditPart extends AbstractBorderIt
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -680,7 +690,7 @@ public class DestructionOccurrenceSpecificationEditPart extends AbstractBorderIt
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -700,7 +710,7 @@ public class DestructionOccurrenceSpecificationEditPart extends AbstractBorderIt
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -720,7 +730,7 @@ public class DestructionOccurrenceSpecificationEditPart extends AbstractBorderIt
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -740,7 +750,7 @@ public class DestructionOccurrenceSpecificationEditPart extends AbstractBorderIt
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -760,7 +770,7 @@ public class DestructionOccurrenceSpecificationEditPart extends AbstractBorderIt
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -780,7 +790,7 @@ public class DestructionOccurrenceSpecificationEditPart extends AbstractBorderIt
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.GeneralOrdering_4012) {
+ } else if (relationshipType == UMLElementTypes.GeneralOrdering_4012) {
types.add(UMLElementTypes.DestructionOccurrenceSpecification_3022);
}
return types;
@@ -809,7 +819,7 @@ public class DestructionOccurrenceSpecificationEditPart extends AbstractBorderIt
*/
public List<IElementType> getMATypesForSource(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -829,7 +839,7 @@ public class DestructionOccurrenceSpecificationEditPart extends AbstractBorderIt
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -849,7 +859,7 @@ public class DestructionOccurrenceSpecificationEditPart extends AbstractBorderIt
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -869,7 +879,7 @@ public class DestructionOccurrenceSpecificationEditPart extends AbstractBorderIt
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -889,7 +899,7 @@ public class DestructionOccurrenceSpecificationEditPart extends AbstractBorderIt
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -909,7 +919,7 @@ public class DestructionOccurrenceSpecificationEditPart extends AbstractBorderIt
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -929,7 +939,7 @@ public class DestructionOccurrenceSpecificationEditPart extends AbstractBorderIt
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -949,14 +959,14 @@ public class DestructionOccurrenceSpecificationEditPart extends AbstractBorderIt
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
+ } else if (relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
types.add(UMLElementTypes.Comment_3009);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
+ } else if (relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
types.add(UMLElementTypes.TimeConstraint_3019);
types.add(UMLElementTypes.DurationConstraint_3021);
types.add(UMLElementTypes.Constraint_3008);
types.add(UMLElementTypes.DurationConstraint_3023);
- } else if(relationshipType == UMLElementTypes.GeneralOrdering_4012) {
+ } else if (relationshipType == UMLElementTypes.GeneralOrdering_4012) {
types.add(UMLElementTypes.DestructionOccurrenceSpecification_3022);
}
return types;
@@ -967,28 +977,28 @@ public class DestructionOccurrenceSpecificationEditPart extends AbstractBorderIt
*/
@Override
public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ IPreferenceStore preferenceStore = (IPreferenceStore) getDiagramPreferencesHint().getPreferenceStore();
Object result = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("DestructionOccurrenceSpecification", PreferencesConstantsHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("DestructionOccurrenceSpecification", PreferencesConstantsHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("DestructionOccurrenceSpecification", PreferencesConstantsHelper.COLOR_FILL);
}
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor(preferenceStore, prefColor));
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
String prefGradient = PreferencesConstantsHelper.getElementConstant("DestructionOccurrenceSpecification", PreferencesConstantsHelper.COLOR_GRADIENT);
GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
result = gradientPreferenceConverter.getGradientData();
}
}
- if(result == null) {
+ if (result == null) {
result = getStructuralFeatureValue(feature);
}
return result;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintAppliedStereotypeEditPart.java
index b967285685c..9e9d1a633b0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintAppliedStereotypeEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -115,14 +115,14 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -143,6 +143,7 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
@@ -153,11 +154,12 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
/**
* @generated
*/
+ @Override
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -165,11 +167,12 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
/**
* @generated
*/
+ @Override
public void refreshBounds() {
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
}
@@ -177,12 +180,12 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -190,12 +193,12 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -203,12 +206,12 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -216,12 +219,12 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -239,6 +242,7 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -246,6 +250,7 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -262,12 +267,12 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(NameLabelIconHelper.showLabelIcon(view)) {
+ for (View view : views) {
+ if (NameLabelIconHelper.showLabelIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -280,10 +285,10 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -292,23 +297,25 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -324,21 +331,24 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -352,8 +362,9 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -362,6 +373,7 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -369,8 +381,9 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.DurationConstraint_3021, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintAppliedStereotypeEditPart.VISUAL_ID));
}
return parser;
@@ -380,7 +393,7 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -404,8 +417,8 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -413,8 +426,8 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -423,41 +436,42 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -469,13 +483,14 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -495,6 +510,7 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -509,17 +525,17 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -527,15 +543,15 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -544,18 +560,19 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -564,6 +581,7 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -571,12 +589,13 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -586,9 +605,10 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -599,10 +619,12 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -620,7 +642,7 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
@@ -631,12 +653,12 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -644,7 +666,7 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -654,13 +676,13 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -670,23 +692,23 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -694,13 +716,14 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -716,26 +739,28 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -748,6 +773,7 @@ public class DurationConstraintAppliedStereotypeEditPart extends LabelEditPart i
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
IFigure label = createFigurePrim();
defaultText = getLabelTextHelper(label);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintEditPart.java
index e9d1915d0f8..4ea012b9cfd 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -93,6 +93,7 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, getPrimaryDragEditPolicy());
@@ -109,31 +110,35 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
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) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case DurationConstraintLabelEditPart.VISUAL_ID:
case DurationConstraintAppliedStereotypeEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
+ @Override
protected List createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
}
+ @Override
protected Command getMoveChildrenCommand(Request request) {
return null;
}
+ @Override
protected Command getCreateCommand(CreateRequest request) {
return null;
}
@@ -152,14 +157,15 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
* @generated
*/
public DurationConstraintFigure getPrimaryShape() {
- return (DurationConstraintFigure)primaryShape;
+ return (DurationConstraintFigure) primaryShape;
}
/**
* @generated
*/
+ @Override
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof DurationConstraintLabelEditPart || borderItemEditPart instanceof DurationConstraintAppliedStereotypeEditPart) {
+ if (borderItemEditPart instanceof DurationConstraintLabelEditPart || borderItemEditPart instanceof DurationConstraintAppliedStereotypeEditPart) {
BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
locator.setBorderItemOffset(new Dimension(-20, -20));
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
@@ -177,19 +183,20 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferencesConstantsHelper.WIDTH);
String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferencesConstantsHelper.HEIGHT);
DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
- //FIXME: workaround for #154536
+ // FIXME: workaround for #154536
result.getBounds().setSize(result.getPreferredSize());
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 createMainFigure() {
NodeFigure figure = createNodePlate();
figure.setLayoutManager(new StackLayout());
@@ -202,9 +209,9 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- *
+ *
* @param nodeShape
- * instance of generated figure class
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
@@ -214,8 +221,9 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
/**
* @generated
*/
+ @Override
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -224,8 +232,9 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
/**
* @generated
*/
+ @Override
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -233,24 +242,27 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
/**
* @generated
*/
+ @Override
protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineWidth(width);
}
}
/**
* @generated
*/
+ @Override
protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineStyle(style);
}
}
/**
* @generated
*/
+ @Override
public EditPart getPrimaryChildEditPart() {
return getChildBySemanticHint(UMLVisualIDRegistry.getType(DurationConstraintLabelEditPart.VISUAL_ID));
}
@@ -277,466 +289,466 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
*/
public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.ConstraintContext_8500);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.ConstraintContext_8500);
}
return types;
@@ -747,7 +759,7 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
*/
public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -767,7 +779,7 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -787,7 +799,7 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -807,7 +819,7 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -827,7 +839,7 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -847,7 +859,7 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -867,7 +879,7 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -887,7 +899,7 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
+ } else if (relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -907,7 +919,7 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.ConstraintContext_8500) {
+ } else if (relationshipType == UMLElementTypes.ConstraintContext_8500) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.InteractionOperand_3005);
}
@@ -936,7 +948,7 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
*/
public List<IElementType> getMATypesForSource(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -956,7 +968,7 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -976,7 +988,7 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -996,7 +1008,7 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1016,7 +1028,7 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1036,7 +1048,7 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1056,7 +1068,7 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1076,9 +1088,9 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
+ } else if (relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
types.add(UMLElementTypes.Comment_3009);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
+ } else if (relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
types.add(UMLElementTypes.TimeConstraint_3019);
types.add(UMLElementTypes.DurationConstraint_3021);
types.add(UMLElementTypes.Constraint_3008);
@@ -1142,28 +1154,28 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
*/
@Override
public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ IPreferenceStore preferenceStore = (IPreferenceStore) getDiagramPreferencesHint().getPreferenceStore();
Object result = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("DurationConstraint", PreferencesConstantsHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("DurationConstraint", PreferencesConstantsHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("DurationConstraint", PreferencesConstantsHelper.COLOR_FILL);
}
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor(preferenceStore, prefColor));
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
String prefGradient = PreferencesConstantsHelper.getElementConstant("DurationConstraint", PreferencesConstantsHelper.COLOR_GRADIENT);
GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
result = gradientPreferenceConverter.getGradientData();
}
}
- if(result == null) {
+ if (result == null) {
result = getStructuralFeatureValue(feature);
}
return result;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintInMessageAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintInMessageAppliedStereotypeEditPart.java
index 5119e64b90c..2e9cfbdcd1d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintInMessageAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintInMessageAppliedStereotypeEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -115,14 +115,14 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -143,6 +143,7 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
@@ -153,11 +154,12 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
/**
* @generated
*/
+ @Override
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -165,11 +167,12 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
/**
* @generated
*/
+ @Override
public void refreshBounds() {
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
}
@@ -177,12 +180,12 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -190,12 +193,12 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -203,12 +206,12 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -216,12 +219,12 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -239,6 +242,7 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -246,6 +250,7 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -262,12 +267,12 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(NameLabelIconHelper.showLabelIcon(view)) {
+ for (View view : views) {
+ if (NameLabelIconHelper.showLabelIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -280,10 +285,10 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -292,23 +297,25 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -324,21 +331,24 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -352,8 +362,9 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -362,6 +373,7 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -369,8 +381,9 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.DurationConstraint_3023, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintInMessageAppliedStereotypeEditPart.VISUAL_ID));
}
return parser;
@@ -380,7 +393,7 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -404,8 +417,8 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -413,8 +426,8 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -423,41 +436,42 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -469,13 +483,14 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -495,6 +510,7 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -509,17 +525,17 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -527,15 +543,15 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -544,18 +560,19 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -564,6 +581,7 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -571,12 +589,13 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -586,9 +605,10 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -599,10 +619,12 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -620,7 +642,7 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
@@ -631,12 +653,12 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -644,7 +666,7 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -654,13 +676,13 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -670,23 +692,23 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -694,13 +716,14 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -716,26 +739,28 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -748,6 +773,7 @@ public class DurationConstraintInMessageAppliedStereotypeEditPart extends LabelE
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
IFigure label = createFigurePrim();
defaultText = getLabelTextHelper(label);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintInMessageEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintInMessageEditPart.java
index 075601d1154..1c6f82b8342 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintInMessageEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintInMessageEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -95,6 +95,7 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DurationConstraintInMessageItemSemanticEditPolicy());
@@ -112,30 +113,34 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
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) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case DurationConstraintInMessageAppliedStereotypeEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
+ @Override
protected List createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
}
+ @Override
protected Command getMoveChildrenCommand(Request request) {
return null;
}
+ @Override
protected Command getCreateCommand(CreateRequest request) {
return null;
}
@@ -154,15 +159,15 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
* @generated
*/
public DurationObservationConstraint getPrimaryShape() {
- return (DurationObservationConstraint)primaryShape;
+ return (DurationObservationConstraint) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DurationConstraintInMessageLabelEditPart) {
- ((DurationConstraintInMessageLabelEditPart)childEditPart).setLabel(getPrimaryShape().getDurationLabel());
+ if (childEditPart instanceof DurationConstraintInMessageLabelEditPart) {
+ ((DurationConstraintInMessageLabelEditPart) childEditPart).setLabel(getPrimaryShape().getDurationLabel());
return true;
}
return false;
@@ -172,7 +177,7 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DurationConstraintInMessageLabelEditPart) {
+ if (childEditPart instanceof DurationConstraintInMessageLabelEditPart) {
return true;
}
return false;
@@ -181,8 +186,9 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
/**
* @generated
*/
+ @Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -191,8 +197,9 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
/**
* @generated
*/
+ @Override
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -201,8 +208,9 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
/**
* @generated
*/
+ @Override
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -211,8 +219,9 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
/**
* @generated
*/
+ @Override
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof DurationConstraintInMessageAppliedStereotypeEditPart) {
+ if (borderItemEditPart instanceof DurationConstraintInMessageAppliedStereotypeEditPart) {
BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
locator.setBorderItemOffset(new Dimension(-20, -20));
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
@@ -235,12 +244,13 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
/**
* 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 createMainFigure() {
NodeFigure figure = createNodePlate();
figure.setLayoutManager(new StackLayout());
@@ -253,13 +263,13 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- *
+ *
* @param nodeShape
- * instance of generated figure class
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -270,8 +280,9 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
/**
* @generated
*/
+ @Override
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -280,8 +291,9 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
/**
* @generated
*/
+ @Override
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -289,24 +301,27 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
/**
* @generated
*/
+ @Override
protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineWidth(width);
}
}
/**
* @generated
*/
+ @Override
protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineStyle(style);
}
}
/**
* @generated
*/
+ @Override
public EditPart getPrimaryChildEditPart() {
return getChildBySemanticHint(UMLVisualIDRegistry.getType(DurationConstraintInMessageLabelEditPart.VISUAL_ID));
}
@@ -333,466 +348,466 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
*/
public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.ConstraintContext_8500);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.ConstraintContext_8500);
}
return types;
@@ -803,7 +818,7 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
*/
public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -823,7 +838,7 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -843,7 +858,7 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -863,7 +878,7 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -883,7 +898,7 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -903,7 +918,7 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -923,7 +938,7 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -943,7 +958,7 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
+ } else if (relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -963,7 +978,7 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.ConstraintContext_8500) {
+ } else if (relationshipType == UMLElementTypes.ConstraintContext_8500) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.InteractionOperand_3005);
}
@@ -992,7 +1007,7 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
*/
public List<IElementType> getMATypesForSource(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1012,7 +1027,7 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1032,7 +1047,7 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1052,7 +1067,7 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1072,7 +1087,7 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1092,7 +1107,7 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1112,7 +1127,7 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1132,9 +1147,9 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
+ } else if (relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
types.add(UMLElementTypes.Comment_3009);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
+ } else if (relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
types.add(UMLElementTypes.TimeConstraint_3019);
types.add(UMLElementTypes.DurationConstraint_3021);
types.add(UMLElementTypes.Constraint_3008);
@@ -1181,28 +1196,28 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
*/
@Override
public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ IPreferenceStore preferenceStore = (IPreferenceStore) getDiagramPreferencesHint().getPreferenceStore();
Object result = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("DurationConstraint", PreferencesConstantsHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("DurationConstraint", PreferencesConstantsHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("DurationConstraint", PreferencesConstantsHelper.COLOR_FILL);
}
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor(preferenceStore, prefColor));
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
String prefGradient = PreferencesConstantsHelper.getElementConstant("DurationConstraint", PreferencesConstantsHelper.COLOR_GRADIENT);
GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
result = gradientPreferenceConverter.getGradientData();
}
}
- if(result == null) {
+ if (result == null) {
result = getStructuralFeatureValue(feature);
}
return result;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintInMessageLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintInMessageLabelEditPart.java
index f146ede9f58..c220d7faf80 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintInMessageLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintInMessageLabelEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -108,14 +108,14 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -130,6 +130,7 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
@@ -142,12 +143,12 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -155,12 +156,12 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -168,12 +169,12 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -181,12 +182,12 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -204,6 +205,7 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -211,6 +213,7 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -235,10 +238,10 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -247,23 +250,25 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -279,21 +284,24 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -307,8 +315,9 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -317,6 +326,7 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -324,8 +334,9 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.DurationConstraint_3023, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintInMessageLabelEditPart.VISUAL_ID));
}
return parser;
@@ -335,7 +346,7 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -359,8 +370,8 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -368,8 +379,8 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -378,41 +389,42 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -424,13 +436,14 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -450,6 +463,7 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -464,17 +478,17 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -482,15 +496,15 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -499,18 +513,19 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -519,6 +534,7 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -526,12 +542,13 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -541,9 +558,10 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -554,10 +572,12 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -570,21 +590,21 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
* @generated
*/
private View getFontStyleOwnerView() {
- return (View)getModel();
+ return (View) getModel();
}
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
// not a named element. no specific editor => do nothing
@@ -593,12 +613,12 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -606,7 +626,7 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -616,13 +636,13 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -632,23 +652,23 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -656,13 +676,14 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -678,6 +699,7 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
/**
* @generated
*/
+ @Override
protected void addNotationalListeners() {
super.addNotationalListeners();
addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
@@ -686,6 +708,7 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
/**
* @generated
*/
+ @Override
protected void removeNotationalListeners() {
super.removeNotationalListeners();
removeListenerFilter("PrimaryView"); //$NON-NLS-1$
@@ -694,27 +717,29 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -727,6 +752,7 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
@@ -740,6 +766,7 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
/**
* @generated
*/
+ @Override
public void activate() {
super.activate();
addOwnerElementListeners();
@@ -749,12 +776,13 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
}
/**
* @generated
*/
+ @Override
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintLabelEditPart.java
index ac15069a82b..97154811679 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintLabelEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -111,14 +111,14 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -139,6 +139,7 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
@@ -148,11 +149,12 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
/**
* @generated
*/
+ @Override
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -160,11 +162,12 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
/**
* @generated
*/
+ @Override
public void refreshBounds() {
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
}
@@ -172,12 +175,12 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -185,12 +188,12 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -198,12 +201,12 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -211,12 +214,12 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -234,6 +237,7 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -241,6 +245,7 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -265,10 +270,10 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -277,23 +282,25 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -309,21 +316,24 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -337,8 +347,9 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,6 +358,7 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -354,8 +366,9 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.DurationConstraint_3021, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintLabelEditPart.VISUAL_ID));
}
return parser;
@@ -365,7 +378,7 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -389,8 +402,8 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -398,8 +411,8 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -408,41 +421,42 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -454,13 +468,14 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -480,6 +495,7 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -494,17 +510,17 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -512,15 +528,15 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -529,18 +545,19 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -549,6 +566,7 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -556,12 +574,13 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -571,9 +590,10 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -584,10 +604,12 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -605,16 +627,16 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
// not a named element. no specific editor => do nothing
@@ -623,12 +645,12 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -636,7 +658,7 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -646,13 +668,13 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -662,23 +684,23 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -686,13 +708,14 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -708,26 +731,28 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -740,6 +765,7 @@ public class DurationConstraintLabelEditPart extends LabelEditPart implements IT
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
IFigure label = createFigurePrim();
defaultText = getLabelTextHelper(label);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationObservationAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationObservationAppliedStereotypeEditPart.java
index 75979dd96a8..1b99021f9db 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationObservationAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationObservationAppliedStereotypeEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -115,14 +115,14 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -143,6 +143,7 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
@@ -153,11 +154,12 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
/**
* @generated
*/
+ @Override
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -165,11 +167,12 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
/**
* @generated
*/
+ @Override
public void refreshBounds() {
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
}
@@ -177,12 +180,12 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -190,12 +193,12 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -203,12 +206,12 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -216,12 +219,12 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -239,6 +242,7 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -246,6 +250,7 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -262,12 +267,12 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(NameLabelIconHelper.showLabelIcon(view)) {
+ for (View view : views) {
+ if (NameLabelIconHelper.showLabelIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -280,10 +285,10 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -292,23 +297,25 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -324,21 +331,24 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -352,8 +362,9 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -362,6 +373,7 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -369,8 +381,9 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.DurationObservation_3024, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationObservationAppliedStereotypeEditPart.VISUAL_ID));
}
return parser;
@@ -380,7 +393,7 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -404,8 +417,8 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -413,8 +426,8 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -423,41 +436,42 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -469,13 +483,14 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -495,6 +510,7 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -509,17 +525,17 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -527,15 +543,15 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -544,18 +560,19 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -564,6 +581,7 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -571,12 +589,13 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -586,9 +605,10 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -599,10 +619,12 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -620,7 +642,7 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
@@ -631,12 +653,12 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -644,7 +666,7 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -654,13 +676,13 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -670,23 +692,23 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -694,13 +716,14 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -716,26 +739,28 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -748,6 +773,7 @@ public class DurationObservationAppliedStereotypeEditPart extends LabelEditPart
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
IFigure label = createFigurePrim();
defaultText = getLabelTextHelper(label);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationObservationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationObservationEditPart.java
index 25d673ff7ef..1fa4d0a6a2b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationObservationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationObservationEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -95,6 +95,7 @@ public class DurationObservationEditPart extends AbstractBorderedShapeEditPart {
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DurationObservationItemSemanticEditPolicy());
@@ -112,30 +113,34 @@ public class DurationObservationEditPart extends AbstractBorderedShapeEditPart {
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) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case DurationObservationAppliedStereotypeEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
+ @Override
protected List createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
}
+ @Override
protected Command getMoveChildrenCommand(Request request) {
return null;
}
+ @Override
protected Command getCreateCommand(CreateRequest request) {
return null;
}
@@ -154,15 +159,15 @@ public class DurationObservationEditPart extends AbstractBorderedShapeEditPart {
* @generated
*/
public DurationObservationConstraint getPrimaryShape() {
- return (DurationObservationConstraint)primaryShape;
+ return (DurationObservationConstraint) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DurationObservationLabelEditPart) {
- ((DurationObservationLabelEditPart)childEditPart).setLabel(getPrimaryShape().getDurationLabel());
+ if (childEditPart instanceof DurationObservationLabelEditPart) {
+ ((DurationObservationLabelEditPart) childEditPart).setLabel(getPrimaryShape().getDurationLabel());
return true;
}
return false;
@@ -172,7 +177,7 @@ public class DurationObservationEditPart extends AbstractBorderedShapeEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DurationObservationLabelEditPart) {
+ if (childEditPart instanceof DurationObservationLabelEditPart) {
return true;
}
return false;
@@ -181,8 +186,9 @@ public class DurationObservationEditPart extends AbstractBorderedShapeEditPart {
/**
* @generated
*/
+ @Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -191,8 +197,9 @@ public class DurationObservationEditPart extends AbstractBorderedShapeEditPart {
/**
* @generated
*/
+ @Override
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -201,8 +208,9 @@ public class DurationObservationEditPart extends AbstractBorderedShapeEditPart {
/**
* @generated
*/
+ @Override
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -211,8 +219,9 @@ public class DurationObservationEditPart extends AbstractBorderedShapeEditPart {
/**
* @generated
*/
+ @Override
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof DurationObservationAppliedStereotypeEditPart) {
+ if (borderItemEditPart instanceof DurationObservationAppliedStereotypeEditPart) {
BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
locator.setBorderItemOffset(new Dimension(-20, -20));
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
@@ -235,12 +244,13 @@ public class DurationObservationEditPart extends AbstractBorderedShapeEditPart {
/**
* 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 createMainFigure() {
NodeFigure figure = createNodePlate();
figure.setLayoutManager(new StackLayout());
@@ -253,13 +263,13 @@ public class DurationObservationEditPart extends AbstractBorderedShapeEditPart {
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- *
+ *
* @param nodeShape
- * instance of generated figure class
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -270,8 +280,9 @@ public class DurationObservationEditPart extends AbstractBorderedShapeEditPart {
/**
* @generated
*/
+ @Override
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -280,8 +291,9 @@ public class DurationObservationEditPart extends AbstractBorderedShapeEditPart {
/**
* @generated
*/
+ @Override
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -289,24 +301,27 @@ public class DurationObservationEditPart extends AbstractBorderedShapeEditPart {
/**
* @generated
*/
+ @Override
protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineWidth(width);
}
}
/**
* @generated
*/
+ @Override
protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineStyle(style);
}
}
/**
* @generated
*/
+ @Override
public EditPart getPrimaryChildEditPart() {
return getChildBySemanticHint(UMLVisualIDRegistry.getType(DurationObservationLabelEditPart.VISUAL_ID));
}
@@ -331,403 +346,403 @@ public class DurationObservationEditPart extends AbstractBorderedShapeEditPart {
*/
public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationObservationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationObservationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationObservationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationObservationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationObservationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationObservationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationObservationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
return types;
@@ -738,7 +753,7 @@ public class DurationObservationEditPart extends AbstractBorderedShapeEditPart {
*/
public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -758,7 +773,7 @@ public class DurationObservationEditPart extends AbstractBorderedShapeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -778,7 +793,7 @@ public class DurationObservationEditPart extends AbstractBorderedShapeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -798,7 +813,7 @@ public class DurationObservationEditPart extends AbstractBorderedShapeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -818,7 +833,7 @@ public class DurationObservationEditPart extends AbstractBorderedShapeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -838,7 +853,7 @@ public class DurationObservationEditPart extends AbstractBorderedShapeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -858,7 +873,7 @@ public class DurationObservationEditPart extends AbstractBorderedShapeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -904,7 +919,7 @@ public class DurationObservationEditPart extends AbstractBorderedShapeEditPart {
*/
public List<IElementType> getMATypesForSource(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -924,7 +939,7 @@ public class DurationObservationEditPart extends AbstractBorderedShapeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -944,7 +959,7 @@ public class DurationObservationEditPart extends AbstractBorderedShapeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -964,7 +979,7 @@ public class DurationObservationEditPart extends AbstractBorderedShapeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -984,7 +999,7 @@ public class DurationObservationEditPart extends AbstractBorderedShapeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1004,7 +1019,7 @@ public class DurationObservationEditPart extends AbstractBorderedShapeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1024,7 +1039,7 @@ public class DurationObservationEditPart extends AbstractBorderedShapeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1044,9 +1059,9 @@ public class DurationObservationEditPart extends AbstractBorderedShapeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
+ } else if (relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
types.add(UMLElementTypes.Comment_3009);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
+ } else if (relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
types.add(UMLElementTypes.TimeConstraint_3019);
types.add(UMLElementTypes.DurationConstraint_3021);
types.add(UMLElementTypes.Constraint_3008);
@@ -1093,28 +1108,28 @@ public class DurationObservationEditPart extends AbstractBorderedShapeEditPart {
*/
@Override
public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ IPreferenceStore preferenceStore = (IPreferenceStore) getDiagramPreferencesHint().getPreferenceStore();
Object result = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("DurationObservation", PreferencesConstantsHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("DurationObservation", PreferencesConstantsHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("DurationObservation", PreferencesConstantsHelper.COLOR_FILL);
}
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor(preferenceStore, prefColor));
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
String prefGradient = PreferencesConstantsHelper.getElementConstant("DurationObservation", PreferencesConstantsHelper.COLOR_GRADIENT);
GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
result = gradientPreferenceConverter.getGradientData();
}
}
- if(result == null) {
+ if (result == null) {
result = getStructuralFeatureValue(feature);
}
return result;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationObservationLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationObservationLabelEditPart.java
index ef12132c71c..bc297f4d8f8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationObservationLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationObservationLabelEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -108,14 +108,14 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -130,6 +130,7 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
@@ -142,12 +143,12 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -155,12 +156,12 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -168,12 +169,12 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -181,12 +182,12 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -204,6 +205,7 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -211,6 +213,7 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -235,10 +238,10 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -247,23 +250,25 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -279,21 +284,24 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -307,8 +315,9 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -317,6 +326,7 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -324,8 +334,9 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.DurationObservation_3024, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationObservationLabelEditPart.VISUAL_ID));
}
return parser;
@@ -335,7 +346,7 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -359,8 +370,8 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -368,8 +379,8 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -378,41 +389,42 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -424,13 +436,14 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -450,6 +463,7 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -464,17 +478,17 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -482,15 +496,15 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -499,18 +513,19 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -519,6 +534,7 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -526,12 +542,13 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -541,9 +558,10 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -554,10 +572,12 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -570,21 +590,21 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
* @generated
*/
private View getFontStyleOwnerView() {
- return (View)getModel();
+ return (View) getModel();
}
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
// not a named element. no specific editor => do nothing
@@ -593,12 +613,12 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -606,7 +626,7 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -616,13 +636,13 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -632,23 +652,23 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -656,13 +676,14 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -678,6 +699,7 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
/**
* @generated
*/
+ @Override
protected void addNotationalListeners() {
super.addNotationalListeners();
addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
@@ -686,6 +708,7 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
/**
* @generated
*/
+ @Override
protected void removeNotationalListeners() {
super.removeNotationalListeners();
removeListenerFilter("PrimaryView"); //$NON-NLS-1$
@@ -694,27 +717,29 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -727,6 +752,7 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
@@ -740,6 +766,7 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
/**
* @generated
*/
+ @Override
public void activate() {
super.activate();
addOwnerElementListeners();
@@ -749,12 +776,13 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
}
/**
* @generated
*/
+ @Override
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GeneralOrderingAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GeneralOrderingAppliedStereotypeEditPart.java
index 9d2e64f36fb..5e6c44fd347 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GeneralOrderingAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GeneralOrderingAppliedStereotypeEditPart.java
@@ -100,14 +100,14 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -128,6 +128,7 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
@@ -138,6 +139,7 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
/**
* @generated
*/
+ @Override
public int getKeyPoint() {
return ConnectionLocator.MIDDLE;
}
@@ -146,12 +148,12 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -159,12 +161,12 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -172,12 +174,12 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -185,12 +187,12 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -208,6 +210,7 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -215,6 +218,7 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -231,12 +235,12 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(NameLabelIconHelper.showLabelIcon(view)) {
+ for (View view : views) {
+ if (NameLabelIconHelper.showLabelIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -249,10 +253,10 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -261,23 +265,25 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -293,21 +299,24 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -321,8 +330,9 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -331,6 +341,7 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -338,8 +349,9 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.GeneralOrdering_4012, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.GeneralOrderingAppliedStereotypeEditPart.VISUAL_ID));
}
return parser;
@@ -349,7 +361,7 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -373,8 +385,8 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -382,8 +394,8 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -392,41 +404,42 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -438,13 +451,14 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -464,6 +478,7 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -478,17 +493,17 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -496,15 +511,15 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -513,18 +528,19 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -533,6 +549,7 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -540,12 +557,13 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -555,9 +573,10 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -568,10 +587,12 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -584,12 +605,12 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
* @generated
*/
private View getFontStyleOwnerView() {
- return (View)getModel();
+ return (View) getModel();
}
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
@@ -600,12 +621,12 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -613,7 +634,7 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -623,13 +644,13 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -639,23 +660,23 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -663,13 +684,14 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -685,33 +707,35 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -720,6 +744,7 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GeneralOrderingEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GeneralOrderingEditPart.java
index 9566ef67dbe..aeb0931f931 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GeneralOrderingEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GeneralOrderingEditPart.java
@@ -13,6 +13,7 @@ import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.gmfdiag.common.figure.edge.PapyrusEdgeFigure;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.GeneralOrderingItemSemanticEditPolicy;
@@ -36,18 +37,19 @@ public class GeneralOrderingEditPart extends ConnectionNodeEditPart implements I
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new GeneralOrderingItemSemanticEditPolicy());
- installEditPolicy(AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeLinkLabelDisplayEditPolicy());
+ installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeLinkLabelDisplayEditPolicy());
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof GeneralOrderingAppliedStereotypeEditPart) {
- ((GeneralOrderingAppliedStereotypeEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
+ if (childEditPart instanceof GeneralOrderingAppliedStereotypeEditPart) {
+ ((GeneralOrderingAppliedStereotypeEditPart) childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
return true;
}
return false;
@@ -56,8 +58,9 @@ public class GeneralOrderingEditPart extends ConnectionNodeEditPart implements I
/**
* @generated
*/
+ @Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -67,7 +70,7 @@ public class GeneralOrderingEditPart extends ConnectionNodeEditPart implements I
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof GeneralOrderingAppliedStereotypeEditPart) {
+ if (childEditPart instanceof GeneralOrderingAppliedStereotypeEditPart) {
return true;
}
return false;
@@ -76,8 +79,9 @@ public class GeneralOrderingEditPart extends ConnectionNodeEditPart implements I
/**
* @generated
*/
+ @Override
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -85,12 +89,13 @@ public class GeneralOrderingEditPart extends ConnectionNodeEditPart implements I
/**
* 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 Connection createConnectionFigure() {
return new GeneralOrderingDescriptor();
}
@@ -99,7 +104,7 @@ public class GeneralOrderingEditPart extends ConnectionNodeEditPart implements I
* @generated
*/
public GeneralOrderingDescriptor getPrimaryShape() {
- return (GeneralOrderingDescriptor)getFigure();
+ return (GeneralOrderingDescriptor) getFigure();
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionEditPart.java
index 4e46122dde8..c10983f0375 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -85,13 +85,14 @@ public class InteractionEditPart extends ShapeNodeEditPart {
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new PapyrusCreationEditPolicy());
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new InteractionItemSemanticEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
- //in Papyrus diagrams are not strongly synchronised
- //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.sequence.edit.policies.InteractionCanonicalEditPolicy());
+ // in Papyrus diagrams are not strongly synchronised
+ // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.sequence.edit.policies.InteractionCanonicalEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new SequenceGraphicalNodeEditPolicy());
installEditPolicy(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY, new ShowHideCompartmentEditPolicy());
@@ -106,18 +107,21 @@ public class InteractionEditPart extends ShapeNodeEditPart {
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) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
}
+ @Override
protected Command getMoveChildrenCommand(Request request) {
return null;
}
+ @Override
protected Command getCreateCommand(CreateRequest request) {
return null;
}
@@ -136,21 +140,21 @@ public class InteractionEditPart extends ShapeNodeEditPart {
* @generated
*/
public InteractionRectangleFigure getPrimaryShape() {
- return (InteractionRectangleFigure)primaryShape;
+ return (InteractionRectangleFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof InteractionNameEditPart) {
- ((InteractionNameEditPart)childEditPart).setLabel(getPrimaryShape().getHeaderLabel());
+ if (childEditPart instanceof InteractionNameEditPart) {
+ ((InteractionNameEditPart) childEditPart).setLabel(getPrimaryShape().getHeaderLabel());
return true;
}
- if(childEditPart instanceof InteractionInteractionCompartmentEditPart) {
+ if (childEditPart instanceof InteractionInteractionCompartmentEditPart) {
IFigure pane = getPrimaryShape().getCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((InteractionInteractionCompartmentEditPart)childEditPart).getFigure());
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((InteractionInteractionCompartmentEditPart) childEditPart).getFigure());
return true;
}
return false;
@@ -160,12 +164,12 @@ public class InteractionEditPart extends ShapeNodeEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof InteractionNameEditPart) {
+ if (childEditPart instanceof InteractionNameEditPart) {
return true;
}
- if(childEditPart instanceof InteractionInteractionCompartmentEditPart) {
+ if (childEditPart instanceof InteractionInteractionCompartmentEditPart) {
IFigure pane = getPrimaryShape().getCompartmentFigure();
- pane.remove(((InteractionInteractionCompartmentEditPart)childEditPart).getFigure());
+ pane.remove(((InteractionInteractionCompartmentEditPart) childEditPart).getFigure());
return true;
}
return false;
@@ -174,8 +178,9 @@ public class InteractionEditPart extends ShapeNodeEditPart {
/**
* @generated
*/
+ @Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -184,8 +189,9 @@ public class InteractionEditPart extends ShapeNodeEditPart {
/**
* @generated
*/
+ @Override
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -194,8 +200,9 @@ public class InteractionEditPart extends ShapeNodeEditPart {
/**
* @generated
*/
+ @Override
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof InteractionInteractionCompartmentEditPart) {
+ if (editPart instanceof InteractionInteractionCompartmentEditPart) {
return getPrimaryShape().getCompartmentFigure();
}
return getContentPane();
@@ -215,12 +222,13 @@ public class InteractionEditPart extends ShapeNodeEditPart {
/**
* 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() {
NodeFigure figure = createNodePlate();
figure.setLayoutManager(new StackLayout());
@@ -233,13 +241,13 @@ public class InteractionEditPart extends ShapeNodeEditPart {
/**
* Default implementation treats passed figure as content pane. Respects layout one may have set
* for generated figure.
- *
+ *
* @param nodeShape
- * instance of generated figure class
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -250,8 +258,9 @@ public class InteractionEditPart extends ShapeNodeEditPart {
/**
* @generated
*/
+ @Override
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -260,8 +269,9 @@ public class InteractionEditPart extends ShapeNodeEditPart {
/**
* @generated
*/
+ @Override
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -269,24 +279,27 @@ public class InteractionEditPart extends ShapeNodeEditPart {
/**
* @generated
*/
+ @Override
protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineWidth(width);
}
}
/**
* @generated
*/
+ @Override
protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineStyle(style);
}
}
/**
* @generated
*/
+ @Override
public EditPart getPrimaryChildEditPart() {
return getChildBySemanticHint(UMLVisualIDRegistry.getType(InteractionNameEditPart.VISUAL_ID));
}
@@ -311,403 +324,403 @@ public class InteractionEditPart extends ShapeNodeEditPart {
*/
public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
return types;
@@ -718,7 +731,7 @@ public class InteractionEditPart extends ShapeNodeEditPart {
*/
public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -738,7 +751,7 @@ public class InteractionEditPart extends ShapeNodeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -758,7 +771,7 @@ public class InteractionEditPart extends ShapeNodeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -778,7 +791,7 @@ public class InteractionEditPart extends ShapeNodeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -798,7 +811,7 @@ public class InteractionEditPart extends ShapeNodeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -818,7 +831,7 @@ public class InteractionEditPart extends ShapeNodeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -838,7 +851,7 @@ public class InteractionEditPart extends ShapeNodeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -885,7 +898,7 @@ public class InteractionEditPart extends ShapeNodeEditPart {
*/
public List<IElementType> getMATypesForSource(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -905,7 +918,7 @@ public class InteractionEditPart extends ShapeNodeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -925,7 +938,7 @@ public class InteractionEditPart extends ShapeNodeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -945,7 +958,7 @@ public class InteractionEditPart extends ShapeNodeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -965,7 +978,7 @@ public class InteractionEditPart extends ShapeNodeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -985,7 +998,7 @@ public class InteractionEditPart extends ShapeNodeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1005,7 +1018,7 @@ public class InteractionEditPart extends ShapeNodeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1025,14 +1038,14 @@ public class InteractionEditPart extends ShapeNodeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
+ } else if (relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
types.add(UMLElementTypes.Comment_3009);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
+ } else if (relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
types.add(UMLElementTypes.TimeConstraint_3019);
types.add(UMLElementTypes.DurationConstraint_3021);
types.add(UMLElementTypes.Constraint_3008);
types.add(UMLElementTypes.DurationConstraint_3023);
- } else if(relationshipType == UMLElementTypes.ConstraintContext_8500) {
+ } else if (relationshipType == UMLElementTypes.ConstraintContext_8500) {
types.add(UMLElementTypes.TimeConstraint_3019);
types.add(UMLElementTypes.DurationConstraint_3021);
types.add(UMLElementTypes.Constraint_3008);
@@ -1046,28 +1059,28 @@ public class InteractionEditPart extends ShapeNodeEditPart {
*/
@Override
public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ IPreferenceStore preferenceStore = (IPreferenceStore) getDiagramPreferencesHint().getPreferenceStore();
Object result = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("Interaction", PreferencesConstantsHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("Interaction", PreferencesConstantsHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("Interaction", PreferencesConstantsHelper.COLOR_FILL);
}
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor(preferenceStore, prefColor));
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
String prefGradient = PreferencesConstantsHelper.getElementConstant("Interaction", PreferencesConstantsHelper.COLOR_GRADIENT);
GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
result = gradientPreferenceConverter.getGradientData();
}
}
- if(result == null) {
+ if (result == null) {
result = getStructuralFeatureValue(feature);
}
return result;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionInteractionCompartmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionInteractionCompartmentEditPart.java
index cc7967489f6..c2c4908560b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionInteractionCompartmentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionInteractionCompartmentEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -56,6 +56,7 @@ public class InteractionInteractionCompartmentEditPart extends ShapeCompartmentE
/**
* @generated
*/
+ @Override
public String getCompartmentName() {
return Messages.InteractionInteractionCompartmentEditPart_title;
}
@@ -63,8 +64,9 @@ public class InteractionInteractionCompartmentEditPart extends ShapeCompartmentE
/**
* @generated
*/
+ @Override
public IFigure createFigure() {
- ResizableCompartmentFigure result = (ResizableCompartmentFigure)super.createFigure();
+ ResizableCompartmentFigure result = (ResizableCompartmentFigure) super.createFigure();
result.setTitleVisibility(false);
return result;
}
@@ -72,14 +74,15 @@ public class InteractionInteractionCompartmentEditPart extends ShapeCompartmentE
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new InteractionInteractionCompartmentItemSemanticEditPolicy());
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new PapyrusCreationEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(DuplicatePasteEditPolicy.PASTE_ROLE, new DuplicatePasteEditPolicy());
- //in Papyrus diagrams are not strongly synchronised
- //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.sequence.edit.policies.InteractionInteractionCompartmentCanonicalEditPolicy());
+ // in Papyrus diagrams are not strongly synchronised
+ // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.sequence.edit.policies.InteractionInteractionCompartmentCanonicalEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, new InteractionCompartmentXYLayoutEditPolicy());
installEditPolicy("RemoveOrphanView", new RemoveOrphanViewPolicy()); //$NON-NLS-1$
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
@@ -89,8 +92,9 @@ public class InteractionInteractionCompartmentEditPart extends ShapeCompartmentE
/**
* @generated
*/
+ @Override
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -98,9 +102,10 @@ public class InteractionInteractionCompartmentEditPart extends ShapeCompartmentE
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -110,18 +115,19 @@ public class InteractionInteractionCompartmentEditPart extends ShapeCompartmentE
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
}
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshBounds();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionNameEditPart.java
index 6bd2a077e97..2f29b39e1b9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionNameEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -108,14 +108,14 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -130,6 +130,7 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
@@ -141,12 +142,12 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -154,12 +155,12 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -167,12 +168,12 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -180,12 +181,12 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -203,6 +204,7 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -210,6 +212,7 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -234,10 +237,10 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -246,23 +249,25 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -278,21 +283,24 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -306,8 +314,9 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -316,6 +325,7 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -323,8 +333,9 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Interaction_2001, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionNameEditPart.VISUAL_ID));
}
return parser;
@@ -334,7 +345,7 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -358,8 +369,8 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -367,8 +378,8 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -377,41 +388,42 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -423,13 +435,14 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -449,6 +462,7 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -463,17 +477,17 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -481,15 +495,15 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -498,18 +512,19 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -518,6 +533,7 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -525,12 +541,13 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -540,9 +557,10 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -553,10 +571,12 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -574,17 +594,17 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see
* org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
// not a named element. no specific editor => do nothing
@@ -593,12 +613,12 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -606,7 +626,7 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -616,13 +636,13 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -632,23 +652,23 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -656,13 +676,14 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -678,6 +699,7 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* @generated
*/
+ @Override
protected void addNotationalListeners() {
super.addNotationalListeners();
addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
@@ -686,6 +708,7 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* @generated
*/
+ @Override
protected void removeNotationalListeners() {
super.removeNotationalListeners();
removeListenerFilter("PrimaryView"); //$NON-NLS-1$
@@ -694,27 +717,29 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -727,6 +752,7 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
@@ -740,6 +766,7 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* @generated
*/
+ @Override
public void activate() {
super.activate();
addOwnerElementListeners();
@@ -749,12 +776,13 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
}
/**
* @generated
*/
+ @Override
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionOperandEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionOperandEditPart.java
index dafaded252e..9feadc008b4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionOperandEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionOperandEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -98,13 +98,14 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new PapyrusCreationEditPolicy());
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new InteractionOperandItemSemanticEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
- //in Papyrus diagrams are not strongly synchronised
- //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.sequence.edit.policies.InteractionOperandCanonicalEditPolicy());
+ // in Papyrus diagrams are not strongly synchronised
+ // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.sequence.edit.policies.InteractionOperandCanonicalEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, new InteractionOperandLayoutEditPolicy());
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new InteractionOperandDragDropEditPolicy());
@@ -122,14 +123,15 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
protected LayoutEditPolicy createLayoutEditPolicy() {
XYLayoutEditPolicy lep = new XYLayoutEditPolicy() {
+ @Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case ContinuationEditPart.VISUAL_ID:
return new BorderItemResizableEditPolicy();
}
EditPolicy result = super.createChildEditPolicy(child);
- if(result == null) {
+ if (result == null) {
return new ResizableShapeEditPolicy();
}
return result;
@@ -144,6 +146,7 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
protected IFigure createNodeShape() {
return primaryShape = new CustomInteractionOperandFigure() {
+ @Override
protected boolean useLocalCoordinates() {
return true;
}
@@ -154,7 +157,7 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
* @generated
*/
public CustomInteractionOperandFigure getPrimaryShape() {
- return (CustomInteractionOperandFigure)primaryShape;
+ return (CustomInteractionOperandFigure) primaryShape;
}
/**
@@ -172,10 +175,11 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
/**
* @generated
*/
+ @Override
public EditPolicy getPrimaryDragEditPolicy() {
EditPolicy result = super.getPrimaryDragEditPolicy();
- if(result instanceof ResizableEditPolicy) {
- ResizableEditPolicy ep = (ResizableEditPolicy)result;
+ if (result instanceof ResizableEditPolicy) {
+ ResizableEditPolicy ep = (ResizableEditPolicy) result;
ep.setResizeDirections(PositionConstants.SOUTH);
}
return result;
@@ -183,12 +187,13 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
/**
* 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 createMainFigure() {
NodeFigure figure = createNodePlate();
figure.setLayoutManager(new StackLayout());
@@ -201,18 +206,19 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- *
+ *
* @param nodeShape
- * instance of generated figure class
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
nodeShape.setLayoutManager(new FreeformLayout() {
+ @Override
public Object getConstraint(IFigure figure) {
Object result = constraints.get(figure);
- if(result == null) {
+ if (result == null) {
result = new Rectangle(0, 0, -1, -1);
}
return result;
@@ -225,8 +231,9 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
/**
* @generated
*/
+ @Override
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -235,8 +242,9 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
/**
* @generated
*/
+ @Override
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -244,18 +252,20 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
/**
* @generated
*/
+ @Override
protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineWidth(width);
}
}
/**
* @generated
*/
+ @Override
protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineStyle(style);
}
}
@@ -302,28 +312,28 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
*/
@Override
public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ IPreferenceStore preferenceStore = (IPreferenceStore) getDiagramPreferencesHint().getPreferenceStore();
Object result = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("InteractionOperand", PreferencesConstantsHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("InteractionOperand", PreferencesConstantsHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("InteractionOperand", PreferencesConstantsHelper.COLOR_FILL);
}
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor(preferenceStore, prefColor));
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
String prefGradient = PreferencesConstantsHelper.getElementConstant("InteractionOperand", PreferencesConstantsHelper.COLOR_GRADIENT);
GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
result = gradientPreferenceConverter.getGradientData();
}
}
- if(result == null) {
+ if (result == null) {
result = getStructuralFeatureValue(feature);
}
return result;
@@ -349,403 +359,403 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
*/
public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionOperandEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionOperandEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionOperandEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionOperandEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionOperandEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionOperandEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionOperandEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
return types;
@@ -756,7 +766,7 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
*/
public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -776,7 +786,7 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -796,7 +806,7 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -816,7 +826,7 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -836,7 +846,7 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -856,7 +866,7 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -876,7 +886,7 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -923,7 +933,7 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
*/
public List<IElementType> getMATypesForSource(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -943,7 +953,7 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -963,7 +973,7 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -983,7 +993,7 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1003,7 +1013,7 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1023,7 +1033,7 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1043,7 +1053,7 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1063,14 +1073,14 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
+ } else if (relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
types.add(UMLElementTypes.Comment_3009);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
+ } else if (relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
types.add(UMLElementTypes.TimeConstraint_3019);
types.add(UMLElementTypes.DurationConstraint_3021);
types.add(UMLElementTypes.Constraint_3008);
types.add(UMLElementTypes.DurationConstraint_3023);
- } else if(relationshipType == UMLElementTypes.ConstraintContext_8500) {
+ } else if (relationshipType == UMLElementTypes.ConstraintContext_8500) {
types.add(UMLElementTypes.TimeConstraint_3019);
types.add(UMLElementTypes.DurationConstraint_3021);
types.add(UMLElementTypes.Constraint_3008);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionUseEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionUseEditPart.java
index 6b71cb6aa33..5decd3f9af8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionUseEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionUseEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -93,9 +93,10 @@ public class InteractionUseEditPart extends InteractionFragmentEditPart {
/**
* Papyrus codeGen
- *
+ *
* @generated
**/
+ @Override
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
}
@@ -106,18 +107,21 @@ public class InteractionUseEditPart extends InteractionFragmentEditPart {
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) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
}
+ @Override
protected Command getMoveChildrenCommand(Request request) {
return null;
}
+ @Override
protected Command getCreateCommand(CreateRequest request) {
return null;
}
@@ -136,19 +140,19 @@ public class InteractionUseEditPart extends InteractionFragmentEditPart {
* @generated
*/
public InteractionUseRectangleFigure getPrimaryShape() {
- return (InteractionUseRectangleFigure)primaryShape;
+ return (InteractionUseRectangleFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof InteractionUseNameEditPart) {
- ((InteractionUseNameEditPart)childEditPart).setLabel(getPrimaryShape().getHeaderLabel());
+ if (childEditPart instanceof InteractionUseNameEditPart) {
+ ((InteractionUseNameEditPart) childEditPart).setLabel(getPrimaryShape().getHeaderLabel());
return true;
}
- if(childEditPart instanceof InteractionUseName2EditPart) {
- ((InteractionUseName2EditPart)childEditPart).setLabel(getPrimaryShape().getCenterLabel());
+ if (childEditPart instanceof InteractionUseName2EditPart) {
+ ((InteractionUseName2EditPart) childEditPart).setLabel(getPrimaryShape().getCenterLabel());
return true;
}
return false;
@@ -158,10 +162,10 @@ public class InteractionUseEditPart extends InteractionFragmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof InteractionUseNameEditPart) {
+ if (childEditPart instanceof InteractionUseNameEditPart) {
return true;
}
- if(childEditPart instanceof InteractionUseName2EditPart) {
+ if (childEditPart instanceof InteractionUseName2EditPart) {
return true;
}
return false;
@@ -172,7 +176,7 @@ public class InteractionUseEditPart extends InteractionFragmentEditPart {
*/
@Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -183,7 +187,7 @@ public class InteractionUseEditPart extends InteractionFragmentEditPart {
*/
@Override
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -211,10 +215,10 @@ public class InteractionUseEditPart extends InteractionFragmentEditPart {
/**
* 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
@@ -230,13 +234,13 @@ public class InteractionUseEditPart extends InteractionFragmentEditPart {
/**
* Default implementation treats passed figure as content pane. Respects layout one may have set
* for generated figure.
- *
+ *
* @param nodeShape
- * instance of generated figure class
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -249,7 +253,7 @@ public class InteractionUseEditPart extends InteractionFragmentEditPart {
*/
@Override
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -260,7 +264,7 @@ public class InteractionUseEditPart extends InteractionFragmentEditPart {
*/
@Override
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -270,8 +274,8 @@ public class InteractionUseEditPart extends InteractionFragmentEditPart {
*/
@Override
protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineWidth(width);
}
}
@@ -280,8 +284,8 @@ public class InteractionUseEditPart extends InteractionFragmentEditPart {
*/
@Override
protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineStyle(style);
}
}
@@ -298,28 +302,28 @@ public class InteractionUseEditPart extends InteractionFragmentEditPart {
*/
@Override
public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ IPreferenceStore preferenceStore = (IPreferenceStore) getDiagramPreferencesHint().getPreferenceStore();
Object result = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("InteractionUse", PreferencesConstantsHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("InteractionUse", PreferencesConstantsHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("InteractionUse", PreferencesConstantsHelper.COLOR_FILL);
}
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor(preferenceStore, prefColor));
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
String prefGradient = PreferencesConstantsHelper.getElementConstant("InteractionUse", PreferencesConstantsHelper.COLOR_GRADIENT);
GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
result = gradientPreferenceConverter.getGradientData();
}
}
- if(result == null) {
+ if (result == null) {
result = getStructuralFeatureValue(feature);
}
return result;
@@ -345,403 +349,403 @@ public class InteractionUseEditPart extends InteractionFragmentEditPart {
*/
public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionUseEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionUseEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionUseEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionUseEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionUseEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionUseEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionUseEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
return types;
@@ -752,7 +756,7 @@ public class InteractionUseEditPart extends InteractionFragmentEditPart {
*/
public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -772,7 +776,7 @@ public class InteractionUseEditPart extends InteractionFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -792,7 +796,7 @@ public class InteractionUseEditPart extends InteractionFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -812,7 +816,7 @@ public class InteractionUseEditPart extends InteractionFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -832,7 +836,7 @@ public class InteractionUseEditPart extends InteractionFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -852,7 +856,7 @@ public class InteractionUseEditPart extends InteractionFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -872,7 +876,7 @@ public class InteractionUseEditPart extends InteractionFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -918,7 +922,7 @@ public class InteractionUseEditPart extends InteractionFragmentEditPart {
*/
public List<IElementType> getMATypesForSource(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -938,7 +942,7 @@ public class InteractionUseEditPart extends InteractionFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -958,7 +962,7 @@ public class InteractionUseEditPart extends InteractionFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -978,7 +982,7 @@ public class InteractionUseEditPart extends InteractionFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -998,7 +1002,7 @@ public class InteractionUseEditPart extends InteractionFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1018,7 +1022,7 @@ public class InteractionUseEditPart extends InteractionFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1038,7 +1042,7 @@ public class InteractionUseEditPart extends InteractionFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1058,9 +1062,9 @@ public class InteractionUseEditPart extends InteractionFragmentEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
+ } else if (relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
types.add(UMLElementTypes.Comment_3009);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
+ } else if (relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
types.add(UMLElementTypes.TimeConstraint_3019);
types.add(UMLElementTypes.DurationConstraint_3021);
types.add(UMLElementTypes.Constraint_3008);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionUseName2EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionUseName2EditPart.java
index e6a593f2459..04e3e87f0ad 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionUseName2EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionUseName2EditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -108,14 +108,14 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -130,6 +130,7 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
@@ -141,12 +142,12 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -154,12 +155,12 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -167,12 +168,12 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -180,12 +181,12 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -203,6 +204,7 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -210,6 +212,7 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -234,10 +237,10 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -246,23 +249,25 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -278,21 +283,24 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -306,8 +314,9 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -316,6 +325,7 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -323,8 +333,9 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.InteractionUse_3002, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionUseName2EditPart.VISUAL_ID));
}
return parser;
@@ -334,7 +345,7 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -358,8 +369,8 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -367,8 +378,8 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -377,41 +388,42 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -423,13 +435,14 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -449,6 +462,7 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -463,17 +477,17 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -481,15 +495,15 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -498,18 +512,19 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -518,6 +533,7 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -525,12 +541,13 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -540,9 +557,10 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -553,10 +571,12 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -574,7 +594,7 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see
* org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
@@ -586,12 +606,12 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -599,7 +619,7 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -609,13 +629,13 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -625,23 +645,23 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -649,13 +669,14 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -671,6 +692,7 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
protected void addNotationalListeners() {
super.addNotationalListeners();
addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
@@ -679,6 +701,7 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
protected void removeNotationalListeners() {
super.removeNotationalListeners();
removeListenerFilter("PrimaryView"); //$NON-NLS-1$
@@ -687,27 +710,29 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -720,6 +745,7 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
@@ -733,6 +759,7 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
public void activate() {
super.activate();
addOwnerElementListeners();
@@ -742,12 +769,13 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
}
/**
* @generated
*/
+ @Override
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionUseNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionUseNameEditPart.java
index 6358608ac83..361adf045d4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionUseNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionUseNameEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -108,14 +108,14 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -130,6 +130,7 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
@@ -141,12 +142,12 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -154,12 +155,12 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -167,12 +168,12 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -180,12 +181,12 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -203,6 +204,7 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -210,6 +212,7 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -234,10 +237,10 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -246,23 +249,25 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -278,21 +283,24 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -306,8 +314,9 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -316,6 +325,7 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -323,8 +333,9 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.InteractionUse_3002, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionUseNameEditPart.VISUAL_ID));
}
return parser;
@@ -334,7 +345,7 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -358,8 +369,8 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -367,8 +378,8 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -377,41 +388,42 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -423,13 +435,14 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -449,6 +462,7 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -463,17 +477,17 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -481,15 +495,15 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -498,18 +512,19 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -518,6 +533,7 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -525,12 +541,13 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -540,9 +557,10 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -553,10 +571,12 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -574,7 +594,7 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see
* org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
@@ -586,12 +606,12 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -599,7 +619,7 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -609,13 +629,13 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -625,23 +645,23 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -649,13 +669,14 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -671,6 +692,7 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
protected void addNotationalListeners() {
super.addNotationalListeners();
addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
@@ -679,6 +701,7 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
protected void removeNotationalListeners() {
super.removeNotationalListeners();
removeListenerFilter("PrimaryView"); //$NON-NLS-1$
@@ -687,27 +710,29 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -720,6 +745,7 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
@@ -733,6 +759,7 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
public void activate() {
super.activate();
addOwnerElementListeners();
@@ -742,12 +769,13 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
}
/**
* @generated
*/
+ @Override
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/LifelineEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/LifelineEditPart.java
index 4f5de3c1df4..9a246479f40 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/LifelineEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/LifelineEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -102,8 +102,8 @@ public class LifelineEditPart extends NamedElementEditPart {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new LifelineItemSemanticEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
- //in Papyrus diagrams are not strongly synchronised
- //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.sequence.edit.policies.LifelineCanonicalEditPolicy());
+ // in Papyrus diagrams are not strongly synchronised
+ // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.sequence.edit.policies.LifelineCanonicalEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, new LifelineXYLayoutEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
@@ -117,9 +117,10 @@ public class LifelineEditPart extends NamedElementEditPart {
/**
* Papyrus codeGen
- *
+ *
* @generated
**/
+ @Override
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
}
@@ -130,9 +131,10 @@ public class LifelineEditPart extends NamedElementEditPart {
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) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case StateInvariantEditPart.VISUAL_ID:
case TimeConstraintEditPart.VISUAL_ID:
case TimeObservationEditPart.VISUAL_ID:
@@ -141,16 +143,18 @@ public class LifelineEditPart extends NamedElementEditPart {
return new BorderItemResizableEditPolicy();
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
}
+ @Override
protected Command getMoveChildrenCommand(Request request) {
return null;
}
+ @Override
protected Command getCreateCommand(CreateRequest request) {
return null;
}
@@ -161,6 +165,7 @@ public class LifelineEditPart extends NamedElementEditPart {
/**
* @generated
*/
+ @Override
protected IFigure createNodeShape() {
return primaryShape = new LifelineFigure();
}
@@ -168,46 +173,47 @@ public class LifelineEditPart extends NamedElementEditPart {
/**
* @generated
*/
+ @Override
public LifelineFigure getPrimaryShape() {
- return (LifelineFigure)primaryShape;
+ return (LifelineFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof LifelineNameEditPart) {
- ((LifelineNameEditPart)childEditPart).setLabel(getPrimaryShape().getFigureLifelineLabelFigure());
+ if (childEditPart instanceof LifelineNameEditPart) {
+ ((LifelineNameEditPart) childEditPart).setLabel(getPrimaryShape().getFigureLifelineLabelFigure());
return true;
}
- //Papyrus Gencode :Specific locator for the itemBorder of the lifeline.
- if(childEditPart instanceof StateInvariantEditPart) {
+ // Papyrus Gencode :Specific locator for the itemBorder of the lifeline.
+ if (childEditPart instanceof StateInvariantEditPart) {
IBorderItemLocator locator = new CenterLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((StateInvariantEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((StateInvariantEditPart) childEditPart).getFigure(), locator);
return true;
}
- //Papyrus Gencode :Affixed locator for Lifelines to place element with a time bar
- if(childEditPart instanceof TimeConstraintEditPart) {
+ // Papyrus Gencode :Affixed locator for Lifelines to place element with a time bar
+ if (childEditPart instanceof TimeConstraintEditPart) {
IBorderItemLocator locator = new TimeMarkElementPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((TimeConstraintEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((TimeConstraintEditPart) childEditPart).getFigure(), locator);
return true;
}
- //Papyrus Gencode :Affixed locator for Lifelines to place element with a time bar
- if(childEditPart instanceof TimeObservationEditPart) {
+ // Papyrus Gencode :Affixed locator for Lifelines to place element with a time bar
+ if (childEditPart instanceof TimeObservationEditPart) {
IBorderItemLocator locator = new TimeMarkElementPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((TimeObservationEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((TimeObservationEditPart) childEditPart).getFigure(), locator);
return true;
}
- //Papyrus Gencode :Affixed locator for Lifelines to place element with a time bar
- if(childEditPart instanceof DurationConstraintEditPart) {
+ // Papyrus Gencode :Affixed locator for Lifelines to place element with a time bar
+ if (childEditPart instanceof DurationConstraintEditPart) {
IBorderItemLocator locator = new TimeMarkElementPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((DurationConstraintEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((DurationConstraintEditPart) childEditPart).getFigure(), locator);
return true;
}
- //Papyrus Gencode :Specific locator for the itemBorder of the lifeline.
- if(childEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ // Papyrus Gencode :Specific locator for the itemBorder of the lifeline.
+ if (childEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
IBorderItemLocator locator = new CenterLocator(getMainFigure(), PositionConstants.SOUTH);
- getBorderedFigure().getBorderItemContainer().add(((DestructionOccurrenceSpecificationEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((DestructionOccurrenceSpecificationEditPart) childEditPart).getFigure(), locator);
return true;
}
return false;
@@ -217,27 +223,27 @@ public class LifelineEditPart extends NamedElementEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof LifelineNameEditPart) {
+ if (childEditPart instanceof LifelineNameEditPart) {
return true;
}
- if(childEditPart instanceof StateInvariantEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((StateInvariantEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof StateInvariantEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((StateInvariantEditPart) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof TimeConstraintEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((TimeConstraintEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof TimeConstraintEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((TimeConstraintEditPart) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof TimeObservationEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((TimeObservationEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof TimeObservationEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((TimeObservationEditPart) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof DurationConstraintEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((DurationConstraintEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof DurationConstraintEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((DurationConstraintEditPart) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((DestructionOccurrenceSpecificationEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((DestructionOccurrenceSpecificationEditPart) childEditPart).getFigure());
return true;
}
return false;
@@ -248,7 +254,7 @@ public class LifelineEditPart extends NamedElementEditPart {
*/
@Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -259,7 +265,7 @@ public class LifelineEditPart extends NamedElementEditPart {
*/
@Override
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -267,11 +273,12 @@ public class LifelineEditPart extends NamedElementEditPart {
/**
* {@inheritDoc}
- *
+ *
* @generated
*/
+ @Override
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -280,9 +287,10 @@ public class LifelineEditPart extends NamedElementEditPart {
/**
* Overrides to disable the defaultAnchorArea. The edge is now more stuck with the middle of the
* figure.
- *
+ *
* @generated
*/
+ @Override
protected NodeFigure createNodePlate() {
String prefElementId = "Lifeline";
IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
@@ -294,12 +302,13 @@ public class LifelineEditPart extends NamedElementEditPart {
/**
* 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 createMainFigure() {
NodeFigure figure = createNodePlate();
figure.setLayoutManager(new StackLayout());
@@ -312,13 +321,14 @@ public class LifelineEditPart extends NamedElementEditPart {
/**
* Default implementation treats passed figure as content pane. Respects layout one may have set
* for generated figure.
- *
+ *
* @param nodeShape
- * instance of generated figure class
+ * instance of generated figure class
* @generated
*/
+ @Override
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -331,7 +341,7 @@ public class LifelineEditPart extends NamedElementEditPart {
*/
@Override
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -342,7 +352,7 @@ public class LifelineEditPart extends NamedElementEditPart {
*/
@Override
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -352,8 +362,8 @@ public class LifelineEditPart extends NamedElementEditPart {
*/
@Override
protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineWidth(width);
}
}
@@ -362,8 +372,8 @@ public class LifelineEditPart extends NamedElementEditPart {
*/
@Override
protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineStyle(style);
}
}
@@ -395,403 +405,403 @@ public class LifelineEditPart extends NamedElementEditPart {
*/
public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
return types;
@@ -802,7 +812,7 @@ public class LifelineEditPart extends NamedElementEditPart {
*/
public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -822,7 +832,7 @@ public class LifelineEditPart extends NamedElementEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -842,7 +852,7 @@ public class LifelineEditPart extends NamedElementEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -862,7 +872,7 @@ public class LifelineEditPart extends NamedElementEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -882,7 +892,7 @@ public class LifelineEditPart extends NamedElementEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -902,7 +912,7 @@ public class LifelineEditPart extends NamedElementEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -922,7 +932,7 @@ public class LifelineEditPart extends NamedElementEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -968,7 +978,7 @@ public class LifelineEditPart extends NamedElementEditPart {
*/
public List<IElementType> getMATypesForSource(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -988,7 +998,7 @@ public class LifelineEditPart extends NamedElementEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1008,7 +1018,7 @@ public class LifelineEditPart extends NamedElementEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1028,7 +1038,7 @@ public class LifelineEditPart extends NamedElementEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1048,7 +1058,7 @@ public class LifelineEditPart extends NamedElementEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1068,7 +1078,7 @@ public class LifelineEditPart extends NamedElementEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1088,7 +1098,7 @@ public class LifelineEditPart extends NamedElementEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1108,9 +1118,9 @@ public class LifelineEditPart extends NamedElementEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
+ } else if (relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
types.add(UMLElementTypes.Comment_3009);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
+ } else if (relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
types.add(UMLElementTypes.TimeConstraint_3019);
types.add(UMLElementTypes.DurationConstraint_3021);
types.add(UMLElementTypes.Constraint_3008);
@@ -1124,28 +1134,28 @@ public class LifelineEditPart extends NamedElementEditPart {
*/
@Override
public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ IPreferenceStore preferenceStore = (IPreferenceStore) getDiagramPreferencesHint().getPreferenceStore();
Object result = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("Lifeline", PreferencesConstantsHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("Lifeline", PreferencesConstantsHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("Lifeline", PreferencesConstantsHelper.COLOR_FILL);
}
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor(preferenceStore, prefColor));
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
String prefGradient = PreferencesConstantsHelper.getElementConstant("Lifeline", PreferencesConstantsHelper.COLOR_GRADIENT);
GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
result = gradientPreferenceConverter.getGradientData();
}
}
- if(result == null) {
+ if (result == null) {
result = getStructuralFeatureValue(feature);
}
return result;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/LifelineNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/LifelineNameEditPart.java
index 3964f9459f4..8a4bd16781a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/LifelineNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/LifelineNameEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -108,14 +108,14 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -130,6 +130,7 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
@@ -141,12 +142,12 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -154,12 +155,12 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -167,12 +168,12 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -180,12 +181,12 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -203,6 +204,7 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -210,6 +212,7 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -234,10 +237,10 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -246,23 +249,25 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -278,21 +283,24 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -306,8 +314,9 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -316,6 +325,7 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -323,8 +333,9 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Lifeline_3001, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineNameEditPart.VISUAL_ID));
}
return parser;
@@ -334,7 +345,7 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -358,8 +369,8 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -367,8 +378,8 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -377,44 +388,45 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
/**
* This methods is no more generated to handle the case of editing the name of a lifeline
* with a directEdition when its properties represents and decomposedAs are null
- *
+ *
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -426,13 +438,14 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -452,6 +465,7 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -466,17 +480,17 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -484,15 +498,15 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -501,18 +515,19 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -521,6 +536,7 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -528,12 +544,13 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -543,9 +560,10 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -556,10 +574,12 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -572,22 +592,22 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
private View getFontStyleOwnerView() {
- return (View)getModel();
+ return (View) getModel();
}
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see
* org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
// not a named element. no specific editor => do nothing
@@ -596,12 +616,12 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -609,7 +629,7 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -619,13 +639,13 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -635,23 +655,23 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -659,13 +679,14 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -681,6 +702,7 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
/**
* @generated
*/
+ @Override
protected void addNotationalListeners() {
super.addNotationalListeners();
addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
@@ -689,6 +711,7 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
/**
* @generated
*/
+ @Override
protected void removeNotationalListeners() {
super.removeNotationalListeners();
removeListenerFilter("PrimaryView"); //$NON-NLS-1$
@@ -697,27 +720,29 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -730,6 +755,7 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
@@ -743,6 +769,7 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
/**
* @generated
*/
+ @Override
public void activate() {
super.activate();
addOwnerElementListeners();
@@ -752,12 +779,13 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
}
/**
* @generated
*/
+ @Override
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Message2EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Message2EditPart.java
index 4054947c9b2..e1ff86b0bb8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Message2EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Message2EditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -19,6 +19,7 @@ import org.eclipse.gef.EditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.CreationOnMessageEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.Message2ItemSemanticEditPolicy;
@@ -46,12 +47,13 @@ public class Message2EditPart extends AbstractMessageEditPart implements ITreeBr
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new Message2ItemSemanticEditPolicy());
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationOnMessageEditPolicy());
installEditPolicy(EditPolicy.CONNECTION_ROLE, new MessageConnectionEditPolicy());
- installEditPolicy(AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeLinkLabelDisplayEditPolicy());
+ installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeLinkLabelDisplayEditPolicy());
installEditPolicy(EditPolicy.CONNECTION_BENDPOINTS_ROLE, new MessageConnectionLineSegEditPolicy());
}
@@ -59,12 +61,12 @@ public class Message2EditPart extends AbstractMessageEditPart implements ITreeBr
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof MessageName2EditPart) {
- ((MessageName2EditPart)childEditPart).setLabel(getPrimaryShape().getMessageLabelFigure());
+ if (childEditPart instanceof MessageName2EditPart) {
+ ((MessageName2EditPart) childEditPart).setLabel(getPrimaryShape().getMessageLabelFigure());
return true;
}
- if(childEditPart instanceof MessageAsyncAppliedStereotypeEditPart) {
- ((MessageAsyncAppliedStereotypeEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
+ if (childEditPart instanceof MessageAsyncAppliedStereotypeEditPart) {
+ ((MessageAsyncAppliedStereotypeEditPart) childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
return true;
}
return false;
@@ -73,8 +75,9 @@ public class Message2EditPart extends AbstractMessageEditPart implements ITreeBr
/**
* @generated
*/
+ @Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -84,10 +87,10 @@ public class Message2EditPart extends AbstractMessageEditPart implements ITreeBr
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof MessageName2EditPart) {
+ if (childEditPart instanceof MessageName2EditPart) {
return true;
}
- if(childEditPart instanceof MessageAsyncAppliedStereotypeEditPart) {
+ if (childEditPart instanceof MessageAsyncAppliedStereotypeEditPart) {
return true;
}
return false;
@@ -96,8 +99,9 @@ public class Message2EditPart extends AbstractMessageEditPart implements ITreeBr
/**
* @generated
*/
+ @Override
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -105,12 +109,13 @@ public class Message2EditPart extends AbstractMessageEditPart implements ITreeBr
/**
* 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 Connection createConnectionFigure() {
return new MessageAsync();
}
@@ -118,7 +123,8 @@ public class Message2EditPart extends AbstractMessageEditPart implements ITreeBr
/**
* @generated
*/
+ @Override
public MessageAsync getPrimaryShape() {
- return (MessageAsync)getFigure();
+ return (MessageAsync) getFigure();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Message3EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Message3EditPart.java
index 72e1690540b..751050349c5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Message3EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Message3EditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -19,6 +19,7 @@ import org.eclipse.gef.EditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.CreationOnMessageEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.Message3ItemSemanticEditPolicy;
@@ -46,12 +47,13 @@ public class Message3EditPart extends AbstractMessageEditPart implements ITreeBr
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new Message3ItemSemanticEditPolicy());
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationOnMessageEditPolicy());
installEditPolicy(EditPolicy.CONNECTION_ROLE, new MessageConnectionEditPolicy());
- installEditPolicy(AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeLinkLabelDisplayEditPolicy());
+ installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeLinkLabelDisplayEditPolicy());
installEditPolicy(EditPolicy.CONNECTION_BENDPOINTS_ROLE, new MessageConnectionLineSegEditPolicy());
}
@@ -59,12 +61,12 @@ public class Message3EditPart extends AbstractMessageEditPart implements ITreeBr
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof MessageName3EditPart) {
- ((MessageName3EditPart)childEditPart).setLabel(getPrimaryShape().getMessageLabelFigure());
+ if (childEditPart instanceof MessageName3EditPart) {
+ ((MessageName3EditPart) childEditPart).setLabel(getPrimaryShape().getMessageLabelFigure());
return true;
}
- if(childEditPart instanceof MessageReplyAppliedStereotypeEditPart) {
- ((MessageReplyAppliedStereotypeEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
+ if (childEditPart instanceof MessageReplyAppliedStereotypeEditPart) {
+ ((MessageReplyAppliedStereotypeEditPart) childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
return true;
}
return false;
@@ -73,8 +75,9 @@ public class Message3EditPart extends AbstractMessageEditPart implements ITreeBr
/**
* @generated
*/
+ @Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -84,10 +87,10 @@ public class Message3EditPart extends AbstractMessageEditPart implements ITreeBr
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof MessageName3EditPart) {
+ if (childEditPart instanceof MessageName3EditPart) {
return true;
}
- if(childEditPart instanceof MessageReplyAppliedStereotypeEditPart) {
+ if (childEditPart instanceof MessageReplyAppliedStereotypeEditPart) {
return true;
}
return false;
@@ -96,8 +99,9 @@ public class Message3EditPart extends AbstractMessageEditPart implements ITreeBr
/**
* @generated
*/
+ @Override
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -105,12 +109,13 @@ public class Message3EditPart extends AbstractMessageEditPart implements ITreeBr
/**
* 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 Connection createConnectionFigure() {
return new MessageReply();
}
@@ -118,7 +123,8 @@ public class Message3EditPart extends AbstractMessageEditPart implements ITreeBr
/**
* @generated
*/
+ @Override
public MessageReply getPrimaryShape() {
- return (MessageReply)getFigure();
+ return (MessageReply) getFigure();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Message4EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Message4EditPart.java
index 4d6db0ae49b..a9c7412314c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Message4EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Message4EditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -19,6 +19,7 @@ import org.eclipse.gef.EditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.CreationOnMessageEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.Message4ItemSemanticEditPolicy;
@@ -46,12 +47,13 @@ public class Message4EditPart extends AbstractMessageEditPart implements ITreeBr
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new Message4ItemSemanticEditPolicy());
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationOnMessageEditPolicy());
installEditPolicy(EditPolicy.CONNECTION_ROLE, new MessageConnectionEditPolicy());
- installEditPolicy(AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeLinkLabelDisplayEditPolicy());
+ installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeLinkLabelDisplayEditPolicy());
installEditPolicy(EditPolicy.CONNECTION_BENDPOINTS_ROLE, new MessageConnectionLineSegEditPolicy());
}
@@ -59,12 +61,12 @@ public class Message4EditPart extends AbstractMessageEditPart implements ITreeBr
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof MessageName4EditPart) {
- ((MessageName4EditPart)childEditPart).setLabel(getPrimaryShape().getMessageLabelFigure());
+ if (childEditPart instanceof MessageName4EditPart) {
+ ((MessageName4EditPart) childEditPart).setLabel(getPrimaryShape().getMessageLabelFigure());
return true;
}
- if(childEditPart instanceof MessageCreateAppliedStereotypeEditPart) {
- ((MessageCreateAppliedStereotypeEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
+ if (childEditPart instanceof MessageCreateAppliedStereotypeEditPart) {
+ ((MessageCreateAppliedStereotypeEditPart) childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
return true;
}
return false;
@@ -73,8 +75,9 @@ public class Message4EditPart extends AbstractMessageEditPart implements ITreeBr
/**
* @generated
*/
+ @Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -84,10 +87,10 @@ public class Message4EditPart extends AbstractMessageEditPart implements ITreeBr
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof MessageName4EditPart) {
+ if (childEditPart instanceof MessageName4EditPart) {
return true;
}
- if(childEditPart instanceof MessageCreateAppliedStereotypeEditPart) {
+ if (childEditPart instanceof MessageCreateAppliedStereotypeEditPart) {
return true;
}
return false;
@@ -96,8 +99,9 @@ public class Message4EditPart extends AbstractMessageEditPart implements ITreeBr
/**
* @generated
*/
+ @Override
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -105,12 +109,13 @@ public class Message4EditPart extends AbstractMessageEditPart implements ITreeBr
/**
* 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 Connection createConnectionFigure() {
return new MessageCreate();
}
@@ -118,7 +123,8 @@ public class Message4EditPart extends AbstractMessageEditPart implements ITreeBr
/**
* @generated
*/
+ @Override
public MessageCreate getPrimaryShape() {
- return (MessageCreate)getFigure();
+ return (MessageCreate) getFigure();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Message5EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Message5EditPart.java
index fe40cd34fde..fd7b2e32ff3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Message5EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Message5EditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -19,6 +19,7 @@ import org.eclipse.gef.EditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.CreationOnMessageEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.Message5ItemSemanticEditPolicy;
@@ -46,12 +47,13 @@ public class Message5EditPart extends AbstractMessageEditPart implements ITreeBr
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new Message5ItemSemanticEditPolicy());
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationOnMessageEditPolicy());
installEditPolicy(EditPolicy.CONNECTION_ROLE, new MessageConnectionEditPolicy());
- installEditPolicy(AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeLinkLabelDisplayEditPolicy());
+ installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeLinkLabelDisplayEditPolicy());
installEditPolicy(EditPolicy.CONNECTION_BENDPOINTS_ROLE, new MessageConnectionLineSegEditPolicy());
}
@@ -59,12 +61,12 @@ public class Message5EditPart extends AbstractMessageEditPart implements ITreeBr
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof MessageName5EditPart) {
- ((MessageName5EditPart)childEditPart).setLabel(getPrimaryShape().getMessageLabelFigure());
+ if (childEditPart instanceof MessageName5EditPart) {
+ ((MessageName5EditPart) childEditPart).setLabel(getPrimaryShape().getMessageLabelFigure());
return true;
}
- if(childEditPart instanceof MessageDeleteAppliedStereotypeEditPart) {
- ((MessageDeleteAppliedStereotypeEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
+ if (childEditPart instanceof MessageDeleteAppliedStereotypeEditPart) {
+ ((MessageDeleteAppliedStereotypeEditPart) childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
return true;
}
return false;
@@ -73,8 +75,9 @@ public class Message5EditPart extends AbstractMessageEditPart implements ITreeBr
/**
* @generated
*/
+ @Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -84,10 +87,10 @@ public class Message5EditPart extends AbstractMessageEditPart implements ITreeBr
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof MessageName5EditPart) {
+ if (childEditPart instanceof MessageName5EditPart) {
return true;
}
- if(childEditPart instanceof MessageDeleteAppliedStereotypeEditPart) {
+ if (childEditPart instanceof MessageDeleteAppliedStereotypeEditPart) {
return true;
}
return false;
@@ -96,8 +99,9 @@ public class Message5EditPart extends AbstractMessageEditPart implements ITreeBr
/**
* @generated
*/
+ @Override
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -105,12 +109,13 @@ public class Message5EditPart extends AbstractMessageEditPart implements ITreeBr
/**
* 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 Connection createConnectionFigure() {
return new MessageDelete();
}
@@ -118,7 +123,8 @@ public class Message5EditPart extends AbstractMessageEditPart implements ITreeBr
/**
* @generated
*/
+ @Override
public MessageDelete getPrimaryShape() {
- return (MessageDelete)getFigure();
+ return (MessageDelete) getFigure();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Message6EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Message6EditPart.java
index 18c2efe0e3d..c62fa0fe79b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Message6EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Message6EditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -19,6 +19,7 @@ import org.eclipse.gef.EditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.CreationOnMessageEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.Message6ItemSemanticEditPolicy;
@@ -46,12 +47,13 @@ public class Message6EditPart extends AbstractMessageEditPart implements ITreeBr
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new Message6ItemSemanticEditPolicy());
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationOnMessageEditPolicy());
installEditPolicy(EditPolicy.CONNECTION_ROLE, new MessageConnectionEditPolicy());
- installEditPolicy(AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeLinkLabelDisplayEditPolicy());
+ installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeLinkLabelDisplayEditPolicy());
installEditPolicy(EditPolicy.CONNECTION_BENDPOINTS_ROLE, new MessageConnectionLineSegEditPolicy());
}
@@ -59,12 +61,12 @@ public class Message6EditPart extends AbstractMessageEditPart implements ITreeBr
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof MessageName6EditPart) {
- ((MessageName6EditPart)childEditPart).setLabel(getPrimaryShape().getMessageLabelFigure());
+ if (childEditPart instanceof MessageName6EditPart) {
+ ((MessageName6EditPart) childEditPart).setLabel(getPrimaryShape().getMessageLabelFigure());
return true;
}
- if(childEditPart instanceof MessageLostAppliedStereotypeEditPart) {
- ((MessageLostAppliedStereotypeEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
+ if (childEditPart instanceof MessageLostAppliedStereotypeEditPart) {
+ ((MessageLostAppliedStereotypeEditPart) childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
return true;
}
return false;
@@ -73,8 +75,9 @@ public class Message6EditPart extends AbstractMessageEditPart implements ITreeBr
/**
* @generated
*/
+ @Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -84,10 +87,10 @@ public class Message6EditPart extends AbstractMessageEditPart implements ITreeBr
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof MessageName6EditPart) {
+ if (childEditPart instanceof MessageName6EditPart) {
return true;
}
- if(childEditPart instanceof MessageLostAppliedStereotypeEditPart) {
+ if (childEditPart instanceof MessageLostAppliedStereotypeEditPart) {
return true;
}
return false;
@@ -96,8 +99,9 @@ public class Message6EditPart extends AbstractMessageEditPart implements ITreeBr
/**
* @generated
*/
+ @Override
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -105,12 +109,13 @@ public class Message6EditPart extends AbstractMessageEditPart implements ITreeBr
/**
* 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 Connection createConnectionFigure() {
return new MessageLost();
}
@@ -118,7 +123,8 @@ public class Message6EditPart extends AbstractMessageEditPart implements ITreeBr
/**
* @generated
*/
+ @Override
public MessageLost getPrimaryShape() {
- return (MessageLost)getFigure();
+ return (MessageLost) getFigure();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Message7EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Message7EditPart.java
index bdf7f2700f9..4ef66a07da0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Message7EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Message7EditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -19,6 +19,7 @@ import org.eclipse.gef.EditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.CreationOnMessageEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.Message7ItemSemanticEditPolicy;
@@ -46,12 +47,13 @@ public class Message7EditPart extends AbstractMessageEditPart implements ITreeBr
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new Message7ItemSemanticEditPolicy());
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationOnMessageEditPolicy());
installEditPolicy(EditPolicy.CONNECTION_ROLE, new MessageConnectionEditPolicy());
- installEditPolicy(AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeLinkLabelDisplayEditPolicy());
+ installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeLinkLabelDisplayEditPolicy());
installEditPolicy(EditPolicy.CONNECTION_BENDPOINTS_ROLE, new MessageConnectionLineSegEditPolicy());
}
@@ -59,12 +61,12 @@ public class Message7EditPart extends AbstractMessageEditPart implements ITreeBr
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof MessageName7EditPart) {
- ((MessageName7EditPart)childEditPart).setLabel(getPrimaryShape().getMessageLabelFigure());
+ if (childEditPart instanceof MessageName7EditPart) {
+ ((MessageName7EditPart) childEditPart).setLabel(getPrimaryShape().getMessageLabelFigure());
return true;
}
- if(childEditPart instanceof MessageFoundAppliedStereotypeEditPart) {
- ((MessageFoundAppliedStereotypeEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
+ if (childEditPart instanceof MessageFoundAppliedStereotypeEditPart) {
+ ((MessageFoundAppliedStereotypeEditPart) childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
return true;
}
return false;
@@ -73,8 +75,9 @@ public class Message7EditPart extends AbstractMessageEditPart implements ITreeBr
/**
* @generated
*/
+ @Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -84,10 +87,10 @@ public class Message7EditPart extends AbstractMessageEditPart implements ITreeBr
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof MessageName7EditPart) {
+ if (childEditPart instanceof MessageName7EditPart) {
return true;
}
- if(childEditPart instanceof MessageFoundAppliedStereotypeEditPart) {
+ if (childEditPart instanceof MessageFoundAppliedStereotypeEditPart) {
return true;
}
return false;
@@ -96,8 +99,9 @@ public class Message7EditPart extends AbstractMessageEditPart implements ITreeBr
/**
* @generated
*/
+ @Override
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -105,12 +109,13 @@ public class Message7EditPart extends AbstractMessageEditPart implements ITreeBr
/**
* 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 Connection createConnectionFigure() {
return new MessageFound();
}
@@ -118,7 +123,8 @@ public class Message7EditPart extends AbstractMessageEditPart implements ITreeBr
/**
* @generated
*/
+ @Override
public MessageFound getPrimaryShape() {
- return (MessageFound)getFigure();
+ return (MessageFound) getFigure();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageAsyncAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageAsyncAppliedStereotypeEditPart.java
index 5082d60da07..de39809c20f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageAsyncAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageAsyncAppliedStereotypeEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -109,14 +109,14 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -137,6 +137,7 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
@@ -147,6 +148,7 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public int getKeyPoint() {
return ConnectionLocator.MIDDLE;
}
@@ -155,12 +157,12 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -168,12 +170,12 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -181,12 +183,12 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -194,12 +196,12 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -217,6 +219,7 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -224,6 +227,7 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -248,10 +252,10 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -260,23 +264,25 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -292,21 +298,24 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -320,8 +329,9 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -330,6 +340,7 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -337,8 +348,9 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Message_4004, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageAsyncAppliedStereotypeEditPart.VISUAL_ID));
}
return parser;
@@ -348,7 +360,7 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -372,8 +384,8 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -381,8 +393,8 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -391,41 +403,42 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -437,13 +450,14 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -463,6 +477,7 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -477,17 +492,17 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -495,15 +510,15 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -512,18 +527,19 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -532,6 +548,7 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -539,12 +556,13 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -554,9 +572,10 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -567,10 +586,12 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -583,12 +604,12 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
private View getFontStyleOwnerView() {
- return (View)getModel();
+ return (View) getModel();
}
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
@@ -599,12 +620,12 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -612,7 +633,7 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -622,13 +643,13 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -638,23 +659,23 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -662,13 +683,14 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -684,26 +706,28 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -716,6 +740,7 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageCreateAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageCreateAppliedStereotypeEditPart.java
index 50b02808301..9213ec41d19 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageCreateAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageCreateAppliedStereotypeEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -109,14 +109,14 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -137,6 +137,7 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
@@ -147,6 +148,7 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public int getKeyPoint() {
return ConnectionLocator.MIDDLE;
}
@@ -155,12 +157,12 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -168,12 +170,12 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -181,12 +183,12 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -194,12 +196,12 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -217,6 +219,7 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -224,6 +227,7 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -248,10 +252,10 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -260,23 +264,25 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -292,21 +298,24 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -320,8 +329,9 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -330,6 +340,7 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -337,8 +348,9 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Message_4006, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageCreateAppliedStereotypeEditPart.VISUAL_ID));
}
return parser;
@@ -348,7 +360,7 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -372,8 +384,8 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -381,8 +393,8 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -391,41 +403,42 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -437,13 +450,14 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -463,6 +477,7 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -477,17 +492,17 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -495,15 +510,15 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -512,18 +527,19 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -532,6 +548,7 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -539,12 +556,13 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -554,9 +572,10 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -567,10 +586,12 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -583,12 +604,12 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
private View getFontStyleOwnerView() {
- return (View)getModel();
+ return (View) getModel();
}
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
@@ -599,12 +620,12 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -612,7 +633,7 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -622,13 +643,13 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -638,23 +659,23 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -662,13 +683,14 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -684,26 +706,28 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -716,6 +740,7 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageDeleteAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageDeleteAppliedStereotypeEditPart.java
index ca8fa1711a5..fc31e1d94da 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageDeleteAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageDeleteAppliedStereotypeEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -109,14 +109,14 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -137,6 +137,7 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
@@ -147,6 +148,7 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public int getKeyPoint() {
return ConnectionLocator.MIDDLE;
}
@@ -155,12 +157,12 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -168,12 +170,12 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -181,12 +183,12 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -194,12 +196,12 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -217,6 +219,7 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -224,6 +227,7 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -248,10 +252,10 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -260,23 +264,25 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -292,21 +298,24 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -320,8 +329,9 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -330,6 +340,7 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -337,8 +348,9 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Message_4007, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageDeleteAppliedStereotypeEditPart.VISUAL_ID));
}
return parser;
@@ -348,7 +360,7 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -372,8 +384,8 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -381,8 +393,8 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -391,41 +403,42 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -437,13 +450,14 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -463,6 +477,7 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -477,17 +492,17 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -495,15 +510,15 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -512,18 +527,19 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -532,6 +548,7 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -539,12 +556,13 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -554,9 +572,10 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -567,10 +586,12 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -583,12 +604,12 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
private View getFontStyleOwnerView() {
- return (View)getModel();
+ return (View) getModel();
}
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
@@ -599,12 +620,12 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -612,7 +633,7 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -622,13 +643,13 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -638,23 +659,23 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -662,13 +683,14 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -684,26 +706,28 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -716,6 +740,7 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageEditPart.java
index dcbba277584..9c6ff42daf8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -19,6 +19,7 @@ import org.eclipse.gef.EditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.CreationOnMessageEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.MessageConnectionEditPolicy;
@@ -46,12 +47,13 @@ public class MessageEditPart extends AbstractMessageEditPart implements ITreeBra
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new MessageItemSemanticEditPolicy());
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationOnMessageEditPolicy());
installEditPolicy(EditPolicy.CONNECTION_ROLE, new MessageConnectionEditPolicy());
- installEditPolicy(AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeLinkLabelDisplayEditPolicy());
+ installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeLinkLabelDisplayEditPolicy());
installEditPolicy(EditPolicy.CONNECTION_BENDPOINTS_ROLE, new MessageConnectionLineSegEditPolicy());
}
@@ -59,12 +61,12 @@ public class MessageEditPart extends AbstractMessageEditPart implements ITreeBra
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof MessageNameEditPart) {
- ((MessageNameEditPart)childEditPart).setLabel(getPrimaryShape().getMessageLabelFigure());
+ if (childEditPart instanceof MessageNameEditPart) {
+ ((MessageNameEditPart) childEditPart).setLabel(getPrimaryShape().getMessageLabelFigure());
return true;
}
- if(childEditPart instanceof MessageSyncAppliedStereotypeEditPart) {
- ((MessageSyncAppliedStereotypeEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
+ if (childEditPart instanceof MessageSyncAppliedStereotypeEditPart) {
+ ((MessageSyncAppliedStereotypeEditPart) childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
return true;
}
return false;
@@ -73,8 +75,9 @@ public class MessageEditPart extends AbstractMessageEditPart implements ITreeBra
/**
* @generated
*/
+ @Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -84,10 +87,10 @@ public class MessageEditPart extends AbstractMessageEditPart implements ITreeBra
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof MessageNameEditPart) {
+ if (childEditPart instanceof MessageNameEditPart) {
return true;
}
- if(childEditPart instanceof MessageSyncAppliedStereotypeEditPart) {
+ if (childEditPart instanceof MessageSyncAppliedStereotypeEditPart) {
return true;
}
return false;
@@ -96,8 +99,9 @@ public class MessageEditPart extends AbstractMessageEditPart implements ITreeBra
/**
* @generated
*/
+ @Override
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -105,12 +109,13 @@ public class MessageEditPart extends AbstractMessageEditPart implements ITreeBra
/**
* 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 Connection createConnectionFigure() {
return new MessageSync();
}
@@ -118,7 +123,8 @@ public class MessageEditPart extends AbstractMessageEditPart implements ITreeBra
/**
* @generated
*/
+ @Override
public MessageSync getPrimaryShape() {
- return (MessageSync)getFigure();
+ return (MessageSync) getFigure();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageFoundAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageFoundAppliedStereotypeEditPart.java
index 812eca53fe7..b56eea7d2e0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageFoundAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageFoundAppliedStereotypeEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -113,14 +113,14 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -141,6 +141,7 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
@@ -151,6 +152,7 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public int getKeyPoint() {
return ConnectionLocator.MIDDLE;
}
@@ -159,12 +161,12 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -172,12 +174,12 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -185,12 +187,12 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -198,12 +200,12 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -221,6 +223,7 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -228,6 +231,7 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -244,12 +248,12 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(NameLabelIconHelper.showLabelIcon(view)) {
+ for (View view : views) {
+ if (NameLabelIconHelper.showLabelIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -262,10 +266,10 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -274,23 +278,25 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -306,21 +312,24 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -334,8 +343,9 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -344,6 +354,7 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -351,8 +362,9 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Message_4009, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageFoundAppliedStereotypeEditPart.VISUAL_ID));
}
return parser;
@@ -362,7 +374,7 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -386,8 +398,8 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -395,8 +407,8 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -405,41 +417,42 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -451,13 +464,14 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -477,6 +491,7 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -491,17 +506,17 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -509,15 +524,15 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -526,18 +541,19 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -546,6 +562,7 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -553,12 +570,13 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -568,9 +586,10 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -581,10 +600,12 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -597,12 +618,12 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
private View getFontStyleOwnerView() {
- return (View)getModel();
+ return (View) getModel();
}
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
@@ -613,12 +634,12 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -626,7 +647,7 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -636,13 +657,13 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -652,23 +673,23 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -676,13 +697,14 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -698,33 +720,35 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -733,6 +757,7 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageLostAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageLostAppliedStereotypeEditPart.java
index fbb096e7973..ee323ebbf6c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageLostAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageLostAppliedStereotypeEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -109,14 +109,14 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -137,6 +137,7 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
@@ -147,6 +148,7 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
public int getKeyPoint() {
return ConnectionLocator.MIDDLE;
}
@@ -155,12 +157,12 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -168,12 +170,12 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -181,12 +183,12 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -194,12 +196,12 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -217,6 +219,7 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -224,6 +227,7 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -248,10 +252,10 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -260,23 +264,25 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -292,21 +298,24 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -320,8 +329,9 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -330,6 +340,7 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -337,8 +348,9 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Message_4008, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageLostAppliedStereotypeEditPart.VISUAL_ID));
}
return parser;
@@ -348,7 +360,7 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -372,8 +384,8 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -381,8 +393,8 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -391,41 +403,42 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -437,13 +450,14 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -463,6 +477,7 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -477,17 +492,17 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -495,15 +510,15 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -512,18 +527,19 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -532,6 +548,7 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -539,12 +556,13 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -554,9 +572,10 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -567,10 +586,12 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -583,12 +604,12 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
private View getFontStyleOwnerView() {
- return (View)getModel();
+ return (View) getModel();
}
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
@@ -599,12 +620,12 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -612,7 +633,7 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -622,13 +643,13 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -638,23 +659,23 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -662,13 +683,14 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -684,26 +706,28 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -716,6 +740,7 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName2EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName2EditPart.java
index c3d11b692e3..d4a58532259 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName2EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName2EditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -109,14 +109,14 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -137,6 +137,7 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
@@ -147,6 +148,7 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public int getKeyPoint() {
return ConnectionLocator.MIDDLE;
}
@@ -155,12 +157,12 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -168,12 +170,12 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -181,12 +183,12 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -194,12 +196,12 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -217,6 +219,7 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -224,6 +227,7 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -248,10 +252,10 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -260,23 +264,25 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -292,21 +298,24 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -320,8 +329,9 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -330,6 +340,7 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -337,8 +348,9 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Message_4004, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageName2EditPart.VISUAL_ID));
}
return parser;
@@ -348,7 +360,7 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -372,8 +384,8 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -381,8 +393,8 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -391,41 +403,42 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -437,13 +450,14 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -463,6 +477,7 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -477,17 +492,17 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -495,15 +510,15 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -512,18 +527,19 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -532,6 +548,7 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -539,12 +556,13 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -554,9 +572,10 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -567,10 +586,12 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -583,22 +604,22 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
private View getFontStyleOwnerView() {
- return (View)getModel();
+ return (View) getModel();
}
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see
* org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
// not a named element. no specific editor => do nothing
@@ -607,12 +628,12 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -620,7 +641,7 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -630,13 +651,13 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -646,23 +667,23 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -670,13 +691,14 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -692,26 +714,28 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -724,6 +748,7 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName3EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName3EditPart.java
index 7880dbe4280..8d7616f2fb2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName3EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName3EditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -109,14 +109,14 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -137,6 +137,7 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
@@ -147,6 +148,7 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public int getKeyPoint() {
return ConnectionLocator.MIDDLE;
}
@@ -155,12 +157,12 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -168,12 +170,12 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -181,12 +183,12 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -194,12 +196,12 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -217,6 +219,7 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -224,6 +227,7 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -248,10 +252,10 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -260,23 +264,25 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -292,21 +298,24 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -320,8 +329,9 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -330,6 +340,7 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -337,8 +348,9 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Message_4005, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageName3EditPart.VISUAL_ID));
}
return parser;
@@ -348,7 +360,7 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -372,8 +384,8 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -381,8 +393,8 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -391,41 +403,42 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -437,13 +450,14 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -463,6 +477,7 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -477,17 +492,17 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -495,15 +510,15 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -512,18 +527,19 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -532,6 +548,7 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -539,12 +556,13 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -554,9 +572,10 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -567,10 +586,12 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -583,22 +604,22 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
private View getFontStyleOwnerView() {
- return (View)getModel();
+ return (View) getModel();
}
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see
* org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
// not a named element. no specific editor => do nothing
@@ -607,12 +628,12 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -620,7 +641,7 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -630,13 +651,13 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -646,23 +667,23 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -670,13 +691,14 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -692,26 +714,28 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -724,6 +748,7 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName4EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName4EditPart.java
index 8612e09a13c..49b6c03665a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName4EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName4EditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -109,14 +109,14 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -137,6 +137,7 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
@@ -147,6 +148,7 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public int getKeyPoint() {
return ConnectionLocator.MIDDLE;
}
@@ -155,12 +157,12 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -168,12 +170,12 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -181,12 +183,12 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -194,12 +196,12 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -217,6 +219,7 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -224,6 +227,7 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -248,10 +252,10 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -260,23 +264,25 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -292,21 +298,24 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -320,8 +329,9 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -330,6 +340,7 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -337,8 +348,9 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Message_4006, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageName4EditPart.VISUAL_ID));
}
return parser;
@@ -348,7 +360,7 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -372,8 +384,8 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -381,8 +393,8 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -391,41 +403,42 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -437,13 +450,14 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -463,6 +477,7 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -477,17 +492,17 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -495,15 +510,15 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -512,18 +527,19 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -532,6 +548,7 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -539,12 +556,13 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -554,9 +572,10 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -567,10 +586,12 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -583,22 +604,22 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
private View getFontStyleOwnerView() {
- return (View)getModel();
+ return (View) getModel();
}
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see
* org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
// not a named element. no specific editor => do nothing
@@ -607,12 +628,12 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -620,7 +641,7 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -630,13 +651,13 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -646,23 +667,23 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -670,13 +691,14 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -692,26 +714,28 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -724,6 +748,7 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName5EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName5EditPart.java
index 4c7b39824c5..178cf154a91 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName5EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName5EditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -109,14 +109,14 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -137,6 +137,7 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
@@ -147,6 +148,7 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public int getKeyPoint() {
return ConnectionLocator.MIDDLE;
}
@@ -155,12 +157,12 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -168,12 +170,12 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -181,12 +183,12 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -194,12 +196,12 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -217,6 +219,7 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -224,6 +227,7 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -248,10 +252,10 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -260,23 +264,25 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -292,21 +298,24 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -320,8 +329,9 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -330,6 +340,7 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -337,8 +348,9 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Message_4007, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageName5EditPart.VISUAL_ID));
}
return parser;
@@ -348,7 +360,7 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -372,8 +384,8 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -381,8 +393,8 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -391,41 +403,42 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -437,13 +450,14 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -463,6 +477,7 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -477,17 +492,17 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -495,15 +510,15 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -512,18 +527,19 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -532,6 +548,7 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -539,12 +556,13 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -554,9 +572,10 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -567,10 +586,12 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -583,22 +604,22 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
private View getFontStyleOwnerView() {
- return (View)getModel();
+ return (View) getModel();
}
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see
* org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
// not a named element. no specific editor => do nothing
@@ -607,12 +628,12 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -620,7 +641,7 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -630,13 +651,13 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -646,23 +667,23 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -670,13 +691,14 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -692,26 +714,28 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -724,6 +748,7 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName6EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName6EditPart.java
index 575776f7714..7c993a299e6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName6EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName6EditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -109,14 +109,14 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -137,6 +137,7 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
@@ -147,6 +148,7 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public int getKeyPoint() {
return ConnectionLocator.MIDDLE;
}
@@ -155,12 +157,12 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -168,12 +170,12 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -181,12 +183,12 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -194,12 +196,12 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -217,6 +219,7 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -224,6 +227,7 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -248,10 +252,10 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -260,23 +264,25 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -292,21 +298,24 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -320,8 +329,9 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -330,6 +340,7 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -337,8 +348,9 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Message_4008, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageName6EditPart.VISUAL_ID));
}
return parser;
@@ -348,7 +360,7 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -372,8 +384,8 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -381,8 +393,8 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -391,41 +403,42 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -437,13 +450,14 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -463,6 +477,7 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -477,17 +492,17 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -495,15 +510,15 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -512,18 +527,19 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -532,6 +548,7 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -539,12 +556,13 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -554,9 +572,10 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -567,10 +586,12 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -583,22 +604,22 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
private View getFontStyleOwnerView() {
- return (View)getModel();
+ return (View) getModel();
}
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see
* org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
// not a named element. no specific editor => do nothing
@@ -607,12 +628,12 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -620,7 +641,7 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -630,13 +651,13 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -646,23 +667,23 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -670,13 +691,14 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -692,26 +714,28 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -724,6 +748,7 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName7EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName7EditPart.java
index 09f809c9c79..5a454dc22d0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName7EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName7EditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -109,14 +109,14 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -137,6 +137,7 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
@@ -147,6 +148,7 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public int getKeyPoint() {
return ConnectionLocator.MIDDLE;
}
@@ -155,12 +157,12 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -168,12 +170,12 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -181,12 +183,12 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -194,12 +196,12 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -217,6 +219,7 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -224,6 +227,7 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -248,10 +252,10 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -260,23 +264,25 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -292,21 +298,24 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -320,8 +329,9 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -330,6 +340,7 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -337,8 +348,9 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Message_4009, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageName7EditPart.VISUAL_ID));
}
return parser;
@@ -348,7 +360,7 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -372,8 +384,8 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -381,8 +393,8 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -391,41 +403,42 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -437,13 +450,14 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -463,6 +477,7 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -477,17 +492,17 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -495,15 +510,15 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -512,18 +527,19 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -532,6 +548,7 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -539,12 +556,13 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -554,9 +572,10 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -567,10 +586,12 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -583,22 +604,22 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
* @generated
*/
private View getFontStyleOwnerView() {
- return (View)getModel();
+ return (View) getModel();
}
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see
* org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
// not a named element. no specific editor => do nothing
@@ -607,12 +628,12 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -620,7 +641,7 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -630,13 +651,13 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -646,23 +667,23 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -670,13 +691,14 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -692,26 +714,28 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -724,6 +748,7 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageNameEditPart.java
index 3760a205465..75ec1b71ef9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageNameEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -109,14 +109,14 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -137,6 +137,7 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
@@ -147,6 +148,7 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
/**
* @generated
*/
+ @Override
public int getKeyPoint() {
return ConnectionLocator.MIDDLE;
}
@@ -155,12 +157,12 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -168,12 +170,12 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -181,12 +183,12 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -194,12 +196,12 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -217,6 +219,7 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -224,6 +227,7 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -248,10 +252,10 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -260,23 +264,25 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -292,21 +298,24 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -320,8 +329,9 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -330,6 +340,7 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -337,8 +348,9 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Message_4003, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageNameEditPart.VISUAL_ID));
}
return parser;
@@ -348,7 +360,7 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -372,8 +384,8 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -381,8 +393,8 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -391,41 +403,42 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -437,13 +450,14 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -463,6 +477,7 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -477,17 +492,17 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -495,15 +510,15 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -512,18 +527,19 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -532,6 +548,7 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -539,12 +556,13 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -554,9 +572,10 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -567,10 +586,12 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -583,22 +604,22 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
* @generated
*/
private View getFontStyleOwnerView() {
- return (View)getModel();
+ return (View) getModel();
}
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see
* org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
// not a named element. no specific editor => do nothing
@@ -607,12 +628,12 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -620,7 +641,7 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -630,13 +651,13 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -646,23 +667,23 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -670,13 +691,14 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -692,26 +714,28 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -724,6 +748,7 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageReplyAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageReplyAppliedStereotypeEditPart.java
index 1a98efad86b..e984f29285f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageReplyAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageReplyAppliedStereotypeEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -109,14 +109,14 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -137,6 +137,7 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
@@ -147,6 +148,7 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public int getKeyPoint() {
return ConnectionLocator.MIDDLE;
}
@@ -155,12 +157,12 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -168,12 +170,12 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -181,12 +183,12 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -194,12 +196,12 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -217,6 +219,7 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -224,6 +227,7 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -248,10 +252,10 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -260,23 +264,25 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -292,21 +298,24 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -320,8 +329,9 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -330,6 +340,7 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -337,8 +348,9 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Message_4005, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageReplyAppliedStereotypeEditPart.VISUAL_ID));
}
return parser;
@@ -348,7 +360,7 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -372,8 +384,8 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -381,8 +393,8 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -391,41 +403,42 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -437,13 +450,14 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -463,6 +477,7 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -477,17 +492,17 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -495,15 +510,15 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -512,18 +527,19 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -532,6 +548,7 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -539,12 +556,13 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -554,9 +572,10 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -567,10 +586,12 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -583,12 +604,12 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
private View getFontStyleOwnerView() {
- return (View)getModel();
+ return (View) getModel();
}
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
@@ -599,12 +620,12 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -612,7 +633,7 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -622,13 +643,13 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -638,23 +659,23 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -662,13 +683,14 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -684,26 +706,28 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -716,6 +740,7 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageSyncAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageSyncAppliedStereotypeEditPart.java
index 755a4434b9b..f54671e14c3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageSyncAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageSyncAppliedStereotypeEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -109,14 +109,14 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -137,6 +137,7 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
@@ -147,6 +148,7 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
public int getKeyPoint() {
return ConnectionLocator.MIDDLE;
}
@@ -155,12 +157,12 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -168,12 +170,12 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -181,12 +183,12 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -194,12 +196,12 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -217,6 +219,7 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -224,6 +227,7 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -248,10 +252,10 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -260,23 +264,25 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -292,21 +298,24 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -320,8 +329,9 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -330,6 +340,7 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -337,8 +348,9 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Message_4003, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageSyncAppliedStereotypeEditPart.VISUAL_ID));
}
return parser;
@@ -348,7 +360,7 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -372,8 +384,8 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -381,8 +393,8 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -391,41 +403,42 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -437,13 +450,14 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -463,6 +477,7 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -477,17 +492,17 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -495,15 +510,15 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -512,18 +527,19 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -532,6 +548,7 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -539,12 +556,13 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -554,9 +572,10 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -567,10 +586,12 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -583,12 +604,12 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
private View getFontStyleOwnerView() {
- return (View)getModel();
+ return (View) getModel();
}
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
@@ -599,12 +620,12 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -612,7 +633,7 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -622,13 +643,13 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -638,23 +659,23 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -662,13 +683,14 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -684,26 +706,28 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -716,6 +740,7 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/PackageEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/PackageEditPart.java
index b595a7acfaf..5d5ea1aa16e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/PackageEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/PackageEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -46,16 +46,17 @@ public class PackageEditPart extends PapyrusDiagramEditPart {
/**
* Remove the two policies dealing with the popup menu
- *
+ *
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new PapyrusCreationEditPolicy());
installEditPolicy(DuplicatePasteEditPolicy.PASTE_ROLE, new DuplicatePasteEditPolicy());
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new PackageItemSemanticEditPolicy());
- //in Papyrus diagrams are not strongly synchronised
- //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.sequence.edit.policies.PackageCanonicalEditPolicy());
+ // in Papyrus diagrams are not strongly synchronised
+ // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.sequence.edit.policies.PackageCanonicalEditPolicy());
installEditPolicy("RemoveOrphanView", new RemoveOrphanViewPolicy()); //$NON-NLS-1$
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
// removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/StateInvariantEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/StateInvariantEditPart.java
index 3dea3a0c5f2..05ac412156c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/StateInvariantEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/StateInvariantEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -83,6 +83,7 @@ public class StateInvariantEditPart extends AbstractBorderItemEditPart {
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, getPrimaryDragEditPolicy());
@@ -98,18 +99,21 @@ public class StateInvariantEditPart extends AbstractBorderItemEditPart {
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) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
}
+ @Override
protected Command getMoveChildrenCommand(Request request) {
return null;
}
+ @Override
protected Command getCreateCommand(CreateRequest request) {
return null;
}
@@ -128,19 +132,19 @@ public class StateInvariantEditPart extends AbstractBorderItemEditPart {
* @generated
*/
public ContinuationFigure getPrimaryShape() {
- return (ContinuationFigure)primaryShape;
+ return (ContinuationFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof StateInvariantNameEditPart) {
- ((StateInvariantNameEditPart)childEditPart).setLabel(getPrimaryShape().getFigureContinuationNameLabel());
+ if (childEditPart instanceof StateInvariantNameEditPart) {
+ ((StateInvariantNameEditPart) childEditPart).setLabel(getPrimaryShape().getFigureContinuationNameLabel());
return true;
}
- if(childEditPart instanceof StateInvariantLabelEditPart) {
- ((StateInvariantLabelEditPart)childEditPart).setLabel(getPrimaryShape().getInvariantFigure());
+ if (childEditPart instanceof StateInvariantLabelEditPart) {
+ ((StateInvariantLabelEditPart) childEditPart).setLabel(getPrimaryShape().getInvariantFigure());
return true;
}
return false;
@@ -150,10 +154,10 @@ public class StateInvariantEditPart extends AbstractBorderItemEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof StateInvariantNameEditPart) {
+ if (childEditPart instanceof StateInvariantNameEditPart) {
return true;
}
- if(childEditPart instanceof StateInvariantLabelEditPart) {
+ if (childEditPart instanceof StateInvariantLabelEditPart) {
return true;
}
return false;
@@ -162,8 +166,9 @@ public class StateInvariantEditPart extends AbstractBorderItemEditPart {
/**
* @generated
*/
+ @Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -172,8 +177,9 @@ public class StateInvariantEditPart extends AbstractBorderItemEditPart {
/**
* @generated
*/
+ @Override
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -182,6 +188,7 @@ public class StateInvariantEditPart extends AbstractBorderItemEditPart {
/**
* @generated
*/
+ @Override
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
return getContentPane();
}
@@ -195,19 +202,20 @@ public class StateInvariantEditPart extends AbstractBorderItemEditPart {
String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferencesConstantsHelper.WIDTH);
String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferencesConstantsHelper.HEIGHT);
DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
- //FIXME: workaround for #154536
+ // FIXME: workaround for #154536
result.getBounds().setSize(result.getPreferredSize());
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() {
NodeFigure figure = createNodePlate();
figure.setLayoutManager(new StackLayout());
@@ -220,13 +228,13 @@ public class StateInvariantEditPart extends AbstractBorderItemEditPart {
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- *
+ *
* @param nodeShape
- * instance of generated figure class
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -237,8 +245,9 @@ public class StateInvariantEditPart extends AbstractBorderItemEditPart {
/**
* @generated
*/
+ @Override
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -247,8 +256,9 @@ public class StateInvariantEditPart extends AbstractBorderItemEditPart {
/**
* @generated
*/
+ @Override
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -256,24 +266,27 @@ public class StateInvariantEditPart extends AbstractBorderItemEditPart {
/**
* @generated
*/
+ @Override
protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineWidth(width);
}
}
/**
* @generated
*/
+ @Override
protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineStyle(style);
}
}
/**
* @generated
*/
+ @Override
public EditPart getPrimaryChildEditPart() {
return getChildBySemanticHint(UMLVisualIDRegistry.getType(StateInvariantNameEditPart.VISUAL_ID));
}
@@ -298,403 +311,403 @@ public class StateInvariantEditPart extends AbstractBorderItemEditPart {
*/
public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.StateInvariantEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.StateInvariantEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.StateInvariantEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.StateInvariantEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.StateInvariantEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.StateInvariantEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.StateInvariantEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
return types;
@@ -705,7 +718,7 @@ public class StateInvariantEditPart extends AbstractBorderItemEditPart {
*/
public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -725,7 +738,7 @@ public class StateInvariantEditPart extends AbstractBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -745,7 +758,7 @@ public class StateInvariantEditPart extends AbstractBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -765,7 +778,7 @@ public class StateInvariantEditPart extends AbstractBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -785,7 +798,7 @@ public class StateInvariantEditPart extends AbstractBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -805,7 +818,7 @@ public class StateInvariantEditPart extends AbstractBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -825,7 +838,7 @@ public class StateInvariantEditPart extends AbstractBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -871,7 +884,7 @@ public class StateInvariantEditPart extends AbstractBorderItemEditPart {
*/
public List<IElementType> getMATypesForSource(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -891,7 +904,7 @@ public class StateInvariantEditPart extends AbstractBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -911,7 +924,7 @@ public class StateInvariantEditPart extends AbstractBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -931,7 +944,7 @@ public class StateInvariantEditPart extends AbstractBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -951,7 +964,7 @@ public class StateInvariantEditPart extends AbstractBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -971,7 +984,7 @@ public class StateInvariantEditPart extends AbstractBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -991,7 +1004,7 @@ public class StateInvariantEditPart extends AbstractBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1011,9 +1024,9 @@ public class StateInvariantEditPart extends AbstractBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
+ } else if (relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
types.add(UMLElementTypes.Comment_3009);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
+ } else if (relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
types.add(UMLElementTypes.TimeConstraint_3019);
types.add(UMLElementTypes.DurationConstraint_3021);
types.add(UMLElementTypes.Constraint_3008);
@@ -1068,28 +1081,28 @@ public class StateInvariantEditPart extends AbstractBorderItemEditPart {
*/
@Override
public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ IPreferenceStore preferenceStore = (IPreferenceStore) getDiagramPreferencesHint().getPreferenceStore();
Object result = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("StateInvariant", PreferencesConstantsHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("StateInvariant", PreferencesConstantsHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("StateInvariant", PreferencesConstantsHelper.COLOR_FILL);
}
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor(preferenceStore, prefColor));
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
String prefGradient = PreferencesConstantsHelper.getElementConstant("StateInvariant", PreferencesConstantsHelper.COLOR_GRADIENT);
GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
result = gradientPreferenceConverter.getGradientData();
}
}
- if(result == null) {
+ if (result == null) {
result = getStructuralFeatureValue(feature);
}
return result;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/StateInvariantLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/StateInvariantLabelEditPart.java
index d0bc8252bf6..99ae3bc957e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/StateInvariantLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/StateInvariantLabelEditPart.java
@@ -99,14 +99,14 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -121,6 +121,7 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
@@ -132,12 +133,12 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {
- return ((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {
+ return ((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -145,12 +146,12 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {
- ((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {
+ ((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -158,12 +159,12 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {
- return ((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {
+ return ((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -171,12 +172,12 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {
- ((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {
+ ((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -194,6 +195,7 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -201,6 +203,7 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -217,12 +220,12 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(NameLabelIconHelper.showLabelIcon(view)) {
+ for (View view : views) {
+ if (NameLabelIconHelper.showLabelIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -235,10 +238,10 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -247,23 +250,25 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -279,21 +284,24 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -307,8 +315,9 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -317,6 +326,7 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -324,8 +334,9 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.StateInvariant_3017, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.StateInvariantLabelEditPart.VISUAL_ID));
}
return parser;
@@ -335,7 +346,7 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -359,8 +370,8 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -368,8 +379,8 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -378,41 +389,42 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -424,13 +436,14 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -450,6 +463,7 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -464,17 +478,17 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -482,15 +496,15 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {
- ((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {
+ ((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -499,18 +513,19 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {
- ((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {
+ ((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -519,6 +534,7 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -526,12 +542,13 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -541,9 +558,10 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -554,10 +572,12 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -575,16 +595,16 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
// not a named element. no specific editor => do nothing
@@ -593,12 +613,12 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -606,7 +626,7 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -616,13 +636,13 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -632,23 +652,23 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -656,13 +676,14 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -678,6 +699,7 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
protected void addNotationalListeners() {
super.addNotationalListeners();
addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
@@ -686,6 +708,7 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
protected void removeNotationalListeners() {
super.removeNotationalListeners();
removeListenerFilter("PrimaryView"); //$NON-NLS-1$
@@ -694,34 +717,36 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -730,6 +755,7 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
@@ -743,6 +769,7 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
/**
* @generated
*/
+ @Override
public void activate() {
super.activate();
addOwnerElementListeners();
@@ -752,12 +779,13 @@ public class StateInvariantLabelEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
}
/**
* @generated
*/
+ @Override
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/StateInvariantNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/StateInvariantNameEditPart.java
index 024667676d6..cc002da3e10 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/StateInvariantNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/StateInvariantNameEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -113,14 +113,14 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -135,6 +135,7 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
@@ -146,12 +147,12 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -159,12 +160,12 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -172,12 +173,12 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -185,12 +186,12 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -208,6 +209,7 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -215,6 +217,7 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -231,12 +234,12 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(NameLabelIconHelper.showLabelIcon(view)) {
+ for (View view : views) {
+ if (NameLabelIconHelper.showLabelIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -249,10 +252,10 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -261,23 +264,25 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -293,21 +298,24 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -321,8 +329,9 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -331,6 +340,7 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -338,8 +348,9 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.StateInvariant_3017, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.StateInvariantNameEditPart.VISUAL_ID));
}
return parser;
@@ -349,7 +360,7 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -373,8 +384,8 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -382,8 +393,8 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -392,41 +403,42 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -438,13 +450,14 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -464,6 +477,7 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -478,17 +492,17 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -496,15 +510,15 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -513,18 +527,19 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -533,6 +548,7 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -540,12 +556,13 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -555,9 +572,10 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -568,10 +586,12 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -589,16 +609,16 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
// not a named element. no specific editor => do nothing
@@ -607,12 +627,12 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -620,7 +640,7 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -630,13 +650,13 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -646,23 +666,23 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -670,13 +690,14 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -692,6 +713,7 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
protected void addNotationalListeners() {
super.addNotationalListeners();
addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
@@ -700,6 +722,7 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
protected void removeNotationalListeners() {
super.removeNotationalListeners();
removeListenerFilter("PrimaryView"); //$NON-NLS-1$
@@ -708,34 +731,36 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -744,6 +769,7 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
@@ -757,6 +783,7 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
/**
* @generated
*/
+ @Override
public void activate() {
super.activate();
addOwnerElementListeners();
@@ -766,12 +793,13 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
}
/**
* @generated
*/
+ @Override
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeConstraintAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeConstraintAppliedStereotypeEditPart.java
index 6c854744806..86c1bfad65b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeConstraintAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeConstraintAppliedStereotypeEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -115,14 +115,14 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -143,6 +143,7 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
@@ -153,11 +154,12 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
/**
* @generated
*/
+ @Override
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -165,11 +167,12 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
/**
* @generated
*/
+ @Override
public void refreshBounds() {
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
}
@@ -177,12 +180,12 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -190,12 +193,12 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -203,12 +206,12 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -216,12 +219,12 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -239,6 +242,7 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -246,6 +250,7 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -262,12 +267,12 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(NameLabelIconHelper.showLabelIcon(view)) {
+ for (View view : views) {
+ if (NameLabelIconHelper.showLabelIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -280,10 +285,10 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -292,23 +297,25 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -324,21 +331,24 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -352,8 +362,9 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -362,6 +373,7 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -369,8 +381,9 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.TimeConstraint_3019, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeConstraintAppliedStereotypeEditPart.VISUAL_ID));
}
return parser;
@@ -380,7 +393,7 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -404,8 +417,8 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -413,8 +426,8 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -423,41 +436,42 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -469,13 +483,14 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -495,6 +510,7 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -509,17 +525,17 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -527,15 +543,15 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -544,18 +560,19 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -564,6 +581,7 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -571,12 +589,13 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -586,9 +605,10 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -599,10 +619,12 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -620,7 +642,7 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
@@ -631,12 +653,12 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -644,7 +666,7 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -654,13 +676,13 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -670,23 +692,23 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -694,13 +716,14 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -716,26 +739,28 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -748,6 +773,7 @@ public class TimeConstraintAppliedStereotypeEditPart extends LabelEditPart imple
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
IFigure label = createFigurePrim();
defaultText = getLabelTextHelper(label);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeConstraintEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeConstraintEditPart.java
index 9c729ac82fb..9e37e235884 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeConstraintEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeConstraintEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -89,6 +89,7 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, getPrimaryDragEditPolicy());
@@ -105,31 +106,35 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
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) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case TimeConstraintLabelEditPart.VISUAL_ID:
case TimeConstraintAppliedStereotypeEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
+ @Override
protected List createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
}
+ @Override
protected Command getMoveChildrenCommand(Request request) {
return null;
}
+ @Override
protected Command getCreateCommand(CreateRequest request) {
return null;
}
@@ -148,14 +153,15 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
* @generated
*/
public TimeMarkElementFigure getPrimaryShape() {
- return (TimeMarkElementFigure)primaryShape;
+ return (TimeMarkElementFigure) primaryShape;
}
/**
* @generated
*/
+ @Override
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof TimeConstraintLabelEditPart || borderItemEditPart instanceof TimeConstraintAppliedStereotypeEditPart) {
+ if (borderItemEditPart instanceof TimeConstraintLabelEditPart || borderItemEditPart instanceof TimeConstraintAppliedStereotypeEditPart) {
BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
locator.setBorderItemOffset(new Dimension(-20, -20));
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
@@ -173,19 +179,20 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferencesConstantsHelper.WIDTH);
String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferencesConstantsHelper.HEIGHT);
DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
- //FIXME: workaround for #154536
+ // FIXME: workaround for #154536
result.getBounds().setSize(result.getPreferredSize());
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 createMainFigure() {
NodeFigure figure = createNodePlate();
figure.setLayoutManager(new StackLayout());
@@ -198,9 +205,9 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- *
+ *
* @param nodeShape
- * instance of generated figure class
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
@@ -210,8 +217,9 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
/**
* @generated
*/
+ @Override
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -220,8 +228,9 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
/**
* @generated
*/
+ @Override
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -229,24 +238,27 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
/**
* @generated
*/
+ @Override
protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineWidth(width);
}
}
/**
* @generated
*/
+ @Override
protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineStyle(style);
}
}
/**
* @generated
*/
+ @Override
public EditPart getPrimaryChildEditPart() {
return getChildBySemanticHint(UMLVisualIDRegistry.getType(TimeConstraintLabelEditPart.VISUAL_ID));
}
@@ -273,466 +285,466 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
*/
public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeConstraintEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeConstraintEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeConstraintEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeConstraintEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeConstraintEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeConstraintEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeConstraintEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeConstraintEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeConstraintEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
+ if (targetEditPart instanceof TimeObservationEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.ConstraintContext_8500);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.ConstraintContext_8500);
}
return types;
@@ -743,7 +755,7 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
*/
public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -763,7 +775,7 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -783,7 +795,7 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -803,7 +815,7 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -823,7 +835,7 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -843,7 +855,7 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -863,7 +875,7 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -883,7 +895,7 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
+ } else if (relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -903,7 +915,7 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.ConstraintContext_8500) {
+ } else if (relationshipType == UMLElementTypes.ConstraintContext_8500) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.InteractionOperand_3005);
}
@@ -932,7 +944,7 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
*/
public List<IElementType> getMATypesForSource(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -952,7 +964,7 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -972,7 +984,7 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -992,7 +1004,7 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1012,7 +1024,7 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1032,7 +1044,7 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1052,7 +1064,7 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -1072,9 +1084,9 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
+ } else if (relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
types.add(UMLElementTypes.Comment_3009);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
+ } else if (relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
types.add(UMLElementTypes.TimeConstraint_3019);
types.add(UMLElementTypes.DurationConstraint_3021);
types.add(UMLElementTypes.Constraint_3008);
@@ -1103,28 +1115,28 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
*/
@Override
public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ IPreferenceStore preferenceStore = (IPreferenceStore) getDiagramPreferencesHint().getPreferenceStore();
Object result = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("TimeConstraint", PreferencesConstantsHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("TimeConstraint", PreferencesConstantsHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("TimeConstraint", PreferencesConstantsHelper.COLOR_FILL);
}
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor(preferenceStore, prefColor));
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
String prefGradient = PreferencesConstantsHelper.getElementConstant("TimeConstraint", PreferencesConstantsHelper.COLOR_GRADIENT);
GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
result = gradientPreferenceConverter.getGradientData();
}
}
- if(result == null) {
+ if (result == null) {
result = getStructuralFeatureValue(feature);
}
return result;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeConstraintLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeConstraintLabelEditPart.java
index 91e1219fe62..d286ce0be62 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeConstraintLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeConstraintLabelEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -111,14 +111,14 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -139,6 +139,7 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
@@ -148,11 +149,12 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -160,11 +162,12 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public void refreshBounds() {
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
}
@@ -172,12 +175,12 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -185,12 +188,12 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -198,12 +201,12 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -211,12 +214,12 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -234,6 +237,7 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -241,6 +245,7 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -265,10 +270,10 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -277,23 +282,25 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -309,21 +316,24 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -337,8 +347,9 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,6 +358,7 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -354,8 +366,9 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.TimeConstraint_3019, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeConstraintLabelEditPart.VISUAL_ID));
}
return parser;
@@ -365,7 +378,7 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -389,8 +402,8 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -398,8 +411,8 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -408,41 +421,42 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -454,13 +468,14 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -480,6 +495,7 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -494,17 +510,17 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -512,15 +528,15 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -529,18 +545,19 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -549,6 +566,7 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -556,12 +574,13 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -571,9 +590,10 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -584,10 +604,12 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -605,16 +627,16 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
// not a named element. no specific editor => do nothing
@@ -623,12 +645,12 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -636,7 +658,7 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -646,13 +668,13 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -662,23 +684,23 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -686,13 +708,14 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -708,26 +731,28 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -740,6 +765,7 @@ public class TimeConstraintLabelEditPart extends LabelEditPart implements ITextA
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
IFigure label = createFigurePrim();
defaultText = getLabelTextHelper(label);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeObservationAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeObservationAppliedStereotypeEditPart.java
index 5a531c94a85..726ce99ef9f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeObservationAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeObservationAppliedStereotypeEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -115,14 +115,14 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -143,6 +143,7 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
@@ -153,11 +154,12 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
/**
* @generated
*/
+ @Override
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -165,11 +167,12 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
/**
* @generated
*/
+ @Override
public void refreshBounds() {
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
}
@@ -177,12 +180,12 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -190,12 +193,12 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -203,12 +206,12 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -216,12 +219,12 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -239,6 +242,7 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -246,6 +250,7 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -262,12 +267,12 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(NameLabelIconHelper.showLabelIcon(view)) {
+ for (View view : views) {
+ if (NameLabelIconHelper.showLabelIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -280,10 +285,10 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -292,23 +297,25 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -324,21 +331,24 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -352,8 +362,9 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -362,6 +373,7 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -369,8 +381,9 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.TimeObservation_3020, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeObservationAppliedStereotypeEditPart.VISUAL_ID));
}
return parser;
@@ -380,7 +393,7 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -404,8 +417,8 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -413,8 +426,8 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -423,41 +436,42 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -469,13 +483,14 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -495,6 +510,7 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -509,17 +525,17 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -527,15 +543,15 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -544,18 +560,19 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -564,6 +581,7 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -571,12 +589,13 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -586,9 +605,10 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -599,10 +619,12 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -620,7 +642,7 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
@@ -631,12 +653,12 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -644,7 +666,7 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -654,13 +676,13 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -670,23 +692,23 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -694,13 +716,14 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -716,26 +739,28 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -748,6 +773,7 @@ public class TimeObservationAppliedStereotypeEditPart extends LabelEditPart impl
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
IFigure label = createFigurePrim();
defaultText = getLabelTextHelper(label);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeObservationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeObservationEditPart.java
index b72dc24dc0d..9fc96c185e3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeObservationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeObservationEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -89,6 +89,7 @@ public class TimeObservationEditPart extends BorderedBorderItemEditPart {
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, getPrimaryDragEditPolicy());
@@ -105,31 +106,35 @@ public class TimeObservationEditPart extends BorderedBorderItemEditPart {
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) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case TimeObservationLabelEditPart.VISUAL_ID:
case TimeObservationAppliedStereotypeEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
+ @Override
protected List createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
}
+ @Override
protected Command getMoveChildrenCommand(Request request) {
return null;
}
+ @Override
protected Command getCreateCommand(CreateRequest request) {
return null;
}
@@ -148,14 +153,15 @@ public class TimeObservationEditPart extends BorderedBorderItemEditPart {
* @generated
*/
public TimeMarkElementFigure getPrimaryShape() {
- return (TimeMarkElementFigure)primaryShape;
+ return (TimeMarkElementFigure) primaryShape;
}
/**
* @generated
*/
+ @Override
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof TimeObservationLabelEditPart || borderItemEditPart instanceof TimeObservationAppliedStereotypeEditPart) {
+ if (borderItemEditPart instanceof TimeObservationLabelEditPart || borderItemEditPart instanceof TimeObservationAppliedStereotypeEditPart) {
BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
locator.setBorderItemOffset(new Dimension(-20, -20));
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
@@ -173,19 +179,20 @@ public class TimeObservationEditPart extends BorderedBorderItemEditPart {
String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferencesConstantsHelper.WIDTH);
String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferencesConstantsHelper.HEIGHT);
DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
- //FIXME: workaround for #154536
+ // FIXME: workaround for #154536
result.getBounds().setSize(result.getPreferredSize());
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 createMainFigure() {
NodeFigure figure = createNodePlate();
figure.setLayoutManager(new StackLayout());
@@ -198,9 +205,9 @@ public class TimeObservationEditPart extends BorderedBorderItemEditPart {
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- *
+ *
* @param nodeShape
- * instance of generated figure class
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
@@ -210,8 +217,9 @@ public class TimeObservationEditPart extends BorderedBorderItemEditPart {
/**
* @generated
*/
+ @Override
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -220,8 +228,9 @@ public class TimeObservationEditPart extends BorderedBorderItemEditPart {
/**
* @generated
*/
+ @Override
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -229,24 +238,27 @@ public class TimeObservationEditPart extends BorderedBorderItemEditPart {
/**
* @generated
*/
+ @Override
protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineWidth(width);
}
}
/**
* @generated
*/
+ @Override
protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof Shape) {
+ ((Shape) primaryShape).setLineStyle(style);
}
}
/**
* @generated
*/
+ @Override
public EditPart getPrimaryChildEditPart() {
return getChildBySemanticHint(UMLVisualIDRegistry.getType(TimeObservationLabelEditPart.VISUAL_ID));
}
@@ -271,403 +283,403 @@ public class TimeObservationEditPart extends BorderedBorderItemEditPart {
*/
public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeObservationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4003);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeObservationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4004);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeObservationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4005);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeObservationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4006);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeObservationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4007);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeObservationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4008);
}
- if(targetEditPart instanceof InteractionEditPart) {
+ if (targetEditPart instanceof InteractionEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
+ if (targetEditPart instanceof InteractionOperandEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
+ if (targetEditPart instanceof InteractionUseEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ContinuationEditPart) {
+ if (targetEditPart instanceof ContinuationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof LifelineEditPart) {
+ if (targetEditPart instanceof LifelineEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
+ if (targetEditPart instanceof StateInvariantEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
+ if (targetEditPart instanceof TimeConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeObservationEditPart) {
+ if (targetEditPart instanceof org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
+ if (targetEditPart instanceof DurationConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof ConstraintEditPart) {
+ if (targetEditPart instanceof ConstraintEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof CommentEditPart) {
+ if (targetEditPart instanceof CommentEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
types.add(UMLElementTypes.Message_4009);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
+ if (targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.Message_4009);
}
return types;
@@ -678,7 +690,7 @@ public class TimeObservationEditPart extends BorderedBorderItemEditPart {
*/
public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -698,7 +710,7 @@ public class TimeObservationEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -718,7 +730,7 @@ public class TimeObservationEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -738,7 +750,7 @@ public class TimeObservationEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -758,7 +770,7 @@ public class TimeObservationEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -778,7 +790,7 @@ public class TimeObservationEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -798,7 +810,7 @@ public class TimeObservationEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -844,7 +856,7 @@ public class TimeObservationEditPart extends BorderedBorderItemEditPart {
*/
public List<IElementType> getMATypesForSource(IElementType relationshipType) {
LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == UMLElementTypes.Message_4003) {
+ if (relationshipType == UMLElementTypes.Message_4003) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -864,7 +876,7 @@ public class TimeObservationEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4004) {
+ } else if (relationshipType == UMLElementTypes.Message_4004) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -884,7 +896,7 @@ public class TimeObservationEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4005) {
+ } else if (relationshipType == UMLElementTypes.Message_4005) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -904,7 +916,7 @@ public class TimeObservationEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4006) {
+ } else if (relationshipType == UMLElementTypes.Message_4006) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -924,7 +936,7 @@ public class TimeObservationEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4007) {
+ } else if (relationshipType == UMLElementTypes.Message_4007) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -944,7 +956,7 @@ public class TimeObservationEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4008) {
+ } else if (relationshipType == UMLElementTypes.Message_4008) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -964,7 +976,7 @@ public class TimeObservationEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.Message_4009) {
+ } else if (relationshipType == UMLElementTypes.Message_4009) {
types.add(UMLElementTypes.Interaction_2001);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -984,9 +996,9 @@ public class TimeObservationEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
- } else if(relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
+ } else if (relationshipType == UMLElementTypes.CommentAnnotatedElement_4010) {
types.add(UMLElementTypes.Comment_3009);
- } else if(relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
+ } else if (relationshipType == UMLElementTypes.ConstraintConstrainedElement_4011) {
types.add(UMLElementTypes.TimeConstraint_3019);
types.add(UMLElementTypes.DurationConstraint_3021);
types.add(UMLElementTypes.Constraint_3008);
@@ -1015,28 +1027,28 @@ public class TimeObservationEditPart extends BorderedBorderItemEditPart {
*/
@Override
public Object getPreferredValue(EStructuralFeature feature) {
- IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ IPreferenceStore preferenceStore = (IPreferenceStore) getDiagramPreferencesHint().getPreferenceStore();
Object result = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
String prefColor = null;
- if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("TimeObservation", PreferencesConstantsHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("TimeObservation", PreferencesConstantsHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
prefColor = PreferencesConstantsHelper.getElementConstant("TimeObservation", PreferencesConstantsHelper.COLOR_FILL);
}
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor(preferenceStore, prefColor));
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
String prefGradient = PreferencesConstantsHelper.getElementConstant("TimeObservation", PreferencesConstantsHelper.COLOR_GRADIENT);
GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
- if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
result = new Integer(gradientPreferenceConverter.getTransparency());
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
result = gradientPreferenceConverter.getGradientData();
}
}
- if(result == null) {
+ if (result == null) {
result = getStructuralFeatureValue(feature);
}
return result;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeObservationLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeObservationLabelEditPart.java
index 94cad127135..0ec0f4d2526 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeObservationLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeObservationLabelEditPart.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -82,7 +82,7 @@ import org.eclipse.uml2.uml.Feature;
/**
* @generated
*/
-//Fix https://bugs.eclipse.org/bugs/show_bug.cgi?id=364826
+// Fix https://bugs.eclipse.org/bugs/show_bug.cgi?id=364826
public class TimeObservationLabelEditPart extends LabelEditPart implements ITextAwareEditPart, IBorderItemEditPart {
/**
@@ -112,14 +112,14 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
/**
* direct edition mode (default, undefined, registered editor, etc.)
- *
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
- *
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -140,6 +140,7 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
/**
* @generated
*/
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
@@ -149,11 +150,12 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
/**
* @generated
*/
+ @Override
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -161,11 +163,12 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
/**
* @generated
*/
+ @Override
public void refreshBounds() {
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
}
@@ -173,12 +176,12 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -235,6 +238,7 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
/**
* @generated
*/
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -242,6 +246,7 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
/**
* @generated
*/
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -266,10 +271,10 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
+ if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -278,23 +283,25 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
/**
* @generated
*/
+ @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
/**
* @generated
*/
+ @Override
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -310,21 +317,24 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
/**
* @generated
*/
+ @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
- return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
@@ -338,8 +348,9 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
/**
* @generated
*/
+ @Override
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -348,6 +359,7 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
/**
* @generated
*/
+ @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -355,8 +367,9 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
/**
* @generated
*/
+ @Override
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.TimeObservation_3020, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.sequence.edit.parts.TimeObservationLabelEditPart.VISUAL_ID));
}
return parser;
@@ -366,7 +379,7 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
+ if (manager == null) {
setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
@@ -390,8 +403,8 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -399,8 +412,8 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -409,41 +422,42 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
domain.getCommandStack().execute(command);
@@ -455,13 +469,14 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -481,6 +496,7 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
/**
* @generated
*/
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -495,17 +511,17 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -513,15 +529,15 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -530,18 +546,19 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
/**
* @generated
*/
+ @Override
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
@@ -550,6 +567,7 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
/**
* @generated
*/
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -557,12 +575,13 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
/**
* @generated
*/
+ @Override
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -572,9 +591,10 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
/**
* @generated
*/
+ @Override
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -585,10 +605,12 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
/**
* @generated
*/
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -606,16 +628,16 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
// not a named element. no specific editor => do nothing
@@ -624,12 +646,12 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -637,7 +659,7 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -647,13 +669,13 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
/**
* Initializes the extended editor configuration
- *
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
@@ -663,23 +685,23 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
/**
* Updates the preference configuration
- *
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
+ if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- *
+ *
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -687,13 +709,14 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
try {
getEditingDomain().runExclusive(new Runnable() {
+ @Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -709,26 +732,28 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
/**
* @generated
*/
+ @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -741,6 +766,7 @@ public class TimeObservationLabelEditPart extends LabelEditPart implements IText
/**
* @generated
*/
+ @Override
protected IFigure createFigure() {
IFigure label = createFigurePrim();
defaultText = getLabelTextHelper(label);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/UMLEditPartFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/UMLEditPartFactory.java
index fe56fd7b7f2..8f849cc0617 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/UMLEditPartFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/UMLEditPartFactory.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -38,10 +38,11 @@ public class UMLEditPartFactory implements EditPartFactory {
/**
* @generated
*/
+ @Override
public EditPart createEditPart(EditPart context, Object model) {
- if(model instanceof View) {
- View view = (View)model;
- switch(UMLVisualIDRegistry.getVisualID(view)) {
+ if (model instanceof View) {
+ View view = (View) model;
+ switch (UMLVisualIDRegistry.getVisualID(view)) {
case PackageEditPart.VISUAL_ID:
return new PackageEditPart(view);
case InteractionEditPart.VISUAL_ID:
@@ -197,11 +198,11 @@ public class UMLEditPartFactory implements EditPartFactory {
* @generated NOT
*/
public static CellEditorLocator getTextCellEditorLocator(ITextAwareEditPart source) {
- if(source.getFigure() instanceof IMultilineEditableFigure) {
- return new MultilineCellEditorLocator((IMultilineEditableFigure)source.getFigure());
- } else if(source.getFigure() instanceof NodeFigure) {
- WrappingLabel wrappingLabel = (WrappingLabel)source.getFigure().getChildren().get(0);
- if(wrappingLabel != null) {
+ if (source.getFigure() instanceof IMultilineEditableFigure) {
+ return new MultilineCellEditorLocator((IMultilineEditableFigure) source.getFigure());
+ } else if (source.getFigure() instanceof NodeFigure) {
+ WrappingLabel wrappingLabel = (WrappingLabel) source.getFigure().getChildren().get(0);
+ if (wrappingLabel != null) {
return new TextCellEditorLocator(wrappingLabel);
}
return null;
@@ -237,16 +238,17 @@ public class UMLEditPartFactory implements EditPartFactory {
/**
* @generated
*/
+ @Override
public void relocate(CellEditor celleditor) {
- Text text = (Text)celleditor.getControl();
+ Text text = (Text) celleditor.getControl();
Rectangle rect = getMultilineEditableFigure().getBounds().getCopy();
rect.x = getMultilineEditableFigure().getEditionLocation().x;
rect.y = getMultilineEditableFigure().getEditionLocation().y;
getMultilineEditableFigure().translateToAbsolute(rect);
- if(getMultilineEditableFigure().getText().length() > 0) {
+ if (getMultilineEditableFigure().getText().length() > 0) {
rect.setSize(new Dimension(text.computeSize(rect.width, SWT.DEFAULT)));
}
- if(!rect.equals(new Rectangle(text.getBounds()))) {
+ if (!rect.equals(new Rectangle(text.getBounds()))) {
text.setBounds(rect.x, rect.y, rect.width, rect.height);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ActionExecutionSpecificationItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ActionExecutionSpecificationItemSemanticEditPolicy.java
index 40371dfbcd1..69a8bb495ef 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ActionExecutionSpecificationItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ActionExecutionSpecificationItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -71,13 +71,14 @@ public class ActionExecutionSpecificationItemSemanticEditPolicy extends UMLBaseI
/**
* @generated
*/
+ @Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
EObject selectedEObject = req.getElementToDestroy();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
+ if (provider != null) {
// Retrieve delete command from the Element Edit service
ICommand deleteCommand = provider.getEditCommand(req);
- if(deleteCommand != null) {
+ if (deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
}
@@ -87,6 +88,7 @@ public class ActionExecutionSpecificationItemSemanticEditPolicy extends UMLBaseI
/**
* @generated
*/
+ @Override
protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
@@ -98,67 +100,67 @@ public class ActionExecutionSpecificationItemSemanticEditPolicy extends UMLBaseI
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
return null;
}
return null;
@@ -170,72 +172,72 @@ public class ActionExecutionSpecificationItemSemanticEditPolicy extends UMLBaseI
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
@@ -245,12 +247,13 @@ public class ActionExecutionSpecificationItemSemanticEditPolicy extends UMLBaseI
/**
* Returns command to reorient EClass based link. New link target or source should be the domain
* model element associated with this node.
- *
+ *
* @generated
* (update at each lifeline modification) add general ordering
*/
+ @Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new MessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -272,11 +275,12 @@ public class ActionExecutionSpecificationItemSemanticEditPolicy extends UMLBaseI
/**
* Returns command to reorient EReference based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/BehaviorExecutionSpecificationItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/BehaviorExecutionSpecificationItemSemanticEditPolicy.java
index 3608f5a459b..ddfae2d5142 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/BehaviorExecutionSpecificationItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/BehaviorExecutionSpecificationItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -71,13 +71,14 @@ public class BehaviorExecutionSpecificationItemSemanticEditPolicy extends UMLBas
/**
* @generated
*/
+ @Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
EObject selectedEObject = req.getElementToDestroy();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
+ if (provider != null) {
// Retrieve delete command from the Element Edit service
ICommand deleteCommand = provider.getEditCommand(req);
- if(deleteCommand != null) {
+ if (deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
}
@@ -87,6 +88,7 @@ public class BehaviorExecutionSpecificationItemSemanticEditPolicy extends UMLBas
/**
* @generated
*/
+ @Override
protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
@@ -98,67 +100,67 @@ public class BehaviorExecutionSpecificationItemSemanticEditPolicy extends UMLBas
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
return null;
}
return null;
@@ -170,72 +172,72 @@ public class BehaviorExecutionSpecificationItemSemanticEditPolicy extends UMLBas
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
@@ -245,12 +247,13 @@ public class BehaviorExecutionSpecificationItemSemanticEditPolicy extends UMLBas
/**
* Returns command to reorient EClass based link. New link target or source should be the domain
* model element associated with this node.
- *
+ *
* @generated
* (update at each lifeline modification) add general ordering
*/
+ @Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new MessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -272,11 +275,12 @@ public class BehaviorExecutionSpecificationItemSemanticEditPolicy extends UMLBas
/**
* Returns command to reorient EReference based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragment2ItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragment2ItemSemanticEditPolicy.java
index cfc9d412edf..dd8bb16d5a4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragment2ItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragment2ItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -71,13 +71,14 @@ public class CombinedFragment2ItemSemanticEditPolicy extends UMLBaseItemSemantic
/**
* @generated
*/
+ @Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
EObject selectedEObject = req.getElementToDestroy();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
+ if (provider != null) {
// Retrieve delete command from the Element Edit service
ICommand deleteCommand = provider.getEditCommand(req);
- if(deleteCommand != null) {
+ if (deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
}
@@ -87,6 +88,7 @@ public class CombinedFragment2ItemSemanticEditPolicy extends UMLBaseItemSemantic
/**
* @generated
*/
+ @Override
protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
@@ -98,67 +100,67 @@ public class CombinedFragment2ItemSemanticEditPolicy extends UMLBaseItemSemantic
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
return null;
}
return null;
@@ -170,72 +172,72 @@ public class CombinedFragment2ItemSemanticEditPolicy extends UMLBaseItemSemantic
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
@@ -245,12 +247,13 @@ public class CombinedFragment2ItemSemanticEditPolicy extends UMLBaseItemSemantic
/**
* Returns command to reorient EClass based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
* (update at each lifeline modification) add general ordering
*/
+ @Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new MessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -272,11 +275,12 @@ public class CombinedFragment2ItemSemanticEditPolicy extends UMLBaseItemSemantic
/**
* Returns command to reorient EReference based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentCombinedFragmentCompartmentCanonicalEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentCombinedFragmentCompartmentCanonicalEditPolicy.java
index b7ede5c5250..ae7791039ea 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentCombinedFragmentCompartmentCanonicalEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentCombinedFragmentCompartmentCanonicalEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -47,11 +47,12 @@ public class CombinedFragmentCombinedFragmentCompartmentCanonicalEditPolicy exte
/**
* @generated
*/
+ @Override
protected void refreshOnActivate() {
// Need to activate editpart children before invoking the canonical refresh for EditParts to add event listeners
List<?> c = getHost().getChildren();
- for(int i = 0; i < c.size(); i++) {
- ((EditPart)c.get(i)).activate();
+ for (int i = 0; i < c.size(); i++) {
+ ((EditPart) c.get(i)).activate();
}
super.refreshOnActivate();
}
@@ -59,6 +60,7 @@ public class CombinedFragmentCombinedFragmentCompartmentCanonicalEditPolicy exte
/**
* @generated
*/
+ @Override
protected EStructuralFeature getFeatureToSynchronize() {
return UMLPackage.eINSTANCE.getCombinedFragment_Operand();
}
@@ -66,12 +68,13 @@ public class CombinedFragmentCombinedFragmentCompartmentCanonicalEditPolicy exte
/**
* @generated
*/
+ @Override
@SuppressWarnings("rawtypes")
protected List getSemanticChildrenList() {
- View viewObject = (View)getHost().getModel();
+ View viewObject = (View) getHost().getModel();
LinkedList<EObject> result = new LinkedList<EObject>();
List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getCombinedFragmentCombinedFragmentCompartment_7004SemanticChildren(viewObject);
- for(UMLNodeDescriptor d : childDescriptors) {
+ for (UMLNodeDescriptor d : childDescriptors) {
result.add(d.getModelElement());
}
return result;
@@ -80,6 +83,7 @@ public class CombinedFragmentCombinedFragmentCompartmentCanonicalEditPolicy exte
/**
* @generated
*/
+ @Override
protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
}
@@ -94,33 +98,34 @@ public class CombinedFragmentCombinedFragmentCompartmentCanonicalEditPolicy exte
/**
* @generated
*/
+ @Override
protected void refreshSemantic() {
- if(resolveSemanticElement() == null) {
+ if (resolveSemanticElement() == null) {
return;
}
LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getCombinedFragmentCombinedFragmentCompartment_7004SemanticChildren((View)getHost().getModel());
+ List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getCombinedFragmentCombinedFragmentCompartment_7004SemanticChildren((View) getHost().getModel());
LinkedList<View> orphaned = new LinkedList<View>();
// we care to check only views we recognize as ours
LinkedList<View> knownViewChildren = new LinkedList<View>();
- for(View v : getViewChildren()) {
- if(isMyDiagramElement(v)) {
+ for (View v : getViewChildren()) {
+ if (isMyDiagramElement(v)) {
knownViewChildren.add(v);
}
}
// alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
//
// iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
- // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
+ // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
// to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
- for(Iterator<UMLNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
+ for (Iterator<UMLNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
UMLNodeDescriptor next = descriptorsIterator.next();
String hint = UMLVisualIDRegistry.getType(next.getVisualID());
LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
- for(View childView : getViewChildren()) {
+ for (View childView : getViewChildren()) {
EObject semanticElement = childView.getElement();
- if(next.getModelElement().equals(semanticElement)) {
- if(hint.equals(childView.getType())) {
+ if (next.getModelElement().equals(semanticElement)) {
+ if (hint.equals(childView.getType())) {
perfectMatch.add(childView);
// actually, can stop iteration over view children here, but
// may want to use not the first view but last one as a 'real' match (the way original CEP does
@@ -128,7 +133,7 @@ public class CombinedFragmentCombinedFragmentCompartmentCanonicalEditPolicy exte
}
}
}
- if(perfectMatch.size() > 0) {
+ if (perfectMatch.size() > 0) {
descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
// use only one view (first or last?), keep rest as orphaned for further consideration
knownViewChildren.remove(perfectMatch.getFirst());
@@ -139,7 +144,7 @@ public class CombinedFragmentCombinedFragmentCompartmentCanonicalEditPolicy exte
orphaned.addAll(knownViewChildren);
//
ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
- for(UMLNodeDescriptor next : childDescriptors) {
+ for (UMLNodeDescriptor next : childDescriptors) {
String hint = UMLVisualIDRegistry.getType(next.getVisualID());
IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
@@ -149,17 +154,17 @@ public class CombinedFragmentCombinedFragmentCompartmentCanonicalEditPolicy exte
//
CreateViewRequest request = getCreateViewRequest(viewDescriptors);
Command cmd = getCreateViewCommand(request);
- if(cmd != null && cmd.canExecute()) {
+ if (cmd != null && cmd.canExecute()) {
SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
executeCommand(cmd);
@SuppressWarnings("unchecked")
- List<IAdaptable> nl = (List<IAdaptable>)request.getNewObject();
+ List<IAdaptable> nl = (List<IAdaptable>) request.getNewObject();
createdViews.addAll(nl);
}
- if(changed || createdViews.size() > 0) {
+ if (changed || createdViews.size() > 0) {
postProcessRefreshSemantic(createdViews);
}
- if(createdViews.size() > 1) {
+ if (createdViews.size() > 1) {
// perform a layout of the container
DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
executeCommand(new ICommandProxy(layoutCmd));
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentCombinedFragmentCompartmentItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentCombinedFragmentCompartmentItemSemanticEditPolicy.java
index 1a0e5cc82c6..ae41f6fefdd 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentCombinedFragmentCompartmentItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentCombinedFragmentCompartmentItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -36,29 +36,30 @@ public class CombinedFragmentCombinedFragmentCompartmentItemSemanticEditPolicy e
/**
* Generated not for limit InteractionOperand number. {@inheritDoc}
- *
+ *
* @generated
*/
+ @Override
protected Command getCreateCommand(CreateElementRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return super.getCreateCommand(req);
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.InteractionOperand_3005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.InteractionOperand_3005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new InteractionOperandCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentItemSemanticEditPolicy.java
index b3122c108e6..7e83e3e1b83 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CombinedFragmentItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -71,13 +71,14 @@ public class CombinedFragmentItemSemanticEditPolicy extends UMLBaseItemSemanticE
/**
* @generated
*/
+ @Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
EObject selectedEObject = req.getElementToDestroy();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
+ if (provider != null) {
// Retrieve delete command from the Element Edit service
ICommand deleteCommand = provider.getEditCommand(req);
- if(deleteCommand != null) {
+ if (deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
}
@@ -87,6 +88,7 @@ public class CombinedFragmentItemSemanticEditPolicy extends UMLBaseItemSemanticE
/**
* @generated
*/
+ @Override
protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
@@ -97,67 +99,67 @@ public class CombinedFragmentItemSemanticEditPolicy extends UMLBaseItemSemanticE
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
return null;
}
return null;
@@ -168,72 +170,72 @@ public class CombinedFragmentItemSemanticEditPolicy extends UMLBaseItemSemanticE
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
@@ -243,11 +245,12 @@ public class CombinedFragmentItemSemanticEditPolicy extends UMLBaseItemSemanticE
/**
* Returns command to reorient EClass based link. New link target or source should be the domain
* model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new MessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -269,11 +272,12 @@ public class CombinedFragmentItemSemanticEditPolicy extends UMLBaseItemSemanticE
/**
* Returns command to reorient EReference based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CommentAnnotatedElementItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CommentAnnotatedElementItemSemanticEditPolicy.java
index e80d066bfdd..254080fb538 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CommentAnnotatedElementItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CommentAnnotatedElementItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -33,6 +33,7 @@ public class CommentAnnotatedElementItemSemanticEditPolicy extends UMLBaseItemSe
/**
* @generated
*/
+ @Override
protected Command getDestroyReferenceCommand(DestroyReferenceRequest req) {
return getGEFWrapper(new DestroyReferenceCommand(req));
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CommentItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CommentItemSemanticEditPolicy.java
index d15f43f89e4..3079d8f1bc8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CommentItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CommentItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -74,18 +74,19 @@ public class CommentItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy
/**
* @generated
*/
+ @Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View)getHost().getModel();
+ 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) {
+ 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 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));
@@ -96,6 +97,7 @@ public class CommentItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy
/**
* @generated
*/
+ @Override
protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
@@ -106,70 +108,70 @@ public class CommentItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
return null;
}
return null;
@@ -180,72 +182,72 @@ public class CommentItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
@@ -255,11 +257,12 @@ public class CommentItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy
/**
* Returns command to reorient EClass based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new MessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -281,11 +284,12 @@ public class CommentItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy
/**
* Returns command to reorient EReference based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ConsiderIgnoreFragmentItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ConsiderIgnoreFragmentItemSemanticEditPolicy.java
index 928d133a048..6caaefb2d5b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ConsiderIgnoreFragmentItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ConsiderIgnoreFragmentItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -71,13 +71,14 @@ public class ConsiderIgnoreFragmentItemSemanticEditPolicy extends UMLBaseItemSem
/**
* @generated
*/
+ @Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
EObject selectedEObject = req.getElementToDestroy();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
+ if (provider != null) {
// Retrieve delete command from the Element Edit service
ICommand deleteCommand = provider.getEditCommand(req);
- if(deleteCommand != null) {
+ if (deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
}
@@ -87,6 +88,7 @@ public class ConsiderIgnoreFragmentItemSemanticEditPolicy extends UMLBaseItemSem
/**
* @generated
*/
+ @Override
protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
@@ -97,67 +99,67 @@ public class ConsiderIgnoreFragmentItemSemanticEditPolicy extends UMLBaseItemSem
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
return null;
}
return null;
@@ -168,72 +170,72 @@ public class ConsiderIgnoreFragmentItemSemanticEditPolicy extends UMLBaseItemSem
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
@@ -243,11 +245,12 @@ public class ConsiderIgnoreFragmentItemSemanticEditPolicy extends UMLBaseItemSem
/**
* Returns command to reorient EClass based link. New link target or source should be the domain
* model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new MessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -269,11 +272,12 @@ public class ConsiderIgnoreFragmentItemSemanticEditPolicy extends UMLBaseItemSem
/**
* Returns command to reorient EReference based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ConstraintConstrainedElementItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ConstraintConstrainedElementItemSemanticEditPolicy.java
index cbb33b49aac..a102cd4b4b7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ConstraintConstrainedElementItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ConstraintConstrainedElementItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -33,6 +33,7 @@ public class ConstraintConstrainedElementItemSemanticEditPolicy extends UMLBaseI
/**
* @generated
*/
+ @Override
protected Command getDestroyReferenceCommand(DestroyReferenceRequest req) {
return getGEFWrapper(new DestroyReferenceCommand(req));
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ConstraintItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ConstraintItemSemanticEditPolicy.java
index a74d10cc949..7c6499e56f4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ConstraintItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ConstraintItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -77,18 +77,19 @@ public class ConstraintItemSemanticEditPolicy extends UMLBaseItemSemanticEditPol
/**
* @generated
*/
+ @Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View)getHost().getModel();
+ 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) {
+ 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 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));
@@ -99,6 +100,7 @@ public class ConstraintItemSemanticEditPolicy extends UMLBaseItemSemanticEditPol
/**
* @generated
*/
+ @Override
protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
@@ -109,75 +111,75 @@ public class ConstraintItemSemanticEditPolicy extends UMLBaseItemSemanticEditPol
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintContext_8500 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintContext_8500 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ContextLinkCreateCommand(req, req.getSource(), req.getTarget()));
}
@@ -189,76 +191,76 @@ public class ConstraintItemSemanticEditPolicy extends UMLBaseItemSemanticEditPol
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintContext_8500 == baseElementType) {
+ if (UMLElementTypes.ConstraintContext_8500 == baseElementType) {
return null;
}
return null;
@@ -267,11 +269,12 @@ public class ConstraintItemSemanticEditPolicy extends UMLBaseItemSemanticEditPol
/**
* Returns command to reorient EClass based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new MessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -293,11 +296,12 @@ public class ConstraintItemSemanticEditPolicy extends UMLBaseItemSemanticEditPol
/**
* Returns command to reorient EReference based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ContextLinkItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ContextLinkItemSemanticEditPolicy.java
index 568129bf48f..85dd1ee277e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ContextLinkItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ContextLinkItemSemanticEditPolicy.java
@@ -20,6 +20,7 @@ public class ContextLinkItemSemanticEditPolicy extends UMLBaseItemSemanticEditPo
/**
* @generated
*/
+ @Override
protected Command getDestroyReferenceCommand(DestroyReferenceRequest req) {
return getGEFWrapper(new DestroyReferenceCommand(req));
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ContinuationItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ContinuationItemSemanticEditPolicy.java
index 0b90fc77dcb..4e4f66c34f9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ContinuationItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ContinuationItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -74,18 +74,19 @@ public class ContinuationItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
/**
* @generated
*/
+ @Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View)getHost().getModel();
+ 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) {
+ 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 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));
@@ -96,6 +97,7 @@ public class ContinuationItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
/**
* @generated
*/
+ @Override
protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
@@ -106,67 +108,67 @@ public class ContinuationItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
return null;
}
return null;
@@ -177,72 +179,72 @@ public class ContinuationItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
@@ -252,11 +254,12 @@ public class ContinuationItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
/**
* Returns command to reorient EClass based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new MessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -278,11 +281,12 @@ public class ContinuationItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
/**
* Returns command to reorient EReference based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DestructionOccurrenceSpecificationItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DestructionOccurrenceSpecificationItemSemanticEditPolicy.java
index 24359900097..809073bfb4a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DestructionOccurrenceSpecificationItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DestructionOccurrenceSpecificationItemSemanticEditPolicy.java
@@ -61,13 +61,14 @@ public class DestructionOccurrenceSpecificationItemSemanticEditPolicy extends UM
/**
* @generated
*/
+ @Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
EObject selectedEObject = req.getElementToDestroy();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
+ if (provider != null) {
// Retrieve delete command from the Element Edit service
ICommand deleteCommand = provider.getEditCommand(req);
- if(deleteCommand != null) {
+ if (deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
}
@@ -77,6 +78,7 @@ public class DestructionOccurrenceSpecificationItemSemanticEditPolicy extends UM
/**
* @generated
*/
+ @Override
protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
@@ -87,72 +89,72 @@ public class DestructionOccurrenceSpecificationItemSemanticEditPolicy extends UM
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
return null;
}
- if(UMLElementTypes.GeneralOrdering_4012 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.GeneralOrdering_4012 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new GeneralOrderingCreateCommand(req, req.getSource(), req.getTarget()));
}
@@ -164,78 +166,78 @@ public class DestructionOccurrenceSpecificationItemSemanticEditPolicy extends UM
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.GeneralOrdering_4012 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.GeneralOrdering_4012 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new GeneralOrderingCreateCommand(req, req.getSource(), req.getTarget()));
}
@@ -245,11 +247,12 @@ public class DestructionOccurrenceSpecificationItemSemanticEditPolicy extends UM
/**
* Returns command to reorient EClass based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new MessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -273,11 +276,12 @@ public class DestructionOccurrenceSpecificationItemSemanticEditPolicy extends UM
/**
* Returns command to reorient EReference based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DurationConstraintInMessageItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DurationConstraintInMessageItemSemanticEditPolicy.java
index c9208bc351c..0f2aaeedcaa 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DurationConstraintInMessageItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DurationConstraintInMessageItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -77,18 +77,19 @@ public class DurationConstraintInMessageItemSemanticEditPolicy extends UMLBaseIt
/**
* @generated
*/
+ @Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View)getHost().getModel();
+ 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) {
+ 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 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));
@@ -99,6 +100,7 @@ public class DurationConstraintInMessageItemSemanticEditPolicy extends UMLBaseIt
/**
* @generated
*/
+ @Override
protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
@@ -109,75 +111,75 @@ public class DurationConstraintInMessageItemSemanticEditPolicy extends UMLBaseIt
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintContext_8500 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintContext_8500 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ContextLinkCreateCommand(req, req.getSource(), req.getTarget()));
}
@@ -189,76 +191,76 @@ public class DurationConstraintInMessageItemSemanticEditPolicy extends UMLBaseIt
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintContext_8500 == baseElementType) {
+ if (UMLElementTypes.ConstraintContext_8500 == baseElementType) {
return null;
}
return null;
@@ -267,11 +269,12 @@ public class DurationConstraintInMessageItemSemanticEditPolicy extends UMLBaseIt
/**
* Returns command to reorient EClass based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new MessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -293,11 +296,12 @@ public class DurationConstraintInMessageItemSemanticEditPolicy extends UMLBaseIt
/**
* Returns command to reorient EReference based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DurationConstraintItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DurationConstraintItemSemanticEditPolicy.java
index 6a8f51377be..7b38a3e4c91 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DurationConstraintItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DurationConstraintItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -77,18 +77,19 @@ public class DurationConstraintItemSemanticEditPolicy extends UMLBaseItemSemanti
/**
* @generated
*/
+ @Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View)getHost().getModel();
+ 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) {
+ 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 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));
@@ -99,6 +100,7 @@ public class DurationConstraintItemSemanticEditPolicy extends UMLBaseItemSemanti
/**
* @generated
*/
+ @Override
protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
@@ -109,75 +111,75 @@ public class DurationConstraintItemSemanticEditPolicy extends UMLBaseItemSemanti
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintContext_8500 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintContext_8500 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ContextLinkCreateCommand(req, req.getSource(), req.getTarget()));
}
@@ -189,76 +191,76 @@ public class DurationConstraintItemSemanticEditPolicy extends UMLBaseItemSemanti
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintContext_8500 == baseElementType) {
+ if (UMLElementTypes.ConstraintContext_8500 == baseElementType) {
return null;
}
return null;
@@ -267,11 +269,12 @@ public class DurationConstraintItemSemanticEditPolicy extends UMLBaseItemSemanti
/**
* Returns command to reorient EClass based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new MessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -293,11 +296,12 @@ public class DurationConstraintItemSemanticEditPolicy extends UMLBaseItemSemanti
/**
* Returns command to reorient EReference based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DurationObservationItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DurationObservationItemSemanticEditPolicy.java
index 1c43363c837..6215dc83f24 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DurationObservationItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DurationObservationItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -74,18 +74,19 @@ public class DurationObservationItemSemanticEditPolicy extends UMLBaseItemSemant
/**
* @generated
*/
+ @Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View)getHost().getModel();
+ 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) {
+ 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 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));
@@ -96,6 +97,7 @@ public class DurationObservationItemSemanticEditPolicy extends UMLBaseItemSemant
/**
* @generated
*/
+ @Override
protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
@@ -106,67 +108,67 @@ public class DurationObservationItemSemanticEditPolicy extends UMLBaseItemSemant
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
return null;
}
return null;
@@ -177,72 +179,72 @@ public class DurationObservationItemSemanticEditPolicy extends UMLBaseItemSemant
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
@@ -252,11 +254,12 @@ public class DurationObservationItemSemanticEditPolicy extends UMLBaseItemSemant
/**
* Returns command to reorient EClass based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new MessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -278,11 +281,12 @@ public class DurationObservationItemSemanticEditPolicy extends UMLBaseItemSemant
/**
* Returns command to reorient EReference based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/GeneralOrderingItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/GeneralOrderingItemSemanticEditPolicy.java
index a37e2eac78b..2ac562239eb 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/GeneralOrderingItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/GeneralOrderingItemSemanticEditPolicy.java
@@ -59,20 +59,22 @@ public class GeneralOrderingItemSemanticEditPolicy extends UMLBaseItemSemanticEd
/**
* @generated
*/
+ @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 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));
+ // return getGEFWrapper(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
}
/**
* @generated
*/
+ @Override
protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
@@ -83,67 +85,67 @@ public class GeneralOrderingItemSemanticEditPolicy extends UMLBaseItemSemanticEd
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
return null;
}
return null;
@@ -154,72 +156,72 @@ public class GeneralOrderingItemSemanticEditPolicy extends UMLBaseItemSemanticEd
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
@@ -229,11 +231,12 @@ public class GeneralOrderingItemSemanticEditPolicy extends UMLBaseItemSemanticEd
/**
* Returns command to reorient EClass based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new MessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -255,11 +258,12 @@ public class GeneralOrderingItemSemanticEditPolicy extends UMLBaseItemSemanticEd
/**
* Returns command to reorient EReference based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionCanonicalEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionCanonicalEditPolicy.java
index 7cefa80b44b..1f62a785ef0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionCanonicalEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionCanonicalEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -55,11 +55,12 @@ public class InteractionCanonicalEditPolicy extends CanonicalEditPolicy {
/**
* @generated
*/
+ @Override
protected void refreshOnActivate() {
// Need to activate editpart children before invoking the canonical refresh for EditParts to add event listeners
List<?> c = getHost().getChildren();
- for(int i = 0; i < c.size(); i++) {
- ((EditPart)c.get(i)).activate();
+ for (int i = 0; i < c.size(); i++) {
+ ((EditPart) c.get(i)).activate();
}
super.refreshOnActivate();
}
@@ -67,12 +68,13 @@ public class InteractionCanonicalEditPolicy extends CanonicalEditPolicy {
/**
* @generated
*/
+ @Override
@SuppressWarnings("rawtypes")
protected List getSemanticChildrenList() {
- View viewObject = (View)getHost().getModel();
+ View viewObject = (View) getHost().getModel();
LinkedList<EObject> result = new LinkedList<EObject>();
List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getInteraction_2001SemanticChildren(viewObject);
- for(UMLNodeDescriptor d : childDescriptors) {
+ for (UMLNodeDescriptor d : childDescriptors) {
result.add(d.getModelElement());
}
return result;
@@ -81,6 +83,7 @@ public class InteractionCanonicalEditPolicy extends CanonicalEditPolicy {
/**
* @generated
*/
+ @Override
protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
}
@@ -96,33 +99,34 @@ public class InteractionCanonicalEditPolicy extends CanonicalEditPolicy {
/**
* @generated
*/
+ @Override
protected void refreshSemantic() {
- if(resolveSemanticElement() == null) {
+ if (resolveSemanticElement() == null) {
return;
}
LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getInteraction_2001SemanticChildren((View)getHost().getModel());
+ List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getInteraction_2001SemanticChildren((View) getHost().getModel());
LinkedList<View> orphaned = new LinkedList<View>();
// we care to check only views we recognize as ours
LinkedList<View> knownViewChildren = new LinkedList<View>();
- for(View v : getViewChildren()) {
- if(isMyDiagramElement(v)) {
+ for (View v : getViewChildren()) {
+ if (isMyDiagramElement(v)) {
knownViewChildren.add(v);
}
}
// alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
//
// iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
- // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
+ // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
// to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
- for(Iterator<UMLNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
+ for (Iterator<UMLNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
UMLNodeDescriptor next = descriptorsIterator.next();
String hint = UMLVisualIDRegistry.getType(next.getVisualID());
LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
- for(View childView : getViewChildren()) {
+ for (View childView : getViewChildren()) {
EObject semanticElement = childView.getElement();
- if(next.getModelElement().equals(semanticElement)) {
- if(hint.equals(childView.getType())) {
+ if (next.getModelElement().equals(semanticElement)) {
+ if (hint.equals(childView.getType())) {
perfectMatch.add(childView);
// actually, can stop iteration over view children here, but
// may want to use not the first view but last one as a 'real' match (the way original CEP does
@@ -130,7 +134,7 @@ public class InteractionCanonicalEditPolicy extends CanonicalEditPolicy {
}
}
}
- if(perfectMatch.size() > 0) {
+ if (perfectMatch.size() > 0) {
descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
// use only one view (first or last?), keep rest as orphaned for further consideration
knownViewChildren.remove(perfectMatch.getFirst());
@@ -141,7 +145,7 @@ public class InteractionCanonicalEditPolicy extends CanonicalEditPolicy {
orphaned.addAll(knownViewChildren);
//
ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
- for(UMLNodeDescriptor next : childDescriptors) {
+ for (UMLNodeDescriptor next : childDescriptors) {
String hint = UMLVisualIDRegistry.getType(next.getVisualID());
IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
@@ -151,17 +155,17 @@ public class InteractionCanonicalEditPolicy extends CanonicalEditPolicy {
//
CreateViewRequest request = getCreateViewRequest(viewDescriptors);
Command cmd = getCreateViewCommand(request);
- if(cmd != null && cmd.canExecute()) {
+ if (cmd != null && cmd.canExecute()) {
SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
executeCommand(cmd);
@SuppressWarnings("unchecked")
- List<IAdaptable> nl = (List<IAdaptable>)request.getNewObject();
+ List<IAdaptable> nl = (List<IAdaptable>) request.getNewObject();
createdViews.addAll(nl);
}
- if(changed || createdViews.size() > 0) {
+ if (changed || createdViews.size() > 0) {
postProcessRefreshSemantic(createdViews);
}
- if(createdViews.size() > 1) {
+ if (createdViews.size() > 1) {
// perform a layout of the container
DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
executeCommand(new ICommandProxy(layoutCmd));
@@ -172,8 +176,9 @@ public class InteractionCanonicalEditPolicy extends CanonicalEditPolicy {
/**
* @generated
*/
+ @Override
protected Set getFeaturesToSynchronize() {
- if(myFeaturesToSynchronize == null) {
+ if (myFeaturesToSynchronize == null) {
myFeaturesToSynchronize = new HashSet<EStructuralFeature>();
myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getNamespace_OwnedRule());
myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getPackage_PackagedElement());
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionInteractionCompartmentCanonicalEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionInteractionCompartmentCanonicalEditPolicy.java
index d5b603fd2bf..d4cccf03e37 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionInteractionCompartmentCanonicalEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionInteractionCompartmentCanonicalEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -59,11 +59,12 @@ public class InteractionInteractionCompartmentCanonicalEditPolicy extends Canoni
/**
* @generated
*/
+ @Override
protected void refreshOnActivate() {
// Need to activate editpart children before invoking the canonical refresh for EditParts to add event listeners
List<?> c = getHost().getChildren();
- for(int i = 0; i < c.size(); i++) {
- ((EditPart)c.get(i)).activate();
+ for (int i = 0; i < c.size(); i++) {
+ ((EditPart) c.get(i)).activate();
}
super.refreshOnActivate();
}
@@ -71,12 +72,13 @@ public class InteractionInteractionCompartmentCanonicalEditPolicy extends Canoni
/**
* @generated
*/
+ @Override
@SuppressWarnings("rawtypes")
protected List getSemanticChildrenList() {
- View viewObject = (View)getHost().getModel();
+ View viewObject = (View) getHost().getModel();
LinkedList<EObject> result = new LinkedList<EObject>();
List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getInteractionInteractionCompartment_7001SemanticChildren(viewObject);
- for(UMLNodeDescriptor d : childDescriptors) {
+ for (UMLNodeDescriptor d : childDescriptors) {
result.add(d.getModelElement());
}
return result;
@@ -85,6 +87,7 @@ public class InteractionInteractionCompartmentCanonicalEditPolicy extends Canoni
/**
* @generated
*/
+ @Override
protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
}
@@ -94,7 +97,7 @@ public class InteractionInteractionCompartmentCanonicalEditPolicy extends Canoni
*/
private boolean isMyDiagramElement(View view) {
int visualID = UMLVisualIDRegistry.getVisualID(view);
- switch(visualID) {
+ switch (visualID) {
case ConsiderIgnoreFragmentEditPart.VISUAL_ID:
case CombinedFragmentEditPart.VISUAL_ID:
case LifelineEditPart.VISUAL_ID:
@@ -109,33 +112,34 @@ public class InteractionInteractionCompartmentCanonicalEditPolicy extends Canoni
/**
* @generated
*/
+ @Override
protected void refreshSemantic() {
- if(resolveSemanticElement() == null) {
+ if (resolveSemanticElement() == null) {
return;
}
LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getInteractionInteractionCompartment_7001SemanticChildren((View)getHost().getModel());
+ List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getInteractionInteractionCompartment_7001SemanticChildren((View) getHost().getModel());
LinkedList<View> orphaned = new LinkedList<View>();
// we care to check only views we recognize as ours
LinkedList<View> knownViewChildren = new LinkedList<View>();
- for(View v : getViewChildren()) {
- if(isMyDiagramElement(v)) {
+ for (View v : getViewChildren()) {
+ if (isMyDiagramElement(v)) {
knownViewChildren.add(v);
}
}
// alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
//
// iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
- // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
+ // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
// to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
- for(Iterator<UMLNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
+ for (Iterator<UMLNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
UMLNodeDescriptor next = descriptorsIterator.next();
String hint = UMLVisualIDRegistry.getType(next.getVisualID());
LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
- for(View childView : getViewChildren()) {
+ for (View childView : getViewChildren()) {
EObject semanticElement = childView.getElement();
- if(next.getModelElement().equals(semanticElement)) {
- if(hint.equals(childView.getType())) {
+ if (next.getModelElement().equals(semanticElement)) {
+ if (hint.equals(childView.getType())) {
perfectMatch.add(childView);
// actually, can stop iteration over view children here, but
// may want to use not the first view but last one as a 'real' match (the way original CEP does
@@ -143,7 +147,7 @@ public class InteractionInteractionCompartmentCanonicalEditPolicy extends Canoni
}
}
}
- if(perfectMatch.size() > 0) {
+ if (perfectMatch.size() > 0) {
descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
// use only one view (first or last?), keep rest as orphaned for further consideration
knownViewChildren.remove(perfectMatch.getFirst());
@@ -154,7 +158,7 @@ public class InteractionInteractionCompartmentCanonicalEditPolicy extends Canoni
orphaned.addAll(knownViewChildren);
//
ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
- for(UMLNodeDescriptor next : childDescriptors) {
+ for (UMLNodeDescriptor next : childDescriptors) {
String hint = UMLVisualIDRegistry.getType(next.getVisualID());
IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
@@ -164,17 +168,17 @@ public class InteractionInteractionCompartmentCanonicalEditPolicy extends Canoni
//
CreateViewRequest request = getCreateViewRequest(viewDescriptors);
Command cmd = getCreateViewCommand(request);
- if(cmd != null && cmd.canExecute()) {
+ if (cmd != null && cmd.canExecute()) {
SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
executeCommand(cmd);
@SuppressWarnings("unchecked")
- List<IAdaptable> nl = (List<IAdaptable>)request.getNewObject();
+ List<IAdaptable> nl = (List<IAdaptable>) request.getNewObject();
createdViews.addAll(nl);
}
- if(changed || createdViews.size() > 0) {
+ if (changed || createdViews.size() > 0) {
postProcessRefreshSemantic(createdViews);
}
- if(createdViews.size() > 1) {
+ if (createdViews.size() > 1) {
// perform a layout of the container
DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
executeCommand(new ICommandProxy(layoutCmd));
@@ -185,8 +189,9 @@ public class InteractionInteractionCompartmentCanonicalEditPolicy extends Canoni
/**
* @generated
*/
+ @Override
protected Set getFeaturesToSynchronize() {
- if(myFeaturesToSynchronize == null) {
+ if (myFeaturesToSynchronize == null) {
myFeaturesToSynchronize = new HashSet<EStructuralFeature>();
myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getInteraction_Fragment());
myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getInteraction_Lifeline());
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionInteractionCompartmentItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionInteractionCompartmentItemSemanticEditPolicy.java
index 9f33dcfac6c..f7e4047a649 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionInteractionCompartmentItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionInteractionCompartmentItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -42,56 +42,57 @@ public class InteractionInteractionCompartmentItemSemanticEditPolicy extends UML
/**
* @generated
*/
+ @Override
protected Command getCreateCommand(CreateElementRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return super.getCreateCommand(req);
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.ConsiderIgnoreFragment_3007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConsiderIgnoreFragment_3007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConsiderIgnoreFragmentCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.CombinedFragment_3004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CombinedFragment_3004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CombinedFragmentCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.Lifeline_3001 == baseElementType) {
- if(isExtendedType) {
- return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Lifeline_3001 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new LifelineCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.InteractionUse_3002 == baseElementType) {
- if(isExtendedType) {
- return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.InteractionUse_3002 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new InteractionUseCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.Constraint_3008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Constraint_3008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.Comment_3009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Comment_3009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CommentCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionItemSemanticEditPolicy.java
index f6a8f798579..6066bdc22e7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -78,32 +78,33 @@ public class InteractionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPo
/**
* @generated
*/
+ @Override
protected Command getCreateCommand(CreateElementRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return super.getCreateCommand(req);
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.DurationConstraint_3023 == baseElementType) {
- if(isExtendedType) {
- return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.DurationConstraint_3023 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new DurationConstraintInMessageCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.DurationObservation_3024 == baseElementType) {
- if(isExtendedType) {
- return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.DurationObservation_3024 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new DurationObservationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
@@ -113,13 +114,14 @@ public class InteractionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPo
/**
* @generated
*/
+ @Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
EObject selectedEObject = req.getElementToDestroy();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
+ if (provider != null) {
// Retrieve delete command from the Element Edit service
ICommand deleteCommand = provider.getEditCommand(req);
- if(deleteCommand != null) {
+ if (deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
}
@@ -129,6 +131,7 @@ public class InteractionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPo
/**
* @generated
*/
+ @Override
protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
@@ -139,70 +142,70 @@ public class InteractionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPo
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
return null;
}
- if(UMLElementTypes.ConstraintContext_8500 == baseElementType) {
+ if (UMLElementTypes.ConstraintContext_8500 == baseElementType) {
return null;
}
return null;
@@ -213,78 +216,78 @@ public class InteractionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPo
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintContext_8500 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintContext_8500 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ContextLinkCreateCommand(req, req.getSource(), req.getTarget()));
}
@@ -294,11 +297,12 @@ public class InteractionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPo
/**
* Returns command to reorient EClass based link. New link target or source should be the domain
* model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new MessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -320,11 +324,12 @@ public class InteractionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPo
/**
* Returns command to reorient EReference based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandCanonicalEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandCanonicalEditPolicy.java
index 0ad2c77f50d..68c60349a16 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandCanonicalEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandCanonicalEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -57,11 +57,12 @@ public class InteractionOperandCanonicalEditPolicy extends CanonicalEditPolicy {
/**
* @generated
*/
+ @Override
protected void refreshOnActivate() {
// Need to activate editpart children before invoking the canonical refresh for EditParts to add event listeners
List<?> c = getHost().getChildren();
- for(int i = 0; i < c.size(); i++) {
- ((EditPart)c.get(i)).activate();
+ for (int i = 0; i < c.size(); i++) {
+ ((EditPart) c.get(i)).activate();
}
super.refreshOnActivate();
}
@@ -69,12 +70,13 @@ public class InteractionOperandCanonicalEditPolicy extends CanonicalEditPolicy {
/**
* @generated
*/
+ @Override
@SuppressWarnings("rawtypes")
protected List getSemanticChildrenList() {
- View viewObject = (View)getHost().getModel();
+ View viewObject = (View) getHost().getModel();
LinkedList<EObject> result = new LinkedList<EObject>();
List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getInteractionOperand_3005SemanticChildren(viewObject);
- for(UMLNodeDescriptor d : childDescriptors) {
+ for (UMLNodeDescriptor d : childDescriptors) {
result.add(d.getModelElement());
}
return result;
@@ -83,6 +85,7 @@ public class InteractionOperandCanonicalEditPolicy extends CanonicalEditPolicy {
/**
* @generated
*/
+ @Override
protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
}
@@ -92,7 +95,7 @@ public class InteractionOperandCanonicalEditPolicy extends CanonicalEditPolicy {
*/
private boolean isMyDiagramElement(View view) {
int visualID = UMLVisualIDRegistry.getVisualID(view);
- switch(visualID) {
+ switch (visualID) {
case InteractionUseEditPart.VISUAL_ID:
case ConsiderIgnoreFragmentEditPart.VISUAL_ID:
case CombinedFragmentEditPart.VISUAL_ID:
@@ -105,33 +108,34 @@ public class InteractionOperandCanonicalEditPolicy extends CanonicalEditPolicy {
/**
* @generated
*/
+ @Override
protected void refreshSemantic() {
- if(resolveSemanticElement() == null) {
+ if (resolveSemanticElement() == null) {
return;
}
LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getInteractionOperand_3005SemanticChildren((View)getHost().getModel());
+ List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getInteractionOperand_3005SemanticChildren((View) getHost().getModel());
LinkedList<View> orphaned = new LinkedList<View>();
// we care to check only views we recognize as ours
LinkedList<View> knownViewChildren = new LinkedList<View>();
- for(View v : getViewChildren()) {
- if(isMyDiagramElement(v)) {
+ for (View v : getViewChildren()) {
+ if (isMyDiagramElement(v)) {
knownViewChildren.add(v);
}
}
// alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
//
// iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
- // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
+ // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
// to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
- for(Iterator<UMLNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
+ for (Iterator<UMLNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
UMLNodeDescriptor next = descriptorsIterator.next();
String hint = UMLVisualIDRegistry.getType(next.getVisualID());
LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
- for(View childView : getViewChildren()) {
+ for (View childView : getViewChildren()) {
EObject semanticElement = childView.getElement();
- if(next.getModelElement().equals(semanticElement)) {
- if(hint.equals(childView.getType())) {
+ if (next.getModelElement().equals(semanticElement)) {
+ if (hint.equals(childView.getType())) {
perfectMatch.add(childView);
// actually, can stop iteration over view children here, but
// may want to use not the first view but last one as a 'real' match (the way original CEP does
@@ -139,7 +143,7 @@ public class InteractionOperandCanonicalEditPolicy extends CanonicalEditPolicy {
}
}
}
- if(perfectMatch.size() > 0) {
+ if (perfectMatch.size() > 0) {
descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
// use only one view (first or last?), keep rest as orphaned for further consideration
knownViewChildren.remove(perfectMatch.getFirst());
@@ -150,7 +154,7 @@ public class InteractionOperandCanonicalEditPolicy extends CanonicalEditPolicy {
orphaned.addAll(knownViewChildren);
//
ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
- for(UMLNodeDescriptor next : childDescriptors) {
+ for (UMLNodeDescriptor next : childDescriptors) {
String hint = UMLVisualIDRegistry.getType(next.getVisualID());
IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
@@ -160,17 +164,17 @@ public class InteractionOperandCanonicalEditPolicy extends CanonicalEditPolicy {
//
CreateViewRequest request = getCreateViewRequest(viewDescriptors);
Command cmd = getCreateViewCommand(request);
- if(cmd != null && cmd.canExecute()) {
+ if (cmd != null && cmd.canExecute()) {
SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
executeCommand(cmd);
@SuppressWarnings("unchecked")
- List<IAdaptable> nl = (List<IAdaptable>)request.getNewObject();
+ List<IAdaptable> nl = (List<IAdaptable>) request.getNewObject();
createdViews.addAll(nl);
}
- if(changed || createdViews.size() > 0) {
+ if (changed || createdViews.size() > 0) {
postProcessRefreshSemantic(createdViews);
}
- if(createdViews.size() > 1) {
+ if (createdViews.size() > 1) {
// perform a layout of the container
DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
executeCommand(new ICommandProxy(layoutCmd));
@@ -181,8 +185,9 @@ public class InteractionOperandCanonicalEditPolicy extends CanonicalEditPolicy {
/**
* @generated
*/
+ @Override
protected Set getFeaturesToSynchronize() {
- if(myFeaturesToSynchronize == null) {
+ if (myFeaturesToSynchronize == null) {
myFeaturesToSynchronize = new HashSet<EStructuralFeature>();
myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getInteraction_Fragment());
myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getInteractionOperand_Fragment());
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandItemSemanticEditPolicy.java
index 19714399164..fcf30da402a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -80,44 +80,45 @@ public class InteractionOperandItemSemanticEditPolicy extends UMLBaseItemSemanti
/**
* @generated
*/
+ @Override
protected Command getCreateCommand(CreateElementRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return super.getCreateCommand(req);
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.InteractionUse_3002 == baseElementType) {
- if(isExtendedType) {
- return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.InteractionUse_3002 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new InteractionUseCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.ConsiderIgnoreFragment_3007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConsiderIgnoreFragment_3007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConsiderIgnoreFragmentCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.CombinedFragment_3004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CombinedFragment_3004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CombinedFragmentCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.Continuation_3016 == baseElementType) {
- if(isExtendedType) {
- return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Continuation_3016 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ContinuationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
@@ -127,13 +128,14 @@ public class InteractionOperandItemSemanticEditPolicy extends UMLBaseItemSemanti
/**
* @generated
*/
+ @Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
EObject selectedEObject = req.getElementToDestroy();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
+ if (provider != null) {
// Retrieve delete command from the Element Edit service
ICommand deleteCommand = provider.getEditCommand(req);
- if(deleteCommand != null) {
+ if (deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
}
@@ -143,6 +145,7 @@ public class InteractionOperandItemSemanticEditPolicy extends UMLBaseItemSemanti
/**
* @generated
*/
+ @Override
protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
@@ -153,70 +156,70 @@ public class InteractionOperandItemSemanticEditPolicy extends UMLBaseItemSemanti
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
return null;
}
- if(UMLElementTypes.ConstraintContext_8500 == baseElementType) {
+ if (UMLElementTypes.ConstraintContext_8500 == baseElementType) {
return null;
}
return null;
@@ -227,78 +230,78 @@ public class InteractionOperandItemSemanticEditPolicy extends UMLBaseItemSemanti
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintContext_8500 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintContext_8500 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ContextLinkCreateCommand(req, req.getSource(), req.getTarget()));
}
@@ -308,11 +311,12 @@ public class InteractionOperandItemSemanticEditPolicy extends UMLBaseItemSemanti
/**
* Returns command to reorient EClass based link. New link target or source should be the domain
* model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new MessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -334,11 +338,12 @@ public class InteractionOperandItemSemanticEditPolicy extends UMLBaseItemSemanti
/**
* Returns command to reorient EReference based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionUseItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionUseItemSemanticEditPolicy.java
index 65d85a6aadc..e6653d27bcf 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionUseItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionUseItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -74,18 +74,19 @@ public class InteractionUseItemSemanticEditPolicy extends UMLBaseItemSemanticEdi
/**
* @generated
*/
+ @Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View)getHost().getModel();
+ 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) {
+ 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 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));
@@ -96,6 +97,7 @@ public class InteractionUseItemSemanticEditPolicy extends UMLBaseItemSemanticEdi
/**
* @generated
*/
+ @Override
protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
@@ -106,67 +108,67 @@ public class InteractionUseItemSemanticEditPolicy extends UMLBaseItemSemanticEdi
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
return null;
}
return null;
@@ -177,72 +179,72 @@ public class InteractionUseItemSemanticEditPolicy extends UMLBaseItemSemanticEdi
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
@@ -252,11 +254,12 @@ public class InteractionUseItemSemanticEditPolicy extends UMLBaseItemSemanticEdi
/**
* Returns command to reorient EClass based link. New link target or source should be the domain
* model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new MessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -278,11 +281,12 @@ public class InteractionUseItemSemanticEditPolicy extends UMLBaseItemSemanticEdi
/**
* Returns command to reorient EReference based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineCanonicalEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineCanonicalEditPolicy.java
index 21919a541e1..024ce0bc48d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineCanonicalEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineCanonicalEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -61,11 +61,12 @@ public class LifelineCanonicalEditPolicy extends CanonicalEditPolicy {
/**
* @generated
*/
+ @Override
protected void refreshOnActivate() {
// Need to activate editpart children before invoking the canonical refresh for EditParts to add event listeners
List<?> c = getHost().getChildren();
- for(int i = 0; i < c.size(); i++) {
- ((EditPart)c.get(i)).activate();
+ for (int i = 0; i < c.size(); i++) {
+ ((EditPart) c.get(i)).activate();
}
super.refreshOnActivate();
}
@@ -73,12 +74,13 @@ public class LifelineCanonicalEditPolicy extends CanonicalEditPolicy {
/**
* @generated
*/
+ @Override
@SuppressWarnings("rawtypes")
protected List getSemanticChildrenList() {
- View viewObject = (View)getHost().getModel();
+ View viewObject = (View) getHost().getModel();
LinkedList<EObject> result = new LinkedList<EObject>();
List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getLifeline_3001SemanticChildren(viewObject);
- for(UMLNodeDescriptor d : childDescriptors) {
+ for (UMLNodeDescriptor d : childDescriptors) {
result.add(d.getModelElement());
}
return result;
@@ -87,6 +89,7 @@ public class LifelineCanonicalEditPolicy extends CanonicalEditPolicy {
/**
* @generated
*/
+ @Override
protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
}
@@ -96,7 +99,7 @@ public class LifelineCanonicalEditPolicy extends CanonicalEditPolicy {
*/
private boolean isMyDiagramElement(View view) {
int visualID = UMLVisualIDRegistry.getVisualID(view);
- switch(visualID) {
+ switch (visualID) {
case ActionExecutionSpecificationEditPart.VISUAL_ID:
case BehaviorExecutionSpecificationEditPart.VISUAL_ID:
case StateInvariantEditPart.VISUAL_ID:
@@ -113,33 +116,34 @@ public class LifelineCanonicalEditPolicy extends CanonicalEditPolicy {
/**
* @generated
*/
+ @Override
protected void refreshSemantic() {
- if(resolveSemanticElement() == null) {
+ if (resolveSemanticElement() == null) {
return;
}
LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getLifeline_3001SemanticChildren((View)getHost().getModel());
+ List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getLifeline_3001SemanticChildren((View) getHost().getModel());
LinkedList<View> orphaned = new LinkedList<View>();
// we care to check only views we recognize as ours
LinkedList<View> knownViewChildren = new LinkedList<View>();
- for(View v : getViewChildren()) {
- if(isMyDiagramElement(v)) {
+ for (View v : getViewChildren()) {
+ if (isMyDiagramElement(v)) {
knownViewChildren.add(v);
}
}
// alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
//
// iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
- // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
+ // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
// to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
- for(Iterator<UMLNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
+ for (Iterator<UMLNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
UMLNodeDescriptor next = descriptorsIterator.next();
String hint = UMLVisualIDRegistry.getType(next.getVisualID());
LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
- for(View childView : getViewChildren()) {
+ for (View childView : getViewChildren()) {
EObject semanticElement = childView.getElement();
- if(next.getModelElement().equals(semanticElement)) {
- if(hint.equals(childView.getType())) {
+ if (next.getModelElement().equals(semanticElement)) {
+ if (hint.equals(childView.getType())) {
perfectMatch.add(childView);
// actually, can stop iteration over view children here, but
// may want to use not the first view but last one as a 'real' match (the way original CEP does
@@ -147,7 +151,7 @@ public class LifelineCanonicalEditPolicy extends CanonicalEditPolicy {
}
}
}
- if(perfectMatch.size() > 0) {
+ if (perfectMatch.size() > 0) {
descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
// use only one view (first or last?), keep rest as orphaned for further consideration
knownViewChildren.remove(perfectMatch.getFirst());
@@ -158,7 +162,7 @@ public class LifelineCanonicalEditPolicy extends CanonicalEditPolicy {
orphaned.addAll(knownViewChildren);
//
ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
- for(UMLNodeDescriptor next : childDescriptors) {
+ for (UMLNodeDescriptor next : childDescriptors) {
String hint = UMLVisualIDRegistry.getType(next.getVisualID());
IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
@@ -168,17 +172,17 @@ public class LifelineCanonicalEditPolicy extends CanonicalEditPolicy {
//
CreateViewRequest request = getCreateViewRequest(viewDescriptors);
Command cmd = getCreateViewCommand(request);
- if(cmd != null && cmd.canExecute()) {
+ if (cmd != null && cmd.canExecute()) {
SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
executeCommand(cmd);
@SuppressWarnings("unchecked")
- List<IAdaptable> nl = (List<IAdaptable>)request.getNewObject();
+ List<IAdaptable> nl = (List<IAdaptable>) request.getNewObject();
createdViews.addAll(nl);
}
- if(changed || createdViews.size() > 0) {
+ if (changed || createdViews.size() > 0) {
postProcessRefreshSemantic(createdViews);
}
- if(createdViews.size() > 1) {
+ if (createdViews.size() > 1) {
// perform a layout of the container
DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
executeCommand(new ICommandProxy(layoutCmd));
@@ -189,8 +193,9 @@ public class LifelineCanonicalEditPolicy extends CanonicalEditPolicy {
/**
* @generated
*/
+ @Override
protected Set getFeaturesToSynchronize() {
- if(myFeaturesToSynchronize == null) {
+ if (myFeaturesToSynchronize == null) {
myFeaturesToSynchronize = new HashSet<EStructuralFeature>();
myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getInteraction_Fragment());
myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getNamespace_OwnedRule());
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineItemSemanticEditPolicy.java
index ef6a41be44e..b971cee83d9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -80,72 +80,73 @@ public class LifelineItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* Generated not for add lifelines on lifeline
- *
+ *
* @generated
* (update at each lifeline modification) add lifelines, add DurationObservation/Constraint
*/
+ @Override
protected Command getCreateCommand(CreateElementRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return super.getCreateCommand(req);
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.ActionExecutionSpecification_3006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ActionExecutionSpecification_3006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ActionExecutionSpecificationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.BehaviorExecutionSpecification_3003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.BehaviorExecutionSpecification_3003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new BehaviorExecutionSpecificationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.StateInvariant_3017 == baseElementType) {
- if(isExtendedType) {
- return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.StateInvariant_3017 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new StateInvariantCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.CombinedFragment_3018 == baseElementType) {
- if(isExtendedType) {
- return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CombinedFragment_3018 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CombinedFragment2CreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.TimeConstraint_3019 == baseElementType) {
- if(isExtendedType) {
- return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.TimeConstraint_3019 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new TimeConstraintCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.TimeObservation_3020 == baseElementType) {
- if(isExtendedType) {
- return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.TimeObservation_3020 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new TimeObservationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.DurationConstraint_3021 == baseElementType) {
- if(isExtendedType) {
- return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.DurationConstraint_3021 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new DurationConstraintCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if(UMLElementTypes.DestructionOccurrenceSpecification_3022 == baseElementType) {
- if(isExtendedType) {
- return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.DestructionOccurrenceSpecification_3022 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new DestructionOccurrenceSpecificationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
@@ -155,13 +156,14 @@ public class LifelineItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* @generated
*/
+ @Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
EObject selectedEObject = req.getElementToDestroy();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
+ if (provider != null) {
// Retrieve delete command from the Element Edit service
ICommand deleteCommand = provider.getEditCommand(req);
- if(deleteCommand != null) {
+ if (deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
}
@@ -171,6 +173,7 @@ public class LifelineItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* @generated
*/
+ @Override
protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
@@ -182,67 +185,67 @@ public class LifelineItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
return null;
}
return null;
@@ -254,72 +257,72 @@ public class LifelineItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
@@ -329,12 +332,13 @@ public class LifelineItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* Returns command to reorient EClass based link. New link target or source should be the domain
* model element associated with this node.
- *
+ *
* @generated
* (update at each lifeline modification) add general ordering
*/
+ @Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new MessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -356,11 +360,12 @@ public class LifelineItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* Returns command to reorient EReference based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message2ItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message2ItemSemanticEditPolicy.java
index e0ee7ff73ec..1bcef627f64 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message2ItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message2ItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -70,16 +70,17 @@ public class Message2ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* the added code to delete the messageoccurencespecification when the message is deleted
- *
+ *
* @generated
*/
+ @Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
EObject selectedEObject = req.getElementToDestroy();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
+ if (provider != null) {
// Retrieve delete command from the Element Edit service
ICommand deleteCommand = provider.getEditCommand(req);
- if(deleteCommand != null) {
+ if (deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
}
@@ -89,6 +90,7 @@ public class Message2ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* @generated
*/
+ @Override
protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
@@ -99,67 +101,67 @@ public class Message2ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
return null;
}
return null;
@@ -170,72 +172,72 @@ public class Message2ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
@@ -245,11 +247,12 @@ public class Message2ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* Returns command to reorient EClass based link. New link target or source should be the domain
* model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new MessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -271,11 +274,12 @@ public class Message2ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* Returns command to reorient EReference based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message3ItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message3ItemSemanticEditPolicy.java
index 5e7febf3d91..c2941858447 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message3ItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message3ItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -71,13 +71,14 @@ public class Message3ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* @generated
*/
+ @Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
EObject selectedEObject = req.getElementToDestroy();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
+ if (provider != null) {
// Retrieve delete command from the Element Edit service
ICommand deleteCommand = provider.getEditCommand(req);
- if(deleteCommand != null) {
+ if (deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
}
@@ -87,6 +88,7 @@ public class Message3ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* @generated
*/
+ @Override
protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
@@ -97,67 +99,67 @@ public class Message3ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
return null;
}
return null;
@@ -168,72 +170,72 @@ public class Message3ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
@@ -243,11 +245,12 @@ public class Message3ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* Returns command to reorient EClass based link. New link target or source should be the domain
* model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new MessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -269,11 +272,12 @@ public class Message3ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* Returns command to reorient EReference based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message4ItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message4ItemSemanticEditPolicy.java
index db8e7cb250f..7f4198c52f0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message4ItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message4ItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -71,13 +71,14 @@ public class Message4ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* @generated
*/
+ @Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
EObject selectedEObject = req.getElementToDestroy();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
+ if (provider != null) {
// Retrieve delete command from the Element Edit service
ICommand deleteCommand = provider.getEditCommand(req);
- if(deleteCommand != null) {
+ if (deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
}
@@ -87,6 +88,7 @@ public class Message4ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* @generated
*/
+ @Override
protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
@@ -97,67 +99,67 @@ public class Message4ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
return null;
}
return null;
@@ -168,72 +170,72 @@ public class Message4ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
@@ -243,11 +245,12 @@ public class Message4ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* Returns command to reorient EClass based link. New link target or source should be the domain
* model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new MessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -269,11 +272,12 @@ public class Message4ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* Returns command to reorient EReference based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message5ItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message5ItemSemanticEditPolicy.java
index 6bc13b1f1c7..758f084f7b9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message5ItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message5ItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -71,13 +71,14 @@ public class Message5ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* @generated
*/
+ @Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
EObject selectedEObject = req.getElementToDestroy();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
+ if (provider != null) {
// Retrieve delete command from the Element Edit service
ICommand deleteCommand = provider.getEditCommand(req);
- if(deleteCommand != null) {
+ if (deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
}
@@ -87,6 +88,7 @@ public class Message5ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* @generated
*/
+ @Override
protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
@@ -97,67 +99,67 @@ public class Message5ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
return null;
}
return null;
@@ -168,72 +170,72 @@ public class Message5ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
@@ -243,11 +245,12 @@ public class Message5ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* Returns command to reorient EClass based link. New link target or source should be the domain
* model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new MessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -269,11 +272,12 @@ public class Message5ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* Returns command to reorient EReference based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message6ItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message6ItemSemanticEditPolicy.java
index 0e1043428a4..3cef595b8a0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message6ItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message6ItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -71,13 +71,14 @@ public class Message6ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* @generated
*/
+ @Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
EObject selectedEObject = req.getElementToDestroy();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
+ if (provider != null) {
// Retrieve delete command from the Element Edit service
ICommand deleteCommand = provider.getEditCommand(req);
- if(deleteCommand != null) {
+ if (deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
}
@@ -87,6 +88,7 @@ public class Message6ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* @generated
*/
+ @Override
protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
@@ -97,67 +99,67 @@ public class Message6ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
return null;
}
return null;
@@ -168,72 +170,72 @@ public class Message6ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
@@ -243,11 +245,12 @@ public class Message6ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* Returns command to reorient EClass based link. New link target or source should be the domain
* model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new MessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -269,11 +272,12 @@ public class Message6ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* Returns command to reorient EReference based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message7ItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message7ItemSemanticEditPolicy.java
index 20ffdd3cb67..0ed079da7bd 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message7ItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message7ItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -71,13 +71,14 @@ public class Message7ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* @generated
*/
+ @Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
EObject selectedEObject = req.getElementToDestroy();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
+ if (provider != null) {
// Retrieve delete command from the Element Edit service
ICommand deleteCommand = provider.getEditCommand(req);
- if(deleteCommand != null) {
+ if (deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
}
@@ -87,6 +88,7 @@ public class Message7ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* @generated
*/
+ @Override
protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
@@ -97,67 +99,67 @@ public class Message7ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
return null;
}
return null;
@@ -168,72 +170,72 @@ public class Message7ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
@@ -243,11 +245,12 @@ public class Message7ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* Returns command to reorient EClass based link. New link target or source should be the domain
* model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new MessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -269,11 +272,12 @@ public class Message7ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* Returns command to reorient EReference based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageItemSemanticEditPolicy.java
index a4bc928cd85..d147fa4ea69 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -71,13 +71,14 @@ public class MessageItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy
/**
* @generated
*/
+ @Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
EObject selectedEObject = req.getElementToDestroy();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
+ if (provider != null) {
// Retrieve delete command from the Element Edit service
ICommand deleteCommand = provider.getEditCommand(req);
- if(deleteCommand != null) {
+ if (deleteCommand != null) {
return new ICommandProxy(deleteCommand);
}
}
@@ -87,6 +88,7 @@ public class MessageItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy
/**
* @generated
*/
+ @Override
protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
@@ -97,67 +99,67 @@ public class MessageItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
return null;
}
return null;
@@ -168,72 +170,72 @@ public class MessageItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
@@ -243,11 +245,12 @@ public class MessageItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy
/**
* Returns command to reorient EClass based link. New link target or source should be the domain
* model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new MessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -269,11 +272,12 @@ public class MessageItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy
/**
* Returns command to reorient EReference based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/OpenDiagramEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/OpenDiagramEditPolicy.java
index a25951f6d49..b686d9c8039 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/OpenDiagramEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/OpenDiagramEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -59,17 +59,18 @@ public class OpenDiagramEditPolicy extends OpenEditPolicy {
/**
* @generated
*/
+ @Override
protected Command getOpenCommand(Request request) {
EditPart targetEditPart = getTargetEditPart(request);
- if(false == targetEditPart.getModel() instanceof View) {
+ if (false == targetEditPart.getModel() instanceof View) {
return null;
}
- View view = (View)targetEditPart.getModel();
+ View view = (View) targetEditPart.getModel();
Style link = view.getStyle(NotationPackage.eINSTANCE.getHintedDiagramLinkStyle());
- if(false == link instanceof HintedDiagramLinkStyle) {
+ if (false == link instanceof HintedDiagramLinkStyle) {
return null;
}
- return new ICommandProxy(new OpenDiagramCommand((HintedDiagramLinkStyle)link));
+ return new ICommandProxy(new OpenDiagramCommand((HintedDiagramLinkStyle) link));
}
/**
@@ -86,7 +87,7 @@ public class OpenDiagramEditPolicy extends OpenEditPolicy {
* @generated
*/
OpenDiagramCommand(HintedDiagramLinkStyle linkStyle) {
- // editing domain is taken for original diagram,
+ // editing domain is taken for original diagram,
// if we open diagram from another file, we should use another editing domain
super(TransactionUtil.getEditingDomain(linkStyle), Messages.CommandName_OpenDiagram, null);
diagramFacet = linkStyle;
@@ -98,10 +99,11 @@ public class OpenDiagramEditPolicy extends OpenEditPolicy {
/**
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
try {
Diagram diagram = getDiagramToOpen();
- if(diagram == null) {
+ if (diagram == null) {
diagram = intializeNewDiagram();
}
URI uri = EcoreUtil.getURI(diagram);
@@ -127,25 +129,26 @@ public class OpenDiagramEditPolicy extends OpenEditPolicy {
*/
protected Diagram intializeNewDiagram() throws ExecutionException {
Diagram d = ViewService.createDiagram(getDiagramDomainElement(), getDiagramKind(), getPreferencesHint());
- if(d == null) {
+ if (d == null) {
throw new ExecutionException("Can't create diagram of '" + getDiagramKind() + "' kind");
}
diagramFacet.setDiagramLink(d);
assert diagramFacet.eResource() != null;
diagramFacet.eResource().getContents().add(d);
EObject container = diagramFacet.eContainer();
- while(container instanceof View) {
- ((View)container).persist();
+ while (container instanceof View) {
+ ((View) container).persist();
container = container.eContainer();
}
try {
new WorkspaceModifyOperation() {
+ @Override
protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException {
try {
- for(Iterator it = diagramFacet.eResource().getResourceSet().getResources().iterator(); it.hasNext();) {
- Resource nextResource = (Resource)it.next();
- if(nextResource.isLoaded() && !getEditingDomain().isReadOnly(nextResource)) {
+ for (Iterator it = diagramFacet.eResource().getResourceSet().getResources().iterator(); it.hasNext();) {
+ Resource nextResource = (Resource) it.next();
+ if (nextResource.isLoaded() && !getEditingDomain().isReadOnly(nextResource)) {
nextResource.save(UMLDiagramEditorUtil.getSaveOptions());
}
}
@@ -167,7 +170,7 @@ public class OpenDiagramEditPolicy extends OpenEditPolicy {
*/
protected EObject getDiagramDomainElement() {
// use same element as associated with EP
- return ((View)diagramFacet.eContainer()).getElement();
+ return ((View) diagramFacet.eContainer()).getElement();
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/PackageCanonicalEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/PackageCanonicalEditPolicy.java
index 061c7176729..c547223e8e4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/PackageCanonicalEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/PackageCanonicalEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -83,11 +83,12 @@ public class PackageCanonicalEditPolicy extends CanonicalEditPolicy {
/**
* @generated
*/
+ @Override
protected void refreshOnActivate() {
// Need to activate editpart children before invoking the canonical refresh for EditParts to add event listeners
List<?> c = getHost().getChildren();
- for(int i = 0; i < c.size(); i++) {
- ((EditPart)c.get(i)).activate();
+ for (int i = 0; i < c.size(); i++) {
+ ((EditPart) c.get(i)).activate();
}
super.refreshOnActivate();
}
@@ -95,6 +96,7 @@ public class PackageCanonicalEditPolicy extends CanonicalEditPolicy {
/**
* @generated
*/
+ @Override
protected EStructuralFeature getFeatureToSynchronize() {
return UMLPackage.eINSTANCE.getPackage_PackagedElement();
}
@@ -102,12 +104,13 @@ public class PackageCanonicalEditPolicy extends CanonicalEditPolicy {
/**
* @generated
*/
+ @Override
@SuppressWarnings("rawtypes")
protected List getSemanticChildrenList() {
- View viewObject = (View)getHost().getModel();
+ View viewObject = (View) getHost().getModel();
LinkedList<EObject> result = new LinkedList<EObject>();
List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getPackage_1000SemanticChildren(viewObject);
- for(UMLNodeDescriptor d : childDescriptors) {
+ for (UMLNodeDescriptor d : childDescriptors) {
result.add(d.getModelElement());
}
return result;
@@ -116,6 +119,7 @@ public class PackageCanonicalEditPolicy extends CanonicalEditPolicy {
/**
* @generated
*/
+ @Override
protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
}
@@ -130,33 +134,34 @@ public class PackageCanonicalEditPolicy extends CanonicalEditPolicy {
/**
* @generated
*/
+ @Override
protected void refreshSemantic() {
- if(resolveSemanticElement() == null) {
+ if (resolveSemanticElement() == null) {
return;
}
LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
- List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getPackage_1000SemanticChildren((View)getHost().getModel());
+ List<UMLNodeDescriptor> childDescriptors = UMLDiagramUpdater.getPackage_1000SemanticChildren((View) getHost().getModel());
LinkedList<View> orphaned = new LinkedList<View>();
// we care to check only views we recognize as ours
LinkedList<View> knownViewChildren = new LinkedList<View>();
- for(View v : getViewChildren()) {
- if(isMyDiagramElement(v)) {
+ for (View v : getViewChildren()) {
+ if (isMyDiagramElement(v)) {
knownViewChildren.add(v);
}
}
// alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
//
// iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
- // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
+ // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
// to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
- for(Iterator<UMLNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
+ for (Iterator<UMLNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
UMLNodeDescriptor next = descriptorsIterator.next();
String hint = UMLVisualIDRegistry.getType(next.getVisualID());
LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
- for(View childView : getViewChildren()) {
+ for (View childView : getViewChildren()) {
EObject semanticElement = childView.getElement();
- if(next.getModelElement().equals(semanticElement)) {
- if(hint.equals(childView.getType())) {
+ if (next.getModelElement().equals(semanticElement)) {
+ if (hint.equals(childView.getType())) {
perfectMatch.add(childView);
// actually, can stop iteration over view children here, but
// may want to use not the first view but last one as a 'real' match (the way original CEP does
@@ -164,7 +169,7 @@ public class PackageCanonicalEditPolicy extends CanonicalEditPolicy {
}
}
}
- if(perfectMatch.size() > 0) {
+ if (perfectMatch.size() > 0) {
descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
// use only one view (first or last?), keep rest as orphaned for further consideration
knownViewChildren.remove(perfectMatch.getFirst());
@@ -175,7 +180,7 @@ public class PackageCanonicalEditPolicy extends CanonicalEditPolicy {
orphaned.addAll(knownViewChildren);
//
ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
- for(UMLNodeDescriptor next : childDescriptors) {
+ for (UMLNodeDescriptor next : childDescriptors) {
String hint = UMLVisualIDRegistry.getType(next.getVisualID());
IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
@@ -185,18 +190,18 @@ public class PackageCanonicalEditPolicy extends CanonicalEditPolicy {
//
CreateViewRequest request = getCreateViewRequest(viewDescriptors);
Command cmd = getCreateViewCommand(request);
- if(cmd != null && cmd.canExecute()) {
+ if (cmd != null && cmd.canExecute()) {
SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
executeCommand(cmd);
@SuppressWarnings("unchecked")
- List<IAdaptable> nl = (List<IAdaptable>)request.getNewObject();
+ List<IAdaptable> nl = (List<IAdaptable>) request.getNewObject();
createdViews.addAll(nl);
}
- if(changed || createdViews.size() > 0) {
+ if (changed || createdViews.size() > 0) {
postProcessRefreshSemantic(createdViews);
}
Collection<IAdaptable> createdConnectionViews = refreshConnections();
- if(createdViews.size() > 1) {
+ if (createdViews.size() > 1) {
// perform a layout of the container
DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
executeCommand(new ICommandProxy(layoutCmd));
@@ -209,7 +214,7 @@ public class PackageCanonicalEditPolicy extends CanonicalEditPolicy {
* @generated
*/
private Diagram getDiagram() {
- return ((View)getHost().getModel()).getDiagram();
+ return ((View) getHost().getModel()).getDiagram();
}
/**
@@ -230,9 +235,9 @@ public class PackageCanonicalEditPolicy extends CanonicalEditPolicy {
* @generated
*/
protected final EditPart getHintedEditPart(EObject domainModelElement, Domain2Notation domain2NotationMap, int hintVisualId) {
- View view = (View)domain2NotationMap.getHinted(domainModelElement, UMLVisualIDRegistry.getType(hintVisualId));
- if(view != null) {
- return (EditPart)getHost().getViewer().getEditPartRegistry().get(view);
+ View view = domain2NotationMap.getHinted(domainModelElement, UMLVisualIDRegistry.getType(hintVisualId));
+ if (view != null) {
+ return (EditPart) getHost().getViewer().getEditPartRegistry().get(view);
}
return null;
}
@@ -261,7 +266,7 @@ public class PackageCanonicalEditPolicy extends CanonicalEditPolicy {
* @generated
*/
public void putView(EObject domainElement, View view) {
- if(!containsKey(view.getElement())) {
+ if (!containsKey(view.getElement())) {
this.put(domainElement, view);
}
}
@@ -274,11 +279,11 @@ public class PackageCanonicalEditPolicy extends CanonicalEditPolicy {
Domain2Notation domain2NotationMap = new Domain2Notation();
Collection<UMLLinkDescriptor> linkDescriptors = collectAllLinks(getDiagram(), domain2NotationMap);
Collection existingLinks = new LinkedList(getDiagram().getEdges());
- for(Iterator linksIterator = existingLinks.iterator(); linksIterator.hasNext();) {
- Edge nextDiagramLink = (Edge)linksIterator.next();
+ for (Iterator linksIterator = existingLinks.iterator(); linksIterator.hasNext();) {
+ Edge nextDiagramLink = (Edge) linksIterator.next();
int diagramLinkVisualID = UMLVisualIDRegistry.getVisualID(nextDiagramLink);
- if(diagramLinkVisualID == -1) {
- if(nextDiagramLink.getSource() != null && nextDiagramLink.getTarget() != null) {
+ if (diagramLinkVisualID == -1) {
+ if (nextDiagramLink.getSource() != null && nextDiagramLink.getTarget() != null) {
linksIterator.remove();
}
continue;
@@ -286,9 +291,9 @@ public class PackageCanonicalEditPolicy extends CanonicalEditPolicy {
EObject diagramLinkObject = nextDiagramLink.getElement();
EObject diagramLinkSrc = nextDiagramLink.getSource().getElement();
EObject diagramLinkDst = nextDiagramLink.getTarget().getElement();
- for(Iterator<UMLLinkDescriptor> linkDescriptorsIterator = linkDescriptors.iterator(); linkDescriptorsIterator.hasNext();) {
+ for (Iterator<UMLLinkDescriptor> linkDescriptorsIterator = linkDescriptors.iterator(); linkDescriptorsIterator.hasNext();) {
UMLLinkDescriptor nextLinkDescriptor = linkDescriptorsIterator.next();
- if(diagramLinkObject == nextLinkDescriptor.getModelElement() && diagramLinkSrc == nextLinkDescriptor.getSource() && diagramLinkDst == nextLinkDescriptor.getDestination() && diagramLinkVisualID == nextLinkDescriptor.getVisualID()) {
+ if (diagramLinkObject == nextLinkDescriptor.getModelElement() && diagramLinkSrc == nextLinkDescriptor.getSource() && diagramLinkDst == nextLinkDescriptor.getDestination() && diagramLinkVisualID == nextLinkDescriptor.getVisualID()) {
linksIterator.remove();
linkDescriptorsIterator.remove();
break;
@@ -303,241 +308,213 @@ public class PackageCanonicalEditPolicy extends CanonicalEditPolicy {
* @generated
*/
private Collection<UMLLinkDescriptor> collectAllLinks(View view, Domain2Notation domain2NotationMap) {
- if(!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(view))) {
+ if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(view))) {
return Collections.emptyList();
}
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- switch(UMLVisualIDRegistry.getVisualID(view)) {
- case PackageEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
+ switch (UMLVisualIDRegistry.getVisualID(view)) {
+ case PackageEditPart.VISUAL_ID: {
+ if (!domain2NotationMap.containsKey(view.getElement())) {
result.addAll(UMLDiagramUpdater.getPackage_1000ContainedLinks(view));
}
domain2NotationMap.putView(view.getElement(), view);
break;
}
- case InteractionEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
+ case InteractionEditPart.VISUAL_ID: {
+ if (!domain2NotationMap.containsKey(view.getElement())) {
result.addAll(UMLDiagramUpdater.getInteraction_2001ContainedLinks(view));
}
domain2NotationMap.putView(view.getElement(), view);
break;
}
- case ConsiderIgnoreFragmentEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
+ case ConsiderIgnoreFragmentEditPart.VISUAL_ID: {
+ if (!domain2NotationMap.containsKey(view.getElement())) {
result.addAll(UMLDiagramUpdater.getConsiderIgnoreFragment_3007ContainedLinks(view));
}
domain2NotationMap.putView(view.getElement(), view);
break;
}
- case CombinedFragmentEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
+ case CombinedFragmentEditPart.VISUAL_ID: {
+ if (!domain2NotationMap.containsKey(view.getElement())) {
result.addAll(UMLDiagramUpdater.getCombinedFragment_3004ContainedLinks(view));
}
domain2NotationMap.putView(view.getElement(), view);
break;
}
- case InteractionOperandEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
+ case InteractionOperandEditPart.VISUAL_ID: {
+ if (!domain2NotationMap.containsKey(view.getElement())) {
result.addAll(UMLDiagramUpdater.getInteractionOperand_3005ContainedLinks(view));
}
domain2NotationMap.putView(view.getElement(), view);
break;
}
- case InteractionUseEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
+ case InteractionUseEditPart.VISUAL_ID: {
+ if (!domain2NotationMap.containsKey(view.getElement())) {
result.addAll(UMLDiagramUpdater.getInteractionUse_3002ContainedLinks(view));
}
domain2NotationMap.putView(view.getElement(), view);
break;
}
- case ContinuationEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
+ case ContinuationEditPart.VISUAL_ID: {
+ if (!domain2NotationMap.containsKey(view.getElement())) {
result.addAll(UMLDiagramUpdater.getContinuation_3016ContainedLinks(view));
}
domain2NotationMap.putView(view.getElement(), view);
break;
}
- case LifelineEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
+ case LifelineEditPart.VISUAL_ID: {
+ if (!domain2NotationMap.containsKey(view.getElement())) {
result.addAll(UMLDiagramUpdater.getLifeline_3001ContainedLinks(view));
}
domain2NotationMap.putView(view.getElement(), view);
break;
}
- case ActionExecutionSpecificationEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
+ case ActionExecutionSpecificationEditPart.VISUAL_ID: {
+ if (!domain2NotationMap.containsKey(view.getElement())) {
result.addAll(UMLDiagramUpdater.getActionExecutionSpecification_3006ContainedLinks(view));
}
domain2NotationMap.putView(view.getElement(), view);
break;
}
- case BehaviorExecutionSpecificationEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
+ case BehaviorExecutionSpecificationEditPart.VISUAL_ID: {
+ if (!domain2NotationMap.containsKey(view.getElement())) {
result.addAll(UMLDiagramUpdater.getBehaviorExecutionSpecification_3003ContainedLinks(view));
}
domain2NotationMap.putView(view.getElement(), view);
break;
}
- case StateInvariantEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
+ case StateInvariantEditPart.VISUAL_ID: {
+ if (!domain2NotationMap.containsKey(view.getElement())) {
result.addAll(UMLDiagramUpdater.getStateInvariant_3017ContainedLinks(view));
}
domain2NotationMap.putView(view.getElement(), view);
break;
}
- case CombinedFragment2EditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
+ case CombinedFragment2EditPart.VISUAL_ID: {
+ if (!domain2NotationMap.containsKey(view.getElement())) {
result.addAll(UMLDiagramUpdater.getCombinedFragment_3018ContainedLinks(view));
}
domain2NotationMap.putView(view.getElement(), view);
break;
}
- case TimeConstraintEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
+ case TimeConstraintEditPart.VISUAL_ID: {
+ if (!domain2NotationMap.containsKey(view.getElement())) {
result.addAll(UMLDiagramUpdater.getTimeConstraint_3019ContainedLinks(view));
}
domain2NotationMap.putView(view.getElement(), view);
break;
}
- case TimeObservationEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
+ case TimeObservationEditPart.VISUAL_ID: {
+ if (!domain2NotationMap.containsKey(view.getElement())) {
result.addAll(UMLDiagramUpdater.getTimeObservation_3020ContainedLinks(view));
}
domain2NotationMap.putView(view.getElement(), view);
break;
}
- case DurationConstraintEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
+ case DurationConstraintEditPart.VISUAL_ID: {
+ if (!domain2NotationMap.containsKey(view.getElement())) {
result.addAll(UMLDiagramUpdater.getDurationConstraint_3021ContainedLinks(view));
}
domain2NotationMap.putView(view.getElement(), view);
break;
}
- case DestructionOccurrenceSpecificationEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
+ case DestructionOccurrenceSpecificationEditPart.VISUAL_ID: {
+ if (!domain2NotationMap.containsKey(view.getElement())) {
result.addAll(UMLDiagramUpdater.getDestructionOccurrenceSpecification_3022ContainedLinks(view));
}
domain2NotationMap.putView(view.getElement(), view);
break;
}
- case ConstraintEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
+ case ConstraintEditPart.VISUAL_ID: {
+ if (!domain2NotationMap.containsKey(view.getElement())) {
result.addAll(UMLDiagramUpdater.getConstraint_3008ContainedLinks(view));
}
domain2NotationMap.putView(view.getElement(), view);
break;
}
- case CommentEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
+ case CommentEditPart.VISUAL_ID: {
+ if (!domain2NotationMap.containsKey(view.getElement())) {
result.addAll(UMLDiagramUpdater.getComment_3009ContainedLinks(view));
}
domain2NotationMap.putView(view.getElement(), view);
break;
}
- case DurationConstraintInMessageEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
+ case DurationConstraintInMessageEditPart.VISUAL_ID: {
+ if (!domain2NotationMap.containsKey(view.getElement())) {
result.addAll(UMLDiagramUpdater.getDurationConstraint_3023ContainedLinks(view));
}
domain2NotationMap.putView(view.getElement(), view);
break;
}
- case DurationObservationEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
+ case DurationObservationEditPart.VISUAL_ID: {
+ if (!domain2NotationMap.containsKey(view.getElement())) {
result.addAll(UMLDiagramUpdater.getDurationObservation_3024ContainedLinks(view));
}
domain2NotationMap.putView(view.getElement(), view);
break;
}
- case MessageEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
+ case MessageEditPart.VISUAL_ID: {
+ if (!domain2NotationMap.containsKey(view.getElement())) {
result.addAll(UMLDiagramUpdater.getMessage_4003ContainedLinks(view));
}
domain2NotationMap.putView(view.getElement(), view);
break;
}
- case Message2EditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
+ case Message2EditPart.VISUAL_ID: {
+ if (!domain2NotationMap.containsKey(view.getElement())) {
result.addAll(UMLDiagramUpdater.getMessage_4004ContainedLinks(view));
}
domain2NotationMap.putView(view.getElement(), view);
break;
}
- case Message3EditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
+ case Message3EditPart.VISUAL_ID: {
+ if (!domain2NotationMap.containsKey(view.getElement())) {
result.addAll(UMLDiagramUpdater.getMessage_4005ContainedLinks(view));
}
domain2NotationMap.putView(view.getElement(), view);
break;
}
- case Message4EditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
+ case Message4EditPart.VISUAL_ID: {
+ if (!domain2NotationMap.containsKey(view.getElement())) {
result.addAll(UMLDiagramUpdater.getMessage_4006ContainedLinks(view));
}
domain2NotationMap.putView(view.getElement(), view);
break;
}
- case Message5EditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
+ case Message5EditPart.VISUAL_ID: {
+ if (!domain2NotationMap.containsKey(view.getElement())) {
result.addAll(UMLDiagramUpdater.getMessage_4007ContainedLinks(view));
}
domain2NotationMap.putView(view.getElement(), view);
break;
}
- case Message6EditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
+ case Message6EditPart.VISUAL_ID: {
+ if (!domain2NotationMap.containsKey(view.getElement())) {
result.addAll(UMLDiagramUpdater.getMessage_4008ContainedLinks(view));
}
domain2NotationMap.putView(view.getElement(), view);
break;
}
- case Message7EditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
+ case Message7EditPart.VISUAL_ID: {
+ if (!domain2NotationMap.containsKey(view.getElement())) {
result.addAll(UMLDiagramUpdater.getMessage_4009ContainedLinks(view));
}
domain2NotationMap.putView(view.getElement(), view);
break;
}
- case GeneralOrderingEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
+ case GeneralOrderingEditPart.VISUAL_ID: {
+ if (!domain2NotationMap.containsKey(view.getElement())) {
result.addAll(UMLDiagramUpdater.getGeneralOrdering_4012ContainedLinks(view));
}
domain2NotationMap.putView(view.getElement(), view);
break;
}
}
- for(Iterator children = view.getChildren().iterator(); children.hasNext();) {
- result.addAll(collectAllLinks((View)children.next(), domain2NotationMap));
+ for (Iterator children = view.getChildren().iterator(); children.hasNext();) {
+ result.addAll(collectAllLinks((View) children.next(), domain2NotationMap));
}
- for(Iterator edges = view.getSourceEdges().iterator(); edges.hasNext();) {
- result.addAll(collectAllLinks((View)edges.next(), domain2NotationMap));
+ for (Iterator edges = view.getSourceEdges().iterator(); edges.hasNext();) {
+ result.addAll(collectAllLinks((View) edges.next(), domain2NotationMap));
}
return result;
}
@@ -547,24 +524,25 @@ public class PackageCanonicalEditPolicy extends CanonicalEditPolicy {
*/
private Collection<IAdaptable> createConnections(Collection<UMLLinkDescriptor> linkDescriptors, Domain2Notation domain2NotationMap) {
LinkedList<IAdaptable> adapters = new LinkedList<IAdaptable>();
- for(UMLLinkDescriptor nextLinkDescriptor : linkDescriptors) {
+ for (UMLLinkDescriptor nextLinkDescriptor : linkDescriptors) {
EditPart sourceEditPart = getSourceEditPart(nextLinkDescriptor, domain2NotationMap);
EditPart targetEditPart = getTargetEditPart(nextLinkDescriptor, domain2NotationMap);
- if(sourceEditPart == null || targetEditPart == null) {
+ if (sourceEditPart == null || targetEditPart == null) {
continue;
}
- CreateConnectionViewRequest.ConnectionViewDescriptor descriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(nextLinkDescriptor.getSemanticAdapter(), UMLVisualIDRegistry.getType(nextLinkDescriptor.getVisualID()), ViewUtil.APPEND, false, ((IGraphicalEditPart)getHost()).getDiagramPreferencesHint());
+ CreateConnectionViewRequest.ConnectionViewDescriptor descriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(nextLinkDescriptor.getSemanticAdapter(), UMLVisualIDRegistry.getType(nextLinkDescriptor.getVisualID()), ViewUtil.APPEND,
+ false, ((IGraphicalEditPart) getHost()).getDiagramPreferencesHint());
CreateConnectionViewRequest ccr = new CreateConnectionViewRequest(descriptor);
- ccr.setType(RequestConstants.REQ_CONNECTION_START);
+ ccr.setType(org.eclipse.gef.RequestConstants.REQ_CONNECTION_START);
ccr.setSourceEditPart(sourceEditPart);
sourceEditPart.getCommand(ccr);
ccr.setTargetEditPart(targetEditPart);
- ccr.setType(RequestConstants.REQ_CONNECTION_END);
+ ccr.setType(org.eclipse.gef.RequestConstants.REQ_CONNECTION_END);
Command cmd = targetEditPart.getCommand(ccr);
- if(cmd != null && cmd.canExecute()) {
+ if (cmd != null && cmd.canExecute()) {
executeCommand(cmd);
- IAdaptable viewAdapter = (IAdaptable)ccr.getNewObject();
- if(viewAdapter != null) {
+ IAdaptable viewAdapter = (IAdaptable) ccr.getNewObject();
+ if (viewAdapter != null) {
adapters.add(viewAdapter);
}
}
@@ -576,9 +554,9 @@ public class PackageCanonicalEditPolicy extends CanonicalEditPolicy {
* @generated
*/
private EditPart getEditPart(EObject domainModelElement, Domain2Notation domain2NotationMap) {
- View view = (View)domain2NotationMap.get(domainModelElement);
- if(view != null) {
- return (EditPart)getHost().getViewer().getEditPartRegistry().get(view);
+ View view = domain2NotationMap.get(domainModelElement);
+ if (view != null) {
+ return (EditPart) getHost().getViewer().getEditPartRegistry().get(view);
}
return null;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/PackageItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/PackageItemSemanticEditPolicy.java
index a04522811ab..1bacf6adda0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/PackageItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/PackageItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -42,26 +42,27 @@ public class PackageItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy
/**
* @generated
*/
+ @Override
protected Command getCreateCommand(CreateElementRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return super.getCreateCommand(req);
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Interaction_2001 == baseElementType) {
- if(isExtendedType) {
- return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Interaction_2001 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedTypeCreationCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new InteractionCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
@@ -71,11 +72,12 @@ public class PackageItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy
/**
* @generated
*/
+ @Override
protected Command getDuplicateCommand(DuplicateElementsRequest req) {
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
Diagram currentDiagram = null;
- if(getHost() instanceof IGraphicalEditPart) {
- currentDiagram = ((IGraphicalEditPart)getHost()).getNotationView().getDiagram();
+ if (getHost() instanceof IGraphicalEditPart) {
+ currentDiagram = ((IGraphicalEditPart) getHost()).getNotationView().getDiagram();
}
return getGEFWrapper(new DuplicateAnythingCommand(editingDomain, req, currentDiagram));
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/StateInvariantItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/StateInvariantItemSemanticEditPolicy.java
index 7a470c74330..0ca823707c4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/StateInvariantItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/StateInvariantItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -74,18 +74,19 @@ public class StateInvariantItemSemanticEditPolicy extends UMLBaseItemSemanticEdi
/**
* @generated
*/
+ @Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View)getHost().getModel();
+ 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) {
+ 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 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));
@@ -96,6 +97,7 @@ public class StateInvariantItemSemanticEditPolicy extends UMLBaseItemSemanticEdi
/**
* @generated
*/
+ @Override
protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
@@ -106,67 +108,67 @@ public class StateInvariantItemSemanticEditPolicy extends UMLBaseItemSemanticEdi
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
return null;
}
return null;
@@ -177,72 +179,72 @@ public class StateInvariantItemSemanticEditPolicy extends UMLBaseItemSemanticEdi
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
@@ -252,11 +254,12 @@ public class StateInvariantItemSemanticEditPolicy extends UMLBaseItemSemanticEdi
/**
* Returns command to reorient EClass based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new MessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -278,11 +281,12 @@ public class StateInvariantItemSemanticEditPolicy extends UMLBaseItemSemanticEdi
/**
* Returns command to reorient EReference based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/TimeConstraintItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/TimeConstraintItemSemanticEditPolicy.java
index fc363298276..10af546ef14 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/TimeConstraintItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/TimeConstraintItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -77,18 +77,19 @@ public class TimeConstraintItemSemanticEditPolicy extends UMLBaseItemSemanticEdi
/**
* @generated
*/
+ @Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View)getHost().getModel();
+ 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) {
+ 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 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));
@@ -99,6 +100,7 @@ public class TimeConstraintItemSemanticEditPolicy extends UMLBaseItemSemanticEdi
/**
* @generated
*/
+ @Override
protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
@@ -109,75 +111,75 @@ public class TimeConstraintItemSemanticEditPolicy extends UMLBaseItemSemanticEdi
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintContext_8500 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintContext_8500 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ContextLinkCreateCommand(req, req.getSource(), req.getTarget()));
}
@@ -189,76 +191,76 @@ public class TimeConstraintItemSemanticEditPolicy extends UMLBaseItemSemanticEdi
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintContext_8500 == baseElementType) {
+ if (UMLElementTypes.ConstraintContext_8500 == baseElementType) {
return null;
}
return null;
@@ -267,11 +269,12 @@ public class TimeConstraintItemSemanticEditPolicy extends UMLBaseItemSemanticEdi
/**
* Returns command to reorient EClass based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new MessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -293,11 +296,12 @@ public class TimeConstraintItemSemanticEditPolicy extends UMLBaseItemSemanticEdi
/**
* Returns command to reorient EReference based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/TimeObservationItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/TimeObservationItemSemanticEditPolicy.java
index 2c82dc0b641..b66df61bdf2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/TimeObservationItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/TimeObservationItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -74,18 +74,19 @@ public class TimeObservationItemSemanticEditPolicy extends UMLBaseItemSemanticEd
/**
* @generated
*/
+ @Override
protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View)getHost().getModel();
+ 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) {
+ 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 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));
@@ -96,6 +97,7 @@ public class TimeObservationItemSemanticEditPolicy extends UMLBaseItemSemanticEd
/**
* @generated
*/
+ @Override
protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
return command != null ? command : super.getCreateRelationshipCommand(req);
@@ -106,67 +108,67 @@ public class TimeObservationItemSemanticEditPolicy extends UMLBaseItemSemanticEd
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
return null;
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
return null;
}
return null;
@@ -177,72 +179,72 @@ public class TimeObservationItemSemanticEditPolicy extends UMLBaseItemSemanticEd
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
+ if (requestElementType == null) {
return null;
}
IElementType baseElementType = requestElementType;
boolean isExtendedType = false;
- if(requestElementType instanceof IExtendedHintedElementType) {
+ if (requestElementType instanceof IExtendedHintedElementType) {
baseElementType = ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
+ if (baseElementType != null) {
isExtendedType = true;
} else {
// no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType)requestElementType);
+ baseElementType = ElementTypeUtils.findClosestNonExtendedElementType((IExtendedHintedElementType) requestElementType);
isExtendedType = true;
}
}
- if(UMLElementTypes.Message_4003 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4003 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4004 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4004 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message2CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4005 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4005 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message3CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4006 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4006 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message4CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4007 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4007 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message5CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4008 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4008 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message6CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.Message_4009 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.Message_4009 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new Message7CreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.CommentAnnotatedElement_4010 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
- if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ if (UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
+ if (isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType) requestElementType);
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
@@ -252,11 +254,12 @@ public class TimeObservationItemSemanticEditPolicy extends UMLBaseItemSemanticEd
/**
* Returns command to reorient EClass based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case MessageEditPart.VISUAL_ID:
return getGEFWrapper(new MessageReorientCommand(req));
case Message2EditPart.VISUAL_ID:
@@ -278,11 +281,12 @@ public class TimeObservationItemSemanticEditPolicy extends UMLBaseItemSemanticEd
/**
* Returns command to reorient EReference based link. New link target or source
* should be the domain model element associated with this node.
- *
+ *
* @generated
*/
+ @Override
protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- switch(getVisualID(req)) {
+ switch (getVisualID(req)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UMLBaseItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UMLBaseItemSemanticEditPolicy.java
index 4eea96ac7a2..29a2df8e6b9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UMLBaseItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UMLBaseItemSemanticEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -74,14 +74,14 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
/**
* Extended request data key to hold editpart visual id.
- *
+ *
* @generated
*/
public static final String VISUAL_ID_KEY = "visual_id"; //$NON-NLS-1$
/**
* Extended request data key to hold the edge view during a reconnect request.
- *
+ *
* @generated
*/
public static final String GRAPHICAL_RECONNECTED_EDGE = "graphical_edge"; //$NON-NLS-1$
@@ -103,17 +103,18 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
* extended data of the request so command switch can decide what kind of diagram element is
* being edited. It is done in those cases when it's not possible to deduce diagram element kind
* from domain element.
- *
+ *
* @generated
*/
+ @Override
@SuppressWarnings("unchecked")
public Command getCommand(Request request) {
- if(request instanceof ReconnectRequest) {
- Object view = ((ReconnectRequest)request).getConnectionEditPart().getModel();
- if(view instanceof View) {
- Integer id = new Integer(UMLVisualIDRegistry.getVisualID((View)view));
+ if (request instanceof ReconnectRequest) {
+ Object view = ((ReconnectRequest) request).getConnectionEditPart().getModel();
+ if (view instanceof View) {
+ Integer id = new Integer(UMLVisualIDRegistry.getVisualID((View) view));
request.getExtendedData().put(VISUAL_ID_KEY, id);
- request.getExtendedData().put(GRAPHICAL_RECONNECTED_EDGE, (View)view);
+ request.getExtendedData().put(GRAPHICAL_RECONNECTED_EDGE, view);
}
}
return super.getCommand(request);
@@ -121,23 +122,24 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
/**
* Returns visual id from request parameters.
- *
+ *
* @generated
*/
protected int getVisualID(IEditCommandRequest request) {
Object id = request.getParameter(VISUAL_ID_KEY);
- return id instanceof Integer ? ((Integer)id).intValue() : -1;
+ return id instanceof Integer ? ((Integer) id).intValue() : -1;
}
/**
* @generated
*/
+ @Override
protected Command getSemanticCommand(IEditCommandRequest request) {
IEditCommandRequest completedRequest = completeRequest(request);
Command semanticCommand = getSemanticCommandSwitch(completedRequest);
semanticCommand = getEditHelperCommand(completedRequest, semanticCommand);
- if(completedRequest instanceof DestroyRequest) {
- DestroyRequest destroyRequest = (DestroyRequest)completedRequest;
+ if (completedRequest instanceof DestroyRequest) {
+ DestroyRequest destroyRequest = (DestroyRequest) completedRequest;
return shouldProceed(destroyRequest) ? addDeleteViewCommand(semanticCommand, destroyRequest) : null;
}
return semanticCommand;
@@ -147,7 +149,7 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
* @generated
*/
protected Command addDeleteViewCommand(Command mainCommand, DestroyRequest completedRequest) {
- Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View)getHost().getModel()));
+ Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View) getHost().getModel()));
return mainCommand == null ? deleteViewCommand : mainCommand.chain(deleteViewCommand);
}
@@ -155,8 +157,8 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
* @generated
*/
private Command getEditHelperCommand(IEditCommandRequest request, Command editPolicyCommand) {
- if(editPolicyCommand != null) {
- ICommand command = editPolicyCommand instanceof ICommandProxy ? ((ICommandProxy)editPolicyCommand).getICommand() : new CommandProxy(editPolicyCommand);
+ if (editPolicyCommand != null) {
+ ICommand command = editPolicyCommand instanceof ICommandProxy ? ((ICommandProxy) editPolicyCommand).getICommand() : new CommandProxy(editPolicyCommand);
request.setParameter(GeneratedEditHelperBase.EDIT_POLICY_COMMAND, command);
}
IElementType requestContextElementType = getContextElementType(request);
@@ -164,8 +166,8 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
ICommand command = requestContextElementType.getEditCommand(request);
request.setParameter(GeneratedEditHelperBase.EDIT_POLICY_COMMAND, null);
request.setParameter(GeneratedEditHelperBase.CONTEXT_ELEMENT_TYPE, null);
- if(command != null) {
- if(!(command instanceof CompositeTransactionalCommand)) {
+ if (command != null) {
+ if (!(command instanceof CompositeTransactionalCommand)) {
command = new CompositeTransactionalCommand(getEditingDomain(), command.getLabel()).compose(command);
}
return new ICommandProxy(command);
@@ -185,28 +187,28 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
* @generated
*/
protected Command getSemanticCommandSwitch(IEditCommandRequest req) {
- if(req instanceof CreateRelationshipRequest) {
- return getCreateRelationshipCommand((CreateRelationshipRequest)req);
- } else if(req instanceof CreateElementRequest) {
- return getCreateCommand((CreateElementRequest)req);
- } else if(req instanceof ConfigureRequest) {
- return getConfigureCommand((ConfigureRequest)req);
- } else if(req instanceof DestroyElementRequest) {
- return getDestroyElementCommand((DestroyElementRequest)req);
- } else if(req instanceof DestroyReferenceRequest) {
- return getDestroyReferenceCommand((DestroyReferenceRequest)req);
- } else if(req instanceof DuplicateElementsRequest) {
- return getDuplicateCommand((DuplicateElementsRequest)req);
- } else if(req instanceof GetEditContextRequest) {
- return getEditContextCommand((GetEditContextRequest)req);
- } else if(req instanceof MoveRequest) {
- return getMoveCommand((MoveRequest)req);
- } else if(req instanceof ReorientReferenceRelationshipRequest) {
- return getReorientReferenceRelationshipCommand((ReorientReferenceRelationshipRequest)req);
- } else if(req instanceof ReorientRelationshipRequest) {
- return getReorientRelationshipCommand((ReorientRelationshipRequest)req);
- } else if(req instanceof SetRequest) {
- return getSetCommand((SetRequest)req);
+ if (req instanceof CreateRelationshipRequest) {
+ return getCreateRelationshipCommand((CreateRelationshipRequest) req);
+ } else if (req instanceof CreateElementRequest) {
+ return getCreateCommand((CreateElementRequest) req);
+ } else if (req instanceof ConfigureRequest) {
+ return getConfigureCommand((ConfigureRequest) req);
+ } else if (req instanceof DestroyElementRequest) {
+ return getDestroyElementCommand((DestroyElementRequest) req);
+ } else if (req instanceof DestroyReferenceRequest) {
+ return getDestroyReferenceCommand((DestroyReferenceRequest) req);
+ } else if (req instanceof DuplicateElementsRequest) {
+ return getDuplicateCommand((DuplicateElementsRequest) req);
+ } else if (req instanceof GetEditContextRequest) {
+ return getEditContextCommand((GetEditContextRequest) req);
+ } else if (req instanceof MoveRequest) {
+ return getMoveCommand((MoveRequest) req);
+ } else if (req instanceof ReorientReferenceRelationshipRequest) {
+ return getReorientReferenceRelationshipCommand((ReorientReferenceRelationshipRequest) req);
+ } else if (req instanceof ReorientRelationshipRequest) {
+ return getReorientRelationshipCommand((ReorientRelationshipRequest) req);
+ } else if (req instanceof SetRequest) {
+ return getSetCommand((SetRequest) req);
}
return null;
}
@@ -229,7 +231,7 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
* @generated
*/
protected Command getCreateCommand(CreateElementRequest req) {
- // no more usage of the extended types here.
+ // no more usage of the extended types here.
return null;
}
@@ -238,7 +240,7 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
*/
protected Command getExtendedTypeCreationCommand(CreateElementRequest request, IExtendedHintedElementType requestElementType) {
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(request.getContainer());
- if(provider == null) {
+ if (provider == null) {
return UnexecutableCommand.INSTANCE;
}
// Retrieve create command from the Element Edit service
@@ -251,7 +253,7 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
*/
protected Command getExtendedStartCreateRelationshipCommand(CreateElementRequest request, IExtendedHintedElementType requestElementType) {
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(requestElementType);
- if(provider == null) {
+ if (provider == null) {
return UnexecutableCommand.INSTANCE;
}
// Retrieve create command from the Element Edit service
@@ -264,7 +266,7 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
*/
protected Command getExtendedCompleteCreateRelationshipCommand(CreateElementRequest request, IExtendedHintedElementType requestElementType) {
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(requestElementType);
- if(provider == null) {
+ if (provider == null) {
return UnexecutableCommand.INSTANCE;
}
// Retrieve create command from the Element Edit service
@@ -312,11 +314,11 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
*/
protected Command getMoveCommand(MoveRequest req) {
EObject targetCEObject = req.getTargetContainer();
- if(targetCEObject != null) {
+ if (targetCEObject != null) {
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(targetCEObject);
- if(provider != null) {
+ if (provider != null) {
ICommand moveCommand = provider.getEditCommand(req);
- if(moveCommand != null) {
+ if (moveCommand != null) {
return new ICommandProxy(moveCommand);
}
}
@@ -349,23 +351,23 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
/**
* Returns editing domain from the host edit part.
- *
+ *
* @generated
*/
protected TransactionalEditingDomain getEditingDomain() {
- return ((IGraphicalEditPart)getHost()).getEditingDomain();
+ return ((IGraphicalEditPart) getHost()).getEditingDomain();
}
/**
* Clean all shortcuts to the host element from the same diagram
- *
+ *
* @generated
*/
protected void addDestroyShortcutsCommand(ICompositeCommand cmd, View view) {
assert view.getEAnnotation("Shortcut") == null; //$NON-NLS-1$
- for(Iterator it = view.getDiagram().getChildren().iterator(); it.hasNext();) {
- View nextView = (View)it.next();
- if(nextView.getEAnnotation("Shortcut") == null || !nextView.isSetElement() || nextView.getElement() != view.getElement()) { //$NON-NLS-1$
+ for (Iterator it = view.getDiagram().getChildren().iterator(); it.hasNext();) {
+ View nextView = (View) it.next();
+ if (nextView.getEAnnotation("Shortcut") == null || !nextView.isSetElement() || nextView.getElement() != view.getElement()) { //$NON-NLS-1$
continue;
}
cmd.add(new DeleteCommand(getEditingDomain(), nextView));
@@ -377,7 +379,7 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
*/
public static LinkConstraints getLinkConstraints() {
LinkConstraints cached = UMLDiagramEditorPlugin.getInstance().getLinkConstraints();
- if(cached == null) {
+ if (cached == null) {
UMLDiagramEditorPlugin.getInstance().setLinkConstraints(cached = new LinkConstraints());
}
return cached;
@@ -448,8 +450,8 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
* @generated
*/
public boolean canCreateCommentAnnotatedElement_4010(Comment source, Element target) {
- if(source != null) {
- if(source.getAnnotatedElements().contains(target)) {
+ if (source != null) {
+ if (source.getAnnotatedElements().contains(target)) {
return false;
}
}
@@ -460,8 +462,8 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
* @generated
*/
public boolean canCreateConstraintConstrainedElement_4011(Constraint source, Element target) {
- if(source != null) {
- if(source.getConstrainedElements().contains(target)) {
+ if (source != null) {
+ if (source.getConstrainedElements().contains(target)) {
return false;
}
}
@@ -479,12 +481,12 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
* @generated
*/
public boolean canCreateConstraintContext_8500(Constraint source, Namespace target) {
- if(source != null) {
- if(source.getContext() != null) {
+ if (source != null) {
+ if (source.getContext() != null) {
return false;
}
}
- if(target != null && (target.getOwnedRules().contains(target))) {
+ if (target != null && (target.getOwnedRules().contains(target))) {
return false;
}
return canExistConstraintContext_8500(source, target);
@@ -495,21 +497,21 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
*/
public boolean canExistMessage_4003(Interaction container, Message linkInstance, Element source, Element target) {
try {
- if(source == null) {
+ if (source == null) {
return true;
} else {
Map<String, EClassifier> env = Collections.<String, EClassifier> singletonMap("oppositeEnd", UMLPackage.eINSTANCE.getElement()); //$NON-NLS-1$
Object sourceVal = UMLOCLFactory.getExpression(2, UMLPackage.eINSTANCE.getElement(), env).evaluate(source, Collections.singletonMap("oppositeEnd", target)); //$NON-NLS-1$
- if(false == sourceVal instanceof Boolean || !((Boolean)sourceVal).booleanValue()) {
+ if (false == sourceVal instanceof Boolean || !((Boolean) sourceVal).booleanValue()) {
return false;
} // else fall-through
}
- if(target == null) {
+ if (target == null) {
return true;
} else {
Map<String, EClassifier> env = Collections.<String, EClassifier> singletonMap("oppositeEnd", UMLPackage.eINSTANCE.getElement()); //$NON-NLS-1$
Object targetVal = UMLOCLFactory.getExpression(3, UMLPackage.eINSTANCE.getElement(), env).evaluate(target, Collections.singletonMap("oppositeEnd", source)); //$NON-NLS-1$
- if(false == targetVal instanceof Boolean || !((Boolean)targetVal).booleanValue()) {
+ if (false == targetVal instanceof Boolean || !((Boolean) targetVal).booleanValue()) {
return false;
} // else fall-through
}
@@ -525,21 +527,21 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
*/
public boolean canExistMessage_4004(Interaction container, Message linkInstance, Element source, Element target) {
try {
- if(source == null) {
+ if (source == null) {
return true;
} else {
Map<String, EClassifier> env = Collections.<String, EClassifier> singletonMap("oppositeEnd", UMLPackage.eINSTANCE.getElement()); //$NON-NLS-1$
Object sourceVal = UMLOCLFactory.getExpression(22, UMLPackage.eINSTANCE.getElement(), env).evaluate(source, Collections.singletonMap("oppositeEnd", target)); //$NON-NLS-1$
- if(false == sourceVal instanceof Boolean || !((Boolean)sourceVal).booleanValue()) {
+ if (false == sourceVal instanceof Boolean || !((Boolean) sourceVal).booleanValue()) {
return false;
} // else fall-through
}
- if(target == null) {
+ if (target == null) {
return true;
} else {
Map<String, EClassifier> env = Collections.<String, EClassifier> singletonMap("oppositeEnd", UMLPackage.eINSTANCE.getElement()); //$NON-NLS-1$
Object targetVal = UMLOCLFactory.getExpression(6, UMLPackage.eINSTANCE.getElement(), env).evaluate(target, Collections.singletonMap("oppositeEnd", source)); //$NON-NLS-1$
- if(false == targetVal instanceof Boolean || !((Boolean)targetVal).booleanValue()) {
+ if (false == targetVal instanceof Boolean || !((Boolean) targetVal).booleanValue()) {
return false;
} // else fall-through
}
@@ -555,21 +557,21 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
*/
public boolean canExistMessage_4005(Interaction container, Message linkInstance, Element source, Element target) {
try {
- if(source == null) {
+ if (source == null) {
return true;
} else {
Map<String, EClassifier> env = Collections.<String, EClassifier> singletonMap("oppositeEnd", UMLPackage.eINSTANCE.getElement()); //$NON-NLS-1$
Object sourceVal = UMLOCLFactory.getExpression(8, UMLPackage.eINSTANCE.getElement(), env).evaluate(source, Collections.singletonMap("oppositeEnd", target)); //$NON-NLS-1$
- if(false == sourceVal instanceof Boolean || !((Boolean)sourceVal).booleanValue()) {
+ if (false == sourceVal instanceof Boolean || !((Boolean) sourceVal).booleanValue()) {
return false;
} // else fall-through
}
- if(target == null) {
+ if (target == null) {
return true;
} else {
Map<String, EClassifier> env = Collections.<String, EClassifier> singletonMap("oppositeEnd", UMLPackage.eINSTANCE.getElement()); //$NON-NLS-1$
Object targetVal = UMLOCLFactory.getExpression(22, UMLPackage.eINSTANCE.getElement(), env).evaluate(target, Collections.singletonMap("oppositeEnd", source)); //$NON-NLS-1$
- if(false == targetVal instanceof Boolean || !((Boolean)targetVal).booleanValue()) {
+ if (false == targetVal instanceof Boolean || !((Boolean) targetVal).booleanValue()) {
return false;
} // else fall-through
}
@@ -585,21 +587,21 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
*/
public boolean canExistMessage_4006(Interaction container, Message linkInstance, Element source, Element target) {
try {
- if(source == null) {
+ if (source == null) {
return true;
} else {
Map<String, EClassifier> env = Collections.<String, EClassifier> singletonMap("oppositeEnd", UMLPackage.eINSTANCE.getElement()); //$NON-NLS-1$
Object sourceVal = UMLOCLFactory.getExpression(11, UMLPackage.eINSTANCE.getElement(), env).evaluate(source, Collections.singletonMap("oppositeEnd", target)); //$NON-NLS-1$
- if(false == sourceVal instanceof Boolean || !((Boolean)sourceVal).booleanValue()) {
+ if (false == sourceVal instanceof Boolean || !((Boolean) sourceVal).booleanValue()) {
return false;
} // else fall-through
}
- if(target == null) {
+ if (target == null) {
return true;
} else {
Map<String, EClassifier> env = Collections.<String, EClassifier> singletonMap("oppositeEnd", UMLPackage.eINSTANCE.getElement()); //$NON-NLS-1$
Object targetVal = UMLOCLFactory.getExpression(12, UMLPackage.eINSTANCE.getElement(), env).evaluate(target, Collections.singletonMap("oppositeEnd", source)); //$NON-NLS-1$
- if(false == targetVal instanceof Boolean || !((Boolean)targetVal).booleanValue()) {
+ if (false == targetVal instanceof Boolean || !((Boolean) targetVal).booleanValue()) {
return false;
} // else fall-through
}
@@ -615,21 +617,21 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
*/
public boolean canExistMessage_4007(Interaction container, Message linkInstance, Element source, Element target) {
try {
- if(source == null) {
+ if (source == null) {
return true;
} else {
Map<String, EClassifier> env = Collections.<String, EClassifier> singletonMap("oppositeEnd", UMLPackage.eINSTANCE.getElement()); //$NON-NLS-1$
Object sourceVal = UMLOCLFactory.getExpression(14, UMLPackage.eINSTANCE.getElement(), env).evaluate(source, Collections.singletonMap("oppositeEnd", target)); //$NON-NLS-1$
- if(false == sourceVal instanceof Boolean || !((Boolean)sourceVal).booleanValue()) {
+ if (false == sourceVal instanceof Boolean || !((Boolean) sourceVal).booleanValue()) {
return false;
} // else fall-through
}
- if(target == null) {
+ if (target == null) {
return true;
} else {
Map<String, EClassifier> env = Collections.<String, EClassifier> singletonMap("oppositeEnd", UMLPackage.eINSTANCE.getElement()); //$NON-NLS-1$
Object targetVal = UMLOCLFactory.getExpression(15, UMLPackage.eINSTANCE.getElement(), env).evaluate(target, Collections.singletonMap("oppositeEnd", source)); //$NON-NLS-1$
- if(false == targetVal instanceof Boolean || !((Boolean)targetVal).booleanValue()) {
+ if (false == targetVal instanceof Boolean || !((Boolean) targetVal).booleanValue()) {
return false;
} // else fall-through
}
@@ -645,21 +647,21 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
*/
public boolean canExistMessage_4008(Interaction container, Message linkInstance, Element source, Element target) {
try {
- if(source == null) {
+ if (source == null) {
return true;
} else {
Map<String, EClassifier> env = Collections.<String, EClassifier> singletonMap("oppositeEnd", UMLPackage.eINSTANCE.getElement()); //$NON-NLS-1$
Object sourceVal = UMLOCLFactory.getExpression(22, UMLPackage.eINSTANCE.getElement(), env).evaluate(source, Collections.singletonMap("oppositeEnd", target)); //$NON-NLS-1$
- if(false == sourceVal instanceof Boolean || !((Boolean)sourceVal).booleanValue()) {
+ if (false == sourceVal instanceof Boolean || !((Boolean) sourceVal).booleanValue()) {
return false;
} // else fall-through
}
- if(target == null) {
+ if (target == null) {
return true;
} else {
Map<String, EClassifier> env = Collections.<String, EClassifier> singletonMap("oppositeEnd", UMLPackage.eINSTANCE.getElement()); //$NON-NLS-1$
Object targetVal = UMLOCLFactory.getExpression(18, UMLPackage.eINSTANCE.getElement(), env).evaluate(target, Collections.singletonMap("oppositeEnd", source)); //$NON-NLS-1$
- if(false == targetVal instanceof Boolean || !((Boolean)targetVal).booleanValue()) {
+ if (false == targetVal instanceof Boolean || !((Boolean) targetVal).booleanValue()) {
return false;
} // else fall-through
}
@@ -675,21 +677,21 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
*/
public boolean canExistMessage_4009(Interaction container, Message linkInstance, Element source, Element target) {
try {
- if(source == null) {
+ if (source == null) {
return true;
} else {
Map<String, EClassifier> env = Collections.<String, EClassifier> singletonMap("oppositeEnd", UMLPackage.eINSTANCE.getElement()); //$NON-NLS-1$
Object sourceVal = UMLOCLFactory.getExpression(20, UMLPackage.eINSTANCE.getElement(), env).evaluate(source, Collections.singletonMap("oppositeEnd", target)); //$NON-NLS-1$
- if(false == sourceVal instanceof Boolean || !((Boolean)sourceVal).booleanValue()) {
+ if (false == sourceVal instanceof Boolean || !((Boolean) sourceVal).booleanValue()) {
return false;
} // else fall-through
}
- if(target == null) {
+ if (target == null) {
return true;
} else {
Map<String, EClassifier> env = Collections.<String, EClassifier> singletonMap("oppositeEnd", UMLPackage.eINSTANCE.getElement()); //$NON-NLS-1$
Object targetVal = UMLOCLFactory.getExpression(22, UMLPackage.eINSTANCE.getElement(), env).evaluate(target, Collections.singletonMap("oppositeEnd", source)); //$NON-NLS-1$
- if(false == targetVal instanceof Boolean || !((Boolean)targetVal).booleanValue()) {
+ if (false == targetVal instanceof Boolean || !((Boolean) targetVal).booleanValue()) {
return false;
} // else fall-through
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UMLTextNonResizableEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UMLTextNonResizableEditPolicy.java
index e1a0aec32a8..13739c36086 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UMLTextNonResizableEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UMLTextNonResizableEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -54,10 +54,11 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
/**
* @generated
*/
+ @Override
protected void showPrimarySelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(true);
- ((WrappingLabel)getHostFigure()).setFocus(true);
+ if (getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getHostFigure()).setSelected(true);
+ ((WrappingLabel) getHostFigure()).setFocus(true);
} else {
showSelection();
showFocus();
@@ -67,10 +68,11 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
/**
* @generated
*/
+ @Override
protected void showSelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(true);
- ((WrappingLabel)getHostFigure()).setFocus(false);
+ if (getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getHostFigure()).setSelected(true);
+ ((WrappingLabel) getHostFigure()).setFocus(false);
} else {
hideSelection();
addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
@@ -83,12 +85,13 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
/**
* @generated
*/
+ @Override
protected void hideSelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(false);
- ((WrappingLabel)getHostFigure()).setFocus(false);
+ if (getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getHostFigure()).setSelected(false);
+ ((WrappingLabel) getHostFigure()).setFocus(false);
} else {
- if(selectionFeedbackFigure != null) {
+ if (selectionFeedbackFigure != null) {
removeFeedback(selectionFeedbackFigure);
getHostFigure().removeFigureListener(getHostPositionListener());
selectionFeedbackFigure = null;
@@ -100,9 +103,10 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
/**
* @generated
*/
+ @Override
protected void showFocus() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setFocus(true);
+ if (getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getHostFigure()).setFocus(true);
} else {
hideFocus();
addFeedback(focusFeedbackFigure = createFocusFeedbackFigure());
@@ -113,11 +117,12 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
/**
* @generated
*/
+ @Override
protected void hideFocus() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setFocus(false);
+ if (getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getHostFigure()).setFocus(false);
} else {
- if(focusFeedbackFigure != null) {
+ if (focusFeedbackFigure != null) {
removeFeedback(focusFeedbackFigure);
focusFeedbackFigure = null;
}
@@ -129,8 +134,8 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
*/
protected Rectangle getFeedbackBounds() {
Rectangle bounds;
- if(getHostFigure() instanceof Label) {
- bounds = ((Label)getHostFigure()).getTextBounds();
+ if (getHostFigure() instanceof Label) {
+ bounds = ((Label) getHostFigure()).getTextBounds();
bounds.intersect(getHostFigure().getBounds());
} else {
bounds = getHostFigure().getBounds().getCopy();
@@ -144,7 +149,7 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
* @generated
*/
protected IFigure createSelectionFeedbackFigure() {
- if(getHostFigure() instanceof Label) {
+ if (getHostFigure() instanceof Label) {
Label feedbackFigure = new Label();
feedbackFigure.setOpaque(true);
feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected);
@@ -163,6 +168,7 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
protected IFigure createFocusFeedbackFigure() {
return new Figure() {
+ @Override
protected void paintFigure(Graphics graphics) {
graphics.drawFocus(getBounds().getResized(-1, -1));
}
@@ -173,7 +179,7 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
* @generated
*/
protected void updateLabel(Label target) {
- Label source = (Label)getHostFigure();
+ Label source = (Label) getHostFigure();
target.setText(source.getText());
target.setTextAlignment(source.getTextAlignment());
target.setFont(source.getFont());
@@ -183,9 +189,9 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
* @generated
*/
protected void refreshSelectionFeedback() {
- if(selectionFeedbackFigure != null) {
- if(selectionFeedbackFigure instanceof Label) {
- updateLabel((Label)selectionFeedbackFigure);
+ if (selectionFeedbackFigure != null) {
+ if (selectionFeedbackFigure instanceof Label) {
+ updateLabel((Label) selectionFeedbackFigure);
selectionFeedbackFigure.setBounds(getFeedbackBounds());
} else {
selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5));
@@ -197,7 +203,7 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
* @generated
*/
protected void refreshFocusFeedback() {
- if(focusFeedbackFigure != null) {
+ if (focusFeedbackFigure != null) {
focusFeedbackFigure.setBounds(getFeedbackBounds());
}
}
@@ -205,6 +211,7 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
/**
* @generated
*/
+ @Override
public void refreshFeedback() {
refreshSelectionFeedback();
refreshFocusFeedback();
@@ -214,9 +221,10 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
* @generated
*/
private FigureListener getHostPositionListener() {
- if(hostPositionListener == null) {
+ if (hostPositionListener == null) {
hostPositionListener = new FigureListener() {
+ @Override
public void figureMoved(IFigure source) {
refreshFeedback();
}
@@ -228,8 +236,9 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
/**
* @generated
*/
+ @Override
protected List createSelectionHandles() {
- MoveHandle moveHandle = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle moveHandle = new MoveHandle((GraphicalEditPart) getHost());
moveHandle.setBorder(null);
moveHandle.setDragTracker(new DragEditPartsTrackerEx(getHost()));
return Collections.singletonList(moveHandle);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UMLTextSelectionEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UMLTextSelectionEditPolicy.java
index b05d71c579c..f2fac8789db 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UMLTextSelectionEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UMLTextSelectionEditPolicy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -48,10 +48,11 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
/**
* @generated
*/
+ @Override
protected void showPrimarySelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(true);
- ((WrappingLabel)getHostFigure()).setFocus(true);
+ if (getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getHostFigure()).setSelected(true);
+ ((WrappingLabel) getHostFigure()).setFocus(true);
} else {
showSelection();
showFocus();
@@ -61,10 +62,11 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
/**
* @generated
*/
+ @Override
protected void showSelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(true);
- ((WrappingLabel)getHostFigure()).setFocus(false);
+ if (getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getHostFigure()).setSelected(true);
+ ((WrappingLabel) getHostFigure()).setFocus(false);
} else {
hideSelection();
addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
@@ -77,12 +79,13 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
/**
* @generated
*/
+ @Override
protected void hideSelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(false);
- ((WrappingLabel)getHostFigure()).setFocus(false);
+ if (getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getHostFigure()).setSelected(false);
+ ((WrappingLabel) getHostFigure()).setFocus(false);
} else {
- if(selectionFeedbackFigure != null) {
+ if (selectionFeedbackFigure != null) {
removeFeedback(selectionFeedbackFigure);
getHostFigure().removeFigureListener(getHostPositionListener());
selectionFeedbackFigure = null;
@@ -94,9 +97,10 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
/**
* @generated
*/
+ @Override
protected void showFocus() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setFocus(true);
+ if (getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getHostFigure()).setFocus(true);
} else {
hideFocus();
addFeedback(focusFeedbackFigure = createFocusFeedbackFigure());
@@ -107,11 +111,12 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
/**
* @generated
*/
+ @Override
protected void hideFocus() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setFocus(false);
+ if (getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getHostFigure()).setFocus(false);
} else {
- if(focusFeedbackFigure != null) {
+ if (focusFeedbackFigure != null) {
removeFeedback(focusFeedbackFigure);
focusFeedbackFigure = null;
}
@@ -123,8 +128,8 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
*/
protected Rectangle getFeedbackBounds() {
Rectangle bounds;
- if(getHostFigure() instanceof Label) {
- bounds = ((Label)getHostFigure()).getTextBounds();
+ if (getHostFigure() instanceof Label) {
+ bounds = ((Label) getHostFigure()).getTextBounds();
bounds.intersect(getHostFigure().getBounds());
} else {
bounds = getHostFigure().getBounds().getCopy();
@@ -138,7 +143,7 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
* @generated
*/
protected IFigure createSelectionFeedbackFigure() {
- if(getHostFigure() instanceof Label) {
+ if (getHostFigure() instanceof Label) {
Label feedbackFigure = new Label();
feedbackFigure.setOpaque(true);
feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected);
@@ -157,6 +162,7 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
protected IFigure createFocusFeedbackFigure() {
return new Figure() {
+ @Override
protected void paintFigure(Graphics graphics) {
graphics.drawFocus(getBounds().getResized(-1, -1));
}
@@ -167,7 +173,7 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
* @generated
*/
protected void updateLabel(Label target) {
- Label source = (Label)getHostFigure();
+ Label source = (Label) getHostFigure();
target.setText(source.getText());
target.setTextAlignment(source.getTextAlignment());
target.setFont(source.getFont());
@@ -177,9 +183,9 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
* @generated
*/
protected void refreshSelectionFeedback() {
- if(selectionFeedbackFigure != null) {
- if(selectionFeedbackFigure instanceof Label) {
- updateLabel((Label)selectionFeedbackFigure);
+ if (selectionFeedbackFigure != null) {
+ if (selectionFeedbackFigure instanceof Label) {
+ updateLabel((Label) selectionFeedbackFigure);
selectionFeedbackFigure.setBounds(getFeedbackBounds());
} else {
selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5));
@@ -191,7 +197,7 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
* @generated
*/
protected void refreshFocusFeedback() {
- if(focusFeedbackFigure != null) {
+ if (focusFeedbackFigure != null) {
focusFeedbackFigure.setBounds(getFeedbackBounds());
}
}
@@ -199,6 +205,7 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
/**
* @generated
*/
+ @Override
public void refreshFeedback() {
refreshSelectionFeedback();
refreshFocusFeedback();
@@ -208,9 +215,10 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
* @generated
*/
private FigureListener getHostPositionListener() {
- if(hostPositionListener == null) {
+ if (hostPositionListener == null) {
hostPositionListener = new FigureListener() {
+ @Override
public void figureMoved(IFigure source) {
refreshFeedback();
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/expressions/UMLAbstractExpression.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/expressions/UMLAbstractExpression.java
index f2daa4c1287..300eb293e85 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/expressions/UMLAbstractExpression.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/expressions/UMLAbstractExpression.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -43,7 +43,7 @@ public abstract class UMLAbstractExpression {
protected void setStatus(int severity, String message, Throwable throwable) {
String pluginID = UMLDiagramEditorPlugin.ID;
this.status = new Status(severity, pluginID, -1, (message != null) ? message : "", throwable); //$NON-NLS-1$
- if(!this.status.isOK()) {
+ if (!this.status.isOK()) {
UMLDiagramEditorPlugin.getInstance().logError("Expression problem:" + message + "body:" + body(), throwable); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -105,7 +105,7 @@ public abstract class UMLAbstractExpression {
*/
@SuppressWarnings("rawtypes")
public Object evaluate(Object context, Map env) {
- if(context().isInstance(context)) {
+ if (context().isInstance(context)) {
try {
return doEvaluate(context, env);
} catch (Exception e) {
@@ -119,46 +119,54 @@ public abstract class UMLAbstractExpression {
* Expression may return number value which is not directly compatible with feature type (e.g.
* Double when Integer is expected), or EEnumLiteral meta-object when literal instance is
* expected
- *
+ *
* @generated
*/
public static Object performCast(Object value, EDataType targetType) {
- if(targetType instanceof EEnum) {
- if(value instanceof EEnumLiteral) {
- EEnumLiteral literal = (EEnumLiteral)value;
+ if (targetType instanceof EEnum) {
+ if (value instanceof EEnumLiteral) {
+ EEnumLiteral literal = (EEnumLiteral) value;
return (literal.getInstance() != null) ? literal.getInstance() : literal;
}
}
- if(false == value instanceof Number || targetType == null || targetType.getInstanceClass() == null) {
+ if (false == value instanceof Number || targetType == null || targetType.getInstanceClass() == null) {
return value;
}
Class<?> targetClass = targetType.getInstanceClass();
- Number num = (Number)value;
+ Number num = (Number) value;
Class<?> valClass = value.getClass();
Class<?> targetWrapperClass = targetClass;
- if(targetClass.isPrimitive()) {
+ if (targetClass.isPrimitive()) {
targetWrapperClass = EcoreUtil.wrapperClassFor(targetClass);
}
- if(valClass.equals(targetWrapperClass)) {
+ if (valClass.equals(targetWrapperClass)) {
return value;
}
- if(Number.class.isAssignableFrom(targetWrapperClass)) {
- if(targetWrapperClass.equals(Byte.class))
+ if (Number.class.isAssignableFrom(targetWrapperClass)) {
+ if (targetWrapperClass.equals(Byte.class)) {
return new Byte(num.byteValue());
- if(targetWrapperClass.equals(Integer.class))
+ }
+ if (targetWrapperClass.equals(Integer.class)) {
return new Integer(num.intValue());
- if(targetWrapperClass.equals(Short.class))
+ }
+ if (targetWrapperClass.equals(Short.class)) {
return new Short(num.shortValue());
- if(targetWrapperClass.equals(Long.class))
+ }
+ if (targetWrapperClass.equals(Long.class)) {
return new Long(num.longValue());
- if(targetWrapperClass.equals(BigInteger.class))
+ }
+ if (targetWrapperClass.equals(BigInteger.class)) {
return BigInteger.valueOf(num.longValue());
- if(targetWrapperClass.equals(Float.class))
+ }
+ if (targetWrapperClass.equals(Float.class)) {
return new Float(num.floatValue());
- if(targetWrapperClass.equals(Double.class))
+ }
+ if (targetWrapperClass.equals(Double.class)) {
return new Double(num.doubleValue());
- if(targetWrapperClass.equals(BigDecimal.class))
+ }
+ if (targetWrapperClass.equals(BigDecimal.class)) {
return new BigDecimal(num.doubleValue());
+ }
}
return value;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/expressions/UMLOCLFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/expressions/UMLOCLFactory.java
index 66d7745bf5f..66754233179 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/expressions/UMLOCLFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/expressions/UMLOCLFactory.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -50,29 +50,30 @@ public class UMLOCLFactory {
*/
protected UMLOCLFactory() {
this.expressions = new UMLAbstractExpression[23];
- this.expressionBodies = new String[]{ "\' \'", //$NON-NLS-1$
- "self.messageSort=MessageSort::synchCall and self.sendEvent<>null and self.receiveEvent<>null", //$NON-NLS-1$
- "self.oclIsKindOf(uml::InteractionFragment)", //$NON-NLS-1$
- "self.oclIsKindOf(uml::InteractionFragment) or self.oclIsKindOf(uml::Lifeline)", //$NON-NLS-1$
- "(self.messageSort=MessageSort::asynchCall or self.messageSort=MessageSort::asynchSignal) and self.sendEvent<>null and self.receiveEvent<>null", //$NON-NLS-1$
- "self.oclIsKindOf(uml::InteractionFragment) or self.oclIsKindOf(uml::Lifeline)", //$NON-NLS-1$
- "true\r\n-- The following rule is completely false : check can not be performed with only source and target (depends on the the location on the lifeline). Anyway, job is previously done by method CommandHelper.hasValidContainer(IEditCommandRequest)\r\n--(self.oclIsKindOf(uml::InteractionFragment) or self.oclIsKindOf(uml::Lifeline)) and (self.owner = oppositeEnd.owner or self.owner = oppositeEnd or self = oppositeEnd.owner)", //$NON-NLS-1$
- "self.messageSort=MessageSort::reply and self.sendEvent<>null and self.receiveEvent<>null", //$NON-NLS-1$
- "self.oclIsKindOf(uml::InteractionFragment)", //$NON-NLS-1$
- "self.oclIsKindOf(uml::InteractionFragment) or self.oclIsKindOf(uml::Lifeline)", //$NON-NLS-1$
- "self.messageSort=MessageSort::createMessage and self.sendEvent<>null and self.receiveEvent<>null", //$NON-NLS-1$
- "self.oclIsKindOf(uml::InteractionFragment) or self.oclIsKindOf(uml::Lifeline)", //$NON-NLS-1$
- "self.oclIsKindOf(uml::Lifeline)", //$NON-NLS-1$
- "self.messageSort=MessageSort::deleteMessage and self.sendEvent<>null and self.receiveEvent<>null", //$NON-NLS-1$
- "self.oclIsKindOf(uml::InteractionFragment) or self.oclIsKindOf(uml::Lifeline)", //$NON-NLS-1$
- "self.oclIsKindOf(uml::DestructionOccurrenceSpecification) or self.oclIsKindOf(uml::Lifeline)", //$NON-NLS-1$
- "self.receiveEvent=null", //$NON-NLS-1$
- "self.oclIsKindOf(uml::Lifeline) or self.oclIsKindOf(uml::InteractionFragment)", //$NON-NLS-1$
- "self.oclIsKindOf(uml::Interaction)", //$NON-NLS-1$
- "self.sendEvent=null", //$NON-NLS-1$
- "self.oclIsKindOf(uml::Interaction)", //$NON-NLS-1$
- "(self.oclIsKindOf(uml::Lifeline) or self.oclIsKindOf(uml::InteractionFragment))", //$NON-NLS-1$
- "(self.oclIsKindOf(uml::Lifeline) or self.oclIsKindOf(uml::InteractionFragment) or self.oclIsKindOf(uml::Gate))", //$NON-NLS-1$
+ this.expressionBodies = new String[] {
+ "\' \'", //$NON-NLS-1$
+ "self.messageSort=MessageSort::synchCall and self.sendEvent<>null and self.receiveEvent<>null", //$NON-NLS-1$
+ "self.oclIsKindOf(uml::InteractionFragment)", //$NON-NLS-1$
+ "self.oclIsKindOf(uml::InteractionFragment) or self.oclIsKindOf(uml::Lifeline)", //$NON-NLS-1$
+ "(self.messageSort=MessageSort::asynchCall or self.messageSort=MessageSort::asynchSignal) and self.sendEvent<>null and self.receiveEvent<>null", //$NON-NLS-1$
+ "self.oclIsKindOf(uml::InteractionFragment) or self.oclIsKindOf(uml::Lifeline)", //$NON-NLS-1$
+ "true\r\n-- The following rule is completely false : check can not be performed with only source and target (depends on the the location on the lifeline). Anyway, job is previously done by method CommandHelper.hasValidContainer(IEditCommandRequest)\r\n--(self.oclIsKindOf(uml::InteractionFragment) or self.oclIsKindOf(uml::Lifeline)) and (self.owner = oppositeEnd.owner or self.owner = oppositeEnd or self = oppositeEnd.owner)", //$NON-NLS-1$
+ "self.messageSort=MessageSort::reply and self.sendEvent<>null and self.receiveEvent<>null", //$NON-NLS-1$
+ "self.oclIsKindOf(uml::InteractionFragment)", //$NON-NLS-1$
+ "self.oclIsKindOf(uml::InteractionFragment) or self.oclIsKindOf(uml::Lifeline)", //$NON-NLS-1$
+ "self.messageSort=MessageSort::createMessage and self.sendEvent<>null and self.receiveEvent<>null", //$NON-NLS-1$
+ "self.oclIsKindOf(uml::InteractionFragment) or self.oclIsKindOf(uml::Lifeline)", //$NON-NLS-1$
+ "self.oclIsKindOf(uml::Lifeline)", //$NON-NLS-1$
+ "self.messageSort=MessageSort::deleteMessage and self.sendEvent<>null and self.receiveEvent<>null", //$NON-NLS-1$
+ "self.oclIsKindOf(uml::InteractionFragment) or self.oclIsKindOf(uml::Lifeline)", //$NON-NLS-1$
+ "self.oclIsKindOf(uml::DestructionOccurrenceSpecification) or self.oclIsKindOf(uml::Lifeline)", //$NON-NLS-1$
+ "self.receiveEvent=null", //$NON-NLS-1$
+ "self.oclIsKindOf(uml::Lifeline) or self.oclIsKindOf(uml::InteractionFragment)", //$NON-NLS-1$
+ "self.oclIsKindOf(uml::Interaction)", //$NON-NLS-1$
+ "self.sendEvent=null", //$NON-NLS-1$
+ "self.oclIsKindOf(uml::Interaction)", //$NON-NLS-1$
+ "(self.oclIsKindOf(uml::Lifeline) or self.oclIsKindOf(uml::InteractionFragment))", //$NON-NLS-1$
+ "(self.oclIsKindOf(uml::Lifeline) or self.oclIsKindOf(uml::InteractionFragment) or self.oclIsKindOf(uml::Gate))", //$NON-NLS-1$
};
}
@@ -81,7 +82,7 @@ public class UMLOCLFactory {
*/
private static UMLOCLFactory getInstance() {
UMLOCLFactory instance = UMLDiagramEditorPlugin.getInstance().getUMLOCLFactory();
- if(instance == null) {
+ if (instance == null) {
UMLDiagramEditorPlugin.getInstance().setUMLOCLFactory(instance = new UMLOCLFactory());
}
return instance;
@@ -99,10 +100,10 @@ public class UMLOCLFactory {
*/
public static UMLAbstractExpression getExpression(int index, EClassifier context, Map<String, EClassifier> environment) {
UMLOCLFactory cached = getInstance();
- if(index < 0 || index >= cached.expressions.length) {
+ if (index < 0 || index >= cached.expressions.length) {
throw new IllegalArgumentException();
}
- if(cached.expressions[index] == null) {
+ if (cached.expressions[index] == null) {
cached.expressions[index] = getExpression(cached.expressionBodies[index], context, environment == null ? Collections.<String, EClassifier> emptyMap() : environment);
}
return cached.expressions[index];
@@ -157,16 +158,17 @@ public class UMLOCLFactory {
/**
* @generated
*/
+ @Override
@SuppressWarnings("rawtypes")
protected Object doEvaluate(Object context, Map env) {
- if(oclExpression == null) {
+ if (oclExpression == null) {
return null;
}
// on the first call, both evalEnvironment and extentMap are clear, for later we have finally, below.
EvaluationEnvironment<?, ?, ?, ?, ?> evalEnv = oclInstance.getEvaluationEnvironment();
// initialize environment
- for(Object nextKey : env.keySet()) {
- evalEnv.replace((String)nextKey, env.get(nextKey));
+ for (Object nextKey : env.keySet()) {
+ evalEnv.replace((String) nextKey, env.get(nextKey));
}
try {
Object result = oclInstance.evaluate(context, oclExpression);
@@ -183,7 +185,7 @@ public class UMLOCLFactory {
private static void initCustomEnv(Environment<?, EClassifier, ?, ?, ?, EParameter, ?, ?, ?, ?, ?, ?> ecoreEnv, Map<String, EClassifier> environment) {
// Use EObject as implicit root class for any object, to allow eContainer() and other EObject operations from OCL expressions
ParsingOptions.setOption(ecoreEnv, ParsingOptions.implicitRootClass(ecoreEnv), EcorePackage.eINSTANCE.getEObject());
- for(String varName : environment.keySet()) {
+ for (String varName : environment.keySet()) {
EClassifier varType = environment.get(varName);
ecoreEnv.addElement(varName, createVar(ecoreEnv, varName, varType), false);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLAbstractNavigatorItem.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLAbstractNavigatorItem.java
index f1622c26c8b..efe11798282 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLAbstractNavigatorItem.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLAbstractNavigatorItem.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -27,22 +27,25 @@ public abstract class UMLAbstractNavigatorItem extends PlatformObject {
* @generated
*/
static {
- final Class[] supportedTypes = new Class[]{ ITabbedPropertySheetPageContributor.class };
+ final Class[] supportedTypes = new Class[] { ITabbedPropertySheetPageContributor.class };
final ITabbedPropertySheetPageContributor propertySheetPageContributor = new ITabbedPropertySheetPageContributor() {
+ @Override
public String getContributorId() {
return "org.eclipse.papyrus.uml.diagram.sequence"; //$NON-NLS-1$
}
};
Platform.getAdapterManager().registerAdapters(new IAdapterFactory() {
+ @Override
public Object getAdapter(Object adaptableObject, Class adapterType) {
- if(adaptableObject instanceof org.eclipse.papyrus.uml.diagram.sequence.navigator.UMLAbstractNavigatorItem && adapterType == ITabbedPropertySheetPageContributor.class) {
+ if (adaptableObject instanceof org.eclipse.papyrus.uml.diagram.sequence.navigator.UMLAbstractNavigatorItem && adapterType == ITabbedPropertySheetPageContributor.class) {
return propertySheetPageContributor;
}
return null;
}
+ @Override
public Class[] getAdapterList() {
return supportedTypes;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLDomainNavigatorContentProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLDomainNavigatorContentProvider.java
index 98c1659650a..701ab455ee1 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLDomainNavigatorContentProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLDomainNavigatorContentProvider.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -25,6 +25,7 @@ import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.workspace.WorkspaceEditingDomainFactory;
import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory;
import org.eclipse.jface.viewers.Viewer;
@@ -73,12 +74,13 @@ public class UMLDomainNavigatorContentProvider implements ICommonContentProvider
*/
public UMLDomainNavigatorContentProvider() {
myAdapterFctoryContentProvier = new AdapterFactoryContentProvider(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory());
- TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE.createEditingDomain();
- myEditingDomain = (AdapterFactoryEditingDomain)editingDomain;
+ TransactionalEditingDomain editingDomain = WorkspaceEditingDomainFactory.INSTANCE.createEditingDomain();
+ myEditingDomain = (AdapterFactoryEditingDomain) editingDomain;
myEditingDomain.setResourceToReadOnlyMap(new HashMap() {
+ @Override
public Object get(Object key) {
- if(!containsKey(key)) {
+ if (!containsKey(key)) {
put(key, Boolean.TRUE);
}
return super.get(key);
@@ -86,45 +88,50 @@ public class UMLDomainNavigatorContentProvider implements ICommonContentProvider
});
myViewerRefreshRunnable = new Runnable() {
+ @Override
public void run() {
- if(myViewer != null) {
+ if (myViewer != null) {
myViewer.refresh();
}
}
};
myWorkspaceSynchronizer = new WorkspaceSynchronizer(editingDomain, new WorkspaceSynchronizer.Delegate() {
+ @Override
public void dispose() {
}
+ @Override
public boolean handleResourceChanged(final Resource resource) {
- for(Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
- Resource nextResource = (Resource)it.next();
+ for (Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
+ Resource nextResource = (Resource) it.next();
nextResource.unload();
}
- if(myViewer != null) {
+ if (myViewer != null) {
myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable);
}
return true;
}
+ @Override
public boolean handleResourceDeleted(Resource resource) {
- for(Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
- Resource nextResource = (Resource)it.next();
+ for (Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
+ Resource nextResource = (Resource) it.next();
nextResource.unload();
}
- if(myViewer != null) {
+ if (myViewer != null) {
myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable);
}
return true;
}
+ @Override
public boolean handleResourceMoved(Resource resource, final URI newURI) {
- for(Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
- Resource nextResource = (Resource)it.next();
+ for (Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
+ Resource nextResource = (Resource) it.next();
nextResource.unload();
}
- if(myViewer != null) {
+ if (myViewer != null) {
myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable);
}
return true;
@@ -135,21 +142,23 @@ public class UMLDomainNavigatorContentProvider implements ICommonContentProvider
/**
* @generated
*/
+ @Override
public void dispose() {
myWorkspaceSynchronizer.dispose();
myWorkspaceSynchronizer = null;
myViewerRefreshRunnable = null;
- for(Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
- Resource resource = (Resource)it.next();
+ for (Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
+ Resource resource = (Resource) it.next();
resource.unload();
}
- ((TransactionalEditingDomain)myEditingDomain).dispose();
+ ((TransactionalEditingDomain) myEditingDomain).dispose();
myEditingDomain = null;
}
/**
* @generated
*/
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
myViewer = viewer;
}
@@ -157,6 +166,7 @@ public class UMLDomainNavigatorContentProvider implements ICommonContentProvider
/**
* @generated
*/
+ @Override
public Object[] getElements(Object inputElement) {
return getChildren(inputElement);
}
@@ -164,33 +174,37 @@ public class UMLDomainNavigatorContentProvider implements ICommonContentProvider
/**
* @generated
*/
+ @Override
public void restoreState(IMemento aMemento) {
}
/**
* @generated
*/
+ @Override
public void saveState(IMemento aMemento) {
}
/**
* @generated
*/
+ @Override
public void init(ICommonContentExtensionSite aConfig) {
}
/**
* @generated
*/
+ @Override
public Object[] getChildren(Object parentElement) {
- if(parentElement instanceof IFile) {
- IFile file = (IFile)parentElement;
+ if (parentElement instanceof IFile) {
+ IFile file = (IFile) parentElement;
URI fileURI = URI.createPlatformResourceURI(file.getFullPath().toString(), true);
Resource resource = myEditingDomain.getResourceSet().getResource(fileURI, true);
return wrapEObjects(myAdapterFctoryContentProvier.getChildren(resource), parentElement);
}
- if(parentElement instanceof UMLDomainNavigatorItem) {
- return wrapEObjects(myAdapterFctoryContentProvier.getChildren(((UMLDomainNavigatorItem)parentElement).getEObject()), parentElement);
+ if (parentElement instanceof UMLDomainNavigatorItem) {
+ return wrapEObjects(myAdapterFctoryContentProvier.getChildren(((UMLDomainNavigatorItem) parentElement).getEObject()), parentElement);
}
return EMPTY_ARRAY;
}
@@ -200,9 +214,9 @@ public class UMLDomainNavigatorContentProvider implements ICommonContentProvider
*/
public Object[] wrapEObjects(Object[] objects, Object parentElement) {
Collection result = new ArrayList();
- for(int i = 0; i < objects.length; i++) {
- if(objects[i] instanceof EObject) {
- result.add(new UMLDomainNavigatorItem((EObject)objects[i], parentElement, myAdapterFctoryContentProvier));
+ for (int i = 0; i < objects.length; i++) {
+ if (objects[i] instanceof EObject) {
+ result.add(new UMLDomainNavigatorItem((EObject) objects[i], parentElement, myAdapterFctoryContentProvier));
}
}
return result.toArray();
@@ -211,9 +225,10 @@ public class UMLDomainNavigatorContentProvider implements ICommonContentProvider
/**
* @generated
*/
+ @Override
public Object getParent(Object element) {
- if(element instanceof UMLAbstractNavigatorItem) {
- UMLAbstractNavigatorItem abstractNavigatorItem = (UMLAbstractNavigatorItem)element;
+ if (element instanceof UMLAbstractNavigatorItem) {
+ UMLAbstractNavigatorItem abstractNavigatorItem = (UMLAbstractNavigatorItem) element;
return abstractNavigatorItem.getParent();
}
return null;
@@ -222,6 +237,7 @@ public class UMLDomainNavigatorContentProvider implements ICommonContentProvider
/**
* @generated
*/
+ @Override
public boolean hasChildren(Object element) {
return element instanceof IFile || getChildren(element).length > 0;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLDomainNavigatorItem.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLDomainNavigatorItem.java
index 76a16309582..5c9247f9145 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLDomainNavigatorItem.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLDomainNavigatorItem.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -30,23 +30,25 @@ public class UMLDomainNavigatorItem extends PlatformObject {
* @generated
*/
static {
- final Class[] supportedTypes = new Class[]{ EObject.class, IPropertySource.class };
+ final Class[] supportedTypes = new Class[] { EObject.class, IPropertySource.class };
Platform.getAdapterManager().registerAdapters(new IAdapterFactory() {
+ @Override
public Object getAdapter(Object adaptableObject, Class adapterType) {
- if(adaptableObject instanceof org.eclipse.papyrus.uml.diagram.sequence.navigator.UMLDomainNavigatorItem) {
- org.eclipse.papyrus.uml.diagram.sequence.navigator.UMLDomainNavigatorItem domainNavigatorItem = (org.eclipse.papyrus.uml.diagram.sequence.navigator.UMLDomainNavigatorItem)adaptableObject;
+ if (adaptableObject instanceof org.eclipse.papyrus.uml.diagram.sequence.navigator.UMLDomainNavigatorItem) {
+ org.eclipse.papyrus.uml.diagram.sequence.navigator.UMLDomainNavigatorItem domainNavigatorItem = (org.eclipse.papyrus.uml.diagram.sequence.navigator.UMLDomainNavigatorItem) adaptableObject;
EObject eObject = domainNavigatorItem.getEObject();
- if(adapterType == EObject.class) {
+ if (adapterType == EObject.class) {
return eObject;
}
- if(adapterType == IPropertySource.class) {
+ if (adapterType == IPropertySource.class) {
return domainNavigatorItem.getPropertySourceProvider().getPropertySource(eObject);
}
}
return null;
}
+ @Override
public Class[] getAdapterList() {
return supportedTypes;
}
@@ -101,9 +103,10 @@ public class UMLDomainNavigatorItem extends PlatformObject {
/**
* @generated
*/
+ @Override
public boolean equals(Object obj) {
- if(obj instanceof org.eclipse.papyrus.uml.diagram.sequence.navigator.UMLDomainNavigatorItem) {
- return EcoreUtil.getURI(getEObject()).equals(EcoreUtil.getURI(((org.eclipse.papyrus.uml.diagram.sequence.navigator.UMLDomainNavigatorItem)obj).getEObject()));
+ if (obj instanceof org.eclipse.papyrus.uml.diagram.sequence.navigator.UMLDomainNavigatorItem) {
+ return EcoreUtil.getURI(getEObject()).equals(EcoreUtil.getURI(((org.eclipse.papyrus.uml.diagram.sequence.navigator.UMLDomainNavigatorItem) obj).getEObject()));
}
return super.equals(obj);
}
@@ -111,6 +114,7 @@ public class UMLDomainNavigatorItem extends PlatformObject {
/**
* @generated
*/
+ @Override
public int hashCode() {
return EcoreUtil.getURI(getEObject()).hashCode();
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLDomainNavigatorLabelProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLDomainNavigatorLabelProvider.java
index d6159e442c7..97240e1d69e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLDomainNavigatorLabelProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLDomainNavigatorLabelProvider.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -34,15 +34,17 @@ public class UMLDomainNavigatorLabelProvider implements ICommonLabelProvider {
/**
* @generated
*/
+ @Override
public void init(ICommonContentExtensionSite aConfig) {
}
/**
* @generated
*/
+ @Override
public Image getImage(Object element) {
- if(element instanceof UMLDomainNavigatorItem) {
- return myAdapterFactoryLabelProvider.getImage(((UMLDomainNavigatorItem)element).getEObject());
+ if (element instanceof UMLDomainNavigatorItem) {
+ return myAdapterFactoryLabelProvider.getImage(((UMLDomainNavigatorItem) element).getEObject());
}
return null;
}
@@ -50,9 +52,10 @@ public class UMLDomainNavigatorLabelProvider implements ICommonLabelProvider {
/**
* @generated
*/
+ @Override
public String getText(Object element) {
- if(element instanceof UMLDomainNavigatorItem) {
- return myAdapterFactoryLabelProvider.getText(((UMLDomainNavigatorItem)element).getEObject());
+ if (element instanceof UMLDomainNavigatorItem) {
+ return myAdapterFactoryLabelProvider.getText(((UMLDomainNavigatorItem) element).getEObject());
}
return null;
}
@@ -60,6 +63,7 @@ public class UMLDomainNavigatorLabelProvider implements ICommonLabelProvider {
/**
* @generated
*/
+ @Override
public void addListener(ILabelProviderListener listener) {
myAdapterFactoryLabelProvider.addListener(listener);
}
@@ -67,6 +71,7 @@ public class UMLDomainNavigatorLabelProvider implements ICommonLabelProvider {
/**
* @generated
*/
+ @Override
public void dispose() {
myAdapterFactoryLabelProvider.dispose();
}
@@ -74,6 +79,7 @@ public class UMLDomainNavigatorLabelProvider implements ICommonLabelProvider {
/**
* @generated
*/
+ @Override
public boolean isLabelProperty(Object element, String property) {
return myAdapterFactoryLabelProvider.isLabelProperty(element, property);
}
@@ -81,6 +87,7 @@ public class UMLDomainNavigatorLabelProvider implements ICommonLabelProvider {
/**
* @generated
*/
+ @Override
public void removeListener(ILabelProviderListener listener) {
myAdapterFactoryLabelProvider.removeListener(listener);
}
@@ -88,18 +95,21 @@ public class UMLDomainNavigatorLabelProvider implements ICommonLabelProvider {
/**
* @generated
*/
+ @Override
public void restoreState(IMemento aMemento) {
}
/**
* @generated
*/
+ @Override
public void saveState(IMemento aMemento) {
}
/**
* @generated
*/
+ @Override
public String getDescription(Object anElement) {
return null;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorActionProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorActionProvider.java
index 71c4cbee1d3..4b45c5beab0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorActionProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorActionProvider.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -58,11 +58,12 @@ public class UMLNavigatorActionProvider extends CommonActionProvider {
/**
* @generated
*/
+ @Override
public void init(ICommonActionExtensionSite aSite) {
super.init(aSite);
- if(aSite.getViewSite() instanceof ICommonViewerWorkbenchSite) {
+ if (aSite.getViewSite() instanceof ICommonViewerWorkbenchSite) {
myContribute = true;
- makeActions((ICommonViewerWorkbenchSite)aSite.getViewSite());
+ makeActions((ICommonViewerWorkbenchSite) aSite.getViewSite());
} else {
myContribute = false;
}
@@ -78,13 +79,14 @@ public class UMLNavigatorActionProvider extends CommonActionProvider {
/**
* @generated
*/
+ @Override
public void fillActionBars(IActionBars actionBars) {
- if(!myContribute) {
+ if (!myContribute) {
return;
}
- IStructuredSelection selection = (IStructuredSelection)getContext().getSelection();
+ IStructuredSelection selection = (IStructuredSelection) getContext().getSelection();
myOpenDiagramAction.selectionChanged(selection);
- if(myOpenDiagramAction.isEnabled()) {
+ if (myOpenDiagramAction.isEnabled()) {
actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, myOpenDiagramAction);
}
}
@@ -92,6 +94,7 @@ public class UMLNavigatorActionProvider extends CommonActionProvider {
/**
* @generated
*/
+ @Override
public void fillContextMenu(IMenuManager menu) {
}
@@ -123,16 +126,16 @@ public class UMLNavigatorActionProvider extends CommonActionProvider {
*/
public final void selectionChanged(IStructuredSelection selection) {
myDiagram = null;
- if(selection.size() == 1) {
+ if (selection.size() == 1) {
Object selectedElement = selection.getFirstElement();
- if(selectedElement instanceof UMLNavigatorItem) {
- selectedElement = ((UMLNavigatorItem)selectedElement).getView();
- } else if(selectedElement instanceof IAdaptable) {
- selectedElement = ((IAdaptable)selectedElement).getAdapter(View.class);
+ if (selectedElement instanceof UMLNavigatorItem) {
+ selectedElement = ((UMLNavigatorItem) selectedElement).getView();
+ } else if (selectedElement instanceof IAdaptable) {
+ selectedElement = ((IAdaptable) selectedElement).getAdapter(View.class);
}
- if(selectedElement instanceof Diagram) {
- Diagram diagram = (Diagram)selectedElement;
- if(PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(diagram))) {
+ if (selectedElement instanceof Diagram) {
+ Diagram diagram = (Diagram) selectedElement;
+ if (PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(diagram))) {
myDiagram = diagram;
}
}
@@ -143,8 +146,9 @@ public class UMLNavigatorActionProvider extends CommonActionProvider {
/**
* @generated
*/
+ @Override
public void run() {
- if(myDiagram == null || myDiagram.eResource() == null) {
+ if (myDiagram == null || myDiagram.eResource() == null) {
return;
}
IEditorInput editorInput = getEditorInput(myDiagram);
@@ -161,11 +165,11 @@ public class UMLNavigatorActionProvider extends CommonActionProvider {
*/
private static IEditorInput getEditorInput(Diagram diagram) {
Resource diagramResource = diagram.eResource();
- for(EObject nextEObject : diagramResource.getContents()) {
- if(nextEObject == diagram) {
+ for (EObject nextEObject : diagramResource.getContents()) {
+ if (nextEObject == diagram) {
return new FileEditorInput(WorkspaceSynchronizer.getFile(diagramResource));
}
- if(nextEObject instanceof Diagram) {
+ if (nextEObject instanceof Diagram) {
break;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorContentProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorContentProvider.java
index 79927180957..4835e1c3f5a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorContentProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorContentProvider.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -24,6 +24,7 @@ import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.workspace.WorkspaceEditingDomainFactory;
import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory;
import org.eclipse.gmf.runtime.notation.Diagram;
@@ -103,12 +104,13 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
*/
@SuppressWarnings({ "unchecked", "serial", "rawtypes" })
public UMLNavigatorContentProvider() {
- TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE.createEditingDomain();
- myEditingDomain = (AdapterFactoryEditingDomain)editingDomain;
+ TransactionalEditingDomain editingDomain = WorkspaceEditingDomainFactory.INSTANCE.createEditingDomain();
+ myEditingDomain = (AdapterFactoryEditingDomain) editingDomain;
myEditingDomain.setResourceToReadOnlyMap(new HashMap() {
+ @Override
public Object get(Object key) {
- if(!containsKey(key)) {
+ if (!containsKey(key)) {
put(key, Boolean.TRUE);
}
return super.get(key);
@@ -116,45 +118,50 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
});
myViewerRefreshRunnable = new Runnable() {
+ @Override
public void run() {
- if(myViewer != null) {
+ if (myViewer != null) {
myViewer.refresh();
}
}
};
myWorkspaceSynchronizer = new WorkspaceSynchronizer(editingDomain, new WorkspaceSynchronizer.Delegate() {
+ @Override
public void dispose() {
}
+ @Override
public boolean handleResourceChanged(final Resource resource) {
- for(Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
- Resource nextResource = (Resource)it.next();
+ for (Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
+ Resource nextResource = (Resource) it.next();
nextResource.unload();
}
- if(myViewer != null) {
+ if (myViewer != null) {
myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable);
}
return true;
}
+ @Override
public boolean handleResourceDeleted(Resource resource) {
- for(Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
- Resource nextResource = (Resource)it.next();
+ for (Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
+ Resource nextResource = (Resource) it.next();
nextResource.unload();
}
- if(myViewer != null) {
+ if (myViewer != null) {
myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable);
}
return true;
}
+ @Override
public boolean handleResourceMoved(Resource resource, final URI newURI) {
- for(Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
- Resource nextResource = (Resource)it.next();
+ for (Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
+ Resource nextResource = (Resource) it.next();
nextResource.unload();
}
- if(myViewer != null) {
+ if (myViewer != null) {
myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable);
}
return true;
@@ -163,10 +170,10 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
}
/**
- *
+ *
* Papyrus Template this method is a modification of gmf code in order to avoid
* getViewChidreen() method becoming greater than 64kb.
- *
+ *
* @generated
**/
private Object[] getViewChildrenForPackageEditPart(View view, Object parentElement) {
@@ -194,17 +201,17 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
links.addChildren(createNavigatorItems(connectedViews, links, false));
connectedViews = getDiagramLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(GeneralOrderingEditPart.VISUAL_ID));
links.addChildren(createNavigatorItems(connectedViews, links, false));
- if(!links.isEmpty()) {
+ if (!links.isEmpty()) {
result.add(links);
}
return result.toArray();
}
/**
- *
+ *
* Papyrus Template this method is a modification of gmf code in order to avoid
* getViewChidreen() method becoming greater than 64kb.
- *
+ *
* @generated
**/
private Object[] getViewChildrenForInteractionEditPart(View view, Object parentElement) {
@@ -265,20 +272,20 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID));
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
- if(!incominglinks.isEmpty()) {
+ if (!incominglinks.isEmpty()) {
result.add(incominglinks);
}
- if(!outgoinglinks.isEmpty()) {
+ if (!outgoinglinks.isEmpty()) {
result.add(outgoinglinks);
}
return result.toArray();
}
/**
- *
+ *
* Papyrus Template this method is a modification of gmf code in order to avoid
* getViewChidreen() method becoming greater than 64kb.
- *
+ *
* @generated
**/
private Object[] getViewChildrenForLifelineEditPart(View view, Object parentElement) {
@@ -333,20 +340,20 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID));
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
- if(!incominglinks.isEmpty()) {
+ if (!incominglinks.isEmpty()) {
result.add(incominglinks);
}
- if(!outgoinglinks.isEmpty()) {
+ if (!outgoinglinks.isEmpty()) {
result.add(outgoinglinks);
}
return result.toArray();
}
/**
- *
+ *
* Papyrus Template this method is a modification of gmf code in order to avoid
* getViewChidreen() method becoming greater than 64kb.
- *
+ *
* @generated
**/
private Object[] getViewChildrenForActionExecutionSpecificationEditPart(View view, Object parentElement) {
@@ -385,20 +392,20 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID));
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
- if(!incominglinks.isEmpty()) {
+ if (!incominglinks.isEmpty()) {
result.add(incominglinks);
}
- if(!outgoinglinks.isEmpty()) {
+ if (!outgoinglinks.isEmpty()) {
result.add(outgoinglinks);
}
return result.toArray();
}
/**
- *
+ *
* Papyrus Template this method is a modification of gmf code in order to avoid
* getViewChidreen() method becoming greater than 64kb.
- *
+ *
* @generated
**/
private Object[] getViewChildrenForBehaviorExecutionSpecificationEditPart(View view, Object parentElement) {
@@ -437,20 +444,20 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID));
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
- if(!incominglinks.isEmpty()) {
+ if (!incominglinks.isEmpty()) {
result.add(incominglinks);
}
- if(!outgoinglinks.isEmpty()) {
+ if (!outgoinglinks.isEmpty()) {
result.add(outgoinglinks);
}
return result.toArray();
}
/**
- *
+ *
* Papyrus Template
* this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
- *
+ *
* @generated
**/
private Object[] getViewChildrenForStateInvariantEditPart(View view, Object parentElement) {
@@ -489,20 +496,20 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID));
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
- if(!incominglinks.isEmpty()) {
+ if (!incominglinks.isEmpty()) {
result.add(incominglinks);
}
- if(!outgoinglinks.isEmpty()) {
+ if (!outgoinglinks.isEmpty()) {
result.add(outgoinglinks);
}
return result.toArray();
}
/**
- *
+ *
* Papyrus Template
* this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
- *
+ *
* @generated
**/
private Object[] getViewChildrenForCombinedFragment2EditPart(View view, Object parentElement) {
@@ -541,20 +548,20 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID));
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
- if(!incominglinks.isEmpty()) {
+ if (!incominglinks.isEmpty()) {
result.add(incominglinks);
}
- if(!outgoinglinks.isEmpty()) {
+ if (!outgoinglinks.isEmpty()) {
result.add(outgoinglinks);
}
return result.toArray();
}
/**
- *
+ *
* Papyrus Template
* this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
- *
+ *
* @generated
**/
private Object[] getViewChildrenForTimeConstraintEditPart(View view, Object parentElement) {
@@ -595,20 +602,20 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID));
outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
- if(!incominglinks.isEmpty()) {
+ if (!incominglinks.isEmpty()) {
result.add(incominglinks);
}
- if(!outgoinglinks.isEmpty()) {
+ if (!outgoinglinks.isEmpty()) {
result.add(outgoinglinks);
}
return result.toArray();
}
/**
- *
+ *
* Papyrus Template
* this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
- *
+ *
* @generated
**/
private Object[] getViewChildrenForDurationObservationEditPart(View view, Object parentElement) {
@@ -647,20 +654,20 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID));
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
- if(!incominglinks.isEmpty()) {
+ if (!incominglinks.isEmpty()) {
result.add(incominglinks);
}
- if(!outgoinglinks.isEmpty()) {
+ if (!outgoinglinks.isEmpty()) {
result.add(outgoinglinks);
}
return result.toArray();
}
/**
- *
+ *
* Papyrus Template
* this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
- *
+ *
* @generated
**/
private Object[] getViewChildrenForTimeObservationEditPart(View view, Object parentElement) {
@@ -699,20 +706,20 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID));
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
- if(!incominglinks.isEmpty()) {
+ if (!incominglinks.isEmpty()) {
result.add(incominglinks);
}
- if(!outgoinglinks.isEmpty()) {
+ if (!outgoinglinks.isEmpty()) {
result.add(outgoinglinks);
}
return result.toArray();
}
/**
- *
+ *
* Papyrus Template
* this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
- *
+ *
* @generated
**/
private Object[] getViewChildrenForDurationConstraintEditPart(View view, Object parentElement) {
@@ -753,20 +760,20 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID));
outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
- if(!incominglinks.isEmpty()) {
+ if (!incominglinks.isEmpty()) {
result.add(incominglinks);
}
- if(!outgoinglinks.isEmpty()) {
+ if (!outgoinglinks.isEmpty()) {
result.add(outgoinglinks);
}
return result.toArray();
}
/**
- *
+ *
* Papyrus Template this method is a modification of gmf code in order to avoid
* getViewChidreen() method becoming greater than 64kb.
- *
+ *
* @generated
**/
private Object[] getViewChildrenForInteractionUseEditPart(View view, Object parentElement) {
@@ -805,20 +812,20 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID));
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
- if(!incominglinks.isEmpty()) {
+ if (!incominglinks.isEmpty()) {
result.add(incominglinks);
}
- if(!outgoinglinks.isEmpty()) {
+ if (!outgoinglinks.isEmpty()) {
result.add(outgoinglinks);
}
return result.toArray();
}
/**
- *
+ *
* Papyrus Template this method is a modification of gmf code in order to avoid
* getViewChidreen() method becoming greater than 64kb.
- *
+ *
* @generated
**/
private Object[] getViewChildrenForCombinedFragmentEditPart(View view, Object parentElement) {
@@ -860,20 +867,20 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID));
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
- if(!incominglinks.isEmpty()) {
+ if (!incominglinks.isEmpty()) {
result.add(incominglinks);
}
- if(!outgoinglinks.isEmpty()) {
+ if (!outgoinglinks.isEmpty()) {
result.add(outgoinglinks);
}
return result.toArray();
}
/**
- *
+ *
* Papyrus Template this method is a modification of gmf code in order to avoid
* getViewChidreen() method becoming greater than 64kb.
- *
+ *
* @generated
**/
private Object[] getViewChildrenForInteractionOperandEditPart(View view, Object parentElement) {
@@ -920,20 +927,20 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID));
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
- if(!incominglinks.isEmpty()) {
+ if (!incominglinks.isEmpty()) {
result.add(incominglinks);
}
- if(!outgoinglinks.isEmpty()) {
+ if (!outgoinglinks.isEmpty()) {
result.add(outgoinglinks);
}
return result.toArray();
}
/**
- *
+ *
* Papyrus Template
* this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
- *
+ *
* @generated
**/
private Object[] getViewChildrenForContinuationEditPart(View view, Object parentElement) {
@@ -972,20 +979,20 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID));
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
- if(!incominglinks.isEmpty()) {
+ if (!incominglinks.isEmpty()) {
result.add(incominglinks);
}
- if(!outgoinglinks.isEmpty()) {
+ if (!outgoinglinks.isEmpty()) {
result.add(outgoinglinks);
}
return result.toArray();
}
/**
- *
+ *
* Papyrus Template
* this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
- *
+ *
* @generated
**/
private Object[] getViewChildrenForConstraintEditPart(View view, Object parentElement) {
@@ -1026,20 +1033,20 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID));
outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
- if(!incominglinks.isEmpty()) {
+ if (!incominglinks.isEmpty()) {
result.add(incominglinks);
}
- if(!outgoinglinks.isEmpty()) {
+ if (!outgoinglinks.isEmpty()) {
result.add(outgoinglinks);
}
return result.toArray();
}
/**
- *
+ *
* Papyrus Template
* this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
- *
+ *
* @generated
**/
private Object[] getViewChildrenForDurationConstraintInMessageEditPart(View view, Object parentElement) {
@@ -1080,20 +1087,20 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
connectedViews = getOutgoingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID));
outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
- if(!incominglinks.isEmpty()) {
+ if (!incominglinks.isEmpty()) {
result.add(incominglinks);
}
- if(!outgoinglinks.isEmpty()) {
+ if (!outgoinglinks.isEmpty()) {
result.add(outgoinglinks);
}
return result.toArray();
}
/**
- *
+ *
* Papyrus Template
* this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
- *
+ *
* @generated
**/
private Object[] getViewChildrenForCommentEditPart(View view, Object parentElement) {
@@ -1134,20 +1141,20 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID));
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
- if(!incominglinks.isEmpty()) {
+ if (!incominglinks.isEmpty()) {
result.add(incominglinks);
}
- if(!outgoinglinks.isEmpty()) {
+ if (!outgoinglinks.isEmpty()) {
result.add(outgoinglinks);
}
return result.toArray();
}
/**
- *
+ *
* Papyrus Template this method is a modification of gmf code in order to avoid
* getViewChidreen() method becoming greater than 64kb.
- *
+ *
* @generated
**/
private Object[] getViewChildrenForConsiderIgnoreFragmentEditPart(View view, Object parentElement) {
@@ -1186,20 +1193,20 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID));
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
- if(!incominglinks.isEmpty()) {
+ if (!incominglinks.isEmpty()) {
result.add(incominglinks);
}
- if(!outgoinglinks.isEmpty()) {
+ if (!outgoinglinks.isEmpty()) {
result.add(outgoinglinks);
}
return result.toArray();
}
/**
- *
+ *
* Papyrus Template this method is a modification of gmf code in order to avoid
* getViewChidreen() method becoming greater than 64kb.
- *
+ *
* @generated
**/
private Object[] getViewChildrenForMessageEditPart(View view, Object parentElement) {
@@ -1284,26 +1291,26 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
source.addChildren(createNavigatorItems(connectedViews, source, true));
connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(DurationObservationEditPart.VISUAL_ID));
source.addChildren(createNavigatorItems(connectedViews, source, true));
- if(!target.isEmpty()) {
+ if (!target.isEmpty()) {
result.add(target);
}
- if(!incominglinks.isEmpty()) {
+ if (!incominglinks.isEmpty()) {
result.add(incominglinks);
}
- if(!source.isEmpty()) {
+ if (!source.isEmpty()) {
result.add(source);
}
- if(!outgoinglinks.isEmpty()) {
+ if (!outgoinglinks.isEmpty()) {
result.add(outgoinglinks);
}
return result.toArray();
}
/**
- *
+ *
* Papyrus Template this method is a modification of gmf code in order to avoid
* getViewChidreen() method becoming greater than 64kb.
- *
+ *
* @generated
**/
private Object[] getViewChildrenForMessage2EditPart(View view, Object parentElement) {
@@ -1388,26 +1395,26 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
source.addChildren(createNavigatorItems(connectedViews, source, true));
connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(DurationObservationEditPart.VISUAL_ID));
source.addChildren(createNavigatorItems(connectedViews, source, true));
- if(!target.isEmpty()) {
+ if (!target.isEmpty()) {
result.add(target);
}
- if(!incominglinks.isEmpty()) {
+ if (!incominglinks.isEmpty()) {
result.add(incominglinks);
}
- if(!source.isEmpty()) {
+ if (!source.isEmpty()) {
result.add(source);
}
- if(!outgoinglinks.isEmpty()) {
+ if (!outgoinglinks.isEmpty()) {
result.add(outgoinglinks);
}
return result.toArray();
}
/**
- *
+ *
* Papyrus Template this method is a modification of gmf code in order to avoid
* getViewChidreen() method becoming greater than 64kb.
- *
+ *
* @generated
**/
private Object[] getViewChildrenForMessage3EditPart(View view, Object parentElement) {
@@ -1492,26 +1499,26 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
source.addChildren(createNavigatorItems(connectedViews, source, true));
connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(DurationObservationEditPart.VISUAL_ID));
source.addChildren(createNavigatorItems(connectedViews, source, true));
- if(!target.isEmpty()) {
+ if (!target.isEmpty()) {
result.add(target);
}
- if(!incominglinks.isEmpty()) {
+ if (!incominglinks.isEmpty()) {
result.add(incominglinks);
}
- if(!source.isEmpty()) {
+ if (!source.isEmpty()) {
result.add(source);
}
- if(!outgoinglinks.isEmpty()) {
+ if (!outgoinglinks.isEmpty()) {
result.add(outgoinglinks);
}
return result.toArray();
}
/**
- *
+ *
* Papyrus Template this method is a modification of gmf code in order to avoid
* getViewChidreen() method becoming greater than 64kb.
- *
+ *
* @generated
**/
private Object[] getViewChildrenForMessage4EditPart(View view, Object parentElement) {
@@ -1596,26 +1603,26 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
source.addChildren(createNavigatorItems(connectedViews, source, true));
connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(DurationObservationEditPart.VISUAL_ID));
source.addChildren(createNavigatorItems(connectedViews, source, true));
- if(!target.isEmpty()) {
+ if (!target.isEmpty()) {
result.add(target);
}
- if(!incominglinks.isEmpty()) {
+ if (!incominglinks.isEmpty()) {
result.add(incominglinks);
}
- if(!source.isEmpty()) {
+ if (!source.isEmpty()) {
result.add(source);
}
- if(!outgoinglinks.isEmpty()) {
+ if (!outgoinglinks.isEmpty()) {
result.add(outgoinglinks);
}
return result.toArray();
}
/**
- *
+ *
* Papyrus Template this method is a modification of gmf code in order to avoid
* getViewChidreen() method becoming greater than 64kb.
- *
+ *
* @generated
**/
private Object[] getViewChildrenForMessage5EditPart(View view, Object parentElement) {
@@ -1700,26 +1707,26 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
source.addChildren(createNavigatorItems(connectedViews, source, true));
connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(DurationObservationEditPart.VISUAL_ID));
source.addChildren(createNavigatorItems(connectedViews, source, true));
- if(!target.isEmpty()) {
+ if (!target.isEmpty()) {
result.add(target);
}
- if(!incominglinks.isEmpty()) {
+ if (!incominglinks.isEmpty()) {
result.add(incominglinks);
}
- if(!source.isEmpty()) {
+ if (!source.isEmpty()) {
result.add(source);
}
- if(!outgoinglinks.isEmpty()) {
+ if (!outgoinglinks.isEmpty()) {
result.add(outgoinglinks);
}
return result.toArray();
}
/**
- *
+ *
* Papyrus Template this method is a modification of gmf code in order to avoid
* getViewChidreen() method becoming greater than 64kb.
- *
+ *
* @generated
**/
private Object[] getViewChildrenForMessage6EditPart(View view, Object parentElement) {
@@ -1804,26 +1811,26 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
source.addChildren(createNavigatorItems(connectedViews, source, true));
connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(DurationObservationEditPart.VISUAL_ID));
source.addChildren(createNavigatorItems(connectedViews, source, true));
- if(!target.isEmpty()) {
+ if (!target.isEmpty()) {
result.add(target);
}
- if(!incominglinks.isEmpty()) {
+ if (!incominglinks.isEmpty()) {
result.add(incominglinks);
}
- if(!source.isEmpty()) {
+ if (!source.isEmpty()) {
result.add(source);
}
- if(!outgoinglinks.isEmpty()) {
+ if (!outgoinglinks.isEmpty()) {
result.add(outgoinglinks);
}
return result.toArray();
}
/**
- *
+ *
* Papyrus Template this method is a modification of gmf code in order to avoid
* getViewChidreen() method becoming greater than 64kb.
- *
+ *
* @generated
**/
private Object[] getViewChildrenForMessage7EditPart(View view, Object parentElement) {
@@ -1908,26 +1915,26 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
source.addChildren(createNavigatorItems(connectedViews, source, true));
connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(DurationObservationEditPart.VISUAL_ID));
source.addChildren(createNavigatorItems(connectedViews, source, true));
- if(!target.isEmpty()) {
+ if (!target.isEmpty()) {
result.add(target);
}
- if(!incominglinks.isEmpty()) {
+ if (!incominglinks.isEmpty()) {
result.add(incominglinks);
}
- if(!source.isEmpty()) {
+ if (!source.isEmpty()) {
result.add(source);
}
- if(!outgoinglinks.isEmpty()) {
+ if (!outgoinglinks.isEmpty()) {
result.add(outgoinglinks);
}
return result.toArray();
}
/**
- *
+ *
* Papyrus Template
* this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
- *
+ *
* @generated
**/
private Object[] getViewChildrenForCommentAnnotatedElementEditPart(View view, Object parentElement) {
@@ -1974,20 +1981,20 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
target.addChildren(createNavigatorItems(connectedViews, target, true));
connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(CommentEditPart.VISUAL_ID));
source.addChildren(createNavigatorItems(connectedViews, source, true));
- if(!target.isEmpty()) {
+ if (!target.isEmpty()) {
result.add(target);
}
- if(!source.isEmpty()) {
+ if (!source.isEmpty()) {
result.add(source);
}
return result.toArray();
}
/**
- *
+ *
* Papyrus Template
* this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
- *
+ *
* @generated
**/
private Object[] getViewChildrenForDestructionOccurrenceSpecificationEditPart(View view, Object parentElement) {
@@ -2026,20 +2033,20 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
connectedViews = getIncomingLinksByType(Collections.singleton(view), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID));
incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
- if(!incominglinks.isEmpty()) {
+ if (!incominglinks.isEmpty()) {
result.add(incominglinks);
}
- if(!outgoinglinks.isEmpty()) {
+ if (!outgoinglinks.isEmpty()) {
result.add(outgoinglinks);
}
return result.toArray();
}
/**
- *
+ *
* Papyrus Template
* this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
- *
+ *
* @generated
**/
private Object[] getViewChildrenForConstraintConstrainedElementEditPart(View view, Object parentElement) {
@@ -2092,10 +2099,10 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
source.addChildren(createNavigatorItems(connectedViews, source, true));
connectedViews = getLinksSourceByType(Collections.singleton(view), UMLVisualIDRegistry.getType(DurationConstraintInMessageEditPart.VISUAL_ID));
source.addChildren(createNavigatorItems(connectedViews, source, true));
- if(!target.isEmpty()) {
+ if (!target.isEmpty()) {
result.add(target);
}
- if(!source.isEmpty()) {
+ if (!source.isEmpty()) {
result.add(source);
}
return result.toArray();
@@ -2104,21 +2111,23 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
/**
* @generated
*/
+ @Override
public void dispose() {
myWorkspaceSynchronizer.dispose();
myWorkspaceSynchronizer = null;
myViewerRefreshRunnable = null;
- for(Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
- Resource resource = (Resource)it.next();
+ for (Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
+ Resource resource = (Resource) it.next();
resource.unload();
}
- ((TransactionalEditingDomain)myEditingDomain).dispose();
+ ((TransactionalEditingDomain) myEditingDomain).dispose();
myEditingDomain = null;
}
/**
* @generated
*/
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
myViewer = viewer;
}
@@ -2126,6 +2135,7 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
/**
* @generated
*/
+ @Override
public Object[] getElements(Object inputElement) {
return getChildren(inputElement);
}
@@ -2133,40 +2143,44 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
/**
* @generated
*/
+ @Override
public void restoreState(IMemento aMemento) {
}
/**
* @generated
*/
+ @Override
public void saveState(IMemento aMemento) {
}
/**
* @generated
*/
+ @Override
public void init(ICommonContentExtensionSite aConfig) {
}
/**
* @generated
*/
+ @Override
public Object[] getChildren(Object parentElement) {
- if(parentElement instanceof IFile) {
- IFile file = (IFile)parentElement;
+ if (parentElement instanceof IFile) {
+ IFile file = (IFile) parentElement;
URI fileURI = URI.createPlatformResourceURI(file.getFullPath().toString(), true);
Resource resource = myEditingDomain.getResourceSet().getResource(fileURI, true);
Collection result = new ArrayList();
result.addAll(createNavigatorItems(selectViewsByType(resource.getContents(), PackageEditPart.MODEL_ID), file, false));
return result.toArray();
}
- if(parentElement instanceof UMLNavigatorGroup) {
- UMLNavigatorGroup group = (UMLNavigatorGroup)parentElement;
+ if (parentElement instanceof UMLNavigatorGroup) {
+ UMLNavigatorGroup group = (UMLNavigatorGroup) parentElement;
return group.getChildren();
}
- if(parentElement instanceof UMLNavigatorItem) {
- UMLNavigatorItem navigatorItem = (UMLNavigatorItem)parentElement;
- if(navigatorItem.isLeaf() || !isOwnView(navigatorItem.getView())) {
+ if (parentElement instanceof UMLNavigatorItem) {
+ UMLNavigatorItem navigatorItem = (UMLNavigatorItem) parentElement;
+ if (navigatorItem.isLeaf() || !isOwnView(navigatorItem.getView())) {
return EMPTY_ARRAY;
}
return getViewChildren(navigatorItem.getView(), parentElement);
@@ -2178,150 +2192,121 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
* @generated
*/
private Object[] getViewChildren(View view, Object parentElement) {
- switch(UMLVisualIDRegistry.getVisualID(view)) {
- case PackageEditPart.VISUAL_ID:
- {
- //modification of the template to avoid mistake of 65kb.
+ switch (UMLVisualIDRegistry.getVisualID(view)) {
+ case PackageEditPart.VISUAL_ID: {
+ // modification of the template to avoid mistake of 65kb.
return getViewChildrenForPackageEditPart(view, parentElement);
}
- case InteractionEditPart.VISUAL_ID:
- {
- //modification of the template to avoid mistake of 65kb.
+ case InteractionEditPart.VISUAL_ID: {
+ // modification of the template to avoid mistake of 65kb.
return getViewChildrenForInteractionEditPart(view, parentElement);
}
- case LifelineEditPart.VISUAL_ID:
- {
- //modification of the template to avoid mistake of 65kb.
+ case LifelineEditPart.VISUAL_ID: {
+ // modification of the template to avoid mistake of 65kb.
return getViewChildrenForLifelineEditPart(view, parentElement);
}
- case InteractionUseEditPart.VISUAL_ID:
- {
- //modification of the template to avoid mistake of 65kb.
+ case InteractionUseEditPart.VISUAL_ID: {
+ // modification of the template to avoid mistake of 65kb.
return getViewChildrenForInteractionUseEditPart(view, parentElement);
}
- case BehaviorExecutionSpecificationEditPart.VISUAL_ID:
- {
- //modification of the template to avoid mistake of 65kb.
+ case BehaviorExecutionSpecificationEditPart.VISUAL_ID: {
+ // modification of the template to avoid mistake of 65kb.
return getViewChildrenForBehaviorExecutionSpecificationEditPart(view, parentElement);
}
- case CombinedFragmentEditPart.VISUAL_ID:
- {
- //modification of the template to avoid mistake of 65kb.
+ case CombinedFragmentEditPart.VISUAL_ID: {
+ // modification of the template to avoid mistake of 65kb.
return getViewChildrenForCombinedFragmentEditPart(view, parentElement);
}
- case InteractionOperandEditPart.VISUAL_ID:
- {
- //modification of the template to avoid mistake of 65kb.
+ case InteractionOperandEditPart.VISUAL_ID: {
+ // modification of the template to avoid mistake of 65kb.
return getViewChildrenForInteractionOperandEditPart(view, parentElement);
}
- case ActionExecutionSpecificationEditPart.VISUAL_ID:
- {
- //modification of the template to avoid mistake of 65kb.
+ case ActionExecutionSpecificationEditPart.VISUAL_ID: {
+ // modification of the template to avoid mistake of 65kb.
return getViewChildrenForActionExecutionSpecificationEditPart(view, parentElement);
}
- case ConsiderIgnoreFragmentEditPart.VISUAL_ID:
- {
- //modification of the template to avoid mistake of 65kb.
+ case ConsiderIgnoreFragmentEditPart.VISUAL_ID: {
+ // modification of the template to avoid mistake of 65kb.
return getViewChildrenForConsiderIgnoreFragmentEditPart(view, parentElement);
}
- case ConstraintEditPart.VISUAL_ID:
- {
- //modification of the template to avoid mistake of 65kb.
+ case ConstraintEditPart.VISUAL_ID: {
+ // modification of the template to avoid mistake of 65kb.
return getViewChildrenForConstraintEditPart(view, parentElement);
}
- case CommentEditPart.VISUAL_ID:
- {
- //modification of the template to avoid mistake of 65kb.
+ case CommentEditPart.VISUAL_ID: {
+ // modification of the template to avoid mistake of 65kb.
return getViewChildrenForCommentEditPart(view, parentElement);
}
- case ContinuationEditPart.VISUAL_ID:
- {
- //modification of the template to avoid mistake of 65kb.
+ case ContinuationEditPart.VISUAL_ID: {
+ // modification of the template to avoid mistake of 65kb.
return getViewChildrenForContinuationEditPart(view, parentElement);
}
- case StateInvariantEditPart.VISUAL_ID:
- {
- //modification of the template to avoid mistake of 65kb.
+ case StateInvariantEditPart.VISUAL_ID: {
+ // modification of the template to avoid mistake of 65kb.
return getViewChildrenForStateInvariantEditPart(view, parentElement);
}
- case CombinedFragment2EditPart.VISUAL_ID:
- {
- //modification of the template to avoid mistake of 65kb.
+ case CombinedFragment2EditPart.VISUAL_ID: {
+ // modification of the template to avoid mistake of 65kb.
return getViewChildrenForCombinedFragment2EditPart(view, parentElement);
}
- case TimeConstraintEditPart.VISUAL_ID:
- {
- //modification of the template to avoid mistake of 65kb.
+ case TimeConstraintEditPart.VISUAL_ID: {
+ // modification of the template to avoid mistake of 65kb.
return getViewChildrenForTimeConstraintEditPart(view, parentElement);
}
- case TimeObservationEditPart.VISUAL_ID:
- {
- //modification of the template to avoid mistake of 65kb.
+ case TimeObservationEditPart.VISUAL_ID: {
+ // modification of the template to avoid mistake of 65kb.
return getViewChildrenForTimeObservationEditPart(view, parentElement);
}
- case DurationConstraintEditPart.VISUAL_ID:
- {
- //modification of the template to avoid mistake of 65kb.
+ case DurationConstraintEditPart.VISUAL_ID: {
+ // modification of the template to avoid mistake of 65kb.
return getViewChildrenForDurationConstraintEditPart(view, parentElement);
}
- case DestructionOccurrenceSpecificationEditPart.VISUAL_ID:
- {
- //modification of the template to avoid mistake of 65kb.
+ case DestructionOccurrenceSpecificationEditPart.VISUAL_ID: {
+ // modification of the template to avoid mistake of 65kb.
return getViewChildrenForDestructionOccurrenceSpecificationEditPart(view, parentElement);
}
- case DurationConstraintInMessageEditPart.VISUAL_ID:
- {
- //modification of the template to avoid mistake of 65kb.
+ case DurationConstraintInMessageEditPart.VISUAL_ID: {
+ // modification of the template to avoid mistake of 65kb.
return getViewChildrenForDurationConstraintInMessageEditPart(view, parentElement);
}
- case DurationObservationEditPart.VISUAL_ID:
- {
- //modification of the template to avoid mistake of 65kb.
+ case DurationObservationEditPart.VISUAL_ID: {
+ // modification of the template to avoid mistake of 65kb.
return getViewChildrenForDurationObservationEditPart(view, parentElement);
}
- case MessageEditPart.VISUAL_ID:
- {
- //modification of the template to avoid mistake of 65kb.
+ case MessageEditPart.VISUAL_ID: {
+ // modification of the template to avoid mistake of 65kb.
return getViewChildrenForMessageEditPart(view, parentElement);
}
- case Message2EditPart.VISUAL_ID:
- {
- //modification of the template to avoid mistake of 65kb.
+ case Message2EditPart.VISUAL_ID: {
+ // modification of the template to avoid mistake of 65kb.
return getViewChildrenForMessage2EditPart(view, parentElement);
}
- case Message3EditPart.VISUAL_ID:
- {
- //modification of the template to avoid mistake of 65kb.
+ case Message3EditPart.VISUAL_ID: {
+ // modification of the template to avoid mistake of 65kb.
return getViewChildrenForMessage3EditPart(view, parentElement);
}
- case Message4EditPart.VISUAL_ID:
- {
- //modification of the template to avoid mistake of 65kb.
+ case Message4EditPart.VISUAL_ID: {
+ // modification of the template to avoid mistake of 65kb.
return getViewChildrenForMessage4EditPart(view, parentElement);
}
- case Message5EditPart.VISUAL_ID:
- {
- //modification of the template to avoid mistake of 65kb.
+ case Message5EditPart.VISUAL_ID: {
+ // modification of the template to avoid mistake of 65kb.
return getViewChildrenForMessage5EditPart(view, parentElement);
}
- case Message6EditPart.VISUAL_ID:
- {
- //modification of the template to avoid mistake of 65kb.
+ case Message6EditPart.VISUAL_ID: {
+ // modification of the template to avoid mistake of 65kb.
return getViewChildrenForMessage6EditPart(view, parentElement);
}
- case Message7EditPart.VISUAL_ID:
- {
- //modification of the template to avoid mistake of 65kb.
+ case Message7EditPart.VISUAL_ID: {
+ // modification of the template to avoid mistake of 65kb.
return getViewChildrenForMessage7EditPart(view, parentElement);
}
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- {
- //modification of the template to avoid mistake of 65kb.
+ case CommentAnnotatedElementEditPart.VISUAL_ID: {
+ // modification of the template to avoid mistake of 65kb.
return getViewChildrenForCommentAnnotatedElementEditPart(view, parentElement);
}
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- {
- //modification of the template to avoid mistake of 65kb.
+ case ConstraintConstrainedElementEditPart.VISUAL_ID: {
+ // modification of the template to avoid mistake of 65kb.
return getViewChildrenForConstraintConstrainedElementEditPart(view, parentElement);
}
}
@@ -2333,10 +2318,10 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
*/
private Collection getLinksSourceByType(Collection edges, String type) {
Collection result = new ArrayList();
- for(Iterator it = edges.iterator(); it.hasNext();) {
- Edge nextEdge = (Edge)it.next();
+ for (Iterator it = edges.iterator(); it.hasNext();) {
+ Edge nextEdge = (Edge) it.next();
View nextEdgeSource = nextEdge.getSource();
- if(type.equals(nextEdgeSource.getType()) && isOwnView(nextEdgeSource)) {
+ if (type.equals(nextEdgeSource.getType()) && isOwnView(nextEdgeSource)) {
result.add(nextEdgeSource);
}
}
@@ -2348,10 +2333,10 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
*/
private Collection getLinksTargetByType(Collection edges, String type) {
Collection result = new ArrayList();
- for(Iterator it = edges.iterator(); it.hasNext();) {
- Edge nextEdge = (Edge)it.next();
+ for (Iterator it = edges.iterator(); it.hasNext();) {
+ Edge nextEdge = (Edge) it.next();
View nextEdgeTarget = nextEdge.getTarget();
- if(type.equals(nextEdgeTarget.getType()) && isOwnView(nextEdgeTarget)) {
+ if (type.equals(nextEdgeTarget.getType()) && isOwnView(nextEdgeTarget)) {
result.add(nextEdgeTarget);
}
}
@@ -2363,8 +2348,8 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
*/
private Collection getOutgoingLinksByType(Collection nodes, String type) {
Collection result = new ArrayList();
- for(Iterator it = nodes.iterator(); it.hasNext();) {
- View nextNode = (View)it.next();
+ for (Iterator it = nodes.iterator(); it.hasNext();) {
+ View nextNode = (View) it.next();
result.addAll(selectViewsByType(nextNode.getSourceEdges(), type));
}
return result;
@@ -2375,8 +2360,8 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
*/
private Collection getIncomingLinksByType(Collection nodes, String type) {
Collection result = new ArrayList();
- for(Iterator it = nodes.iterator(); it.hasNext();) {
- View nextNode = (View)it.next();
+ for (Iterator it = nodes.iterator(); it.hasNext();) {
+ View nextNode = (View) it.next();
result.addAll(selectViewsByType(nextNode.getTargetEdges(), type));
}
return result;
@@ -2387,8 +2372,8 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
*/
private Collection getChildrenByType(Collection nodes, String type) {
Collection result = new ArrayList();
- for(Iterator it = nodes.iterator(); it.hasNext();) {
- View nextNode = (View)it.next();
+ for (Iterator it = nodes.iterator(); it.hasNext();) {
+ View nextNode = (View) it.next();
result.addAll(selectViewsByType(nextNode.getChildren(), type));
}
return result;
@@ -2399,8 +2384,8 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
*/
private Collection getDiagramLinksByType(Collection diagrams, String type) {
Collection result = new ArrayList();
- for(Iterator it = diagrams.iterator(); it.hasNext();) {
- Diagram nextDiagram = (Diagram)it.next();
+ for (Iterator it = diagrams.iterator(); it.hasNext();) {
+ Diagram nextDiagram = (Diagram) it.next();
result.addAll(selectViewsByType(nextDiagram.getEdges(), type));
}
return result;
@@ -2411,9 +2396,9 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
*/
private Collection selectViewsByType(Collection views, String type) {
Collection result = new ArrayList();
- for(Iterator it = views.iterator(); it.hasNext();) {
- View nextView = (View)it.next();
- if(type.equals(nextView.getType()) && isOwnView(nextView)) {
+ for (Iterator it = views.iterator(); it.hasNext();) {
+ View nextView = (View) it.next();
+ if (type.equals(nextView.getType()) && isOwnView(nextView)) {
result.add(nextView);
}
}
@@ -2432,8 +2417,8 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
*/
private Collection createNavigatorItems(Collection views, Object parent, boolean isLeafs) {
Collection result = new ArrayList();
- for(Iterator it = views.iterator(); it.hasNext();) {
- result.add(new UMLNavigatorItem((View)it.next(), parent, isLeafs));
+ for (Iterator it = views.iterator(); it.hasNext();) {
+ result.add(new UMLNavigatorItem((View) it.next(), parent, isLeafs));
}
return result;
}
@@ -2441,9 +2426,10 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
/**
* @generated
*/
+ @Override
public Object getParent(Object element) {
- if(element instanceof UMLAbstractNavigatorItem) {
- UMLAbstractNavigatorItem abstractNavigatorItem = (UMLAbstractNavigatorItem)element;
+ if (element instanceof UMLAbstractNavigatorItem) {
+ UMLAbstractNavigatorItem abstractNavigatorItem = (UMLAbstractNavigatorItem) element;
return abstractNavigatorItem.getParent();
}
return null;
@@ -2452,6 +2438,7 @@ public class UMLNavigatorContentProvider implements ICommonContentProvider {
/**
* @generated
*/
+ @Override
public boolean hasChildren(Object element) {
return element instanceof IFile || getChildren(element).length > 0;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorGroup.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorGroup.java
index 8ec3c4e7a46..12991c8ff7e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorGroup.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorGroup.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -90,10 +90,11 @@ public class UMLNavigatorGroup extends UMLAbstractNavigatorItem {
/**
* @generated
*/
+ @Override
public boolean equals(Object obj) {
- if(obj instanceof org.eclipse.papyrus.uml.diagram.sequence.navigator.UMLNavigatorGroup) {
- org.eclipse.papyrus.uml.diagram.sequence.navigator.UMLNavigatorGroup anotherGroup = (org.eclipse.papyrus.uml.diagram.sequence.navigator.UMLNavigatorGroup)obj;
- if(getGroupName().equals(anotherGroup.getGroupName())) {
+ if (obj instanceof org.eclipse.papyrus.uml.diagram.sequence.navigator.UMLNavigatorGroup) {
+ org.eclipse.papyrus.uml.diagram.sequence.navigator.UMLNavigatorGroup anotherGroup = (org.eclipse.papyrus.uml.diagram.sequence.navigator.UMLNavigatorGroup) obj;
+ if (getGroupName().equals(anotherGroup.getGroupName())) {
return getParent().equals(anotherGroup.getParent());
}
}
@@ -103,6 +104,7 @@ public class UMLNavigatorGroup extends UMLAbstractNavigatorItem {
/**
* @generated
*/
+ @Override
public int hashCode() {
return getGroupName().hashCode();
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorItem.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorItem.java
index a6fa3c85f3e..360c6d1c438 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorItem.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorItem.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -28,16 +28,18 @@ public class UMLNavigatorItem extends UMLAbstractNavigatorItem {
* @generated
*/
static {
- final Class[] supportedTypes = new Class[]{ View.class, EObject.class };
+ final Class[] supportedTypes = new Class[] { View.class, EObject.class };
Platform.getAdapterManager().registerAdapters(new IAdapterFactory() {
+ @Override
public Object getAdapter(Object adaptableObject, Class adapterType) {
- if(adaptableObject instanceof org.eclipse.papyrus.uml.diagram.sequence.navigator.UMLNavigatorItem && (adapterType == View.class || adapterType == EObject.class)) {
- return ((org.eclipse.papyrus.uml.diagram.sequence.navigator.UMLNavigatorItem)adaptableObject).getView();
+ if (adaptableObject instanceof org.eclipse.papyrus.uml.diagram.sequence.navigator.UMLNavigatorItem && (adapterType == View.class || adapterType == EObject.class)) {
+ return ((org.eclipse.papyrus.uml.diagram.sequence.navigator.UMLNavigatorItem) adaptableObject).getView();
}
return null;
}
+ @Override
public Class[] getAdapterList() {
return supportedTypes;
}
@@ -80,9 +82,10 @@ public class UMLNavigatorItem extends UMLAbstractNavigatorItem {
/**
* @generated
*/
+ @Override
public boolean equals(Object obj) {
- if(obj instanceof org.eclipse.papyrus.uml.diagram.sequence.navigator.UMLNavigatorItem) {
- return EcoreUtil.getURI(getView()).equals(EcoreUtil.getURI(((org.eclipse.papyrus.uml.diagram.sequence.navigator.UMLNavigatorItem)obj).getView()));
+ if (obj instanceof org.eclipse.papyrus.uml.diagram.sequence.navigator.UMLNavigatorItem) {
+ return EcoreUtil.getURI(getView()).equals(EcoreUtil.getURI(((org.eclipse.papyrus.uml.diagram.sequence.navigator.UMLNavigatorItem) obj).getView()));
}
return super.equals(obj);
}
@@ -90,6 +93,7 @@ public class UMLNavigatorItem extends UMLAbstractNavigatorItem {
/**
* @generated
*/
+ @Override
public int hashCode() {
return EcoreUtil.getURI(getView()).hashCode();
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorLabelProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorLabelProvider.java
index 2a001366669..60746a142b1 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorLabelProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorLabelProvider.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -106,9 +106,10 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
/**
* @generated
*/
+ @Override
public void updateLabel(ViewerLabel label, TreePath elementPath) {
Object element = elementPath.getLastSegment();
- if(element instanceof UMLNavigatorItem && !isOwnView(((UMLNavigatorItem)element).getView())) {
+ if (element instanceof UMLNavigatorItem && !isOwnView(((UMLNavigatorItem) element).getView())) {
return;
}
label.setText(getText(element));
@@ -118,14 +119,15 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
/**
* @generated
*/
+ @Override
public Image getImage(Object element) {
- if(element instanceof UMLNavigatorGroup) {
- UMLNavigatorGroup group = (UMLNavigatorGroup)element;
+ if (element instanceof UMLNavigatorGroup) {
+ UMLNavigatorGroup group = (UMLNavigatorGroup) element;
return UMLDiagramEditorPlugin.getInstance().getBundledImage(group.getIcon());
}
- if(element instanceof UMLNavigatorItem) {
- UMLNavigatorItem navigatorItem = (UMLNavigatorItem)element;
- if(!isOwnView(navigatorItem.getView())) {
+ if (element instanceof UMLNavigatorItem) {
+ UMLNavigatorItem navigatorItem = (UMLNavigatorItem) element;
+ if (!isOwnView(navigatorItem.getView())) {
return super.getImage(element);
}
return getImage(navigatorItem.getView());
@@ -137,7 +139,7 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
* @generated
*/
public Image getImage(View view) {
- switch(UMLVisualIDRegistry.getVisualID(view)) {
+ switch (UMLVisualIDRegistry.getVisualID(view)) {
case PackageEditPart.VISUAL_ID:
return getImage("Navigator?Diagram?http://www.eclipse.org/uml2/5.0.0/UML?Package", UMLElementTypes.Package_1000); //$NON-NLS-1$
case InteractionEditPart.VISUAL_ID:
@@ -208,11 +210,11 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
private Image getImage(String key, IElementType elementType) {
ImageRegistry imageRegistry = UMLDiagramEditorPlugin.getInstance().getImageRegistry();
Image image = imageRegistry.get(key);
- if(image == null && elementType != null && UMLElementTypes.isKnownElementType(elementType)) {
+ if (image == null && elementType != null && UMLElementTypes.isKnownElementType(elementType)) {
image = UMLElementTypes.getImage(elementType);
imageRegistry.put(key, image);
}
- if(image == null) {
+ if (image == null) {
image = imageRegistry.get("Navigator?ImageNotFound"); //$NON-NLS-1$
imageRegistry.put(key, image);
}
@@ -222,14 +224,15 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
/**
* @generated
*/
+ @Override
public String getText(Object element) {
- if(element instanceof UMLNavigatorGroup) {
- UMLNavigatorGroup group = (UMLNavigatorGroup)element;
+ if (element instanceof UMLNavigatorGroup) {
+ UMLNavigatorGroup group = (UMLNavigatorGroup) element;
return group.getGroupName();
}
- if(element instanceof UMLNavigatorItem) {
- UMLNavigatorItem navigatorItem = (UMLNavigatorItem)element;
- if(!isOwnView(navigatorItem.getView())) {
+ if (element instanceof UMLNavigatorItem) {
+ UMLNavigatorItem navigatorItem = (UMLNavigatorItem) element;
+ if (!isOwnView(navigatorItem.getView())) {
return null;
}
return getText(navigatorItem.getView());
@@ -241,10 +244,10 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
* @generated
*/
public String getText(View view) {
- if(view.getElement() != null && view.getElement().eIsProxy()) {
+ if (view.getElement() != null && view.getElement().eIsProxy()) {
return getUnresolvedDomainElementProxyText(view);
}
- switch(UMLVisualIDRegistry.getVisualID(view)) {
+ switch (UMLVisualIDRegistry.getVisualID(view)) {
case PackageEditPart.VISUAL_ID:
return getPackage_1000Text(view);
case InteractionEditPart.VISUAL_ID:
@@ -313,8 +316,8 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
* @generated
*/
private String getPackage_1000Text(View view) {
- Package domainModelElement = (Package)view.getElement();
- if(domainModelElement != null) {
+ Package domainModelElement = (Package) view.getElement();
+ if (domainModelElement != null) {
return String.valueOf(domainModelElement.getName());
} else {
UMLDiagramEditorPlugin.getInstance().logError("No domain element for view with visualID = " + 1000); //$NON-NLS-1$
@@ -327,7 +330,7 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
*/
private String getInteraction_2001Text(View view) {
IParser parser = UMLParserProvider.getParser(UMLElementTypes.Interaction_2001, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(InteractionNameEditPart.VISUAL_ID));
- if(parser != null) {
+ if (parser != null) {
return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
} else {
UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5001); //$NON-NLS-1$
@@ -340,7 +343,7 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
*/
private String getLifeline_3001Text(View view) {
IParser parser = UMLParserProvider.getParser(UMLElementTypes.Lifeline_3001, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(LifelineNameEditPart.VISUAL_ID));
- if(parser != null) {
+ if (parser != null) {
return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
} else {
UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5002); //$NON-NLS-1$
@@ -352,8 +355,8 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
* @generated
*/
private String getBehaviorExecutionSpecification_3003Text(View view) {
- BehaviorExecutionSpecification domainModelElement = (BehaviorExecutionSpecification)view.getElement();
- if(domainModelElement != null) {
+ BehaviorExecutionSpecification domainModelElement = (BehaviorExecutionSpecification) view.getElement();
+ if (domainModelElement != null) {
return String.valueOf(domainModelElement.getName());
} else {
UMLDiagramEditorPlugin.getInstance().logError("No domain element for view with visualID = " + 3003); //$NON-NLS-1$
@@ -366,7 +369,7 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
*/
private String getStateInvariant_3017Text(View view) {
IParser parser = UMLParserProvider.getParser(UMLElementTypes.StateInvariant_3017, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(StateInvariantNameEditPart.VISUAL_ID));
- if(parser != null) {
+ if (parser != null) {
return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
} else {
UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5008); //$NON-NLS-1$
@@ -378,8 +381,8 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
* @generated
*/
private String getCombinedFragment_3018Text(View view) {
- CombinedFragment domainModelElement = (CombinedFragment)view.getElement();
- if(domainModelElement != null) {
+ CombinedFragment domainModelElement = (CombinedFragment) view.getElement();
+ if (domainModelElement != null) {
return String.valueOf(domainModelElement.getName());
} else {
UMLDiagramEditorPlugin.getInstance().logError("No domain element for view with visualID = " + 3018); //$NON-NLS-1$
@@ -392,7 +395,7 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
*/
private String getTimeConstraint_3019Text(View view) {
IParser parser = UMLParserProvider.getParser(UMLElementTypes.TimeConstraint_3019, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(TimeConstraintLabelEditPart.VISUAL_ID));
- if(parser != null) {
+ if (parser != null) {
return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
} else {
UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5009); //$NON-NLS-1$
@@ -405,7 +408,7 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
*/
private String getTimeObservation_3020Text(View view) {
IParser parser = UMLParserProvider.getParser(UMLElementTypes.TimeObservation_3020, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(TimeObservationLabelEditPart.VISUAL_ID));
- if(parser != null) {
+ if (parser != null) {
return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
} else {
UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5010); //$NON-NLS-1$
@@ -418,7 +421,7 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
*/
private String getDurationConstraint_3021Text(View view) {
IParser parser = UMLParserProvider.getParser(UMLElementTypes.DurationConstraint_3021, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(DurationConstraintLabelEditPart.VISUAL_ID));
- if(parser != null) {
+ if (parser != null) {
return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
} else {
UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5011); //$NON-NLS-1$
@@ -430,8 +433,8 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
* @generated
*/
private String getActionExecutionSpecification_3006Text(View view) {
- ActionExecutionSpecification domainModelElement = (ActionExecutionSpecification)view.getElement();
- if(domainModelElement != null) {
+ ActionExecutionSpecification domainModelElement = (ActionExecutionSpecification) view.getElement();
+ if (domainModelElement != null) {
return String.valueOf(domainModelElement.getName());
} else {
UMLDiagramEditorPlugin.getInstance().logError("No domain element for view with visualID = " + 3006); //$NON-NLS-1$
@@ -444,7 +447,7 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
*/
private String getInteractionUse_3002Text(View view) {
IParser parser = UMLParserProvider.getParser(UMLElementTypes.InteractionUse_3002, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(InteractionUseNameEditPart.VISUAL_ID));
- if(parser != null) {
+ if (parser != null) {
return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
} else {
UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5003); //$NON-NLS-1$
@@ -456,8 +459,8 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
* @generated
*/
private String getCombinedFragment_3004Text(View view) {
- CombinedFragment domainModelElement = (CombinedFragment)view.getElement();
- if(domainModelElement != null) {
+ CombinedFragment domainModelElement = (CombinedFragment) view.getElement();
+ if (domainModelElement != null) {
return String.valueOf(domainModelElement.getName());
} else {
UMLDiagramEditorPlugin.getInstance().logError("No domain element for view with visualID = " + 3004); //$NON-NLS-1$
@@ -469,8 +472,8 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
* @generated
*/
private String getInteractionOperand_3005Text(View view) {
- InteractionOperand domainModelElement = (InteractionOperand)view.getElement();
- if(domainModelElement != null) {
+ InteractionOperand domainModelElement = (InteractionOperand) view.getElement();
+ if (domainModelElement != null) {
return String.valueOf(domainModelElement.getName());
} else {
UMLDiagramEditorPlugin.getInstance().logError("No domain element for view with visualID = " + 3005); //$NON-NLS-1$
@@ -483,7 +486,7 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
*/
private String getContinuation_3016Text(View view) {
IParser parser = UMLParserProvider.getParser(UMLElementTypes.Continuation_3016, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(ContinuationNameEditPart.VISUAL_ID));
- if(parser != null) {
+ if (parser != null) {
return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
} else {
UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5007); //$NON-NLS-1$
@@ -496,7 +499,7 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
*/
private String getConstraint_3008Text(View view) {
IParser parser = UMLParserProvider.getParser(UMLElementTypes.Constraint_3008, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(ConstraintNameEditPart.VISUAL_ID));
- if(parser != null) {
+ if (parser != null) {
return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
} else {
UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5005); //$NON-NLS-1$
@@ -509,7 +512,7 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
*/
private String getComment_3009Text(View view) {
IParser parser = UMLParserProvider.getParser(UMLElementTypes.Comment_3009, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(CommentBodyEditPart.VISUAL_ID));
- if(parser != null) {
+ if (parser != null) {
return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
} else {
UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5006); //$NON-NLS-1$
@@ -522,7 +525,7 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
*/
private String getDurationConstraint_3023Text(View view) {
IParser parser = UMLParserProvider.getParser(UMLElementTypes.DurationConstraint_3023, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(DurationConstraintInMessageLabelEditPart.VISUAL_ID));
- if(parser != null) {
+ if (parser != null) {
return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
} else {
UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5018); //$NON-NLS-1$
@@ -535,7 +538,7 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
*/
private String getDurationObservation_3024Text(View view) {
IParser parser = UMLParserProvider.getParser(UMLElementTypes.DurationObservation_3024, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(DurationObservationLabelEditPart.VISUAL_ID));
- if(parser != null) {
+ if (parser != null) {
return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
} else {
UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5016); //$NON-NLS-1$
@@ -547,8 +550,8 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
* @generated
*/
private String getConsiderIgnoreFragment_3007Text(View view) {
- ConsiderIgnoreFragment domainModelElement = (ConsiderIgnoreFragment)view.getElement();
- if(domainModelElement != null) {
+ ConsiderIgnoreFragment domainModelElement = (ConsiderIgnoreFragment) view.getElement();
+ if (domainModelElement != null) {
return String.valueOf(domainModelElement.getName());
} else {
UMLDiagramEditorPlugin.getInstance().logError("No domain element for view with visualID = " + 3007); //$NON-NLS-1$
@@ -561,7 +564,7 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
*/
private String getMessage_4003Text(View view) {
IParser parser = UMLParserProvider.getParser(UMLElementTypes.Message_4003, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(MessageNameEditPart.VISUAL_ID));
- if(parser != null) {
+ if (parser != null) {
return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
} else {
UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 6001); //$NON-NLS-1$
@@ -574,7 +577,7 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
*/
private String getMessage_4004Text(View view) {
IParser parser = UMLParserProvider.getParser(UMLElementTypes.Message_4004, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(MessageName2EditPart.VISUAL_ID));
- if(parser != null) {
+ if (parser != null) {
return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
} else {
UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 6002); //$NON-NLS-1$
@@ -587,7 +590,7 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
*/
private String getMessage_4005Text(View view) {
IParser parser = UMLParserProvider.getParser(UMLElementTypes.Message_4005, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(MessageName3EditPart.VISUAL_ID));
- if(parser != null) {
+ if (parser != null) {
return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
} else {
UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 6003); //$NON-NLS-1$
@@ -600,7 +603,7 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
*/
private String getMessage_4006Text(View view) {
IParser parser = UMLParserProvider.getParser(UMLElementTypes.Message_4006, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(MessageName4EditPart.VISUAL_ID));
- if(parser != null) {
+ if (parser != null) {
return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
} else {
UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 6004); //$NON-NLS-1$
@@ -613,7 +616,7 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
*/
private String getMessage_4007Text(View view) {
IParser parser = UMLParserProvider.getParser(UMLElementTypes.Message_4007, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(MessageName5EditPart.VISUAL_ID));
- if(parser != null) {
+ if (parser != null) {
return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
} else {
UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 6005); //$NON-NLS-1$
@@ -626,7 +629,7 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
*/
private String getMessage_4008Text(View view) {
IParser parser = UMLParserProvider.getParser(UMLElementTypes.Message_4008, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(MessageName6EditPart.VISUAL_ID));
- if(parser != null) {
+ if (parser != null) {
return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
} else {
UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 6006); //$NON-NLS-1$
@@ -639,7 +642,7 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
*/
private String getMessage_4009Text(View view) {
IParser parser = UMLParserProvider.getParser(UMLElementTypes.Message_4009, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(MessageName7EditPart.VISUAL_ID));
- if(parser != null) {
+ if (parser != null) {
return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
} else {
UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 6007); //$NON-NLS-1$
@@ -658,8 +661,8 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
* @generated
*/
private String getDestructionOccurrenceSpecification_3022Text(View view) {
- DestructionOccurrenceSpecification domainModelElement = (DestructionOccurrenceSpecification)view.getElement();
- if(domainModelElement != null) {
+ DestructionOccurrenceSpecification domainModelElement = (DestructionOccurrenceSpecification) view.getElement();
+ if (domainModelElement != null) {
return String.valueOf(domainModelElement.getName());
} else {
UMLDiagramEditorPlugin.getInstance().logError("No domain element for view with visualID = " + 3022); //$NON-NLS-1$
@@ -672,7 +675,7 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
*/
private String getGeneralOrdering_4012Text(View view) {
IParser parser = UMLParserProvider.getParser(UMLElementTypes.GeneralOrdering_4012, view.getElement() != null ? view.getElement() : view, UMLVisualIDRegistry.getType(GeneralOrderingAppliedStereotypeEditPart.VISUAL_ID));
- if(parser != null) {
+ if (parser != null) {
return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
} else {
UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 6015); //$NON-NLS-1$
@@ -704,24 +707,28 @@ public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonL
/**
* @generated
*/
+ @Override
public void init(ICommonContentExtensionSite aConfig) {
}
/**
* @generated
*/
+ @Override
public void restoreState(IMemento aMemento) {
}
/**
* @generated
*/
+ @Override
public void saveState(IMemento aMemento) {
}
/**
* @generated
*/
+ @Override
public String getDescription(Object anElement) {
return null;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorLinkHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorLinkHelper.java
index 6c32021459c..424575c0c4e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorLinkHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorLinkHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -46,11 +46,11 @@ public class UMLNavigatorLinkHelper implements ILinkHelper {
*/
private static IEditorInput getEditorInput(Diagram diagram) {
Resource diagramResource = diagram.eResource();
- for(EObject nextEObject : diagramResource.getContents()) {
- if(nextEObject == diagram) {
+ for (EObject nextEObject : diagramResource.getContents()) {
+ if (nextEObject == diagram) {
return new FileEditorInput(WorkspaceSynchronizer.getFile(diagramResource));
}
- if(nextEObject instanceof Diagram) {
+ if (nextEObject instanceof Diagram) {
break;
}
}
@@ -63,17 +63,18 @@ public class UMLNavigatorLinkHelper implements ILinkHelper {
/**
* @generated
*/
+ @Override
public IStructuredSelection findSelection(IEditorInput anInput) {
IDiagramDocument document = UMLDiagramEditorPlugin.getInstance().getDocumentProvider().getDiagramDocument(anInput);
- if(document == null) {
+ if (document == null) {
return StructuredSelection.EMPTY;
}
Diagram diagram = document.getDiagram();
- if(diagram == null || diagram.eResource() == null) {
+ if (diagram == null || diagram.eResource() == null) {
return StructuredSelection.EMPTY;
}
IFile file = WorkspaceSynchronizer.getFile(diagram.eResource());
- if(file != null) {
+ if (file != null) {
UMLNavigatorItem item = new UMLNavigatorItem(diagram, file, false);
return new StructuredSelection(item);
}
@@ -83,42 +84,43 @@ public class UMLNavigatorLinkHelper implements ILinkHelper {
/**
* @generated
*/
+ @Override
public void activateEditor(IWorkbenchPage aPage, IStructuredSelection aSelection) {
- if(aSelection == null || aSelection.isEmpty()) {
+ if (aSelection == null || aSelection.isEmpty()) {
return;
}
- if(false == aSelection.getFirstElement() instanceof UMLAbstractNavigatorItem) {
+ if (false == aSelection.getFirstElement() instanceof UMLAbstractNavigatorItem) {
return;
}
- UMLAbstractNavigatorItem abstractNavigatorItem = (UMLAbstractNavigatorItem)aSelection.getFirstElement();
+ UMLAbstractNavigatorItem abstractNavigatorItem = (UMLAbstractNavigatorItem) aSelection.getFirstElement();
View navigatorView = null;
- if(abstractNavigatorItem instanceof UMLNavigatorItem) {
- navigatorView = ((UMLNavigatorItem)abstractNavigatorItem).getView();
- } else if(abstractNavigatorItem instanceof UMLNavigatorGroup) {
- UMLNavigatorGroup navigatorGroup = (UMLNavigatorGroup)abstractNavigatorItem;
- if(navigatorGroup.getParent() instanceof UMLNavigatorItem) {
- navigatorView = ((UMLNavigatorItem)navigatorGroup.getParent()).getView();
+ if (abstractNavigatorItem instanceof UMLNavigatorItem) {
+ navigatorView = ((UMLNavigatorItem) abstractNavigatorItem).getView();
+ } else if (abstractNavigatorItem instanceof UMLNavigatorGroup) {
+ UMLNavigatorGroup navigatorGroup = (UMLNavigatorGroup) abstractNavigatorItem;
+ if (navigatorGroup.getParent() instanceof UMLNavigatorItem) {
+ navigatorView = ((UMLNavigatorItem) navigatorGroup.getParent()).getView();
}
}
- if(navigatorView == null) {
+ if (navigatorView == null) {
return;
}
IEditorInput editorInput = getEditorInput(navigatorView.getDiagram());
IEditorPart editor = aPage.findEditor(editorInput);
- if(editor == null) {
+ if (editor == null) {
return;
}
aPage.bringToTop(editor);
- if(editor instanceof DiagramEditor) {
- DiagramEditor diagramEditor = (DiagramEditor)editor;
+ if (editor instanceof DiagramEditor) {
+ DiagramEditor diagramEditor = (DiagramEditor) editor;
ResourceSet diagramEditorResourceSet = diagramEditor.getEditingDomain().getResourceSet();
EObject selectedView = diagramEditorResourceSet.getEObject(EcoreUtil.getURI(navigatorView), true);
- if(selectedView == null) {
+ if (selectedView == null) {
return;
}
- GraphicalViewer graphicalViewer = (GraphicalViewer)diagramEditor.getAdapter(GraphicalViewer.class);
- EditPart selectedEditPart = (EditPart)graphicalViewer.getEditPartRegistry().get(selectedView);
- if(selectedEditPart != null) {
+ GraphicalViewer graphicalViewer = (GraphicalViewer) diagramEditor.getAdapter(GraphicalViewer.class);
+ EditPart selectedEditPart = (EditPart) graphicalViewer.getEditPartRegistry().get(selectedView);
+ if (selectedEditPart != null) {
graphicalViewer.select(selectedEditPart);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorSorter.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorSorter.java
index 5f5d6889e0d..4b7645d28c7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorSorter.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorSorter.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -29,9 +29,10 @@ public class UMLNavigatorSorter extends ViewerSorter {
/**
* @generated
*/
+ @Override
public int category(Object element) {
- if(element instanceof UMLNavigatorItem) {
- UMLNavigatorItem item = (UMLNavigatorItem)element;
+ if (element instanceof UMLNavigatorItem) {
+ UMLNavigatorItem item = (UMLNavigatorItem) element;
return UMLVisualIDRegistry.getVisualID(item.getView());
}
return GROUP_CATEGORY;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/parsers/AbstractParser.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/parsers/AbstractParser.java
index c3bd376e52e..c27cb7598a0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/parsers/AbstractParser.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/parsers/AbstractParser.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/parsers/MessageFormatParser.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/parsers/MessageFormatParser.java
index 25c25c01dcc..a7cd1ddb60c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/parsers/MessageFormatParser.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/parsers/MessageFormatParser.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -76,10 +76,10 @@ public class MessageFormatParser extends AbstractAttributeParser {
* @generated
*/
protected String getDefaultPattern() {
- if(defaultPattern == null) {
+ if (defaultPattern == null) {
StringBuffer sb = new StringBuffer();
- for(int i = 0; i < features.length; i++) {
- if(i > 0) {
+ for (int i = 0; i < features.length; i++) {
+ if (i > 0) {
sb.append(' ');
}
sb.append('{');
@@ -94,6 +94,7 @@ public class MessageFormatParser extends AbstractAttributeParser {
/**
* @generated
*/
+ @Override
public void setViewPattern(String viewPattern) {
super.setViewPattern(viewPattern);
viewProcessor = null;
@@ -102,6 +103,7 @@ public class MessageFormatParser extends AbstractAttributeParser {
/**
* @generated
*/
+ @Override
public void setEditorPattern(String editorPattern) {
super.setEditorPattern(editorPattern);
editorProcessor = null;
@@ -111,7 +113,7 @@ public class MessageFormatParser extends AbstractAttributeParser {
* @generated
*/
protected MessageFormat getViewProcessor() {
- if(viewProcessor == null) {
+ if (viewProcessor == null) {
viewProcessor = new MessageFormat(getViewPattern() == null ? getDefaultPattern() : getViewPattern());
}
return viewProcessor;
@@ -121,7 +123,7 @@ public class MessageFormatParser extends AbstractAttributeParser {
* @generated
*/
protected MessageFormat getEditorProcessor() {
- if(editorProcessor == null) {
+ if (editorProcessor == null) {
editorProcessor = new MessageFormat(getEditorPattern() == null ? getDefaultEditablePattern() : getEditorPattern());
}
return editorProcessor;
@@ -131,10 +133,10 @@ public class MessageFormatParser extends AbstractAttributeParser {
* @generated
*/
protected String getDefaultEditablePattern() {
- if(defaultEditablePattern == null) {
+ if (defaultEditablePattern == null) {
StringBuffer sb = new StringBuffer();
- for(int i = 0; i < editableFeatures.length; i++) {
- if(i > 0) {
+ for (int i = 0; i < editableFeatures.length; i++) {
+ if (i > 0) {
sb.append(' ');
}
sb.append('{');
@@ -149,6 +151,7 @@ public class MessageFormatParser extends AbstractAttributeParser {
/**
* @generated
*/
+ @Override
public void setEditPattern(String editPattern) {
super.setEditPattern(editPattern);
editProcessor = null;
@@ -158,7 +161,7 @@ public class MessageFormatParser extends AbstractAttributeParser {
* @generated
*/
protected MessageFormat getEditProcessor() {
- if(editProcessor == null) {
+ if (editProcessor == null) {
editProcessor = new MessageFormat(getEditPattern() == null ? getDefaultEditablePattern() : getEditPattern());
}
return editProcessor;
@@ -167,18 +170,20 @@ public class MessageFormatParser extends AbstractAttributeParser {
/**
* @generated
*/
+ @Override
public String getEditString(IAdaptable adapter, int flags) {
- EObject element = (EObject)adapter.getAdapter(EObject.class);
+ EObject element = (EObject) adapter.getAdapter(EObject.class);
return getEditorProcessor().format(getEditableValues(element), new StringBuffer(), new FieldPosition(0)).toString();
}
/**
* @generated
*/
+ @Override
public IParserEditStatus isValidEditString(IAdaptable adapter, String editString) {
ParsePosition pos = new ParsePosition(0);
Object[] values = getEditProcessor().parse(editString, pos);
- if(values == null) {
+ if (values == null) {
return new ParserEditStatus(UMLDiagramEditorPlugin.ID, IParserEditStatus.UNEDITABLE, NLS.bind(Messages.MessageFormatParser_InvalidInputError, new Integer(pos.getErrorIndex())));
}
return validateNewValues(values);
@@ -187,6 +192,7 @@ public class MessageFormatParser extends AbstractAttributeParser {
/**
* @generated
*/
+ @Override
public ICommand getParseCommand(IAdaptable adapter, String newString, int flags) {
Object[] values = getEditProcessor().parse(newString, new ParsePosition(0));
return getParseCommand(adapter, values, flags);
@@ -195,8 +201,9 @@ public class MessageFormatParser extends AbstractAttributeParser {
/**
* @generated
*/
+ @Override
public String getPrintString(IAdaptable adapter, int flags) {
- EObject element = (EObject)adapter.getAdapter(EObject.class);
+ EObject element = (EObject) adapter.getAdapter(EObject.class);
return getViewProcessor().format(getValues(element), new StringBuffer(), new FieldPosition(0)).toString();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/DeleteElementAction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/DeleteElementAction.java
index 48ee7a51827..727ee82de37 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/DeleteElementAction.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/DeleteElementAction.java
@@ -1,4 +1,4 @@
package org.eclipse.papyrus.uml.diagram.sequence.part;
-//This file is not used.
-//The DeleteElementAction is removed from the plugin and replaced by DeleteFromModelAction in the plugin org.eclipse.diagram.common.
+//This file is not used.
+// The DeleteElementAction is removed from the plugin and replaced by DeleteFromModelAction in the plugin org.eclipse.diagram.common.
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/DiagramEditorContextMenuProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/DiagramEditorContextMenuProvider.java
index 5123740b2be..619df17ce80 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/DiagramEditorContextMenuProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/DiagramEditorContextMenuProvider.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -43,11 +43,13 @@ public class DiagramEditorContextMenuProvider extends DiagramContextMenuProvider
/**
* @generated
*/
+ @Override
public void buildContextMenu(final IMenuManager menu) {
getViewer().flush();
try {
- TransactionUtil.getEditingDomain((EObject)getViewer().getContents().getModel()).runExclusive(new Runnable() {
+ TransactionUtil.getEditingDomain((EObject) getViewer().getContents().getModel()).runExclusive(new Runnable() {
+ @Override
public void run() {
ContributionItemService.getInstance().contributeToPopupMenu(DiagramEditorContextMenuProvider.this, part);
menu.remove(ActionIds.ACTION_DELETE_FROM_MODEL);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/LoadResourceAction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/LoadResourceAction.java
index 32321ef3eae..311a941be03 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/LoadResourceAction.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/LoadResourceAction.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -25,6 +25,7 @@ public class LoadResourceAction extends DefaultLoadResourceAction {
/**
* @generated
*/
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
return super.execute(event);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/Messages.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/Messages.java
index 1a12e864901..b124b7abf21 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/Messages.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/Messages.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/ModelElementSelectionPage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/ModelElementSelectionPage.java
index d906f7911f3..65b4a22fae0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/ModelElementSelectionPage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/ModelElementSelectionPage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -17,7 +17,7 @@ import org.eclipse.gmf.tooling.runtime.part.DefaultModelElementSelectionPage;
/**
* Wizard page that allows to select element from model.
- *
+ *
* @generated
*/
public class ModelElementSelectionPage extends DefaultModelElementSelectionPage {
@@ -31,9 +31,10 @@ public class ModelElementSelectionPage extends DefaultModelElementSelectionPage
/**
* Override to provide custom model element description.
- *
+ *
* @generated
*/
+ @Override
protected String getSelectionTitle() {
return Messages.ModelElementSelectionPageMessage;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLCreationWizard.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLCreationWizard.java
index d24e1921fbd..de7470e744d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLCreationWizard.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLCreationWizard.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -100,6 +100,7 @@ public class UMLCreationWizard extends Wizard implements INewWizard {
/**
* @generated
*/
+ @Override
public void init(IWorkbench workbench, IStructuredSelection selection) {
this.workbench = workbench;
this.selection = selection;
@@ -111,6 +112,7 @@ public class UMLCreationWizard extends Wizard implements INewWizard {
/**
* @generated
*/
+ @Override
public void addPages() {
diagramModelFilePage = new UMLCreationWizardPage("DiagramModelFile", getSelection(), "PapyrusUMLSequence_diagram"); //$NON-NLS-1$ //$NON-NLS-2$
diagramModelFilePage.setTitle(Messages.UMLCreationWizard_DiagramModelFilePageTitle);
@@ -118,8 +120,9 @@ public class UMLCreationWizard extends Wizard implements INewWizard {
addPage(diagramModelFilePage);
domainModelFilePage = new UMLCreationWizardPage("DomainModelFile", getSelection(), "PapyrusUMLSequence") { //$NON-NLS-1$ //$NON-NLS-2$
+ @Override
public void setVisible(boolean visible) {
- if(visible) {
+ if (visible) {
String fileName = diagramModelFilePage.getFileName();
fileName = fileName.substring(0, fileName.length() - ".PapyrusUMLSequence_diagram".length()); //$NON-NLS-1$
setFileName(UMLDiagramEditorUtil.getUniqueFileName(getContainerFullPath(), fileName, "PapyrusUMLSequence")); //$NON-NLS-1$
@@ -135,12 +138,14 @@ public class UMLCreationWizard extends Wizard implements INewWizard {
/**
* @generated
*/
+ @Override
public boolean performFinish() {
IRunnableWithProgress op = new WorkspaceModifyOperation(null) {
+ @Override
protected void execute(IProgressMonitor monitor) throws CoreException, InterruptedException {
diagram = UMLDiagramEditorUtil.createDiagram(diagramModelFilePage.getURI(), domainModelFilePage.getURI(), monitor);
- if(isOpenNewlyCreatedDiagramEditor() && diagram != null) {
+ if (isOpenNewlyCreatedDiagramEditor() && diagram != null) {
try {
UMLDiagramEditorUtil.openDiagram(diagram);
} catch (PartInitException e) {
@@ -154,8 +159,8 @@ public class UMLCreationWizard extends Wizard implements INewWizard {
} catch (InterruptedException e) {
return false;
} catch (InvocationTargetException e) {
- if(e.getTargetException() instanceof CoreException) {
- ErrorDialog.openError(getContainer().getShell(), Messages.UMLCreationWizardCreationError, null, ((CoreException)e.getTargetException()).getStatus());
+ if (e.getTargetException() instanceof CoreException) {
+ ErrorDialog.openError(getContainer().getShell(), Messages.UMLCreationWizardCreationError, null, ((CoreException) e.getTargetException()).getStatus());
} else {
UMLDiagramEditorPlugin.getInstance().logError("Error creating diagram", e.getTargetException()); //$NON-NLS-1$
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLCreationWizardPage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLCreationWizardPage.java
index d7d12ac356f..34ef5a02621 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLCreationWizardPage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLCreationWizardPage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -41,7 +41,7 @@ public class UMLCreationWizardPage extends WizardNewFileCreationPage {
/**
* Override to create files with this extension.
- *
+ *
* @generated
*/
protected String getExtension() {
@@ -60,11 +60,11 @@ public class UMLCreationWizardPage extends WizardNewFileCreationPage {
*/
protected IPath getFilePath() {
IPath path = getContainerFullPath();
- if(path == null) {
+ if (path == null) {
path = new Path(""); //$NON-NLS-1$
}
String fileName = getFileName();
- if(fileName != null) {
+ if (fileName != null) {
path = path.append(fileName);
}
return path;
@@ -73,6 +73,7 @@ public class UMLCreationWizardPage extends WizardNewFileCreationPage {
/**
* @generated
*/
+ @Override
public void createControl(Composite parent) {
super.createControl(parent);
setFileName(UMLDiagramEditorUtil.getUniqueFileName(getContainerFullPath(), getFileName(), getExtension()));
@@ -82,12 +83,13 @@ public class UMLCreationWizardPage extends WizardNewFileCreationPage {
/**
* @generated
*/
+ @Override
protected boolean validatePage() {
- if(!super.validatePage()) {
+ if (!super.validatePage()) {
return false;
}
String extension = getExtension();
- if(extension != null && !getFilePath().toString().endsWith("." + extension)) {
+ if (extension != null && !getFilePath().toString().endsWith("." + extension)) {
setErrorMessage(NLS.bind(Messages.UMLCreationWizardPageExtensionError, extension));
return false;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramActionBarContributor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramActionBarContributor.java
index aa4fe69c5ac..aa53d1a6f4c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramActionBarContributor.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramActionBarContributor.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -29,6 +29,7 @@ public class UMLDiagramActionBarContributor extends DiagramActionBarContributor
/**
* @generated
*/
+ @Override
protected Class getEditorClass() {
return UMLDiagramEditor.class;
}
@@ -36,6 +37,7 @@ public class UMLDiagramActionBarContributor extends DiagramActionBarContributor
/**
* @generated
*/
+ @Override
protected String getEditorId() {
return UMLDiagramEditor.ID;
}
@@ -43,6 +45,7 @@ public class UMLDiagramActionBarContributor extends DiagramActionBarContributor
/**
* @generated
*/
+ @Override
public void init(IActionBars bars, IWorkbenchPage page) {
super.init(bars, page);
// print preview
@@ -51,7 +54,7 @@ public class UMLDiagramActionBarContributor extends DiagramActionBarContributor
fileMenu.remove("pageSetupAction"); //$NON-NLS-1$
IMenuManager editMenu = bars.getMenuManager().findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
assert editMenu != null;
- if(editMenu.find("validationGroup") == null) { //$NON-NLS-1$
+ if (editMenu.find("validationGroup") == null) { //$NON-NLS-1$
editMenu.add(new GroupMarker("validationGroup")); //$NON-NLS-1$
}
IAction validateAction = new ValidateAction(page);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramEditor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramEditor.java
index 8deefe4168a..37721077936 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramEditor.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramEditor.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -134,7 +134,7 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
@Override
protected PaletteRoot createPaletteRoot(PaletteRoot existingPaletteRoot) {
PaletteRoot paletteRoot;
- if(existingPaletteRoot == null) {
+ if (existingPaletteRoot == null) {
paletteRoot = PapyrusPaletteService.getInstance().createPalette(this, getDefaultPaletteContent());
} else {
PapyrusPaletteService.getInstance().updatePalette(existingPaletteRoot, this, getDefaultPaletteContent());
@@ -165,11 +165,12 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
*/
@Override
public Object getAdapter(Class type) {
- if(type == IShowInTargetList.class) {
+ if (type == IShowInTargetList.class) {
return new IShowInTargetList() {
+ @Override
public String[] getShowInTargetIds() {
- return new String[]{ ProjectExplorer.VIEW_ID };
+ return new String[] { ProjectExplorer.VIEW_ID };
}
};
}
@@ -203,6 +204,7 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
/**
* @generated
*/
+ @Override
public void gotoMarker(IMarker marker) {
MarkerNavigationService.getInstance().gotoMarker(this, marker);
}
@@ -244,15 +246,15 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
*/
private ISelection getNavigatorSelection() {
IDiagramDocument document = getDiagramDocument();
- if(document == null) {
+ if (document == null) {
return StructuredSelection.EMPTY;
}
Diagram diagram = document.getDiagram();
- if(diagram == null || diagram.eResource() == null) {
+ if (diagram == null || diagram.eResource() == null) {
return StructuredSelection.EMPTY;
}
IFile file = WorkspaceSynchronizer.getFile(diagram.eResource());
- if(file != null) {
+ if (file != null) {
UMLNavigatorItem item = new UMLNavigatorItem(diagram, file, false);
return new StructuredSelection(item);
}
@@ -273,6 +275,7 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
/**
* @generated
*/
+ @Override
protected TransactionalEditingDomain createEditingDomain() {
// Already configured
return editingDomain;
@@ -281,10 +284,12 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
/**
* @generated
*/
+ @Override
protected void configureDiagramEditDomain() {
super.configureDiagramEditDomain();
getDiagramEditDomain().getDiagramCommandStack().addCommandStackListener(new CommandStackListener() {
+ @Override
public void commandStackChanged(EventObject event) {
firePropertyChange(IEditorPart.PROP_DIRTY);
}
@@ -294,6 +299,7 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
/**
* @generated
*/
+ @Override
public void doSave(IProgressMonitor progressMonitor) {
// The saving of the resource is done by the CoreMultiDiagramEditor
getDirtyState().saved();
@@ -303,7 +309,7 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
* @generated
*/
protected OperationHistoryDirtyState getDirtyState() {
- if(dirtyState == null) {
+ if (dirtyState == null) {
dirtyState = OperationHistoryDirtyState.newInstance(getUndoContext(), getOperationHistory());
}
return dirtyState;
@@ -314,17 +320,18 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
*/
@Override
protected void setUndoContext(IUndoContext context) {
- if(dirtyState != null) {
+ if (dirtyState != null) {
dirtyState.dispose();
dirtyState = null;
}
-
+
super.setUndoContext(context);
}
-
+
/**
* @generated
*/
+ @Override
public boolean isDirty() {
return getDirtyState().isDirty();
}
@@ -332,9 +339,10 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
/**
* @generated
*/
+ @Override
public void providerChanged(ProviderChangeEvent event) {
// update the palette if the palette service has changed
- if(PapyrusPaletteService.getInstance().equals(event.getSource())) {
+ if (PapyrusPaletteService.getInstance().equals(event.getSource())) {
PapyrusPaletteService.getInstance().updatePalette(getPaletteViewer().getPaletteRoot(), this, getDefaultPaletteContent());
}
}
@@ -348,11 +356,11 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
// remove preference listener
PapyrusPaletteService.getInstance().removeProviderChangeListener(this);
- if(dirtyState != null) {
+ if (dirtyState != null) {
dirtyState.dispose();
dirtyState = null;
}
-
+
super.dispose();
}
@@ -386,6 +394,7 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
* with a defaultTool that is the SelectToolEx that undestands how to handle the enter
* key which will result in the creation of the shape also.
*/
+ @Override
protected void configurePaletteViewer(PaletteViewer viewer) {
super.configurePaletteViewer(viewer);
// customize menu...
@@ -400,6 +409,7 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
viewer.setCustomizer(createPaletteCustomizer());
}
+ @Override
public PaletteViewer createPaletteViewer(Composite parent) {
PaletteViewer pViewer = constructPaletteViewer();
pViewer.createControl(parent);
@@ -412,7 +422,7 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
* @return Palette Key Handler for the palette
*/
private KeyHandler getPaletteKeyHandler() {
- if(paletteKeyHandler == null) {
+ if (paletteKeyHandler == null) {
paletteKeyHandler = new KeyHandler() {
/**
@@ -420,15 +430,16 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
* whenever a key is released, and the Tool is in the proper state. Override
* to support pressing the enter key to create a shape or connection
* (between two selected shapes)
- *
+ *
* @param event
- * the KeyEvent
+ * the KeyEvent
* @return <code>true</code> if KeyEvent was handled in some way
*/
+ @Override
public boolean keyReleased(KeyEvent event) {
- if(event.keyCode == SWT.Selection) {
+ if (event.keyCode == SWT.Selection) {
Tool tool = getPaletteViewer().getActiveTool().createTool();
- if(toolSupportsAccessibility(tool)) {
+ if (toolSupportsAccessibility(tool)) {
tool.keyUp(event, getDiagramGraphicalViewer());
// deactivate current selection
getPaletteViewer().setActiveTool(null);
@@ -446,7 +457,7 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
* @return Palette Mouse listener for the palette
*/
private MouseListener getPaletteMouseListener() {
- if(paletteMouseListener == null) {
+ if (paletteMouseListener == null) {
paletteMouseListener = new MouseListener() {
/**
@@ -458,12 +469,13 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
/**
* Override to support double-clicking a palette tool entry to create a
* shape or connection (between two selected shapes).
- *
+ *
* @see MouseListener#mouseDoubleClick(MouseEvent)
*/
+ @Override
public void mouseDoubleClick(MouseEvent e) {
Tool tool = getPaletteViewer().getActiveTool().createTool();
- if(toolSupportsAccessibility(tool)) {
+ if (toolSupportsAccessibility(tool)) {
tool.setViewer(getDiagramGraphicalViewer());
tool.setEditDomain(getDiagramGraphicalViewer().getEditDomain());
tool.mouseDoubleClick(e, getDiagramGraphicalViewer());
@@ -475,14 +487,16 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
}
}
+ @Override
public void mouseDown(MouseEvent e) {
// do nothing
}
+ @Override
public void mouseUp(MouseEvent e) {
// Deactivate current active tool here if a
// double-click was handled.
- if(clearActiveTool) {
+ if (clearActiveTool) {
getPaletteViewer().setActiveTool(null);
clearActiveTool = false;
}
@@ -528,10 +542,10 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
*/
@Override
public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- if(getSite().getPage().getActiveEditor() instanceof IMultiDiagramEditor) {
- IMultiDiagramEditor editor = (IMultiDiagramEditor)getSite().getPage().getActiveEditor();
+ if (getSite().getPage().getActiveEditor() instanceof IMultiDiagramEditor) {
+ IMultiDiagramEditor editor = (IMultiDiagramEditor) getSite().getPage().getActiveEditor();
// If not the active editor, ignore selection changed.
- if(this.equals(editor.getActiveEditor())) {
+ if (this.equals(editor.getActiveEditor())) {
updateActions(getSelectionActions());
super.selectionChanged(part, selection);
} else {
@@ -543,7 +557,7 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
// from
// org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor.selectionChanged(IWorkbenchPart,
// ISelection)
- if(part == this) {
+ if (part == this) {
rebuildStatusLine();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramEditorPlugin.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramEditorPlugin.java
index 0fc727225c1..be47008f75c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramEditorPlugin.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramEditorPlugin.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009, 2014 Atos Origin, CEA, 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
@@ -91,7 +91,7 @@ public class UMLDiagramEditorPlugin extends AbstractUIPlugin {
/**
* It is no more generated to initialize the log.
- *
+ *
* @generated NOT
*/
@Override
@@ -145,8 +145,8 @@ public class UMLDiagramEditorPlugin extends AbstractUIPlugin {
* @generated
*/
public ImageDescriptor getItemImageDescriptor(Object item) {
- IItemLabelProvider labelProvider = (IItemLabelProvider)adapterFactory.adapt(item, IItemLabelProvider.class);
- if(labelProvider != null) {
+ IItemLabelProvider labelProvider = (IItemLabelProvider) adapterFactory.adapt(item, IItemLabelProvider.class);
+ if (labelProvider != null) {
return ExtendedImageRegistry.getInstance().getImageDescriptor(labelProvider.getImage(item));
}
return null;
@@ -154,10 +154,10 @@ public class UMLDiagramEditorPlugin extends AbstractUIPlugin {
/**
* Returns an image descriptor for the image file at the given plug-in relative path.
- *
+ *
* @generated
* @param path
- * the path
+ * the path
* @return the image descriptor
*/
public static ImageDescriptor getBundledImageDescriptor(String path) {
@@ -168,16 +168,16 @@ public class UMLDiagramEditorPlugin extends AbstractUIPlugin {
* Respects images residing in any plug-in. If path is relative, then this bundle is looked up
* for the image, otherwise, for absolute path, first segment is taken as id of plug-in with
* image
- *
+ *
* @generated
* @param path
- * the path to image, either absolute (with plug-in id as first segment), or relative
- * for bundled images
+ * the path to image, either absolute (with plug-in id as first segment), or relative
+ * for bundled images
* @return the image descriptor
*/
public static ImageDescriptor findImageDescriptor(String path) {
final IPath p = new Path(path);
- if(p.isAbsolute() && p.segmentCount() > 1) {
+ if (p.isAbsolute() && p.segmentCount() > 1) {
return AbstractUIPlugin.imageDescriptorFromPlugin(p.segment(0), p.removeFirstSegments(1).makeAbsolute().toString());
} else {
return getBundledImageDescriptor(p.makeAbsolute().toString());
@@ -187,15 +187,15 @@ public class UMLDiagramEditorPlugin extends AbstractUIPlugin {
/**
* Returns an image for the image file at the given plug-in relative path. Client do not need to
* dispose this image. Images will be disposed automatically.
- *
+ *
* @generated
* @param path
- * the path
+ * the path
* @return image instance
*/
public Image getBundledImage(String path) {
Image image = getImageRegistry().get(path);
- if(image == null) {
+ if (image == null) {
getImageRegistry().put(path, getBundledImageDescriptor(path));
image = getImageRegistry().get(path);
}
@@ -204,7 +204,7 @@ public class UMLDiagramEditorPlugin extends AbstractUIPlugin {
/**
* Returns string from plug-in's resource bundle
- *
+ *
* @generated
*/
public static String getString(String key) {
@@ -215,7 +215,7 @@ public class UMLDiagramEditorPlugin extends AbstractUIPlugin {
* @generated
*/
public UMLDocumentProvider getDocumentProvider() {
- if(documentProvider == null) {
+ if (documentProvider == null) {
documentProvider = new UMLDocumentProvider();
}
return documentProvider;
@@ -274,7 +274,7 @@ public class UMLDiagramEditorPlugin extends AbstractUIPlugin {
* @generated
*/
public void logError(String error, Throwable throwable) {
- if(error == null && throwable != null) {
+ if (error == null && throwable != null) {
error = throwable.getMessage();
}
getLog().log(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, IStatus.OK, error, throwable));
@@ -292,7 +292,7 @@ public class UMLDiagramEditorPlugin extends AbstractUIPlugin {
* @generated
*/
public void logInfo(String message, Throwable throwable) {
- if(message == null && throwable != null) {
+ if (message == null && throwable != null) {
message = throwable.getMessage();
}
getLog().log(new Status(IStatus.INFO, UMLDiagramEditorPlugin.ID, IStatus.OK, message, throwable));
@@ -303,13 +303,13 @@ public class UMLDiagramEditorPlugin extends AbstractUIPlugin {
* @generated
*/
private void debug(String message, Throwable throwable) {
- if(!isDebugging()) {
+ if (!isDebugging()) {
return;
}
- if(message != null) {
+ if (message != null) {
System.err.println(message);
}
- if(throwable != null) {
+ if (throwable != null) {
throwable.printStackTrace();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramEditorUtil.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramEditorUtil.java
index 569a423b05d..b4a9fe04ab0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramEditorUtil.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramEditorUtil.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -39,6 +39,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.xmi.XMLResource;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.workspace.WorkspaceEditingDomainFactory;
import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
import org.eclipse.gef.EditPart;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
@@ -87,9 +88,9 @@ public class UMLDiagramEditorUtil {
public static boolean openDiagram(Resource diagram) throws PartInitException {
String path = diagram.getURI().toPlatformString(true);
IResource workspaceResource = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(path));
- if(workspaceResource instanceof IFile) {
+ if (workspaceResource instanceof IFile) {
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- return null != page.openEditor(new FileEditorInput((IFile)workspaceResource), UMLDiagramEditor.ID);
+ return null != page.openEditor(new FileEditorInput((IFile) workspaceResource), UMLDiagramEditor.ID);
}
return false;
}
@@ -98,7 +99,7 @@ public class UMLDiagramEditorUtil {
* @generated
*/
public static void setCharset(IFile file) {
- if(file == null) {
+ if (file == null) {
return;
}
try {
@@ -117,13 +118,13 @@ public class UMLDiagramEditorUtil {
/**
* Runs the wizard in a dialog.
- *
+ *
* @generated
*/
public static void runWizard(Shell shell, Wizard wizard, String settingsKey) {
IDialogSettings pluginDialogSettings = UMLDiagramEditorPlugin.getInstance().getDialogSettings();
IDialogSettings wizardDialogSettings = pluginDialogSettings.getSection(settingsKey);
- if(wizardDialogSettings == null) {
+ if (wizardDialogSettings == null) {
wizardDialogSettings = pluginDialogSettings.addNewSection(settingsKey);
}
wizard.setDialogSettings(wizardDialogSettings);
@@ -135,22 +136,23 @@ public class UMLDiagramEditorUtil {
/**
* This method should be called within a workspace modify operation since it creates resources.
- *
+ *
* @generated
*/
public static Resource createDiagram(URI diagramURI, URI modelURI, IProgressMonitor progressMonitor) {
- TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE.createEditingDomain();
+ TransactionalEditingDomain editingDomain = WorkspaceEditingDomainFactory.INSTANCE.createEditingDomain();
progressMonitor.beginTask(Messages.UMLDiagramEditorUtil_CreateDiagramProgressTask, 3);
final Resource diagramResource = editingDomain.getResourceSet().createResource(diagramURI);
final Resource modelResource = editingDomain.getResourceSet().createResource(modelURI);
final String diagramName = diagramURI.lastSegment();
AbstractTransactionalCommand command = new AbstractTransactionalCommand(editingDomain, Messages.UMLDiagramEditorUtil_CreateDiagramCommandLabel, Collections.EMPTY_LIST) {
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
Package model = createInitialModel();
attachModelToResource(model, modelResource);
Diagram diagram = ViewService.createDiagram(model, PackageEditPart.MODEL_ID, UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- if(diagram != null) {
+ if (diagram != null) {
diagramResource.getContents().add(diagram);
diagram.setName(diagramName);
diagram.setElement(model);
@@ -178,7 +180,7 @@ public class UMLDiagramEditorUtil {
* Create a new instance of domain element associated with canvas.
* <!-- begin-user-doc --> <!--
* end-user-doc -->
- *
+ *
* @generated
*/
private static Package createInitialModel() {
@@ -188,7 +190,7 @@ public class UMLDiagramEditorUtil {
/**
* Store model element in the resource.
* <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
private static void attachModelToResource(Package model, Resource resource) {
@@ -201,14 +203,14 @@ public class UMLDiagramEditorUtil {
public static void selectElementsInDiagram(IDiagramWorkbenchPart diagramPart, List<EditPart> editParts) {
diagramPart.getDiagramGraphicalViewer().deselectAll();
EditPart firstPrimary = null;
- for(EditPart nextPart : editParts) {
+ for (EditPart nextPart : editParts) {
diagramPart.getDiagramGraphicalViewer().appendSelection(nextPart);
- if(firstPrimary == null && nextPart instanceof IPrimaryEditPart) {
+ if (firstPrimary == null && nextPart instanceof IPrimaryEditPart) {
firstPrimary = nextPart;
}
}
- if(!editParts.isEmpty()) {
- diagramPart.getDiagramGraphicalViewer().reveal(firstPrimary != null ? firstPrimary : (EditPart)editParts.get(0));
+ if (!editParts.isEmpty()) {
+ diagramPart.getDiagramGraphicalViewer().reveal(firstPrimary != null ? firstPrimary : (EditPart) editParts.get(0));
}
}
@@ -216,11 +218,11 @@ public class UMLDiagramEditorUtil {
* @generated
*/
private static int findElementsInDiagramByID(DiagramEditPart diagramPart, EObject element, List<EditPart> editPartCollector) {
- IDiagramGraphicalViewer viewer = (IDiagramGraphicalViewer)diagramPart.getViewer();
+ IDiagramGraphicalViewer viewer = (IDiagramGraphicalViewer) diagramPart.getViewer();
final int intialNumOfEditParts = editPartCollector.size();
- if(element instanceof View) { // support notation element lookup
- EditPart editPart = (EditPart)viewer.getEditPartRegistry().get(element);
- if(editPart != null) {
+ if (element instanceof View) { // support notation element lookup
+ EditPart editPart = (EditPart) viewer.getEditPartRegistry().get(element);
+ if (editPart != null) {
editPartCollector.add(editPart);
return 1;
}
@@ -229,20 +231,20 @@ public class UMLDiagramEditorUtil {
@SuppressWarnings("unchecked")
List<EditPart> associatedParts = viewer.findEditPartsForElement(elementID, IGraphicalEditPart.class);
// perform the possible hierarchy disjoint -> take the top-most parts only
- for(EditPart nextPart : associatedParts) {
+ for (EditPart nextPart : associatedParts) {
EditPart parentPart = nextPart.getParent();
- while(parentPart != null && !associatedParts.contains(parentPart)) {
+ while (parentPart != null && !associatedParts.contains(parentPart)) {
parentPart = parentPart.getParent();
}
- if(parentPart == null) {
+ if (parentPart == null) {
editPartCollector.add(nextPart);
}
}
- if(intialNumOfEditParts == editPartCollector.size()) {
- if(!associatedParts.isEmpty()) {
+ if (intialNumOfEditParts == editPartCollector.size()) {
+ if (!associatedParts.isEmpty()) {
editPartCollector.add(associatedParts.get(0));
} else {
- if(element.eContainer() != null) {
+ if (element.eContainer() != null) {
return findElementsInDiagramByID(diagramPart, element.eContainer(), editPartCollector);
}
}
@@ -255,16 +257,16 @@ public class UMLDiagramEditorUtil {
*/
public static View findView(DiagramEditPart diagramEditPart, EObject targetElement, LazyElement2ViewMap lazyElement2ViewMap) {
boolean hasStructuralURI = false;
- if(targetElement.eResource() instanceof XMLResource) {
- hasStructuralURI = ((XMLResource)targetElement.eResource()).getID(targetElement) == null;
+ if (targetElement.eResource() instanceof XMLResource) {
+ hasStructuralURI = ((XMLResource) targetElement.eResource()).getID(targetElement) == null;
}
View view = null;
LinkedList<EditPart> editPartHolder = new LinkedList<EditPart>();
- if(hasStructuralURI && !lazyElement2ViewMap.getElement2ViewMap().isEmpty()) {
+ if (hasStructuralURI && !lazyElement2ViewMap.getElement2ViewMap().isEmpty()) {
view = lazyElement2ViewMap.getElement2ViewMap().get(targetElement);
- } else if(findElementsInDiagramByID(diagramEditPart, targetElement, editPartHolder) > 0) {
+ } else if (findElementsInDiagramByID(diagramEditPart, targetElement, editPartHolder) > 0) {
EditPart editPart = editPartHolder.get(0);
- view = editPart.getModel() instanceof View ? (View)editPart.getModel() : null;
+ view = editPart.getModel() instanceof View ? (View) editPart.getModel() : null;
}
return (view == null) ? diagramEditPart.getDiagramView() : view;
}
@@ -301,13 +303,13 @@ public class UMLDiagramEditorUtil {
* @generated
*/
public final Map<EObject, View> getElement2ViewMap() {
- if(element2ViewMap == null) {
+ if (element2ViewMap == null) {
element2ViewMap = new HashMap<EObject, View>();
// map possible notation elements to itself as these can't be found by view.getElement()
- for(EObject element : elementSet) {
- if(element instanceof View) {
- View view = (View)element;
- if(view.getDiagram() == scope.getDiagram()) {
+ for (EObject element : elementSet) {
+ if (element instanceof View) {
+ View view = (View) element;
+ if (view.getDiagram() == scope.getDiagram()) {
element2ViewMap.put(element, view); // take only those that part of our diagram
}
}
@@ -321,24 +323,24 @@ public class UMLDiagramEditorUtil {
* @generated
*/
private static boolean buildElement2ViewMap(View parentView, Map<EObject, View> element2ViewMap, Set<? extends EObject> elements) {
- if(elements.size() == element2ViewMap.size()) {
+ if (elements.size() == element2ViewMap.size()) {
return true;
}
- if(parentView.isSetElement() && !element2ViewMap.containsKey(parentView.getElement()) && elements.contains(parentView.getElement())) {
+ if (parentView.isSetElement() && !element2ViewMap.containsKey(parentView.getElement()) && elements.contains(parentView.getElement())) {
element2ViewMap.put(parentView.getElement(), parentView);
- if(elements.size() == element2ViewMap.size()) {
+ if (elements.size() == element2ViewMap.size()) {
return true;
}
}
boolean complete = false;
- for(Iterator<?> it = parentView.getChildren().iterator(); it.hasNext() && !complete;) {
- complete = buildElement2ViewMap((View)it.next(), element2ViewMap, elements);
+ for (Iterator<?> it = parentView.getChildren().iterator(); it.hasNext() && !complete;) {
+ complete = buildElement2ViewMap((View) it.next(), element2ViewMap, elements);
}
- for(Iterator<?> it = parentView.getSourceEdges().iterator(); it.hasNext() && !complete;) {
- complete = buildElement2ViewMap((View)it.next(), element2ViewMap, elements);
+ for (Iterator<?> it = parentView.getSourceEdges().iterator(); it.hasNext() && !complete;) {
+ complete = buildElement2ViewMap((View) it.next(), element2ViewMap, elements);
}
- for(Iterator<?> it = parentView.getTargetEdges().iterator(); it.hasNext() && !complete;) {
- complete = buildElement2ViewMap((View)it.next(), element2ViewMap, elements);
+ for (Iterator<?> it = parentView.getTargetEdges().iterator(); it.hasNext() && !complete;) {
+ complete = buildElement2ViewMap((View) it.next(), element2ViewMap, elements);
}
return complete;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramUpdateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramUpdateCommand.java
index ae94401ef2d..23d5e4f767f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramUpdateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramUpdateCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -36,30 +36,33 @@ public class UMLDiagramUpdateCommand implements IHandler {
/**
* @generated
*/
+ @Override
public void addHandlerListener(IHandlerListener handlerListener) {
}
/**
* @generated
*/
+ @Override
public void dispose() {
}
/**
* @generated
*/
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
- if(selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection)selection;
- if(structuredSelection.size() != 1) {
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+ if (structuredSelection.size() != 1) {
return null;
}
- if(structuredSelection.getFirstElement() instanceof EditPart && ((EditPart)structuredSelection.getFirstElement()).getModel() instanceof View) {
- EObject modelElement = ((View)((EditPart)structuredSelection.getFirstElement()).getModel()).getElement();
+ if (structuredSelection.getFirstElement() instanceof EditPart && ((EditPart) structuredSelection.getFirstElement()).getModel() instanceof View) {
+ EObject modelElement = ((View) ((EditPart) structuredSelection.getFirstElement()).getModel()).getElement();
List editPolicies = CanonicalEditPolicy.getRegisteredEditPolicies(modelElement);
- for(Iterator it = editPolicies.iterator(); it.hasNext();) {
- CanonicalEditPolicy nextEditPolicy = (CanonicalEditPolicy)it.next();
+ for (Iterator it = editPolicies.iterator(); it.hasNext();) {
+ CanonicalEditPolicy nextEditPolicy = (CanonicalEditPolicy) it.next();
nextEditPolicy.refresh();
}
}
@@ -70,6 +73,7 @@ public class UMLDiagramUpdateCommand implements IHandler {
/**
* @generated
*/
+ @Override
public boolean isEnabled() {
return true;
}
@@ -77,6 +81,7 @@ public class UMLDiagramUpdateCommand implements IHandler {
/**
* @generated
*/
+ @Override
public boolean isHandled() {
return true;
}
@@ -84,6 +89,7 @@ public class UMLDiagramUpdateCommand implements IHandler {
/**
* @generated
*/
+ @Override
public void removeHandlerListener(IHandlerListener handlerListener) {
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramUpdater.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramUpdater.java
index 47b3b3f5220..6f7dabd1f72 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramUpdater.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramUpdater.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009, 2014 Atos Origin, CEA, 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
@@ -98,7 +98,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLNodeDescriptor> getSemanticChildren(View view) {
- switch(UMLVisualIDRegistry.getVisualID(view)) {
+ switch (UMLVisualIDRegistry.getVisualID(view)) {
case PackageEditPart.VISUAL_ID:
return getPackage_1000SemanticChildren(view);
case InteractionEditPart.VISUAL_ID:
@@ -119,10 +119,10 @@ public class UMLDiagramUpdater {
* @generated NOT remove fake children for messages (DurationConstraintInMessageEditPart/DurationObservationEditPart)
*/
public static List<UMLNodeDescriptor> getInteraction_2001SemanticChildren(View view) {
- if(!view.isSetElement()) {
+ if (!view.isSetElement()) {
return Collections.EMPTY_LIST;
}
- Interaction modelElement = (Interaction)view.getElement();
+ Interaction modelElement = (Interaction) view.getElement();
List result = new LinkedList();
// remove fake children for messages (DurationConstraintInMessageEditPart/DurationObservationEditPart)
return result;
@@ -132,31 +132,31 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLNodeDescriptor> getInteractionOperand_3005SemanticChildren(View view) {
- if(!view.isSetElement()) {
+ if (!view.isSetElement()) {
return Collections.EMPTY_LIST;
}
- InteractionOperand modelElement = (InteractionOperand)view.getElement();
+ InteractionOperand modelElement = (InteractionOperand) view.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getFragments().iterator(); it.hasNext();) {
- InteractionFragment childElement = (InteractionFragment)it.next();
+ for (Iterator<?> it = modelElement.getFragments().iterator(); it.hasNext();) {
+ InteractionFragment childElement = (InteractionFragment) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == InteractionUseEditPart.VISUAL_ID) {
+ if (visualID == InteractionUseEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ConsiderIgnoreFragmentEditPart.VISUAL_ID) {
+ if (visualID == ConsiderIgnoreFragmentEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == CombinedFragmentEditPart.VISUAL_ID) {
+ if (visualID == CombinedFragmentEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getFragments().iterator(); it.hasNext();) {
- InteractionFragment childElement = (InteractionFragment)it.next();
+ for (Iterator<?> it = modelElement.getFragments().iterator(); it.hasNext();) {
+ InteractionFragment childElement = (InteractionFragment) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ContinuationEditPart.VISUAL_ID) {
+ if (visualID == ContinuationEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -169,37 +169,37 @@ public class UMLDiagramUpdater {
* DurationConstraintEditPart children, handle TimeObservationEditPart children
*/
public static List<UMLNodeDescriptor> getLifeline_3001SemanticChildren(View view) {
- if(!view.isSetElement()) {
+ if (!view.isSetElement()) {
return Collections.EMPTY_LIST;
}
- Lifeline modelElement = (Lifeline)view.getElement();
+ Lifeline modelElement = (Lifeline) view.getElement();
List result = new LinkedList();
// Added code for manage ExecutionSpecification
- if(modelElement instanceof Lifeline) {
- if((modelElement).getCoveredBys().size() > 0) {
+ if (modelElement instanceof Lifeline) {
+ if ((modelElement).getCoveredBys().size() > 0) {
Interaction interaction = modelElement.getInteraction();
- for(Iterator values = interaction.getFragments().iterator(); values.hasNext();) {
- EObject nextValue = (EObject)values.next();
+ for (Iterator values = interaction.getFragments().iterator(); values.hasNext();) {
+ EObject nextValue = (EObject) values.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, nextValue);
- if(BehaviorExecutionSpecificationEditPart.VISUAL_ID == visualID) {
- BehaviorExecutionSpecification be = (BehaviorExecutionSpecification)nextValue;
- if(be.getCovereds().size() > 0 && be.getCovereds().get(0) == modelElement) {
+ if (BehaviorExecutionSpecificationEditPart.VISUAL_ID == visualID) {
+ BehaviorExecutionSpecification be = (BehaviorExecutionSpecification) nextValue;
+ if (be.getCovereds().size() > 0 && be.getCovereds().get(0) == modelElement) {
// result.add(nextValue);
result.add(new UMLNodeDescriptor(be, visualID));
}
- } else if(ActionExecutionSpecificationEditPart.VISUAL_ID == visualID) {
- ActionExecutionSpecification ae = (ActionExecutionSpecification)nextValue;
- if(ae.getCovereds().size() > 0 && ae.getCovereds().get(0) == modelElement) {
+ } else if (ActionExecutionSpecificationEditPart.VISUAL_ID == visualID) {
+ ActionExecutionSpecification ae = (ActionExecutionSpecification) nextValue;
+ if (ae.getCovereds().size() > 0 && ae.getCovereds().get(0) == modelElement) {
result.add(new UMLNodeDescriptor(ae, visualID));
}
- } else if(StateInvariantEditPart.VISUAL_ID == visualID) {
- StateInvariant ae = (StateInvariant)nextValue;
- if(ae.getCovereds().size() > 0 && ae.getCovereds().get(0) == modelElement) {
+ } else if (StateInvariantEditPart.VISUAL_ID == visualID) {
+ StateInvariant ae = (StateInvariant) nextValue;
+ if (ae.getCovereds().size() > 0 && ae.getCovereds().get(0) == modelElement) {
result.add(new UMLNodeDescriptor(ae, visualID));
}
- } else if(CombinedFragment2EditPart.VISUAL_ID == visualID) {
- CombinedFragment ae = (CombinedFragment)nextValue;
- if(ae.getCovereds().size() > 0 && ae.getCovereds().get(0) == modelElement) {
+ } else if (CombinedFragment2EditPart.VISUAL_ID == visualID) {
+ CombinedFragment ae = (CombinedFragment) nextValue;
+ if (ae.getCovereds().size() > 0 && ae.getCovereds().get(0) == modelElement) {
result.add(new UMLNodeDescriptor(ae, visualID));
}
}
@@ -214,20 +214,20 @@ public class UMLDiagramUpdater {
* UMLNodeDescriptor(childElement, visualID)); continue; } }
*/
// handle TimeConstraintEditPart and DurationConstraintEditPart children
- if(modelElement instanceof Lifeline) {
- for(InteractionFragment covering : modelElement.getCoveredBys()) {
- for(TimeConstraint childElement : TimeConstraintHelper.getTimeConstraintsOn(covering)) {
+ if (modelElement instanceof Lifeline) {
+ for (InteractionFragment covering : modelElement.getCoveredBys()) {
+ for (TimeConstraint childElement : TimeConstraintHelper.getTimeConstraintsOn(covering)) {
// block from generated code
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == TimeConstraintEditPart.VISUAL_ID) {
+ if (visualID == TimeConstraintEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(DurationConstraint childElement : DurationConstraintHelper.getDurationConstraintsOn(covering)) {
+ for (DurationConstraint childElement : DurationConstraintHelper.getDurationConstraintsOn(covering)) {
// block from generated code
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == DurationConstraintEditPart.VISUAL_ID) {
+ if (visualID == DurationConstraintEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -235,12 +235,12 @@ public class UMLDiagramUpdater {
}
}
// handle TimeObservationEditPart children
- if(modelElement instanceof Lifeline) {
- for(InteractionFragment covering : modelElement.getCoveredBys()) {
- for(TimeObservation childElement : TimeObservationHelper.getTimeObservations(covering)) {
+ if (modelElement instanceof Lifeline) {
+ for (InteractionFragment covering : modelElement.getCoveredBys()) {
+ for (TimeObservation childElement : TimeObservationHelper.getTimeObservations(covering)) {
// block from generated code
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == TimeObservationEditPart.VISUAL_ID) {
+ if (visualID == TimeObservationEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -254,51 +254,51 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLNodeDescriptor> getInteractionInteractionCompartment_7001SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- Interaction modelElement = (Interaction)containerView.getElement();
+ Interaction modelElement = (Interaction) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getFragments().iterator(); it.hasNext();) {
- InteractionFragment childElement = (InteractionFragment)it.next();
+ for (Iterator<?> it = modelElement.getFragments().iterator(); it.hasNext();) {
+ InteractionFragment childElement = (InteractionFragment) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ConsiderIgnoreFragmentEditPart.VISUAL_ID) {
+ if (visualID == ConsiderIgnoreFragmentEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == CombinedFragmentEditPart.VISUAL_ID) {
+ if (visualID == CombinedFragmentEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionUseEditPart.VISUAL_ID) {
+ if (visualID == InteractionUseEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getLifelines().iterator(); it.hasNext();) {
- Lifeline childElement = (Lifeline)it.next();
+ for (Iterator<?> it = modelElement.getLifelines().iterator(); it.hasNext();) {
+ Lifeline childElement = (Lifeline) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == LifelineEditPart.VISUAL_ID) {
+ if (visualID == LifelineEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedRules().iterator(); it.hasNext();) {
- Constraint childElement = (Constraint)it.next();
+ for (Iterator<?> it = modelElement.getOwnedRules().iterator(); it.hasNext();) {
+ Constraint childElement = (Constraint) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ConstraintEditPart.VISUAL_ID) {
+ if (visualID == ConstraintEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedComments().iterator(); it.hasNext();) {
- Comment childElement = (Comment)it.next();
+ for (Iterator<?> it = modelElement.getOwnedComments().iterator(); it.hasNext();) {
+ Comment childElement = (Comment) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CommentEditPart.VISUAL_ID) {
+ if (visualID == CommentEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -310,19 +310,19 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLNodeDescriptor> getCombinedFragmentCombinedFragmentCompartment_7004SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- CombinedFragment modelElement = (CombinedFragment)containerView.getElement();
+ CombinedFragment modelElement = (CombinedFragment) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOperands().iterator(); it.hasNext();) {
- InteractionOperand childElement = (InteractionOperand)it.next();
+ for (Iterator<?> it = modelElement.getOperands().iterator(); it.hasNext();) {
+ InteractionOperand childElement = (InteractionOperand) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == InteractionOperandEditPart.VISUAL_ID) {
+ if (visualID == InteractionOperandEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -334,15 +334,15 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLNodeDescriptor> getPackage_1000SemanticChildren(View view) {
- if(!view.isSetElement()) {
+ if (!view.isSetElement()) {
return Collections.EMPTY_LIST;
}
- Package modelElement = (Package)view.getElement();
+ Package modelElement = (Package) view.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getPackagedElements().iterator(); it.hasNext();) {
- PackageableElement childElement = (PackageableElement)it.next();
+ for (Iterator<?> it = modelElement.getPackagedElements().iterator(); it.hasNext();) {
+ PackageableElement childElement = (PackageableElement) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == InteractionEditPart.VISUAL_ID) {
+ if (visualID == InteractionEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -354,7 +354,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getContainedLinks(View view) {
- switch(UMLVisualIDRegistry.getVisualID(view)) {
+ switch (UMLVisualIDRegistry.getVisualID(view)) {
case PackageEditPart.VISUAL_ID:
return getPackage_1000ContainedLinks(view);
case InteractionEditPart.VISUAL_ID:
@@ -419,7 +419,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getIncomingLinks(View view) {
- switch(UMLVisualIDRegistry.getVisualID(view)) {
+ switch (UMLVisualIDRegistry.getVisualID(view)) {
case InteractionEditPart.VISUAL_ID:
return getInteraction_2001IncomingLinks(view);
case ConsiderIgnoreFragmentEditPart.VISUAL_ID:
@@ -482,7 +482,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getOutgoingLinks(View view) {
- switch(UMLVisualIDRegistry.getVisualID(view)) {
+ switch (UMLVisualIDRegistry.getVisualID(view)) {
case InteractionEditPart.VISUAL_ID:
return getInteraction_2001OutgoingLinks(view);
case ConsiderIgnoreFragmentEditPart.VISUAL_ID:
@@ -552,7 +552,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getInteraction_2001ContainedLinks(View view) {
- Interaction modelElement = (Interaction)view.getElement();
+ Interaction modelElement = (Interaction) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Message_4003(modelElement));
result.addAll(getContainedTypeModelFacetLinks_Message_4004(modelElement));
@@ -576,7 +576,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getBehaviorExecutionSpecification_3003ContainedLinks(View view) {
- BehaviorExecutionSpecification modelElement = (BehaviorExecutionSpecification)view.getElement();
+ BehaviorExecutionSpecification modelElement = (BehaviorExecutionSpecification) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_GeneralOrdering_4012(modelElement));
return result;
@@ -586,7 +586,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getStateInvariant_3017ContainedLinks(View view) {
- StateInvariant modelElement = (StateInvariant)view.getElement();
+ StateInvariant modelElement = (StateInvariant) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_GeneralOrdering_4012(modelElement));
return result;
@@ -596,7 +596,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getCombinedFragment_3018ContainedLinks(View view) {
- CombinedFragment modelElement = (CombinedFragment)view.getElement();
+ CombinedFragment modelElement = (CombinedFragment) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_GeneralOrdering_4012(modelElement));
return result;
@@ -606,7 +606,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getTimeConstraint_3019ContainedLinks(View view) {
- TimeConstraint modelElement = (TimeConstraint)view.getElement();
+ TimeConstraint modelElement = (TimeConstraint) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4011(modelElement));
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_Context_8500(modelElement));
@@ -624,7 +624,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getDurationConstraint_3021ContainedLinks(View view) {
- DurationConstraint modelElement = (DurationConstraint)view.getElement();
+ DurationConstraint modelElement = (DurationConstraint) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4011(modelElement));
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_Context_8500(modelElement));
@@ -635,7 +635,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getDestructionOccurrenceSpecification_3022ContainedLinks(View view) {
- DestructionOccurrenceSpecification modelElement = (DestructionOccurrenceSpecification)view.getElement();
+ DestructionOccurrenceSpecification modelElement = (DestructionOccurrenceSpecification) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_GeneralOrdering_4012(modelElement));
return result;
@@ -645,7 +645,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getActionExecutionSpecification_3006ContainedLinks(View view) {
- ActionExecutionSpecification modelElement = (ActionExecutionSpecification)view.getElement();
+ ActionExecutionSpecification modelElement = (ActionExecutionSpecification) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_GeneralOrdering_4012(modelElement));
return result;
@@ -655,7 +655,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getInteractionUse_3002ContainedLinks(View view) {
- InteractionUse modelElement = (InteractionUse)view.getElement();
+ InteractionUse modelElement = (InteractionUse) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_GeneralOrdering_4012(modelElement));
return result;
@@ -665,7 +665,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getCombinedFragment_3004ContainedLinks(View view) {
- CombinedFragment modelElement = (CombinedFragment)view.getElement();
+ CombinedFragment modelElement = (CombinedFragment) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_GeneralOrdering_4012(modelElement));
return result;
@@ -675,7 +675,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getInteractionOperand_3005ContainedLinks(View view) {
- InteractionOperand modelElement = (InteractionOperand)view.getElement();
+ InteractionOperand modelElement = (InteractionOperand) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_GeneralOrdering_4012(modelElement));
return result;
@@ -685,7 +685,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getContinuation_3016ContainedLinks(View view) {
- Continuation modelElement = (Continuation)view.getElement();
+ Continuation modelElement = (Continuation) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_GeneralOrdering_4012(modelElement));
return result;
@@ -695,7 +695,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getConstraint_3008ContainedLinks(View view) {
- Constraint modelElement = (Constraint)view.getElement();
+ Constraint modelElement = (Constraint) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4011(modelElement));
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_Context_8500(modelElement));
@@ -706,7 +706,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getComment_3009ContainedLinks(View view) {
- Comment modelElement = (Comment)view.getElement();
+ Comment modelElement = (Comment) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Comment_AnnotatedElement_4010(modelElement));
return result;
@@ -716,7 +716,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getDurationConstraint_3023ContainedLinks(View view) {
- DurationConstraint modelElement = (DurationConstraint)view.getElement();
+ DurationConstraint modelElement = (DurationConstraint) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4011(modelElement));
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_Context_8500(modelElement));
@@ -734,7 +734,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getConsiderIgnoreFragment_3007ContainedLinks(View view) {
- ConsiderIgnoreFragment modelElement = (ConsiderIgnoreFragment)view.getElement();
+ ConsiderIgnoreFragment modelElement = (ConsiderIgnoreFragment) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_GeneralOrdering_4012(modelElement));
return result;
@@ -800,7 +800,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getInteraction_2001IncomingLinks(View view) {
- Interaction modelElement = (Interaction)view.getElement();
+ Interaction modelElement = (Interaction) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingTypeModelFacetLinks_Message_4003(modelElement, crossReferencer));
@@ -820,7 +820,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getLifeline_3001IncomingLinks(View view) {
- Lifeline modelElement = (Lifeline)view.getElement();
+ Lifeline modelElement = (Lifeline) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingTypeModelFacetLinks_Message_4003(modelElement, crossReferencer));
@@ -839,7 +839,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getBehaviorExecutionSpecification_3003IncomingLinks(View view) {
- BehaviorExecutionSpecification modelElement = (BehaviorExecutionSpecification)view.getElement();
+ BehaviorExecutionSpecification modelElement = (BehaviorExecutionSpecification) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingTypeModelFacetLinks_Message_4003(modelElement, crossReferencer));
@@ -858,7 +858,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getStateInvariant_3017IncomingLinks(View view) {
- StateInvariant modelElement = (StateInvariant)view.getElement();
+ StateInvariant modelElement = (StateInvariant) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingTypeModelFacetLinks_Message_4003(modelElement, crossReferencer));
@@ -877,7 +877,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getCombinedFragment_3018IncomingLinks(View view) {
- CombinedFragment modelElement = (CombinedFragment)view.getElement();
+ CombinedFragment modelElement = (CombinedFragment) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingTypeModelFacetLinks_Message_4003(modelElement, crossReferencer));
@@ -896,7 +896,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getTimeConstraint_3019IncomingLinks(View view) {
- TimeConstraint modelElement = (TimeConstraint)view.getElement();
+ TimeConstraint modelElement = (TimeConstraint) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingTypeModelFacetLinks_Message_4003(modelElement, crossReferencer));
@@ -915,7 +915,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getTimeObservation_3020IncomingLinks(View view) {
- TimeObservation modelElement = (TimeObservation)view.getElement();
+ TimeObservation modelElement = (TimeObservation) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingTypeModelFacetLinks_Message_4003(modelElement, crossReferencer));
@@ -934,7 +934,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getDurationConstraint_3021IncomingLinks(View view) {
- DurationConstraint modelElement = (DurationConstraint)view.getElement();
+ DurationConstraint modelElement = (DurationConstraint) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingTypeModelFacetLinks_Message_4003(modelElement, crossReferencer));
@@ -953,7 +953,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getDestructionOccurrenceSpecification_3022IncomingLinks(View view) {
- DestructionOccurrenceSpecification modelElement = (DestructionOccurrenceSpecification)view.getElement();
+ DestructionOccurrenceSpecification modelElement = (DestructionOccurrenceSpecification) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingTypeModelFacetLinks_Message_4003(modelElement, crossReferencer));
@@ -973,7 +973,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getActionExecutionSpecification_3006IncomingLinks(View view) {
- ActionExecutionSpecification modelElement = (ActionExecutionSpecification)view.getElement();
+ ActionExecutionSpecification modelElement = (ActionExecutionSpecification) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingTypeModelFacetLinks_Message_4003(modelElement, crossReferencer));
@@ -992,7 +992,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getInteractionUse_3002IncomingLinks(View view) {
- InteractionUse modelElement = (InteractionUse)view.getElement();
+ InteractionUse modelElement = (InteractionUse) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingTypeModelFacetLinks_Message_4003(modelElement, crossReferencer));
@@ -1011,7 +1011,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getCombinedFragment_3004IncomingLinks(View view) {
- CombinedFragment modelElement = (CombinedFragment)view.getElement();
+ CombinedFragment modelElement = (CombinedFragment) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingTypeModelFacetLinks_Message_4003(modelElement, crossReferencer));
@@ -1030,7 +1030,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getInteractionOperand_3005IncomingLinks(View view) {
- InteractionOperand modelElement = (InteractionOperand)view.getElement();
+ InteractionOperand modelElement = (InteractionOperand) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingTypeModelFacetLinks_Message_4003(modelElement, crossReferencer));
@@ -1050,7 +1050,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getContinuation_3016IncomingLinks(View view) {
- Continuation modelElement = (Continuation)view.getElement();
+ Continuation modelElement = (Continuation) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingTypeModelFacetLinks_Message_4003(modelElement, crossReferencer));
@@ -1069,7 +1069,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getConstraint_3008IncomingLinks(View view) {
- Constraint modelElement = (Constraint)view.getElement();
+ Constraint modelElement = (Constraint) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingTypeModelFacetLinks_Message_4003(modelElement, crossReferencer));
@@ -1088,7 +1088,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getComment_3009IncomingLinks(View view) {
- Comment modelElement = (Comment)view.getElement();
+ Comment modelElement = (Comment) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingTypeModelFacetLinks_Message_4003(modelElement, crossReferencer));
@@ -1107,7 +1107,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getDurationConstraint_3023IncomingLinks(View view) {
- DurationConstraint modelElement = (DurationConstraint)view.getElement();
+ DurationConstraint modelElement = (DurationConstraint) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingTypeModelFacetLinks_Message_4003(modelElement, crossReferencer));
@@ -1126,7 +1126,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getDurationObservation_3024IncomingLinks(View view) {
- DurationObservation modelElement = (DurationObservation)view.getElement();
+ DurationObservation modelElement = (DurationObservation) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingTypeModelFacetLinks_Message_4003(modelElement, crossReferencer));
@@ -1145,7 +1145,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getConsiderIgnoreFragment_3007IncomingLinks(View view) {
- ConsiderIgnoreFragment modelElement = (ConsiderIgnoreFragment)view.getElement();
+ ConsiderIgnoreFragment modelElement = (ConsiderIgnoreFragment) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingTypeModelFacetLinks_Message_4003(modelElement, crossReferencer));
@@ -1164,7 +1164,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getMessage_4003IncomingLinks(View view) {
- Message modelElement = (Message)view.getElement();
+ Message modelElement = (Message) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingTypeModelFacetLinks_Message_4003(modelElement, crossReferencer));
@@ -1183,7 +1183,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getMessage_4004IncomingLinks(View view) {
- Message modelElement = (Message)view.getElement();
+ Message modelElement = (Message) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingTypeModelFacetLinks_Message_4003(modelElement, crossReferencer));
@@ -1202,7 +1202,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getMessage_4005IncomingLinks(View view) {
- Message modelElement = (Message)view.getElement();
+ Message modelElement = (Message) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingTypeModelFacetLinks_Message_4003(modelElement, crossReferencer));
@@ -1221,7 +1221,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getMessage_4006IncomingLinks(View view) {
- Message modelElement = (Message)view.getElement();
+ Message modelElement = (Message) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingTypeModelFacetLinks_Message_4003(modelElement, crossReferencer));
@@ -1240,7 +1240,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getMessage_4007IncomingLinks(View view) {
- Message modelElement = (Message)view.getElement();
+ Message modelElement = (Message) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingTypeModelFacetLinks_Message_4003(modelElement, crossReferencer));
@@ -1259,7 +1259,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getMessage_4008IncomingLinks(View view) {
- Message modelElement = (Message)view.getElement();
+ Message modelElement = (Message) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingTypeModelFacetLinks_Message_4003(modelElement, crossReferencer));
@@ -1278,7 +1278,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getMessage_4009IncomingLinks(View view) {
- Message modelElement = (Message)view.getElement();
+ Message modelElement = (Message) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingTypeModelFacetLinks_Message_4003(modelElement, crossReferencer));
@@ -1297,7 +1297,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getGeneralOrdering_4012IncomingLinks(View view) {
- GeneralOrdering modelElement = (GeneralOrdering)view.getElement();
+ GeneralOrdering modelElement = (GeneralOrdering) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingTypeModelFacetLinks_Message_4003(modelElement, crossReferencer));
@@ -1316,7 +1316,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getInteraction_2001OutgoingLinks(View view) {
- Interaction modelElement = (Interaction)view.getElement();
+ Interaction modelElement = (Interaction) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_Message_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4004(modelElement));
@@ -1332,7 +1332,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getLifeline_3001OutgoingLinks(View view) {
- Lifeline modelElement = (Lifeline)view.getElement();
+ Lifeline modelElement = (Lifeline) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_Message_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4004(modelElement));
@@ -1348,7 +1348,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getBehaviorExecutionSpecification_3003OutgoingLinks(View view) {
- BehaviorExecutionSpecification modelElement = (BehaviorExecutionSpecification)view.getElement();
+ BehaviorExecutionSpecification modelElement = (BehaviorExecutionSpecification) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_Message_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4004(modelElement));
@@ -1364,7 +1364,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getStateInvariant_3017OutgoingLinks(View view) {
- StateInvariant modelElement = (StateInvariant)view.getElement();
+ StateInvariant modelElement = (StateInvariant) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_Message_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4004(modelElement));
@@ -1380,7 +1380,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getCombinedFragment_3018OutgoingLinks(View view) {
- CombinedFragment modelElement = (CombinedFragment)view.getElement();
+ CombinedFragment modelElement = (CombinedFragment) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_Message_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4004(modelElement));
@@ -1396,7 +1396,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getTimeConstraint_3019OutgoingLinks(View view) {
- TimeConstraint modelElement = (TimeConstraint)view.getElement();
+ TimeConstraint modelElement = (TimeConstraint) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_Message_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4004(modelElement));
@@ -1414,7 +1414,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getTimeObservation_3020OutgoingLinks(View view) {
- TimeObservation modelElement = (TimeObservation)view.getElement();
+ TimeObservation modelElement = (TimeObservation) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_Message_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4004(modelElement));
@@ -1430,7 +1430,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getDurationConstraint_3021OutgoingLinks(View view) {
- DurationConstraint modelElement = (DurationConstraint)view.getElement();
+ DurationConstraint modelElement = (DurationConstraint) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_Message_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4004(modelElement));
@@ -1448,7 +1448,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getDestructionOccurrenceSpecification_3022OutgoingLinks(View view) {
- DestructionOccurrenceSpecification modelElement = (DestructionOccurrenceSpecification)view.getElement();
+ DestructionOccurrenceSpecification modelElement = (DestructionOccurrenceSpecification) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_Message_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4004(modelElement));
@@ -1465,7 +1465,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getActionExecutionSpecification_3006OutgoingLinks(View view) {
- ActionExecutionSpecification modelElement = (ActionExecutionSpecification)view.getElement();
+ ActionExecutionSpecification modelElement = (ActionExecutionSpecification) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_Message_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4004(modelElement));
@@ -1481,7 +1481,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getInteractionUse_3002OutgoingLinks(View view) {
- InteractionUse modelElement = (InteractionUse)view.getElement();
+ InteractionUse modelElement = (InteractionUse) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_Message_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4004(modelElement));
@@ -1497,7 +1497,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getCombinedFragment_3004OutgoingLinks(View view) {
- CombinedFragment modelElement = (CombinedFragment)view.getElement();
+ CombinedFragment modelElement = (CombinedFragment) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_Message_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4004(modelElement));
@@ -1513,7 +1513,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getInteractionOperand_3005OutgoingLinks(View view) {
- InteractionOperand modelElement = (InteractionOperand)view.getElement();
+ InteractionOperand modelElement = (InteractionOperand) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_Message_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4004(modelElement));
@@ -1529,7 +1529,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getContinuation_3016OutgoingLinks(View view) {
- Continuation modelElement = (Continuation)view.getElement();
+ Continuation modelElement = (Continuation) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_Message_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4004(modelElement));
@@ -1545,7 +1545,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getConstraint_3008OutgoingLinks(View view) {
- Constraint modelElement = (Constraint)view.getElement();
+ Constraint modelElement = (Constraint) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_Message_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4004(modelElement));
@@ -1563,7 +1563,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getComment_3009OutgoingLinks(View view) {
- Comment modelElement = (Comment)view.getElement();
+ Comment modelElement = (Comment) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_Message_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4004(modelElement));
@@ -1580,7 +1580,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getDurationConstraint_3023OutgoingLinks(View view) {
- DurationConstraint modelElement = (DurationConstraint)view.getElement();
+ DurationConstraint modelElement = (DurationConstraint) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_Message_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4004(modelElement));
@@ -1598,7 +1598,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getDurationObservation_3024OutgoingLinks(View view) {
- DurationObservation modelElement = (DurationObservation)view.getElement();
+ DurationObservation modelElement = (DurationObservation) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_Message_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4004(modelElement));
@@ -1614,7 +1614,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getConsiderIgnoreFragment_3007OutgoingLinks(View view) {
- ConsiderIgnoreFragment modelElement = (ConsiderIgnoreFragment)view.getElement();
+ ConsiderIgnoreFragment modelElement = (ConsiderIgnoreFragment) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_Message_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4004(modelElement));
@@ -1630,7 +1630,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getMessage_4003OutgoingLinks(View view) {
- Message modelElement = (Message)view.getElement();
+ Message modelElement = (Message) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_Message_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4004(modelElement));
@@ -1646,7 +1646,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getMessage_4004OutgoingLinks(View view) {
- Message modelElement = (Message)view.getElement();
+ Message modelElement = (Message) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_Message_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4004(modelElement));
@@ -1662,7 +1662,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getMessage_4005OutgoingLinks(View view) {
- Message modelElement = (Message)view.getElement();
+ Message modelElement = (Message) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_Message_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4004(modelElement));
@@ -1678,7 +1678,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getMessage_4006OutgoingLinks(View view) {
- Message modelElement = (Message)view.getElement();
+ Message modelElement = (Message) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_Message_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4004(modelElement));
@@ -1694,7 +1694,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getMessage_4007OutgoingLinks(View view) {
- Message modelElement = (Message)view.getElement();
+ Message modelElement = (Message) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_Message_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4004(modelElement));
@@ -1710,7 +1710,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getMessage_4008OutgoingLinks(View view) {
- Message modelElement = (Message)view.getElement();
+ Message modelElement = (Message) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_Message_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4004(modelElement));
@@ -1726,7 +1726,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getMessage_4009OutgoingLinks(View view) {
- Message modelElement = (Message)view.getElement();
+ Message modelElement = (Message) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_Message_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4004(modelElement));
@@ -1742,7 +1742,7 @@ public class UMLDiagramUpdater {
* @generated
*/
public static List<UMLLinkDescriptor> getGeneralOrdering_4012OutgoingLinks(View view) {
- GeneralOrdering modelElement = (GeneralOrdering)view.getElement();
+ GeneralOrdering modelElement = (GeneralOrdering) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_Message_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4004(modelElement));
@@ -1759,21 +1759,21 @@ public class UMLDiagramUpdater {
*/
private static Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_Message_4003(Interaction container) {
Collection result = new LinkedList();
- for(Iterator links = container.getMessages().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Message) {
+ for (Iterator links = container.getMessages().iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Message) {
continue;
}
- Message link = (Message)linkObject;
- if(MessageEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Message link = (Message) linkObject;
+ if (MessageEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List targets = link.getOwnedElements();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof Element) {
+ if (false == theTarget instanceof Element) {
continue;
}
- Element dst = (Element)theTarget;
+ Element dst = (Element) theTarget;
Element src = link.getOwner();
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Message_4003, MessageEditPart.VISUAL_ID));
}
@@ -1785,21 +1785,21 @@ public class UMLDiagramUpdater {
*/
private static Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_Message_4004(Interaction container) {
Collection result = new LinkedList();
- for(Iterator links = container.getMessages().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Message) {
+ for (Iterator links = container.getMessages().iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Message) {
continue;
}
- Message link = (Message)linkObject;
- if(Message2EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Message link = (Message) linkObject;
+ if (Message2EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List targets = link.getOwnedElements();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof Element) {
+ if (false == theTarget instanceof Element) {
continue;
}
- Element dst = (Element)theTarget;
+ Element dst = (Element) theTarget;
Element src = link.getOwner();
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Message_4004, Message2EditPart.VISUAL_ID));
}
@@ -1811,21 +1811,21 @@ public class UMLDiagramUpdater {
*/
private static Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_Message_4005(Interaction container) {
Collection result = new LinkedList();
- for(Iterator links = container.getMessages().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Message) {
+ for (Iterator links = container.getMessages().iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Message) {
continue;
}
- Message link = (Message)linkObject;
- if(Message3EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Message link = (Message) linkObject;
+ if (Message3EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List targets = link.getOwnedElements();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof Element) {
+ if (false == theTarget instanceof Element) {
continue;
}
- Element dst = (Element)theTarget;
+ Element dst = (Element) theTarget;
Element src = link.getOwner();
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Message_4005, Message3EditPart.VISUAL_ID));
}
@@ -1837,21 +1837,21 @@ public class UMLDiagramUpdater {
*/
private static Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_Message_4006(Interaction container) {
Collection result = new LinkedList();
- for(Iterator links = container.getMessages().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Message) {
+ for (Iterator links = container.getMessages().iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Message) {
continue;
}
- Message link = (Message)linkObject;
- if(Message4EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Message link = (Message) linkObject;
+ if (Message4EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List targets = link.getOwnedElements();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof Element) {
+ if (false == theTarget instanceof Element) {
continue;
}
- Element dst = (Element)theTarget;
+ Element dst = (Element) theTarget;
Element src = link.getOwner();
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Message_4006, Message4EditPart.VISUAL_ID));
}
@@ -1863,21 +1863,21 @@ public class UMLDiagramUpdater {
*/
private static Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_Message_4007(Interaction container) {
Collection result = new LinkedList();
- for(Iterator links = container.getMessages().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Message) {
+ for (Iterator links = container.getMessages().iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Message) {
continue;
}
- Message link = (Message)linkObject;
- if(Message5EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Message link = (Message) linkObject;
+ if (Message5EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List targets = link.getOwnedElements();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof Element) {
+ if (false == theTarget instanceof Element) {
continue;
}
- Element dst = (Element)theTarget;
+ Element dst = (Element) theTarget;
Element src = link.getOwner();
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Message_4007, Message5EditPart.VISUAL_ID));
}
@@ -1889,21 +1889,21 @@ public class UMLDiagramUpdater {
*/
private static Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_Message_4008(Interaction container) {
Collection result = new LinkedList();
- for(Iterator links = container.getMessages().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Message) {
+ for (Iterator links = container.getMessages().iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Message) {
continue;
}
- Message link = (Message)linkObject;
- if(Message6EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Message link = (Message) linkObject;
+ if (Message6EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List targets = link.getOwnedElements();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof Element) {
+ if (false == theTarget instanceof Element) {
continue;
}
- Element dst = (Element)theTarget;
+ Element dst = (Element) theTarget;
Element src = link.getOwner();
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Message_4008, Message6EditPart.VISUAL_ID));
}
@@ -1915,21 +1915,21 @@ public class UMLDiagramUpdater {
*/
private static Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_Message_4009(Interaction container) {
Collection result = new LinkedList();
- for(Iterator links = container.getMessages().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Message) {
+ for (Iterator links = container.getMessages().iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Message) {
continue;
}
- Message link = (Message)linkObject;
- if(Message7EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Message link = (Message) linkObject;
+ if (Message7EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List targets = link.getOwnedElements();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof Element) {
+ if (false == theTarget instanceof Element) {
continue;
}
- Element dst = (Element)theTarget;
+ Element dst = (Element) theTarget;
Element src = link.getOwner();
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Message_4009, Message7EditPart.VISUAL_ID));
}
@@ -1941,13 +1941,13 @@ public class UMLDiagramUpdater {
*/
private static Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_GeneralOrdering_4012(InteractionFragment container) {
Collection result = new LinkedList();
- for(Iterator links = container.getGeneralOrderings().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof GeneralOrdering) {
+ for (Iterator links = container.getGeneralOrderings().iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof GeneralOrdering) {
continue;
}
- GeneralOrdering link = (GeneralOrdering)linkObject;
- if(GeneralOrderingEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ GeneralOrdering link = (GeneralOrdering) linkObject;
+ if (GeneralOrderingEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
OccurrenceSpecification dst = link.getAfter();
@@ -1963,12 +1963,12 @@ public class UMLDiagramUpdater {
private static Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_Message_4003(Element target, CrossReferenceAdapter crossReferencer) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
Collection<EStructuralFeature.Setting> settings = crossReferencer.getInverseReferences(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getElement_OwnedElement() || false == setting.getEObject() instanceof Message) {
+ for (EStructuralFeature.Setting setting : settings) {
+ if (setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getElement_OwnedElement() || false == setting.getEObject() instanceof Message) {
continue;
}
- Message link = (Message)setting.getEObject();
- if(MessageEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Message link = (Message) setting.getEObject();
+ if (MessageEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
Element src = link.getOwner();
@@ -1983,12 +1983,12 @@ public class UMLDiagramUpdater {
private static Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_Message_4004(Element target, CrossReferenceAdapter crossReferencer) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
Collection<EStructuralFeature.Setting> settings = crossReferencer.getInverseReferences(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getElement_OwnedElement() || false == setting.getEObject() instanceof Message) {
+ for (EStructuralFeature.Setting setting : settings) {
+ if (setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getElement_OwnedElement() || false == setting.getEObject() instanceof Message) {
continue;
}
- Message link = (Message)setting.getEObject();
- if(Message2EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Message link = (Message) setting.getEObject();
+ if (Message2EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
Element src = link.getOwner();
@@ -2003,12 +2003,12 @@ public class UMLDiagramUpdater {
private static Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_Message_4005(Element target, CrossReferenceAdapter crossReferencer) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
Collection<EStructuralFeature.Setting> settings = crossReferencer.getInverseReferences(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getElement_OwnedElement() || false == setting.getEObject() instanceof Message) {
+ for (EStructuralFeature.Setting setting : settings) {
+ if (setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getElement_OwnedElement() || false == setting.getEObject() instanceof Message) {
continue;
}
- Message link = (Message)setting.getEObject();
- if(Message3EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Message link = (Message) setting.getEObject();
+ if (Message3EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
Element src = link.getOwner();
@@ -2023,12 +2023,12 @@ public class UMLDiagramUpdater {
private static Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_Message_4006(Element target, CrossReferenceAdapter crossReferencer) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
Collection<EStructuralFeature.Setting> settings = crossReferencer.getInverseReferences(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getElement_OwnedElement() || false == setting.getEObject() instanceof Message) {
+ for (EStructuralFeature.Setting setting : settings) {
+ if (setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getElement_OwnedElement() || false == setting.getEObject() instanceof Message) {
continue;
}
- Message link = (Message)setting.getEObject();
- if(Message4EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Message link = (Message) setting.getEObject();
+ if (Message4EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
Element src = link.getOwner();
@@ -2043,12 +2043,12 @@ public class UMLDiagramUpdater {
private static Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_Message_4007(Element target, CrossReferenceAdapter crossReferencer) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
Collection<EStructuralFeature.Setting> settings = crossReferencer.getInverseReferences(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getElement_OwnedElement() || false == setting.getEObject() instanceof Message) {
+ for (EStructuralFeature.Setting setting : settings) {
+ if (setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getElement_OwnedElement() || false == setting.getEObject() instanceof Message) {
continue;
}
- Message link = (Message)setting.getEObject();
- if(Message5EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Message link = (Message) setting.getEObject();
+ if (Message5EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
Element src = link.getOwner();
@@ -2063,12 +2063,12 @@ public class UMLDiagramUpdater {
private static Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_Message_4008(Element target, CrossReferenceAdapter crossReferencer) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
Collection<EStructuralFeature.Setting> settings = crossReferencer.getInverseReferences(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getElement_OwnedElement() || false == setting.getEObject() instanceof Message) {
+ for (EStructuralFeature.Setting setting : settings) {
+ if (setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getElement_OwnedElement() || false == setting.getEObject() instanceof Message) {
continue;
}
- Message link = (Message)setting.getEObject();
- if(Message6EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Message link = (Message) setting.getEObject();
+ if (Message6EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
Element src = link.getOwner();
@@ -2083,12 +2083,12 @@ public class UMLDiagramUpdater {
private static Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_Message_4009(Element target, CrossReferenceAdapter crossReferencer) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
Collection<EStructuralFeature.Setting> settings = crossReferencer.getInverseReferences(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getElement_OwnedElement() || false == setting.getEObject() instanceof Message) {
+ for (EStructuralFeature.Setting setting : settings) {
+ if (setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getElement_OwnedElement() || false == setting.getEObject() instanceof Message) {
continue;
}
- Message link = (Message)setting.getEObject();
- if(Message7EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Message link = (Message) setting.getEObject();
+ if (Message7EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
Element src = link.getOwner();
@@ -2103,8 +2103,8 @@ public class UMLDiagramUpdater {
private static Collection<UMLLinkDescriptor> getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4010(Element target, CrossReferenceAdapter crossReferencer) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
Collection<EStructuralFeature.Setting> settings = crossReferencer.getInverseReferences(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() == UMLPackage.eINSTANCE.getComment_AnnotatedElement()) {
+ for (EStructuralFeature.Setting setting : settings) {
+ if (setting.getEStructuralFeature() == UMLPackage.eINSTANCE.getComment_AnnotatedElement()) {
result.add(new UMLLinkDescriptor(setting.getEObject(), target, UMLElementTypes.CommentAnnotatedElement_4010, CommentAnnotatedElementEditPart.VISUAL_ID));
}
}
@@ -2117,8 +2117,8 @@ public class UMLDiagramUpdater {
private static Collection<UMLLinkDescriptor> getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4011(Element target, CrossReferenceAdapter crossReferencer) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
Collection<EStructuralFeature.Setting> settings = crossReferencer.getInverseReferences(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() == UMLPackage.eINSTANCE.getConstraint_ConstrainedElement()) {
+ for (EStructuralFeature.Setting setting : settings) {
+ if (setting.getEStructuralFeature() == UMLPackage.eINSTANCE.getConstraint_ConstrainedElement()) {
result.add(new UMLLinkDescriptor(setting.getEObject(), target, UMLElementTypes.ConstraintConstrainedElement_4011, ConstraintConstrainedElementEditPart.VISUAL_ID));
}
}
@@ -2131,12 +2131,12 @@ public class UMLDiagramUpdater {
private static Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_GeneralOrdering_4012(OccurrenceSpecification target, CrossReferenceAdapter crossReferencer) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
Collection<EStructuralFeature.Setting> settings = crossReferencer.getInverseReferences(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getGeneralOrdering_After() || false == setting.getEObject() instanceof GeneralOrdering) {
+ for (EStructuralFeature.Setting setting : settings) {
+ if (setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getGeneralOrdering_After() || false == setting.getEObject() instanceof GeneralOrdering) {
continue;
}
- GeneralOrdering link = (GeneralOrdering)setting.getEObject();
- if(GeneralOrderingEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ GeneralOrdering link = (GeneralOrdering) setting.getEObject();
+ if (GeneralOrderingEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
OccurrenceSpecification src = link.getBefore();
@@ -2151,8 +2151,8 @@ public class UMLDiagramUpdater {
private static Collection<UMLLinkDescriptor> getIncomingFeatureModelFacetLinks_Constraint_Context_8500(Namespace target, CrossReferenceAdapter crossReferencer) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
Collection<EStructuralFeature.Setting> settings = crossReferencer.getInverseReferences(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() == UMLPackage.eINSTANCE.getConstraint_Context()) {
+ for (EStructuralFeature.Setting setting : settings) {
+ if (setting.getEStructuralFeature() == UMLPackage.eINSTANCE.getConstraint_Context()) {
result.add(new UMLLinkDescriptor(setting.getEObject(), target, UMLElementTypes.ConstraintContext_8500, ContextLinkEditPart.VISUAL_ID));
}
}
@@ -2167,32 +2167,32 @@ public class UMLDiagramUpdater {
// Find container element for the link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof Interaction) {
- container = (Interaction)element;
+ for (EObject element = source; element != null && container == null; element = element.eContainer()) {
+ if (element instanceof Interaction) {
+ container = (Interaction) element;
}
}
- if(container == null) {
+ if (container == null) {
return Collections.emptyList();
}
Collection result = new LinkedList();
- for(Iterator links = container.getMessages().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Message) {
+ for (Iterator links = container.getMessages().iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Message) {
continue;
}
- Message link = (Message)linkObject;
- if(MessageEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Message link = (Message) linkObject;
+ if (MessageEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List targets = link.getOwnedElements();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof Element) {
+ if (false == theTarget instanceof Element) {
continue;
}
- Element dst = (Element)theTarget;
+ Element dst = (Element) theTarget;
Element src = link.getOwner();
- if(src != source) {
+ if (src != source) {
continue;
}
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Message_4003, MessageEditPart.VISUAL_ID));
@@ -2208,32 +2208,32 @@ public class UMLDiagramUpdater {
// Find container element for the link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof Interaction) {
- container = (Interaction)element;
+ for (EObject element = source; element != null && container == null; element = element.eContainer()) {
+ if (element instanceof Interaction) {
+ container = (Interaction) element;
}
}
- if(container == null) {
+ if (container == null) {
return Collections.emptyList();
}
Collection result = new LinkedList();
- for(Iterator links = container.getMessages().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Message) {
+ for (Iterator links = container.getMessages().iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Message) {
continue;
}
- Message link = (Message)linkObject;
- if(Message2EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Message link = (Message) linkObject;
+ if (Message2EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List targets = link.getOwnedElements();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof Element) {
+ if (false == theTarget instanceof Element) {
continue;
}
- Element dst = (Element)theTarget;
+ Element dst = (Element) theTarget;
Element src = link.getOwner();
- if(src != source) {
+ if (src != source) {
continue;
}
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Message_4004, Message2EditPart.VISUAL_ID));
@@ -2249,32 +2249,32 @@ public class UMLDiagramUpdater {
// Find container element for the link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof Interaction) {
- container = (Interaction)element;
+ for (EObject element = source; element != null && container == null; element = element.eContainer()) {
+ if (element instanceof Interaction) {
+ container = (Interaction) element;
}
}
- if(container == null) {
+ if (container == null) {
return Collections.emptyList();
}
Collection result = new LinkedList();
- for(Iterator links = container.getMessages().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Message) {
+ for (Iterator links = container.getMessages().iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Message) {
continue;
}
- Message link = (Message)linkObject;
- if(Message3EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Message link = (Message) linkObject;
+ if (Message3EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List targets = link.getOwnedElements();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof Element) {
+ if (false == theTarget instanceof Element) {
continue;
}
- Element dst = (Element)theTarget;
+ Element dst = (Element) theTarget;
Element src = link.getOwner();
- if(src != source) {
+ if (src != source) {
continue;
}
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Message_4005, Message3EditPart.VISUAL_ID));
@@ -2290,32 +2290,32 @@ public class UMLDiagramUpdater {
// Find container element for the link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof Interaction) {
- container = (Interaction)element;
+ for (EObject element = source; element != null && container == null; element = element.eContainer()) {
+ if (element instanceof Interaction) {
+ container = (Interaction) element;
}
}
- if(container == null) {
+ if (container == null) {
return Collections.emptyList();
}
Collection result = new LinkedList();
- for(Iterator links = container.getMessages().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Message) {
+ for (Iterator links = container.getMessages().iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Message) {
continue;
}
- Message link = (Message)linkObject;
- if(Message4EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Message link = (Message) linkObject;
+ if (Message4EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List targets = link.getOwnedElements();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof Element) {
+ if (false == theTarget instanceof Element) {
continue;
}
- Element dst = (Element)theTarget;
+ Element dst = (Element) theTarget;
Element src = link.getOwner();
- if(src != source) {
+ if (src != source) {
continue;
}
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Message_4006, Message4EditPart.VISUAL_ID));
@@ -2331,32 +2331,32 @@ public class UMLDiagramUpdater {
// Find container element for the link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof Interaction) {
- container = (Interaction)element;
+ for (EObject element = source; element != null && container == null; element = element.eContainer()) {
+ if (element instanceof Interaction) {
+ container = (Interaction) element;
}
}
- if(container == null) {
+ if (container == null) {
return Collections.emptyList();
}
Collection result = new LinkedList();
- for(Iterator links = container.getMessages().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Message) {
+ for (Iterator links = container.getMessages().iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Message) {
continue;
}
- Message link = (Message)linkObject;
- if(Message5EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Message link = (Message) linkObject;
+ if (Message5EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List targets = link.getOwnedElements();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof Element) {
+ if (false == theTarget instanceof Element) {
continue;
}
- Element dst = (Element)theTarget;
+ Element dst = (Element) theTarget;
Element src = link.getOwner();
- if(src != source) {
+ if (src != source) {
continue;
}
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Message_4007, Message5EditPart.VISUAL_ID));
@@ -2372,32 +2372,32 @@ public class UMLDiagramUpdater {
// Find container element for the link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof Interaction) {
- container = (Interaction)element;
+ for (EObject element = source; element != null && container == null; element = element.eContainer()) {
+ if (element instanceof Interaction) {
+ container = (Interaction) element;
}
}
- if(container == null) {
+ if (container == null) {
return Collections.emptyList();
}
Collection result = new LinkedList();
- for(Iterator links = container.getMessages().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Message) {
+ for (Iterator links = container.getMessages().iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Message) {
continue;
}
- Message link = (Message)linkObject;
- if(Message6EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Message link = (Message) linkObject;
+ if (Message6EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List targets = link.getOwnedElements();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof Element) {
+ if (false == theTarget instanceof Element) {
continue;
}
- Element dst = (Element)theTarget;
+ Element dst = (Element) theTarget;
Element src = link.getOwner();
- if(src != source) {
+ if (src != source) {
continue;
}
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Message_4008, Message6EditPart.VISUAL_ID));
@@ -2413,32 +2413,32 @@ public class UMLDiagramUpdater {
// Find container element for the link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof Interaction) {
- container = (Interaction)element;
+ for (EObject element = source; element != null && container == null; element = element.eContainer()) {
+ if (element instanceof Interaction) {
+ container = (Interaction) element;
}
}
- if(container == null) {
+ if (container == null) {
return Collections.emptyList();
}
Collection result = new LinkedList();
- for(Iterator links = container.getMessages().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Message) {
+ for (Iterator links = container.getMessages().iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Message) {
continue;
}
- Message link = (Message)linkObject;
- if(Message7EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Message link = (Message) linkObject;
+ if (Message7EditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List targets = link.getOwnedElements();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof Element) {
+ if (false == theTarget instanceof Element) {
continue;
}
- Element dst = (Element)theTarget;
+ Element dst = (Element) theTarget;
Element src = link.getOwner();
- if(src != source) {
+ if (src != source) {
continue;
}
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Message_4009, Message7EditPart.VISUAL_ID));
@@ -2451,8 +2451,8 @@ public class UMLDiagramUpdater {
*/
private static Collection<UMLLinkDescriptor> getOutgoingFeatureModelFacetLinks_Comment_AnnotatedElement_4010(Comment source) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> destinations = source.getAnnotatedElements().iterator(); destinations.hasNext();) {
- Element destination = (Element)destinations.next();
+ for (Iterator<?> destinations = source.getAnnotatedElements().iterator(); destinations.hasNext();) {
+ Element destination = (Element) destinations.next();
result.add(new UMLLinkDescriptor(source, destination, UMLElementTypes.CommentAnnotatedElement_4010, CommentAnnotatedElementEditPart.VISUAL_ID));
}
return result;
@@ -2463,8 +2463,8 @@ public class UMLDiagramUpdater {
*/
private static Collection<UMLLinkDescriptor> getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4011(Constraint source) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> destinations = source.getConstrainedElements().iterator(); destinations.hasNext();) {
- Element destination = (Element)destinations.next();
+ for (Iterator<?> destinations = source.getConstrainedElements().iterator(); destinations.hasNext();) {
+ Element destination = (Element) destinations.next();
result.add(new UMLLinkDescriptor(source, destination, UMLElementTypes.ConstraintConstrainedElement_4011, ConstraintConstrainedElementEditPart.VISUAL_ID));
}
return result;
@@ -2478,27 +2478,27 @@ public class UMLDiagramUpdater {
// Find container element for the link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof InteractionFragment) {
- container = (InteractionFragment)element;
+ for (EObject element = source; element != null && container == null; element = element.eContainer()) {
+ if (element instanceof InteractionFragment) {
+ container = (InteractionFragment) element;
}
}
- if(container == null) {
+ if (container == null) {
return Collections.emptyList();
}
Collection result = new LinkedList();
- for(Iterator links = container.getGeneralOrderings().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof GeneralOrdering) {
+ for (Iterator links = container.getGeneralOrderings().iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof GeneralOrdering) {
continue;
}
- GeneralOrdering link = (GeneralOrdering)linkObject;
- if(GeneralOrderingEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ GeneralOrdering link = (GeneralOrdering) linkObject;
+ if (GeneralOrderingEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
OccurrenceSpecification dst = link.getAfter();
OccurrenceSpecification src = link.getBefore();
- if(src != source) {
+ if (src != source) {
continue;
}
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.GeneralOrdering_4012, GeneralOrderingEditPart.VISUAL_ID));
@@ -2512,7 +2512,7 @@ public class UMLDiagramUpdater {
private static Collection<UMLLinkDescriptor> getOutgoingFeatureModelFacetLinks_Constraint_Context_8500(Constraint source) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
Namespace destination = source.getContext();
- if(destination == null) {
+ if (destination == null) {
return result;
}
result.add(new UMLLinkDescriptor(source, destination, UMLElementTypes.ConstraintContext_8500, ContextLinkEditPart.VISUAL_ID));
@@ -2527,6 +2527,7 @@ public class UMLDiagramUpdater {
/**
* @generated
*/
+ @Override
public List<UMLNodeDescriptor> getSemanticChildren(View view) {
return UMLDiagramUpdater.getSemanticChildren(view);
}
@@ -2534,6 +2535,7 @@ public class UMLDiagramUpdater {
/**
* @generated
*/
+ @Override
public List<UMLLinkDescriptor> getContainedLinks(View view) {
return UMLDiagramUpdater.getContainedLinks(view);
}
@@ -2541,6 +2543,7 @@ public class UMLDiagramUpdater {
/**
* @generated
*/
+ @Override
public List<UMLLinkDescriptor> getIncomingLinks(View view) {
return UMLDiagramUpdater.getIncomingLinks(view);
}
@@ -2548,6 +2551,7 @@ public class UMLDiagramUpdater {
/**
* @generated
*/
+ @Override
public List<UMLLinkDescriptor> getOutgoingLinks(View view) {
return UMLDiagramUpdater.getOutgoingLinks(view);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDocumentProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDocumentProvider.java
index 981e5c204ca..8c0b9341dbc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDocumentProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDocumentProvider.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -75,13 +75,15 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
/**
* @generated
*/
+ @Override
protected ElementInfo createElementInfo(Object element) throws CoreException {
- if(false == element instanceof FileEditorInput && false == element instanceof URIEditorInput) {
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, NLS.bind(Messages.UMLDocumentProvider_IncorrectInputError, new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
- null));
+ if (false == element instanceof FileEditorInput && false == element instanceof URIEditorInput) {
+ throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0,
+ NLS.bind(Messages.UMLDocumentProvider_IncorrectInputError, new Object[] { element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
+ null));
}
- IEditorInput editorInput = (IEditorInput)element;
- IDiagramDocument document = (IDiagramDocument)createDocument(editorInput);
+ IEditorInput editorInput = (IEditorInput) element;
+ IDiagramDocument document = (IDiagramDocument) createDocument(editorInput);
ResourceSetInfo info = new ResourceSetInfo(document, editorInput);
info.setModificationStamp(computeModificationStamp(info));
info.fStatus = null;
@@ -91,13 +93,15 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
/**
* @generated
*/
+ @Override
protected IDocument createDocument(Object element) throws CoreException {
- if(false == element instanceof FileEditorInput && false == element instanceof URIEditorInput) {
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, NLS.bind(Messages.UMLDocumentProvider_IncorrectInputError, new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
- null));
+ if (false == element instanceof FileEditorInput && false == element instanceof URIEditorInput) {
+ throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0,
+ NLS.bind(Messages.UMLDocumentProvider_IncorrectInputError, new Object[] { element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
+ null));
}
IDocument document = createEmptyDocument();
- setDocumentContent(document, (IEditorInput)element);
+ setDocumentContent(document, (IEditorInput) element);
setupDocument(element, document);
return document;
}
@@ -105,11 +109,11 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
/**
* Sets up the given document as it would be provided for the given element. The content of the
* document is not changed. This default implementation is empty. Subclasses may reimplement.
- *
+ *
* @param element
- * the blue-print element
+ * the blue-print element
* @param document
- * the document to set up
+ * the document to set up
* @generated
*/
protected void setupDocument(Object element, IDocument document) {
@@ -121,11 +125,11 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
*/
private long computeModificationStamp(ResourceSetInfo info) {
int result = 0;
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
Resource nextResource = it.next();
IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null) {
- if(file.getLocation() != null) {
+ if (file != null) {
+ if (file.getLocation() != null) {
result += file.getLocation().toFile().lastModified();
} else {
result += file.getModificationStamp();
@@ -138,6 +142,7 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
/**
* @generated
*/
+ @Override
protected IDocument createEmptyDocument() {
DiagramDocument document = new DiagramDocument();
document.setEditingDomain(createEditingDomain());
@@ -150,28 +155,33 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
private TransactionalEditingDomain createEditingDomain() {
TransactionalEditingDomain editingDomain = DiagramEditingDomainFactory.getInstance().createEditingDomain();
editingDomain.setID("org.eclipse.papyrus.uml.diagram.sequence.EditingDomain"); //$NON-NLS-1$
- final NotificationFilter diagramResourceModifiedFilter = NotificationFilter.createNotifierFilter(editingDomain.getResourceSet()).and(NotificationFilter.createEventTypeFilter(Notification.ADD)).and(NotificationFilter.createFeatureFilter(ResourceSet.class, ResourceSet.RESOURCE_SET__RESOURCES));
+ final NotificationFilter diagramResourceModifiedFilter = NotificationFilter.createNotifierFilter(editingDomain.getResourceSet()).and(NotificationFilter.createEventTypeFilter(Notification.ADD))
+ .and(NotificationFilter.createFeatureFilter(ResourceSet.class, ResourceSet.RESOURCE_SET__RESOURCES));
editingDomain.getResourceSet().eAdapters().add(new Adapter() {
private Notifier myTarger;
+ @Override
public Notifier getTarget() {
return myTarger;
}
+ @Override
public boolean isAdapterForType(Object type) {
return false;
}
+ @Override
public void notifyChanged(Notification notification) {
- if(diagramResourceModifiedFilter.matches(notification)) {
+ if (diagramResourceModifiedFilter.matches(notification)) {
Object value = notification.getNewValue();
- if(value instanceof Resource) {
- ((Resource)value).setTrackingModification(true);
+ if (value instanceof Resource) {
+ ((Resource) value).setTrackingModification(true);
}
}
}
+ @Override
public void setTarget(Notifier newTarget) {
myTarger = newTarget;
}
@@ -183,24 +193,24 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
* @generated
*/
protected void setDocumentContent(IDocument document, IEditorInput element) throws CoreException {
- IDiagramDocument diagramDocument = (IDiagramDocument)document;
+ IDiagramDocument diagramDocument = (IDiagramDocument) document;
TransactionalEditingDomain domain = diagramDocument.getEditingDomain();
- if(element instanceof FileEditorInput) {
- IStorage storage = ((FileEditorInput)element).getStorage();
+ if (element instanceof FileEditorInput) {
+ IStorage storage = ((FileEditorInput) element).getStorage();
Diagram diagram = DiagramIOUtil.load(domain, storage, true, getProgressMonitor());
document.setContent(diagram);
- } else if(element instanceof URIEditorInput) {
- URI uri = ((URIEditorInput)element).getURI();
+ } else if (element instanceof URIEditorInput) {
+ URI uri = ((URIEditorInput) element).getURI();
Resource resource = null;
try {
resource = domain.getResourceSet().getResource(uri.trimFragment(), false);
- if(resource == null) {
+ if (resource == null) {
resource = domain.getResourceSet().createResource(uri.trimFragment());
}
- if(!resource.isLoaded()) {
+ if (!resource.isLoaded()) {
try {
Map options = new HashMap(GMFResourceFactory.getDefaultLoadOptions());
- // @see 171060
+ // @see 171060
// options.put(org.eclipse.emf.ecore.xmi.XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE);
resource.load(options);
} catch (IOException e) {
@@ -208,17 +218,17 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
throw e;
}
}
- if(uri.fragment() != null) {
+ if (uri.fragment() != null) {
EObject rootElement = resource.getEObject(uri.fragment());
- if(rootElement instanceof Diagram) {
- document.setContent((Diagram)rootElement);
+ if (rootElement instanceof Diagram) {
+ document.setContent(rootElement);
return;
}
} else {
- for(Iterator it = resource.getContents().iterator(); it.hasNext();) {
+ for (Iterator it = resource.getContents().iterator(); it.hasNext();) {
Object rootElement = it.next();
- if(rootElement instanceof Diagram) {
- document.setContent((Diagram)rootElement);
+ if (rootElement instanceof Diagram) {
+ document.setContent(rootElement);
return;
}
}
@@ -226,8 +236,8 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
throw new RuntimeException(Messages.UMLDocumentProvider_NoDiagramInResourceError);
} catch (Exception e) {
CoreException thrownExcp = null;
- if(e instanceof CoreException) {
- thrownExcp = (CoreException)e;
+ if (e instanceof CoreException) {
+ thrownExcp = (CoreException) e;
} else {
String msg = e.getLocalizedMessage();
thrownExcp = new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, msg != null ? msg : Messages.UMLDocumentProvider_DiagramLoadingError, e));
@@ -235,17 +245,19 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
throw thrownExcp;
}
} else {
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, NLS.bind(Messages.UMLDocumentProvider_IncorrectInputError, new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
- null));
+ throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0,
+ NLS.bind(Messages.UMLDocumentProvider_IncorrectInputError, new Object[] { element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
+ null));
}
}
/**
* @generated
*/
+ @Override
public long getModificationStamp(Object element) {
ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
+ if (info != null) {
return computeModificationStamp(info);
}
return super.getModificationStamp(element);
@@ -254,11 +266,12 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
/**
* @generated
*/
+ @Override
public boolean isDeleted(Object element) {
IDiagramDocument document = getDiagramDocument(element);
- if(document != null) {
+ if (document != null) {
Resource diagramResource = document.getDiagram().eResource();
- if(diagramResource != null) {
+ if (diagramResource != null) {
IFile file = WorkspaceSynchronizer.getFile(diagramResource);
return file == null || file.getLocation() == null || !file.getLocation().toFile().exists();
}
@@ -270,15 +283,16 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
* @generated
*/
public ResourceSetInfo getResourceSetInfo(Object editorInput) {
- return (ResourceSetInfo)super.getElementInfo(editorInput);
+ return (ResourceSetInfo) super.getElementInfo(editorInput);
}
/**
* @generated
*/
+ @Override
protected void disposeElementInfo(Object element, ElementInfo info) {
- if(info instanceof ResourceSetInfo) {
- ResourceSetInfo resourceSetInfo = (ResourceSetInfo)info;
+ if (info instanceof ResourceSetInfo) {
+ ResourceSetInfo resourceSetInfo = (ResourceSetInfo) info;
resourceSetInfo.dispose();
}
super.disposeElementInfo(element, info);
@@ -287,18 +301,19 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
/**
* @generated
*/
+ @Override
protected void doValidateState(Object element, Object computationContext) throws CoreException {
ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
+ if (info != null) {
LinkedList<IFile> files2Validate = new LinkedList<IFile>();
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
Resource nextResource = it.next();
IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null && file.isReadOnly()) {
+ if (file != null && file.isReadOnly()) {
files2Validate.add(file);
}
}
- ResourcesPlugin.getWorkspace().validateEdit((IFile[])files2Validate.toArray(new IFile[files2Validate.size()]), computationContext);
+ ResourcesPlugin.getWorkspace().validateEdit(files2Validate.toArray(new IFile[files2Validate.size()]), computationContext);
}
super.doValidateState(element, computationContext);
}
@@ -306,10 +321,11 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
/**
* @generated
*/
+ @Override
public boolean isReadOnly(Object element) {
ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- if(info.isUpdateCache()) {
+ if (info != null) {
+ if (info.isUpdateCache()) {
try {
updateCache(element);
} catch (CoreException ex) {
@@ -325,15 +341,16 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
/**
* @generated
*/
+ @Override
public boolean isModifiable(Object element) {
- if(!isStateValidated(element)) {
- if(element instanceof FileEditorInput || element instanceof URIEditorInput) {
+ if (!isStateValidated(element)) {
+ if (element instanceof FileEditorInput || element instanceof URIEditorInput) {
return true;
}
}
ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- if(info.isUpdateCache()) {
+ if (info != null) {
+ if (info.isUpdateCache()) {
try {
updateCache(element);
} catch (CoreException ex) {
@@ -351,11 +368,11 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
*/
protected void updateCache(Object element) throws CoreException {
ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ if (info != null) {
+ for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
Resource nextResource = it.next();
IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null && file.isReadOnly()) {
+ if (file != null && file.isReadOnly()) {
info.setReadOnly(true);
info.setModifiable(false);
return;
@@ -370,9 +387,10 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
/**
* @generated
*/
+ @Override
protected void doUpdateStateCache(Object element) throws CoreException {
ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
+ if (info != null) {
info.setUpdateCache(true);
}
super.doUpdateStateCache(element);
@@ -381,9 +399,10 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
/**
* @generated
*/
+ @Override
public boolean isSynchronized(Object element) {
ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
+ if (info != null) {
return info.isSynchronized();
}
return super.isSynchronized(element);
@@ -392,18 +411,19 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
/**
* @generated
*/
+ @Override
protected ISchedulingRule getResetRule(Object element) {
ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
+ if (info != null) {
LinkedList<ISchedulingRule> rules = new LinkedList<ISchedulingRule>();
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
Resource nextResource = it.next();
IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null) {
+ if (file != null) {
rules.add(ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(file));
}
}
- return new MultiRule((ISchedulingRule[])rules.toArray(new ISchedulingRule[rules.size()]));
+ return new MultiRule(rules.toArray(new ISchedulingRule[rules.size()]));
}
return null;
}
@@ -411,18 +431,19 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
/**
* @generated
*/
+ @Override
protected ISchedulingRule getSaveRule(Object element) {
ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
+ if (info != null) {
LinkedList<ISchedulingRule> rules = new LinkedList<ISchedulingRule>();
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
Resource nextResource = it.next();
IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null) {
+ if (file != null) {
rules.add(computeSchedulingRule(file));
}
}
- return new MultiRule((ISchedulingRule[])rules.toArray(new ISchedulingRule[rules.size()]));
+ return new MultiRule(rules.toArray(new ISchedulingRule[rules.size()]));
}
return null;
}
@@ -430,18 +451,19 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
/**
* @generated
*/
+ @Override
protected ISchedulingRule getSynchronizeRule(Object element) {
ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
+ if (info != null) {
LinkedList<ISchedulingRule> rules = new LinkedList<ISchedulingRule>();
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
Resource nextResource = it.next();
IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null) {
+ if (file != null) {
rules.add(ResourcesPlugin.getWorkspace().getRuleFactory().refreshRule(file));
}
}
- return new MultiRule((ISchedulingRule[])rules.toArray(new ISchedulingRule[rules.size()]));
+ return new MultiRule(rules.toArray(new ISchedulingRule[rules.size()]));
}
return null;
}
@@ -449,18 +471,19 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
/**
* @generated
*/
+ @Override
protected ISchedulingRule getValidateStateRule(Object element) {
ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
+ if (info != null) {
LinkedList<ISchedulingRule> files = new LinkedList<ISchedulingRule>();
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
Resource nextResource = it.next();
IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null) {
+ if (file != null) {
files.add(file);
}
}
- return ResourcesPlugin.getWorkspace().getRuleFactory().validateEditRule((IFile[])files.toArray(new IFile[files.size()]));
+ return ResourcesPlugin.getWorkspace().getRuleFactory().validateEditRule(files.toArray(new IFile[files.size()]));
}
return null;
}
@@ -469,8 +492,9 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
* @generated
*/
private ISchedulingRule computeSchedulingRule(IResource toCreateOrModify) {
- if(toCreateOrModify.exists())
+ if (toCreateOrModify.exists()) {
return ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(toCreateOrModify);
+ }
IResource parent = toCreateOrModify;
do {
/*
@@ -481,17 +505,18 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
*/
toCreateOrModify = parent;
parent = toCreateOrModify.getParent();
- } while(parent != null && !parent.exists());
+ } while (parent != null && !parent.exists());
return ResourcesPlugin.getWorkspace().getRuleFactory().createRule(toCreateOrModify);
}
/**
* @generated
*/
+ @Override
protected void doSynchronize(Object element, IProgressMonitor monitor) throws CoreException {
ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ if (info != null) {
+ for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
Resource nextResource = it.next();
handleElementChanged(info, nextResource, monitor);
}
@@ -503,20 +528,21 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
/**
* @generated
*/
+ @Override
protected void doSaveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) throws CoreException {
ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- if(!overwrite && !info.isSynchronized()) {
+ if (info != null) {
+ if (!overwrite && !info.isSynchronized()) {
throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, IResourceStatus.OUT_OF_SYNC_LOCAL, Messages.UMLDocumentProvider_UnsynchronizedFileSaveError, null));
}
info.stopResourceListening();
fireElementStateChanging(element);
try {
- monitor.beginTask(Messages.UMLDocumentProvider_SaveDiagramTask, info.getResourceSet().getResources().size() + 1); //"Saving diagram"
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ monitor.beginTask(Messages.UMLDocumentProvider_SaveDiagramTask, info.getResourceSet().getResources().size() + 1); // "Saving diagram"
+ for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
Resource nextResource = it.next();
monitor.setTaskName(NLS.bind(Messages.UMLDocumentProvider_SaveNextResourceTask, nextResource.getURI()));
- if(nextResource.isLoaded() && !info.getEditingDomain().isReadOnly(nextResource)) {
+ if (nextResource.isLoaded() && !info.getEditingDomain().isReadOnly(nextResource)) {
try {
nextResource.save(UMLDiagramEditorUtil.getSaveOptions());
} catch (IOException e) {
@@ -537,27 +563,29 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
} else {
URI newResoruceURI;
List<IFile> affectedFiles = null;
- if(element instanceof FileEditorInput) {
- IFile newFile = ((FileEditorInput)element).getFile();
+ if (element instanceof FileEditorInput) {
+ IFile newFile = ((FileEditorInput) element).getFile();
affectedFiles = Collections.singletonList(newFile);
newResoruceURI = URI.createPlatformResourceURI(newFile.getFullPath().toString(), true);
- } else if(element instanceof URIEditorInput) {
- newResoruceURI = ((URIEditorInput)element).getURI();
+ } else if (element instanceof URIEditorInput) {
+ newResoruceURI = ((URIEditorInput) element).getURI();
} else {
fireElementStateChangeFailed(element);
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, NLS.bind(Messages.UMLDocumentProvider_IncorrectInputError, new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
- null));
+ throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, NLS.bind(Messages.UMLDocumentProvider_IncorrectInputError, new Object[] { element,
+ "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
+ null));
}
- if(false == document instanceof IDiagramDocument) {
+ if (false == document instanceof IDiagramDocument) {
fireElementStateChangeFailed(element);
throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, "Incorrect document used: " + document + " instead of org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument", null)); //$NON-NLS-1$ //$NON-NLS-2$
}
- IDiagramDocument diagramDocument = (IDiagramDocument)document;
+ IDiagramDocument diagramDocument = (IDiagramDocument) document;
final Resource newResource = diagramDocument.getEditingDomain().getResourceSet().createResource(newResoruceURI);
- final Diagram diagramCopy = (Diagram)EcoreUtil.copy(diagramDocument.getDiagram());
+ final Diagram diagramCopy = EcoreUtil.copy(diagramDocument.getDiagram());
try {
new AbstractTransactionalCommand(diagramDocument.getEditingDomain(), NLS.bind(Messages.UMLDocumentProvider_SaveAsOperation, diagramCopy.getName()), affectedFiles) {
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
newResource.getContents().add(diagramCopy);
return CommandResult.newOKCommandResult();
@@ -580,7 +608,7 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
*/
protected void handleElementChanged(ResourceSetInfo info, Resource changedResource, IProgressMonitor monitor) {
IFile file = WorkspaceSynchronizer.getFile(changedResource);
- if(file != null) {
+ if (file != null) {
try {
file.refreshLocal(IResource.DEPTH_INFINITE, monitor);
} catch (CoreException ex) {
@@ -597,7 +625,7 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
} catch (CoreException e) {
info.fStatus = e.getStatus();
}
- if(!info.fCanBeSaved) {
+ if (!info.fCanBeSaved) {
info.setModificationStamp(computeModificationStamp(info));
}
addUnchangedElementListeners(info.getEditorInput(), info);
@@ -608,7 +636,7 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
* @generated
*/
protected void handleElementMoved(IEditorInput input, URI uri) {
- if(input instanceof FileEditorInput) {
+ if (input instanceof FileEditorInput) {
IFile newFile = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(URI.decode(uri.path())).removeFirstSegments(1));
fireElementMoved(input, newFile == null ? null : new FileEditorInput(newFile));
return;
@@ -620,6 +648,7 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
/**
* @generated
*/
+ @Override
public IEditorInput createInputWithEditingDomain(IEditorInput editorInput, TransactionalEditingDomain domain) {
return editorInput;
}
@@ -627,10 +656,11 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
/**
* @generated
*/
+ @Override
public IDiagramDocument getDiagramDocument(Object element) {
IDocument doc = getDocument(element);
- if(doc instanceof IDiagramDocument) {
- return (IDiagramDocument)doc;
+ if (doc instanceof IDiagramDocument) {
+ return (IDiagramDocument) doc;
}
return null;
}
@@ -638,6 +668,7 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
/**
* @generated
*/
+ @Override
protected IRunnableContext getOperationRunner(IProgressMonitor monitor) {
return null;
}
@@ -752,7 +783,7 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
public void dispose() {
stopResourceListening();
getResourceSet().eAdapters().remove(myResourceSetListener);
- for(Iterator<Resource> it = getLoadedResourcesIterator(); it.hasNext();) {
+ for (Iterator<Resource> it = getLoadedResourcesIterator(); it.hasNext();) {
Resource resource = it.next();
resource.unload();
}
@@ -845,21 +876,24 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
/**
* @generated
*/
+ @Override
public void dispose() {
}
/**
* @generated
*/
+ @Override
public boolean handleResourceChanged(final Resource resource) {
- synchronized(ResourceSetInfo.this) {
- if(ResourceSetInfo.this.fCanBeSaved) {
+ synchronized (ResourceSetInfo.this) {
+ if (ResourceSetInfo.this.fCanBeSaved) {
ResourceSetInfo.this.setUnSynchronized(resource);
return true;
}
}
Display.getDefault().asyncExec(new Runnable() {
+ @Override
public void run() {
handleElementChanged(ResourceSetInfo.this, resource, null);
}
@@ -870,15 +904,17 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
/**
* @generated
*/
+ @Override
public boolean handleResourceDeleted(Resource resource) {
- synchronized(ResourceSetInfo.this) {
- if(ResourceSetInfo.this.fCanBeSaved) {
+ synchronized (ResourceSetInfo.this) {
+ if (ResourceSetInfo.this.fCanBeSaved) {
ResourceSetInfo.this.setUnSynchronized(resource);
return true;
}
}
Display.getDefault().asyncExec(new Runnable() {
+ @Override
public void run() {
fireElementDeleted(ResourceSetInfo.this.getEditorInput());
}
@@ -889,16 +925,18 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
/**
* @generated
*/
+ @Override
public boolean handleResourceMoved(Resource resource, final URI newURI) {
- synchronized(ResourceSetInfo.this) {
- if(ResourceSetInfo.this.fCanBeSaved) {
+ synchronized (ResourceSetInfo.this) {
+ if (ResourceSetInfo.this.fCanBeSaved) {
ResourceSetInfo.this.setUnSynchronized(resource);
return true;
}
}
- if(myDocument.getDiagram().eResource() == resource) {
+ if (myDocument.getDiagram().eResource() == resource) {
Display.getDefault().asyncExec(new Runnable() {
+ @Override
public void run() {
handleElementMoved(ResourceSetInfo.this.getEditorInput(), newURI);
}
@@ -937,34 +975,35 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
/**
* @generated
*/
+ @Override
public void notifyChanged(Notification notification) {
- if(notification.getNotifier() instanceof ResourceSet) {
+ if (notification.getNotifier() instanceof ResourceSet) {
super.notifyChanged(notification);
}
- if(!notification.isTouch() && myModifiedFilter.matches(notification)) {
- if(notification.getNotifier() instanceof Resource) {
- Resource resource = (Resource)notification.getNotifier();
- if(resource.isLoaded()) {
+ if (!notification.isTouch() && myModifiedFilter.matches(notification)) {
+ if (notification.getNotifier() instanceof Resource) {
+ Resource resource = (Resource) notification.getNotifier();
+ if (resource.isLoaded()) {
boolean modified = false;
- for(Iterator/* <org.eclipse.emf.ecore.resource.Resource> */it = myInfo.getLoadedResourcesIterator(); it.hasNext() && !modified;) {
- Resource nextResource = (Resource)it.next();
- if(nextResource.isLoaded()) {
+ for (Iterator/* <org.eclipse.emf.ecore.resource.Resource> */it = myInfo.getLoadedResourcesIterator(); it.hasNext() && !modified;) {
+ Resource nextResource = (Resource) it.next();
+ if (nextResource.isLoaded()) {
modified = nextResource.isModified();
}
}
boolean dirtyStateChanged = false;
- synchronized(myInfo) {
- if(modified != myInfo.fCanBeSaved) {
+ synchronized (myInfo) {
+ if (modified != myInfo.fCanBeSaved) {
myInfo.fCanBeSaved = modified;
dirtyStateChanged = true;
}
- if(!resource.isModified()) {
+ if (!resource.isModified()) {
myInfo.setSynchronized(resource);
}
}
- if(dirtyStateChanged) {
+ if (dirtyStateChanged) {
fireElementDirtyStateChanged(myInfo.getEditorInput(), modified);
- if(!modified) {
+ if (!modified) {
myInfo.setModificationStamp(computeModificationStamp(myInfo));
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLInitDiagramFileAction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLInitDiagramFileAction.java
index be4ce7a1c2a..81335f57cb5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLInitDiagramFileAction.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLInitDiagramFileAction.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -20,6 +20,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.workspace.WorkspaceEditingDomainFactory;
import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.MessageDialog;
@@ -50,6 +51,7 @@ public class UMLInitDiagramFileAction implements IObjectActionDelegate {
/**
* @generated
*/
+ @Override
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
this.targetPart = targetPart;
}
@@ -57,13 +59,14 @@ public class UMLInitDiagramFileAction implements IObjectActionDelegate {
/**
* @generated
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
domainModelURI = null;
action.setEnabled(false);
- if(selection instanceof IStructuredSelection == false || selection.isEmpty()) {
+ if (selection instanceof IStructuredSelection == false || selection.isEmpty()) {
return;
}
- IFile file = (IFile)((IStructuredSelection)selection).getFirstElement();
+ IFile file = (IFile) ((IStructuredSelection) selection).getFirstElement();
domainModelURI = URI.createPlatformResourceURI(file.getFullPath().toString(), true);
action.setEnabled(true);
}
@@ -78,17 +81,18 @@ public class UMLInitDiagramFileAction implements IObjectActionDelegate {
/**
* @generated
*/
+ @Override
public void run(IAction action) {
- TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE.createEditingDomain();
+ TransactionalEditingDomain editingDomain = WorkspaceEditingDomainFactory.INSTANCE.createEditingDomain();
ResourceSet resourceSet = editingDomain.getResourceSet();
EObject diagramRoot = null;
try {
Resource resource = resourceSet.getResource(domainModelURI, true);
- diagramRoot = (EObject)resource.getContents().get(0);
+ diagramRoot = resource.getContents().get(0);
} catch (WrappedException ex) {
UMLDiagramEditorPlugin.getInstance().logError("Unable to load resource: " + domainModelURI, ex); //$NON-NLS-1$
}
- if(diagramRoot == null) {
+ if (diagramRoot == null) {
MessageDialog.openError(getShell(), Messages.InitDiagramFile_ResourceErrorDialogTitle, Messages.InitDiagramFile_ResourceErrorDialogMessage);
return;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLLinkDescriptor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLLinkDescriptor.java
index 907818e13ea..be200760865 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLLinkDescriptor.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLLinkDescriptor.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLMatchingStrategy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLMatchingStrategy.java
index 5482cf6d14d..5ddcf829d2e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLMatchingStrategy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLMatchingStrategy.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -27,6 +27,7 @@ public class UMLMatchingStrategy implements IEditorMatchingStrategy {
/**
* @generated
*/
+ @Override
public boolean matches(IEditorReference editorRef, IEditorInput input) {
IEditorInput editorInput;
try {
@@ -34,11 +35,11 @@ public class UMLMatchingStrategy implements IEditorMatchingStrategy {
} catch (PartInitException e) {
return false;
}
- if(editorInput.equals(input)) {
+ if (editorInput.equals(input)) {
return true;
}
- if(editorInput instanceof URIEditorInput && input instanceof URIEditorInput) {
- return ((URIEditorInput)editorInput).getURI().equals(((URIEditorInput)input).getURI());
+ if (editorInput instanceof URIEditorInput && input instanceof URIEditorInput) {
+ return ((URIEditorInput) editorInput).getURI().equals(((URIEditorInput) input).getURI());
}
return false;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLNewDiagramFileWizard.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLNewDiagramFileWizard.java
index 2ea212241ff..aea722206b7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLNewDiagramFileWizard.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLNewDiagramFileWizard.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -74,9 +74,9 @@ public class UMLNewDiagramFileWizard extends Wizard {
myFileCreationPage.setDescription(NLS.bind(Messages.UMLNewDiagramFileWizard_CreationPageDescription, PackageEditPart.MODEL_ID));
IPath filePath;
String fileName = URI.decode(domainModelURI.trimFileExtension().lastSegment());
- if(domainModelURI.isPlatformResource()) {
+ if (domainModelURI.isPlatformResource()) {
filePath = new Path(domainModelURI.trimSegments(1).toPlatformString(true));
- } else if(domainModelURI.isFile()) {
+ } else if (domainModelURI.isFile()) {
filePath = new Path(domainModelURI.trimSegments(1).toFileString());
} else {
// TODO : use some default path
@@ -94,6 +94,7 @@ public class UMLNewDiagramFileWizard extends Wizard {
/**
* @generated
*/
+ @Override
public void addPages() {
addPage(myFileCreationPage);
addPage(diagramRootElementSelectionPage);
@@ -102,6 +103,7 @@ public class UMLNewDiagramFileWizard extends Wizard {
/**
* @generated
*/
+ @Override
public boolean performFinish() {
LinkedList<IFile> affectedFiles = new LinkedList<IFile>();
IFile diagramFile = myFileCreationPage.createNewFile();
@@ -112,9 +114,10 @@ public class UMLNewDiagramFileWizard extends Wizard {
final Resource diagramResource = resourceSet.createResource(diagramModelURI);
AbstractTransactionalCommand command = new AbstractTransactionalCommand(myEditingDomain, Messages.UMLNewDiagramFileWizard_InitDiagramCommand, affectedFiles) {
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
int diagramVID = UMLVisualIDRegistry.getDiagramVisualID(diagramRootElementSelectionPage.getModelElement());
- if(diagramVID != PackageEditPart.VISUAL_ID) {
+ if (diagramVID != PackageEditPart.VISUAL_ID) {
return CommandResult.newErrorCommandResult(Messages.UMLNewDiagramFileWizard_IncorrectRootError);
}
Diagram diagram = ViewService.createDiagram(diagramRootElementSelectionPage.getModelElement(), PackageEditPart.MODEL_ID, UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
@@ -151,6 +154,7 @@ public class UMLNewDiagramFileWizard extends Wizard {
/**
* @generated
*/
+ @Override
protected String getSelectionTitle() {
return Messages.UMLNewDiagramFileWizard_RootSelectionPageSelectionTitle;
}
@@ -158,8 +162,9 @@ public class UMLNewDiagramFileWizard extends Wizard {
/**
* @generated
*/
+ @Override
protected boolean validatePage() {
- if(getModelElement() == null) {
+ if (getModelElement() == null) {
setErrorMessage(Messages.UMLNewDiagramFileWizard_RootSelectionPageNoSelectionMessage);
return false;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLNodeDescriptor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLNodeDescriptor.java
index 5536ba1fc0d..7600fb9eccb 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLNodeDescriptor.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLNodeDescriptor.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLPaletteFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLPaletteFactory.java
index 2bb685f4b93..6f8e3c70145 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLPaletteFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLPaletteFactory.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -174,85 +174,85 @@ public class UMLPaletteFactory extends PaletteFactory.Adapter {
*/
@Override
public Tool createTool(String toolId) {
- if(toolId.equals(CREATELIFELINE1CREATIONTOOL)) {
+ if (toolId.equals(CREATELIFELINE1CREATIONTOOL)) {
return createLifeline1CreationTool();
}
- if(toolId.equals(CREATEACTIONEXECUTIONSPECIFICATION2CREATIONTOOL)) {
+ if (toolId.equals(CREATEACTIONEXECUTIONSPECIFICATION2CREATIONTOOL)) {
return createActionExecutionSpecification2CreationTool();
}
- if(toolId.equals(CREATEBEHAVIOREXECUTIONSPECIFICATION3CREATIONTOOL)) {
+ if (toolId.equals(CREATEBEHAVIOREXECUTIONSPECIFICATION3CREATIONTOOL)) {
return createBehaviorExecutionSpecification3CreationTool();
}
- if(toolId.equals(CREATEINTERACTIONUSE4CREATIONTOOL)) {
+ if (toolId.equals(CREATEINTERACTIONUSE4CREATIONTOOL)) {
return createInteractionUse4CreationTool();
}
- if(toolId.equals(CREATECOMBINEDFRAGMENT5CREATIONTOOL)) {
+ if (toolId.equals(CREATECOMBINEDFRAGMENT5CREATIONTOOL)) {
return createCombinedFragment5CreationTool();
}
- if(toolId.equals(CREATEINTERACTIONOPERAND6CREATIONTOOL)) {
+ if (toolId.equals(CREATEINTERACTIONOPERAND6CREATIONTOOL)) {
return createInteractionOperand6CreationTool();
}
- if(toolId.equals(CREATECONTINUATION7CREATIONTOOL)) {
+ if (toolId.equals(CREATECONTINUATION7CREATIONTOOL)) {
return createContinuation7CreationTool();
}
- if(toolId.equals(CREATESTATEINVARIANT8CREATIONTOOL)) {
+ if (toolId.equals(CREATESTATEINVARIANT8CREATIONTOOL)) {
return createStateInvariant8CreationTool();
}
- if(toolId.equals(CREATECOMMENT9CREATIONTOOL)) {
+ if (toolId.equals(CREATECOMMENT9CREATIONTOOL)) {
return createComment9CreationTool();
}
- if(toolId.equals(CREATECONSTRAINT10CREATIONTOOL)) {
+ if (toolId.equals(CREATECONSTRAINT10CREATIONTOOL)) {
return createConstraint10CreationTool();
}
- if(toolId.equals(CREATECOREGION11CREATIONTOOL)) {
+ if (toolId.equals(CREATECOREGION11CREATIONTOOL)) {
return createCoRegion11CreationTool();
}
- if(toolId.equals(CREATEDURATIONOBSERVATION12CREATIONTOOL)) {
+ if (toolId.equals(CREATEDURATIONOBSERVATION12CREATIONTOOL)) {
return createDurationObservation12CreationTool();
}
- if(toolId.equals(CREATETIMECONSTRAINT13CREATIONTOOL)) {
+ if (toolId.equals(CREATETIMECONSTRAINT13CREATIONTOOL)) {
return createTimeConstraint13CreationTool();
}
- if(toolId.equals(CREATETIMEOBSERVATION14CREATIONTOOL)) {
+ if (toolId.equals(CREATETIMEOBSERVATION14CREATIONTOOL)) {
return createTimeObservation14CreationTool();
}
- if(toolId.equals(CREATEDURATIONCONSTRAINT15CREATIONTOOL)) {
+ if (toolId.equals(CREATEDURATIONCONSTRAINT15CREATIONTOOL)) {
return createDurationConstraint15CreationTool();
}
- if(toolId.equals(CREATEDESTRUCTIONEVENT16CREATIONTOOL)) {
+ if (toolId.equals(CREATEDESTRUCTIONEVENT16CREATIONTOOL)) {
return createDestructionEvent16CreationTool();
}
- if(toolId.equals(CREATEMESSAGESYNC1CREATIONTOOL)) {
+ if (toolId.equals(CREATEMESSAGESYNC1CREATIONTOOL)) {
return createMessageSync1CreationTool();
}
- if(toolId.equals(CREATEMESSAGEASYNC2CREATIONTOOL)) {
+ if (toolId.equals(CREATEMESSAGEASYNC2CREATIONTOOL)) {
return createMessageAsync2CreationTool();
}
- if(toolId.equals(CREATEMESSAGEREPLY3CREATIONTOOL)) {
+ if (toolId.equals(CREATEMESSAGEREPLY3CREATIONTOOL)) {
return createMessageReply3CreationTool();
}
- if(toolId.equals(CREATEMESSAGECREATE4CREATIONTOOL)) {
+ if (toolId.equals(CREATEMESSAGECREATE4CREATIONTOOL)) {
return createMessageCreate4CreationTool();
}
- if(toolId.equals(CREATEMESSAGEDELETE5CREATIONTOOL)) {
+ if (toolId.equals(CREATEMESSAGEDELETE5CREATIONTOOL)) {
return createMessageDelete5CreationTool();
}
- if(toolId.equals(CREATEMESSAGELOST6CREATIONTOOL)) {
+ if (toolId.equals(CREATEMESSAGELOST6CREATIONTOOL)) {
return createMessageLost6CreationTool();
}
- if(toolId.equals(CREATEMESSAGEFOUND7CREATIONTOOL)) {
+ if (toolId.equals(CREATEMESSAGEFOUND7CREATIONTOOL)) {
return createMessageFound7CreationTool();
}
- if(toolId.equals(CREATEGENERALORDERING8CREATIONTOOL)) {
+ if (toolId.equals(CREATEGENERALORDERING8CREATIONTOOL)) {
return createGeneralOrdering8CreationTool();
}
- if(toolId.equals(CREATECOMMENTLINK9CREATIONTOOL)) {
+ if (toolId.equals(CREATECOMMENTLINK9CREATIONTOOL)) {
return createCommentlink9CreationTool();
}
- if(toolId.equals(CREATECONSTRAINTLINK10CREATIONTOOL)) {
+ if (toolId.equals(CREATECONSTRAINTLINK10CREATIONTOOL)) {
return createConstraintlink10CreationTool();
}
- if(toolId.equals(CREATECONTEXTLINK11CREATIONTOOL)) {
+ if (toolId.equals(CREATECONTEXTLINK11CREATIONTOOL)) {
return createContextLink11CreationTool();
}
// default return: null
@@ -262,6 +262,7 @@ public class UMLPaletteFactory extends PaletteFactory.Adapter {
/**
* @generated
*/
+ @Override
public Object getTemplate(String templateId) {
// default return: null
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLUriEditorInputTester.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLUriEditorInputTester.java
index d563d161afb..429f0d5947e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLUriEditorInputTester.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLUriEditorInputTester.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -24,11 +24,12 @@ public class UMLUriEditorInputTester extends PropertyTester {
/**
* @generated
*/
+ @Override
public boolean test(Object receiver, String method, Object[] args, Object expectedValue) {
- if(false == receiver instanceof URIEditorInput) {
+ if (false == receiver instanceof URIEditorInput) {
return false;
}
- URIEditorInput editorInput = (URIEditorInput)receiver;
+ URIEditorInput editorInput = (URIEditorInput) receiver;
return "PapyrusUMLSequence_diagram".equals(editorInput.getURI().fileExtension()); //$NON-NLS-1$
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLVisualIDRegistry.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLVisualIDRegistry.java
index 05ae3190680..628c920d5ef 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLVisualIDRegistry.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLVisualIDRegistry.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -100,7 +100,7 @@ import org.eclipse.uml2.uml.UMLPackage;
/**
* This registry is used to determine which type of visual object should be created for the
* corresponding Diagram, Node, ChildNode or Link represented by a domain model object.
- *
+ *
* @generated
*/
public class UMLVisualIDRegistry {
@@ -114,8 +114,8 @@ public class UMLVisualIDRegistry {
* @generated
*/
public static int getVisualID(View view) {
- if(view instanceof Diagram) {
- if(PackageEditPart.MODEL_ID.equals(view.getType())) {
+ if (view instanceof Diagram) {
+ if (PackageEditPart.MODEL_ID.equals(view.getType())) {
return PackageEditPart.VISUAL_ID;
} else {
return -1;
@@ -129,12 +129,12 @@ public class UMLVisualIDRegistry {
*/
public static String getModelID(View view) {
View diagram = view.getDiagram();
- while(view != diagram) {
+ while (view != diagram) {
EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
- if(annotation != null) {
- return (String)annotation.getDetails().get("modelID"); //$NON-NLS-1$
+ if (annotation != null) {
+ return annotation.getDetails().get("modelID"); //$NON-NLS-1$
}
- view = (View)view.eContainer();
+ view = (View) view.eContainer();
}
return diagram != null ? diagram.getType() : null;
}
@@ -146,7 +146,7 @@ public class UMLVisualIDRegistry {
try {
return Integer.parseInt(type);
} catch (NumberFormatException e) {
- if(Boolean.TRUE.toString().equalsIgnoreCase(Platform.getDebugOption(DEBUG_KEY))) {
+ if (Boolean.TRUE.toString().equalsIgnoreCase(Platform.getDebugOption(DEBUG_KEY))) {
UMLDiagramEditorPlugin.getInstance().logError("Unable to parse view type as a visualID number: " + type);
}
}
@@ -169,138 +169,138 @@ public class UMLVisualIDRegistry {
/**
* Generated not for add lifelines on lifeline
- *
+ *
* @generated NOT (update at each gmf change) lifeline, handle duration constraint/observation on message
*/
public static int getNodeVisualID(View containerView, EObject domainElement) {
- if(domainElement == null) {
+ if (domainElement == null) {
return -1;
}
String containerModelID = org.eclipse.papyrus.uml.diagram.sequence.part.UMLVisualIDRegistry.getModelID(containerView);
- if(!PackageEditPart.MODEL_ID.equals(containerModelID)) {
+ if (!PackageEditPart.MODEL_ID.equals(containerModelID)) {
return -1;
}
int containerVisualID;
- if(PackageEditPart.MODEL_ID.equals(containerModelID)) {
+ if (PackageEditPart.MODEL_ID.equals(containerModelID)) {
containerVisualID = org.eclipse.papyrus.uml.diagram.sequence.part.UMLVisualIDRegistry.getVisualID(containerView);
} else {
- if(containerView instanceof Diagram) {
+ if (containerView instanceof Diagram) {
containerVisualID = PackageEditPart.VISUAL_ID;
} else {
return -1;
}
}
- switch(containerVisualID) {
+ switch (containerVisualID) {
case PackageEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
return InteractionEditPart.VISUAL_ID;
}
break;
case InteractionEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
return DurationConstraintInMessageEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationObservation().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationObservation().isSuperTypeOf(domainElement.eClass())) {
return DurationObservationEditPart.VISUAL_ID;
}
break;
case InteractionOperandEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getInteractionUse().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteractionUse().isSuperTypeOf(domainElement.eClass())) {
return InteractionUseEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getConsiderIgnoreFragment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConsiderIgnoreFragment().isSuperTypeOf(domainElement.eClass())) {
return ConsiderIgnoreFragmentEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCombinedFragment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCombinedFragment().isSuperTypeOf(domainElement.eClass())) {
return CombinedFragmentEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getContinuation().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getContinuation().isSuperTypeOf(domainElement.eClass())) {
return ContinuationEditPart.VISUAL_ID;
}
break;
case LifelineEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getActionExecutionSpecification().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActionExecutionSpecification().isSuperTypeOf(domainElement.eClass())) {
return ActionExecutionSpecificationEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getBehaviorExecutionSpecification().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getBehaviorExecutionSpecification().isSuperTypeOf(domainElement.eClass())) {
return BehaviorExecutionSpecificationEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getStateInvariant().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getStateInvariant().isSuperTypeOf(domainElement.eClass())) {
return StateInvariantEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCombinedFragment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCombinedFragment().isSuperTypeOf(domainElement.eClass())) {
return CombinedFragment2EditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
return TimeConstraintEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeObservation().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeObservation().isSuperTypeOf(domainElement.eClass())) {
return TimeObservationEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
// handle duration constraint/observation on message
- List<Element> occurrences = ((DurationConstraint)domainElement).getConstrainedElements();
- if(occurrences.size() >= 2 && occurrences.get(0) instanceof OccurrenceSpecification && occurrences.get(1) instanceof OccurrenceSpecification) {
- if(DurationConstraintHelper.endsOfSameMessage((OccurrenceSpecification)occurrences.get(0), (OccurrenceSpecification)occurrences.get(1))) {
+ List<Element> occurrences = ((DurationConstraint) domainElement).getConstrainedElements();
+ if (occurrences.size() >= 2 && occurrences.get(0) instanceof OccurrenceSpecification && occurrences.get(1) instanceof OccurrenceSpecification) {
+ if (DurationConstraintHelper.endsOfSameMessage((OccurrenceSpecification) occurrences.get(0), (OccurrenceSpecification) occurrences.get(1))) {
return DurationConstraintInMessageEditPart.VISUAL_ID;
}
}
return DurationConstraintEditPart.VISUAL_ID;
}
// handle duration constraint/observation on message
- if(UMLPackage.eINSTANCE.getDurationObservation().isSuperTypeOf(domainElement.eClass())) {
- List<NamedElement> occurrences = ((DurationObservation)domainElement).getEvents();
- if(occurrences.size() >= 2 && occurrences.get(0) instanceof OccurrenceSpecification && occurrences.get(1) instanceof OccurrenceSpecification) {
- if(DurationObservationHelper.endsOfSameMessage((OccurrenceSpecification)occurrences.get(0), (OccurrenceSpecification)occurrences.get(1))) {
+ if (UMLPackage.eINSTANCE.getDurationObservation().isSuperTypeOf(domainElement.eClass())) {
+ List<NamedElement> occurrences = ((DurationObservation) domainElement).getEvents();
+ if (occurrences.size() >= 2 && occurrences.get(0) instanceof OccurrenceSpecification && occurrences.get(1) instanceof OccurrenceSpecification) {
+ if (DurationObservationHelper.endsOfSameMessage((OccurrenceSpecification) occurrences.get(0), (OccurrenceSpecification) occurrences.get(1))) {
return DurationObservationEditPart.VISUAL_ID;
}
}
}
- if(UMLPackage.eINSTANCE.getDestructionOccurrenceSpecification().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDestructionOccurrenceSpecification().isSuperTypeOf(domainElement.eClass())) {
return DestructionOccurrenceSpecificationEditPart.VISUAL_ID;
}
// lifeline : add lifelines on lifeline
- if(UMLPackage.eINSTANCE.getLifeline().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getLifeline().isSuperTypeOf(domainElement.eClass())) {
return LifelineEditPart.VISUAL_ID;
}
break;
case InteractionInteractionCompartmentEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getConsiderIgnoreFragment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConsiderIgnoreFragment().isSuperTypeOf(domainElement.eClass())) {
return ConsiderIgnoreFragmentEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCombinedFragment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCombinedFragment().isSuperTypeOf(domainElement.eClass())) {
return CombinedFragmentEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getLifeline().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getLifeline().isSuperTypeOf(domainElement.eClass())) {
return LifelineEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteractionOperand().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteractionOperand().isSuperTypeOf(domainElement.eClass())) {
return InteractionOperandEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteractionUse().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteractionUse().isSuperTypeOf(domainElement.eClass())) {
return InteractionUseEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
return ConstraintEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
return CommentEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeObservation().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeObservation().isSuperTypeOf(domainElement.eClass())) {
return TimeObservationEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationObservation().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationObservation().isSuperTypeOf(domainElement.eClass())) {
return DurationObservationEditPart.VISUAL_ID;
}
break;
case CombinedFragmentCombinedFragmentCompartmentEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getInteractionOperand().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteractionOperand().isSuperTypeOf(domainElement.eClass())) {
return InteractionOperandEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getContinuation().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getContinuation().isSuperTypeOf(domainElement.eClass())) {
return ContinuationEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCombinedFragment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCombinedFragment().isSuperTypeOf(domainElement.eClass())) {
return CombinedFragmentEditPart.VISUAL_ID;
}
break;
@@ -312,10 +312,10 @@ public class UMLVisualIDRegistry {
case Message5EditPart.VISUAL_ID:
case Message6EditPart.VISUAL_ID:
case Message7EditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
return DurationConstraintInMessageEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationObservation().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationObservation().isSuperTypeOf(domainElement.eClass())) {
return DurationObservationEditPart.VISUAL_ID;
}
break;
@@ -328,250 +328,250 @@ public class UMLVisualIDRegistry {
*/
public static boolean canCreateNode(View containerView, int nodeVisualID) {
String containerModelID = org.eclipse.papyrus.uml.diagram.sequence.part.UMLVisualIDRegistry.getModelID(containerView);
- if(!PackageEditPart.MODEL_ID.equals(containerModelID)) {
+ if (!PackageEditPart.MODEL_ID.equals(containerModelID)) {
return false;
}
int containerVisualID;
- if(PackageEditPart.MODEL_ID.equals(containerModelID)) {
+ if (PackageEditPart.MODEL_ID.equals(containerModelID)) {
containerVisualID = org.eclipse.papyrus.uml.diagram.sequence.part.UMLVisualIDRegistry.getVisualID(containerView);
} else {
- if(containerView instanceof Diagram) {
+ if (containerView instanceof Diagram) {
containerVisualID = PackageEditPart.VISUAL_ID;
} else {
return false;
}
}
- switch(containerVisualID) {
+ switch (containerVisualID) {
case PackageEditPart.VISUAL_ID:
- if(InteractionEditPart.VISUAL_ID == nodeVisualID) {
+ if (InteractionEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case InteractionEditPart.VISUAL_ID:
- if(InteractionNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (InteractionNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionInteractionCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+ if (InteractionInteractionCompartmentEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintInMessageEditPart.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintInMessageEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationObservationEditPart.VISUAL_ID == nodeVisualID) {
+ if (DurationObservationEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case CombinedFragmentEditPart.VISUAL_ID:
- if(CombinedFragmentCombinedFragmentCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+ if (CombinedFragmentCombinedFragmentCompartmentEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case InteractionOperandEditPart.VISUAL_ID:
- if(InteractionUseEditPart.VISUAL_ID == nodeVisualID) {
+ if (InteractionUseEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConsiderIgnoreFragmentEditPart.VISUAL_ID == nodeVisualID) {
+ if (ConsiderIgnoreFragmentEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CombinedFragmentEditPart.VISUAL_ID == nodeVisualID) {
+ if (CombinedFragmentEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ContinuationEditPart.VISUAL_ID == nodeVisualID) {
+ if (ContinuationEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case InteractionUseEditPart.VISUAL_ID:
- if(InteractionUseNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (InteractionUseNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionUseName2EditPart.VISUAL_ID == nodeVisualID) {
+ if (InteractionUseName2EditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ContinuationEditPart.VISUAL_ID:
- if(ContinuationNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (ContinuationNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case LifelineEditPart.VISUAL_ID:
- if(LifelineEditPart.VISUAL_ID == nodeVisualID) {
+ if (LifelineEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(LifelineNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (LifelineNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActionExecutionSpecificationEditPart.VISUAL_ID == nodeVisualID) {
+ if (ActionExecutionSpecificationEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(BehaviorExecutionSpecificationEditPart.VISUAL_ID == nodeVisualID) {
+ if (BehaviorExecutionSpecificationEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(StateInvariantEditPart.VISUAL_ID == nodeVisualID) {
+ if (StateInvariantEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CombinedFragment2EditPart.VISUAL_ID == nodeVisualID) {
+ if (CombinedFragment2EditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeConstraintEditPart.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeObservationEditPart.VISUAL_ID == nodeVisualID) {
+ if (TimeObservationEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintEditPart.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DestructionOccurrenceSpecificationEditPart.VISUAL_ID == nodeVisualID) {
+ if (DestructionOccurrenceSpecificationEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case StateInvariantEditPart.VISUAL_ID:
- if(StateInvariantNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (StateInvariantNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case TimeConstraintEditPart.VISUAL_ID:
- if(TimeConstraintLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeConstraintAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case TimeObservationEditPart.VISUAL_ID:
- if(TimeObservationLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (TimeObservationLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeObservationAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
+ if (TimeObservationAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case DurationConstraintEditPart.VISUAL_ID:
- if(DurationConstraintLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ConstraintEditPart.VISUAL_ID:
- if(ConstraintNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (ConstraintNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(Constraint2EditPart.VISUAL_ID == nodeVisualID) {
+ if (Constraint2EditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case CommentEditPart.VISUAL_ID:
- if(CommentBodyEditPart.VISUAL_ID == nodeVisualID) {
+ if (CommentBodyEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case DurationConstraintInMessageEditPart.VISUAL_ID:
- if(DurationConstraintInMessageLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintInMessageLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintInMessageAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintInMessageAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case DurationObservationEditPart.VISUAL_ID:
- if(DurationObservationLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (DurationObservationLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationObservationAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
+ if (DurationObservationAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case InteractionInteractionCompartmentEditPart.VISUAL_ID:
- if(ConsiderIgnoreFragmentEditPart.VISUAL_ID == nodeVisualID) {
+ if (ConsiderIgnoreFragmentEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CombinedFragmentEditPart.VISUAL_ID == nodeVisualID) {
+ if (CombinedFragmentEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(LifelineEditPart.VISUAL_ID == nodeVisualID) {
+ if (LifelineEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionUseEditPart.VISUAL_ID == nodeVisualID) {
+ if (InteractionUseEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConstraintEditPart.VISUAL_ID == nodeVisualID) {
+ if (ConstraintEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CommentEditPart.VISUAL_ID == nodeVisualID) {
+ if (CommentEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeObservationEditPart.VISUAL_ID == nodeVisualID) {
+ if (TimeObservationEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationObservationEditPart.VISUAL_ID == nodeVisualID) {
+ if (DurationObservationEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case CombinedFragmentCombinedFragmentCompartmentEditPart.VISUAL_ID:
- if(InteractionOperandEditPart.VISUAL_ID == nodeVisualID) {
+ if (InteractionOperandEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case MessageEditPart.VISUAL_ID:
- if(MessageNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (MessageNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(MessageSyncAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
+ if (MessageSyncAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case Message2EditPart.VISUAL_ID:
- if(MessageName2EditPart.VISUAL_ID == nodeVisualID) {
+ if (MessageName2EditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(MessageAsyncAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
+ if (MessageAsyncAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case Message3EditPart.VISUAL_ID:
- if(MessageName3EditPart.VISUAL_ID == nodeVisualID) {
+ if (MessageName3EditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(MessageReplyAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
+ if (MessageReplyAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case Message4EditPart.VISUAL_ID:
- if(MessageName4EditPart.VISUAL_ID == nodeVisualID) {
+ if (MessageName4EditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(MessageCreateAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
+ if (MessageCreateAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case Message5EditPart.VISUAL_ID:
- if(MessageName5EditPart.VISUAL_ID == nodeVisualID) {
+ if (MessageName5EditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(MessageDeleteAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
+ if (MessageDeleteAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case Message6EditPart.VISUAL_ID:
- if(MessageName6EditPart.VISUAL_ID == nodeVisualID) {
+ if (MessageName6EditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(MessageLostAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
+ if (MessageLostAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case Message7EditPart.VISUAL_ID:
- if(MessageName7EditPart.VISUAL_ID == nodeVisualID) {
+ if (MessageName7EditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(MessageFoundAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
+ if (MessageFoundAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case GeneralOrderingEditPart.VISUAL_ID:
- if(GeneralOrderingAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
+ if (GeneralOrderingAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
@@ -583,31 +583,31 @@ public class UMLVisualIDRegistry {
* @generated
*/
public static int getLinkWithClassVisualID(EObject domainElement) {
- if(domainElement == null) {
+ if (domainElement == null) {
return -1;
}
- if(UMLPackage.eINSTANCE.getMessage().isSuperTypeOf(domainElement.eClass()) && isMessage_4003((Message)domainElement)) {
+ if (UMLPackage.eINSTANCE.getMessage().isSuperTypeOf(domainElement.eClass()) && isMessage_4003((Message) domainElement)) {
return MessageEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getMessage().isSuperTypeOf(domainElement.eClass()) && isMessage_4004((Message)domainElement)) {
+ if (UMLPackage.eINSTANCE.getMessage().isSuperTypeOf(domainElement.eClass()) && isMessage_4004((Message) domainElement)) {
return Message2EditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getMessage().isSuperTypeOf(domainElement.eClass()) && isMessage_4005((Message)domainElement)) {
+ if (UMLPackage.eINSTANCE.getMessage().isSuperTypeOf(domainElement.eClass()) && isMessage_4005((Message) domainElement)) {
return Message3EditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getMessage().isSuperTypeOf(domainElement.eClass()) && isMessage_4006((Message)domainElement)) {
+ if (UMLPackage.eINSTANCE.getMessage().isSuperTypeOf(domainElement.eClass()) && isMessage_4006((Message) domainElement)) {
return Message4EditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getMessage().isSuperTypeOf(domainElement.eClass()) && isMessage_4007((Message)domainElement)) {
+ if (UMLPackage.eINSTANCE.getMessage().isSuperTypeOf(domainElement.eClass()) && isMessage_4007((Message) domainElement)) {
return Message5EditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getMessage().isSuperTypeOf(domainElement.eClass()) && isMessage_4008((Message)domainElement)) {
+ if (UMLPackage.eINSTANCE.getMessage().isSuperTypeOf(domainElement.eClass()) && isMessage_4008((Message) domainElement)) {
return Message6EditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getMessage().isSuperTypeOf(domainElement.eClass()) && isMessage_4009((Message)domainElement)) {
+ if (UMLPackage.eINSTANCE.getMessage().isSuperTypeOf(domainElement.eClass()) && isMessage_4009((Message) domainElement)) {
return Message7EditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getGeneralOrdering().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getGeneralOrdering().isSuperTypeOf(domainElement.eClass())) {
return GeneralOrderingEditPart.VISUAL_ID;
}
return -1;
@@ -616,7 +616,7 @@ public class UMLVisualIDRegistry {
/**
* User can change implementation of this method to handle some specific situations not covered
* by default logic.
- *
+ *
* @generated
*/
private static boolean isDiagram(Package element) {
@@ -628,7 +628,7 @@ public class UMLVisualIDRegistry {
*/
private static boolean isMessage_4003(Message domainElement) {
Object result = UMLOCLFactory.getExpression(1, UMLPackage.eINSTANCE.getMessage(), null).evaluate(domainElement);
- return result instanceof Boolean && ((Boolean)result).booleanValue();
+ return result instanceof Boolean && ((Boolean) result).booleanValue();
}
/**
@@ -636,7 +636,7 @@ public class UMLVisualIDRegistry {
*/
private static boolean isMessage_4004(Message domainElement) {
Object result = UMLOCLFactory.getExpression(4, UMLPackage.eINSTANCE.getMessage(), null).evaluate(domainElement);
- return result instanceof Boolean && ((Boolean)result).booleanValue();
+ return result instanceof Boolean && ((Boolean) result).booleanValue();
}
/**
@@ -644,7 +644,7 @@ public class UMLVisualIDRegistry {
*/
private static boolean isMessage_4005(Message domainElement) {
Object result = UMLOCLFactory.getExpression(7, UMLPackage.eINSTANCE.getMessage(), null).evaluate(domainElement);
- return result instanceof Boolean && ((Boolean)result).booleanValue();
+ return result instanceof Boolean && ((Boolean) result).booleanValue();
}
/**
@@ -652,7 +652,7 @@ public class UMLVisualIDRegistry {
*/
private static boolean isMessage_4006(Message domainElement) {
Object result = UMLOCLFactory.getExpression(10, UMLPackage.eINSTANCE.getMessage(), null).evaluate(domainElement);
- return result instanceof Boolean && ((Boolean)result).booleanValue();
+ return result instanceof Boolean && ((Boolean) result).booleanValue();
}
/**
@@ -660,7 +660,7 @@ public class UMLVisualIDRegistry {
*/
private static boolean isMessage_4007(Message domainElement) {
Object result = UMLOCLFactory.getExpression(13, UMLPackage.eINSTANCE.getMessage(), null).evaluate(domainElement);
- return result instanceof Boolean && ((Boolean)result).booleanValue();
+ return result instanceof Boolean && ((Boolean) result).booleanValue();
}
/**
@@ -668,7 +668,7 @@ public class UMLVisualIDRegistry {
*/
private static boolean isMessage_4008(Message domainElement) {
Object result = UMLOCLFactory.getExpression(16, UMLPackage.eINSTANCE.getMessage(), null).evaluate(domainElement);
- return result instanceof Boolean && ((Boolean)result).booleanValue();
+ return result instanceof Boolean && ((Boolean) result).booleanValue();
}
/**
@@ -676,15 +676,15 @@ public class UMLVisualIDRegistry {
*/
private static boolean isMessage_4009(Message domainElement) {
Object result = UMLOCLFactory.getExpression(19, UMLPackage.eINSTANCE.getMessage(), null).evaluate(domainElement);
- return result instanceof Boolean && ((Boolean)result).booleanValue();
+ return result instanceof Boolean && ((Boolean) result).booleanValue();
}
/**
* @generated
*/
public static boolean checkNodeVisualID(View containerView, EObject domainElement, int candidate) {
- if(candidate == -1) {
- //unrecognized id is always bad
+ if (candidate == -1) {
+ // unrecognized id is always bad
return false;
}
int basic = getNodeVisualID(containerView, domainElement);
@@ -695,7 +695,7 @@ public class UMLVisualIDRegistry {
* @generated
*/
public static boolean isCompartmentVisualID(int visualID) {
- switch(visualID) {
+ switch (visualID) {
case InteractionInteractionCompartmentEditPart.VISUAL_ID:
case CombinedFragmentCombinedFragmentCompartmentEditPart.VISUAL_ID:
return true;
@@ -709,7 +709,7 @@ public class UMLVisualIDRegistry {
* @generated
*/
public static boolean isSemanticLeafVisualID(int visualID) {
- switch(visualID) {
+ switch (visualID) {
case PackageEditPart.VISUAL_ID:
return false;
case InteractionUseEditPart.VISUAL_ID:
@@ -742,6 +742,7 @@ public class UMLVisualIDRegistry {
/**
* @generated
*/
+ @Override
public int getVisualID(View view) {
return org.eclipse.papyrus.uml.diagram.sequence.part.UMLVisualIDRegistry.getVisualID(view);
}
@@ -749,6 +750,7 @@ public class UMLVisualIDRegistry {
/**
* @generated
*/
+ @Override
public String getModelID(View view) {
return org.eclipse.papyrus.uml.diagram.sequence.part.UMLVisualIDRegistry.getModelID(view);
}
@@ -756,6 +758,7 @@ public class UMLVisualIDRegistry {
/**
* @generated
*/
+ @Override
public int getNodeVisualID(View containerView, EObject domainElement) {
return org.eclipse.papyrus.uml.diagram.sequence.part.UMLVisualIDRegistry.getNodeVisualID(containerView, domainElement);
}
@@ -763,6 +766,7 @@ public class UMLVisualIDRegistry {
/**
* @generated
*/
+ @Override
public boolean checkNodeVisualID(View containerView, EObject domainElement, int candidate) {
return org.eclipse.papyrus.uml.diagram.sequence.part.UMLVisualIDRegistry.checkNodeVisualID(containerView, domainElement, candidate);
}
@@ -770,6 +774,7 @@ public class UMLVisualIDRegistry {
/**
* @generated
*/
+ @Override
public boolean isCompartmentVisualID(int visualID) {
return org.eclipse.papyrus.uml.diagram.sequence.part.UMLVisualIDRegistry.isCompartmentVisualID(visualID);
}
@@ -777,6 +782,7 @@ public class UMLVisualIDRegistry {
/**
* @generated
*/
+ @Override
public boolean isSemanticLeafVisualID(int visualID) {
return org.eclipse.papyrus.uml.diagram.sequence.part.UMLVisualIDRegistry.isSemanticLeafVisualID(visualID);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/ValidateAction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/ValidateAction.java
index 62fdbccc682..798ba309692 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/ValidateAction.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/ValidateAction.java
@@ -58,13 +58,15 @@ public class ValidateAction extends Action {
/**
* @generated
*/
+ @Override
public void run() {
IWorkbenchPart workbenchPart = page.getActivePart();
- if(workbenchPart instanceof IDiagramWorkbenchPart) {
- final IDiagramWorkbenchPart part = (IDiagramWorkbenchPart)workbenchPart;
+ if (workbenchPart instanceof IDiagramWorkbenchPart) {
+ final IDiagramWorkbenchPart part = (IDiagramWorkbenchPart) workbenchPart;
try {
new WorkspaceModifyDelegatingOperation(new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor) throws InterruptedException, InvocationTargetException {
runValidation(part.getDiagramEditPart(), part.getDiagram());
}
@@ -80,10 +82,10 @@ public class ValidateAction extends Action {
*/
public static void runValidation(View view) {
try {
- if(UMLDiagramEditorUtil.openDiagram(view.eResource())) {
+ if (UMLDiagramEditorUtil.openDiagram(view.eResource())) {
IEditorPart editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- if(editorPart instanceof IDiagramWorkbenchPart) {
- runValidation(((IDiagramWorkbenchPart)editorPart).getDiagramEditPart(), view);
+ if (editorPart instanceof IDiagramWorkbenchPart) {
+ runValidation(((IDiagramWorkbenchPart) editorPart).getDiagramEditPart(), view);
} else {
runNonUIValidation(view);
}
@@ -110,6 +112,7 @@ public class ValidateAction extends Action {
TransactionalEditingDomain txDomain = TransactionUtil.getEditingDomain(view);
UMLValidationProvider.runWithConstraints(txDomain, new Runnable() {
+ @Override
public void run() {
validate(fpart, fview);
}
@@ -120,9 +123,10 @@ public class ValidateAction extends Action {
* @generated
*/
private static Diagnostic runEMFValidator(View target) {
- if(target.isSetElement() && target.getElement() != null) {
+ if (target.isSetElement() && target.getElement() != null) {
return new Diagnostician() {
+ @Override
public String getObjectLabel(EObject eObject) {
return EMFCoreUtil.getQualifiedName(eObject, true);
}
@@ -136,14 +140,14 @@ public class ValidateAction extends Action {
*/
private static void validate(DiagramEditPart diagramEditPart, View view) {
IFile target = view.eResource() != null ? WorkspaceSynchronizer.getFile(view.eResource()) : null;
- if(target != null) {
+ if (target != null) {
UMLMarkerNavigationProvider.deleteMarkers(target);
}
Diagnostic diagnostic = runEMFValidator(view);
createMarkers(target, diagnostic, diagramEditPart);
- IBatchValidator validator = (IBatchValidator)ModelValidationService.getInstance().newValidator(EvaluationMode.BATCH);
+ IBatchValidator validator = (IBatchValidator) ModelValidationService.getInstance().newValidator(EvaluationMode.BATCH);
validator.setIncludeLiveConstraints(true);
- if(view.isSetElement() && view.getElement() != null) {
+ if (view.isSetElement() && view.getElement() != null) {
IStatus status = validator.validate(view.getElement());
createMarkers(target, status, diagramEditPart);
}
@@ -156,14 +160,14 @@ public class ValidateAction extends Action {
* @generated
*/
private static void createMarkers(IFile target, IStatus validationStatus, DiagramEditPart diagramEditPart) {
- if(validationStatus.isOK()) {
+ if (validationStatus.isOK()) {
return;
}
final IStatus rootStatus = validationStatus;
List allStatuses = new ArrayList();
UMLDiagramEditorUtil.LazyElement2ViewMap element2ViewMap = new UMLDiagramEditorUtil.LazyElement2ViewMap(diagramEditPart.getDiagramView(), collectTargetElements(rootStatus, new HashSet<EObject>(), allStatuses));
- for(Iterator it = allStatuses.iterator(); it.hasNext();) {
- IConstraintStatus nextStatus = (IConstraintStatus)it.next();
+ for (Iterator it = allStatuses.iterator(); it.hasNext();) {
+ IConstraintStatus nextStatus = (IConstraintStatus) it.next();
View view = UMLDiagramEditorUtil.findView(diagramEditPart, nextStatus.getTarget(), element2ViewMap);
addMarker(diagramEditPart.getViewer(), target, view.eResource().getURIFragment(view), EMFCoreUtil.getQualifiedName(nextStatus.getTarget(), true), nextStatus.getMessage(), nextStatus.getSeverity());
}
@@ -173,17 +177,17 @@ public class ValidateAction extends Action {
* @generated
*/
private static void createMarkers(IFile target, Diagnostic emfValidationStatus, DiagramEditPart diagramEditPart) {
- if(emfValidationStatus.getSeverity() == Diagnostic.OK) {
+ if (emfValidationStatus.getSeverity() == Diagnostic.OK) {
return;
}
final Diagnostic rootStatus = emfValidationStatus;
List allDiagnostics = new ArrayList();
UMLDiagramEditorUtil.LazyElement2ViewMap element2ViewMap = new UMLDiagramEditorUtil.LazyElement2ViewMap(diagramEditPart.getDiagramView(), collectTargetElements(rootStatus, new HashSet<EObject>(), allDiagnostics));
- for(Iterator it = emfValidationStatus.getChildren().iterator(); it.hasNext();) {
- Diagnostic nextDiagnostic = (Diagnostic)it.next();
+ for (Iterator it = emfValidationStatus.getChildren().iterator(); it.hasNext();) {
+ Diagnostic nextDiagnostic = (Diagnostic) it.next();
List data = nextDiagnostic.getData();
- if(data != null && !data.isEmpty() && data.get(0) instanceof EObject) {
- EObject element = (EObject)data.get(0);
+ if (data != null && !data.isEmpty() && data.get(0) instanceof EObject) {
+ EObject element = (EObject) data.get(0);
View view = UMLDiagramEditorUtil.findView(diagramEditPart, element, element2ViewMap);
addMarker(diagramEditPart.getViewer(), target, view.eResource().getURIFragment(view), EMFCoreUtil.getQualifiedName(element, true), nextDiagnostic.getMessage(), diagnosticToStatusSeverity(nextDiagnostic.getSeverity()));
}
@@ -194,7 +198,7 @@ public class ValidateAction extends Action {
* @generated
*/
private static void addMarker(EditPartViewer viewer, IFile target, String elementId, String location, String message, int statusSeverity) {
- if(target == null) {
+ if (target == null) {
return;
}
UMLMarkerNavigationProvider.addMarker(target, elementId, location, message, statusSeverity);
@@ -204,13 +208,13 @@ public class ValidateAction extends Action {
* @generated
*/
private static int diagnosticToStatusSeverity(int diagnosticSeverity) {
- if(diagnosticSeverity == Diagnostic.OK) {
+ if (diagnosticSeverity == Diagnostic.OK) {
return IStatus.OK;
- } else if(diagnosticSeverity == Diagnostic.INFO) {
+ } else if (diagnosticSeverity == Diagnostic.INFO) {
return IStatus.INFO;
- } else if(diagnosticSeverity == Diagnostic.WARNING) {
+ } else if (diagnosticSeverity == Diagnostic.WARNING) {
return IStatus.WARNING;
- } else if(diagnosticSeverity == Diagnostic.ERROR || diagnosticSeverity == Diagnostic.CANCEL) {
+ } else if (diagnosticSeverity == Diagnostic.ERROR || diagnosticSeverity == Diagnostic.CANCEL) {
return IStatus.ERROR;
}
return IStatus.INFO;
@@ -220,13 +224,13 @@ public class ValidateAction extends Action {
* @generated
*/
private static Set<EObject> collectTargetElements(IStatus status, Set<EObject> targetElementCollector, List allConstraintStatuses) {
- if(status instanceof IConstraintStatus) {
- targetElementCollector.add(((IConstraintStatus)status).getTarget());
+ if (status instanceof IConstraintStatus) {
+ targetElementCollector.add(((IConstraintStatus) status).getTarget());
allConstraintStatuses.add(status);
}
- if(status.isMultiStatus()) {
+ if (status.isMultiStatus()) {
IStatus[] children = status.getChildren();
- for(int i = 0; i < children.length; i++) {
+ for (int i = 0; i < children.length; i++) {
collectTargetElements(children[i], targetElementCollector, allConstraintStatuses);
}
}
@@ -239,14 +243,14 @@ public class ValidateAction extends Action {
private static Set<EObject> collectTargetElements(Diagnostic diagnostic, Set<EObject> targetElementCollector, List allDiagnostics) {
List data = diagnostic.getData();
EObject target = null;
- if(data != null && !data.isEmpty() && data.get(0) instanceof EObject) {
- target = (EObject)data.get(0);
+ if (data != null && !data.isEmpty() && data.get(0) instanceof EObject) {
+ target = (EObject) data.get(0);
targetElementCollector.add(target);
allDiagnostics.add(diagnostic);
}
- if(diagnostic.getChildren() != null && !diagnostic.getChildren().isEmpty()) {
- for(Iterator it = diagnostic.getChildren().iterator(); it.hasNext();) {
- collectTargetElements((Diagnostic)it.next(), targetElementCollector, allDiagnostics);
+ if (diagnostic.getChildren() != null && !diagnostic.getChildren().isEmpty()) {
+ for (Iterator it = diagnostic.getChildren().iterator(); it.hasNext();) {
+ collectTargetElements((Diagnostic) it.next(), targetElementCollector, allDiagnostics);
}
}
return targetElementCollector;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/ActionExecutionSpecificationPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/ActionExecutionSpecificationPreferencePage.java
index f08aea200f6..d67407876d2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/ActionExecutionSpecificationPreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/ActionExecutionSpecificationPreferencePage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -47,13 +47,16 @@ public class ActionExecutionSpecificationPreferencePage extends AbstractPapyrusN
String key = PackageEditPart.MODEL_ID + "_ActionExecutionSpecification";
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.WIDTH), 16);
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.HEIGHT), 60);
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
// Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
+ // org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
+ // new org.eclipse.swt.graphics.RGB(255, 255, 255),
+ // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT),
+ // gradientPreferenceConverter.getPreferenceValue());
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/BehaviorExecutionSpecificationPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/BehaviorExecutionSpecificationPreferencePage.java
index b75f066bddd..4e0100862ba 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/BehaviorExecutionSpecificationPreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/BehaviorExecutionSpecificationPreferencePage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -47,13 +47,16 @@ public class BehaviorExecutionSpecificationPreferencePage extends AbstractPapyru
String key = PackageEditPart.MODEL_ID + "_BehaviorExecutionSpecification";
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.WIDTH), 16);
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.HEIGHT), 60);
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
// Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
+ // org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
+ // new org.eclipse.swt.graphics.RGB(255, 255, 255),
+ // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT),
+ // gradientPreferenceConverter.getPreferenceValue());
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CombinedFragmentPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CombinedFragmentPreferencePage.java
index fb73a0b2d4d..0d5364ca3e3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CombinedFragmentPreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CombinedFragmentPreferencePage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -47,13 +47,16 @@ public class CombinedFragmentPreferencePage extends AbstractPapyrusNodePreferenc
String key = PackageEditPart.MODEL_ID + "_CombinedFragment";
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.WIDTH), 40);
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.HEIGHT), 40);
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
// Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
+ // org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
+ // new org.eclipse.swt.graphics.RGB(255, 255, 255),
+ // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT),
+ // gradientPreferenceConverter.getPreferenceValue());
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CommentPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CommentPreferencePage.java
index 407e196173f..cf6b45a1c28 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CommentPreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/CommentPreferencePage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -47,13 +47,16 @@ public class CommentPreferencePage extends AbstractPapyrusNodePreferencePage {
String key = PackageEditPart.MODEL_ID + "_Comment";
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.WIDTH), 40);
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.HEIGHT), 40);
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
// Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
+ // org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
+ // new org.eclipse.swt.graphics.RGB(255, 255, 255),
+ // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT),
+ // gradientPreferenceConverter.getPreferenceValue());
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/ConsiderIgnoreFragmentPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/ConsiderIgnoreFragmentPreferencePage.java
index fade4564c47..805269de502 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/ConsiderIgnoreFragmentPreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/ConsiderIgnoreFragmentPreferencePage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -47,13 +47,16 @@ public class ConsiderIgnoreFragmentPreferencePage extends AbstractPapyrusNodePre
String key = PackageEditPart.MODEL_ID + "_ConsiderIgnoreFragment";
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.WIDTH), 40);
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.HEIGHT), 40);
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
// Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
+ // org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
+ // new org.eclipse.swt.graphics.RGB(255, 255, 255),
+ // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT),
+ // gradientPreferenceConverter.getPreferenceValue());
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/ConstraintPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/ConstraintPreferencePage.java
index 1845540707c..1f72315a99c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/ConstraintPreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/ConstraintPreferencePage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -47,13 +47,16 @@ public class ConstraintPreferencePage extends AbstractPapyrusNodePreferencePage
String key = PackageEditPart.MODEL_ID + "_Constraint";
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.WIDTH), 40);
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.HEIGHT), 40);
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
// Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
+ // org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
+ // new org.eclipse.swt.graphics.RGB(255, 255, 255),
+ // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT),
+ // gradientPreferenceConverter.getPreferenceValue());
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/ContinuationPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/ContinuationPreferencePage.java
index eb6f4edb8d8..f3ac00e5af8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/ContinuationPreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/ContinuationPreferencePage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -47,13 +47,16 @@ public class ContinuationPreferencePage extends AbstractPapyrusNodePreferencePag
String key = PackageEditPart.MODEL_ID + "_Continuation";
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.WIDTH), 40);
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.HEIGHT), 40);
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
// Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
+ // org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
+ // new org.eclipse.swt.graphics.RGB(255, 255, 255),
+ // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT),
+ // gradientPreferenceConverter.getPreferenceValue());
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DestructionOccurrenceSpecificationPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DestructionOccurrenceSpecificationPreferencePage.java
index f5940cc4f9d..9ed9db0b72a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DestructionOccurrenceSpecificationPreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DestructionOccurrenceSpecificationPreferencePage.java
@@ -34,13 +34,16 @@ public class DestructionOccurrenceSpecificationPreferencePage extends AbstractPa
String key = PackageEditPart.MODEL_ID + "_DestructionOccurrenceSpecification";
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.WIDTH), 40);
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.HEIGHT), 40);
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
// Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
+ // org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
+ // new org.eclipse.swt.graphics.RGB(255, 255, 255),
+ // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT),
+ // gradientPreferenceConverter.getPreferenceValue());
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DiagramAppearancePreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DiagramAppearancePreferencePage.java
index 6442bb44884..bce09d42592 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DiagramAppearancePreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DiagramAppearancePreferencePage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DiagramConnectionsPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DiagramConnectionsPreferencePage.java
index 74ae9a8978d..4ec312ed566 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DiagramConnectionsPreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DiagramConnectionsPreferencePage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DiagramGeneralPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DiagramGeneralPreferencePage.java
index c864c30a238..ccd73b77bb0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DiagramGeneralPreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DiagramGeneralPreferencePage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DiagramPreferenceInitializer.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DiagramPreferenceInitializer.java
index f46b2d9f1bc..deae490d092 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DiagramPreferenceInitializer.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DiagramPreferenceInitializer.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -24,9 +24,10 @@ public class DiagramPreferenceInitializer extends AbstractPreferenceInitializer
/**
* Add the diagram preference page to the initialization
- *
+ *
* @generated
*/
+ @Override
public void initializeDefaultPreferences() {
IPreferenceStore store = getPreferenceStore();
InteractionPreferencePage.initDefaults(store);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DiagramPrintingPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DiagramPrintingPreferencePage.java
index b75dabd0d23..ed0d60fa802 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DiagramPrintingPreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DiagramPrintingPreferencePage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DiagramRulersAndGridPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DiagramRulersAndGridPreferencePage.java
index 861cbbe9ab9..23c1fa1e52c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DiagramRulersAndGridPreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DiagramRulersAndGridPreferencePage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DurationConstraintInMessagePreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DurationConstraintInMessagePreferencePage.java
index b203f16149b..00564e5d537 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DurationConstraintInMessagePreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DurationConstraintInMessagePreferencePage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -30,7 +30,8 @@ public class DurationConstraintInMessagePreferencePage extends AbstractPapyrusNo
*/
@Override
protected String getBundleId() {
- return UMLDiagramEditorPlugin.getInstance().ID;
+ UMLDiagramEditorPlugin.getInstance();
+ return UMLDiagramEditorPlugin.ID;
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DurationConstraintPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DurationConstraintPreferencePage.java
index 3d311e75627..9669bdf84e9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DurationConstraintPreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DurationConstraintPreferencePage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -47,13 +47,16 @@ public class DurationConstraintPreferencePage extends AbstractPapyrusNodePrefere
String key = PackageEditPart.MODEL_ID + "_DurationConstraint";
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.WIDTH), 40);
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.HEIGHT), 40);
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
// Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
+ // org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
+ // new org.eclipse.swt.graphics.RGB(255, 255, 255),
+ // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT),
+ // gradientPreferenceConverter.getPreferenceValue());
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DurationObservationPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DurationObservationPreferencePage.java
index 5808e0fc2e1..c85ab8b29d3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DurationObservationPreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/DurationObservationPreferencePage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -47,13 +47,16 @@ public class DurationObservationPreferencePage extends AbstractPapyrusNodePrefer
String key = PackageEditPart.MODEL_ID + "_DurationObservation";
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.WIDTH), 40);
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.HEIGHT), 40);
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
// Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
+ // org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
+ // new org.eclipse.swt.graphics.RGB(255, 255, 255),
+ // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT),
+ // gradientPreferenceConverter.getPreferenceValue());
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/InteractionOperandPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/InteractionOperandPreferencePage.java
index 4eb1aaf3cab..3f1a29d814f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/InteractionOperandPreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/InteractionOperandPreferencePage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -47,13 +47,16 @@ public class InteractionOperandPreferencePage extends AbstractPapyrusNodePrefere
String key = PackageEditPart.MODEL_ID + "_InteractionOperand";
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.WIDTH), 40);
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.HEIGHT), 40);
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
// Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
+ // org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
+ // new org.eclipse.swt.graphics.RGB(255, 255, 255),
+ // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT),
+ // gradientPreferenceConverter.getPreferenceValue());
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/InteractionPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/InteractionPreferencePage.java
index d9bf0e12092..33535241657 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/InteractionPreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/InteractionPreferencePage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -56,23 +56,26 @@ public class InteractionPreferencePage extends AbstractPapyrusNodePreferencePage
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.WIDTH), 857);
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.HEIGHT), 757);
Map<String, Boolean> map = getStaticCompartmentVisibilityPreferences();
- for(String name : map.keySet()) {
+ for (String name : map.keySet()) {
String preferenceName = PreferencesConstantsHelper.getLabelElementConstant(key, name, PreferencesConstantsHelper.COMPARTMENT_VISIBILITY);
store.setDefault(preferenceName, map.get(name));
}
map = getStaticCompartmentTitleVisibilityPreferences();
- for(String name : map.keySet()) {
+ for (String name : map.keySet()) {
String preferenceName = PreferencesConstantsHelper.getLabelElementConstant(key, name, PreferencesConstantsHelper.COMPARTMENT_NAME_VISIBILITY);
store.setDefault(preferenceName, map.get(name));
}
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
// Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
+ // org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
+ // new org.eclipse.swt.graphics.RGB(255, 255, 255),
+ // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT),
+ // gradientPreferenceConverter.getPreferenceValue());
}
/**
@@ -80,7 +83,7 @@ public class InteractionPreferencePage extends AbstractPapyrusNodePreferencePage
*/
@Override
protected void initializeCompartmentsList() {
- for(String name : compartments) {
+ for (String name : compartments) {
this.compartmentsList.add(name);
}
}
@@ -105,6 +108,7 @@ public class InteractionPreferencePage extends AbstractPapyrusNodePreferencePage
/**
* @generated
*/
+ @Override
protected TreeMap<String, Boolean> getCompartmentTitleVisibilityPreferences() {
return getStaticCompartmentTitleVisibilityPreferences();
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/InteractionUsePreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/InteractionUsePreferencePage.java
index 2461c199a78..dac77c403da 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/InteractionUsePreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/InteractionUsePreferencePage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -47,13 +47,16 @@ public class InteractionUsePreferencePage extends AbstractPapyrusNodePreferenceP
String key = PackageEditPart.MODEL_ID + "_InteractionUse";
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.WIDTH), 40);
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.HEIGHT), 40);
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
// Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
+ // org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
+ // new org.eclipse.swt.graphics.RGB(255, 255, 255),
+ // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT),
+ // gradientPreferenceConverter.getPreferenceValue());
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/LifelinePreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/LifelinePreferencePage.java
index 34b74f0e1f1..ef99a851c8b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/LifelinePreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/LifelinePreferencePage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
@@ -47,13 +47,16 @@ public class LifelinePreferencePage extends AbstractPapyrusNodePreferencePage {
String key = PackageEditPart.MODEL_ID + "_Lifeline";
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.WIDTH), 100);
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.HEIGHT), 250);
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
// Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
+ // org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
+ // new org.eclipse.swt.graphics.RGB(255, 255, 255),
+ // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT),
+ // gradientPreferenceConverter.getPreferenceValue());
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/MessageOccurrenceSpecificationPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/MessageOccurrenceSpecificationPreferencePage.java
index bf1e9d638ca..5774cb4ade3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/MessageOccurrenceSpecificationPreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/MessageOccurrenceSpecificationPreferencePage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -27,7 +27,8 @@ public class MessageOccurrenceSpecificationPreferencePage extends AbstractPapyru
*/
@Override
protected String getBundleId() {
- return UMLDiagramEditorPlugin.getInstance().ID;
+ UMLDiagramEditorPlugin.getInstance();
+ return UMLDiagramEditorPlugin.ID;
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/MessagePreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/MessagePreferencePage.java
index 7b524db934b..a565d6c8565 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/MessagePreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/MessagePreferencePage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/StateInvariantPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/StateInvariantPreferencePage.java
index 840f5752113..2098503a183 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/StateInvariantPreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/StateInvariantPreferencePage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -47,13 +47,16 @@ public class StateInvariantPreferencePage extends AbstractPapyrusNodePreferenceP
String key = PackageEditPart.MODEL_ID + "_StateInvariant";
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.WIDTH), 40);
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.HEIGHT), 40);
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
// Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
+ // org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
+ // new org.eclipse.swt.graphics.RGB(255, 255, 255),
+ // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT),
+ // gradientPreferenceConverter.getPreferenceValue());
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/TimeConstraintPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/TimeConstraintPreferencePage.java
index 2f067740c8d..7e5db26da26 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/TimeConstraintPreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/TimeConstraintPreferencePage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -47,13 +47,16 @@ public class TimeConstraintPreferencePage extends AbstractPapyrusNodePreferenceP
String key = PackageEditPart.MODEL_ID + "_TimeConstraint";
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.WIDTH), 40);
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.HEIGHT), 40);
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
// Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
+ // org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
+ // new org.eclipse.swt.graphics.RGB(255, 255, 255),
+ // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT),
+ // gradientPreferenceConverter.getPreferenceValue());
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/TimeObservationPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/TimeObservationPreferencePage.java
index eb41874891d..62c9db67047 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/TimeObservationPreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/preferences/TimeObservationPreferencePage.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -47,13 +47,16 @@ public class TimeObservationPreferencePage extends AbstractPapyrusNodePreference
String key = PackageEditPart.MODEL_ID + "_TimeObservation";
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.WIDTH), 40);
store.setDefault(PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.HEIGHT), 40);
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
+ // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,
+ // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
// Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
+ // org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
+ // new org.eclipse.swt.graphics.RGB(255, 255, 255),
+ // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
+ // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT),
+ // gradientPreferenceConverter.getPreferenceValue());
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/ElementInitializers.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/ElementInitializers.java
index 1f3d0068bf8..3cef5b10382 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/ElementInitializers.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/ElementInitializers.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -59,9 +59,9 @@ public class ElementInitializers {
public void init_Interaction_2001(Interaction instance) {
try {
Object value_0 = name_Interaction_2001(instance);
- instance.setName((String)value_0);
+ instance.setName((String) value_0);
} catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
@@ -71,9 +71,9 @@ public class ElementInitializers {
public void init_ConsiderIgnoreFragment_3007(ConsiderIgnoreFragment instance) {
try {
Object value_0 = name_ConsiderIgnoreFragment_3007(instance);
- instance.setName((String)value_0);
+ instance.setName((String) value_0);
} catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
@@ -83,9 +83,9 @@ public class ElementInitializers {
public void init_CombinedFragment_3004(CombinedFragment instance) {
try {
Object value_0 = name_CombinedFragment_3004(instance);
- instance.setName((String)value_0);
+ instance.setName((String) value_0);
} catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
@@ -95,9 +95,9 @@ public class ElementInitializers {
public void init_InteractionUse_3002(InteractionUse instance) {
try {
Object value_0 = name_InteractionUse_3002(instance);
- instance.setName((String)value_0);
+ instance.setName((String) value_0);
} catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
@@ -107,9 +107,9 @@ public class ElementInitializers {
public void init_Continuation_3016(Continuation instance) {
try {
Object value_0 = name_Continuation_3016(instance);
- instance.setName((String)value_0);
+ instance.setName((String) value_0);
} catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
@@ -119,9 +119,9 @@ public class ElementInitializers {
public void init_Lifeline_3001(Lifeline instance) {
try {
Object value_0 = name_Lifeline_3001(instance);
- instance.setName((String)value_0);
+ instance.setName((String) value_0);
} catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
@@ -131,9 +131,9 @@ public class ElementInitializers {
public void init_StateInvariant_3017(StateInvariant instance) {
try {
Object value_0 = name_StateInvariant_3017(instance);
- instance.setName((String)value_0);
+ instance.setName((String) value_0);
} catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
@@ -143,9 +143,9 @@ public class ElementInitializers {
public void init_CombinedFragment_3018(CombinedFragment instance) {
try {
Object value_0 = name_CombinedFragment_3018(instance);
- instance.setName((String)value_0);
+ instance.setName((String) value_0);
} catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
@@ -157,13 +157,13 @@ public class ElementInitializers {
TimeInterval newInstance_0_0 = UMLFactory.eINSTANCE.createTimeInterval();
instance.setSpecification(newInstance_0_0);
Object value_0_0_0 = name_specification_TimeConstraint_3019(newInstance_0_0);
- newInstance_0_0.setName((String)value_0_0_0);
+ newInstance_0_0.setName((String) value_0_0_0);
// init Time Interval
init_TimeInterval(newInstance_0_0);
Object value_1 = name_TimeConstraint_3019(instance);
- instance.setName((String)value_1);
+ instance.setName((String) value_1);
} catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
@@ -173,9 +173,9 @@ public class ElementInitializers {
public void init_TimeObservation_3020(TimeObservation instance) {
try {
Object value_0 = name_TimeObservation_3020(instance);
- instance.setName((String)value_0);
+ instance.setName((String) value_0);
} catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
@@ -187,13 +187,13 @@ public class ElementInitializers {
DurationInterval newInstance_0_0 = UMLFactory.eINSTANCE.createDurationInterval();
instance.setSpecification(newInstance_0_0);
Object value_0_0_0 = name_specification_DurationConstraint_3021(newInstance_0_0);
- newInstance_0_0.setName((String)value_0_0_0);
+ newInstance_0_0.setName((String) value_0_0_0);
// init Duration Interval
init_DurationInterval(newInstance_0_0);
Object value_1 = name_DurationConstraint_3021(instance);
- instance.setName((String)value_1);
+ instance.setName((String) value_1);
} catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
@@ -203,17 +203,17 @@ public class ElementInitializers {
public void init_DestructionOccurrenceSpecification_3022(DestructionOccurrenceSpecification instance) {
try {
Object value_0 = name_DestructionOccurrenceSpecification_3022(instance);
- instance.setName((String)value_0);
+ instance.setName((String) value_0);
} catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
/**
* Initialize a time interval
- *
+ *
* @param instance
- * instance to initialize
+ * instance to initialize
*/
private void init_TimeInterval(TimeInterval instance) {
// time interval
@@ -234,9 +234,9 @@ public class ElementInitializers {
/**
* Initialize a duration interval
- *
+ *
* @param instance
- * instance to initialize
+ * instance to initialize
*/
private void init_DurationInterval(DurationInterval instance) {
// duration interval
@@ -263,9 +263,9 @@ public class ElementInitializers {
LiteralString newInstance_0_0 = UMLFactory.eINSTANCE.createLiteralString();
instance.setSpecification(newInstance_0_0);
Object value_0_0_0 = value_specification_Constraint_3008(newInstance_0_0);
- newInstance_0_0.setValue((String)value_0_0_0);
+ newInstance_0_0.setValue((String) value_0_0_0);
} catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
@@ -275,9 +275,9 @@ public class ElementInitializers {
public void init_Comment_3009(Comment instance) {
try {
Object value_0 = UMLOCLFactory.getExpression(0, UMLPackage.eINSTANCE.getComment(), null).evaluate(instance);
- instance.setBody((String)value_0);
+ instance.setBody((String) value_0);
} catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
@@ -289,13 +289,13 @@ public class ElementInitializers {
DurationInterval newInstance_0_0 = UMLFactory.eINSTANCE.createDurationInterval();
instance.setSpecification(newInstance_0_0);
Object value_0_0_0 = name_specification_DurationConstraint_3023(newInstance_0_0);
- newInstance_0_0.setName((String)value_0_0_0);
+ newInstance_0_0.setName((String) value_0_0_0);
// init Duration Interval
init_DurationInterval(newInstance_0_0);
Object value_1 = name_DurationConstraint_3023(instance);
- instance.setName((String)value_1);
+ instance.setName((String) value_1);
} catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
@@ -305,9 +305,9 @@ public class ElementInitializers {
public void init_DurationObservation_3024(DurationObservation instance) {
try {
Object value_0 = name_DurationObservation_3024(instance);
- instance.setName((String)value_0);
+ instance.setName((String) value_0);
} catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
@@ -317,9 +317,9 @@ public class ElementInitializers {
public void init_GeneralOrdering_4012(GeneralOrdering instance) {
try {
Object value_0 = name_GeneralOrdering_4012(instance);
- instance.setName((String)value_0);
+ instance.setName((String) value_0);
} catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
@@ -461,7 +461,7 @@ public class ElementInitializers {
*/
public static ElementInitializers getInstance() {
ElementInitializers cached = UMLDiagramEditorPlugin.getInstance().getElementInitializers();
- if(cached == null) {
+ if (cached == null) {
UMLDiagramEditorPlugin.getInstance().setElementInitializers(cached = new ElementInitializers());
}
return cached;
@@ -470,9 +470,9 @@ public class ElementInitializers {
/**
* @generated NOT
* Initialize the name of a namedElement
- *
+ *
* @param namedElement
- * the namedElement
+ * the namedElement
*/
public static void init_NamedElement(NamedElement namedElement) {
init_NamedElement(namedElement, ""); //$NON-NLS-1$
@@ -481,11 +481,11 @@ public class ElementInitializers {
/**
* @generated NOT
* Initialize the name of a namedElement with a given prefix
- *
+ *
* @param namedElement
- * the namedElement
+ * the namedElement
* @param prefix
- * a prefix for the name
+ * a prefix for the name
*/
public static void init_NamedElement(NamedElement namedElement, String prefix) {
init_NamedElement(namedElement, prefix, namedElement.eClass().getName(), "");
@@ -494,13 +494,13 @@ public class ElementInitializers {
/**
* @generated NOT
* Initialize the name of a namedElement with a given suffix
- *
+ *
* @param namedElement
- * the namedElement
+ * the namedElement
* @param prefix
- * the prefix for the name
+ * the prefix for the name
* @param suffix
- * a suffix for the name
+ * a suffix for the name
*/
public static void init_NamedElement(NamedElement namedElement, String prefix, String suffix) {
init_NamedElement(namedElement, prefix, namedElement.eClass().getName(), suffix);
@@ -509,37 +509,37 @@ public class ElementInitializers {
/**
* @generated NOT
* Initialize the name of a namedElement with a given suffix
- *
+ *
* @param namedElement
- * the namedElement
+ * the namedElement
* @param prefix
- * the prefix for the name
+ * the prefix for the name
* @param body
- * the body used for the name
+ * the body used for the name
* @param suffix
- * a suffix for the name
+ * a suffix for the name
*/
public static void init_NamedElement(NamedElement namedElement, String prefix, String body, String suffix) {
try {
namedElement.setName(getNamedElement(namedElement, prefix, body, suffix));
} catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
/**
* @generated NOT
- *
+ *
*/
private static String getNamedElement(NamedElement namedElement, String prefix, String body, String suffix) {
String base = prefix + body + suffix;
Namespace namespace = namedElement.getNamespace();
- if(namespace != null) {
+ if (namespace != null) {
Set<NamedElement> members = new HashSet<NamedElement>();
members.addAll(namespace.getMembers());
// add general orderings which are not in initial selection
- if(namespace instanceof Interaction) {
- members.addAll(((Interaction)namespace).getGeneralOrderings());
+ if (namespace instanceof Interaction) {
+ members.addAll(((Interaction) namespace).getGeneralOrderings());
}
return getNextNumberedName(members, base);
}
@@ -550,14 +550,14 @@ public class ElementInitializers {
public static String getNextNumberedName(Collection currentElements, String base) {
int nextNumber = -1;
Set<String> elementNames = new HashSet<String>();
- for(Object o : currentElements) {
- if(o instanceof NamedElement) {
- String name = ((NamedElement)o).getName();
- if(name != null && name.startsWith(base)) {
+ for (Object o : currentElements) {
+ if (o instanceof NamedElement) {
+ String name = ((NamedElement) o).getName();
+ if (name != null && name.startsWith(base)) {
elementNames.add(name);
String end = name.substring(base.length());
int nextNumberTmp = -1;
- if(end.trim().equals("")) {
+ if (end.trim().equals("")) {
nextNumberTmp = 0;
} else {
try {
@@ -566,13 +566,13 @@ public class ElementInitializers {
nextNumberTmp = -1;
}
}
- if(nextNumberTmp > nextNumber) {
+ if (nextNumberTmp > nextNumber) {
nextNumber = nextNumberTmp;
}
}
}
}
- if(nextNumber == -1) {
+ if (nextNumber == -1) {
return generateUniqueName(base, elementNames, base, nextNumber);
} else {
return generateUniqueName(base + nextNumber, elementNames, base, nextNumber);
@@ -580,7 +580,7 @@ public class ElementInitializers {
}
private static String generateUniqueName(String name, Set<String> elementNames, String base, int nextNumber) {
- while(elementNames.contains(name)) {
+ while (elementNames.contains(name)) {
nextNumber++;
name = base + nextNumber;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLEditPartProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLEditPartProvider.java
index fd1f03d32aa..2964a57d247 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLEditPartProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLEditPartProvider.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLElementTypes.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLElementTypes.java
index 8d2072a18b3..46693f24174 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLElementTypes.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLElementTypes.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -271,12 +271,12 @@ public class UMLElementTypes {
/**
* Returns 'type' of the ecore object associated with the hint.
- *
+ *
* @generated
*/
public static ENamedElement getElement(IAdaptable hint) {
Object type = hint.getAdapter(IElementType.class);
- if(elements == null) {
+ if (elements == null) {
elements = new IdentityHashMap<IElementType, ENamedElement>();
elements.put(Package_1000, UMLPackage.eINSTANCE.getPackage());
elements.put(Interaction_2001, UMLPackage.eINSTANCE.getInteraction());
@@ -310,7 +310,7 @@ public class UMLElementTypes {
elements.put(GeneralOrdering_4012, UMLPackage.eINSTANCE.getGeneralOrdering());
elements.put(ConstraintContext_8500, UMLPackage.eINSTANCE.getConstraint_Context());
}
- return (ENamedElement)elements.get(type);
+ return elements.get(type);
}
/**
@@ -324,7 +324,7 @@ public class UMLElementTypes {
* @generated
*/
public static boolean isKnownElementType(IElementType elementType) {
- if(KNOWN_ELEMENT_TYPES == null) {
+ if (KNOWN_ELEMENT_TYPES == null) {
KNOWN_ELEMENT_TYPES = new HashSet<IElementType>();
KNOWN_ELEMENT_TYPES.add(Package_1000);
KNOWN_ELEMENT_TYPES.add(Interaction_2001);
@@ -365,7 +365,7 @@ public class UMLElementTypes {
* @generated
*/
public static IElementType getElementType(int visualID) {
- switch(visualID) {
+ switch (visualID) {
case PackageEditPart.VISUAL_ID:
return Package_1000;
case InteractionEditPart.VISUAL_ID:
@@ -440,6 +440,7 @@ public class UMLElementTypes {
/**
* @generated
*/
+ @Override
public boolean isKnownElementType(IElementType elementType) {
return org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes.isKnownElementType(elementType);
}
@@ -447,6 +448,7 @@ public class UMLElementTypes {
/**
* @generated
*/
+ @Override
public IElementType getElementTypeForVisualId(int visualID) {
return org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes.getElementType(visualID);
}
@@ -454,6 +456,7 @@ public class UMLElementTypes {
/**
* @generated
*/
+ @Override
public ENamedElement getDefiningNamedElement(IAdaptable elementTypeAdapter) {
return org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes.getElement(elementTypeAdapter);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLIconProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLIconProvider.java
index 720761ee483..f98b708e06e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLIconProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLIconProvider.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLMarkerNavigationProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLMarkerNavigationProvider.java
index 9cd15e5ff17..9362caf55c8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLMarkerNavigationProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLMarkerNavigationProvider.java
@@ -28,20 +28,21 @@ public class UMLMarkerNavigationProvider extends AbstractModelMarkerNavigationPr
/**
* @generated
*/
+ @Override
protected void doGotoMarker(IMarker marker) {
String elementId = marker.getAttribute(org.eclipse.gmf.runtime.common.core.resources.IMarker.ELEMENT_ID, null);
- if(elementId == null || !(getEditor() instanceof DiagramEditor)) {
+ if (elementId == null || !(getEditor() instanceof DiagramEditor)) {
return;
}
- DiagramEditor editor = (DiagramEditor)getEditor();
+ DiagramEditor editor = (DiagramEditor) getEditor();
Map editPartRegistry = editor.getDiagramGraphicalViewer().getEditPartRegistry();
EObject targetView = editor.getDiagram().eResource().getEObject(elementId);
- if(targetView == null) {
+ if (targetView == null) {
return;
}
- EditPart targetEditPart = (EditPart)editPartRegistry.get(targetView);
- if(targetEditPart != null) {
- UMLDiagramEditorUtil.selectElementsInDiagram(editor, Arrays.asList(new EditPart[]{ targetEditPart }));
+ EditPart targetEditPart = (EditPart) editPartRegistry.get(targetView);
+ if (targetEditPart != null) {
+ UMLDiagramEditorUtil.selectElementsInDiagram(editor, Arrays.asList(new EditPart[] { targetEditPart }));
}
}
@@ -65,11 +66,11 @@ public class UMLMarkerNavigationProvider extends AbstractModelMarkerNavigationPr
marker = file.createMarker(MARKER_TYPE);
marker.setAttribute(IMarker.MESSAGE, message);
marker.setAttribute(IMarker.LOCATION, location);
- marker.setAttribute(org.eclipse.gmf.runtime.common.ui.resources.IMarker.ELEMENT_ID, elementId);
+ marker.setAttribute(org.eclipse.gmf.runtime.common.core.resources.IMarker.ELEMENT_ID, elementId);
int markerSeverity = IMarker.SEVERITY_INFO;
- if(statusSeverity == IStatus.WARNING) {
+ if (statusSeverity == IStatus.WARNING) {
markerSeverity = IMarker.SEVERITY_WARNING;
- } else if(statusSeverity == IStatus.ERROR || statusSeverity == IStatus.CANCEL) {
+ } else if (statusSeverity == IStatus.ERROR || statusSeverity == IStatus.CANCEL) {
markerSeverity = IMarker.SEVERITY_ERROR;
}
marker.setAttribute(IMarker.SEVERITY, markerSeverity);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLModelingAssistantProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLModelingAssistantProvider.java
index c13e9b5254b..23a1c997e45 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLModelingAssistantProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLModelingAssistantProvider.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -65,25 +65,26 @@ public class UMLModelingAssistantProvider extends ModelingAssistantProvider {
/**
* @generated
*/
+ @Override
public List getTypesForPopupBar(IAdaptable host) {
- IGraphicalEditPart editPart = (IGraphicalEditPart)host.getAdapter(IGraphicalEditPart.class);
- if(editPart instanceof PackageEditPart) {
+ IGraphicalEditPart editPart = (IGraphicalEditPart) host.getAdapter(IGraphicalEditPart.class);
+ if (editPart instanceof PackageEditPart) {
ArrayList<IElementType> types = new ArrayList<IElementType>(1);
types.add(UMLElementTypes.Interaction_2001);
return types;
}
- if(editPart instanceof InteractionEditPart) {
+ if (editPart instanceof InteractionEditPart) {
ArrayList<IElementType> types = new ArrayList<IElementType>(2);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
return types;
}
- if(editPart instanceof CombinedFragmentEditPart) {
+ if (editPart instanceof CombinedFragmentEditPart) {
ArrayList<IElementType> types = new ArrayList<IElementType>(1);
types.add(UMLElementTypes.InteractionOperand_3005);
return types;
}
- if(editPart instanceof InteractionOperandEditPart) {
+ if (editPart instanceof InteractionOperandEditPart) {
ArrayList<IElementType> types = new ArrayList<IElementType>(4);
types.add(UMLElementTypes.InteractionUse_3002);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
@@ -91,7 +92,7 @@ public class UMLModelingAssistantProvider extends ModelingAssistantProvider {
types.add(UMLElementTypes.Continuation_3016);
return types;
}
- if(editPart instanceof LifelineEditPart) {
+ if (editPart instanceof LifelineEditPart) {
ArrayList<IElementType> types = new ArrayList<IElementType>(8);
types.add(UMLElementTypes.ActionExecutionSpecification_3006);
types.add(UMLElementTypes.BehaviorExecutionSpecification_3003);
@@ -103,7 +104,7 @@ public class UMLModelingAssistantProvider extends ModelingAssistantProvider {
types.add(UMLElementTypes.DestructionOccurrenceSpecification_3022);
return types;
}
- if(editPart instanceof InteractionInteractionCompartmentEditPart) {
+ if (editPart instanceof InteractionInteractionCompartmentEditPart) {
ArrayList<IElementType> types = new ArrayList<IElementType>(6);
types.add(UMLElementTypes.ConsiderIgnoreFragment_3007);
types.add(UMLElementTypes.CombinedFragment_3004);
@@ -119,64 +120,65 @@ public class UMLModelingAssistantProvider extends ModelingAssistantProvider {
/**
* @generated
*/
+ @Override
public List getRelTypesOnSource(IAdaptable source) {
- IGraphicalEditPart sourceEditPart = (IGraphicalEditPart)source.getAdapter(IGraphicalEditPart.class);
- if(sourceEditPart instanceof InteractionEditPart) {
- return ((InteractionEditPart)sourceEditPart).getMARelTypesOnSource();
+ IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source.getAdapter(IGraphicalEditPart.class);
+ if (sourceEditPart instanceof InteractionEditPart) {
+ return ((InteractionEditPart) sourceEditPart).getMARelTypesOnSource();
}
- if(sourceEditPart instanceof ConsiderIgnoreFragmentEditPart) {
- return ((ConsiderIgnoreFragmentEditPart)sourceEditPart).getMARelTypesOnSource();
+ if (sourceEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ return ((ConsiderIgnoreFragmentEditPart) sourceEditPart).getMARelTypesOnSource();
}
- if(sourceEditPart instanceof CombinedFragmentEditPart) {
- return ((CombinedFragmentEditPart)sourceEditPart).getMARelTypesOnSource();
+ if (sourceEditPart instanceof CombinedFragmentEditPart) {
+ return ((CombinedFragmentEditPart) sourceEditPart).getMARelTypesOnSource();
}
- if(sourceEditPart instanceof InteractionOperandEditPart) {
- return ((InteractionOperandEditPart)sourceEditPart).getMARelTypesOnSource();
+ if (sourceEditPart instanceof InteractionOperandEditPart) {
+ return ((InteractionOperandEditPart) sourceEditPart).getMARelTypesOnSource();
}
- if(sourceEditPart instanceof InteractionUseEditPart) {
- return ((InteractionUseEditPart)sourceEditPart).getMARelTypesOnSource();
+ if (sourceEditPart instanceof InteractionUseEditPart) {
+ return ((InteractionUseEditPart) sourceEditPart).getMARelTypesOnSource();
}
- if(sourceEditPart instanceof ContinuationEditPart) {
- return ((ContinuationEditPart)sourceEditPart).getMARelTypesOnSource();
+ if (sourceEditPart instanceof ContinuationEditPart) {
+ return ((ContinuationEditPart) sourceEditPart).getMARelTypesOnSource();
}
- if(sourceEditPart instanceof LifelineEditPart) {
- return ((LifelineEditPart)sourceEditPart).getMARelTypesOnSource();
+ if (sourceEditPart instanceof LifelineEditPart) {
+ return ((LifelineEditPart) sourceEditPart).getMARelTypesOnSource();
}
- if(sourceEditPart instanceof ActionExecutionSpecificationEditPart) {
- return ((ActionExecutionSpecificationEditPart)sourceEditPart).getMARelTypesOnSource();
+ if (sourceEditPart instanceof ActionExecutionSpecificationEditPart) {
+ return ((ActionExecutionSpecificationEditPart) sourceEditPart).getMARelTypesOnSource();
}
- if(sourceEditPart instanceof BehaviorExecutionSpecificationEditPart) {
- return ((BehaviorExecutionSpecificationEditPart)sourceEditPart).getMARelTypesOnSource();
+ if (sourceEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ return ((BehaviorExecutionSpecificationEditPart) sourceEditPart).getMARelTypesOnSource();
}
- if(sourceEditPart instanceof StateInvariantEditPart) {
- return ((StateInvariantEditPart)sourceEditPart).getMARelTypesOnSource();
+ if (sourceEditPart instanceof StateInvariantEditPart) {
+ return ((StateInvariantEditPart) sourceEditPart).getMARelTypesOnSource();
}
- if(sourceEditPart instanceof CombinedFragment2EditPart) {
- return ((CombinedFragment2EditPart)sourceEditPart).getMARelTypesOnSource();
+ if (sourceEditPart instanceof CombinedFragment2EditPart) {
+ return ((CombinedFragment2EditPart) sourceEditPart).getMARelTypesOnSource();
}
- if(sourceEditPart instanceof TimeConstraintEditPart) {
- return ((TimeConstraintEditPart)sourceEditPart).getMARelTypesOnSource();
+ if (sourceEditPart instanceof TimeConstraintEditPart) {
+ return ((TimeConstraintEditPart) sourceEditPart).getMARelTypesOnSource();
}
- if(sourceEditPart instanceof TimeObservationEditPart) {
- return ((TimeObservationEditPart)sourceEditPart).getMARelTypesOnSource();
+ if (sourceEditPart instanceof TimeObservationEditPart) {
+ return ((TimeObservationEditPart) sourceEditPart).getMARelTypesOnSource();
}
- if(sourceEditPart instanceof DurationConstraintEditPart) {
- return ((DurationConstraintEditPart)sourceEditPart).getMARelTypesOnSource();
+ if (sourceEditPart instanceof DurationConstraintEditPart) {
+ return ((DurationConstraintEditPart) sourceEditPart).getMARelTypesOnSource();
}
- if(sourceEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
- return ((DestructionOccurrenceSpecificationEditPart)sourceEditPart).getMARelTypesOnSource();
+ if (sourceEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ return ((DestructionOccurrenceSpecificationEditPart) sourceEditPart).getMARelTypesOnSource();
}
- if(sourceEditPart instanceof ConstraintEditPart) {
- return ((ConstraintEditPart)sourceEditPart).getMARelTypesOnSource();
+ if (sourceEditPart instanceof ConstraintEditPart) {
+ return ((ConstraintEditPart) sourceEditPart).getMARelTypesOnSource();
}
- if(sourceEditPart instanceof CommentEditPart) {
- return ((CommentEditPart)sourceEditPart).getMARelTypesOnSource();
+ if (sourceEditPart instanceof CommentEditPart) {
+ return ((CommentEditPart) sourceEditPart).getMARelTypesOnSource();
}
- if(sourceEditPart instanceof DurationConstraintInMessageEditPart) {
- return ((DurationConstraintInMessageEditPart)sourceEditPart).getMARelTypesOnSource();
+ if (sourceEditPart instanceof DurationConstraintInMessageEditPart) {
+ return ((DurationConstraintInMessageEditPart) sourceEditPart).getMARelTypesOnSource();
}
- if(sourceEditPart instanceof DurationObservationEditPart) {
- return ((DurationObservationEditPart)sourceEditPart).getMARelTypesOnSource();
+ if (sourceEditPart instanceof DurationObservationEditPart) {
+ return ((DurationObservationEditPart) sourceEditPart).getMARelTypesOnSource();
}
return Collections.EMPTY_LIST;
}
@@ -184,64 +186,65 @@ public class UMLModelingAssistantProvider extends ModelingAssistantProvider {
/**
* @generated
*/
+ @Override
public List getRelTypesOnTarget(IAdaptable target) {
- IGraphicalEditPart targetEditPart = (IGraphicalEditPart)target.getAdapter(IGraphicalEditPart.class);
- if(targetEditPart instanceof InteractionEditPart) {
- return ((InteractionEditPart)targetEditPart).getMARelTypesOnTarget();
+ IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target.getAdapter(IGraphicalEditPart.class);
+ if (targetEditPart instanceof InteractionEditPart) {
+ return ((InteractionEditPart) targetEditPart).getMARelTypesOnTarget();
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
- return ((ConsiderIgnoreFragmentEditPart)targetEditPart).getMARelTypesOnTarget();
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ return ((ConsiderIgnoreFragmentEditPart) targetEditPart).getMARelTypesOnTarget();
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
- return ((CombinedFragmentEditPart)targetEditPart).getMARelTypesOnTarget();
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
+ return ((CombinedFragmentEditPart) targetEditPart).getMARelTypesOnTarget();
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
- return ((InteractionOperandEditPart)targetEditPart).getMARelTypesOnTarget();
+ if (targetEditPart instanceof InteractionOperandEditPart) {
+ return ((InteractionOperandEditPart) targetEditPart).getMARelTypesOnTarget();
}
- if(targetEditPart instanceof InteractionUseEditPart) {
- return ((InteractionUseEditPart)targetEditPart).getMARelTypesOnTarget();
+ if (targetEditPart instanceof InteractionUseEditPart) {
+ return ((InteractionUseEditPart) targetEditPart).getMARelTypesOnTarget();
}
- if(targetEditPart instanceof ContinuationEditPart) {
- return ((ContinuationEditPart)targetEditPart).getMARelTypesOnTarget();
+ if (targetEditPart instanceof ContinuationEditPart) {
+ return ((ContinuationEditPart) targetEditPart).getMARelTypesOnTarget();
}
- if(targetEditPart instanceof LifelineEditPart) {
- return ((LifelineEditPart)targetEditPart).getMARelTypesOnTarget();
+ if (targetEditPart instanceof LifelineEditPart) {
+ return ((LifelineEditPart) targetEditPart).getMARelTypesOnTarget();
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
- return ((ActionExecutionSpecificationEditPart)targetEditPart).getMARelTypesOnTarget();
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ return ((ActionExecutionSpecificationEditPart) targetEditPart).getMARelTypesOnTarget();
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
- return ((BehaviorExecutionSpecificationEditPart)targetEditPart).getMARelTypesOnTarget();
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ return ((BehaviorExecutionSpecificationEditPart) targetEditPart).getMARelTypesOnTarget();
}
- if(targetEditPart instanceof StateInvariantEditPart) {
- return ((StateInvariantEditPart)targetEditPart).getMARelTypesOnTarget();
+ if (targetEditPart instanceof StateInvariantEditPart) {
+ return ((StateInvariantEditPart) targetEditPart).getMARelTypesOnTarget();
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
- return ((CombinedFragment2EditPart)targetEditPart).getMARelTypesOnTarget();
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
+ return ((CombinedFragment2EditPart) targetEditPart).getMARelTypesOnTarget();
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
- return ((TimeConstraintEditPart)targetEditPart).getMARelTypesOnTarget();
+ if (targetEditPart instanceof TimeConstraintEditPart) {
+ return ((TimeConstraintEditPart) targetEditPart).getMARelTypesOnTarget();
}
- if(targetEditPart instanceof TimeObservationEditPart) {
- return ((TimeObservationEditPart)targetEditPart).getMARelTypesOnTarget();
+ if (targetEditPart instanceof TimeObservationEditPart) {
+ return ((TimeObservationEditPart) targetEditPart).getMARelTypesOnTarget();
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
- return ((DurationConstraintEditPart)targetEditPart).getMARelTypesOnTarget();
+ if (targetEditPart instanceof DurationConstraintEditPart) {
+ return ((DurationConstraintEditPart) targetEditPart).getMARelTypesOnTarget();
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
- return ((DestructionOccurrenceSpecificationEditPart)targetEditPart).getMARelTypesOnTarget();
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ return ((DestructionOccurrenceSpecificationEditPart) targetEditPart).getMARelTypesOnTarget();
}
- if(targetEditPart instanceof ConstraintEditPart) {
- return ((ConstraintEditPart)targetEditPart).getMARelTypesOnTarget();
+ if (targetEditPart instanceof ConstraintEditPart) {
+ return ((ConstraintEditPart) targetEditPart).getMARelTypesOnTarget();
}
- if(targetEditPart instanceof CommentEditPart) {
- return ((CommentEditPart)targetEditPart).getMARelTypesOnTarget();
+ if (targetEditPart instanceof CommentEditPart) {
+ return ((CommentEditPart) targetEditPart).getMARelTypesOnTarget();
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
- return ((DurationConstraintInMessageEditPart)targetEditPart).getMARelTypesOnTarget();
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ return ((DurationConstraintInMessageEditPart) targetEditPart).getMARelTypesOnTarget();
}
- if(targetEditPart instanceof DurationObservationEditPart) {
- return ((DurationObservationEditPart)targetEditPart).getMARelTypesOnTarget();
+ if (targetEditPart instanceof DurationObservationEditPart) {
+ return ((DurationObservationEditPart) targetEditPart).getMARelTypesOnTarget();
}
return Collections.EMPTY_LIST;
}
@@ -249,65 +252,66 @@ public class UMLModelingAssistantProvider extends ModelingAssistantProvider {
/**
* @generated
*/
+ @Override
public List getRelTypesOnSourceAndTarget(IAdaptable source, IAdaptable target) {
- IGraphicalEditPart sourceEditPart = (IGraphicalEditPart)source.getAdapter(IGraphicalEditPart.class);
- IGraphicalEditPart targetEditPart = (IGraphicalEditPart)target.getAdapter(IGraphicalEditPart.class);
- if(sourceEditPart instanceof InteractionEditPart) {
- return ((InteractionEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source.getAdapter(IGraphicalEditPart.class);
+ IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target.getAdapter(IGraphicalEditPart.class);
+ if (sourceEditPart instanceof InteractionEditPart) {
+ return ((InteractionEditPart) sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
}
- if(sourceEditPart instanceof ConsiderIgnoreFragmentEditPart) {
- return ((ConsiderIgnoreFragmentEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ if (sourceEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ return ((ConsiderIgnoreFragmentEditPart) sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
}
- if(sourceEditPart instanceof CombinedFragmentEditPart) {
- return ((CombinedFragmentEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ if (sourceEditPart instanceof CombinedFragmentEditPart) {
+ return ((CombinedFragmentEditPart) sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
}
- if(sourceEditPart instanceof InteractionOperandEditPart) {
- return ((InteractionOperandEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ if (sourceEditPart instanceof InteractionOperandEditPart) {
+ return ((InteractionOperandEditPart) sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
}
- if(sourceEditPart instanceof InteractionUseEditPart) {
- return ((InteractionUseEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ if (sourceEditPart instanceof InteractionUseEditPart) {
+ return ((InteractionUseEditPart) sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
}
- if(sourceEditPart instanceof ContinuationEditPart) {
- return ((ContinuationEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ if (sourceEditPart instanceof ContinuationEditPart) {
+ return ((ContinuationEditPart) sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
}
- if(sourceEditPart instanceof LifelineEditPart) {
- return ((LifelineEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ if (sourceEditPart instanceof LifelineEditPart) {
+ return ((LifelineEditPart) sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
}
- if(sourceEditPart instanceof ActionExecutionSpecificationEditPart) {
- return ((ActionExecutionSpecificationEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ if (sourceEditPart instanceof ActionExecutionSpecificationEditPart) {
+ return ((ActionExecutionSpecificationEditPart) sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
}
- if(sourceEditPart instanceof BehaviorExecutionSpecificationEditPart) {
- return ((BehaviorExecutionSpecificationEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ if (sourceEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ return ((BehaviorExecutionSpecificationEditPart) sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
}
- if(sourceEditPart instanceof StateInvariantEditPart) {
- return ((StateInvariantEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ if (sourceEditPart instanceof StateInvariantEditPart) {
+ return ((StateInvariantEditPart) sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
}
- if(sourceEditPart instanceof CombinedFragment2EditPart) {
- return ((CombinedFragment2EditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ if (sourceEditPart instanceof CombinedFragment2EditPart) {
+ return ((CombinedFragment2EditPart) sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
}
- if(sourceEditPart instanceof TimeConstraintEditPart) {
- return ((TimeConstraintEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ if (sourceEditPart instanceof TimeConstraintEditPart) {
+ return ((TimeConstraintEditPart) sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
}
- if(sourceEditPart instanceof TimeObservationEditPart) {
- return ((TimeObservationEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ if (sourceEditPart instanceof TimeObservationEditPart) {
+ return ((TimeObservationEditPart) sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
}
- if(sourceEditPart instanceof DurationConstraintEditPart) {
- return ((DurationConstraintEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ if (sourceEditPart instanceof DurationConstraintEditPart) {
+ return ((DurationConstraintEditPart) sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
}
- if(sourceEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
- return ((DestructionOccurrenceSpecificationEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ if (sourceEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ return ((DestructionOccurrenceSpecificationEditPart) sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
}
- if(sourceEditPart instanceof ConstraintEditPart) {
- return ((ConstraintEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ if (sourceEditPart instanceof ConstraintEditPart) {
+ return ((ConstraintEditPart) sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
}
- if(sourceEditPart instanceof CommentEditPart) {
- return ((CommentEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ if (sourceEditPart instanceof CommentEditPart) {
+ return ((CommentEditPart) sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
}
- if(sourceEditPart instanceof DurationConstraintInMessageEditPart) {
- return ((DurationConstraintInMessageEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ if (sourceEditPart instanceof DurationConstraintInMessageEditPart) {
+ return ((DurationConstraintInMessageEditPart) sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
}
- if(sourceEditPart instanceof DurationObservationEditPart) {
- return ((DurationObservationEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
+ if (sourceEditPart instanceof DurationObservationEditPart) {
+ return ((DurationObservationEditPart) sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
}
return Collections.EMPTY_LIST;
}
@@ -315,64 +319,65 @@ public class UMLModelingAssistantProvider extends ModelingAssistantProvider {
/**
* @generated
*/
+ @Override
public List getTypesForSource(IAdaptable target, IElementType relationshipType) {
- IGraphicalEditPart targetEditPart = (IGraphicalEditPart)target.getAdapter(IGraphicalEditPart.class);
- if(targetEditPart instanceof InteractionEditPart) {
- return ((InteractionEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target.getAdapter(IGraphicalEditPart.class);
+ if (targetEditPart instanceof InteractionEditPart) {
+ return ((InteractionEditPart) targetEditPart).getMATypesForSource(relationshipType);
}
- if(targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
- return ((ConsiderIgnoreFragmentEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ if (targetEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ return ((ConsiderIgnoreFragmentEditPart) targetEditPart).getMATypesForSource(relationshipType);
}
- if(targetEditPart instanceof CombinedFragmentEditPart) {
- return ((CombinedFragmentEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ if (targetEditPart instanceof CombinedFragmentEditPart) {
+ return ((CombinedFragmentEditPart) targetEditPart).getMATypesForSource(relationshipType);
}
- if(targetEditPart instanceof InteractionOperandEditPart) {
- return ((InteractionOperandEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ if (targetEditPart instanceof InteractionOperandEditPart) {
+ return ((InteractionOperandEditPart) targetEditPart).getMATypesForSource(relationshipType);
}
- if(targetEditPart instanceof InteractionUseEditPart) {
- return ((InteractionUseEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ if (targetEditPart instanceof InteractionUseEditPart) {
+ return ((InteractionUseEditPart) targetEditPart).getMATypesForSource(relationshipType);
}
- if(targetEditPart instanceof ContinuationEditPart) {
- return ((ContinuationEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ if (targetEditPart instanceof ContinuationEditPart) {
+ return ((ContinuationEditPart) targetEditPart).getMATypesForSource(relationshipType);
}
- if(targetEditPart instanceof LifelineEditPart) {
- return ((LifelineEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ if (targetEditPart instanceof LifelineEditPart) {
+ return ((LifelineEditPart) targetEditPart).getMATypesForSource(relationshipType);
}
- if(targetEditPart instanceof ActionExecutionSpecificationEditPart) {
- return ((ActionExecutionSpecificationEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ if (targetEditPart instanceof ActionExecutionSpecificationEditPart) {
+ return ((ActionExecutionSpecificationEditPart) targetEditPart).getMATypesForSource(relationshipType);
}
- if(targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
- return ((BehaviorExecutionSpecificationEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ if (targetEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ return ((BehaviorExecutionSpecificationEditPart) targetEditPart).getMATypesForSource(relationshipType);
}
- if(targetEditPart instanceof StateInvariantEditPart) {
- return ((StateInvariantEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ if (targetEditPart instanceof StateInvariantEditPart) {
+ return ((StateInvariantEditPart) targetEditPart).getMATypesForSource(relationshipType);
}
- if(targetEditPart instanceof CombinedFragment2EditPart) {
- return ((CombinedFragment2EditPart)targetEditPart).getMATypesForSource(relationshipType);
+ if (targetEditPart instanceof CombinedFragment2EditPart) {
+ return ((CombinedFragment2EditPart) targetEditPart).getMATypesForSource(relationshipType);
}
- if(targetEditPart instanceof TimeConstraintEditPart) {
- return ((TimeConstraintEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ if (targetEditPart instanceof TimeConstraintEditPart) {
+ return ((TimeConstraintEditPart) targetEditPart).getMATypesForSource(relationshipType);
}
- if(targetEditPart instanceof TimeObservationEditPart) {
- return ((TimeObservationEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ if (targetEditPart instanceof TimeObservationEditPart) {
+ return ((TimeObservationEditPart) targetEditPart).getMATypesForSource(relationshipType);
}
- if(targetEditPart instanceof DurationConstraintEditPart) {
- return ((DurationConstraintEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ if (targetEditPart instanceof DurationConstraintEditPart) {
+ return ((DurationConstraintEditPart) targetEditPart).getMATypesForSource(relationshipType);
}
- if(targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
- return ((DestructionOccurrenceSpecificationEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ if (targetEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ return ((DestructionOccurrenceSpecificationEditPart) targetEditPart).getMATypesForSource(relationshipType);
}
- if(targetEditPart instanceof ConstraintEditPart) {
- return ((ConstraintEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ if (targetEditPart instanceof ConstraintEditPart) {
+ return ((ConstraintEditPart) targetEditPart).getMATypesForSource(relationshipType);
}
- if(targetEditPart instanceof CommentEditPart) {
- return ((CommentEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ if (targetEditPart instanceof CommentEditPart) {
+ return ((CommentEditPart) targetEditPart).getMATypesForSource(relationshipType);
}
- if(targetEditPart instanceof DurationConstraintInMessageEditPart) {
- return ((DurationConstraintInMessageEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ if (targetEditPart instanceof DurationConstraintInMessageEditPart) {
+ return ((DurationConstraintInMessageEditPart) targetEditPart).getMATypesForSource(relationshipType);
}
- if(targetEditPart instanceof DurationObservationEditPart) {
- return ((DurationObservationEditPart)targetEditPart).getMATypesForSource(relationshipType);
+ if (targetEditPart instanceof DurationObservationEditPart) {
+ return ((DurationObservationEditPart) targetEditPart).getMATypesForSource(relationshipType);
}
return Collections.EMPTY_LIST;
}
@@ -380,64 +385,65 @@ public class UMLModelingAssistantProvider extends ModelingAssistantProvider {
/**
* @generated
*/
+ @Override
public List getTypesForTarget(IAdaptable source, IElementType relationshipType) {
- IGraphicalEditPart sourceEditPart = (IGraphicalEditPart)source.getAdapter(IGraphicalEditPart.class);
- if(sourceEditPart instanceof InteractionEditPart) {
- return ((InteractionEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source.getAdapter(IGraphicalEditPart.class);
+ if (sourceEditPart instanceof InteractionEditPart) {
+ return ((InteractionEditPart) sourceEditPart).getMATypesForTarget(relationshipType);
}
- if(sourceEditPart instanceof ConsiderIgnoreFragmentEditPart) {
- return ((ConsiderIgnoreFragmentEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ if (sourceEditPart instanceof ConsiderIgnoreFragmentEditPart) {
+ return ((ConsiderIgnoreFragmentEditPart) sourceEditPart).getMATypesForTarget(relationshipType);
}
- if(sourceEditPart instanceof CombinedFragmentEditPart) {
- return ((CombinedFragmentEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ if (sourceEditPart instanceof CombinedFragmentEditPart) {
+ return ((CombinedFragmentEditPart) sourceEditPart).getMATypesForTarget(relationshipType);
}
- if(sourceEditPart instanceof InteractionOperandEditPart) {
- return ((InteractionOperandEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ if (sourceEditPart instanceof InteractionOperandEditPart) {
+ return ((InteractionOperandEditPart) sourceEditPart).getMATypesForTarget(relationshipType);
}
- if(sourceEditPart instanceof InteractionUseEditPart) {
- return ((InteractionUseEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ if (sourceEditPart instanceof InteractionUseEditPart) {
+ return ((InteractionUseEditPart) sourceEditPart).getMATypesForTarget(relationshipType);
}
- if(sourceEditPart instanceof ContinuationEditPart) {
- return ((ContinuationEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ if (sourceEditPart instanceof ContinuationEditPart) {
+ return ((ContinuationEditPart) sourceEditPart).getMATypesForTarget(relationshipType);
}
- if(sourceEditPart instanceof LifelineEditPart) {
- return ((LifelineEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ if (sourceEditPart instanceof LifelineEditPart) {
+ return ((LifelineEditPart) sourceEditPart).getMATypesForTarget(relationshipType);
}
- if(sourceEditPart instanceof ActionExecutionSpecificationEditPart) {
- return ((ActionExecutionSpecificationEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ if (sourceEditPart instanceof ActionExecutionSpecificationEditPart) {
+ return ((ActionExecutionSpecificationEditPart) sourceEditPart).getMATypesForTarget(relationshipType);
}
- if(sourceEditPart instanceof BehaviorExecutionSpecificationEditPart) {
- return ((BehaviorExecutionSpecificationEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ if (sourceEditPart instanceof BehaviorExecutionSpecificationEditPart) {
+ return ((BehaviorExecutionSpecificationEditPart) sourceEditPart).getMATypesForTarget(relationshipType);
}
- if(sourceEditPart instanceof StateInvariantEditPart) {
- return ((StateInvariantEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ if (sourceEditPart instanceof StateInvariantEditPart) {
+ return ((StateInvariantEditPart) sourceEditPart).getMATypesForTarget(relationshipType);
}
- if(sourceEditPart instanceof CombinedFragment2EditPart) {
- return ((CombinedFragment2EditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ if (sourceEditPart instanceof CombinedFragment2EditPart) {
+ return ((CombinedFragment2EditPart) sourceEditPart).getMATypesForTarget(relationshipType);
}
- if(sourceEditPart instanceof TimeConstraintEditPart) {
- return ((TimeConstraintEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ if (sourceEditPart instanceof TimeConstraintEditPart) {
+ return ((TimeConstraintEditPart) sourceEditPart).getMATypesForTarget(relationshipType);
}
- if(sourceEditPart instanceof TimeObservationEditPart) {
- return ((TimeObservationEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ if (sourceEditPart instanceof TimeObservationEditPart) {
+ return ((TimeObservationEditPart) sourceEditPart).getMATypesForTarget(relationshipType);
}
- if(sourceEditPart instanceof DurationConstraintEditPart) {
- return ((DurationConstraintEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ if (sourceEditPart instanceof DurationConstraintEditPart) {
+ return ((DurationConstraintEditPart) sourceEditPart).getMATypesForTarget(relationshipType);
}
- if(sourceEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
- return ((DestructionOccurrenceSpecificationEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ if (sourceEditPart instanceof DestructionOccurrenceSpecificationEditPart) {
+ return ((DestructionOccurrenceSpecificationEditPart) sourceEditPart).getMATypesForTarget(relationshipType);
}
- if(sourceEditPart instanceof ConstraintEditPart) {
- return ((ConstraintEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ if (sourceEditPart instanceof ConstraintEditPart) {
+ return ((ConstraintEditPart) sourceEditPart).getMATypesForTarget(relationshipType);
}
- if(sourceEditPart instanceof CommentEditPart) {
- return ((CommentEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ if (sourceEditPart instanceof CommentEditPart) {
+ return ((CommentEditPart) sourceEditPart).getMATypesForTarget(relationshipType);
}
- if(sourceEditPart instanceof DurationConstraintInMessageEditPart) {
- return ((DurationConstraintInMessageEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ if (sourceEditPart instanceof DurationConstraintInMessageEditPart) {
+ return ((DurationConstraintInMessageEditPart) sourceEditPart).getMATypesForTarget(relationshipType);
}
- if(sourceEditPart instanceof DurationObservationEditPart) {
- return ((DurationObservationEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
+ if (sourceEditPart instanceof DurationObservationEditPart) {
+ return ((DurationObservationEditPart) sourceEditPart).getMATypesForTarget(relationshipType);
}
return Collections.EMPTY_LIST;
}
@@ -445,6 +451,7 @@ public class UMLModelingAssistantProvider extends ModelingAssistantProvider {
/**
* @generated
*/
+ @Override
public EObject selectExistingElementForSource(IAdaptable target, IElementType relationshipType) {
return selectExistingElement(target, getTypesForSource(target, relationshipType));
}
@@ -452,6 +459,7 @@ public class UMLModelingAssistantProvider extends ModelingAssistantProvider {
/**
* @generated
*/
+ @Override
public EObject selectExistingElementForTarget(IAdaptable source, IElementType relationshipType) {
return selectExistingElement(source, getTypesForTarget(source, relationshipType));
}
@@ -460,25 +468,25 @@ public class UMLModelingAssistantProvider extends ModelingAssistantProvider {
* @generated
*/
protected EObject selectExistingElement(IAdaptable host, Collection types) {
- if(types.isEmpty()) {
+ if (types.isEmpty()) {
return null;
}
- IGraphicalEditPart editPart = (IGraphicalEditPart)host.getAdapter(IGraphicalEditPart.class);
- if(editPart == null) {
+ IGraphicalEditPart editPart = (IGraphicalEditPart) host.getAdapter(IGraphicalEditPart.class);
+ if (editPart == null) {
return null;
}
- Diagram diagram = (Diagram)editPart.getRoot().getContents().getModel();
+ Diagram diagram = (Diagram) editPart.getRoot().getContents().getModel();
HashSet<EObject> elements = new HashSet<EObject>();
- for(Iterator<EObject> it = diagram.getElement().eAllContents(); it.hasNext();) {
+ for (Iterator<EObject> it = diagram.getElement().eAllContents(); it.hasNext();) {
EObject element = it.next();
- if(isApplicableElement(element, types)) {
+ if (isApplicableElement(element, types)) {
elements.add(element);
}
}
- if(elements.isEmpty()) {
+ if (elements.isEmpty()) {
return null;
}
- return selectElement((EObject[])elements.toArray(new EObject[elements.size()]));
+ return selectElement(elements.toArray(new EObject[elements.size()]));
}
/**
@@ -501,8 +509,8 @@ public class UMLModelingAssistantProvider extends ModelingAssistantProvider {
dialog.setMultipleSelection(false);
dialog.setElements(elements);
EObject selected = null;
- if(dialog.open() == Window.OK) {
- selected = (EObject)dialog.getFirstResult();
+ if (dialog.open() == Window.OK) {
+ selected = (EObject) dialog.getFirstResult();
}
return selected;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLParserProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLParserProvider.java
index 997594e9f01..8cf40b0538c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLParserProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLParserProvider.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -88,8 +88,8 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getInteractionName_5001Parser() {
- if(interactionName_5001Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (interactionName_5001Parser == null) {
+ EAttribute[] features = new EAttribute[] { UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("sd: {0}"); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -108,7 +108,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getLifelineName_5002Parser() {
- if(lifelineName_5002Parser == null) {
+ if (lifelineName_5002Parser == null) {
lifelineName_5002Parser = new LifelineCustomParsers();
}
return lifelineName_5002Parser;
@@ -123,8 +123,8 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getStateInvariantName_5008Parser() {
- if(stateInvariantName_5008Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (stateInvariantName_5008Parser == null) {
+ EAttribute[] features = new EAttribute[] { UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
stateInvariantName_5008Parser = parser;
}
@@ -140,7 +140,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getStateInvariantLabel_5023Parser() {
- if(stateInvariantLabel_5023Parser == null) {
+ if (stateInvariantLabel_5023Parser == null) {
stateInvariantLabel_5023Parser = new ConstraintParser();
}
return stateInvariantLabel_5023Parser;
@@ -155,7 +155,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getTimeConstraintLabel_5009Parser() {
- if(timeConstraintLabel_5009Parser == null) {
+ if (timeConstraintLabel_5009Parser == null) {
timeConstraintLabel_5009Parser = new TimeConstraintParser();
}
return timeConstraintLabel_5009Parser;
@@ -170,7 +170,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getTimeConstraintLabel_5013Parser() {
- if(timeConstraintLabel_5013Parser == null) {
+ if (timeConstraintLabel_5013Parser == null) {
timeConstraintLabel_5013Parser = new AppliedStereotypeParser();
}
return timeConstraintLabel_5013Parser;
@@ -185,7 +185,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getTimeObservationLabel_5010Parser() {
- if(timeObservationLabel_5010Parser == null) {
+ if (timeObservationLabel_5010Parser == null) {
timeObservationLabel_5010Parser = new TimeObservationParser();
}
return timeObservationLabel_5010Parser;
@@ -200,7 +200,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getTimeObservationLabel_5014Parser() {
- if(timeObservationLabel_5014Parser == null) {
+ if (timeObservationLabel_5014Parser == null) {
timeObservationLabel_5014Parser = new AppliedStereotypeParser();
}
return timeObservationLabel_5014Parser;
@@ -215,7 +215,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDurationConstraintLabel_5011Parser() {
- if(durationConstraintLabel_5011Parser == null) {
+ if (durationConstraintLabel_5011Parser == null) {
durationConstraintLabel_5011Parser = new TimeConstraintParser();
}
return durationConstraintLabel_5011Parser;
@@ -230,7 +230,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDurationConstraintLabel_5015Parser() {
- if(durationConstraintLabel_5015Parser == null) {
+ if (durationConstraintLabel_5015Parser == null) {
durationConstraintLabel_5015Parser = new AppliedStereotypeParser();
}
return durationConstraintLabel_5015Parser;
@@ -245,8 +245,8 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getInteractionUseName_5003Parser() {
- if(interactionUseName_5003Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (interactionUseName_5003Parser == null) {
+ EAttribute[] features = new EAttribute[] { UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("Ref"); //$NON-NLS-1$
parser.setEditorPattern("Ref"); //$NON-NLS-1$
@@ -265,7 +265,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getInteractionUseName_5004Parser() {
- if(interactionUseName_5004Parser == null) {
+ if (interactionUseName_5004Parser == null) {
interactionUseName_5004Parser = new InteractionUseCustomParsers();
}
return interactionUseName_5004Parser;
@@ -280,8 +280,8 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getContinuationName_5007Parser() {
- if(continuationName_5007Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (continuationName_5007Parser == null) {
+ EAttribute[] features = new EAttribute[] { UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
continuationName_5007Parser = parser;
}
@@ -297,8 +297,8 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getConstraintName_5005Parser() {
- if(constraintName_5005Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (constraintName_5005Parser == null) {
+ EAttribute[] features = new EAttribute[] { UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
constraintName_5005Parser = parser;
}
@@ -314,7 +314,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getConstraintLabel_5012Parser() {
- if(constraintLabel_5012Parser == null) {
+ if (constraintLabel_5012Parser == null) {
constraintLabel_5012Parser = new ConstraintParser();
}
return constraintLabel_5012Parser;
@@ -329,7 +329,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getCommentBody_5006Parser() {
- if(commentBody_5006Parser == null) {
+ if (commentBody_5006Parser == null) {
commentBody_5006Parser = new CommentParser();
}
return commentBody_5006Parser;
@@ -344,7 +344,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDurationConstraintLabel_5018Parser() {
- if(durationConstraintLabel_5018Parser == null) {
+ if (durationConstraintLabel_5018Parser == null) {
durationConstraintLabel_5018Parser = new TimeConstraintParser();
}
return durationConstraintLabel_5018Parser;
@@ -359,7 +359,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDurationConstraintLabel_5019Parser() {
- if(durationConstraintLabel_5019Parser == null) {
+ if (durationConstraintLabel_5019Parser == null) {
durationConstraintLabel_5019Parser = new AppliedStereotypeParser();
}
return durationConstraintLabel_5019Parser;
@@ -374,7 +374,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDurationObservationLabel_5016Parser() {
- if(durationObservationLabel_5016Parser == null) {
+ if (durationObservationLabel_5016Parser == null) {
durationObservationLabel_5016Parser = new DurationObservationParser();
}
return durationObservationLabel_5016Parser;
@@ -389,7 +389,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDurationObservationLabel_5017Parser() {
- if(durationObservationLabel_5017Parser == null) {
+ if (durationObservationLabel_5017Parser == null) {
durationObservationLabel_5017Parser = new AppliedStereotypeParser();
}
return durationObservationLabel_5017Parser;
@@ -404,7 +404,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getMessageName_6001Parser() {
- if(messageName_6001Parser == null) {
+ if (messageName_6001Parser == null) {
messageName_6001Parser = new MessageCustomParser();
}
return messageName_6001Parser;
@@ -419,7 +419,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getMessageLabel_6008Parser() {
- if(messageLabel_6008Parser == null) {
+ if (messageLabel_6008Parser == null) {
messageLabel_6008Parser = new AppliedStereotypeParser();
}
return messageLabel_6008Parser;
@@ -434,7 +434,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getMessageName_6002Parser() {
- if(messageName_6002Parser == null) {
+ if (messageName_6002Parser == null) {
messageName_6002Parser = new MessageCustomParser();
}
return messageName_6002Parser;
@@ -449,7 +449,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getMessageLabel_6009Parser() {
- if(messageLabel_6009Parser == null) {
+ if (messageLabel_6009Parser == null) {
messageLabel_6009Parser = new AppliedStereotypeParser();
}
return messageLabel_6009Parser;
@@ -464,7 +464,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getMessageName_6003Parser() {
- if(messageName_6003Parser == null) {
+ if (messageName_6003Parser == null) {
messageName_6003Parser = new MessageCustomParser();
}
return messageName_6003Parser;
@@ -479,7 +479,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getMessageLabel_6010Parser() {
- if(messageLabel_6010Parser == null) {
+ if (messageLabel_6010Parser == null) {
messageLabel_6010Parser = new AppliedStereotypeParser();
}
return messageLabel_6010Parser;
@@ -494,7 +494,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getMessageName_6004Parser() {
- if(messageName_6004Parser == null) {
+ if (messageName_6004Parser == null) {
messageName_6004Parser = new MessageCustomParser();
}
return messageName_6004Parser;
@@ -509,7 +509,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getMessageLabel_6011Parser() {
- if(messageLabel_6011Parser == null) {
+ if (messageLabel_6011Parser == null) {
messageLabel_6011Parser = new AppliedStereotypeParser();
}
return messageLabel_6011Parser;
@@ -524,7 +524,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getMessageName_6005Parser() {
- if(messageName_6005Parser == null) {
+ if (messageName_6005Parser == null) {
messageName_6005Parser = new MessageCustomParser();
}
return messageName_6005Parser;
@@ -539,7 +539,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getMessageLabel_6012Parser() {
- if(messageLabel_6012Parser == null) {
+ if (messageLabel_6012Parser == null) {
messageLabel_6012Parser = new AppliedStereotypeParser();
}
return messageLabel_6012Parser;
@@ -554,7 +554,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getMessageName_6006Parser() {
- if(messageName_6006Parser == null) {
+ if (messageName_6006Parser == null) {
messageName_6006Parser = new MessageCustomParser();
}
return messageName_6006Parser;
@@ -569,7 +569,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getMessageLabel_6013Parser() {
- if(messageLabel_6013Parser == null) {
+ if (messageLabel_6013Parser == null) {
messageLabel_6013Parser = new AppliedStereotypeParser();
}
return messageLabel_6013Parser;
@@ -584,7 +584,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getMessageName_6007Parser() {
- if(messageName_6007Parser == null) {
+ if (messageName_6007Parser == null) {
messageName_6007Parser = new MessageCustomParser();
}
return messageName_6007Parser;
@@ -599,7 +599,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getMessageLabel_6014Parser() {
- if(messageLabel_6014Parser == null) {
+ if (messageLabel_6014Parser == null) {
messageLabel_6014Parser = new AppliedStereotypeParser();
}
return messageLabel_6014Parser;
@@ -614,7 +614,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getGeneralOrderingLabel_6015Parser() {
- if(generalOrderingLabel_6015Parser == null) {
+ if (generalOrderingLabel_6015Parser == null) {
generalOrderingLabel_6015Parser = new AppliedStereotypeParser();
}
return generalOrderingLabel_6015Parser;
@@ -629,7 +629,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getConstraintContextName_8501Parser() {
- if(constraintContextName_8501Parser == null) {
+ if (constraintContextName_8501Parser == null) {
constraintContextName_8501Parser = new AppliedStereotypeParser();
}
return constraintContextName_8501Parser;
@@ -639,7 +639,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
protected IParser getParser(int visualID) {
- switch(visualID) {
+ switch (visualID) {
case InteractionNameEditPart.VISUAL_ID:
return getInteractionName_5001Parser();
case InteractionUseNameEditPart.VISUAL_ID:
@@ -718,7 +718,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
/**
* Utility method that consults ParserService
- *
+ *
* @generated
*/
public static IParser getParser(IElementType type, EObject object, String parserHint) {
@@ -728,13 +728,14 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
/**
* @generated
*/
+ @Override
public IParser getParser(IAdaptable hint) {
- String vid = (String)hint.getAdapter(String.class);
- if(vid != null) {
+ String vid = (String) hint.getAdapter(String.class);
+ if (vid != null) {
return getParser(UMLVisualIDRegistry.getVisualID(vid));
}
- View view = (View)hint.getAdapter(View.class);
- if(view != null) {
+ View view = (View) hint.getAdapter(View.class);
+ if (view != null) {
return getParser(UMLVisualIDRegistry.getVisualID(view));
}
return null;
@@ -743,10 +744,11 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
/**
* @generated
*/
+ @Override
public boolean provides(IOperation operation) {
- if(operation instanceof GetParserOperation) {
- IAdaptable hint = ((GetParserOperation)operation).getHint();
- if(UMLElementTypes.getElement(hint) == null) {
+ if (operation instanceof GetParserOperation) {
+ IAdaptable hint = ((GetParserOperation) operation).getHint();
+ if (UMLElementTypes.getElement(hint) == null) {
return false;
}
return getParser(hint) != null;
@@ -776,8 +778,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
/**
* @generated
*/
+ @Override
public Object getAdapter(Class adapter) {
- if(IElementType.class.equals(adapter)) {
+ if (IElementType.class.equals(adapter)) {
return elementType;
}
return super.getAdapter(adapter);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLValidationDecoratorProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLValidationDecoratorProvider.java
index d995d751f58..d8053e80bf9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLValidationDecoratorProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLValidationDecoratorProvider.java
@@ -24,21 +24,22 @@ public class UMLValidationDecoratorProvider extends ValidationDecoratorProvider
/**
* @generated
*/
+ @Override
public void createDecorators(IDecoratorTarget decoratorTarget) {
- EditPart editPart = (EditPart)decoratorTarget.getAdapter(EditPart.class);
- if(editPart instanceof GraphicalEditPart || editPart instanceof AbstractConnectionEditPart) {
+ EditPart editPart = (EditPart) decoratorTarget.getAdapter(EditPart.class);
+ if (editPart instanceof GraphicalEditPart || editPart instanceof AbstractConnectionEditPart) {
Object model = editPart.getModel();
- if((model instanceof View)) {
- View view = (View)model;
- if(!(view instanceof Edge) && !view.isSetElement()) {
+ if ((model instanceof View)) {
+ View view = (View) model;
+ if (!(view instanceof Edge) && !view.isSetElement()) {
return;
}
}
EditDomain ed = editPart.getViewer().getEditDomain();
- if(!(ed instanceof DiagramEditDomain)) {
+ if (!(ed instanceof DiagramEditDomain)) {
return;
}
- if(((DiagramEditDomain)ed).getEditorPart() instanceof UMLDiagramEditor) {
+ if (((DiagramEditDomain) ed).getEditorPart() instanceof UMLDiagramEditor) {
decoratorTarget.installDecorator(KEY, new StatusDecorator(decoratorTarget));
}
}
@@ -47,12 +48,13 @@ public class UMLValidationDecoratorProvider extends ValidationDecoratorProvider
/**
* @generated
*/
+ @Override
public boolean provides(IOperation operation) {
- if(!(operation instanceof CreateDecoratorsOperation)) {
+ if (!(operation instanceof CreateDecoratorsOperation)) {
return false;
}
- IDecoratorTarget decoratorTarget = ((CreateDecoratorsOperation)operation).getDecoratorTarget();
- View view = (View)decoratorTarget.getAdapter(View.class);
+ IDecoratorTarget decoratorTarget = ((CreateDecoratorsOperation) operation).getDecoratorTarget();
+ View view = (View) decoratorTarget.getAdapter(View.class);
return view != null && PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(view));
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLValidationProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLValidationProvider.java
index 13e419e5b9b..27d0f1acf8f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLValidationProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLValidationProvider.java
@@ -47,6 +47,7 @@ public class UMLValidationProvider {
final Runnable op = operation;
Runnable task = new Runnable() {
+ @Override
public void run() {
try {
constraintsActive = true;
@@ -56,7 +57,7 @@ public class UMLValidationProvider {
}
}
};
- if(editingDomain != null) {
+ if (editingDomain != null) {
try {
editingDomain.runExclusive(task);
} catch (Exception e) {
@@ -71,11 +72,11 @@ public class UMLValidationProvider {
* @generated
*/
static boolean isInDefaultEditorContext(Object object) {
- if(shouldConstraintsBePrivate() && !constraintsActive) {
+ if (shouldConstraintsBePrivate() && !constraintsActive) {
return false;
}
- if(object instanceof View) {
- return constraintsActive && PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID((View)object));
+ if (object instanceof View) {
+ return constraintsActive && PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID((View) object));
}
return true;
}
@@ -88,6 +89,7 @@ public class UMLValidationProvider {
/**
* @generated
*/
+ @Override
public boolean selects(Object object) {
return isInDefaultEditorContext(object);
}
@@ -100,12 +102,13 @@ public class UMLValidationProvider {
/**
* select all moved edit parts which are linked to an occurrence specification
- *
+ *
* @generated
*/
+ @Override
public boolean selects(Object object) {
- if(isInDefaultEditorContext(object) && object instanceof View) {
- final int id = UMLVisualIDRegistry.getVisualID((View)object);
+ if (isInDefaultEditorContext(object) && object instanceof View) {
+ final int id = UMLVisualIDRegistry.getVisualID((View) object);
boolean result = false;
result = result || id == LifelineEditPart.VISUAL_ID;
return result;
@@ -161,13 +164,14 @@ public class UMLValidationProvider {
*/
CtxSwitchStrategy(IBatchValidator validator) {
this.defaultStrategy = validator.getDefaultTraversalStrategy();
- this.contextSwitchingIdentifiers = new int[]{ LifelineEditPart.VISUAL_ID };
+ this.contextSwitchingIdentifiers = new int[] { LifelineEditPart.VISUAL_ID };
Arrays.sort(this.contextSwitchingIdentifiers);
}
/**
* @generated
*/
+ @Override
public void elementValidated(EObject element, IStatus status) {
defaultStrategy.elementValidated(element, status);
}
@@ -175,6 +179,7 @@ public class UMLValidationProvider {
/**
* @generated
*/
+ @Override
public boolean hasNext() {
return defaultStrategy.hasNext();
}
@@ -182,8 +187,9 @@ public class UMLValidationProvider {
/**
* @generated
*/
+ @Override
public boolean isClientContextChanged() {
- if(preFetchedNextTarget == null) {
+ if (preFetchedNextTarget == null) {
preFetchedNextTarget = next();
prepareNextClientContext(preFetchedNextTarget);
}
@@ -193,9 +199,10 @@ public class UMLValidationProvider {
/**
* @generated
*/
+ @Override
public EObject next() {
EObject nextTarget = preFetchedNextTarget;
- if(nextTarget == null) {
+ if (nextTarget == null) {
nextTarget = defaultStrategy.next();
}
this.preFetchedNextTarget = null;
@@ -205,6 +212,7 @@ public class UMLValidationProvider {
/**
* @generated
*/
+ @Override
public void startTraversal(Collection traversalRoots, IProgressMonitor monitor) {
defaultStrategy.startTraversal(traversalRoots, monitor);
}
@@ -213,11 +221,11 @@ public class UMLValidationProvider {
* @generated
*/
private void prepareNextClientContext(EObject nextTarget) {
- if(nextTarget != null && currentTarget != null) {
- if(nextTarget instanceof View) {
- final int id = UMLVisualIDRegistry.getVisualID((View)nextTarget);
+ if (nextTarget != null && currentTarget != null) {
+ if (nextTarget instanceof View) {
+ final int id = UMLVisualIDRegistry.getVisualID((View) nextTarget);
int nextSemanticId = (id != -1 && Arrays.binarySearch(contextSwitchingIdentifiers, id) >= 0) ? id : -1;
- if((currentSemanticCtxId != -1 && currentSemanticCtxId != nextSemanticId) || (nextSemanticId != -1 && nextSemanticId != currentSemanticCtxId)) {
+ if ((currentSemanticCtxId != -1 && currentSemanticCtxId != nextSemanticId) || (nextSemanticId != -1 && nextSemanticId != currentSemanticCtxId)) {
this.ctxChanged = true;
}
currentSemanticCtxId = nextSemanticId;
@@ -240,8 +248,9 @@ public class UMLValidationProvider {
/**
* @generated
*/
+ @Override
public IStatus validate(IValidationContext ctx) {
- Interaction context = (Interaction)ctx.getTarget();
+ Interaction context = (Interaction) ctx.getTarget();
return UMLValidationHelper.validateFragmentsOrder(context, ctx);
}
}
@@ -254,8 +263,9 @@ public class UMLValidationProvider {
/**
* @generated
*/
+ @Override
public IStatus validate(IValidationContext ctx) {
- InteractionOperand context = (InteractionOperand)ctx.getTarget();
+ InteractionOperand context = (InteractionOperand) ctx.getTarget();
return UMLValidationHelper.validateFragmentsOrder(context, ctx);
}
}
@@ -267,11 +277,12 @@ public class UMLValidationProvider {
/**
* do not presume on target type
- *
+ *
* @generated
*/
+ @Override
public IStatus validate(IValidationContext ctx) {
- Node context = (Node)ctx.getTarget();
+ Node context = (Node) ctx.getTarget();
return UMLValidationHelper.validateFragmentsOrder(context, ctx);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLViewProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLViewProvider.java
index 210455955bc..3bd3f8ef7a9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLViewProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLViewProvider.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -139,17 +139,18 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
/**
* @generated
*/
+ @Override
public final boolean provides(IOperation operation) {
- if(operation instanceof CreateViewForKindOperation) {
- return provides((CreateViewForKindOperation)operation);
+ if (operation instanceof CreateViewForKindOperation) {
+ return provides((CreateViewForKindOperation) operation);
}
assert operation instanceof CreateViewOperation;
- if(operation instanceof CreateDiagramViewOperation) {
- return provides((CreateDiagramViewOperation)operation);
- } else if(operation instanceof CreateEdgeViewOperation) {
- return provides((CreateEdgeViewOperation)operation);
- } else if(operation instanceof CreateNodeViewOperation) {
- return provides((CreateNodeViewOperation)operation);
+ if (operation instanceof CreateDiagramViewOperation) {
+ return provides((CreateDiagramViewOperation) operation);
+ } else if (operation instanceof CreateEdgeViewOperation) {
+ return provides((CreateEdgeViewOperation) operation);
+ } else if (operation instanceof CreateNodeViewOperation) {
+ return provides((CreateNodeViewOperation) operation);
}
return false;
}
@@ -166,11 +167,11 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
*/
// check Diagram Type should be the class diagram
String modelID = UMLVisualIDRegistry.getModelID(op.getContainerView());
- if(!getDiagramProvidedId().equals(modelID)) {
+ if (!getDiagramProvidedId().equals(modelID)) {
return false;
}
int visualID = UMLVisualIDRegistry.getVisualID(op.getSemanticHint());
- if(Node.class.isAssignableFrom(op.getViewKind())) {
+ if (Node.class.isAssignableFrom(op.getViewKind())) {
return UMLVisualIDRegistry.canCreateNode(op.getContainerView(), visualID);
}
return true;
@@ -202,45 +203,45 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
* @generated
*/
protected boolean provides(CreateNodeViewOperation op) {
- if(op.getContainerView() == null) {
+ if (op.getContainerView() == null) {
return false;
}
IElementType elementType = getSemanticElementType(op.getSemanticAdapter());
EObject domainElement = getSemanticElement(op.getSemanticAdapter());
int visualID;
- if(op.getSemanticHint() == null) {
+ if (op.getSemanticHint() == null) {
// Semantic hint is not specified. Can be a result of call from CanonicalEditPolicy.
// In this situation there should be NO elementType, visualID will be determined
// by VisualIDRegistry.getNodeVisualID() for domainElement.
- if(elementType != null || domainElement == null) {
+ if (elementType != null || domainElement == null) {
return false;
}
visualID = UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement);
} else {
visualID = UMLVisualIDRegistry.getVisualID(op.getSemanticHint());
- if(elementType != null) {
- if(elementType instanceof IExtendedHintedElementType) {
+ if (elementType != null) {
+ if (elementType instanceof IExtendedHintedElementType) {
IElementType closestNonExtendedType = ElementTypeUtils.getClosestDiagramType(elementType);
- if(!UMLElementTypes.isKnownElementType(closestNonExtendedType) || (!(closestNonExtendedType instanceof IHintedType))) {
+ if (!UMLElementTypes.isKnownElementType(closestNonExtendedType) || (!(closestNonExtendedType instanceof IHintedType))) {
return false; // foreign element type.
}
} else {
- if(!UMLElementTypes.isKnownElementType(elementType) || (!(elementType instanceof IHintedType))) {
+ if (!UMLElementTypes.isKnownElementType(elementType) || (!(elementType instanceof IHintedType))) {
return false; // foreign element type
}
}
- String elementTypeHint = ((IHintedType)elementType).getSemanticHint();
- if(!op.getSemanticHint().equals(elementTypeHint)) {
+ String elementTypeHint = ((IHintedType) elementType).getSemanticHint();
+ if (!op.getSemanticHint().equals(elementTypeHint)) {
return false; // if semantic hint is specified it should be the same as in element type
}
- if(domainElement != null && visualID != UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement)) {
+ if (domainElement != null && visualID != UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement)) {
return false; // visual id for node EClass should match visual id from element type
}
} else {
- if(!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(op.getContainerView()))) {
+ if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(op.getContainerView()))) {
return false; // foreign diagram
}
- switch(visualID) {
+ switch (visualID) {
case InteractionEditPart.VISUAL_ID:
case ConsiderIgnoreFragmentEditPart.VISUAL_ID:
case CombinedFragmentEditPart.VISUAL_ID:
@@ -260,7 +261,7 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
case DurationObservationEditPart.VISUAL_ID:
case CombinedFragment2EditPart.VISUAL_ID:
case DurationConstraintInMessageEditPart.VISUAL_ID:
- if(domainElement == null || visualID != UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement)) {
+ if (domainElement == null || visualID != UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement)) {
return false; // visual id in semantic hint should match visual id for domain element
}
break;
@@ -269,7 +270,11 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
}
}
}
- return InteractionEditPart.VISUAL_ID == visualID || ConsiderIgnoreFragmentEditPart.VISUAL_ID == visualID || CombinedFragmentEditPart.VISUAL_ID == visualID || InteractionOperandEditPart.VISUAL_ID == visualID || InteractionUseEditPart.VISUAL_ID == visualID || ContinuationEditPart.VISUAL_ID == visualID || LifelineEditPart.VISUAL_ID == visualID || ActionExecutionSpecificationEditPart.VISUAL_ID == visualID || BehaviorExecutionSpecificationEditPart.VISUAL_ID == visualID || StateInvariantEditPart.VISUAL_ID == visualID || CombinedFragment2EditPart.VISUAL_ID == visualID || TimeConstraintEditPart.VISUAL_ID == visualID || TimeObservationEditPart.VISUAL_ID == visualID || DurationConstraintEditPart.VISUAL_ID == visualID || DestructionOccurrenceSpecificationEditPart.VISUAL_ID == visualID || ConstraintEditPart.VISUAL_ID == visualID || CommentEditPart.VISUAL_ID == visualID || DurationConstraintInMessageEditPart.VISUAL_ID == visualID || DurationObservationEditPart.VISUAL_ID == visualID;
+ return InteractionEditPart.VISUAL_ID == visualID || ConsiderIgnoreFragmentEditPart.VISUAL_ID == visualID || CombinedFragmentEditPart.VISUAL_ID == visualID || InteractionOperandEditPart.VISUAL_ID == visualID
+ || InteractionUseEditPart.VISUAL_ID == visualID || ContinuationEditPart.VISUAL_ID == visualID || LifelineEditPart.VISUAL_ID == visualID || ActionExecutionSpecificationEditPart.VISUAL_ID == visualID
+ || BehaviorExecutionSpecificationEditPart.VISUAL_ID == visualID || StateInvariantEditPart.VISUAL_ID == visualID || CombinedFragment2EditPart.VISUAL_ID == visualID || TimeConstraintEditPart.VISUAL_ID == visualID
+ || TimeObservationEditPart.VISUAL_ID == visualID || DurationConstraintEditPart.VISUAL_ID == visualID || DestructionOccurrenceSpecificationEditPart.VISUAL_ID == visualID || ConstraintEditPart.VISUAL_ID == visualID
+ || CommentEditPart.VISUAL_ID == visualID || DurationConstraintInMessageEditPart.VISUAL_ID == visualID || DurationObservationEditPart.VISUAL_ID == visualID;
}
/**
@@ -277,28 +282,28 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
*/
protected boolean provides(CreateEdgeViewOperation op) {
IElementType elementType = getSemanticElementType(op.getSemanticAdapter());
- //RS: add code for extended types creation
- if(elementType instanceof IExtendedHintedElementType) {
+ // RS: add code for extended types creation
+ if (elementType instanceof IExtendedHintedElementType) {
IElementType closestNonExtendedType = ElementTypeUtils.getClosestDiagramType(elementType);
- if(!UMLElementTypes.isKnownElementType(closestNonExtendedType) || (!(closestNonExtendedType instanceof IHintedType))) {
+ if (!UMLElementTypes.isKnownElementType(closestNonExtendedType) || (!(closestNonExtendedType instanceof IHintedType))) {
return false; // foreign element type.
}
} else {
- if(!UMLElementTypes.isKnownElementType(elementType) || (!(elementType instanceof IHintedType))) {
+ if (!UMLElementTypes.isKnownElementType(elementType) || (!(elementType instanceof IHintedType))) {
return false; // foreign element type
}
}
- //if (!org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes.isKnownElementType(elementType) || (!(elementType instanceof org.eclipse.gmf.runtime.emf.type.core.IHintedType))) {
- // return false; // foreign element type
- //}
+ // if (!org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes.isKnownElementType(elementType) || (!(elementType instanceof org.eclipse.gmf.runtime.emf.type.core.IHintedType))) {
+ // return false; // foreign element type
+ // }
// END R.S.
- String elementTypeHint = ((IHintedType)elementType).getSemanticHint();
- if(elementTypeHint == null || (op.getSemanticHint() != null && !elementTypeHint.equals(op.getSemanticHint()))) {
+ String elementTypeHint = ((IHintedType) elementType).getSemanticHint();
+ if (elementTypeHint == null || (op.getSemanticHint() != null && !elementTypeHint.equals(op.getSemanticHint()))) {
return false; // our hint is visual id and must be specified, and it should be the same as in element type
}
int visualID = UMLVisualIDRegistry.getVisualID(elementTypeHint);
EObject domainElement = getSemanticElement(op.getSemanticAdapter());
- if(domainElement != null && visualID != UMLVisualIDRegistry.getLinkWithClassVisualID(domainElement)) {
+ if (domainElement != null && visualID != UMLVisualIDRegistry.getLinkWithClassVisualID(domainElement)) {
return false; // visual id for link EClass should match visual id from element type
}
return true;
@@ -307,6 +312,7 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
/**
* @generated
*/
+ @Override
public Diagram createDiagram(IAdaptable semanticAdapter, String diagramKind, PreferencesHint preferencesHint) {
Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
DiagramVersioningUtils.stampCurrentVersion(diagram);
@@ -320,15 +326,16 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
/**
* @generated
*/
+ @Override
public Node createNode(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
final EObject domainElement = getSemanticElement(semanticAdapter);
final int visualID;
- if(semanticHint == null) {
+ if (semanticHint == null) {
visualID = UMLVisualIDRegistry.getNodeVisualID(containerView, domainElement);
} else {
visualID = UMLVisualIDRegistry.getVisualID(semanticHint);
}
- switch(visualID) {
+ switch (visualID) {
case InteractionEditPart.VISUAL_ID:
return createInteraction_2001(domainElement, containerView, index, persisted, preferencesHint);
case ConsiderIgnoreFragmentEditPart.VISUAL_ID:
@@ -375,10 +382,11 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
/**
* @generated
*/
+ @Override
public Edge createEdge(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
IElementType elementType = getSemanticElementType(semanticAdapter);
- String elementTypeHint = ((IHintedType)elementType).getSemanticHint();
- switch(UMLVisualIDRegistry.getVisualID(elementTypeHint)) {
+ String elementTypeHint = ((IHintedType) elementType).getSemanticHint();
+ switch (UMLVisualIDRegistry.getVisualID(elementTypeHint)) {
case MessageEditPart.VISUAL_ID:
return createMessage_4003(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint);
case Message2EditPart.VISUAL_ID:
@@ -416,8 +424,8 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Interaction");
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Interaction");
PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Interaction");
@@ -436,8 +444,8 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(LifelineEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Lifeline");
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Lifeline");
PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Lifeline");
@@ -454,8 +462,8 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(BehaviorExecutionSpecificationEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "BehaviorExecutionSpecification");
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "BehaviorExecutionSpecification");
PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "BehaviorExecutionSpecification");
@@ -471,8 +479,8 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(StateInvariantEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "StateInvariant");
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "StateInvariant");
PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "StateInvariant");
@@ -490,8 +498,8 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(CombinedFragment2EditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "CombinedFragment");
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "CombinedFragment");
PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "CombinedFragment");
@@ -507,19 +515,19 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(TimeConstraintEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "TimeConstraint");
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "TimeConstraint");
PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "TimeConstraint");
Node label5009 = createLabel(node, UMLVisualIDRegistry.getType(TimeConstraintLabelEditPart.VISUAL_ID));
label5009.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location5009 = (Location)label5009.getLayoutConstraint();
+ Location location5009 = (Location) label5009.getLayoutConstraint();
location5009.setX(22);
location5009.setY(-7);
Node label5013 = createLabel(node, UMLVisualIDRegistry.getType(TimeConstraintAppliedStereotypeEditPart.VISUAL_ID));
label5013.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location5013 = (Location)label5013.getLayoutConstraint();
+ Location location5013 = (Location) label5013.getLayoutConstraint();
location5013.setX(0);
location5013.setY(-22);
return node;
@@ -534,19 +542,19 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(TimeObservationEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "TimeObservation");
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "TimeObservation");
PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "TimeObservation");
Node label5010 = createLabel(node, UMLVisualIDRegistry.getType(TimeObservationLabelEditPart.VISUAL_ID));
label5010.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location5010 = (Location)label5010.getLayoutConstraint();
+ Location location5010 = (Location) label5010.getLayoutConstraint();
location5010.setX(22);
location5010.setY(-7);
Node label5014 = createLabel(node, UMLVisualIDRegistry.getType(TimeObservationAppliedStereotypeEditPart.VISUAL_ID));
label5014.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location5014 = (Location)label5014.getLayoutConstraint();
+ Location location5014 = (Location) label5014.getLayoutConstraint();
location5014.setX(0);
location5014.setY(-22);
return node;
@@ -561,19 +569,19 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(DurationConstraintEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "DurationConstraint");
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "DurationConstraint");
PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "DurationConstraint");
Node label5011 = createLabel(node, UMLVisualIDRegistry.getType(DurationConstraintLabelEditPart.VISUAL_ID));
label5011.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location5011 = (Location)label5011.getLayoutConstraint();
+ Location location5011 = (Location) label5011.getLayoutConstraint();
location5011.setX(25);
location5011.setY(45);
Node label5015 = createLabel(node, UMLVisualIDRegistry.getType(DurationConstraintAppliedStereotypeEditPart.VISUAL_ID));
label5015.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location5015 = (Location)label5015.getLayoutConstraint();
+ Location location5015 = (Location) label5015.getLayoutConstraint();
location5015.setX(0);
location5015.setY(-22);
return node;
@@ -588,8 +596,8 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(DestructionOccurrenceSpecificationEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "DestructionOccurrenceSpecification");
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "DestructionOccurrenceSpecification");
PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "DestructionOccurrenceSpecification");
@@ -605,8 +613,8 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(ActionExecutionSpecificationEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "ActionExecutionSpecification");
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "ActionExecutionSpecification");
PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "ActionExecutionSpecification");
@@ -623,8 +631,8 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(InteractionUseEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "InteractionUse");
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "InteractionUse");
PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "InteractionUse");
@@ -635,7 +643,7 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
/**
* Generated not for always have an InteractionOperand on a CombinedFragment
- *
+ *
* @generated
*/
public Node createCombinedFragment_3004(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
@@ -644,8 +652,8 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(CombinedFragmentEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "CombinedFragment");
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "CombinedFragment");
PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "CombinedFragment");
@@ -663,8 +671,8 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(InteractionOperandEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "InteractionOperand");
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "InteractionOperand");
PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "InteractionOperand");
@@ -680,8 +688,8 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(ContinuationEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Continuation");
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Continuation");
PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Continuation");
@@ -698,8 +706,8 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(ConstraintEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Constraint");
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Constraint");
PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Constraint");
@@ -717,8 +725,8 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(CommentEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Comment");
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Comment");
PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Comment");
@@ -737,13 +745,13 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(DurationConstraintInMessageEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "DurationConstraint");
Node label5018 = createLabel(node, UMLVisualIDRegistry.getType(DurationConstraintInMessageLabelEditPart.VISUAL_ID));
Node label5019 = createLabel(node, UMLVisualIDRegistry.getType(DurationConstraintInMessageAppliedStereotypeEditPart.VISUAL_ID));
label5019.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location5019 = (Location)label5019.getLayoutConstraint();
+ Location location5019 = (Location) label5019.getLayoutConstraint();
location5019.setX(0);
location5019.setY(-22);
return node;
@@ -760,13 +768,13 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(DurationObservationEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "DurationObservation");
Node label5016 = createLabel(node, UMLVisualIDRegistry.getType(DurationObservationLabelEditPart.VISUAL_ID));
Node label5017 = createLabel(node, UMLVisualIDRegistry.getType(DurationObservationAppliedStereotypeEditPart.VISUAL_ID));
label5017.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location5017 = (Location)label5017.getLayoutConstraint();
+ Location location5017 = (Location) label5017.getLayoutConstraint();
location5017.setX(0);
location5017.setY(-22);
return node;
@@ -781,8 +789,8 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(ConsiderIgnoreFragmentEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "ConsiderIgnoreFragment");
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "ConsiderIgnoreFragment");
PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "ConsiderIgnoreFragment");
@@ -806,21 +814,21 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(MessageEditPart.VISUAL_ID));
edge.setElement(domainElement);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Message");
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
+ // org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
+ // if (routing != null) {
+ // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
+ // }
PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Message");
Node label6001 = createLabel(edge, UMLVisualIDRegistry.getType(MessageNameEditPart.VISUAL_ID));
label6001.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6001 = (Location)label6001.getLayoutConstraint();
+ Location location6001 = (Location) label6001.getLayoutConstraint();
location6001.setX(1);
location6001.setY(-13);
Node label6008 = createLabel(edge, UMLVisualIDRegistry.getType(MessageSyncAppliedStereotypeEditPart.VISUAL_ID));
label6008.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6008 = (Location)label6008.getLayoutConstraint();
+ Location location6008 = (Location) label6008.getLayoutConstraint();
location6008.setX(1);
location6008.setY(-33);
return edge;
@@ -843,21 +851,21 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(Message2EditPart.VISUAL_ID));
edge.setElement(domainElement);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Message");
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
+ // org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
+ // if (routing != null) {
+ // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
+ // }
PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Message");
Node label6002 = createLabel(edge, UMLVisualIDRegistry.getType(MessageName2EditPart.VISUAL_ID));
label6002.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6002 = (Location)label6002.getLayoutConstraint();
+ Location location6002 = (Location) label6002.getLayoutConstraint();
location6002.setX(1);
location6002.setY(-13);
Node label6009 = createLabel(edge, UMLVisualIDRegistry.getType(MessageAsyncAppliedStereotypeEditPart.VISUAL_ID));
label6009.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6009 = (Location)label6009.getLayoutConstraint();
+ Location location6009 = (Location) label6009.getLayoutConstraint();
location6009.setX(1);
location6009.setY(-33);
return edge;
@@ -880,21 +888,21 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(Message3EditPart.VISUAL_ID));
edge.setElement(domainElement);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Message");
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
+ // org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
+ // if (routing != null) {
+ // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
+ // }
PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Message");
Node label6003 = createLabel(edge, UMLVisualIDRegistry.getType(MessageName3EditPart.VISUAL_ID));
label6003.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6003 = (Location)label6003.getLayoutConstraint();
+ Location location6003 = (Location) label6003.getLayoutConstraint();
location6003.setX(1);
location6003.setY(-13);
Node label6010 = createLabel(edge, UMLVisualIDRegistry.getType(MessageReplyAppliedStereotypeEditPart.VISUAL_ID));
label6010.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6010 = (Location)label6010.getLayoutConstraint();
+ Location location6010 = (Location) label6010.getLayoutConstraint();
location6010.setX(1);
location6010.setY(-33);
return edge;
@@ -917,21 +925,21 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(Message4EditPart.VISUAL_ID));
edge.setElement(domainElement);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Message");
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
+ // org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
+ // if (routing != null) {
+ // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
+ // }
PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Message");
Node label6004 = createLabel(edge, UMLVisualIDRegistry.getType(MessageName4EditPart.VISUAL_ID));
label6004.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6004 = (Location)label6004.getLayoutConstraint();
+ Location location6004 = (Location) label6004.getLayoutConstraint();
location6004.setX(1);
location6004.setY(-13);
Node label6011 = createLabel(edge, UMLVisualIDRegistry.getType(MessageCreateAppliedStereotypeEditPart.VISUAL_ID));
label6011.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6011 = (Location)label6011.getLayoutConstraint();
+ Location location6011 = (Location) label6011.getLayoutConstraint();
location6011.setX(1);
location6011.setY(-33);
return edge;
@@ -954,21 +962,21 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(Message5EditPart.VISUAL_ID));
edge.setElement(domainElement);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Message");
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
+ // org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
+ // if (routing != null) {
+ // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
+ // }
PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Message");
Node label6005 = createLabel(edge, UMLVisualIDRegistry.getType(MessageName5EditPart.VISUAL_ID));
label6005.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6005 = (Location)label6005.getLayoutConstraint();
+ Location location6005 = (Location) label6005.getLayoutConstraint();
location6005.setX(1);
location6005.setY(-13);
Node label6012 = createLabel(edge, UMLVisualIDRegistry.getType(MessageDeleteAppliedStereotypeEditPart.VISUAL_ID));
label6012.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6012 = (Location)label6012.getLayoutConstraint();
+ Location location6012 = (Location) label6012.getLayoutConstraint();
location6012.setX(1);
location6012.setY(-33);
return edge;
@@ -991,21 +999,21 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(Message6EditPart.VISUAL_ID));
edge.setElement(domainElement);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Message");
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
+ // org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
+ // if (routing != null) {
+ // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
+ // }
PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Message");
Node label6006 = createLabel(edge, UMLVisualIDRegistry.getType(MessageName6EditPart.VISUAL_ID));
label6006.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6006 = (Location)label6006.getLayoutConstraint();
+ Location location6006 = (Location) label6006.getLayoutConstraint();
location6006.setX(1);
location6006.setY(-13);
Node label6013 = createLabel(edge, UMLVisualIDRegistry.getType(MessageLostAppliedStereotypeEditPart.VISUAL_ID));
label6013.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6013 = (Location)label6013.getLayoutConstraint();
+ Location location6013 = (Location) label6013.getLayoutConstraint();
location6013.setX(1);
location6013.setY(-33);
return edge;
@@ -1028,21 +1036,21 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(Message7EditPart.VISUAL_ID));
edge.setElement(domainElement);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Message");
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
+ // org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
+ // if (routing != null) {
+ // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
+ // }
PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Message");
Node label6007 = createLabel(edge, UMLVisualIDRegistry.getType(MessageName7EditPart.VISUAL_ID));
label6007.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6007 = (Location)label6007.getLayoutConstraint();
+ Location location6007 = (Location) label6007.getLayoutConstraint();
location6007.setX(1);
location6007.setY(-13);
Node label6014 = createLabel(edge, UMLVisualIDRegistry.getType(MessageFoundAppliedStereotypeEditPart.VISUAL_ID));
label6014.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6014 = (Location)label6014.getLayoutConstraint();
+ Location location6014 = (Location) label6014.getLayoutConstraint();
location6014.setX(1);
location6014.setY(-33);
return edge;
@@ -1064,13 +1072,13 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(CommentAnnotatedElementEditPart.VISUAL_ID));
edge.setElement(null);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "Undefined");
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Undefined");
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
+ // org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
+ // if (routing != null) {
+ // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
+ // }
PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Undefined");
return edge;
}
@@ -1091,13 +1099,13 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID));
edge.setElement(null);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "Undefined");
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Undefined");
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
+ // org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
+ // if (routing != null) {
+ // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
+ // }
PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Undefined");
return edge;
}
@@ -1119,16 +1127,16 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(GeneralOrderingEditPart.VISUAL_ID));
edge.setElement(domainElement);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "GeneralOrdering");
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
+ // org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
+ // if (routing != null) {
+ // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
+ // }
PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "GeneralOrdering");
Node label6015 = createLabel(edge, UMLVisualIDRegistry.getType(GeneralOrderingAppliedStereotypeEditPart.VISUAL_ID));
label6015.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6015 = (Location)label6015.getLayoutConstraint();
+ Location location6015 = (Location) label6015.getLayoutConstraint();
location6015.setX(1);
location6015.setY(-33);
return edge;
@@ -1150,17 +1158,17 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(ContextLinkEditPart.VISUAL_ID));
edge.setElement(null);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "Undefined");
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Undefined");
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
+ // org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
+ // if (routing != null) {
+ // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
+ // }
PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Undefined");
Node label8501 = createLabel(edge, UMLVisualIDRegistry.getType(ConstraintContextAppliedStereotypeEditPart.VISUAL_ID));
label8501.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location8501 = (Location)label8501.getLayoutConstraint();
+ Location location8501 = (Location) label8501.getLayoutConstraint();
location8501.setX(0);
location8501.setY(60);
return edge;
@@ -1170,7 +1178,7 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
* @generated
*/
protected void stampShortcut(View containerView, Node target) {
- if(!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
+ if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
@@ -1192,24 +1200,24 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
* @generated
*/
protected Node createCompartment(View owner, String hint, boolean canCollapse, boolean hasTitle, boolean canSort, boolean canFilter) {
- //SemanticListCompartment rv = NotationFactory.eINSTANCE.createSemanticListCompartment();
- //rv.setShowTitle(showTitle);
- //rv.setCollapsed(isCollapsed);
+ // SemanticListCompartment rv = NotationFactory.eINSTANCE.createSemanticListCompartment();
+ // rv.setShowTitle(showTitle);
+ // rv.setCollapsed(isCollapsed);
Node rv;
- if(canCollapse) {
+ if (canCollapse) {
rv = NotationFactory.eINSTANCE.createBasicCompartment();
} else {
rv = NotationFactory.eINSTANCE.createDecorationNode();
}
rv.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- if(hasTitle) {
+ if (hasTitle) {
TitleStyle ts = NotationFactory.eINSTANCE.createTitleStyle();
rv.getStyles().add(ts);
}
- if(canSort) {
+ if (canSort) {
rv.getStyles().add(NotationFactory.eINSTANCE.createSortingStyle());
}
- if(canFilter) {
+ if (canFilter) {
rv.getStyles().add(NotationFactory.eINSTANCE.createFilteringStyle());
}
rv.setType(hint);
@@ -1221,11 +1229,11 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
* @generated
*/
protected EObject getSemanticElement(IAdaptable semanticAdapter) {
- if(semanticAdapter == null) {
+ if (semanticAdapter == null) {
return null;
}
- EObject eObject = (EObject)semanticAdapter.getAdapter(EObject.class);
- if(eObject != null) {
+ EObject eObject = (EObject) semanticAdapter.getAdapter(EObject.class);
+ if (eObject != null) {
return EMFCoreUtil.resolve(TransactionUtil.getEditingDomain(eObject), eObject);
}
return null;
@@ -1235,10 +1243,10 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
* @generated
*/
protected IElementType getSemanticElementType(IAdaptable semanticAdapter) {
- if(semanticAdapter == null) {
+ if (semanticAdapter == null) {
return null;
}
- return (IElementType)semanticAdapter.getAdapter(IElementType.class);
+ return (IElementType) semanticAdapter.getAdapter(IElementType.class);
}
/**
@@ -1247,8 +1255,8 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
private void initFontStyleFromPrefs(View view, final IPreferenceStore store, String elementName) {
String fontConstant = PreferencesConstantsHelper.getElementConstant(elementName, PreferencesConstantsHelper.FONT);
String fontColorConstant = PreferencesConstantsHelper.getElementConstant(elementName, PreferencesConstantsHelper.COLOR_FONT);
- FontStyle viewFontStyle = (FontStyle)view.getStyle(NotationPackage.Literals.FONT_STYLE);
- if(viewFontStyle != null) {
+ FontStyle viewFontStyle = (FontStyle) view.getStyle(NotationPackage.Literals.FONT_STYLE);
+ if (viewFontStyle != null) {
FontData fontData = PreferenceConverter.getFontData(store, fontConstant);
viewFontStyle.setFontName(fontData.getName());
viewFontStyle.setFontHeight(fontData.getHeight());
@@ -1277,9 +1285,10 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
String gradientPolicyConstant = PreferencesConstantsHelper.getElementConstant(elementName, PreferencesConstantsHelper.GRADIENT_POLICY);
org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(store, fillColorConstant);
ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB));
- FillStyle fillStyle = (FillStyle)view.getStyle(NotationPackage.Literals.FILL_STYLE);
- fillStyle.setFillColor(FigureUtilities.RGBToInteger(fillRGB).intValue());;
- if(store.getBoolean(gradientPolicyConstant)) {
+ FillStyle fillStyle = (FillStyle) view.getStyle(NotationPackage.Literals.FILL_STYLE);
+ fillStyle.setFillColor(FigureUtilities.RGBToInteger(fillRGB).intValue());
+ ;
+ if (store.getBoolean(gradientPolicyConstant)) {
GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(store.getString(gradientColorConstant));
fillStyle.setGradient(gradientPreferenceConverter.getGradientData());
fillStyle.setTransparency(gradientPreferenceConverter.getTransparency());
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/sheet/UMLPropertySection.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/sheet/UMLPropertySection.java
index 1b3048eff64..40828bfed2a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/sheet/UMLPropertySection.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/sheet/UMLPropertySection.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -23,9 +23,10 @@ public class UMLPropertySection extends DefaultPropertySection implements IPrope
/**
* Modify/unwrap selection.
- *
+ *
* @generated
*/
+ @Override
protected Object transformSelection(Object selected) {
selected = /* super. */transformSelectionToDomain(selected);
return selected;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/sheet/UMLSheetLabelProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/sheet/UMLSheetLabelProvider.java
index d0090542822..74b9332921e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/sheet/UMLSheetLabelProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/sheet/UMLSheetLabelProvider.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -32,10 +32,11 @@ public class UMLSheetLabelProvider extends BaseLabelProvider implements ILabelPr
/**
* @generated
*/
+ @Override
public String getText(Object element) {
element = unwrap(element);
- if(element instanceof UMLNavigatorGroup) {
- return ((UMLNavigatorGroup)element).getGroupName();
+ if (element instanceof UMLNavigatorGroup) {
+ return ((UMLNavigatorGroup) element).getGroupName();
}
IElementType etype = getElementType(getView(element));
return etype == null ? "" : etype.getDisplayName();
@@ -44,6 +45,7 @@ public class UMLSheetLabelProvider extends BaseLabelProvider implements ILabelPr
/**
* @generated
*/
+ @Override
public Image getImage(Object element) {
IElementType etype = getElementType(getView(unwrap(element)));
return etype == null ? null : UMLElementTypes.getImage(etype);
@@ -53,8 +55,8 @@ public class UMLSheetLabelProvider extends BaseLabelProvider implements ILabelPr
* @generated
*/
private Object unwrap(Object element) {
- if(element instanceof IStructuredSelection) {
- return ((IStructuredSelection)element).getFirstElement();
+ if (element instanceof IStructuredSelection) {
+ return ((IStructuredSelection) element).getFirstElement();
}
return element;
}
@@ -63,11 +65,11 @@ public class UMLSheetLabelProvider extends BaseLabelProvider implements ILabelPr
* @generated
*/
private View getView(Object element) {
- if(element instanceof View) {
- return (View)element;
+ if (element instanceof View) {
+ return (View) element;
}
- if(element instanceof IAdaptable) {
- return (View)((IAdaptable)element).getAdapter(View.class);
+ if (element instanceof IAdaptable) {
+ return (View) ((IAdaptable) element).getAdapter(View.class);
}
return null;
}
@@ -77,13 +79,13 @@ public class UMLSheetLabelProvider extends BaseLabelProvider implements ILabelPr
*/
private IElementType getElementType(View view) {
// For intermediate views climb up the containment hierarchy to find the one associated with an element type.
- while(view != null) {
+ while (view != null) {
int vid = UMLVisualIDRegistry.getVisualID(view);
IElementType etype = UMLElementTypes.getElementType(vid);
- if(etype != null) {
+ if (etype != null) {
return etype;
}
- view = view.eContainer() instanceof View ? (View)view.eContainer() : null;
+ view = view.eContainer() instanceof View ? (View) view.eContainer() : null;
}
return null;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/test/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineXYLayoutEditPolicyTest.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/test/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineXYLayoutEditPolicyTest.java
index 849308b9946..957641717c6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/test/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineXYLayoutEditPolicyTest.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/test/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/LifelineXYLayoutEditPolicyTest.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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

Back to the top