Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcletavernie2013-01-10 15:18:47 +0000
committercletavernie2013-01-10 15:18:47 +0000
commitce1f998c24ca336dba10414cdf20eb11d68502ab (patch)
tree129cf5f4f74c128f917ffa89c1b2c7edc89a5573 /incoming
parent5059d31236ba867550e2651ea01d6c3474c08462 (diff)
downloadorg.eclipse.papyrus-ce1f998c24ca336dba10414cdf20eb11d68502ab.tar.gz
org.eclipse.papyrus-ce1f998c24ca336dba10414cdf20eb11d68502ab.tar.xz
org.eclipse.papyrus-ce1f998c24ca336dba10414cdf20eb11d68502ab.zip
397389: [Timing Diagram] Papyrus shall support UML2 timing diagram
https://bugs.eclipse.org/bugs/show_bug.cgi?id=397389 Apply the Papyrus formatter to Timing Diagram and Tests
Diffstat (limited to 'incoming')
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/AllTests.java7
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/AbstractTimingDiagramTestCase.java173
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/AllCanonicalTests.java25
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactLifeline.java13
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactOccurrenceSpecification.java48
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactStateInvariant.java18
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifeline.java13
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullOccurrenceSpecification.java30
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullStateInvariant.java32
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramInteraction.java7
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramMessages.java6
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramStateDefinition.java33
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/LifelineVerticalLabelCellEditorLocator.java6
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/Messages.java86
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/OperationForbiddenException.java1
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/AbstractChangeLifelineTypeCommand.java12
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/AddOccurrenceSpecificationInCompactLifelineCommand.java39
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CreateTickCommand.java22
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomDurationConstraintCreateCommand.java14
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomDurationObservationCreateCommand.java14
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomGeneralOrderingCreateCommand.java10
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomMessageCreateCommand.java46
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomMessageReorientCommand.java32
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomTimeConstraintCreateCommand.java12
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomTimeObservationCreateCommand.java10
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/DeleteStateDefinitionCommand.java7
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/RefreshCommandForUndo.java1
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/SwitchLifelineCommand.java246
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/ToggleTimeRulerVisibility.java36
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/ValidateInteractionCommand.java8
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactLifelineCompartmentEditPart.java65
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactLifelineEditPartCN.java18
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactLifelineTimeRulerCompartmentEditPartCN.java4
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactStateInvariantEditPartCN.java9
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactStateInvariantNameEditPart.java4
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomDestructionOccurrenceSpecificationEditPartCN.java1
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomDestructionOccurrenceSpecificationLabelEditPart.java3
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomDurationConstraintEditPart.java1
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomDurationObservationEditPart.java1
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFreeTimeRulerCompartmentEditPart.java29
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFreeTimingRulerEditPart.java16
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullLifelineEditPartCN.java18
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullLifelineStateDefinitionCompartmentEditPartCN.java13
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullLifelineTimeRulerCompartmentEditPartCN.java4
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullLifelineTimelineCompartmentEditPartCN.java98
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullStateInvariantEditPartCN.java28
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullStateInvariantVerticalLineEditPart.java3
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomGateEditPart.java1
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomGeneralOrderingEditPart.java1
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomInteractionCompartmentEditPartTN.java28
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomInteractionEditPartTN.java36
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomMessageFoundEditPart.java2
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomMessageLostEditPart.java2
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomMessageOccurrenceSpecificationEditPartCN.java1
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomMessageOccurrenceSpecificationLabelEditPart.java3
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomOccurrenceSpecificationEditPartCN.java1
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomOccurrenceSpecificationLabelEditPart.java3
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomStateDefinitionEditPart.java18
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomStateDefinitionLabelEditPart.java6
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTickEditPart.java1
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimeConstraintEditPart.java1
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimeObservationEditPart.java1
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimeRulerCompartmentEditPartCN.java4
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimingDiagramEditPart.java7
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomUMLEditPartFactory.java7
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/AbstractTimelineLayoutPolicy.java245
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomCompactLifelineCompartmentItemSemanticEditPolicyCN.java16
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomCompactLifelineCompartmentLayoutEditPolicy.java68
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomCompactLifelineItemSemanticEditPolicyCN.java4
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomCompactStateInvariantItemSemanticEditPolicy.java10
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomDestructionOccurrenceSpecificationItemSemanticEditPolicy.java7
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullLifelineItemSemanticEditPolicyCN.java4
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullLifelineStateDefinitionCompartmentLayoutEditPolicy.java2
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullLifelineTimelineCompartmentItemSemanticEditPolicyCN.java16
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullStateInvariantItemSemanticEditPolicy.java10
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomGateItemSemanticEditPolicy.java7
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomInteractionCompartmentCreationEditPolicy.java28
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomInteractionCompartmentItemSemanticEditPolicy.java6
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomInteractionCreationEditPolicy.java21
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomLifelineCompartmentGraphicalNodeEditPolicy.java31
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomLifelineNameEditPolicy.java11
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomMessageOccurrenceSpecificationItemSemanticEditPolicy.java11
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomOccurrenceSpecificationItemSemanticEditPolicy.java9
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomTimelineCompartmentLayoutEditPolicy.java129
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomTimingDiagramCreationEditPolicy.java8
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/ExternalLabelPrimaryDragRoleEditPolicy.java9
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/FirstEventRefreshEditPolicy.java19
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/GenericListCompartmentLayoutEditPolicy.java47
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/LayoutEditPolicyForLabel.java6
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/SelectionOnlyLayoutEditPolicy.java1
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/TimeRulerVisibilityRefreshEditPolicy.java18
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/TimingDiagramDragDropEditPolicy.java140
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/AbstractMessageFigure.java23
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/CompactLifelineFigure.java16
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/CompactStateFigure.java48
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/CustomInteractionRectangleFigure.java3
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/EllipseDecoration.java4
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/FullLifelineFigure.java30
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/GeneralOrderingHorizontalFigure.java6
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/InvisibleRectangleFigure.java4
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/LifelineFigure.java20
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/LifelineVerticalLabel.java7
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/MessageDeleteFigure.java1
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/MessageSyncFigure.java1
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/SmallSquareFigure.java1
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/StateDefinitionFigure.java2
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/TimeRulerFigure.java1
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/VerticalLabel.java30
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/VerticalMarkFigure.java1
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/helper/TimingDiagramLinkMappingHelper.java2
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/helper/advice/DefaultTypeHelperAdvice.java10
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/helper/advice/GateHelperAdvice.java10
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/helper/advice/OccurrenceSpecificationHelperAdvice.java12
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/helper/advice/StateInvariantHelperAdvice.java10
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/layouts/FillLayout.java9
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/layouts/TimeRulerLayout.java2
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parsers/CompactStateInvariantNameParser.java22
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parsers/ConstraintParser.java63
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parsers/OccurrenceSpecificationNameParser.java15
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parsers/StateDefinitionParser.java21
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/AbstractTwoPointCreationTool.java51
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/CustomPaletteFactory.java96
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/DestructionOccurrenceSpecificationCreationTool.java11
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/DurationCreationTool.java6
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/FloatingMessageAnchor.java6
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/GeneralOrderingCreationTool.java2
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/OccurrenceSpecificationCreationTool.java8
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/PropertyDiagramUpdater.java64
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/SpecificTypeCreationTool.java26
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/providers/CustomEditPolicyProvider.java16
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/providers/StereotypePropertiesEditPartProvider.java10
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/Constants.java5
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/DropUtils.java114
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/EcoreUtils.java55
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/EditPartUtils.java40
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/FigureUtils.java39
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/GateUtils.java7
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/GeneralOrderingUtils.java14
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/InteractionUtils.java8
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/LifelineUtils.java79
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/MessageUtils.java108
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/ModelValidationUtils.java89
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/OccurrenceSpecificationUtils.java175
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/RequestUtils.java23
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/StateDefinitionUtils.java84
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/StateInvariantUtils.java162
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/TickUtils.java53
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/TimeElementUtils.java26
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/TimeRulerUtils.java45
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/Utils.java50
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/ViewUtils.java83
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/CompactLifelineCreateCommandCN.java19
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/CompactStateInvariantCreateCommandCN.java19
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/DestructionOccurrenceSpecificationCreateCommandCN.java22
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/DurationConstraintCreateCommandCN.java19
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/DurationObservationCreateCommandCN.java19
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/FullLifelineCreateCommandCN.java19
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/FullStateInvariantCreateCommandCN.java19
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/GateCreateCommand.java19
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/GeneralOrderingCreateCommand.java19
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/InteractionCreateCommandTN.java19
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/LifelineCreateCommand.java19
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageAsyncCreateCommand.java30
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageAsyncReorientCommand.java34
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageCreateCreateCommand.java30
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageCreateReorientCommand.java34
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageDeleteCreateCommand.java30
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageDeleteReorientCommand.java34
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageFoundCreateCommand.java28
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageFoundReorientCommand.java34
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageLostCreateCommand.java28
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageLostReorientCommand.java34
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageOccurrenceSpecificationCreateCommandCN.java22
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageReplyCreateCommand.java30
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageReplyReorientCommand.java34
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageSyncCreateCommand.java30
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageSyncReorientCommand.java34
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/OccurrenceSpecificationCreateCommandCN.java19
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/TimeConstraintCreateCommand.java19
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/TimeObservationCreateCommand.java19
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/CompactLifelineCompartmentEditPartCN.java17
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/CompactLifelineEditPartCN.java93
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/CompactLifelineNameEditPart.java226
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/CompactLifelineTimeRulerCompartmentEditPartCN.java17
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/CompactStateInvariantEditPartCN.java83
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/CompactStateInvariantNameEditPart.java226
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/DestructionOccurrenceSpecificationAppliedStereotypeEditPart.java237
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/DestructionOccurrenceSpecificationEditPartCN.java150
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/DestructionOccurrenceSpecificationLabelEditPart.java240
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/DurationConstraintEditPartCN.java61
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/DurationConstraintSpecificationEditPart.java240
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/DurationObservationEditPartCN.java61
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/DurationObservationNameEditPart.java239
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/FreeTimeRulerCompartmentEditPart.java17
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/FreeTimingRulerEditPartCN.java59
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/FullLifelineEditPartCN.java105
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/FullLifelineNameEditPart.java225
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/FullLifelineStateDefinitionCompartmentEditPartCN.java17
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/FullLifelineTimeRulerCompartmentEditPartCN.java17
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/FullLifelineTimelineCompartmentEditPartCN.java17
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/FullStateInvariantAppliedStereotypeEditPart.java236
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/FullStateInvariantEditPartCN.java69
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/FullStateInvariantVerticalLineEditPart.java43
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/GateEditPart.java145
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/GateLabelEditPart.java235
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/GeneralOrderingEditPart.java61
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/GeneralOrderingNameEditPart.java239
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/InteractionCompartmentEditPartTN.java17
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/InteractionEditPartTN.java113
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/InteractionNameEditPart.java225
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/LifelineEditPart.java53
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/LinearTimeRulerCompartmentEditPart.java17
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/LinearTimingRulerEditPartCN.java59
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageAsyncAppliedStereotypeEditPart.java230
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageAsyncEditPart.java18
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageAsyncNameLabelEditPart.java229
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageCreateAppliedStereotypeEditPart.java230
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageCreateEditPart.java18
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageCreateNameLabelEditPart.java229
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageDeleteAppliedStereotypeEditPart.java230
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageDeleteEditPart.java18
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageDeleteNameLabelEditPart.java229
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageFoundAppliedStereotypeEditPart.java230
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageFoundEditPart.java18
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageFoundNameLabelEditPart.java229
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageLostAppliedStereotypeEditPart.java229
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageLostEditPart.java18
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageLostNameLabelEditPart.java229
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageOccurrenceSpecificationAppliedStereotypeEditPart.java237
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageOccurrenceSpecificationEditPartCN.java155
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageOccurrenceSpecificationLabelEditPart.java240
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageReplyAppliedStereotypeEditPart.java230
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageReplyEditPart.java18
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageReplyNameLabelEditPart.java229
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageSyncAppliedStereotypeEditPart.java229
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageSyncEditPart.java18
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageSyncNameLabelEditPart.java229
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/OccurrenceSpecificationAppliedStereotypeEditPart.java236
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/OccurrenceSpecificationEditPartCN.java71
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/OccurrenceSpecificationLabelEditPart.java239
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/StateDefinitionEditPart.java55
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/StateDefinitionLabelEditPart.java225
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/StateInvariantAppliedStereotypeEditPart.java236
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/TickEditPart.java51
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/TickNameEditPart.java234
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/TimeConstraintAppliedStereotypeEditPart.java236
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/TimeConstraintEditPart.java63
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/TimeConstraintSpecificationEditPart.java239
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/TimeObservationAppliedStereotypeEditPart.java236
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/TimeObservationEditPart.java63
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/TimeObservationNameEditPart.java239
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/TimeRulerCompartmentEditPartCN.java17
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/TimingDiagramEditPart.java4
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/UMLEditPartFactory.java26
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/CompactLifelineCompartmentItemSemanticEditPolicyCN.java62
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/CompactLifelineItemSemanticEditPolicyCN.java38
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/CompactLifelineTimeRulerCompartmentItemSemanticEditPolicyCN.java8
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/CompactStateInvariantItemSemanticEditPolicyCN.java38
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/DestructionOccurrenceSpecificationItemSemanticEditPolicyCN.java106
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/DurationConstraintItemSemanticEditPolicyCN.java38
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/DurationObservationItemSemanticEditPolicyCN.java38
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullLifelineItemSemanticEditPolicyCN.java38
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullLifelineStateDefinitionCompartmentItemSemanticEditPolicyCN.java8
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullLifelineTimeRulerCompartmentItemSemanticEditPolicyCN.java8
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullLifelineTimelineCompartmentItemSemanticEditPolicyCN.java62
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullStateInvariantItemSemanticEditPolicyCN.java38
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/GateItemSemanticEditPolicy.java106
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/GeneralOrderingItemSemanticEditPolicy.java38
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/InteractionCompartmentItemSemanticEditPolicyTN.java20
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/InteractionNodeItemSemanticEditPolicyTN.java52
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/LifelineItemSemanticEditPolicy.java38
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageAsyncItemSemanticEditPolicy.java38
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageCreateItemSemanticEditPolicy.java38
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageDeleteItemSemanticEditPolicy.java38
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageFoundItemSemanticEditPolicy.java38
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageLostItemSemanticEditPolicy.java38
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageOccurrenceSpecificationItemSemanticEditPolicyCN.java106
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageReplyItemSemanticEditPolicy.java38
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageSyncItemSemanticEditPolicy.java38
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/OccurrenceSpecificationItemSemanticEditPolicyCN.java38
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/TimeConstraintItemSemanticEditPolicy.java38
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/TimeObservationItemSemanticEditPolicy.java38
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/TimeRulerCompartmentItemSemanticEditPolicyCN.java8
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/TimingDiagramEditPartFactoryItemSemanticEditPolicy.java21
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/UMLBaseItemSemanticEditPolicy.java94
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/UMLTextNonResizableEditPolicy.java51
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/UMLTextSelectionEditPolicy.java49
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/expressions/UMLAbstractExpression.java36
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/expressions/UMLOCLFactory.java35
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/navigator/UMLAbstractNavigatorItem.java6
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/navigator/UMLDomainNavigatorContentProvider.java64
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/navigator/UMLDomainNavigatorItem.java15
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/navigator/UMLDomainNavigatorLabelProvider.java11
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/navigator/UMLNavigatorActionProvider.java34
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/navigator/UMLNavigatorContentProvider.java96
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/navigator/UMLNavigatorGroup.java6
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/navigator/UMLNavigatorItem.java11
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/navigator/UMLNavigatorLabelProvider.java28
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/navigator/UMLNavigatorLinkHelper.java40
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/navigator/UMLNavigatorSorter.java4
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/parsers/AbstractParser.java150
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/parsers/MessageFormatParser.java27
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/DiagramEditorContextMenuProvider.java5
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/ModelElementSelectionPage.java24
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLCreationWizard.java12
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLCreationWizardPage.java8
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLDiagramActionBarContributor.java2
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLDiagramContentInitializer.java72
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLDiagramEditor.java31
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLDiagramEditorPlugin.java26
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLDiagramEditorUtil.java91
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLDiagramUpdateCommand.java14
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLDiagramUpdater.java488
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLDocumentProvider.java247
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLInitDiagramFileAction.java6
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLLinkDescriptor.java1
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLMatchingStrategy.java6
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLNewDiagramFileWizard.java18
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLNodeDescriptor.java1
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLPaletteFactory.java53
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLUriEditorInputTester.java4
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLVisualIDRegistry.java279
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/ValidateAction.java77
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/CompactLifelinePreferencePage.java6
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/FreeTimingRulerPreferencePage.java6
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/FullLifelinePreferencePage.java6
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/InteractionPreferencePage.java6
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/LinearTimingRulerPreferencePage.java6
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/providers/ElementInitializers.java2
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/providers/UMLEditPartProvider.java26
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/providers/UMLElementTypes.java61
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/providers/UMLIconProvider.java4
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/providers/UMLMarkerNavigationProvider.java16
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/providers/UMLModelingAssistantProvider.java348
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/providers/UMLParserProvider.java126
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/providers/UMLValidationDecoratorProvider.java20
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/providers/UMLValidationProvider.java9
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/providers/UMLViewProvider.java314
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/sheet/UMLPropertySection.java46
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/sheet/UMLSheetLabelProvider.java22
340 files changed, 9632 insertions, 10155 deletions
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/AllTests.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/AllTests.java
index 4e093c45a3f..551c0de1308 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/AllTests.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/AllTests.java
@@ -16,10 +16,9 @@ import org.junit.runners.Suite.SuiteClasses;
//@formatter:off
@RunWith(Suite.class)
@SuiteClasses({
- // canonical
- AllCanonicalTests.class
-})
+// canonical
+AllCanonicalTests.class })
//@formatter:on
public class AllTests {
// Junit 4 test case
-} \ No newline at end of file
+}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/AbstractTimingDiagramTestCase.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/AbstractTimingDiagramTestCase.java
index d511540c5e1..9d07531f411 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/AbstractTimingDiagramTestCase.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/AbstractTimingDiagramTestCase.java
@@ -54,11 +54,17 @@ import org.eclipse.uml2.uml.ValueSpecification;
public class AbstractTimingDiagramTestCase extends AbstractPapyrusTestCase {
private InteractionEditPartTN interactionEditPart;
+
private InteractionCompartmentEditPartTN interactionCompartment;
+
private FullLifelineEditPartCN fullLifelineEditPart;
+
private CompactLifelineEditPartCN compactLifelineEditPart;
+
private FullLifelineStateDefinitionCompartmentEditPartCN stateDefinitionCompartment;
+
private FullLifelineTimelineCompartmentEditPartCN fullLifelineTimelineCompartment;
+
private CompactLifelineCompartmentEditPartCN compactLifelineTimelineCompartment;
@Override
@@ -69,8 +75,7 @@ public class AbstractTimingDiagramTestCase extends AbstractPapyrusTestCase {
/** Creates the default Interaction (use this when only one Interaction will be used in a test) */
protected void createDefaultInteraction(final Point position, final Dimension size) {
this.interactionEditPart = createInteraction(position, size);
- this.interactionCompartment = (InteractionCompartmentEditPartTN) EditPartUtils.findFirstChildEditPartWithId(this.interactionEditPart,
- InteractionCompartmentEditPartTN.VISUAL_ID);
+ this.interactionCompartment = (InteractionCompartmentEditPartTN)EditPartUtils.findFirstChildEditPartWithId(this.interactionEditPart, InteractionCompartmentEditPartTN.VISUAL_ID);
assertNotNull("The interaction compartment was not found", this.interactionCompartment);
}
@@ -85,11 +90,9 @@ public class AbstractTimingDiagramTestCase extends AbstractPapyrusTestCase {
*/
protected void createDefaultFullLifeline() {
this.fullLifelineEditPart = createFullLifeline(getDefaultInteractionEditPart());
- this.stateDefinitionCompartment = (FullLifelineStateDefinitionCompartmentEditPartCN) EditPartUtils.findFirstChildEditPartWithId(
- this.fullLifelineEditPart, FullLifelineStateDefinitionCompartmentEditPartCN.VISUAL_ID);
+ this.stateDefinitionCompartment = (FullLifelineStateDefinitionCompartmentEditPartCN)EditPartUtils.findFirstChildEditPartWithId(this.fullLifelineEditPart, FullLifelineStateDefinitionCompartmentEditPartCN.VISUAL_ID);
assertNotNull("The StateDefinition compartment must exist", this.stateDefinitionCompartment);
- this.fullLifelineTimelineCompartment = (FullLifelineTimelineCompartmentEditPartCN) EditPartUtils.findFirstChildEditPartWithId(
- this.fullLifelineEditPart, FullLifelineTimelineCompartmentEditPartCN.VISUAL_ID);
+ this.fullLifelineTimelineCompartment = (FullLifelineTimelineCompartmentEditPartCN)EditPartUtils.findFirstChildEditPartWithId(this.fullLifelineEditPart, FullLifelineTimelineCompartmentEditPartCN.VISUAL_ID);
assertNotNull("The timeline compartment must exist", this.fullLifelineTimelineCompartment);
}
@@ -99,8 +102,7 @@ public class AbstractTimingDiagramTestCase extends AbstractPapyrusTestCase {
*/
protected void createDefaultCompactLifeline() {
this.compactLifelineEditPart = createCompactLifeline(getDefaultInteractionEditPart());
- this.compactLifelineTimelineCompartment = (CompactLifelineCompartmentEditPartCN) EditPartUtils.findFirstChildEditPartWithId(
- this.compactLifelineEditPart, CompactLifelineCompartmentEditPartCN.VISUAL_ID);
+ this.compactLifelineTimelineCompartment = (CompactLifelineCompartmentEditPartCN)EditPartUtils.findFirstChildEditPartWithId(this.compactLifelineEditPart, CompactLifelineCompartmentEditPartCN.VISUAL_ID);
assertNotNull("The timeline compartment must exist", this.compactLifelineTimelineCompartment);
}
@@ -126,11 +128,10 @@ public class AbstractTimingDiagramTestCase extends AbstractPapyrusTestCase {
* @return the created StateDefinition's EditPart
*/
protected StateDefinitionEditPart createStateDefinition(final FullLifelineEditPartCN parentLifelineEditPart) {
- final FullLifelineStateDefinitionCompartmentEditPartCN compartment = (FullLifelineStateDefinitionCompartmentEditPartCN) EditPartUtils
- .findFirstChildEditPartWithId(parentLifelineEditPart, FullLifelineStateDefinitionCompartmentEditPartCN.VISUAL_ID);
+ final FullLifelineStateDefinitionCompartmentEditPartCN compartment = (FullLifelineStateDefinitionCompartmentEditPartCN)EditPartUtils.findFirstChildEditPartWithId(parentLifelineEditPart, FullLifelineStateDefinitionCompartmentEditPartCN.VISUAL_ID);
final View stateDefinitionView = createView(UMLElementTypes.Node_9, compartment);
assertNotNull("The StateDefinition View should be created", stateDefinitionView);
- return (StateDefinitionEditPart) findChildEditPartAssociatedToView(compartment, stateDefinitionView);
+ return (StateDefinitionEditPart)findChildEditPartAssociatedToView(compartment, stateDefinitionView);
}
/**
@@ -152,7 +153,7 @@ public class AbstractTimingDiagramTestCase extends AbstractPapyrusTestCase {
assertNotNull("The compartment must not be null", compartment);
final View view = createView(UMLElementTypes.Lifeline_19, compartment);
assertNotNull("The FullLifeline View should be created", view);
- return (FullLifelineEditPartCN) findChildEditPartAssociatedToView(compartment, view);
+ return (FullLifelineEditPartCN)findChildEditPartAssociatedToView(compartment, view);
}
/**
@@ -174,25 +175,23 @@ public class AbstractTimingDiagramTestCase extends AbstractPapyrusTestCase {
assertNotNull("The compartment must not be null", compartment);
final View view = createView(UMLElementTypes.Lifeline_20, compartment);
assertNotNull("The CompactLifeline View should be created", view);
- return (CompactLifelineEditPartCN) findChildEditPartAssociatedToView(compartment, view);
+ return (CompactLifelineEditPartCN)findChildEditPartAssociatedToView(compartment, view);
}
/**
* Create a new Interaction in the default diagram using a Request.
*
* @param location
- * the position for the new Interaction
+ * the position for the new Interaction
* @param dimension
- * the size of the new Interaction
+ * the size of the new Interaction
* @return the created Interaction's EditPart
*/
protected InteractionEditPartTN createInteraction(final Point location, final Dimension dimension) {
createView(UMLElementTypes.Interaction_2, location, dimension, getDiagramEditPart());
- final InteractionEditPartTN interactionEditPart = (InteractionEditPartTN) EditPartUtils.findFirstChildEditPartWithId(getDiagramEditPart(),
- InteractionEditPartTN.VISUAL_ID);
+ final InteractionEditPartTN interactionEditPart = (InteractionEditPartTN)EditPartUtils.findFirstChildEditPartWithId(getDiagramEditPart(), InteractionEditPartTN.VISUAL_ID);
assertNotNull("The interaction EditPart was not found under the diagram EditPart", interactionEditPart);
- final InteractionCompartmentEditPartTN interactionCompartment = (InteractionCompartmentEditPartTN) EditPartUtils.findFirstChildEditPartWithId(
- interactionEditPart, InteractionCompartmentEditPartTN.VISUAL_ID);
+ final InteractionCompartmentEditPartTN interactionCompartment = (InteractionCompartmentEditPartTN)EditPartUtils.findFirstChildEditPartWithId(interactionEditPart, InteractionCompartmentEditPartTN.VISUAL_ID);
assertNotNull("The interaction compartment was not found", interactionCompartment);
return interactionEditPart;
}
@@ -242,9 +241,9 @@ public class AbstractTimingDiagramTestCase extends AbstractPapyrusTestCase {
* Create an OccurrenceSpecification on the last StateInvariant in the timeline of the default Lifeline
*
* @param expectedNumberOfStateInvariants
- * the number of state invariants that is expected (for checking)
+ * the number of state invariants that is expected (for checking)
* @param xPos
- * the position starting from the left of the StateInvariant
+ * the position starting from the left of the StateInvariant
*/
protected void createOccurrenceSpecificationInLastFullStateInvariantAtAbsolutePos(final int expectedNumberOfStateInvariants, final int xPos) {
// we need to wait for GMF to do its layout in order to have correct coordinates
@@ -259,9 +258,9 @@ public class AbstractTimingDiagramTestCase extends AbstractPapyrusTestCase {
* Create an OccurrenceSpecification on the last StateInvariant in the timeline of the default Lifeline
*
* @param expectedNumberOfStateInvariants
- * the number of state invariants that is expected (for checking)
+ * the number of state invariants that is expected (for checking)
* @param xPos
- * the position starting from the left of the StateInvariant
+ * the position starting from the left of the StateInvariant
*/
protected void createOccurrenceSpecificationInLastCompactStateInvariantAtAbsolutePos(final int expectedNumberOfStateInvariants, final int xPos) {
// we need to wait for GMF to do its layout in order to have correct coordinates
@@ -276,9 +275,9 @@ public class AbstractTimingDiagramTestCase extends AbstractPapyrusTestCase {
* Create an OccurrenceSpecification on the last StateInvariant in the timeline of the default full Lifeline
*
* @param expectedNumberOfStateInvariants
- * the number of state invariants that is expected (for checking)
+ * the number of state invariants that is expected (for checking)
* @param ratio
- * where to click in the StateInvariant (0.0 = beginning; 1.0 = end)
+ * where to click in the StateInvariant (0.0 = beginning; 1.0 = end)
*/
protected void createOccurrenceSpecificationInLastFullStateInvariantWithRatio(final int expectedNumberOfStateInvariants, final double ratio) {
assertTrue("invalid ratio", ratio >= 0.0 && ratio <= 1.0);
@@ -286,16 +285,16 @@ public class AbstractTimingDiagramTestCase extends AbstractPapyrusTestCase {
flushEventLoop();
final FullStateInvariantEditPartCN lastStateInvariant = getAndAssertLastFullStateInvariant(expectedNumberOfStateInvariants);
final Rectangle bounds = getAbsoluteBounds(lastStateInvariant);
- sendOpenSelectionRequest(lastStateInvariant, new Point(bounds.x + (int) (bounds.width * ratio), bounds.y));
+ sendOpenSelectionRequest(lastStateInvariant, new Point(bounds.x + (int)(bounds.width * ratio), bounds.y));
}
/**
* Create an OccurrenceSpecification on the last StateInvariant in the timeline of the default compact Lifeline
*
* @param expectedNumberOfStateInvariants
- * the number of state invariants that is expected (for checking)
+ * the number of state invariants that is expected (for checking)
* @param ratio
- * where to click in the StateInvariant (0.0 = beginning; 1.0 = end)
+ * where to click in the StateInvariant (0.0 = beginning; 1.0 = end)
*/
protected void createOccurrenceSpecificationInLastCompactStateInvariantWithRatio(final int expectedNumberOfStateInvariants, final double ratio) {
assertTrue("invalid ratio", ratio >= 0.0 && ratio <= 1.0);
@@ -303,7 +302,7 @@ public class AbstractTimingDiagramTestCase extends AbstractPapyrusTestCase {
flushEventLoop();
final CompactStateInvariantEditPartCN lastStateInvariant = getAndAssertLastCompactStateInvariant(expectedNumberOfStateInvariants);
final Rectangle bounds = getAbsoluteBounds(lastStateInvariant);
- sendOpenSelectionRequest(lastStateInvariant, new Point(bounds.x + (int) (bounds.width * ratio), bounds.y));
+ sendOpenSelectionRequest(lastStateInvariant, new Point(bounds.x + (int)(bounds.width * ratio), bounds.y));
}
private FullStateInvariantEditPartCN getAndAssertLastFullStateInvariant(final int expectedNumberOfStateInvariants) {
@@ -323,42 +322,38 @@ public class AbstractTimingDiagramTestCase extends AbstractPapyrusTestCase {
/** @return all OccurrenceSpecification EditParts found in the default Lifeline */
@SuppressWarnings("unchecked")
protected List<OccurrenceSpecificationEditPartCN> findOccurrenceSpecificationsInDefaultFullLifeline() {
- return (List<OccurrenceSpecificationEditPartCN>) EditPartUtils.findChildEditPartsWithId(getDefaultFullLifelineEditPart(),
- OccurrenceSpecificationEditPartCN.VISUAL_ID);
+ return (List<OccurrenceSpecificationEditPartCN>)EditPartUtils.findChildEditPartsWithId(getDefaultFullLifelineEditPart(), OccurrenceSpecificationEditPartCN.VISUAL_ID);
}
/** @return all OccurrenceSpecification EditParts found in the default Lifeline */
@SuppressWarnings("unchecked")
protected List<OccurrenceSpecificationEditPartCN> findOccurrenceSpecificationsInDefaultCompactLifeline() {
- return (List<OccurrenceSpecificationEditPartCN>) EditPartUtils.findChildEditPartsWithId(getDefaultCompactLifelineEditPart(),
- OccurrenceSpecificationEditPartCN.VISUAL_ID);
+ return (List<OccurrenceSpecificationEditPartCN>)EditPartUtils.findChildEditPartsWithId(getDefaultCompactLifelineEditPart(), OccurrenceSpecificationEditPartCN.VISUAL_ID);
}
/** @return all StateInvariant EditParts found in the default Lifeline */
@SuppressWarnings("unchecked")
protected List<FullStateInvariantEditPartCN> findStateInvariantsInDefaultFullLifeline() {
- return (List<FullStateInvariantEditPartCN>) EditPartUtils.findChildEditPartsWithId(getDefaultFullLifelineEditPart(),
- FullStateInvariantEditPartCN.VISUAL_ID);
+ return (List<FullStateInvariantEditPartCN>)EditPartUtils.findChildEditPartsWithId(getDefaultFullLifelineEditPart(), FullStateInvariantEditPartCN.VISUAL_ID);
}
/** @return all StateInvariant EditParts found in the default Lifeline */
@SuppressWarnings("unchecked")
protected List<CompactStateInvariantEditPartCN> findStateInvariantsInDefaultCompactLifeline() {
- return (List<CompactStateInvariantEditPartCN>) EditPartUtils.findChildEditPartsWithId(getDefaultCompactLifelineEditPart(),
- CompactStateInvariantEditPartCN.VISUAL_ID);
+ return (List<CompactStateInvariantEditPartCN>)EditPartUtils.findChildEditPartsWithId(getDefaultCompactLifelineEditPart(), CompactStateInvariantEditPartCN.VISUAL_ID);
}
/** @return all StateDefinition EditParts found in the default Lifeline */
@SuppressWarnings("unchecked")
protected List<StateDefinitionEditPart> findStateDefinitions() {
- return (List<StateDefinitionEditPart>) EditPartUtils.findChildEditPartsWithId(getDefaultFullLifelineEditPart(), StateDefinitionEditPart.VISUAL_ID);
+ return (List<StateDefinitionEditPart>)EditPartUtils.findChildEditPartsWithId(getDefaultFullLifelineEditPart(), StateDefinitionEditPart.VISUAL_ID);
}
/**
* Check that the fragments in the default interaction are ordered following the given pattern.
*
* @param pattern
- * the pattern, where "o" means OccurrenceSpecification, and "-" means StateInvariant
+ * the pattern, where "o" means OccurrenceSpecification, and "-" means StateInvariant
*/
protected void checkInteractionFragmentsWithPattern(final String expectedPattern) {
final String fragmentsStringPattern = computeInteractionFragmentsStringPattern();
@@ -367,16 +362,16 @@ public class AbstractTimingDiagramTestCase extends AbstractPapyrusTestCase {
protected String computeInteractionFragmentsStringPattern() {
final StringBuilder pattern = new StringBuilder();
- final Interaction interaction = (Interaction) ((View) getDefaultInteractionEditPart().getModel()).getElement();
+ final Interaction interaction = (Interaction)((View)getDefaultInteractionEditPart().getModel()).getElement();
final EList<InteractionFragment> fragments = interaction.getFragments();
- for (final InteractionFragment fragment : fragments) {
- if (fragment instanceof StateInvariant) {
+ for(final InteractionFragment fragment : fragments) {
+ if(fragment instanceof StateInvariant) {
pattern.append("-");
- } else if (fragment instanceof DestructionOccurrenceSpecification) {
+ } else if(fragment instanceof DestructionOccurrenceSpecification) {
pattern.append("x");
- } else if (fragment instanceof MessageOccurrenceSpecification) {
+ } else if(fragment instanceof MessageOccurrenceSpecification) {
pattern.append("m");
- } else if (fragment instanceof OccurrenceSpecification) {
+ } else if(fragment instanceof OccurrenceSpecification) {
pattern.append("o");
}
}
@@ -416,9 +411,9 @@ public class AbstractTimingDiagramTestCase extends AbstractPapyrusTestCase {
* an OccurrenceSpecification over it.
*
* @param compactStateInvariant
- * the StateInvariant on which to create an OccurrenceSpecification
+ * the StateInvariant on which to create an OccurrenceSpecification
* @param bottom
- * whether to click at the bottom of the StateInvariant, instead of at the top
+ * whether to click at the bottom of the StateInvariant, instead of at the top
*/
protected void createOccurrenceSpecificationOverCompactStateInvariant(final CompactStateInvariantEditPartCN compactStateInvariant, final boolean bottom) {
final Rectangle bounds = getBounds(compactStateInvariant);
@@ -438,12 +433,12 @@ public class AbstractTimingDiagramTestCase extends AbstractPapyrusTestCase {
final FullLifelineTimelineCompartmentEditPartCN timelineCompartment = getDefaultFullLifelineTimelineCompartment();
@SuppressWarnings("unchecked")
final List<EditPart> children = timelineCompartment.getChildren();
- for (final EditPart editPart : children) {
- if (editPart instanceof FullStateInvariantEditPartCN) {
- outputFullStateInvariantPattern((FullStateInvariantEditPartCN) editPart, pattern);
- } else if (editPart instanceof OccurrenceSpecificationEditPartCN) {
- outputFullOccurrenceSpecificationPattern((OccurrenceSpecificationEditPartCN) editPart, pattern);
- } else if (editPart instanceof FullStateInvariantVerticalLineEditPart) {
+ for(final EditPart editPart : children) {
+ if(editPart instanceof FullStateInvariantEditPartCN) {
+ outputFullStateInvariantPattern((FullStateInvariantEditPartCN)editPart, pattern);
+ } else if(editPart instanceof OccurrenceSpecificationEditPartCN) {
+ outputFullOccurrenceSpecificationPattern((OccurrenceSpecificationEditPartCN)editPart, pattern);
+ } else if(editPart instanceof FullStateInvariantVerticalLineEditPart) {
pattern.append("VerticalLine;");
} else {
fail("unexpected element");
@@ -453,25 +448,25 @@ public class AbstractTimingDiagramTestCase extends AbstractPapyrusTestCase {
}
private static void outputFullStateInvariantPattern(final FullStateInvariantEditPartCN editPart, final StringBuilder pattern) {
- final View view = (View) editPart.getModel();
+ final View view = (View)editPart.getModel();
assertNotNull("The EditPart must have a View", view);
- final StateInvariant stateInvariant = (StateInvariant) view.getElement();
+ final StateInvariant stateInvariant = (StateInvariant)view.getElement();
assertNotNull("The View must have a semantic element", view);
final Constraint constraint = stateInvariant.getInvariant();
assertNotNull("The StateInvariant must have a Constraint", constraint);
final ValueSpecification specification = constraint.getSpecification();
assertNotNull("The Constraint must have a ValueSpecification", specification);
assertTrue("The ValueSpecification must be an OpaqueExpression", specification instanceof OpaqueExpression);
- final OpaqueExpression opaqueExpression = (OpaqueExpression) specification;
+ final OpaqueExpression opaqueExpression = (OpaqueExpression)specification;
assertNotNull("The OpaqueExpression must not have a null list of bodies", opaqueExpression.getBodies());
assertEquals("The OpaqueExpression must have one Body", 1, opaqueExpression.getBodies().size());
pattern.append("StateInvariant(").append(opaqueExpression.getBodies().get(0)).append(");");
}
private static void outputFullOccurrenceSpecificationPattern(final OccurrenceSpecificationEditPartCN editPart, final StringBuilder pattern) {
- final View view = (View) editPart.getModel();
+ final View view = (View)editPart.getModel();
assertNotNull("The EditPart must have a View", view);
- final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification) view.getElement();
+ final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification)view.getElement();
assertNotNull("The View must have a semantic element", occurrenceSpecification);
final String name = occurrenceSpecification.getName();
pattern.append("OccurrenceSpecification(").append(name).append(");");
@@ -488,11 +483,11 @@ public class AbstractTimingDiagramTestCase extends AbstractPapyrusTestCase {
final CompactLifelineCompartmentEditPartCN timelineCompartment = getDefaultCompactLifelineTimelineCompartment();
@SuppressWarnings("unchecked")
final List<EditPart> children = timelineCompartment.getChildren();
- for (final EditPart editPart : children) {
- if (editPart instanceof CompactStateInvariantEditPartCN) {
- outputCompactStateInvariantPattern((CompactStateInvariantEditPartCN) editPart, pattern);
- } else if (editPart instanceof OccurrenceSpecificationEditPartCN) {
- outputCompactOccurrenceSpecificationPattern((OccurrenceSpecificationEditPartCN) editPart, pattern);
+ for(final EditPart editPart : children) {
+ if(editPart instanceof CompactStateInvariantEditPartCN) {
+ outputCompactStateInvariantPattern((CompactStateInvariantEditPartCN)editPart, pattern);
+ } else if(editPart instanceof OccurrenceSpecificationEditPartCN) {
+ outputCompactOccurrenceSpecificationPattern((OccurrenceSpecificationEditPartCN)editPart, pattern);
} else {
fail("unexpected element");
}
@@ -501,18 +496,18 @@ public class AbstractTimingDiagramTestCase extends AbstractPapyrusTestCase {
}
private static void outputCompactStateInvariantPattern(final CompactStateInvariantEditPartCN editPart, final StringBuilder pattern) {
- final View view = (View) editPart.getModel();
+ final View view = (View)editPart.getModel();
assertNotNull("The EditPart must have a View", view);
- final StateInvariant stateInvariant = (StateInvariant) view.getElement();
+ final StateInvariant stateInvariant = (StateInvariant)view.getElement();
assertNotNull("The View must have a semantic element", view);
final Constraint constraint = stateInvariant.getInvariant();
assertNotNull("The StateInvariant must have a Constraint", constraint);
final ValueSpecification specification = constraint.getSpecification();
assertNotNull("The Constraint must have a ValueSpecification", specification);
assertTrue("The ValueSpecification must be an OpaqueExpression", specification instanceof OpaqueExpression);
- final OpaqueExpression opaqueExpression = (OpaqueExpression) specification;
+ final OpaqueExpression opaqueExpression = (OpaqueExpression)specification;
assertNotNull("The OpaqueExpression must not have a null list of bodies", opaqueExpression.getBodies());
- if (opaqueExpression.getBodies().isEmpty()) {
+ if(opaqueExpression.getBodies().isEmpty()) {
pattern.append("StateInvariant(unnamed);");
} else {
pattern.append("StateInvariant(").append(opaqueExpression.getBodies().get(0)).append(");");
@@ -520,9 +515,9 @@ public class AbstractTimingDiagramTestCase extends AbstractPapyrusTestCase {
}
private static void outputCompactOccurrenceSpecificationPattern(final OccurrenceSpecificationEditPartCN editPart, final StringBuilder pattern) {
- final View view = (View) editPart.getModel();
+ final View view = (View)editPart.getModel();
assertNotNull("The EditPart must have a View", view);
- final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification) view.getElement();
+ final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification)view.getElement();
assertNotNull("The View must have a semantic element", occurrenceSpecification);
final String name = occurrenceSpecification.getName();
pattern.append("OccurrenceSpecification(").append(name).append(");");
@@ -539,16 +534,16 @@ public class AbstractTimingDiagramTestCase extends AbstractPapyrusTestCase {
final FullLifelineTimelineCompartmentEditPartCN timelineCompartment = getDefaultFullLifelineTimelineCompartment();
@SuppressWarnings("unchecked")
final List<EditPart> children = timelineCompartment.getChildren();
- for (final EditPart editPart : children) {
- if (editPart instanceof FullStateInvariantEditPartCN) {
+ for(final EditPart editPart : children) {
+ if(editPart instanceof FullStateInvariantEditPartCN) {
pattern.append("-");
- } else if (editPart instanceof OccurrenceSpecificationEditPartCN) {
+ } else if(editPart instanceof OccurrenceSpecificationEditPartCN) {
pattern.append("o");
- } else if (editPart instanceof MessageOccurrenceSpecificationEditPartCN) {
+ } else if(editPart instanceof MessageOccurrenceSpecificationEditPartCN) {
pattern.append("m");
- } else if (editPart instanceof DestructionOccurrenceSpecificationEditPartCN) {
+ } else if(editPart instanceof DestructionOccurrenceSpecificationEditPartCN) {
pattern.append("x");
- } else if (editPart instanceof FullStateInvariantVerticalLineEditPart) {
+ } else if(editPart instanceof FullStateInvariantVerticalLineEditPart) {
pattern.append("|");
} else {
fail("unexpected element");
@@ -561,11 +556,11 @@ public class AbstractTimingDiagramTestCase extends AbstractPapyrusTestCase {
* Check that the timeline contains the expected elements in the expected order.
*
* @param expectedPattern
- * a pattern where
- * <ul>
- * <li>"o" represents an OccurrenceSpecification
- * <li>"-" represents a StateInvariant
- * </ul>
+ * a pattern where
+ * <ul>
+ * <li>"o" represents an OccurrenceSpecification
+ * <li>"-" represents a StateInvariant
+ * </ul>
*/
protected void checkSimpleCompactTimelinePattern(final String expectedPattern) {
final String timelineStringPattern = computeSimpleCompactTimelineStringPattern();
@@ -578,14 +573,14 @@ public class AbstractTimingDiagramTestCase extends AbstractPapyrusTestCase {
final CompactLifelineCompartmentEditPartCN timelineCompartment = getDefaultCompactLifelineTimelineCompartment();
@SuppressWarnings("unchecked")
final List<EditPart> children = timelineCompartment.getChildren();
- for (final EditPart editPart : children) {
- if (editPart instanceof CompactStateInvariantEditPartCN) {
+ for(final EditPart editPart : children) {
+ if(editPart instanceof CompactStateInvariantEditPartCN) {
pattern.append("-");
- } else if (editPart instanceof OccurrenceSpecificationEditPartCN) {
+ } else if(editPart instanceof OccurrenceSpecificationEditPartCN) {
pattern.append("o");
- } else if (editPart instanceof MessageOccurrenceSpecificationEditPartCN) {
+ } else if(editPart instanceof MessageOccurrenceSpecificationEditPartCN) {
pattern.append("m");
- } else if (editPart instanceof DestructionOccurrenceSpecificationEditPartCN) {
+ } else if(editPart instanceof DestructionOccurrenceSpecificationEditPartCN) {
pattern.append("x");
} else {
fail("unexpected element");
@@ -599,20 +594,20 @@ public class AbstractTimingDiagramTestCase extends AbstractPapyrusTestCase {
* undo/redo operations.
*
* @param nElementsToUndo
- * the number of elements that should be undoable before reaching the non-dirty state
+ * the number of elements that should be undoable before reaching the non-dirty state
*/
protected void testDirtyStateForFullUndoRedo(final int nElementsToUndo) {
assertTrue("The editor should be dirty after all the modifications", this.diagramEditor.isDirty());
- for (int i = 0; i < nElementsToUndo; i++) {
+ for(int i = 0; i < nElementsToUndo; i++) {
undoOnUIThread();
// editor should be dirty for all states except the initial state
- if (i == nElementsToUndo - 1) {
+ if(i == nElementsToUndo - 1) {
assertFalse("The editor should not be dirty after we undid all previous modifications", this.diagramEditor.isDirty());
} else {
assertTrue("The editor should be dirty until we undo all previous modifications", this.diagramEditor.isDirty());
}
}
- for (int i = 0; i < nElementsToUndo; i++) {
+ for(int i = 0; i < nElementsToUndo; i++) {
redoOnUIThread();
assertTrue("The editor should be dirty after we redo", this.diagramEditor.isDirty());
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/AllCanonicalTests.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/AllCanonicalTests.java
index 1620ec4b736..9363056e3f2 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/AllCanonicalTests.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/AllCanonicalTests.java
@@ -14,23 +14,16 @@ import org.junit.runners.Suite.SuiteClasses;
//@formatter:off
@RunWith(Suite.class)
-@SuiteClasses({
- TestTimingDiagramInteraction.class,
- TestTimingDiagramFullLifeline.class,
- TestTimingDiagramCompactLifeline.class,
+@SuiteClasses({ TestTimingDiagramInteraction.class, TestTimingDiagramFullLifeline.class, TestTimingDiagramCompactLifeline.class,
- TestTimingDiagramFullStateInvariant.class,
- TestTimingDiagramCompactStateInvariant.class,
-
- TestTimingDiagramFullOccurrenceSpecification.class,
- TestTimingDiagramCompactOccurrenceSpecification.class,
-
- TestTimingDiagramStateDefinition.class,
- TestTimingDiagramFullLifelineLayout.class,
-
- TestTimingDiagramMessages.class,
-})
+TestTimingDiagramFullStateInvariant.class, TestTimingDiagramCompactStateInvariant.class,
+
+TestTimingDiagramFullOccurrenceSpecification.class, TestTimingDiagramCompactOccurrenceSpecification.class,
+
+TestTimingDiagramStateDefinition.class, TestTimingDiagramFullLifelineLayout.class,
+
+TestTimingDiagramMessages.class, })
//@formatter:on
public class AllCanonicalTests {
// Junit 4 test case
-} \ No newline at end of file
+}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactLifeline.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactLifeline.java
index e8ea411ba12..769ebecf075 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactLifeline.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactLifeline.java
@@ -57,7 +57,7 @@ public class TestTimingDiagramCompactLifeline extends AbstractTimingDiagramTestC
public void testDropLifeline() {
// create a compact Lifeline and hide its View, so as to be able to drop it after that
final CompactLifelineEditPartCN lifelineEditPart = createCompactLifelineInDefaultInteraction();
- final Lifeline lifeline = (Lifeline) ((View) lifelineEditPart.getModel()).getElement();
+ final Lifeline lifeline = (Lifeline)((View)lifelineEditPart.getModel()).getElement();
assertNotNull("The lifeline should not be null", lifeline);
testHide(lifelineEditPart);
testDrop(getDefaultInteractionCompartment(), getDefaultInteractionCompartment(), lifeline);
@@ -66,20 +66,17 @@ public class TestTimingDiagramCompactLifeline extends AbstractTimingDiagramTestC
@Test
public void testCellEditorLocator() {
final CompactLifelineEditPartCN lifelineEditPart = createCompactLifelineInDefaultInteraction();
- final CompactLifelineNameEditPart compactLifelineNameEditPart = (CompactLifelineNameEditPart) EditPartUtils.findFirstChildEditPartWithId(
- lifelineEditPart, CompactLifelineNameEditPart.VISUAL_ID);
+ final CompactLifelineNameEditPart compactLifelineNameEditPart = (CompactLifelineNameEditPart)EditPartUtils.findFirstChildEditPartWithId(lifelineEditPart, CompactLifelineNameEditPart.VISUAL_ID);
assertNotNull("The CompactLifelineNameEditPart was not found", compactLifelineNameEditPart);
final CellEditorLocator textCellEditorLocator = UMLEditPartFactory.getTextCellEditorLocator(compactLifelineNameEditPart);
- assertTrue("The cell editor locator must be the one specific to the vertical label",
- textCellEditorLocator instanceof LifelineVerticalLabelCellEditorLocator);
+ assertTrue("The cell editor locator must be the one specific to the vertical label", textCellEditorLocator instanceof LifelineVerticalLabelCellEditorLocator);
}
@Test
public void testEditLifelineName() {
final CompactLifelineEditPartCN lifelineEditPart = createCompactLifelineInDefaultInteraction();
- final CompactLifelineNameEditPart compactLifelineNameEditPart = (CompactLifelineNameEditPart) EditPartUtils.findFirstChildEditPartWithId(
- lifelineEditPart, CompactLifelineNameEditPart.VISUAL_ID);
- final NamedElement namedElement = (Lifeline) ((View) lifelineEditPart.getModel()).getElement();
+ final CompactLifelineNameEditPart compactLifelineNameEditPart = (CompactLifelineNameEditPart)EditPartUtils.findFirstChildEditPartWithId(lifelineEditPart, CompactLifelineNameEditPart.VISUAL_ID);
+ final NamedElement namedElement = (Lifeline)((View)lifelineEditPart.getModel()).getElement();
testSetNameWithDirectEditRequest(compactLifelineNameEditPart, namedElement);
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactOccurrenceSpecification.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactOccurrenceSpecification.java
index f1e08a79306..dfaa97026de 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactOccurrenceSpecification.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactOccurrenceSpecification.java
@@ -47,8 +47,8 @@ public class TestTimingDiagramCompactOccurrenceSpecification extends AbstractTim
@Test
public void testCreateThreeOccurrenceSpecifications() {
createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
- final View interactionView = (View) getDefaultInteractionEditPart().getModel();
- final Interaction interaction = (Interaction) interactionView.getElement();
+ final View interactionView = (View)getDefaultInteractionEditPart().getModel();
+ final Interaction interaction = (Interaction)interactionView.getElement();
assertTrue("The interaction should be in a Model", isInModel(interaction));
// We created 3 OccurrenceSpecifications. The model starts and ends with a StateInvariant, and when creating an
// OccurrenceSpecification, we split a StateInvariant in two and insert the OccurrenceSpecification.
@@ -64,7 +64,7 @@ public class TestTimingDiagramCompactOccurrenceSpecification extends AbstractTim
assertEquals("Wrong number of OccurrenceSpecifications", 3, occurrenceSpecifications.size());
final OccurrenceSpecificationEditPartCN middleOccurrence = occurrenceSpecifications.get(1);
- final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification) ((View) middleOccurrence.getModel()).getElement();
+ final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification)((View)middleOccurrence.getModel()).getElement();
assertTrue("The OccurrenceSpecification should be in a Model", isInModel(occurrenceSpecification));
checkInteractionFragmentsWithPattern("-o-o-o-");
checkSimpleCompactTimelinePattern("-o-o-o-");
@@ -96,11 +96,10 @@ public class TestTimingDiagramCompactOccurrenceSpecification extends AbstractTim
@Test
public void testCreateOccurrenceSpecificationWithDoubleClick() {
- final CompactStateInvariantEditPartCN stateInvariantEditPart = (CompactStateInvariantEditPartCN) EditPartUtils.findFirstChildEditPartWithId(
- getDefaultCompactLifelineEditPart(), CompactStateInvariantEditPartCN.VISUAL_ID);
+ final CompactStateInvariantEditPartCN stateInvariantEditPart = (CompactStateInvariantEditPartCN)EditPartUtils.findFirstChildEditPartWithId(getDefaultCompactLifelineEditPart(), CompactStateInvariantEditPartCN.VISUAL_ID);
assertNotNull("A StateInvariant must always exist", stateInvariantEditPart);
assertEquals("There must always be only one StateInvariant initially", 1, findStateInvariantsInDefaultCompactLifeline().size());
- final StateInvariant stateInvariant = (StateInvariant) ((View) stateInvariantEditPart.getModel()).getElement();
+ final StateInvariant stateInvariant = (StateInvariant)((View)stateInvariantEditPart.getModel()).getElement();
assertNotNull("The StateInvariant must not be null", stateInvariant);
final IFigure figure = stateInvariantEditPart.getFigure();
@@ -267,32 +266,25 @@ public class TestTimingDiagramCompactOccurrenceSpecification extends AbstractTim
checkOccurrenceIsMiddleXBottomYOfStateInvariant(o7, s4);
}
- private static void checkOccurrenceIsMiddleXTopYOfStateInvariant(final OccurrenceSpecificationEditPartCN occurrenceSpecificationEditPart,
- final CompactStateInvariantEditPartCN stateInvariantEditPart) {
+ private static void checkOccurrenceIsMiddleXTopYOfStateInvariant(final OccurrenceSpecificationEditPartCN occurrenceSpecificationEditPart, final CompactStateInvariantEditPartCN stateInvariantEditPart) {
final Rectangle oBounds = getBounds(occurrenceSpecificationEditPart);
final Rectangle sBounds = getBounds(stateInvariantEditPart);
assertTrue("The occurrence should be located vertically near the top of the state invariant", Math.abs(oBounds.y - sBounds.y) <= 5);
- assertTrue("The occurrence should be located horizontally near the middle of the state invariant",
- Math.abs(oBounds.x - (sBounds.x + sBounds.width / 2)) <= 5);
+ assertTrue("The occurrence should be located horizontally near the middle of the state invariant", Math.abs(oBounds.x - (sBounds.x + sBounds.width / 2)) <= 5);
}
- private static void checkOccurrenceIsMiddleXBottomYOfStateInvariant(final OccurrenceSpecificationEditPartCN occurrenceSpecificationEditPart,
- final CompactStateInvariantEditPartCN stateInvariantEditPart) {
+ private static void checkOccurrenceIsMiddleXBottomYOfStateInvariant(final OccurrenceSpecificationEditPartCN occurrenceSpecificationEditPart, final CompactStateInvariantEditPartCN stateInvariantEditPart) {
final Rectangle oBounds = getBounds(occurrenceSpecificationEditPart);
final Rectangle sBounds = getBounds(stateInvariantEditPart);
assertTrue("The occurrence should be located vertically near the top of the state invariant", Math.abs(oBounds.y - (sBounds.y + sBounds.height)) <= 5);
- assertTrue("The occurrence should be located horizontally near the middle of the state invariant",
- Math.abs(oBounds.x - (sBounds.x + sBounds.width / 2)) <= 5);
+ assertTrue("The occurrence should be located horizontally near the middle of the state invariant", Math.abs(oBounds.x - (sBounds.x + sBounds.width / 2)) <= 5);
}
- private static void checkOccurrenceIsRightXMiddleYOfStateInvariant(final OccurrenceSpecificationEditPartCN occurrenceSpecificationEditPart,
- final CompactStateInvariantEditPartCN stateInvariantEditPart) {
+ private static void checkOccurrenceIsRightXMiddleYOfStateInvariant(final OccurrenceSpecificationEditPartCN occurrenceSpecificationEditPart, final CompactStateInvariantEditPartCN stateInvariantEditPart) {
final Rectangle oBounds = getBounds(occurrenceSpecificationEditPart);
final Rectangle sBounds = getBounds(stateInvariantEditPart);
- assertTrue("The occurrence should be located vertically near the middle of the state invariant",
- Math.abs(oBounds.y - (sBounds.y + sBounds.height / 2)) <= 5);
- assertTrue("The occurrence should be located horizontally near the right of the state invariant",
- Math.abs(oBounds.x - (sBounds.x + sBounds.width)) <= 5);
+ assertTrue("The occurrence should be located vertically near the middle of the state invariant", Math.abs(oBounds.y - (sBounds.y + sBounds.height / 2)) <= 5);
+ assertTrue("The occurrence should be located horizontally near the right of the state invariant", Math.abs(oBounds.x - (sBounds.x + sBounds.width)) <= 5);
}
protected void checkCreatedStateInvariants() {
@@ -307,26 +299,26 @@ public class TestTimingDiagramCompactOccurrenceSpecification extends AbstractTim
final List<OccurrenceSpecificationEditPartCN> occurrenceSpecificationEditParts = findOccurrenceSpecificationsInDefaultCompactLifeline();
assertEquals("There must be one OccurrenceSpecification", 1, occurrenceSpecificationEditParts.size());
final OccurrenceSpecificationEditPartCN occurrenceSpecificationEditPart = occurrenceSpecificationEditParts.get(0);
- final View occurrenceSpecificationView = (View) occurrenceSpecificationEditPart.getModel();
- final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification) occurrenceSpecificationView.getElement();
+ final View occurrenceSpecificationView = (View)occurrenceSpecificationEditPart.getModel();
+ final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification)occurrenceSpecificationView.getElement();
assertNotNull("The OccurrenceSpecification must not be null", occurrenceSpecification);
assertTrue("The OccurrenceSpecification must be in the model", isInModel(occurrenceSpecification));
assertEquals("The OccurrenceSpecification must cover one Lifeline", 1, occurrenceSpecification.getCovereds().size());
- final Lifeline lifeline = (Lifeline) ((View) getDefaultCompactLifelineEditPart().getModel()).getElement();
+ final Lifeline lifeline = (Lifeline)((View)getDefaultCompactLifelineEditPart().getModel()).getElement();
assertEquals("The OccurrenceSpecification must cover the Lifeline", lifeline, occurrenceSpecification.getCovereds().get(0));
- final Interaction interaction = (Interaction) ((View) getDefaultInteractionEditPart().getModel()).getElement();
+ final Interaction interaction = (Interaction)((View)getDefaultInteractionEditPart().getModel()).getElement();
assertTrue("The OccurrenceSpecification must be in the Interaction", interaction.getFragments().contains(occurrenceSpecification));
}
private void checkStateInvariant(final CompactStateInvariantEditPartCN stateInvariantEditPartCN) {
- final View stateInvariantView = (View) stateInvariantEditPartCN.getModel();
- final StateInvariant stateInvariant = (StateInvariant) stateInvariantView.getElement();
+ final View stateInvariantView = (View)stateInvariantEditPartCN.getModel();
+ final StateInvariant stateInvariant = (StateInvariant)stateInvariantView.getElement();
assertNotNull("The StateInvariant must not be null", stateInvariant);
assertTrue("The StateInvariant must be in the model", isInModel(stateInvariant));
assertEquals("The StateInvariant must cover one Lifeline", 1, stateInvariant.getCovereds().size());
- final Lifeline lifeline = (Lifeline) ((View) getDefaultCompactLifelineEditPart().getModel()).getElement();
+ final Lifeline lifeline = (Lifeline)((View)getDefaultCompactLifelineEditPart().getModel()).getElement();
assertEquals("The StateInvariant must cover the Lifeline", lifeline, stateInvariant.getCovereds().get(0));
- final Interaction interaction = (Interaction) ((View) getDefaultInteractionEditPart().getModel()).getElement();
+ final Interaction interaction = (Interaction)((View)getDefaultInteractionEditPart().getModel()).getElement();
assertTrue("The StateInvariant must be in the Interaction", interaction.getFragments().contains(stateInvariant));
}
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactStateInvariant.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactStateInvariant.java
index 9bebb3d371f..16930ef6438 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactStateInvariant.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactStateInvariant.java
@@ -53,8 +53,7 @@ public class TestTimingDiagramCompactStateInvariant extends AbstractTimingDiagra
createOccurrenceSpecificationInLastCompactStateInvariantWithRatio(2, 1.0 / 3.0);
createOccurrenceSpecificationInLastCompactStateInvariantWithRatio(3, 1.0 / 2.0);
checkSimpleCompactTimelinePattern("-o-o-o-");
- checkCompactTimelinePattern("StateInvariant(unnamed);OccurrenceSpecification(<unnamed>_To_<unnamed>);StateInvariant(unnamed);"
- + "OccurrenceSpecification(<unnamed>_To_<unnamed>);StateInvariant(unnamed);OccurrenceSpecification(<unnamed>_To_<unnamed>);StateInvariant(unnamed);");
+ checkCompactTimelinePattern("StateInvariant(unnamed);OccurrenceSpecification(<unnamed>_To_<unnamed>);StateInvariant(unnamed);" + "OccurrenceSpecification(<unnamed>_To_<unnamed>);StateInvariant(unnamed);OccurrenceSpecification(<unnamed>_To_<unnamed>);StateInvariant(unnamed);");
}
@Test
@@ -64,12 +63,12 @@ public class TestTimingDiagramCompactStateInvariant extends AbstractTimingDiagra
final List<CompactStateInvariantEditPartCN> stateInvariantEditParts = findStateInvariantsInDefaultCompactLifeline();
assertEquals("We should have four StateInvariants", 4, stateInvariantEditParts.size());
int i = 1;
- for (final CompactStateInvariantEditPartCN stateInvariantEditPart : stateInvariantEditParts) {
- final CompactStateInvariantNameEditPart nameEditPart = (CompactStateInvariantNameEditPart) EditPartUtils.findFirstChildEditPartWithId(
- stateInvariantEditPart, CompactStateInvariantNameEditPart.VISUAL_ID);
+ for(final CompactStateInvariantEditPartCN stateInvariantEditPart : stateInvariantEditParts) {
+ final CompactStateInvariantNameEditPart nameEditPart = (CompactStateInvariantNameEditPart)EditPartUtils.findFirstChildEditPartWithId(stateInvariantEditPart, CompactStateInvariantNameEditPart.VISUAL_ID);
assertNotNull("The name edit part must not be null", nameEditPart);
- final StateInvariant stateInvariant = (StateInvariant) ((View) stateInvariantEditPart.getModel()).getElement();
+ final StateInvariant stateInvariant = (StateInvariant)((View)stateInvariantEditPart.getModel()).getElement();
testSetNameWithDirectEditRequest(nameEditPart, stateInvariant, new INameProvider<StateInvariant>() {
+
public String getName(final StateInvariant stateInvariant) {
return StateInvariantUtils.getInnerStateInvariantName(stateInvariant);
}
@@ -77,8 +76,7 @@ public class TestTimingDiagramCompactStateInvariant extends AbstractTimingDiagra
setNameWithDirectEditRequest(nameEditPart, "state" + (i % 2 + 1));
i++;
}
- checkCompactTimelinePattern("StateInvariant(state2);OccurrenceSpecification(state2_1_To_state1_1);StateInvariant(state1);"
- + "OccurrenceSpecification(state1_1_To_state2_2);StateInvariant(state2);OccurrenceSpecification(state2_2_To_state1_2);StateInvariant(state1);");
+ checkCompactTimelinePattern("StateInvariant(state2);OccurrenceSpecification(state2_1_To_state1_1);StateInvariant(state1);" + "OccurrenceSpecification(state1_1_To_state2_2);StateInvariant(state2);OccurrenceSpecification(state2_2_To_state1_2);StateInvariant(state1);");
}
@Test
@@ -205,9 +203,7 @@ public class TestTimingDiagramCompactStateInvariant extends AbstractTimingDiagra
testResizeCompactStateInvariant(s2, 42, o1, o2, o3, o4, o5, timelineCompartment);
}
- private void testResizeCompactStateInvariant(final CompactStateInvariantEditPartCN s2, final int widthDelta, final OccurrenceSpecificationEditPartCN o1,
- final OccurrenceSpecificationEditPartCN o2, final OccurrenceSpecificationEditPartCN o3, final OccurrenceSpecificationEditPartCN o4,
- final OccurrenceSpecificationEditPartCN o5, final CompactLifelineCompartmentEditPartCN timelineCompartment) {
+ private void testResizeCompactStateInvariant(final CompactStateInvariantEditPartCN s2, final int widthDelta, final OccurrenceSpecificationEditPartCN o1, final OccurrenceSpecificationEditPartCN o2, final OccurrenceSpecificationEditPartCN o3, final OccurrenceSpecificationEditPartCN o4, final OccurrenceSpecificationEditPartCN o5, final CompactLifelineCompartmentEditPartCN timelineCompartment) {
final Rectangle o1Before = getBounds(o1);
final Rectangle o2Before = getBounds(o2);
final Rectangle o3Before = getBounds(o3);
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifeline.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifeline.java
index d032507fc50..73ff53ce99b 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifeline.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifeline.java
@@ -57,7 +57,7 @@ public class TestTimingDiagramFullLifeline extends AbstractTimingDiagramTestCase
public void testDropLifeline() {
// create a Lifeline and hide its View, so as to be able to drop it after that
final FullLifelineEditPartCN lifelineEditPart = createFullLifelineInDefaultInteraction();
- final Lifeline lifeline = (Lifeline) ((View) lifelineEditPart.getModel()).getElement();
+ final Lifeline lifeline = (Lifeline)((View)lifelineEditPart.getModel()).getElement();
assertNotNull("The lifeline should not be null", lifeline);
testHide(lifelineEditPart);
testDrop(getDefaultInteractionCompartment(), getDefaultInteractionCompartment(), lifeline);
@@ -66,20 +66,17 @@ public class TestTimingDiagramFullLifeline extends AbstractTimingDiagramTestCase
@Test
public void testCellEditorLocator() {
final FullLifelineEditPartCN lifelineEditPart = createFullLifelineInDefaultInteraction();
- final FullLifelineNameEditPart fullLifelineNameEditPart = (FullLifelineNameEditPart) EditPartUtils.findFirstChildEditPartWithId(lifelineEditPart,
- FullLifelineNameEditPart.VISUAL_ID);
+ final FullLifelineNameEditPart fullLifelineNameEditPart = (FullLifelineNameEditPart)EditPartUtils.findFirstChildEditPartWithId(lifelineEditPart, FullLifelineNameEditPart.VISUAL_ID);
assertNotNull("The FullLifelineNameEditPart was not found", fullLifelineNameEditPart);
final CellEditorLocator textCellEditorLocator = UMLEditPartFactory.getTextCellEditorLocator(fullLifelineNameEditPart);
- assertTrue("The cell editor locator must be the one specific to the vertical label",
- textCellEditorLocator instanceof LifelineVerticalLabelCellEditorLocator);
+ assertTrue("The cell editor locator must be the one specific to the vertical label", textCellEditorLocator instanceof LifelineVerticalLabelCellEditorLocator);
}
@Test
public void testEditLifelineName() {
final FullLifelineEditPartCN lifelineEditPart = createFullLifelineInDefaultInteraction();
- final FullLifelineNameEditPart lifelineNameEditPart = (FullLifelineNameEditPart) EditPartUtils.findFirstChildEditPartWithId(lifelineEditPart,
- FullLifelineNameEditPart.VISUAL_ID);
- final NamedElement namedElement = (Lifeline) ((View) lifelineEditPart.getModel()).getElement();
+ final FullLifelineNameEditPart lifelineNameEditPart = (FullLifelineNameEditPart)EditPartUtils.findFirstChildEditPartWithId(lifelineEditPart, FullLifelineNameEditPart.VISUAL_ID);
+ final NamedElement namedElement = (Lifeline)((View)lifelineEditPart.getModel()).getElement();
testSetNameWithDirectEditRequest(lifelineNameEditPart, namedElement);
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullOccurrenceSpecification.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullOccurrenceSpecification.java
index 9b7d8abbf0b..d2ac36557de 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullOccurrenceSpecification.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullOccurrenceSpecification.java
@@ -48,8 +48,8 @@ public class TestTimingDiagramFullOccurrenceSpecification extends AbstractTiming
@Test
public void testModelWithThreeOccurrenceSpecifications() {
createThreeOccurrenceSpecificationsInDefaultFullLifeline();
- final View interactionView = (View) getDefaultInteractionEditPart().getModel();
- final Interaction interaction = (Interaction) interactionView.getElement();
+ final View interactionView = (View)getDefaultInteractionEditPart().getModel();
+ final Interaction interaction = (Interaction)interactionView.getElement();
assertTrue("The interaction should be in a Model", isInModel(interaction));
// We created 3 OccurrenceSpecifications. The model starts and ends with a StateInvariant, and when creating an
// OccurrenceSpecification, we split a StateInvariant in two and insert the OccurrenceSpecification.
@@ -64,7 +64,7 @@ public class TestTimingDiagramFullOccurrenceSpecification extends AbstractTiming
assertEquals("Wrong number of OccurrenceSpecifications", 3, occurrenceSpecifications.size());
final OccurrenceSpecificationEditPartCN middleOccurrence = occurrenceSpecifications.get(1);
- final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification) ((View) middleOccurrence.getModel()).getElement();
+ final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification)((View)middleOccurrence.getModel()).getElement();
assertTrue("The OccurrenceSpecification should be in a Model", isInModel(occurrenceSpecification));
checkInteractionFragmentsWithPattern("-o-o-o-");
@@ -92,11 +92,10 @@ public class TestTimingDiagramFullOccurrenceSpecification extends AbstractTiming
@Test
public void testCreateOccurrenceSpecificationWithDoubleClick() {
- final FullStateInvariantEditPartCN stateInvariantEditPart = (FullStateInvariantEditPartCN) EditPartUtils.findFirstChildEditPartWithId(
- getDefaultFullLifelineEditPart(), FullStateInvariantEditPartCN.VISUAL_ID);
+ final FullStateInvariantEditPartCN stateInvariantEditPart = (FullStateInvariantEditPartCN)EditPartUtils.findFirstChildEditPartWithId(getDefaultFullLifelineEditPart(), FullStateInvariantEditPartCN.VISUAL_ID);
assertNotNull("A StateInvariant must always exist", stateInvariantEditPart);
assertEquals("There must always be only one StateInvariant initially", 1, findStateInvariantsInDefaultFullLifeline().size());
- final StateInvariant stateInvariant = (StateInvariant) ((View) stateInvariantEditPart.getModel()).getElement();
+ final StateInvariant stateInvariant = (StateInvariant)((View)stateInvariantEditPart.getModel()).getElement();
assertNotNull("The StateInvariant must not be null", stateInvariant);
final IFigure figure = stateInvariantEditPart.getFigure();
@@ -128,8 +127,7 @@ public class TestTimingDiagramFullOccurrenceSpecification extends AbstractTiming
public void testCreateOccurrenceSpecificationWithPaletteTool() {
// let GMF do its layout (in order for the Figure coordinates to be set)
flushEventLoop();
- final FullStateInvariantEditPartCN stateInvariantEditPart = (FullStateInvariantEditPartCN) EditPartUtils.findFirstChildEditPartWithId(
- getDefaultFullLifelineEditPart(), FullStateInvariantEditPartCN.VISUAL_ID);
+ final FullStateInvariantEditPartCN stateInvariantEditPart = (FullStateInvariantEditPartCN)EditPartUtils.findFirstChildEditPartWithId(getDefaultFullLifelineEditPart(), FullStateInvariantEditPartCN.VISUAL_ID);
assertNotNull("A StateInvariant must always exist", stateInvariantEditPart);
// use the OccurrenceSpecification creation tool to create a new OccurrenceSpecification
@@ -265,26 +263,26 @@ public class TestTimingDiagramFullOccurrenceSpecification extends AbstractTiming
final List<OccurrenceSpecificationEditPartCN> occurrenceSpecificationEditParts = findOccurrenceSpecificationsInDefaultFullLifeline();
assertEquals("There must be one OccurrenceSpecification", 1, occurrenceSpecificationEditParts.size());
final OccurrenceSpecificationEditPartCN occurrenceSpecificationEditPart = occurrenceSpecificationEditParts.get(0);
- final View occurrenceSpecificationView = (View) occurrenceSpecificationEditPart.getModel();
- final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification) occurrenceSpecificationView.getElement();
+ final View occurrenceSpecificationView = (View)occurrenceSpecificationEditPart.getModel();
+ final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification)occurrenceSpecificationView.getElement();
assertNotNull("The OccurrenceSpecification must not be null", occurrenceSpecification);
assertTrue("The OccurrenceSpecification must be in the model", isInModel(occurrenceSpecification));
assertEquals("The OccurrenceSpecification must cover one Lifeline", 1, occurrenceSpecification.getCovereds().size());
- final Lifeline lifeline = (Lifeline) ((View) getDefaultFullLifelineEditPart().getModel()).getElement();
+ final Lifeline lifeline = (Lifeline)((View)getDefaultFullLifelineEditPart().getModel()).getElement();
assertEquals("The OccurrenceSpecification must cover the Lifeline", lifeline, occurrenceSpecification.getCovereds().get(0));
- final Interaction interaction = (Interaction) ((View) getDefaultInteractionEditPart().getModel()).getElement();
+ final Interaction interaction = (Interaction)((View)getDefaultInteractionEditPart().getModel()).getElement();
assertTrue("The OccurrenceSpecification must be in the Interaction", interaction.getFragments().contains(occurrenceSpecification));
}
private void checkStateInvariant(final FullStateInvariantEditPartCN fullStateInvariantEditPartCN) {
- final View stateInvariantView = (View) fullStateInvariantEditPartCN.getModel();
- final StateInvariant stateInvariant = (StateInvariant) stateInvariantView.getElement();
+ final View stateInvariantView = (View)fullStateInvariantEditPartCN.getModel();
+ final StateInvariant stateInvariant = (StateInvariant)stateInvariantView.getElement();
assertNotNull("The StateInvariant must not be null", stateInvariant);
assertTrue("The StateInvariant must be in the model", isInModel(stateInvariant));
assertEquals("The StateInvariant must cover one Lifeline", 1, stateInvariant.getCovereds().size());
- final Lifeline lifeline = (Lifeline) ((View) getDefaultFullLifelineEditPart().getModel()).getElement();
+ final Lifeline lifeline = (Lifeline)((View)getDefaultFullLifelineEditPart().getModel()).getElement();
assertEquals("The StateInvariant must cover the Lifeline", lifeline, stateInvariant.getCovereds().get(0));
- final Interaction interaction = (Interaction) ((View) getDefaultInteractionEditPart().getModel()).getElement();
+ final Interaction interaction = (Interaction)((View)getDefaultInteractionEditPart().getModel()).getElement();
assertTrue("The StateInvariant must be in the Interaction", interaction.getFragments().contains(stateInvariant));
}
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullStateInvariant.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullStateInvariant.java
index 1908fb3e67d..8b53a16a4b0 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullStateInvariant.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullStateInvariant.java
@@ -39,9 +39,7 @@ public class TestTimingDiagramFullStateInvariant extends AbstractTimingDiagramTe
assertEquals("We should have 3 StateDefinitions at the beginning of this test", 3, stateDefinitionEditParts.size());
// computeTimelineStringPattern();
- checkFullTimelinePattern("StateInvariant(State 1);OccurrenceSpecification(State 1_1_To_State 1_2);VerticalLine;"
- + "StateInvariant(State 1);OccurrenceSpecification(State 1_2_To_State 1_3);VerticalLine;"
- + "StateInvariant(State 1);OccurrenceSpecification(State 1_3_To_State 1_4);VerticalLine;" + "StateInvariant(State 1);");
+ checkFullTimelinePattern("StateInvariant(State 1);OccurrenceSpecification(State 1_1_To_State 1_2);VerticalLine;" + "StateInvariant(State 1);OccurrenceSpecification(State 1_2_To_State 1_3);VerticalLine;" + "StateInvariant(State 1);OccurrenceSpecification(State 1_3_To_State 1_4);VerticalLine;" + "StateInvariant(State 1);");
final Rectangle stateDefBounds1 = getAbsoluteBounds(stateDefinitionEditParts.get(0));
final Rectangle stateDefBounds2 = getAbsoluteBounds(stateDefinitionEditParts.get(1));
@@ -56,33 +54,19 @@ public class TestTimingDiagramFullStateInvariant extends AbstractTimingDiagramTe
// TODO: check state invariant in front of state definitions
moveEditPart(stateInvariantEditParts.get(0), getDefaultFullLifelineTimelineCompartment(), new Point(0, distanceBetweenStates));
- checkFullTimelinePattern("StateInvariant(State 2);OccurrenceSpecification(State 2_1_To_State 1_1);VerticalLine;"
- + "StateInvariant(State 1);OccurrenceSpecification(State 1_1_To_State 1_2);VerticalLine;"
- + "StateInvariant(State 1);OccurrenceSpecification(State 1_2_To_State 1_3);VerticalLine;StateInvariant(State 1);");
+ checkFullTimelinePattern("StateInvariant(State 2);OccurrenceSpecification(State 2_1_To_State 1_1);VerticalLine;" + "StateInvariant(State 1);OccurrenceSpecification(State 1_1_To_State 1_2);VerticalLine;" + "StateInvariant(State 1);OccurrenceSpecification(State 1_2_To_State 1_3);VerticalLine;StateInvariant(State 1);");
moveEditPart(stateInvariantEditParts.get(1), getDefaultFullLifelineTimelineCompartment(), new Point(0, 2 * distanceBetweenStates));
- checkFullTimelinePattern("StateInvariant(State 2);OccurrenceSpecification(State 2_1_To_State 3_1);VerticalLine;"
- + "StateInvariant(State 3);OccurrenceSpecification(State 3_1_To_State 1_1);VerticalLine;"
- + "StateInvariant(State 1);OccurrenceSpecification(State 1_1_To_State 1_2);VerticalLine;StateInvariant(State 1);");
+ checkFullTimelinePattern("StateInvariant(State 2);OccurrenceSpecification(State 2_1_To_State 3_1);VerticalLine;" + "StateInvariant(State 3);OccurrenceSpecification(State 3_1_To_State 1_1);VerticalLine;" + "StateInvariant(State 1);OccurrenceSpecification(State 1_1_To_State 1_2);VerticalLine;StateInvariant(State 1);");
moveEditPart(stateInvariantEditParts.get(3), getDefaultFullLifelineTimelineCompartment(), new Point(0, distanceBetweenStates));
- checkFullTimelinePattern("StateInvariant(State 2);OccurrenceSpecification(State 2_1_To_State 3_1);VerticalLine;"
- + "StateInvariant(State 3);OccurrenceSpecification(State 3_1_To_State 1_1);VerticalLine;"
- + "StateInvariant(State 1);OccurrenceSpecification(State 1_1_To_State 2_2);VerticalLine;StateInvariant(State 2);");
+ checkFullTimelinePattern("StateInvariant(State 2);OccurrenceSpecification(State 2_1_To_State 3_1);VerticalLine;" + "StateInvariant(State 3);OccurrenceSpecification(State 3_1_To_State 1_1);VerticalLine;" + "StateInvariant(State 1);OccurrenceSpecification(State 1_1_To_State 2_2);VerticalLine;StateInvariant(State 2);");
moveEditPart(stateInvariantEditParts.get(3), getDefaultFullLifelineTimelineCompartment(), new Point(0, distanceBetweenStates));
- checkFullTimelinePattern("StateInvariant(State 2);OccurrenceSpecification(State 2_1_To_State 3_1);VerticalLine;"
- + "StateInvariant(State 3);OccurrenceSpecification(State 3_1_To_State 1_1);VerticalLine;"
- + "StateInvariant(State 1);OccurrenceSpecification(State 1_1_To_State 3_2);VerticalLine;StateInvariant(State 3);");
+ checkFullTimelinePattern("StateInvariant(State 2);OccurrenceSpecification(State 2_1_To_State 3_1);VerticalLine;" + "StateInvariant(State 3);OccurrenceSpecification(State 3_1_To_State 1_1);VerticalLine;" + "StateInvariant(State 1);OccurrenceSpecification(State 1_1_To_State 3_2);VerticalLine;StateInvariant(State 3);");
moveEditPart(stateInvariantEditParts.get(2), getDefaultFullLifelineTimelineCompartment(), new Point(0, 2 * distanceBetweenStates));
- checkFullTimelinePattern("StateInvariant(State 2);OccurrenceSpecification(State 2_1_To_State 3_1);VerticalLine;"
- + "StateInvariant(State 3);OccurrenceSpecification(State 3_1_To_State 3_2);VerticalLine;"
- + "StateInvariant(State 3);OccurrenceSpecification(State 3_2_To_State 3_3);VerticalLine;StateInvariant(State 3);");
+ checkFullTimelinePattern("StateInvariant(State 2);OccurrenceSpecification(State 2_1_To_State 3_1);VerticalLine;" + "StateInvariant(State 3);OccurrenceSpecification(State 3_1_To_State 3_2);VerticalLine;" + "StateInvariant(State 3);OccurrenceSpecification(State 3_2_To_State 3_3);VerticalLine;StateInvariant(State 3);");
moveEditPart(stateInvariantEditParts.get(2), getDefaultFullLifelineTimelineCompartment(), new Point(0, -distanceBetweenStates));
- checkFullTimelinePattern("StateInvariant(State 2);OccurrenceSpecification(State 2_1_To_State 3_1);VerticalLine;"
- + "StateInvariant(State 3);OccurrenceSpecification(State 3_1_To_State 2_2);VerticalLine;"
- + "StateInvariant(State 2);OccurrenceSpecification(State 2_2_To_State 3_2);VerticalLine;StateInvariant(State 3);");
+ checkFullTimelinePattern("StateInvariant(State 2);OccurrenceSpecification(State 2_1_To_State 3_1);VerticalLine;" + "StateInvariant(State 3);OccurrenceSpecification(State 3_1_To_State 2_2);VerticalLine;" + "StateInvariant(State 2);OccurrenceSpecification(State 2_2_To_State 3_2);VerticalLine;StateInvariant(State 3);");
moveEditPart(stateInvariantEditParts.get(1), getDefaultFullLifelineTimelineCompartment(), new Point(0, -2 * distanceBetweenStates));
- checkFullTimelinePattern("StateInvariant(State 2);OccurrenceSpecification(State 2_1_To_State 1_1);VerticalLine;"
- + "StateInvariant(State 1);OccurrenceSpecification(State 1_1_To_State 2_2);VerticalLine;"
- + "StateInvariant(State 2);OccurrenceSpecification(State 2_2_To_State 3_1);VerticalLine;StateInvariant(State 3);");
+ checkFullTimelinePattern("StateInvariant(State 2);OccurrenceSpecification(State 2_1_To_State 1_1);VerticalLine;" + "StateInvariant(State 1);OccurrenceSpecification(State 1_1_To_State 2_2);VerticalLine;" + "StateInvariant(State 2);OccurrenceSpecification(State 2_2_To_State 3_1);VerticalLine;StateInvariant(State 3);");
}
@Test
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramInteraction.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramInteraction.java
index ad64befd2d6..efe338e0145 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramInteraction.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramInteraction.java
@@ -49,7 +49,7 @@ public class TestTimingDiagramInteraction extends AbstractTimingDiagramTestCase
public void testDropInteraction() {
// create an Interaction and hide its View, so as to be able to drop it after that
final InteractionEditPartTN interactionEditPart = createInteraction();
- final Interaction interaction = (Interaction) ((View) interactionEditPart.getModel()).getElement();
+ final Interaction interaction = (Interaction)((View)interactionEditPart.getModel()).getElement();
assertNotNull("The interaction should not be null", interaction);
hide(interactionEditPart);
@@ -70,9 +70,8 @@ public class TestTimingDiagramInteraction extends AbstractTimingDiagramTestCase
@Test
public void testEditInteractionName() {
final InteractionEditPartTN interactionEditPart = createInteraction();
- final InteractionNameEditPart interactionNameEditPart = (InteractionNameEditPart) EditPartUtils.findFirstChildEditPartWithId(interactionEditPart,
- InteractionNameEditPart.VISUAL_ID);
- final NamedElement namedElement = (Interaction) ((View) interactionEditPart.getModel()).getElement();
+ final InteractionNameEditPart interactionNameEditPart = (InteractionNameEditPart)EditPartUtils.findFirstChildEditPartWithId(interactionEditPart, InteractionNameEditPart.VISUAL_ID);
+ final NamedElement namedElement = (Interaction)((View)interactionEditPart.getModel()).getElement();
testSetNameWithDirectEditRequest(interactionNameEditPart, namedElement);
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramMessages.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramMessages.java
index 5a8cbdb3a2d..02433f1f94c 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramMessages.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramMessages.java
@@ -27,8 +27,7 @@ public class TestTimingDiagramMessages extends AbstractTimingDiagramTestCase {
@Test
public void testCreateSyncMessage() {
- clickTwiceWithTool("createMessageSyncCreationTool", findOccurrenceSpecificationsInDefaultFullLifeline().get(0),
- findOccurrenceSpecificationsInDefaultCompactLifeline().get(1));
+ clickTwiceWithTool("createMessageSyncCreationTool", findOccurrenceSpecificationsInDefaultFullLifeline().get(0), findOccurrenceSpecificationsInDefaultCompactLifeline().get(1));
final Text text = findVisibleTextWidgetOnDiagram();
setText(text, "abc");
@@ -42,8 +41,7 @@ public class TestTimingDiagramMessages extends AbstractTimingDiagramTestCase {
@Test
public void testCreateAsyncMessage() {
- clickTwiceWithTool("createMessageAsyncCreationTool", findOccurrenceSpecificationsInDefaultFullLifeline().get(0),
- findOccurrenceSpecificationsInDefaultCompactLifeline().get(1));
+ clickTwiceWithTool("createMessageAsyncCreationTool", findOccurrenceSpecificationsInDefaultFullLifeline().get(0), findOccurrenceSpecificationsInDefaultCompactLifeline().get(1));
final Text text = findVisibleTextWidgetOnDiagram();
setText(text, "def");
// TODO: check async Message instance
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramStateDefinition.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramStateDefinition.java
index 54100b5e855..16370e88091 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramStateDefinition.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramStateDefinition.java
@@ -49,14 +49,13 @@ public class TestTimingDiagramStateDefinition extends AbstractTimingDiagramTestC
@Test
public void testCreateStateDefinition() {
final EditPart stateDefinition = createStateDefinitionInDefaultFullLifeline();
- final EditPart stateInvariantEditPart = EditPartUtils.findFirstChildEditPartWithId(getDefaultFullLifelineEditPart(),
- FullStateInvariantEditPartCN.VISUAL_ID);
+ final EditPart stateInvariantEditPart = EditPartUtils.findFirstChildEditPartWithId(getDefaultFullLifelineEditPart(), FullStateInvariantEditPartCN.VISUAL_ID);
assertNotNull("A StateInvariant must be created with the first StateDefinition", stateInvariantEditPart);
- final StateInvariant stateInvariant = (StateInvariant) ((View) stateInvariantEditPart.getModel()).getElement();
+ final StateInvariant stateInvariant = (StateInvariant)((View)stateInvariantEditPart.getModel()).getElement();
assertNotNull("The StateInvariant must not be null", stateInvariant);
final String stateInvariantId = StateInvariantUtils.getStateInvariantId(stateInvariant);
assertNotNull("The StateInvariant id must not be null", stateInvariantId);
- final String stateDefinitionViewID = StateDefinitionUtils.getStateDefinitionViewID((View) stateDefinition.getModel());
+ final String stateDefinitionViewID = StateDefinitionUtils.getStateDefinitionViewID((View)stateDefinition.getModel());
assertEquals("The ids of the StateDefinition and the StateInvariant must be equal", stateDefinitionViewID, stateInvariantId);
}
@@ -80,8 +79,7 @@ public class TestTimingDiagramStateDefinition extends AbstractTimingDiagramTestC
}
private void expectNStateDefinitions(final int numberOfExpectedStateDefinitions) {
- assertEquals("There must be " + numberOfExpectedStateDefinitions + " StateDefinitionEditPart", numberOfExpectedStateDefinitions, findStateDefinitions()
- .size());
+ assertEquals("There must be " + numberOfExpectedStateDefinitions + " StateDefinitionEditPart", numberOfExpectedStateDefinitions, findStateDefinitions().size());
}
/**
@@ -112,19 +110,19 @@ public class TestTimingDiagramStateDefinition extends AbstractTimingDiagramTestC
* Check that there is a StateDefinition with the given name.
*
* @param expectedName
- * the name of a StateDefinition that should exist.
+ * the name of a StateDefinition that should exist.
*/
protected void checkStateDefinition(final String expectedName) {
- final View lifelineView = (View) getDefaultFullLifelineEditPart().getModel();
- final Lifeline lifeline = (Lifeline) lifelineView.getElement();
+ final View lifelineView = (View)getDefaultFullLifelineEditPart().getModel();
+ final Lifeline lifeline = (Lifeline)lifelineView.getElement();
final EAnnotation stateDefinitionsEAnnotation = StateDefinitionUtils.getStateDefinitionsEAnnotation(lifeline);
assertNotNull("The lifeline should have an EAnnotation for the state definitions", stateDefinitionsEAnnotation);
// find the entry corresponding to the new StateDefinition
Entry<String, String> newEntry = null;
final EMap<String, String> details = stateDefinitionsEAnnotation.getDetails();
- for (final Entry<String, String> entry : details) {
- if (expectedName.equals(entry.getValue())) {
+ for(final Entry<String, String> entry : details) {
+ if(expectedName.equals(entry.getValue())) {
newEntry = entry;
break;
}
@@ -139,16 +137,16 @@ public class TestTimingDiagramStateDefinition extends AbstractTimingDiagramTestC
/** Check that no StateDefinition exists with the given name. */
protected void checkNoStateDefinition(final String unexpectedName) {
- final View lifelineView = (View) getDefaultFullLifelineEditPart().getModel();
- final Lifeline lifeline = (Lifeline) lifelineView.getElement();
+ final View lifelineView = (View)getDefaultFullLifelineEditPart().getModel();
+ final Lifeline lifeline = (Lifeline)lifelineView.getElement();
final EAnnotation stateDefinitionsEAnnotation = StateDefinitionUtils.getStateDefinitionsEAnnotation(lifeline);
- if (stateDefinitionsEAnnotation == null) {
+ if(stateDefinitionsEAnnotation == null) {
return;
}
// find the entry corresponding to the new StateDefinition
final EMap<String, String> details = stateDefinitionsEAnnotation.getDetails();
- for (final Entry<String, String> entry : details) {
- if (unexpectedName.equals(entry.getValue())) {
+ for(final Entry<String, String> entry : details) {
+ if(unexpectedName.equals(entry.getValue())) {
fail("A StateDefinition with the given name exists");
}
}
@@ -219,8 +217,7 @@ public class TestTimingDiagramStateDefinition extends AbstractTimingDiagramTestC
}
private static StateDefinitionLabelEditPart getStateDefinitionLabelEditPart(final EditPart stateDefinitionEditPart) {
- final StateDefinitionLabelEditPart stateDefinitionLabelEditPart = (StateDefinitionLabelEditPart) EditPartUtils.findFirstChildEditPartWithId(
- stateDefinitionEditPart, StateDefinitionLabelEditPart.VISUAL_ID);
+ final StateDefinitionLabelEditPart stateDefinitionLabelEditPart = (StateDefinitionLabelEditPart)EditPartUtils.findFirstChildEditPartWithId(stateDefinitionEditPart, StateDefinitionLabelEditPart.VISUAL_ID);
return stateDefinitionLabelEditPart;
}
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/LifelineVerticalLabelCellEditorLocator.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/LifelineVerticalLabelCellEditorLocator.java
index fc2ae319a2a..77599c26567 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/LifelineVerticalLabelCellEditorLocator.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/LifelineVerticalLabelCellEditorLocator.java
@@ -28,16 +28,16 @@ public class LifelineVerticalLabelCellEditorLocator implements CellEditorLocator
}
public void relocate(final CellEditor celleditor) {
- final Text text = (Text) celleditor.getControl();
+ final Text text = (Text)celleditor.getControl();
// position the cell editor at the top of the vertical text
final Rectangle rect = this.figure.getBounds().getCopy();
rect.y -= text.getBounds().height + 5;
this.figure.translateToAbsolute(rect);
- if (!text.getFont().isDisposed()) {
+ if(!text.getFont().isDisposed()) {
final 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/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/Messages.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/Messages.java
index b434f971936..9f03e2f79a9 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/Messages.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/Messages.java
@@ -13,91 +13,177 @@ package org.eclipse.papyrus.uml.diagram.timing.custom;
import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
+
private static final String BUNDLE_NAME = "org.eclipse.papyrus.uml.diagram.timing.custom.messages"; //$NON-NLS-1$
+
public static String AbstractTimelineLayoutPolicy_MoveOccurrenceSpecification;
+
public static String AbstractTimelineLayoutPolicy_UpdateLocationOfTimeElements;
+
public static String AddOccurrenceSpecificationInCompactLifelineCommand_CreateOccurrenceSpecification;
+
public static String ChangeLifelineFromCompactToFull_commandLabel;
+
public static String ChangeLifelineFromFullToCompact_commandLabel;
+
public static String CompactStateInvariantNameParser_SetStateInvariantName;
+
public static String CompactStateInvariantNameParser_Unnamed;
+
public static String CustomCompactLifelifeCompactStateInvariantCreationEditPolicy_CreateStateInvariant;
+
public static String CustomCompactLifelifeCompactStateInvariantCreationEditPolicy_InitializeStateInvariant;
+
public static String CustomCompactLifelineCompartmentLayoutEditPolicy_MoveElement;
+
public static String CustomCompactLifelineCompartmentLayoutEditPolicy_MoveOccurrenceSpecification;
+
public static String CustomCompactLifelineCompartmentLayoutEditPolicy_ResizeStateInvariant;
+
public static String CustomCompactStateInvariantEditPartCN_CreateOccurrenceSpecification;
+
public static String CustomFullLifelineStateDefinitionCompartmentCreationEditPolicy_CreateStateDefinition;
+
public static String CustomFullLifelineStateDefinitionCompartmentCreationEditPolicy_InitializeStateDefinition;
+
public static String CustomFullLifelineStateDefinitionCompartmentEditPartCN_AddStateDefinitionsHere;
+
public static String CustomFullStateInvariantEditPartCN_CreateOccurrenceSpecification;
+
public static String hideStateInvariant;
+
public static String CustomInteractionCompartmentCreationEditPolicy_CreateCompactLifeline;
+
public static String CustomInteractionCompartmentCreationEditPolicy_CreateFullLifeline;
+
public static String CustomInteractionCreationEditPolicy_CreateGate;
+
public static String CustomInteractionCreationEditPolicy_PositionGate;
+
public static String CustomLifelineCompartmentGraphicalNodeEditPolicy_SetMessageFoundSourceLocation;
+
public static String CustomLifelineCompartmentGraphicalNodeEditPolicy_SetMessageLostTargetLocation;
+
public static String OccurrenceSpecificationUtils_DestroyOccurrenceSpecification;
+
public static String OccurrenceSpecificationUtils_HideOccurrenceSpecification;
+
public static String LifelineUtils_CreationOccurrence;
+
public static String LifelineUtils_DestructionOccurrence;
+
public static String LifelineUtils_UpdateFragmentNames;
+
public static String LifelineUtils_UpdateLifelineFragmentNames;
+
public static String CustomPaletteFactory_SetFoundMessageTarget;
+
public static String CustomPaletteFactory_SetLostMessageOrigin;
+
public static String CustomStateDefinitionEditPart_DeleteStateDefinition;
+
public static String CustomTimelineCompartmentLayoutEditPolicy_MoveOccurrenceSpecification;
+
public static String CustomTimelineCompartmentLayoutEditPolicy_MoveStateInvariant;
+
public static String CustomTimelineCompartmentLayoutEditPolicy_MoveVerticalLine;
+
public static String CustomTimelineCompartmentLayoutEditPolicy_UpdateStateInvariant;
+
public static String CutAndInsertOccurrenceSpecificationCommand_CreateOccurrenceSpecification;
+
public static String CutAndInsertOccurrenceSpecificationCompactLifelineCommand_CreateOccurrenceSpecification;
+
public static String DeleteStateDefinitionCommand_DeleteStateDefinition;
+
public static String DestructionOccurrenceSpecificationCreationTool_CreateDestructionOccurrenceSpecification;
+
public static String DropUtils_DropElement;
+
public static String DropUtils_DropGate;
+
public static String DurationCreationTool_ClickEndElement;
+
public static String DurationCreationTool_ClickStartElement;
+
public static String ModelValidationUtils_CoveredByFragmentsWereReOrdered;
+
public static String ModelValidationUtils_FragmentsFoundAfterDestructionOccurrenceSpecification;
+
public static String ModelValidationUtils_FragmentsRemovedAfterDestructionOccurrenceSpecification;
+
public static String ModelValidationUtils_MissingOccurrenceSpecificationAdded;
+
public static String ModelValidationUtils_MissingOccurrenceSpecificationFound;
+
public static String ModelValidationUtils_ModelValidation;
+
public static String OccurrenceSpecificationCreationTool_CreateOccurrenceSpecification;
+
public static String OccurrenceSpecificationHelperAdvice_DestroyOccurrenceSpecification;
+
public static String OccurrenceSpecificationNameParser_SetOccurrenceSpecificationName;
+
public static String StateDefinitionParser_SetStateDefinitionName;
+
public static String StateDefinitionParser_Unnamed;
+
public static String StateDefinitionUtils_State;
+
public static String StateInvariantHelperAdvice_DestroyStateInvariant;
+
public static String SwitchLifelineCommand_createLifelineFragments;
+
public static String SwitchLifelineCommand_CreateLinkedElements;
+
public static String SwitchLifelineCommand_CreateTimeRuler;
+
public static String SwitchLifelineCommand_createMessages;
+
public static String SwitchLifelineCommand_createStateDefinitions;
+
public static String SwitchLifelineCommand_NameUnnamedStateInvariants;
+
public static String SwitchLifelineCommand_ReAssociateTicks;
+
public static String SwitchLifelineCommand_switchLifeline;
+
public static String SwitchLifelineCommand_unnamed;
+
public static String CreateTickCommand_attachTick;
+
public static String CreateTickCommand_CreateTick;
+
public static String ConstraintParser_SetConstraint;
+
public static String GateHelperAdvice_DestroyGate;
+
public static String GeneralOrderingCreationTool_ClickAfter;
+
public static String GeneralOrderingCreationTool_ClickBefore;
+
public static String TimingDiagramDragDropEditPolicy_Drop;
+
public static String TimingDiagramDragDropEditPolicy_DropLifeline;
+
public static String TimingDiagramDragDropEditPolicy_DropLifelineFragments;
+
public static String TimingDiagramDragDropEditPolicy_DropMessage;
+
public static String TimingDiagramDragDropEditPolicy_DropStateDefinitions;
+
public static String ToggleTimeRulerVisibility_ToggleTimeRulerVisibility;
+
public static String UmlTimingDiagramForMultiEditor_editorOpeningErrorMessage;
+
public static String UmlTimingDiagramForMultiEditor_editorOpeningErrorTitle;
+
public static String ValidateInteractionCommand_ValidateInteraction;
+
public static String ViewUtils_MoveView;
+
public static String CustomTimeRulerCreationEditPolicy_CreateFreeTimeRuler;
+
public static String CustomTimingDiagramCreationEditPolicy_CreateInteraction;
static {
// initialize resource bundle
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/OperationForbiddenException.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/OperationForbiddenException.java
index 40c36fd4a13..8d5c9eddacf 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/OperationForbiddenException.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/OperationForbiddenException.java
@@ -10,6 +10,7 @@ package org.eclipse.papyrus.uml.diagram.timing.custom;
/** An exception indicating that the operation that was asked should not be performed, as it is not allowed. */
public class OperationForbiddenException extends Exception {
+
private static final long serialVersionUID = -4972361328078373414L;
public OperationForbiddenException() {
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/AbstractChangeLifelineTypeCommand.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/AbstractChangeLifelineTypeCommand.java
index 0279a88cf7e..45000ab0f89 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/AbstractChangeLifelineTypeCommand.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/AbstractChangeLifelineTypeCommand.java
@@ -37,9 +37,9 @@ public abstract class AbstractChangeLifelineTypeCommand extends AbstractTransact
* Constructor of this command
*
* @param domain
- * the transactional editing domain to execute the transaction
+ * the transactional editing domain to execute the transaction
* @param lifelineEditPart
- * the editpart that will be transformed
+ * the editpart that will be transformed
* @param changeLifelineFromCompactToFull_commandLabel
*/
public AbstractChangeLifelineTypeCommand(final TransactionalEditingDomain domain, final IGraphicalEditPart lifelineEditPart, final String commandLabel) {
@@ -52,15 +52,15 @@ public abstract class AbstractChangeLifelineTypeCommand extends AbstractTransact
final EditPart parentEditPart = this.lifelineEditPart.getParent();
// creation of the node
final UMLViewProvider umlViewProvider = new UMLViewProvider();
- final Lifeline lifeline = (Lifeline) this.lifelineEditPart.resolveSemanticElement();
+ final Lifeline lifeline = (Lifeline)this.lifelineEditPart.resolveSemanticElement();
final View view = this.lifelineEditPart.getNotationView();
- final View containerView = (View) view.eContainer();
+ final View containerView = (View)view.eContainer();
final int index = containerView.getChildren().indexOf(view);
final Node lifelineNode = createTargetLifelineView(umlViewProvider, lifeline, containerView, index);
- lifelineNode.setLayoutConstraint(((Node) this.lifelineEditPart.getNotationView()).getLayoutConstraint());
+ lifelineNode.setLayoutConstraint(((Node)this.lifelineEditPart.getNotationView()).getLayoutConstraint());
// copy all EAnnotations
final Iterator<EAnnotation> iter = this.lifelineEditPart.getNotationView().getEAnnotations().iterator();
- while (iter.hasNext()) {
+ while(iter.hasNext()) {
final EAnnotation annotation = EcoreUtil.copy(iter.next());
lifelineNode.getEAnnotations().add(annotation);
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/AddOccurrenceSpecificationInCompactLifelineCommand.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/AddOccurrenceSpecificationInCompactLifelineCommand.java
index 2db0f492767..5ffe7ffd3fd 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/AddOccurrenceSpecificationInCompactLifelineCommand.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/AddOccurrenceSpecificationInCompactLifelineCommand.java
@@ -36,39 +36,40 @@ import org.eclipse.uml2.uml.UMLFactory;
/** This command adds an OccurrenceSpecification at a given Location. */
public class AddOccurrenceSpecificationInCompactLifelineCommand extends AbstractTransactionalCommand {
+
private final CompactStateInvariantEditPartCN compactStateInvariantEditPartCN;
+
private final Point location;
+
private final CompactLifelineEditPartCN lifelineEditPart;
+
private final Lifeline lifeline;
/**
* @param fullStateInvariantEditPartCN
- * the state invariant on top of which to put the OccurrenceSpecification
+ * the state invariant on top of which to put the OccurrenceSpecification
* @param location
- * where the user clicked: the horizontal coordinate indicates where to insert the
- * OccurrenceSpecification
+ * where the user clicked: the horizontal coordinate indicates where to insert the
+ * OccurrenceSpecification
*/
public AddOccurrenceSpecificationInCompactLifelineCommand(final CompactStateInvariantEditPartCN compactStateInvariantEditPartCN, final Point location) {
- super(getEditingDomain(compactStateInvariantEditPartCN), Messages.AddOccurrenceSpecificationInCompactLifelineCommand_CreateOccurrenceSpecification,
- null);
+ super(getEditingDomain(compactStateInvariantEditPartCN), Messages.AddOccurrenceSpecificationInCompactLifelineCommand_CreateOccurrenceSpecification, null);
this.compactStateInvariantEditPartCN = compactStateInvariantEditPartCN;
this.location = location;
- this.lifelineEditPart = (CompactLifelineEditPartCN) EditPartUtils.findParentEditPartWithId(this.compactStateInvariantEditPartCN,
- CompactLifelineEditPartCN.VISUAL_ID);
- this.lifeline = (Lifeline) ((View) this.lifelineEditPart.getModel()).getElement();
+ this.lifelineEditPart = (CompactLifelineEditPartCN)EditPartUtils.findParentEditPartWithId(this.compactStateInvariantEditPartCN, CompactLifelineEditPartCN.VISUAL_ID);
+ this.lifeline = (Lifeline)((View)this.lifelineEditPart.getModel()).getElement();
}
private static TransactionalEditingDomain getEditingDomain(final CompactStateInvariantEditPartCN compactStateInvariantEditPart) {
- final StateInvariant stateInvariant = (StateInvariant) ((View) compactStateInvariantEditPart.getModel()).getElement();
+ final StateInvariant stateInvariant = (StateInvariant)((View)compactStateInvariantEditPart.getModel()).getElement();
return TransactionUtil.getEditingDomain(stateInvariant);
}
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final CompactLifelineCompartmentEditPartCN timelineCompartmentEditPart = (CompactLifelineCompartmentEditPartCN) EditPartUtils
- .findFirstChildEditPartWithId(this.lifelineEditPart, CompactLifelineCompartmentEditPartCN.VISUAL_ID);
+ final CompactLifelineCompartmentEditPartCN timelineCompartmentEditPart = (CompactLifelineCompartmentEditPartCN)EditPartUtils.findFirstChildEditPartWithId(this.lifelineEditPart, CompactLifelineCompartmentEditPartCN.VISUAL_ID);
- final View timelineCompartmentView = (View) timelineCompartmentEditPart.getModel();
+ final View timelineCompartmentView = (View)timelineCompartmentEditPart.getModel();
// translate the coordinates
final Point pt = new Point(this.location);
@@ -76,12 +77,11 @@ public class AddOccurrenceSpecificationInCompactLifelineCommand extends Abstract
pt.translate(timelineCompartmentEditPart.getFigure().getBounds().getTopLeft().getNegated());
// find where to insert the OccurrenceSpecification
- final int insertionIndexInCompartment = OccurrenceSpecificationUtils.findInsertionIndexFor(pt, timelineCompartmentView,
- timelineCompartmentEditPart.getViewer());
+ final int insertionIndexInCompartment = OccurrenceSpecificationUtils.findInsertionIndexFor(pt, timelineCompartmentView, timelineCompartmentEditPart.getViewer());
final int insertionIndexInFragments;
final int insertionIndexInCoveredBys;
- if (insertionIndexInCompartment < timelineCompartmentView.getChildren().size()) {
- final View view = (View) timelineCompartmentView.getChildren().get(insertionIndexInCompartment);
+ if(insertionIndexInCompartment < timelineCompartmentView.getChildren().size()) {
+ final View view = (View)timelineCompartmentView.getChildren().get(insertionIndexInCompartment);
final EObject element = view.getElement();
insertionIndexInFragments = this.lifeline.getInteraction().getFragments().indexOf(element);
insertionIndexInCoveredBys = this.lifeline.getCoveredBys().indexOf(element);
@@ -92,12 +92,12 @@ public class AddOccurrenceSpecificationInCompactLifelineCommand extends Abstract
// create the occurrence specification at the right index
final OccurrenceSpecification newOccurrenceSpecification = UMLFactory.eINSTANCE.createOccurrenceSpecification();
- if (insertionIndexInFragments == -1) {
+ if(insertionIndexInFragments == -1) {
this.lifeline.getInteraction().getFragments().add(newOccurrenceSpecification);
} else {
this.lifeline.getInteraction().getFragments().add(insertionIndexInFragments, newOccurrenceSpecification);
}
- if (insertionIndexInCoveredBys == -1) {
+ if(insertionIndexInCoveredBys == -1) {
this.lifeline.getCoveredBys().add(newOccurrenceSpecification);
} else {
this.lifeline.getCoveredBys().add(insertionIndexInCoveredBys, newOccurrenceSpecification);
@@ -106,8 +106,7 @@ public class AddOccurrenceSpecificationInCompactLifelineCommand extends Abstract
// create the View for the occurrence specification
final UMLViewProvider umlViewProvider = new UMLViewProvider();
- final Node occurrenceSpecificationView = umlViewProvider.createOccurrenceSpecification_12(newOccurrenceSpecification, timelineCompartmentView,
- insertionIndexInCompartment, true, PreferencesHint.USE_DEFAULTS);
+ final Node occurrenceSpecificationView = umlViewProvider.createOccurrenceSpecification_12(newOccurrenceSpecification, timelineCompartmentView, insertionIndexInCompartment, true, PreferencesHint.USE_DEFAULTS);
final Location loc = NotationFactory.eINSTANCE.createLocation();
loc.setX(pt.x);
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CreateTickCommand.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CreateTickCommand.java
index 074020c0e99..638957b0d83 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CreateTickCommand.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CreateTickCommand.java
@@ -45,12 +45,11 @@ public class CreateTickCommand extends GraphicalCommandHandler {
protected Command getCommand() throws ExecutionException {
final CompoundCommand cmd = new CompoundCommand(Messages.CreateTickCommand_attachTick);
final ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
- if (!selection.isEmpty() && selection instanceof IStructuredSelection) {
- final IStructuredSelection structSelection = (IStructuredSelection) selection;
- for (final Object object : structSelection.toArray()) {
- if (object instanceof OccurrenceSpecificationEditPartCN || object instanceof MessageOccurrenceSpecificationEditPartCN
- || object instanceof DestructionOccurrenceSpecificationEditPartCN) {
- cmd.add(attachTick((GraphicalEditPart) object));
+ if(!selection.isEmpty() && selection instanceof IStructuredSelection) {
+ final IStructuredSelection structSelection = (IStructuredSelection)selection;
+ for(final Object object : structSelection.toArray()) {
+ if(object instanceof OccurrenceSpecificationEditPartCN || object instanceof MessageOccurrenceSpecificationEditPartCN || object instanceof DestructionOccurrenceSpecificationEditPartCN) {
+ cmd.add(attachTick((GraphicalEditPart)object));
}
}
}
@@ -59,21 +58,22 @@ public class CreateTickCommand extends GraphicalCommandHandler {
private static Command attachTick(final GraphicalEditPart osEditPart) {
final IGraphicalEditPart tickContainer = TimeRulerUtils.findClosestTimeRuler(osEditPart);
- if (tickContainer == null) {
+ if(tickContainer == null) {
Activator.log.error("No tick container found", new Exception()); //$NON-NLS-1$
return UnexecutableCommand.INSTANCE;
}
- final View tickContainerView = (View) tickContainer.getModel();
+ final View tickContainerView = (View)tickContainer.getModel();
final TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(osEditPart.getEditingDomain());
- final Node osView = (Node) osEditPart.getModel();
- final OccurrenceSpecification os = (OccurrenceSpecification) osView.getElement();
+ final Node osView = (Node)osEditPart.getModel();
+ final OccurrenceSpecification os = (OccurrenceSpecification)osView.getElement();
// if the Lifeline or Interaction compartment already contains a tick for this occurrence,
// then don't let a duplicate be created
- if (TickUtils.containsTickFor(tickContainerView, os)) {
+ if(TickUtils.containsTickFor(tickContainerView, os)) {
return UnexecutableCommand.INSTANCE;
}
final AbstractTransactionalCommand createTickCommand = new AbstractTransactionalCommand(editingDomain, Messages.CreateTickCommand_CreateTick, null) {
+
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
final UMLViewProvider umlViewProvider = new UMLViewProvider();
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomDurationConstraintCreateCommand.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomDurationConstraintCreateCommand.java
index cc0d371d2ba..c7bb7f9abb5 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomDurationConstraintCreateCommand.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomDurationConstraintCreateCommand.java
@@ -39,23 +39,23 @@ public class CustomDurationConstraintCreateCommand extends EditElementCommand {
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final CreateElementRequest request = (CreateElementRequest) getRequest();
- final EditPart firstTarget = (EditPart) request.getParameter(AbstractTwoPointCreationTool.FIRST_TARGET);
- final EditPart secondTarget = (EditPart) request.getParameter(AbstractTwoPointCreationTool.SECOND_TARGET);
+ final CreateElementRequest request = (CreateElementRequest)getRequest();
+ final EditPart firstTarget = (EditPart)request.getParameter(AbstractTwoPointCreationTool.FIRST_TARGET);
+ final EditPart secondTarget = (EditPart)request.getParameter(AbstractTwoPointCreationTool.SECOND_TARGET);
final DurationConstraint durationConstraint = UMLFactory.eINSTANCE.createDurationConstraint();
- final NamedElement firstTargetElement = (NamedElement) ((View) firstTarget.getModel()).getElement();
- final NamedElement secondTargetElement = (NamedElement) ((View) secondTarget.getModel()).getElement();
+ final NamedElement firstTargetElement = (NamedElement)((View)firstTarget.getModel()).getElement();
+ final NamedElement secondTargetElement = (NamedElement)((View)secondTarget.getModel()).getElement();
final Package containingPackage = EcoreUtils.getContaining(request.getContainer(), Package.class);
- if (containingPackage == null) {
+ if(containingPackage == null) {
return CommandResult.newErrorCommandResult("The container must be in a Package"); //$NON-NLS-1$
}
containingPackage.getPackagedElements().add(durationConstraint);
durationConstraint.getConstrainedElements().clear();
durationConstraint.getFirstEvents().clear();
- if (firstTargetElement == secondTargetElement) {
+ if(firstTargetElement == secondTargetElement) {
durationConstraint.getConstrainedElements().add(firstTargetElement);
} else {
durationConstraint.getConstrainedElements().add(firstTargetElement);
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomDurationObservationCreateCommand.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomDurationObservationCreateCommand.java
index 71812171bd3..ef85b9bd198 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomDurationObservationCreateCommand.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomDurationObservationCreateCommand.java
@@ -36,23 +36,23 @@ public class CustomDurationObservationCreateCommand extends EditElementCommand {
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final CreateElementRequest request = (CreateElementRequest) getRequest();
- final EditPart firstTarget = (EditPart) request.getParameter(AbstractTwoPointCreationTool.FIRST_TARGET);
- final EditPart secondTarget = (EditPart) request.getParameter(AbstractTwoPointCreationTool.SECOND_TARGET);
+ final CreateElementRequest request = (CreateElementRequest)getRequest();
+ final EditPart firstTarget = (EditPart)request.getParameter(AbstractTwoPointCreationTool.FIRST_TARGET);
+ final EditPart secondTarget = (EditPart)request.getParameter(AbstractTwoPointCreationTool.SECOND_TARGET);
final DurationObservation durationObservation = UMLFactory.eINSTANCE.createDurationObservation();
- final NamedElement firstTargetElement = (NamedElement) ((View) firstTarget.getModel()).getElement();
- final NamedElement secondTargetElement = (NamedElement) ((View) secondTarget.getModel()).getElement();
+ final NamedElement firstTargetElement = (NamedElement)((View)firstTarget.getModel()).getElement();
+ final NamedElement secondTargetElement = (NamedElement)((View)secondTarget.getModel()).getElement();
final Package containingPackage = EcoreUtils.getContaining(request.getContainer(), Package.class);
- if (containingPackage == null) {
+ if(containingPackage == null) {
return CommandResult.newErrorCommandResult("The container must be in a Package"); //$NON-NLS-1$
}
containingPackage.getPackagedElements().add(durationObservation);
durationObservation.getEvents().clear();
durationObservation.getFirstEvents().clear();
- if (firstTargetElement == secondTargetElement) {
+ if(firstTargetElement == secondTargetElement) {
durationObservation.getEvents().add(firstTargetElement);
} else {
durationObservation.getEvents().add(firstTargetElement);
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomGeneralOrderingCreateCommand.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomGeneralOrderingCreateCommand.java
index 5c34f5e06ac..4a9dc0661dc 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomGeneralOrderingCreateCommand.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomGeneralOrderingCreateCommand.java
@@ -34,13 +34,13 @@ public class CustomGeneralOrderingCreateCommand extends EditElementCommand {
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final CreateElementRequest request = (CreateElementRequest) getRequest();
- final EditPart firstTarget = (EditPart) request.getParameter(AbstractTwoPointCreationTool.FIRST_TARGET);
- final EditPart secondTarget = (EditPart) request.getParameter(AbstractTwoPointCreationTool.SECOND_TARGET);
+ final CreateElementRequest request = (CreateElementRequest)getRequest();
+ final EditPart firstTarget = (EditPart)request.getParameter(AbstractTwoPointCreationTool.FIRST_TARGET);
+ final EditPart secondTarget = (EditPart)request.getParameter(AbstractTwoPointCreationTool.SECOND_TARGET);
final GeneralOrdering generalOrdering = UMLFactory.eINSTANCE.createGeneralOrdering();
- final OccurrenceSpecification beforeOccurrence = (OccurrenceSpecification) ((View) firstTarget.getModel()).getElement();
- final OccurrenceSpecification afterOccurrence = (OccurrenceSpecification) ((View) secondTarget.getModel()).getElement();
+ final OccurrenceSpecification beforeOccurrence = (OccurrenceSpecification)((View)firstTarget.getModel()).getElement();
+ final OccurrenceSpecification afterOccurrence = (OccurrenceSpecification)((View)secondTarget.getModel()).getElement();
beforeOccurrence.getGeneralOrderings().add(generalOrdering);
generalOrdering.setBefore(beforeOccurrence);
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomMessageCreateCommand.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomMessageCreateCommand.java
index af6a8cd7782..567b3ebfe8b 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomMessageCreateCommand.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomMessageCreateCommand.java
@@ -37,9 +37,13 @@ import org.eclipse.uml2.uml.UMLFactory;
public class CustomMessageCreateCommand extends EditElementCommand {
private final Interaction interaction;
+
private final EObject source;
+
private final EObject target;
+
private final MessageKind messageKind;
+
private final MessageSort messageSort;
public CustomMessageCreateCommand(final CreateRelationshipRequest request) {
@@ -53,38 +57,38 @@ public class CustomMessageCreateCommand extends EditElementCommand {
@Override
public boolean canExecute() {
- if (this.source == null && this.target == null) {
+ if(this.source == null && this.target == null) {
return false;
}
// no create or destroy Message to a Gate
- if (this.target instanceof Gate && (this.messageSort == MessageSort.CREATE_MESSAGE_LITERAL || this.messageSort == MessageSort.DELETE_MESSAGE_LITERAL)) {
+ if(this.target instanceof Gate && (this.messageSort == MessageSort.CREATE_MESSAGE_LITERAL || this.messageSort == MessageSort.DELETE_MESSAGE_LITERAL)) {
return false;
}
// no create message can target a destruction
- if (this.messageSort == MessageSort.CREATE_MESSAGE_LITERAL && this.target instanceof DestructionOccurrenceSpecification) {
+ if(this.messageSort == MessageSort.CREATE_MESSAGE_LITERAL && this.target instanceof DestructionOccurrenceSpecification) {
return false;
}
- if (this.messageKind == MessageKind.FOUND_LITERAL) {
- if (this.source != null && !(this.source instanceof Lifeline)) {
+ if(this.messageKind == MessageKind.FOUND_LITERAL) {
+ if(this.source != null && !(this.source instanceof Lifeline)) {
return false;
}
- } else if (this.source != null && !(MessageUtils.isPotentialMessageEnd(this.source))) {
+ } else if(this.source != null && !(MessageUtils.isPotentialMessageEnd(this.source))) {
return false;
}
- if (this.messageKind == MessageKind.LOST_LITERAL) {
- if (this.target != null && !(this.target instanceof Lifeline)) {
+ if(this.messageKind == MessageKind.LOST_LITERAL) {
+ if(this.target != null && !(this.target instanceof Lifeline)) {
return false;
}
- } else if (this.target != null && !(MessageUtils.isPotentialMessageEnd(this.target))) {
+ } else if(this.target != null && !(MessageUtils.isPotentialMessageEnd(this.target))) {
return false;
}
- if (this.source == null) {
+ if(this.source == null) {
return true; // link creation is in progress; source is not defined yet
}
- if (this.interaction == null) {
+ if(this.interaction == null) {
return false;
}
return true;
@@ -92,28 +96,26 @@ public class CustomMessageCreateCommand extends EditElementCommand {
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- if (!canExecute()) {
+ if(!canExecute()) {
throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
}
final boolean destruction = this.messageSort == MessageSort.DELETE_MESSAGE_LITERAL;
final boolean creation = this.messageSort == MessageSort.CREATE_MESSAGE_LITERAL;
- if (destruction) {
- OccurrenceSpecificationUtils.deleteEverythingAfter((OccurrenceSpecification) this.target, null);
+ if(destruction) {
+ OccurrenceSpecificationUtils.deleteEverythingAfter((OccurrenceSpecification)this.target, null);
}
- if (creation) {
- OccurrenceSpecificationUtils.deleteEverythingBefore((OccurrenceSpecification) this.target, null);
+ if(creation) {
+ OccurrenceSpecificationUtils.deleteEverythingBefore((OccurrenceSpecification)this.target, null);
}
// a "found" message comes from nowhere
- final MessageEnd messageSource = this.messageKind == MessageKind.FOUND_LITERAL ? null : MessageUtils.convertToMessageOccurrenceSpecification(
- this.source, false);
+ final MessageEnd messageSource = this.messageKind == MessageKind.FOUND_LITERAL ? null : MessageUtils.convertToMessageOccurrenceSpecification(this.source, false);
// a "lost" message goes to nowhere
- final MessageEnd messageTarget = this.messageKind == MessageKind.LOST_LITERAL ? null : MessageUtils.convertToMessageOccurrenceSpecification(
- this.target, destruction);
+ final MessageEnd messageTarget = this.messageKind == MessageKind.LOST_LITERAL ? null : MessageUtils.convertToMessageOccurrenceSpecification(this.target, destruction);
- if (!MessageUtils.isValidMessage(this.messageSort, this.messageKind, messageSource, messageTarget)) {
+ if(!MessageUtils.isValidMessage(this.messageSort, this.messageKind, messageSource, messageTarget)) {
throw new ExecutionException("Invalid Message"); //$NON-NLS-1$
}
@@ -124,7 +126,7 @@ public class CustomMessageCreateCommand extends EditElementCommand {
newMessage.setMessageSort(this.messageSort);
newMessage.setName(""); //$NON-NLS-1$
- ((CreateElementRequest) getRequest()).setNewElement(newMessage);
+ ((CreateElementRequest)getRequest()).setNewElement(newMessage);
return CommandResult.newOKCommandResult(newMessage);
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomMessageReorientCommand.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomMessageReorientCommand.java
index 3bcb15cdac6..27d6f58fc78 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomMessageReorientCommand.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomMessageReorientCommand.java
@@ -38,7 +38,9 @@ import org.eclipse.uml2.uml.OccurrenceSpecification;
public class CustomMessageReorientCommand extends EditElementCommand {
private final int reorientDirection;
+
private final EObject newEnd;
+
private final EditPartViewer viewer;
public CustomMessageReorientCommand(final ReorientRelationshipRequest request, final EditPartViewer viewer) {
@@ -50,14 +52,14 @@ public class CustomMessageReorientCommand extends EditElementCommand {
@Override
public boolean canExecute() {
- if (!(getElementToEdit() instanceof Message)) {
+ if(!(getElementToEdit() instanceof Message)) {
return false;
}
- final Message message = (Message) getElementToEdit();
+ final Message message = (Message)getElementToEdit();
final EObject source;
final EObject target;
- if (this.reorientDirection == ReorientRequest.REORIENT_SOURCE) {
+ if(this.reorientDirection == ReorientRequest.REORIENT_SOURCE) {
source = this.newEnd;
target = message.getReceiveEvent();
} else {
@@ -71,36 +73,36 @@ public class CustomMessageReorientCommand extends EditElementCommand {
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- if (!canExecute()) {
+ if(!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
final boolean reorientSource = this.reorientDirection == ReorientRequest.REORIENT_SOURCE;
final boolean reorientTarget = this.reorientDirection == ReorientRequest.REORIENT_TARGET;
- final Message message = (Message) getElementToEdit();
+ final Message message = (Message)getElementToEdit();
final boolean destruction = reorientTarget && message.getMessageSort() == MessageSort.DELETE_MESSAGE_LITERAL;
final boolean creation = reorientTarget && message.getMessageSort() == MessageSort.CREATE_MESSAGE_LITERAL;
final MessageEnd newMessageEnd = MessageUtils.convertToMessageOccurrenceSpecification(this.newEnd, destruction);
- if (reorientSource) {
+ if(reorientSource) {
message.setSendEvent(newMessageEnd);
- } else if (reorientTarget) {
+ } else if(reorientTarget) {
message.setReceiveEvent(newMessageEnd);
}
- if (destruction || creation) {
+ if(destruction || creation) {
// save the parent View while the message is still in it
final Set<View> parentInteractionViews = findParentInteractionViews(newMessageEnd);
// destroying the old target of the message will also delete the Message View
- if (destruction) {
- OccurrenceSpecificationUtils.deleteEverythingAfter((OccurrenceSpecification) newMessageEnd, null);
+ if(destruction) {
+ OccurrenceSpecificationUtils.deleteEverythingAfter((OccurrenceSpecification)newMessageEnd, null);
}
- if (creation) {
- OccurrenceSpecificationUtils.deleteEverythingBefore((OccurrenceSpecification) newMessageEnd, null);
+ if(creation) {
+ OccurrenceSpecificationUtils.deleteEverythingBefore((OccurrenceSpecification)newMessageEnd, null);
}
// re-create the Message View that was deleted by GMF
- for (final View parentInteractionView : parentInteractionViews) {
+ for(final View parentInteractionView : parentInteractionViews) {
DropUtils.getDropMessageCommand(message, parentInteractionView, this.viewer).execute(new NullProgressMonitor(), null);
}
}
@@ -111,9 +113,9 @@ public class CustomMessageReorientCommand extends EditElementCommand {
private Set<View> findParentInteractionViews(final EObject eObject) {
final List<View> views = DiagramEditPartsUtil.findViews(eObject, this.viewer);
final Set<View> interactionViews = new HashSet<View>();
- for (final View view : views) {
+ for(final View view : views) {
final View interactionView = ViewUtils.findSuperViewWithId(view, InteractionEditPartTN.VISUAL_ID);
- if (interactionView != null) {
+ if(interactionView != null) {
interactionViews.add(interactionView);
}
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomTimeConstraintCreateCommand.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomTimeConstraintCreateCommand.java
index c9a2785295e..1cce0cd04f0 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomTimeConstraintCreateCommand.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomTimeConstraintCreateCommand.java
@@ -41,18 +41,18 @@ public class CustomTimeConstraintCreateCommand extends EditElementCommand {
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
final TimeConstraint timeConstraint = UMLFactory.eINSTANCE.createTimeConstraint();
- final CreateElementRequest request = (CreateElementRequest) getRequest();
- final EditPart originalTarget = (EditPart) request.getParameter(CustomPaletteFactory.ORIGINAL_TARGET);
- final NamedElement targetElement = (NamedElement) ((View) originalTarget.getModel()).getElement();
+ final CreateElementRequest request = (CreateElementRequest)getRequest();
+ final EditPart originalTarget = (EditPart)request.getParameter(CustomPaletteFactory.ORIGINAL_TARGET);
+ final NamedElement targetElement = (NamedElement)((View)originalTarget.getModel()).getElement();
// TODO: firstEvent depending on the click location relative to the originalTarget EditPart figure
final Package containingPackage = EcoreUtils.getContaining(request.getContainer(), Package.class);
- if (containingPackage == null) {
+ if(containingPackage == null) {
return CommandResult.newErrorCommandResult("The container must be in a Package"); //$NON-NLS-1$
}
final Interaction containingInteraction = EcoreUtils.getContaining(request.getContainer(), Interaction.class);
- if (containingInteraction == null) {
+ if(containingInteraction == null) {
return CommandResult.newErrorCommandResult("The container must be in an Interaction"); //$NON-NLS-1$
}
@@ -77,7 +77,7 @@ public class CustomTimeConstraintCreateCommand extends EditElementCommand {
minExpr.setValue("t1"); //$NON-NLS-1$
maxExpr.setValue("t2"); //$NON-NLS-1$
- ((CreateElementRequest) getRequest()).setNewElement(timeConstraint);
+ ((CreateElementRequest)getRequest()).setNewElement(timeConstraint);
return CommandResult.newOKCommandResult(timeConstraint);
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomTimeObservationCreateCommand.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomTimeObservationCreateCommand.java
index 7940b48ed69..e0bc540df0d 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomTimeObservationCreateCommand.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomTimeObservationCreateCommand.java
@@ -37,19 +37,19 @@ public class CustomTimeObservationCreateCommand extends EditElementCommand {
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
final TimeObservation timeObservation = UMLFactory.eINSTANCE.createTimeObservation();
- final CreateElementRequest request = (CreateElementRequest) getRequest();
- final EditPart originalTarget = (EditPart) request.getParameter(CustomPaletteFactory.ORIGINAL_TARGET);
- final NamedElement targetElement = (NamedElement) ((View) originalTarget.getModel()).getElement();
+ final CreateElementRequest request = (CreateElementRequest)getRequest();
+ final EditPart originalTarget = (EditPart)request.getParameter(CustomPaletteFactory.ORIGINAL_TARGET);
+ final NamedElement targetElement = (NamedElement)((View)originalTarget.getModel()).getElement();
// TODO: firstEvent depending on the click location relative to the originalTarget EditPart figure
final Package containingPackage = EcoreUtils.getContaining(request.getContainer(), Package.class);
- if (containingPackage == null) {
+ if(containingPackage == null) {
return CommandResult.newErrorCommandResult("The container must be in a Package"); //$NON-NLS-1$
}
containingPackage.getPackagedElements().add(timeObservation);
timeObservation.setEvent(targetElement);
- ((CreateElementRequest) getRequest()).setNewElement(timeObservation);
+ ((CreateElementRequest)getRequest()).setNewElement(timeObservation);
return CommandResult.newOKCommandResult(timeObservation);
}
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/DeleteStateDefinitionCommand.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/DeleteStateDefinitionCommand.java
index 1753111e906..2e06ea6c57d 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/DeleteStateDefinitionCommand.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/DeleteStateDefinitionCommand.java
@@ -26,15 +26,16 @@ import org.eclipse.uml2.uml.Lifeline;
public class DeleteStateDefinitionCommand extends AbstractTransactionalCommand {
private final String id;
+
private final Lifeline lifeline;
/**
* @param id
- * the id of the state definition to delete
+ * the id of the state definition to delete
* @param lifeline
- * the lifeline
+ * the lifeline
* @param domain
- * the editing domain
+ * the editing domain
*/
public DeleteStateDefinitionCommand(final String id, final Lifeline lifeline, final TransactionalEditingDomain domain) {
super(domain, Messages.DeleteStateDefinitionCommand_DeleteStateDefinition, null);
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/RefreshCommandForUndo.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/RefreshCommandForUndo.java
index 2c2ac1bf28b..8fafa31ecb0 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/RefreshCommandForUndo.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/RefreshCommandForUndo.java
@@ -10,7 +10,6 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands;
-import org.eclipse.draw2d.IFigure;
import org.eclipse.gef.GraphicalEditPart;
/**
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/SwitchLifelineCommand.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/SwitchLifelineCommand.java
index 8ab9fcef2ee..885f22fc316 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/SwitchLifelineCommand.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/SwitchLifelineCommand.java
@@ -77,10 +77,10 @@ public class SwitchLifelineCommand extends GraphicalCommandHandler {
private Command switchLifeline(final IGraphicalEditPart lifelineEditPart) {
final EditPartViewer viewer = lifelineEditPart.getViewer();
- final View lifelineView = (View) lifelineEditPart.getModel();
+ final View lifelineView = (View)lifelineEditPart.getModel();
final View timeRulerCompartmentView = ViewUtils.findTimeRulerCompartmentView(lifelineView);
final boolean timeRulerVisible = timeRulerCompartmentView.isVisible();
- final Lifeline lifeline = (Lifeline) lifelineView.getElement();
+ final Lifeline lifeline = (Lifeline)lifelineView.getElement();
final CompoundCommand cc = new CompoundCommand(Messages.SwitchLifelineCommand_switchLifeline);
// we need to re-associate ticks in the Interaction time ruler to their new OccurrenceSpecification Views
@@ -88,8 +88,8 @@ public class SwitchLifelineCommand extends GraphicalCommandHandler {
// we need to re-create ticks in the Lifeline time ruler (since they get destroyed when destroying the Lifeline)
final Map<OccurrenceSpecification, String> lifelineTicksAssociations = computeLifelineTicksAssociations(lifelineView);
- if (lifelineEditPart instanceof CompactLifelineEditPartCN) {
- cc.add(new RefreshCommandForUndo((GraphicalEditPart) lifelineEditPart.getParent()));
+ if(lifelineEditPart instanceof CompactLifelineEditPartCN) {
+ cc.add(new RefreshCommandForUndo((GraphicalEditPart)lifelineEditPart.getParent()));
cc.add(new ICommandProxy(getNameUnnamedStateInvariants(lifeline)));
final ICommand createCommand = new ChangeLifelineFromCompactToFull(getEditingDomain(), lifelineEditPart);
cc.add(new ICommandProxy(createCommand));
@@ -100,13 +100,13 @@ public class SwitchLifelineCommand extends GraphicalCommandHandler {
cc.add(new ICommandProxy(getLifelineTicksCreationCommand(createCommand, lifelineTicksAssociations)));
addDestroyViewsAndEdgesRecursivelyCommand(cc, lifelineView);
// we need to create the EditParts corresponding to the MessageEnd Views before trying to reconnect Messages
- cc.add(new RefreshCommandForDo((GraphicalEditPart) lifelineEditPart.getParent()));
+ cc.add(new RefreshCommandForDo((GraphicalEditPart)lifelineEditPart.getParent()));
cc.add(new ICommandProxy(getMessagesCreationCommand(createCommand, viewer)));
cc.add(new ICommandProxy(getLinkedElementsCreationCommand(createCommand, viewer)));
- cc.add(new RefreshCommandForDo((GraphicalEditPart) lifelineEditPart.getParent()));
+ cc.add(new RefreshCommandForDo((GraphicalEditPart)lifelineEditPart.getParent()));
return cc;
- } else if (lifelineEditPart instanceof FullLifelineEditPartCN) {
- cc.add(new RefreshCommandForUndo((GraphicalEditPart) lifelineEditPart.getParent()));
+ } else if(lifelineEditPart instanceof FullLifelineEditPartCN) {
+ cc.add(new RefreshCommandForUndo((GraphicalEditPart)lifelineEditPart.getParent()));
final ICommand createCommand = new ChangeLifelineFromFullToCompact(getEditingDomain(), lifelineEditPart);
cc.add(new ICommandProxy(createCommand));
cc.add(new ICommandProxy(getFreeTimeRulerCreationCommand(createCommand, timeRulerVisible)));
@@ -115,10 +115,10 @@ public class SwitchLifelineCommand extends GraphicalCommandHandler {
cc.add(new ICommandProxy(getLifelineTicksCreationCommand(createCommand, lifelineTicksAssociations)));
addDestroyViewsAndEdgesRecursivelyCommand(cc, lifelineView);
// we need to create the EditParts corresponding to the MessageEnd Views before trying to reconnect Messages
- cc.add(new RefreshCommandForDo((GraphicalEditPart) lifelineEditPart.getParent()));
+ cc.add(new RefreshCommandForDo((GraphicalEditPart)lifelineEditPart.getParent()));
cc.add(new ICommandProxy(getMessagesCreationCommand(createCommand, viewer)));
cc.add(new ICommandProxy(getLinkedElementsCreationCommand(createCommand, viewer)));
- cc.add(new RefreshCommandForDo((GraphicalEditPart) lifelineEditPart.getParent()));
+ cc.add(new RefreshCommandForDo((GraphicalEditPart)lifelineEditPart.getParent()));
return cc;
}
throw new IllegalArgumentException("expected a Lifeline edit part"); //$NON-NLS-1$
@@ -130,9 +130,9 @@ public class SwitchLifelineCommand extends GraphicalCommandHandler {
final View timelineCompartmentView = ViewUtils.findChildTimelineCompartmentView(lifelineView);
@SuppressWarnings("unchecked")
final EList<View> children = timelineCompartmentView.getChildren();
- for (final View child : children) {
- if (ViewUtils.isViewFor(child, UMLPackage.eINSTANCE.getOccurrenceSpecification())) {
- final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification) child.getElement();
+ for(final View child : children) {
+ if(ViewUtils.isViewFor(child, UMLPackage.eINSTANCE.getOccurrenceSpecification())) {
+ final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification)child.getElement();
final List<Node> associatedTickViews = TickUtils.getAssociatedTickViews(child);
map.put(occurrenceSpecification, associatedTickViews);
}
@@ -151,9 +151,9 @@ public class SwitchLifelineCommand extends GraphicalCommandHandler {
final View timeRulerCompartment = ViewUtils.findFirstChildViewWithId(lifelineView, FreeTimeRulerCompartmentEditPart.VISUAL_ID);
@SuppressWarnings("unchecked")
final EList<View> children = timeRulerCompartment.getChildren();
- for (final View tickView : children) {
+ for(final View tickView : children) {
final Node associatedOccurrenceView = TickUtils.getAssociatedOccurrenceView(tickView);
- final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification) associatedOccurrenceView.getElement();
+ final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification)associatedOccurrenceView.getElement();
final String description = getTickLabelDescription(tickView);
map.put(occurrenceSpecification, description);
}
@@ -162,12 +162,12 @@ public class SwitchLifelineCommand extends GraphicalCommandHandler {
protected static void setTickLabelDescription(final Node tickNode, final String tickName) {
final View labelView = ViewUtils.findFirstChildViewWithId(tickNode, TickNameEditPart.VISUAL_ID);
- if (labelView != null) {
+ if(labelView != null) {
@SuppressWarnings("unchecked")
final EList<Style> styles = labelView.getStyles();
- for (final Object style : styles) {
- if (style instanceof DescriptionStyle) {
- final DescriptionStyle descriptionStyle = (DescriptionStyle) style;
+ for(final Object style : styles) {
+ if(style instanceof DescriptionStyle) {
+ final DescriptionStyle descriptionStyle = (DescriptionStyle)style;
descriptionStyle.setDescription(tickName);
}
}
@@ -176,12 +176,12 @@ public class SwitchLifelineCommand extends GraphicalCommandHandler {
private static String getTickLabelDescription(final View tickView) {
final View labelView = ViewUtils.findFirstChildViewWithId(tickView, TickNameEditPart.VISUAL_ID);
- if (labelView != null) {
+ if(labelView != null) {
@SuppressWarnings("unchecked")
final EList<Style> styles = labelView.getStyles();
- for (final Object style : styles) {
- if (style instanceof DescriptionStyle) {
- final DescriptionStyle descriptionStyle = (DescriptionStyle) style;
+ for(final Object style : styles) {
+ if(style instanceof DescriptionStyle) {
+ final DescriptionStyle descriptionStyle = (DescriptionStyle)style;
return descriptionStyle.getDescription();
}
}
@@ -192,22 +192,23 @@ public class SwitchLifelineCommand extends GraphicalCommandHandler {
/** Re-associates Interaction time ruler ticks to their new OccurrenceSpecification Views. */
private ICommand getTicksAssociationCommand(final ICommand createCommand, final Map<OccurrenceSpecification, List<Node>> ticksAssociations) {
return new AbstractTransactionalCommand(getEditingDomain(), Messages.SwitchLifelineCommand_ReAssociateTicks, null, null) {
+
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final View lifelineView = (View) createCommand.getCommandResult().getReturnValue();
- if (lifelineView == null) {
+ final View lifelineView = (View)createCommand.getCommandResult().getReturnValue();
+ if(lifelineView == null) {
return CommandResult.newErrorCommandResult("Parent Lifeline not found"); //$NON-NLS-1$
}
final View timelineCompartmentView = ViewUtils.findChildTimelineCompartmentView(lifelineView);
@SuppressWarnings("unchecked")
final EList<View> children = timelineCompartmentView.getChildren();
- for (final View child : children) {
- if (ViewUtils.isViewFor(child, UMLPackage.eINSTANCE.getOccurrenceSpecification())) {
- final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification) child.getElement();
+ for(final View child : children) {
+ if(ViewUtils.isViewFor(child, UMLPackage.eINSTANCE.getOccurrenceSpecification())) {
+ final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification)child.getElement();
final List<Node> tickNodes = ticksAssociations.get(occurrenceSpecification);
- if (tickNodes != null) {
- for (final Node tickNode : tickNodes) {
- TickUtils.associateTickNodeToOccurrenceNode(tickNode, (Node) child, true);
+ if(tickNodes != null) {
+ for(final Node tickNode : tickNodes) {
+ TickUtils.associateTickNodeToOccurrenceNode(tickNode, (Node)child, true);
}
}
}
@@ -220,22 +221,22 @@ public class SwitchLifelineCommand extends GraphicalCommandHandler {
/** Re-creates Lifeline time ruler ticks, and associate them to their new OccurrenceSpecification Views. */
private ICommand getLifelineTicksCreationCommand(final ICommand createCommand, final Map<OccurrenceSpecification, String> lifelineTicksAssociations) {
return new AbstractTransactionalCommand(getEditingDomain(), Messages.SwitchLifelineCommand_ReAssociateTicks, null, null) {
+
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final View lifelineView = (View) createCommand.getCommandResult().getReturnValue();
- if (lifelineView == null) {
+ final View lifelineView = (View)createCommand.getCommandResult().getReturnValue();
+ if(lifelineView == null) {
return CommandResult.newErrorCommandResult("Parent Lifeline not found"); //$NON-NLS-1$
}
final View timeRulerCompartment = ViewUtils.findFirstChildViewWithId(lifelineView, FreeTimeRulerCompartmentEditPart.VISUAL_ID);
final View timelineCompartmentView = ViewUtils.findChildTimelineCompartmentView(lifelineView);
final UMLViewProvider umlViewProvider = new UMLViewProvider();
- for (final Entry<OccurrenceSpecification, String> entry : lifelineTicksAssociations.entrySet()) {
+ for(final Entry<OccurrenceSpecification, String> entry : lifelineTicksAssociations.entrySet()) {
final OccurrenceSpecification occurrenceSpecification = entry.getKey();
final Node occurrenceView = findOccurrenceView(occurrenceSpecification, timelineCompartmentView);
final String tickName = entry.getValue();
- final Node tickNode = umlViewProvider.createNode_26(null, timeRulerCompartment, ViewUtil.APPEND, true,
- UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
+ final Node tickNode = umlViewProvider.createNode_26(null, timeRulerCompartment, ViewUtil.APPEND, true, UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
setTickLabelDescription(tickNode, tickName);
TickUtils.associateTickNodeToOccurrenceNode(tickNode, occurrenceView, false);
}
@@ -248,9 +249,9 @@ public class SwitchLifelineCommand extends GraphicalCommandHandler {
protected static Node findOccurrenceView(final OccurrenceSpecification occurrenceSpecification, final View timelineCompartmentView) {
@SuppressWarnings("unchecked")
final EList<View> children = timelineCompartmentView.getChildren();
- for (final View child : children) {
- if (child.getElement() == occurrenceSpecification) {
- return (Node) child;
+ for(final View child : children) {
+ if(child.getElement() == occurrenceSpecification) {
+ return (Node)child;
}
}
return null;
@@ -262,20 +263,21 @@ public class SwitchLifelineCommand extends GraphicalCommandHandler {
*/
private ICommand getNameUnnamedStateInvariants(final Lifeline lifeline) {
return new AbstractTransactionalCommand(getEditingDomain(), Messages.SwitchLifelineCommand_NameUnnamedStateInvariants, null, null) {
+
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
final EList<InteractionFragment> coveredBys = lifeline.getCoveredBys();
boolean containsUnnamedStateInvariants = false;
- for (final InteractionFragment interactionFragment : coveredBys) {
- if (interactionFragment instanceof StateInvariant) {
- final StateInvariant stateInvariant = (StateInvariant) interactionFragment;
- if (StateInvariantUtils.getInnerStateInvariantName(stateInvariant) == null) {
+ for(final InteractionFragment interactionFragment : coveredBys) {
+ if(interactionFragment instanceof StateInvariant) {
+ final StateInvariant stateInvariant = (StateInvariant)interactionFragment;
+ if(StateInvariantUtils.getInnerStateInvariantName(stateInvariant) == null) {
containsUnnamedStateInvariants = true;
StateInvariantUtils.setInnerStateInvariantName(stateInvariant, Messages.SwitchLifelineCommand_unnamed);
}
}
}
- if (containsUnnamedStateInvariants) {
+ if(containsUnnamedStateInvariants) {
StateDefinitionUtils.updateStateDefinitionNamesForCompactLifeline(lifeline);
}
return CommandResult.newOKCommandResult();
@@ -286,17 +288,17 @@ public class SwitchLifelineCommand extends GraphicalCommandHandler {
private static void addDestroyViewsAndEdgesRecursivelyCommand(final CompoundCommand cc, final View view) {
@SuppressWarnings("unchecked")
final EList<View> children = view.getChildren();
- for (final View childView : children) {
+ for(final View childView : children) {
addDestroyViewsAndEdgesRecursivelyCommand(cc, childView);
}
@SuppressWarnings("unchecked")
final EList<Edge> sourceEdges = view.getSourceEdges();
@SuppressWarnings("unchecked")
final EList<Edge> targetEdges = view.getTargetEdges();
- for (final Edge edge : sourceEdges) {
+ for(final Edge edge : sourceEdges) {
cc.add(new ICommandProxy(new DestroyElementCommand(new DestroyElementRequest(edge, false))));
}
- for (final Edge edge : targetEdges) {
+ for(final Edge edge : targetEdges) {
cc.add(new ICommandProxy(new DestroyElementCommand(new DestroyElementRequest(edge, false))));
}
cc.add(new ICommandProxy(new DestroyElementCommand(new DestroyElementRequest(view, false))));
@@ -305,25 +307,26 @@ public class SwitchLifelineCommand extends GraphicalCommandHandler {
private ICommand getMessagesCreationCommand(final ICommand createCommand, final EditPartViewer viewer) {
return new AbstractTransactionalCommand(getEditingDomain(), Messages.SwitchLifelineCommand_createMessages, null, null) {
+
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final View lifelineView = (View) createCommand.getCommandResult().getReturnValue();
- if (lifelineView == null) {
+ final View lifelineView = (View)createCommand.getCommandResult().getReturnValue();
+ if(lifelineView == null) {
return CommandResult.newErrorCommandResult("Parent Lifeline not found"); //$NON-NLS-1$
}
- final Lifeline lifeline = (Lifeline) lifelineView.getElement();
+ final Lifeline lifeline = (Lifeline)lifelineView.getElement();
// find Messages linked to fragments in the Lifeline
- final EReference[] references = new EReference[] { UMLPackage.eINSTANCE.getMessage_ReceiveEvent(), UMLPackage.eINSTANCE.getMessage_SendEvent() };
- final Class<?>[] expectedClasses = new Class<?>[] { Message.class };
+ final EReference[] references = new EReference[]{ UMLPackage.eINSTANCE.getMessage_ReceiveEvent(), UMLPackage.eINSTANCE.getMessage_SendEvent() };
+ final Class<?>[] expectedClasses = new Class<?>[]{ Message.class };
final EList<InteractionFragment> coveredBys = lifeline.getCoveredBys();
final Set<EObject> referencingElements = new HashSet<EObject>();
- for (final InteractionFragment interactionFragment : coveredBys) {
+ for(final InteractionFragment interactionFragment : coveredBys) {
referencingElements.addAll(Utils.findReferencingElements(interactionFragment, references, expectedClasses));
}
// drop the Messages
- for (final EObject referencingElement : referencingElements) {
- final Message referencingMessage = (Message) referencingElement;
+ for(final EObject referencingElement : referencingElements) {
+ final Message referencingMessage = (Message)referencingElement;
executeCommand(DropUtils.getDropMessageCommand(referencingMessage, lifelineView, viewer));
}
return CommandResult.newOKCommandResult();
@@ -333,43 +336,41 @@ public class SwitchLifelineCommand extends GraphicalCommandHandler {
private ICommand getLinkedElementsCreationCommand(final ICommand createCommand, final EditPartViewer viewer) {
return new AbstractTransactionalCommand(getEditingDomain(), Messages.SwitchLifelineCommand_CreateLinkedElements, null, null) {
+
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final View lifelineView = (View) createCommand.getCommandResult().getReturnValue();
- if (lifelineView == null) {
+ final View lifelineView = (View)createCommand.getCommandResult().getReturnValue();
+ if(lifelineView == null) {
return CommandResult.newErrorCommandResult("Parent Lifeline not found"); //$NON-NLS-1$
}
// find time elements and general orderings linked to fragments in the Lifeline
- final EReference[] references = new EReference[] { UMLPackage.eINSTANCE.getGeneralOrdering_Before(),
- UMLPackage.eINSTANCE.getGeneralOrdering_After(), UMLPackage.eINSTANCE.getDurationObservation_Event(),
- UMLPackage.eINSTANCE.getTimeObservation_Event(), UMLPackage.eINSTANCE.getConstraint_ConstrainedElement() };
- final Class<?>[] expectedClasses = new Class<?>[] { GeneralOrdering.class, TimeObservation.class, DurationObservation.class,
- TimeConstraint.class, DurationConstraint.class };
+ final EReference[] references = new EReference[]{ UMLPackage.eINSTANCE.getGeneralOrdering_Before(), UMLPackage.eINSTANCE.getGeneralOrdering_After(), UMLPackage.eINSTANCE.getDurationObservation_Event(), UMLPackage.eINSTANCE.getTimeObservation_Event(), UMLPackage.eINSTANCE.getConstraint_ConstrainedElement() };
+ final Class<?>[] expectedClasses = new Class<?>[]{ GeneralOrdering.class, TimeObservation.class, DurationObservation.class, TimeConstraint.class, DurationConstraint.class };
- final Lifeline lifeline = (Lifeline) lifelineView.getElement();
+ final Lifeline lifeline = (Lifeline)lifelineView.getElement();
final EList<InteractionFragment> coveredBys = lifeline.getCoveredBys();
final Set<EObject> referencingElements = new HashSet<EObject>();
- for (final InteractionFragment interactionFragment : coveredBys) {
+ for(final InteractionFragment interactionFragment : coveredBys) {
referencingElements.addAll(Utils.findReferencingElements(interactionFragment, references, expectedClasses));
}
// drop the elements
- for (final EObject eObject : referencingElements) {
- if (eObject instanceof TimeObservation) {
- final TimeObservation timeObservation = (TimeObservation) eObject;
+ for(final EObject eObject : referencingElements) {
+ if(eObject instanceof TimeObservation) {
+ final TimeObservation timeObservation = (TimeObservation)eObject;
executeCommand(DropUtils.getDropTimeObservationCommand(timeObservation, lifelineView, viewer));
- } else if (eObject instanceof TimeConstraint) {
- final TimeConstraint timeConstraint = (TimeConstraint) eObject;
+ } else if(eObject instanceof TimeConstraint) {
+ final TimeConstraint timeConstraint = (TimeConstraint)eObject;
executeCommand(DropUtils.getDropTimeConstraintCommand(timeConstraint, lifelineView, viewer));
- } else if (eObject instanceof DurationObservation) {
- final DurationObservation durationObservation = (DurationObservation) eObject;
+ } else if(eObject instanceof DurationObservation) {
+ final DurationObservation durationObservation = (DurationObservation)eObject;
executeCommand(DropUtils.getDropDurationObservationCommand(durationObservation, lifelineView, viewer));
- } else if (eObject instanceof DurationConstraint) {
- final DurationConstraint durationConstraint = (DurationConstraint) eObject;
+ } else if(eObject instanceof DurationConstraint) {
+ final DurationConstraint durationConstraint = (DurationConstraint)eObject;
executeCommand(DropUtils.getDropDurationConstraintCommand(durationConstraint, lifelineView, viewer));
- } else if (eObject instanceof GeneralOrdering) {
- final GeneralOrdering generalOrdering = (GeneralOrdering) eObject;
+ } else if(eObject instanceof GeneralOrdering) {
+ final GeneralOrdering generalOrdering = (GeneralOrdering)eObject;
executeCommand(DropUtils.getDropGeneralOrderingCommand(generalOrdering, lifelineView, viewer));
}
}
@@ -381,16 +382,17 @@ public class SwitchLifelineCommand extends GraphicalCommandHandler {
private ICommand getStateDefinitionCreationForFullLifelineCommand(final Lifeline lifeline, final ICommand createCommand) {
return new AbstractTransactionalCommand(getEditingDomain(), Messages.SwitchLifelineCommand_createStateDefinitions, null, null) {
+
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final View lifelineView = (View) createCommand.getCommandResult().getReturnValue();
- if (lifelineView == null) {
+ final View lifelineView = (View)createCommand.getCommandResult().getReturnValue();
+ if(lifelineView == null) {
return CommandResult.newErrorCommandResult("Parent Lifeline not found"); //$NON-NLS-1$
}
final View stateDefinitionCompartmentView = ViewUtils.findStateDefinitionCompartmentView(lifelineView);
final List<String> stateDefinitionIds = StateDefinitionUtils.getStateDefinitionIds(lifeline);
- for (final String stateDefinitionId : stateDefinitionIds) {
+ for(final String stateDefinitionId : stateDefinitionIds) {
final String stateDefinitionName = StateDefinitionUtils.getStateDefinitionName(stateDefinitionId, lifeline);
// create the View for the state definition
@@ -409,10 +411,11 @@ public class SwitchLifelineCommand extends GraphicalCommandHandler {
private ICommand getFreeTimeRulerCreationCommand(final ICommand createCommand, final boolean timeRulerVisible) {
return new AbstractTransactionalCommand(getEditingDomain(), Messages.SwitchLifelineCommand_CreateTimeRuler, null) {
+
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final View lifelineView = (View) createCommand.getCommandResult().getReturnValue();
- if (lifelineView == null) {
+ final View lifelineView = (View)createCommand.getCommandResult().getReturnValue();
+ if(lifelineView == null) {
return CommandResult.newErrorCommandResult("Parent Lifeline not found"); //$NON-NLS-1$
}
TimeRulerUtils.createFreeTimeRuler(lifelineView);
@@ -427,11 +430,12 @@ public class SwitchLifelineCommand extends GraphicalCommandHandler {
private ICommand getFragmentsCreationForCompactLifelineCommand(final Lifeline lifeline, final ICommand createCommand) {
return new AbstractTransactionalCommand(getEditingDomain(), Messages.SwitchLifelineCommand_createLifelineFragments, null, null) {
+
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final View lifelineView = (View) createCommand.getCommandResult().getReturnValue();
- if (lifelineView == null) {
+ final View lifelineView = (View)createCommand.getCommandResult().getReturnValue();
+ if(lifelineView == null) {
return CommandResult.newErrorCommandResult("Parent Lifeline not found"); //$NON-NLS-1$
}
final UMLViewProvider umlViewProvider = new UMLViewProvider();
@@ -439,41 +443,37 @@ public class SwitchLifelineCommand extends GraphicalCommandHandler {
String previousStateInvariantName = ""; //$NON-NLS-1$
int indexInCompartment = 0;
int x = CustomCompactLifelineCompartmentEditPart.FIRST_STATE_OFFSET;
- for (final InteractionFragment fragment : lifeline.getCoveredBys()) {
+ for(final InteractionFragment fragment : lifeline.getCoveredBys()) {
final Location loc = NotationFactory.eINSTANCE.createLocation();
loc.setX(x);
loc.setY(0);
- if (fragment instanceof StateInvariant) {
- final StateInvariant stateInvariant = (StateInvariant) fragment;
+ if(fragment instanceof StateInvariant) {
+ final StateInvariant stateInvariant = (StateInvariant)fragment;
final String stateInvariantName = StateInvariantUtils.getInnerStateInvariantName(stateInvariant);
- if (!Utils.safeEquals(stateInvariantName, previousStateInvariantName)) {
- umlViewProvider.createStateInvariant_28(stateInvariant, stateInvariantCompartmentView, indexInCompartment, true,
- PreferencesHint.USE_DEFAULTS);
+ if(!Utils.safeEquals(stateInvariantName, previousStateInvariantName)) {
+ umlViewProvider.createStateInvariant_28(stateInvariant, stateInvariantCompartmentView, indexInCompartment, true, PreferencesHint.USE_DEFAULTS);
indexInCompartment++;
x += 60;
}
previousStateInvariantName = stateInvariantName;
- } else if (fragment instanceof DestructionOccurrenceSpecification) {
- final DestructionOccurrenceSpecification occurrence = (DestructionOccurrenceSpecification) fragment;
- final Node occurrenceSpecificationView = umlViewProvider.createDestructionOccurrenceSpecification_27(occurrence,
- stateInvariantCompartmentView, indexInCompartment, true, PreferencesHint.USE_DEFAULTS);
+ } else if(fragment instanceof DestructionOccurrenceSpecification) {
+ final DestructionOccurrenceSpecification occurrence = (DestructionOccurrenceSpecification)fragment;
+ final Node occurrenceSpecificationView = umlViewProvider.createDestructionOccurrenceSpecification_27(occurrence, stateInvariantCompartmentView, indexInCompartment, true, PreferencesHint.USE_DEFAULTS);
indexInCompartment++;
occurrenceSpecificationView.setLayoutConstraint(loc);
x += 10;
- } else if (fragment instanceof MessageOccurrenceSpecification) {
- final MessageOccurrenceSpecification occurrence = (MessageOccurrenceSpecification) fragment;
- final Node occurrenceSpecificationView = umlViewProvider.createMessageOccurrenceSpecification_13(occurrence,
- stateInvariantCompartmentView, indexInCompartment, true, PreferencesHint.USE_DEFAULTS);
+ } else if(fragment instanceof MessageOccurrenceSpecification) {
+ final MessageOccurrenceSpecification occurrence = (MessageOccurrenceSpecification)fragment;
+ final Node occurrenceSpecificationView = umlViewProvider.createMessageOccurrenceSpecification_13(occurrence, stateInvariantCompartmentView, indexInCompartment, true, PreferencesHint.USE_DEFAULTS);
indexInCompartment++;
occurrenceSpecificationView.setLayoutConstraint(loc);
x += 10;
- } else if (fragment instanceof OccurrenceSpecification) {
- final OccurrenceSpecification occurrence = (OccurrenceSpecification) fragment;
- final Node occurrenceSpecificationView = umlViewProvider.createOccurrenceSpecification_12(occurrence, stateInvariantCompartmentView,
- indexInCompartment, true, PreferencesHint.USE_DEFAULTS);
+ } else if(fragment instanceof OccurrenceSpecification) {
+ final OccurrenceSpecification occurrence = (OccurrenceSpecification)fragment;
+ final Node occurrenceSpecificationView = umlViewProvider.createOccurrenceSpecification_12(occurrence, stateInvariantCompartmentView, indexInCompartment, true, PreferencesHint.USE_DEFAULTS);
indexInCompartment++;
occurrenceSpecificationView.setLayoutConstraint(loc);
x += 10;
@@ -488,10 +488,11 @@ public class SwitchLifelineCommand extends GraphicalCommandHandler {
private ICommand getFragmentsCreationForFullLifelineCommand(final Lifeline lifeline, final ICommand createCommand) {
return new AbstractTransactionalCommand(getEditingDomain(), Messages.SwitchLifelineCommand_createLifelineFragments, null, null) {
+
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final View lifelineView = (View) createCommand.getCommandResult().getReturnValue();
- if (lifelineView == null) {
+ final View lifelineView = (View)createCommand.getCommandResult().getReturnValue();
+ if(lifelineView == null) {
return CommandResult.newErrorCommandResult("Parent Lifeline not found"); //$NON-NLS-1$
}
final View timelineCompartmentView = ViewUtils.findFullLifelineCompartmentView(lifelineView);
@@ -503,25 +504,25 @@ public class SwitchLifelineCommand extends GraphicalCommandHandler {
String previousStateInvariantName = ""; //$NON-NLS-1$
StateInvariant previousStateInvariant = null;
boolean needStateInvariant = false;
- for (final InteractionFragment fragment : fragments) {
+ for(final InteractionFragment fragment : fragments) {
final Location loc = NotationFactory.eINSTANCE.createLocation();
loc.setX(x);
loc.setY(0);
// we always need a StateInvariant between OccurrenceSpecifications
// (otherwise we would be leaving a gap in the timeline)
- if (!(fragment instanceof StateInvariant) && needStateInvariant && previousStateInvariant != null) {
+ if(!(fragment instanceof StateInvariant) && needStateInvariant && previousStateInvariant != null) {
umlViewProvider.createStateInvariant_11(previousStateInvariant, timelineCompartmentView, -1, true, PreferencesHint.USE_DEFAULTS);
}
- if (fragment instanceof StateInvariant) {
- if (!firstStateInvariant) {
+ if(fragment instanceof StateInvariant) {
+ if(!firstStateInvariant) {
// add a vertical line
umlViewProvider.createNode_39(null, timelineCompartmentView, -1, true, PreferencesHint.USE_DEFAULTS);
}
- final StateInvariant stateInvariant = (StateInvariant) fragment;
+ final StateInvariant stateInvariant = (StateInvariant)fragment;
final String stateInvariantName = StateInvariantUtils.getInnerStateInvariantName(stateInvariant);
- if (Utils.safeEquals(stateInvariantName, previousStateInvariantName)) {
+ if(Utils.safeEquals(stateInvariantName, previousStateInvariantName)) {
x += 10;
} else {
x += 25;
@@ -532,27 +533,24 @@ public class SwitchLifelineCommand extends GraphicalCommandHandler {
previousStateInvariantName = stateInvariantName;
previousStateInvariant = stateInvariant;
needStateInvariant = false;
- } else if (fragment instanceof DestructionOccurrenceSpecification) {
- final DestructionOccurrenceSpecification destructionOccurrenceSpecification = (DestructionOccurrenceSpecification) fragment;
+ } else if(fragment instanceof DestructionOccurrenceSpecification) {
+ final DestructionOccurrenceSpecification destructionOccurrenceSpecification = (DestructionOccurrenceSpecification)fragment;
// create the View for the occurrence specification
- final Node occurrenceSpecificationView = umlViewProvider.createDestructionOccurrenceSpecification_27(
- destructionOccurrenceSpecification, timelineCompartmentView, -1, true, PreferencesHint.USE_DEFAULTS);
+ final Node occurrenceSpecificationView = umlViewProvider.createDestructionOccurrenceSpecification_27(destructionOccurrenceSpecification, timelineCompartmentView, -1, true, PreferencesHint.USE_DEFAULTS);
occurrenceSpecificationView.setLayoutConstraint(loc);
needStateInvariant = false;
x += 10;
- } else if (fragment instanceof MessageOccurrenceSpecification) {
- final MessageOccurrenceSpecification occurrenceSpecification = (MessageOccurrenceSpecification) fragment;
+ } else if(fragment instanceof MessageOccurrenceSpecification) {
+ final MessageOccurrenceSpecification occurrenceSpecification = (MessageOccurrenceSpecification)fragment;
// create the View for the occurrence specification
- final Node occurrenceSpecificationView = umlViewProvider.createMessageOccurrenceSpecification_13(occurrenceSpecification,
- timelineCompartmentView, -1, true, PreferencesHint.USE_DEFAULTS);
+ final Node occurrenceSpecificationView = umlViewProvider.createMessageOccurrenceSpecification_13(occurrenceSpecification, timelineCompartmentView, -1, true, PreferencesHint.USE_DEFAULTS);
occurrenceSpecificationView.setLayoutConstraint(loc);
needStateInvariant = true;
x += 10;
- } else if (fragment instanceof OccurrenceSpecification) {
- final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification) fragment;
+ } else if(fragment instanceof OccurrenceSpecification) {
+ final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification)fragment;
// create the View for the occurrence specification
- final Node occurrenceSpecificationView = umlViewProvider.createOccurrenceSpecification_12(occurrenceSpecification,
- timelineCompartmentView, -1, true, PreferencesHint.USE_DEFAULTS);
+ final Node occurrenceSpecificationView = umlViewProvider.createOccurrenceSpecification_12(occurrenceSpecification, timelineCompartmentView, -1, true, PreferencesHint.USE_DEFAULTS);
occurrenceSpecificationView.setLayoutConstraint(loc);
needStateInvariant = true;
x += 10;
@@ -560,7 +558,7 @@ public class SwitchLifelineCommand extends GraphicalCommandHandler {
}
// we always need the timeline to end with a StateInvariant
- if (needStateInvariant && previousStateInvariant != null) {
+ if(needStateInvariant && previousStateInvariant != null) {
umlViewProvider.createStateInvariant_11(previousStateInvariant, timelineCompartmentView, -1, true, PreferencesHint.USE_DEFAULTS);
}
@@ -573,8 +571,8 @@ public class SwitchLifelineCommand extends GraphicalCommandHandler {
protected Command getCommand() throws ExecutionException {
final CompoundCommand cmd = new CompoundCommand(Messages.SwitchLifelineCommand_switchLifeline);
final List<IGraphicalEditPart> selectedElements = getSelectedElements();
- for (final IGraphicalEditPart selectedElement : selectedElements) {
- if (selectedElement instanceof FullLifelineEditPartCN || selectedElement instanceof CompactLifelineEditPartCN) {
+ for(final IGraphicalEditPart selectedElement : selectedElements) {
+ if(selectedElement instanceof FullLifelineEditPartCN || selectedElement instanceof CompactLifelineEditPartCN) {
cmd.add(switchLifeline(selectedElement));
}
}
@@ -582,7 +580,7 @@ public class SwitchLifelineCommand extends GraphicalCommandHandler {
}
protected static void executeCommand(final ICommand command) throws ExecutionException {
- if (command.canExecute()) {
+ if(command.canExecute()) {
command.execute(new NullProgressMonitor(), null);
} else {
Activator.log.warn("Cannot execute command for lifeline switch: " + command.getLabel()); //$NON-NLS-1$
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/ToggleTimeRulerVisibility.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/ToggleTimeRulerVisibility.java
index 7f4897fa944..edb24a1c7b3 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/ToggleTimeRulerVisibility.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/ToggleTimeRulerVisibility.java
@@ -42,11 +42,11 @@ public class ToggleTimeRulerVisibility extends GraphicalCommandHandler {
final List<IGraphicalEditPart> selectedElements = getSelectedElements();
boolean first = true;
InteractionEditPartTN interactionEditPart = null;
- for (final IGraphicalEditPart selectedEditPart : selectedElements) {
- if (selectedEditPart instanceof FullLifelineEditPartCN || selectedEditPart instanceof CompactLifelineEditPartCN) {
- if (first) {
- interactionEditPart = (InteractionEditPartTN) EditPartUtils.findParentEditPartWithId(selectedEditPart, InteractionEditPartTN.VISUAL_ID);
- if (interactionEditPart != null) {
+ for(final IGraphicalEditPart selectedEditPart : selectedElements) {
+ if(selectedEditPart instanceof FullLifelineEditPartCN || selectedEditPart instanceof CompactLifelineEditPartCN) {
+ if(first) {
+ interactionEditPart = (InteractionEditPartTN)EditPartUtils.findParentEditPartWithId(selectedEditPart, InteractionEditPartTN.VISUAL_ID);
+ if(interactionEditPart != null) {
cmd.add(new RefreshCommandForUndo(interactionEditPart));
first = false;
}
@@ -54,30 +54,30 @@ public class ToggleTimeRulerVisibility extends GraphicalCommandHandler {
cmd.add(toggleTimeRulerVisibility(selectedEditPart));
}
}
- if (interactionEditPart != null) {
+ if(interactionEditPart != null) {
cmd.add(new RefreshCommandForDo(interactionEditPart));
}
return cmd;
}
private Command toggleTimeRulerVisibility(final IGraphicalEditPart object) {
- return new ICommandProxy(
- new AbstractTransactionalCommand(getEditingDomain(), Messages.ToggleTimeRulerVisibility_ToggleTimeRulerVisibility, null, null) {
- @Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final LifelineEditPart lifelineEditPart = (LifelineEditPart) object;
- final View lifelineView = (View) lifelineEditPart.getModel();
- final View timeRulerCompartmentView = ViewUtils.findTimeRulerCompartmentView(lifelineView);
- timeRulerCompartmentView.setVisible(!timeRulerCompartmentView.isVisible());
- return CommandResult.newOKCommandResult();
- }
- });
+ return new ICommandProxy(new AbstractTransactionalCommand(getEditingDomain(), Messages.ToggleTimeRulerVisibility_ToggleTimeRulerVisibility, null, null) {
+
+ @Override
+ protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
+ final LifelineEditPart lifelineEditPart = (LifelineEditPart)object;
+ final View lifelineView = (View)lifelineEditPart.getModel();
+ final View timeRulerCompartmentView = ViewUtils.findTimeRulerCompartmentView(lifelineView);
+ timeRulerCompartmentView.setVisible(!timeRulerCompartmentView.isVisible());
+ return CommandResult.newOKCommandResult();
+ }
+ });
}
protected static final LifelineFigure getLifelineFigure(final IFigure figure) {
LifelineFigure result = null;
result = FigureUtils.findChildFigureInstance(figure, FullLifelineFigure.class);
- if (result == null) {
+ if(result == null) {
result = FigureUtils.findChildFigureInstance(figure, CompactLifelineFigure.class);
}
return result;
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/ValidateInteractionCommand.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/ValidateInteractionCommand.java
index 1200f2ce82d..ceb23345c42 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/ValidateInteractionCommand.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/ValidateInteractionCommand.java
@@ -22,15 +22,16 @@ import org.eclipse.uml2.uml.Interaction;
public class ValidateInteractionCommand extends AbstractTransactionalCommand {
private final Interaction interaction;
+
private final boolean interactive;
/**
* @param domain
- * the editing domain
+ * the editing domain
* @param interaction
- * the interaction to validate
+ * the interaction to validate
* @param interactive
- * whether to display notifications to the user, and ask for confirmation using dialog boxes
+ * whether to display notifications to the user, and ask for confirmation using dialog boxes
*/
public ValidateInteractionCommand(final TransactionalEditingDomain domain, final Interaction interaction, final boolean interactive) {
super(domain, Messages.ValidateInteractionCommand_ValidateInteraction, null);
@@ -42,6 +43,7 @@ public class ValidateInteractionCommand extends AbstractTransactionalCommand {
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
final boolean[] result = new boolean[1];
Display.getDefault().syncExec(new Runnable() {
+
public void run() {
result[0] = validate();
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactLifelineCompartmentEditPart.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactLifelineCompartmentEditPart.java
index 905b81b0061..9a8ebc130f1 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactLifelineCompartmentEditPart.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactLifelineCompartmentEditPart.java
@@ -45,16 +45,17 @@ public class CustomCompactLifelineCompartmentEditPart extends CompactLifelineCom
@Override
public IFigure createFigure() {
- final ResizableCompartmentFigure figure = (ResizableCompartmentFigure) super.createFigure();
+ final ResizableCompartmentFigure figure = (ResizableCompartmentFigure)super.createFigure();
figure.setBorder(null);
figure.getScrollPane().setBorder(null);
figure.setLayoutManager(new FillLayout());
figure.getContentPane().setLayoutManager(new FreeFormLayoutEx() {
+
@Override
public void layout(final IFigure container) {
// reset the layout so that the BorderItemsAwareFreeFormLayer fills its parent FreeformViewport
- if (!(container.getParent().getLayoutManager() instanceof FillLayout)) {
+ if(!(container.getParent().getLayoutManager() instanceof FillLayout)) {
container.getParent().setLayoutManager(new FillLayout());
}
@@ -74,20 +75,20 @@ public class CustomCompactLifelineCompartmentEditPart extends CompactLifelineCom
boolean destruction = false;
int destructionX = Integer.MAX_VALUE;
- for (int i = 0; i < children.size(); i++) {
+ for(int i = 0; i < children.size(); i++) {
final IFigure child = children.get(i);
final CrossFigure crossFigure = FigureUtils.findChildFigureInstance(child, CrossFigure.class);
- if (crossFigure != null) {
- final Rectangle constraint = (Rectangle) getConstraint(child);
+ if(crossFigure != null) {
+ final Rectangle constraint = (Rectangle)getConstraint(child);
destruction = true;
destructionX = constraint.x;
}
}
IFigure nextChild = null;
- for (int i = 0; i < children.size(); i++) {
+ for(int i = 0; i < children.size(); i++) {
final IFigure child = children.get(i);
- if (i < children.size() - 1) {
+ if(i < children.size() - 1) {
nextChild = children.get(i + 1);
} else {
nextChild = null;
@@ -97,17 +98,16 @@ public class CustomCompactLifelineCompartmentEditPart extends CompactLifelineCom
final CompactStateFigure stateInvariantFigure = FigureUtils.findChildFigureInstance(child, CompactStateFigure.class);
final VerticalMarkFigure verticalMarkFigure = FigureUtils.findChildFigureInstance(child, VerticalMarkFigure.class);
final DimensioningArrowFigure dimensioningArrowFigure = FigureUtils.findChildFigureInstance(figure, DimensioningArrowFigure.class);
- final GeneralOrderingHorizontalFigure generalOrderingHorizontalFigure = FigureUtils.findChildFigureInstance(figure,
- GeneralOrderingHorizontalFigure.class);
+ final GeneralOrderingHorizontalFigure generalOrderingHorizontalFigure = FigureUtils.findChildFigureInstance(figure, GeneralOrderingHorizontalFigure.class);
// This is the bounds that the user tries to set. We further constrain these bounds.
- final Rectangle constraint = (Rectangle) getConstraint(child);
+ final Rectangle constraint = (Rectangle)getConstraint(child);
// OccurrenceSpecification, MessageOccurrenceSpecification or DestructionOccurrenceSpecification
- if (occurrenceFigure != null) {
+ if(occurrenceFigure != null) {
final Dimension preferredSize = occurrenceFigure.getPreferredSize();
- if (nextChild != null && FigureUtils.findChildFigureInstance(nextChild, CompactStateFigure.class) != null) {
+ if(nextChild != null && FigureUtils.findChildFigureInstance(nextChild, CompactStateFigure.class) != null) {
// this is an occurrence specification marking a state change
// => center it vertically
child.setBounds(new Rectangle(constraint.x, centerY - preferredSize.height / 2, preferredSize.width, preferredSize.height));
@@ -123,12 +123,11 @@ public class CustomCompactLifelineCompartmentEditPart extends CompactLifelineCom
// let the user move the OccurrenceSpecification near the top or bottom of the
// StateInvariant on top of which it appears, and snap it to this position
- final int halfHeight = CompactStateFigure.computeHalfHeightAtAbscissa(posX - currentStateInvariantX + SmallSquareFigure.RADIUS,
- currentStateInvariantWidth, currentStateInvariantHeight, currentStateInvariantInfinite);
+ final int halfHeight = CompactStateFigure.computeHalfHeightAtAbscissa(posX - currentStateInvariantX + SmallSquareFigure.RADIUS, currentStateInvariantWidth, currentStateInvariantHeight, currentStateInvariantInfinite);
final int topPos = centerY - halfHeight - SmallSquareFigure.RADIUS;
final int bottomPos = centerY + halfHeight - SmallSquareFigure.RADIUS - 1;
int posY;
- if (Math.abs(constraint.y - topPos) < Math.abs(constraint.y - bottomPos)) {
+ if(Math.abs(constraint.y - topPos) < Math.abs(constraint.y - bottomPos)) {
posY = topPos;
} else {
posY = bottomPos;
@@ -139,18 +138,18 @@ public class CustomCompactLifelineCompartmentEditPart extends CompactLifelineCom
}
}
// StateInvariant
- else if (stateInvariantFigure != null) {
+ else if(stateInvariantFigure != null) {
final Dimension preferredSize = stateInvariantFigure.getPreferredSize();
final int height = Math.min(preferredSize.height, clientArea.height);
final int width;
// the StateInvariant stops where the next state change occurrence begins
final IFigure nextStateChangeOccurrence = findNextStateChangeOccurrence(children, i + 1);
- if (nextStateChangeOccurrence != null) {
+ if(nextStateChangeOccurrence != null) {
stateInvariantFigure.setInfinite(false);
currentStateInvariantInfinite = false;
- width = ((Rectangle) getConstraint(nextStateChangeOccurrence)).x - x;
- } else if (destruction) {
+ width = ((Rectangle)getConstraint(nextStateChangeOccurrence)).x - x;
+ } else if(destruction) {
stateInvariantFigure.setInfinite(false);
currentStateInvariantInfinite = false;
width = destructionX - x;
@@ -165,23 +164,23 @@ public class CustomCompactLifelineCompartmentEditPart extends CompactLifelineCom
currentStateInvariantWidth = width;
currentStateInvariantHeight = height;
x += width;
- } else if (verticalMarkFigure != null) {
+ } else if(verticalMarkFigure != null) {
// time observation or constraint
final Dimension size = verticalMarkFigure.getPreferredSize();
final int margin = 3;
// put it right above the StateInvariants
final int y = centerY - CompactStateFigure.PREFERRED_HEIGHT / 2 - VerticalMarkFigure.PREFERRED_HEIGHT - margin;
child.setBounds(new Rectangle(constraint.x, y, size.width, size.height));
- } else if (dimensioningArrowFigure != null) {
+ } else if(dimensioningArrowFigure != null) {
// duration observation or constraint
final Dimension size = dimensioningArrowFigure.getPreferredSize();
- if (constraint.width == Integer.MAX_VALUE) {
+ if(constraint.width == Integer.MAX_VALUE) {
// it has no end => set the right side of the compartment as the end
child.setBounds(new Rectangle(constraint.x, constraint.y, clientArea.width - constraint.x, size.height));
} else {
child.setBounds(new Rectangle(constraint.x, constraint.y, constraint.width, size.height));
}
- } else if (generalOrderingHorizontalFigure != null) {
+ } else if(generalOrderingHorizontalFigure != null) {
// general ordering
final Dimension size = generalOrderingHorizontalFigure.getPreferredSize();
child.setBounds(new Rectangle(constraint.x, constraint.y, constraint.width, size.height));
@@ -200,18 +199,18 @@ public class CustomCompactLifelineCompartmentEditPart extends CompactLifelineCom
protected static IFigure getOccurrenceChild(final IFigure child) {
IFigure occurrenceFigure = FigureUtils.findChildFigureInstance(child, SmallSquareFigure.class);
- if (occurrenceFigure == null) {
+ if(occurrenceFigure == null) {
occurrenceFigure = FigureUtils.findChildFigureInstance(child, CrossFigure.class);
}
return occurrenceFigure;
}
protected static IFigure findNextStateChangeOccurrence(final List<IFigure> children, final int startIndex) {
- for (int i = startIndex; i < children.size() - 1; i++) {
+ for(int i = startIndex; i < children.size() - 1; i++) {
final IFigure figure1 = children.get(i);
final IFigure figure2 = children.get(i + 1);
// an OccurrenceSpecification followed by a StateInvariant means a state change
- if (getOccurrenceChild(figure1) != null && FigureUtils.findChildFigureInstance(figure2, CompactStateFigure.class) != null) {
+ if(getOccurrenceChild(figure1) != null && FigureUtils.findChildFigureInstance(figure2, CompactStateFigure.class) != null) {
return figure1;
}
}
@@ -226,7 +225,7 @@ public class CustomCompactLifelineCompartmentEditPart extends CompactLifelineCom
@Override
protected void refreshVisuals() {
super.refreshVisuals();
- ((ResizableCompartmentFigure) getFigure()).getScrollPane().setScrollBarVisibility(org.eclipse.draw2d.ScrollPane.NEVER);
+ ((ResizableCompartmentFigure)getFigure()).getScrollPane().setScrollBarVisibility(org.eclipse.draw2d.ScrollPane.NEVER);
refreshBounds();
}
@@ -240,15 +239,15 @@ public class CustomCompactLifelineCompartmentEditPart extends CompactLifelineCom
@Override
public Command getCommand(final Request request) {
// redirect connection requests to the Lifeline (for MessageLost and MessageFound)
- if (request instanceof CreateConnectionRequest) {
- final CreateConnectionRequest createConnectionRequest = (CreateConnectionRequest) request;
- if (RequestConstants.REQ_CONNECTION_START.equals(request.getType())) {
- if (createConnectionRequest.getTargetEditPart() instanceof CompactLifelineCompartmentEditPartCN) {
+ if(request instanceof CreateConnectionRequest) {
+ final CreateConnectionRequest createConnectionRequest = (CreateConnectionRequest)request;
+ if(RequestConstants.REQ_CONNECTION_START.equals(request.getType())) {
+ if(createConnectionRequest.getTargetEditPart() instanceof CompactLifelineCompartmentEditPartCN) {
createConnectionRequest.setTargetEditPart(getParent());
}
return getParent().getCommand(request);
- } else if (RequestConstants.REQ_CONNECTION_END.equals(request.getType())) {
- if (createConnectionRequest.getSourceEditPart() instanceof CompactLifelineCompartmentEditPartCN) {
+ } else if(RequestConstants.REQ_CONNECTION_END.equals(request.getType())) {
+ if(createConnectionRequest.getSourceEditPart() instanceof CompactLifelineCompartmentEditPartCN) {
createConnectionRequest.setSourceEditPart(getParent());
}
return getParent().getCommand(request);
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactLifelineEditPartCN.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactLifelineEditPartCN.java
index 6d831269f28..3af3202be66 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactLifelineEditPartCN.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactLifelineEditPartCN.java
@@ -55,22 +55,23 @@ public class CustomCompactLifelineEditPartCN extends CompactLifelineEditPartCN {
final CompactLifelineFigure lifelineFigure = FigureUtils.findChildFigureInstance(nodeFigure, CompactLifelineFigure.class);
// collapses the time ruler rectangle if the time ruler is not used
lifelineFigure.getLifelineDataContainerFigure().setLayoutManager(new AbstractLayout() {
+
public void layout(final IFigure container) {
final int timeRulerHeight = Constants.TIME_RULER_HEIGHT;
final boolean displayTimeRuler = lifelineFigure.isDisplayTimeRuler();
final Rectangle clientArea = container.getClientArea();
@SuppressWarnings("unchecked")
final List<IFigure> children = container.getChildren();
- for (int i = 0; i < children.size(); i++) {
+ for(int i = 0; i < children.size(); i++) {
final IFigure child = children.get(i);
- if (child == lifelineFigure.getTimelineContainerFigure()) {
- if (displayTimeRuler) {
+ if(child == lifelineFigure.getTimelineContainerFigure()) {
+ if(displayTimeRuler) {
child.setBounds(new Rectangle(clientArea).getResized(0, -timeRulerHeight));
} else {
child.setBounds(clientArea);
}
- } else if (child == lifelineFigure.getTimeRulerContainerFigure()) {
- if (displayTimeRuler) {
+ } else if(child == lifelineFigure.getTimeRulerContainerFigure()) {
+ if(displayTimeRuler) {
final Rectangle bounds = new Rectangle(clientArea);
bounds.height = timeRulerHeight;
bounds.y = clientArea.y + clientArea.height - timeRulerHeight;
@@ -94,6 +95,7 @@ public class CustomCompactLifelineEditPartCN extends CompactLifelineEditPartCN {
public DragTracker getDragTracker(final Request request) {
// lock the drag to the containing compartment
return new DragEditPartsTrackerEx(this) {
+
@Override
protected boolean handleDragStarted() {
lockTargetEditPart(CustomCompactLifelineEditPartCN.this.getParent());
@@ -115,7 +117,7 @@ public class CustomCompactLifelineEditPartCN extends CompactLifelineEditPartCN {
/** Display feedback at the start location (where the create request was started) */
@Override
public ConnectionAnchor getTargetConnectionAnchor(final Request request) {
- if (request instanceof CreateRequest) {
+ if(request instanceof CreateRequest) {
return new XYAnchor(MessageUtils.getLastStartLocation());
}
return super.getTargetConnectionAnchor(request);
@@ -124,8 +126,8 @@ public class CustomCompactLifelineEditPartCN extends CompactLifelineEditPartCN {
/** Display feedback at the cursor location */
@Override
public ConnectionAnchor getSourceConnectionAnchor(final Request request) {
- if (request instanceof LocationRequest) {
- final LocationRequest locationRequest = (LocationRequest) request;
+ if(request instanceof LocationRequest) {
+ final LocationRequest locationRequest = (LocationRequest)request;
return new XYAnchor(locationRequest.getLocation());
}
return super.getTargetConnectionAnchor(request);
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactLifelineTimeRulerCompartmentEditPartCN.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactLifelineTimeRulerCompartmentEditPartCN.java
index 6ef12842d17..364c5509d55 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactLifelineTimeRulerCompartmentEditPartCN.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactLifelineTimeRulerCompartmentEditPartCN.java
@@ -24,7 +24,7 @@ public class CustomCompactLifelineTimeRulerCompartmentEditPartCN extends Compact
@Override
public IFigure createFigure() {
- final ResizableCompartmentFigure result = (ResizableCompartmentFigure) super.createFigure();
+ final ResizableCompartmentFigure result = (ResizableCompartmentFigure)super.createFigure();
result.setBorder(null);
result.setTitleVisibility(false);
result.setLayoutManager(new FillLayout());
@@ -40,7 +40,7 @@ public class CustomCompactLifelineTimeRulerCompartmentEditPartCN extends Compact
@Override
protected void refreshVisuals() {
super.refreshVisuals();
- ((ResizableCompartmentFigure) getFigure()).getScrollPane().setScrollBarVisibility(org.eclipse.draw2d.ScrollPane.NEVER);
+ ((ResizableCompartmentFigure)getFigure()).getScrollPane().setScrollBarVisibility(org.eclipse.draw2d.ScrollPane.NEVER);
refreshBounds();
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactStateInvariantEditPartCN.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactStateInvariantEditPartCN.java
index 4ca303dd6be..9f0faf04bfc 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactStateInvariantEditPartCN.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactStateInvariantEditPartCN.java
@@ -44,11 +44,11 @@ public class CustomCompactStateInvariantEditPartCN extends CompactStateInvariant
public void performRequest(final Request request) {
// allow creating an OccurrenceSpecification when double-clicking on a StateInvariant line
// (in addition to the OccurrenceSpecification creation tool from the palette)
- if (request.getType() == REQ_OPEN && request instanceof LocationRequest) {
- final StateInvariant stateInvariant = (StateInvariant) ((View) getModel()).getElement();
+ if(request.getType() == REQ_OPEN && request instanceof LocationRequest) {
+ final StateInvariant stateInvariant = (StateInvariant)((View)getModel()).getElement();
final TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(stateInvariant);
// shift by 2 pixels to cut at the center of the OccurrenceSpecification
- final Point loc = new Point(((LocationRequest) request).getLocation()).translate(-SmallSquareFigure.RADIUS, 0);
+ final Point loc = new Point(((LocationRequest)request).getLocation()).translate(-SmallSquareFigure.RADIUS, 0);
final CompositeCommand compositeCommand = new CompositeCommand(Messages.CustomCompactStateInvariantEditPartCN_CreateOccurrenceSpecification);
compositeCommand.add(new CutAndInsertOccurrenceSpecificationCompactLifelineCommand(this, loc, false));
final EditPart timeline = EditPartUtils.findParentEditPartWithId(this, CompactLifelineCompartmentEditPartCN.VISUAL_ID);
@@ -62,8 +62,9 @@ public class CustomCompactStateInvariantEditPartCN extends CompactStateInvariant
@Override
protected void addBorderItem(final IFigure borderItemContainer, final IBorderItemEditPart borderItemEditPart) {
- if (borderItemEditPart instanceof StateInvariantAppliedStereotypeEditPart) {
+ if(borderItemEditPart instanceof StateInvariantAppliedStereotypeEditPart) {
final BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH) {
+
@Override
public int getPreferredSideOfParent() {
/*
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactStateInvariantNameEditPart.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactStateInvariantNameEditPart.java
index 9edb610edbe..7e29568ca08 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactStateInvariantNameEditPart.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactStateInvariantNameEditPart.java
@@ -26,7 +26,7 @@ public class CustomCompactStateInvariantNameEditPart extends CompactStateInvaria
@Override
public void performRequest(final Request request) {
- if (request.getType() == REQ_OPEN) {
+ if(request.getType() == REQ_OPEN) {
// double-click on the label is handled by the parent (to cut the CompactStateInvariant)
getParent().performRequest(request);
} else {
@@ -36,7 +36,7 @@ public class CustomCompactStateInvariantNameEditPart extends CompactStateInvaria
@Override
public IParser getParser() {
- if (this.parser == null) {
+ if(this.parser == null) {
this.parser = new CompactStateInvariantNameParser();
}
return this.parser;
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomDestructionOccurrenceSpecificationEditPartCN.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomDestructionOccurrenceSpecificationEditPartCN.java
index 64286448caa..68867e161a2 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomDestructionOccurrenceSpecificationEditPartCN.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomDestructionOccurrenceSpecificationEditPartCN.java
@@ -14,7 +14,6 @@ import org.eclipse.gef.DragTracker;
import org.eclipse.gef.Request;
import org.eclipse.gef.editpolicies.LayoutEditPolicy;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies.ExternalLabelPrimaryDragRoleEditPolicy;
import org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies.LayoutEditPolicyForLabel;
import org.eclipse.papyrus.uml.diagram.timing.custom.parts.NoScrollNoBorderDragEditPartsTracker;
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.DestructionOccurrenceSpecificationEditPartCN;
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomDestructionOccurrenceSpecificationLabelEditPart.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomDestructionOccurrenceSpecificationLabelEditPart.java
index 314cd61c7ed..e26c8bffc85 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomDestructionOccurrenceSpecificationLabelEditPart.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomDestructionOccurrenceSpecificationLabelEditPart.java
@@ -14,6 +14,7 @@ import org.eclipse.papyrus.uml.diagram.timing.custom.parsers.OccurrenceSpecifica
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.DestructionOccurrenceSpecificationLabelEditPart;
public class CustomDestructionOccurrenceSpecificationLabelEditPart extends DestructionOccurrenceSpecificationLabelEditPart {
+
private IParser parser;
public CustomDestructionOccurrenceSpecificationLabelEditPart(final View view) {
@@ -22,7 +23,7 @@ public class CustomDestructionOccurrenceSpecificationLabelEditPart extends Destr
@Override
public IParser getParser() {
- if (this.parser == null) {
+ if(this.parser == null) {
this.parser = new OccurrenceSpecificationNameParser();
}
return this.parser;
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomDurationConstraintEditPart.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomDurationConstraintEditPart.java
index 9f58d380209..80af177a20d 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomDurationConstraintEditPart.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomDurationConstraintEditPart.java
@@ -12,7 +12,6 @@ import org.eclipse.gef.DragTracker;
import org.eclipse.gef.Request;
import org.eclipse.gef.editpolicies.LayoutEditPolicy;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies.ExternalLabelPrimaryDragRoleEditPolicy;
import org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies.LayoutEditPolicyForLabel;
import org.eclipse.papyrus.uml.diagram.timing.custom.parts.NoScrollNoBorderDragEditPartsTracker;
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.DurationConstraintEditPartCN;
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomDurationObservationEditPart.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomDurationObservationEditPart.java
index e3cb178b516..85f53e373ec 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomDurationObservationEditPart.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomDurationObservationEditPart.java
@@ -12,7 +12,6 @@ import org.eclipse.gef.DragTracker;
import org.eclipse.gef.Request;
import org.eclipse.gef.editpolicies.LayoutEditPolicy;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies.ExternalLabelPrimaryDragRoleEditPolicy;
import org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies.LayoutEditPolicyForLabel;
import org.eclipse.papyrus.uml.diagram.timing.custom.parts.NoScrollNoBorderDragEditPartsTracker;
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.DurationObservationEditPartCN;
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFreeTimeRulerCompartmentEditPart.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFreeTimeRulerCompartmentEditPart.java
index a745b262e6a..457f2e5b81d 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFreeTimeRulerCompartmentEditPart.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFreeTimeRulerCompartmentEditPart.java
@@ -47,7 +47,7 @@ public class CustomFreeTimeRulerCompartmentEditPart extends FreeTimeRulerCompart
@Override
public IFigure createFigure() {
- final ResizableCompartmentFigure result = (ResizableCompartmentFigure) super.createFigure();
+ final ResizableCompartmentFigure result = (ResizableCompartmentFigure)super.createFigure();
result.setTitleVisibility(false);
result.setBorder(null);
result.getScrollPane().setBorder(null);
@@ -73,7 +73,7 @@ public class CustomFreeTimeRulerCompartmentEditPart extends FreeTimeRulerCompart
@Override
protected void refreshVisuals() {
super.refreshVisuals();
- ((ResizableCompartmentFigure) getFigure()).getScrollPane().setScrollBarVisibility(org.eclipse.draw2d.ScrollPane.NEVER);
+ ((ResizableCompartmentFigure)getFigure()).getScrollPane().setScrollBarVisibility(org.eclipse.draw2d.ScrollPane.NEVER);
refreshBounds();
}
@@ -95,21 +95,21 @@ public class CustomFreeTimeRulerCompartmentEditPart extends FreeTimeRulerCompart
final List<EditPart> osEditParts = new ArrayList<EditPart>();
- for (final SmallSquareFigure figure : osFigures) {
+ for(final SmallSquareFigure figure : osFigures) {
final EditPart editPart = visualPartMap.get(FigureUtils.findParentFigureInstance(figure, BorderedNodeFigure.class));
- if (editPart != null) {
+ if(editPart != null) {
osEditParts.add(editPart);
}
}
- for (final CrossFigure figure : destructionOSFigures) {
+ for(final CrossFigure figure : destructionOSFigures) {
final EditPart editPart = visualPartMap.get(FigureUtils.findParentFigureInstance(figure, BorderedNodeFigure.class));
- if (editPart != null) {
+ if(editPart != null) {
osEditParts.add(editPart);
}
}
// reset the layout so that the BorderItemsAwareFreeFormLayer fills its parent FreeformViewport
- if (!(container.getParent().getLayoutManager() instanceof FillLayout)) {
+ if(!(container.getParent().getLayoutManager() instanceof FillLayout)) {
container.getParent().setLayoutManager(new FillLayout());
}
@@ -120,22 +120,21 @@ public class CustomFreeTimeRulerCompartmentEditPart extends FreeTimeRulerCompart
@SuppressWarnings("unchecked")
final List<IFigure> children = container.getChildren();
- for (int i = 0; i < children.size(); i++) {
+ for(int i = 0; i < children.size(); i++) {
final IFigure child = children.get(i);
final List<BorderedNodeFigure> marks = FigureUtils.findChildFigureInstances(child, BorderedNodeFigure.class);
- for (final BorderedNodeFigure verticalMarkFigure : marks) {
+ for(final BorderedNodeFigure verticalMarkFigure : marks) {
final boolean compactLifeline = FigureUtils.findParentFigureInstance(verticalMarkFigure, CompactLifelineFigure.class) != null;
final boolean fullLifeline = FigureUtils.findParentFigureInstance(verticalMarkFigure, FullLifelineFigure.class) != null;
- final TickEditPart tickEditPart = (TickEditPart) visualPartMap.get(verticalMarkFigure);
+ final TickEditPart tickEditPart = (TickEditPart)visualPartMap.get(verticalMarkFigure);
final IGraphicalEditPart occurrenceSpecificationEditPart = TickUtils.findOccurrenceSpecificationEditPartFromTickEditPart(tickEditPart, viewer);
- if (occurrenceSpecificationEditPart != null) {
+ if(occurrenceSpecificationEditPart != null) {
final CompartmentEditPart timelineCompartment = EditPartUtils.findParentTimelineCompartment(occurrenceSpecificationEditPart);
- final GraphicalEditPart interactionEditPart = (InteractionEditPartTN) EditPartUtils.findParentEditPartWithId(timelineCompartment,
- InteractionEditPartTN.VISUAL_ID);
+ final GraphicalEditPart interactionEditPart = (InteractionEditPartTN)EditPartUtils.findParentEditPartWithId(timelineCompartment, InteractionEditPartTN.VISUAL_ID);
final int startX;
- if (fullLifeline) {
+ if(fullLifeline) {
startX = Constants.STATE_DEFINITIONS_WIDTH + 1;
- } else if (compactLifeline) {
+ } else if(compactLifeline) {
startX = 1;
} else {
startX = timelineCompartment.getFigure().getBounds().x - interactionEditPart.getFigure().getBounds().x;
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFreeTimingRulerEditPart.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFreeTimingRulerEditPart.java
index ad4dcb47152..bb5f4faf5a6 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFreeTimingRulerEditPart.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFreeTimingRulerEditPart.java
@@ -30,18 +30,19 @@ public class CustomFreeTimingRulerEditPart extends FreeTimingRulerEditPartCN {
protected IFigure createNodeShape() {
this.primaryShape = new TimingRulerFigure();
this.primaryShape.setLayoutManager(new FillLayout() {
+
@Override
public void layout(final IFigure container) {
- for (final Object child : container.getChildren()) {
- ((IFigure) child).setBounds(container.getBounds());
+ for(final Object child : container.getChildren()) {
+ ((IFigure)child).setBounds(container.getBounds());
}
final ShapeCompartmentFigure compartmentFigure = FigureUtils.findChildFigureInstance(container, ShapeCompartmentFigure.class);
- if (compartmentFigure != null) {
- for (final Object child : compartmentFigure.getChildren()) {
- if (child instanceof ScrollPane) {
- ((ScrollPane) child).setBounds(container.getBounds());
+ if(compartmentFigure != null) {
+ for(final Object child : compartmentFigure.getChildren()) {
+ if(child instanceof ScrollPane) {
+ ((ScrollPane)child).setBounds(container.getBounds());
// ((ScrollPane) child).setBorder(null);
- ((ScrollPane) child).setScrollBarVisibility(org.eclipse.draw2d.ScrollPane.NEVER);
+ ((ScrollPane)child).setScrollBarVisibility(org.eclipse.draw2d.ScrollPane.NEVER);
// ((ScrollPane) child).getViewport().setBounds(container.getBounds());
}
}
@@ -62,6 +63,7 @@ public class CustomFreeTimingRulerEditPart extends FreeTimingRulerEditPartCN {
public DragTracker getDragTracker(final Request request) {
// lock the drag to the containing compartment
return new DragEditPartsTrackerEx(this) {
+
@Override
protected boolean handleDragStarted() {
lockTargetEditPart(CustomFreeTimingRulerEditPart.this.getParent());
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullLifelineEditPartCN.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullLifelineEditPartCN.java
index 63d04ecbc9c..10045576637 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullLifelineEditPartCN.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullLifelineEditPartCN.java
@@ -57,22 +57,23 @@ public class CustomFullLifelineEditPartCN extends FullLifelineEditPartCN {
final FullLifelineFigure lifelineFigure = FigureUtils.findChildFigureInstance(nodeFigure, FullLifelineFigure.class);
// collapses the time ruler rectangle if the time ruler is not used
lifelineFigure.getLifelineDataContainerFigure().setLayoutManager(new AbstractLayout() {
+
public void layout(final IFigure container) {
final int timeRulerHeight = Constants.TIME_RULER_HEIGHT;
final boolean displayTimeRuler = lifelineFigure.isDisplayTimeRuler();
final Rectangle clientArea = container.getClientArea();
@SuppressWarnings("unchecked")
final List<IFigure> children = container.getChildren();
- for (int i = 0; i < children.size(); i++) {
+ for(int i = 0; i < children.size(); i++) {
final IFigure child = children.get(i);
- if (child == lifelineFigure.getChronogramContainerFigure()) {
- if (displayTimeRuler) {
+ if(child == lifelineFigure.getChronogramContainerFigure()) {
+ if(displayTimeRuler) {
child.setBounds(new Rectangle(clientArea).getResized(0, -timeRulerHeight));
} else {
child.setBounds(clientArea);
}
- } else if (child == lifelineFigure.getTimeRulerContainerFigure()) {
- if (displayTimeRuler) {
+ } else if(child == lifelineFigure.getTimeRulerContainerFigure()) {
+ if(displayTimeRuler) {
final Rectangle bounds = new Rectangle(clientArea);
bounds.height = timeRulerHeight;
bounds.y = clientArea.y + clientArea.height - timeRulerHeight;
@@ -96,6 +97,7 @@ public class CustomFullLifelineEditPartCN extends FullLifelineEditPartCN {
public DragTracker getDragTracker(final Request request) {
// lock the drag to the containing compartment
return new DragEditPartsTrackerEx(this) {
+
@Override
protected boolean handleDragStarted() {
lockTargetEditPart(CustomFullLifelineEditPartCN.this.getParent());
@@ -117,7 +119,7 @@ public class CustomFullLifelineEditPartCN extends FullLifelineEditPartCN {
/** Display feedback at the start location (where the create request was started) */
@Override
public ConnectionAnchor getTargetConnectionAnchor(final Request request) {
- if (request instanceof CreateRequest) {
+ if(request instanceof CreateRequest) {
return new XYAnchor(MessageUtils.getLastStartLocation());
}
return super.getTargetConnectionAnchor(request);
@@ -126,8 +128,8 @@ public class CustomFullLifelineEditPartCN extends FullLifelineEditPartCN {
/** Display feedback at the cursor location */
@Override
public ConnectionAnchor getSourceConnectionAnchor(final Request request) {
- if (request instanceof LocationRequest) {
- final LocationRequest locationRequest = (LocationRequest) request;
+ if(request instanceof LocationRequest) {
+ final LocationRequest locationRequest = (LocationRequest)request;
return new XYAnchor(locationRequest.getLocation());
}
return super.getTargetConnectionAnchor(request);
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullLifelineStateDefinitionCompartmentEditPartCN.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullLifelineStateDefinitionCompartmentEditPartCN.java
index b278672e246..a58cc7cb9a9 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullLifelineStateDefinitionCompartmentEditPartCN.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullLifelineStateDefinitionCompartmentEditPartCN.java
@@ -34,7 +34,7 @@ public class CustomFullLifelineStateDefinitionCompartmentEditPartCN extends Full
@Override
public IFigure createFigure() {
- final ResizableCompartmentFigure result = (ResizableCompartmentFigure) super.createFigure();
+ final ResizableCompartmentFigure result = (ResizableCompartmentFigure)super.createFigure();
result.setBorder(null);
result.getScrollPane().getContents().setBorder(null);
@@ -42,10 +42,11 @@ public class CustomFullLifelineStateDefinitionCompartmentEditPartCN extends Full
// layout StateDefinitions so that they are regularly spaced and fill the whole height
result.getContentPane().setLayoutManager(new XYLayout() {
+
@Override
public void layout(final IFigure container) {
// reset the layout so that the BorderItemsAwareFreeFormLayer fills its parent FreeformViewport
- if (!(container.getParent().getLayoutManager() instanceof FillLayout)) {
+ if(!(container.getParent().getLayoutManager() instanceof FillLayout)) {
container.getParent().setLayoutManager(new FillLayout());
}
@@ -56,7 +57,7 @@ public class CustomFullLifelineStateDefinitionCompartmentEditPartCN extends Full
final int nChildren = container.getChildren().size();
final int margin;
final int spacing;
- if (nChildren == 1) {
+ if(nChildren == 1) {
margin = clientArea.height / 2;
spacing = 0;
} else {
@@ -64,8 +65,8 @@ public class CustomFullLifelineStateDefinitionCompartmentEditPartCN extends Full
spacing = (clientArea.height - 2 * margin) / (nChildren - 1);
}
- for (int i = 0; i < nChildren; i++) {
- final IFigure child = (IFigure) container.getChildren().get(i);
+ for(int i = 0; i < nChildren; i++) {
+ final IFigure child = (IFigure)container.getChildren().get(i);
final Dimension ps = child.getPreferredSize();
final int w = ps.width;
// the height is twice as big as needed by default
@@ -94,7 +95,7 @@ public class CustomFullLifelineStateDefinitionCompartmentEditPartCN extends Full
@Override
protected void refreshVisuals() {
super.refreshVisuals();
- ((ResizableCompartmentFigure) getFigure()).getScrollPane().setScrollBarVisibility(org.eclipse.draw2d.ScrollPane.NEVER);
+ ((ResizableCompartmentFigure)getFigure()).getScrollPane().setScrollBarVisibility(org.eclipse.draw2d.ScrollPane.NEVER);
refreshBounds();
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullLifelineTimeRulerCompartmentEditPartCN.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullLifelineTimeRulerCompartmentEditPartCN.java
index 3fb45a6ec98..71fd2b5b84b 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullLifelineTimeRulerCompartmentEditPartCN.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullLifelineTimeRulerCompartmentEditPartCN.java
@@ -24,7 +24,7 @@ public class CustomFullLifelineTimeRulerCompartmentEditPartCN extends FullLifeli
@Override
public IFigure createFigure() {
- final ResizableCompartmentFigure result = (ResizableCompartmentFigure) super.createFigure();
+ final ResizableCompartmentFigure result = (ResizableCompartmentFigure)super.createFigure();
result.setBorder(null);
result.setTitleVisibility(false);
result.setLayoutManager(new FillLayout());
@@ -40,7 +40,7 @@ public class CustomFullLifelineTimeRulerCompartmentEditPartCN extends FullLifeli
@Override
protected void refreshVisuals() {
super.refreshVisuals();
- ((ResizableCompartmentFigure) getFigure()).getScrollPane().setScrollBarVisibility(org.eclipse.draw2d.ScrollPane.NEVER);
+ ((ResizableCompartmentFigure)getFigure()).getScrollPane().setScrollBarVisibility(org.eclipse.draw2d.ScrollPane.NEVER);
refreshBounds();
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullLifelineTimelineCompartmentEditPartCN.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullLifelineTimelineCompartmentEditPartCN.java
index c89f1b8236f..a80ee321816 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullLifelineTimelineCompartmentEditPartCN.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullLifelineTimelineCompartmentEditPartCN.java
@@ -50,20 +50,21 @@ public class CustomFullLifelineTimelineCompartmentEditPartCN extends FullLifelin
@Override
public IFigure createFigure() {
- final ResizableCompartmentFigure figure = (ResizableCompartmentFigure) super.createFigure();
+ final ResizableCompartmentFigure figure = (ResizableCompartmentFigure)super.createFigure();
figure.setBorder(null);
figure.getScrollPane().setBorder(null);
figure.setLayoutManager(new FillLayout());
figure.getContentPane().setLayoutManager(new FreeFormLayoutEx() {
+
@Override
public void layout(final IFigure container) {
final EditPartViewer viewer = CustomFullLifelineTimelineCompartmentEditPartCN.this.getRoot().getViewer();
// reset the layout so that the BorderItemsAwareFreeFormLayer fills its parent FreeformViewport
final IFigure parent = container.getParent();
- if (parent instanceof FreeformViewport) {
- final FreeformViewport freeformViewport = (FreeformViewport) parent;
- if (!(freeformViewport.getLayoutManager() instanceof FillLayout)) {
+ if(parent instanceof FreeformViewport) {
+ final FreeformViewport freeformViewport = (FreeformViewport)parent;
+ if(!(freeformViewport.getLayoutManager() instanceof FillLayout)) {
freeformViewport.setLayoutManager(new FillLayout());
}
// reset the origin if it changed (for example, clicking on a label partly
@@ -78,8 +79,8 @@ public class CustomFullLifelineTimelineCompartmentEditPartCN extends FullLifelin
@SuppressWarnings("unchecked")
final List<IFigure> children = container.getChildren();
final Rectangle[] constraints = new Rectangle[children.size()];
- for (int i = 0; i < children.size(); i++) {
- constraints[i] = (Rectangle) getConstraint(children.get(i));
+ for(int i = 0; i < children.size(); i++) {
+ constraints[i] = (Rectangle)getConstraint(children.get(i));
}
/*
@@ -108,7 +109,7 @@ public class CustomFullLifelineTimelineCompartmentEditPartCN extends FullLifelin
@Override
protected void refreshVisuals() {
super.refreshVisuals();
- ((ResizableCompartmentFigure) getFigure()).getScrollPane().setScrollBarVisibility(org.eclipse.draw2d.ScrollPane.NEVER);
+ ((ResizableCompartmentFigure)getFigure()).getScrollPane().setScrollBarVisibility(org.eclipse.draw2d.ScrollPane.NEVER);
refreshBounds();
}
@@ -122,15 +123,15 @@ public class CustomFullLifelineTimelineCompartmentEditPartCN extends FullLifelin
@Override
public Command getCommand(final Request request) {
// redirect connection requests to the Lifeline (for MessageLost and MessageFound)
- if (request instanceof CreateConnectionRequest) {
- final CreateConnectionRequest createConnectionRequest = (CreateConnectionRequest) request;
- if (RequestConstants.REQ_CONNECTION_START.equals(request.getType())) {
- if (createConnectionRequest.getTargetEditPart() instanceof FullLifelineTimelineCompartmentEditPartCN) {
+ if(request instanceof CreateConnectionRequest) {
+ final CreateConnectionRequest createConnectionRequest = (CreateConnectionRequest)request;
+ if(RequestConstants.REQ_CONNECTION_START.equals(request.getType())) {
+ if(createConnectionRequest.getTargetEditPart() instanceof FullLifelineTimelineCompartmentEditPartCN) {
createConnectionRequest.setTargetEditPart(getParent());
}
return getParent().getCommand(request);
- } else if (RequestConstants.REQ_CONNECTION_END.equals(request.getType())) {
- if (createConnectionRequest.getSourceEditPart() instanceof FullLifelineTimelineCompartmentEditPartCN) {
+ } else if(RequestConstants.REQ_CONNECTION_END.equals(request.getType())) {
+ if(createConnectionRequest.getSourceEditPart() instanceof FullLifelineTimelineCompartmentEditPartCN) {
createConnectionRequest.setSourceEditPart(getParent());
}
return getParent().getCommand(request);
@@ -140,8 +141,7 @@ public class CustomFullLifelineTimelineCompartmentEditPartCN extends FullLifelin
}
/** First pass of the layout */
- protected static void layoutOccurrenceSpecificationsAndStateInvariants(final EditPartViewer viewer, final Rectangle clientArea,
- final List<IFigure> figures, final Rectangle[] constraints) {
+ protected static void layoutOccurrenceSpecificationsAndStateInvariants(final EditPartViewer viewer, final Rectangle clientArea, final List<IFigure> figures, final Rectangle[] constraints) {
int x = clientArea.x;
int y = -1;
@@ -149,13 +149,13 @@ public class CustomFullLifelineTimelineCompartmentEditPartCN extends FullLifelin
Rectangle nextConstraint = null;
IFigure nextFigure = null;
IFigure nextChildFigure = null;
- for (int i = 0; i < figures.size(); i++) {
+ for(int i = 0; i < figures.size(); i++) {
final IFigure figure = figures.get(i);
final FullStateFigure stateInvariantFigure = FigureUtils.findChildFigureInstance(figure, FullStateFigure.class);
final SmallSquareFigure smallSquareFigure = FigureUtils.findChildFigureInstance(figure, SmallSquareFigure.class);
final CrossFigure crossFigure = FigureUtils.findChildFigureInstance(figure, CrossFigure.class);
- if (stateInvariantFigure == null && smallSquareFigure == null && crossFigure == null) {
+ if(stateInvariantFigure == null && smallSquareFigure == null && crossFigure == null) {
continue;
}
@@ -164,16 +164,16 @@ public class CustomFullLifelineTimelineCompartmentEditPartCN extends FullLifelin
nextConstraint = null;
nextFigure = null;
- for (int j = i + 1; j < figures.size(); j++) {
+ for(int j = i + 1; j < figures.size(); j++) {
final IFigure f = figures.get(j);
nextChildFigure = FigureUtils.findChildFigureInstance(f, FullStateFigure.class);
- if (nextChildFigure == null) {
+ if(nextChildFigure == null) {
nextChildFigure = FigureUtils.findChildFigureInstance(f, SmallSquareFigure.class);
}
- if (nextChildFigure == null) {
+ if(nextChildFigure == null) {
nextChildFigure = FigureUtils.findChildFigureInstance(f, CrossFigure.class);
}
- if (nextChildFigure != null) {
+ if(nextChildFigure != null) {
nextConstraint = constraints[j];
nextFigure = f;
break;
@@ -181,18 +181,18 @@ public class CustomFullLifelineTimelineCompartmentEditPartCN extends FullLifelin
}
IFigure occurrenceFigure = null;
- if (smallSquareFigure != null) {
+ if(smallSquareFigure != null) {
occurrenceFigure = smallSquareFigure;
- } else if (crossFigure != null) {
+ } else if(crossFigure != null) {
occurrenceFigure = crossFigure;
}
// OccurrenceSpecification, MessageOccurrenceSpecification or DestructionOccurrenceSpecification
- if (occurrenceFigure != null) {
+ if(occurrenceFigure != null) {
final int occurrenceY;
- if (y == -1) {
+ if(y == -1) {
// the Lifeline starts by an OccurrenceSpecification => align it with the following StateInvariant
- if (nextChildFigure instanceof FullStateFigure) {
+ if(nextChildFigure instanceof FullStateFigure) {
occurrenceY = computeVerticalPosition(nextFigure, viewer);
} else {
Activator.log.warn("The Lifeline starts by an OccurrenceSpecification not followed by a StateInvariant"); //$NON-NLS-1$
@@ -210,11 +210,11 @@ public class CustomFullLifelineTimelineCompartmentEditPartCN extends FullLifelin
}
// StateInvariant
- if (stateInvariantFigure != null) {
+ if(stateInvariantFigure != null) {
final int computedY = computeVerticalPosition(figure, viewer);
stateInvariantFigure.setPosY(computedY);
- if (y == -1) {
+ if(y == -1) {
// first state invariant
prevY = computedY;
} else {
@@ -224,7 +224,7 @@ public class CustomFullLifelineTimelineCompartmentEditPartCN extends FullLifelin
y = computedY;
final int width;
- if (nextConstraint != null) {
+ if(nextConstraint != null) {
// the StateInvariant stops where the next occurrence begins
width = nextConstraint.x - x;
} else {
@@ -232,7 +232,7 @@ public class CustomFullLifelineTimelineCompartmentEditPartCN extends FullLifelin
width = clientArea.width - x;
}
- if (prevY == y) {
+ if(prevY == y) {
// a StateInvariant on the right of an OccurrenceSpecification (or at the beginning)
figure.setBounds(new Rectangle(x, y - 5, width, 10));
} else {
@@ -248,23 +248,23 @@ public class CustomFullLifelineTimelineCompartmentEditPartCN extends FullLifelin
private static int computeVerticalPosition(final IFigure stateInvariantFigure, final EditPartViewer viewer) {
@SuppressWarnings("unchecked")
final Map<IFigure, EditPart> visualPartMap = viewer.getVisualPartMap();
- final CustomFullStateInvariantEditPartCN stateInvariantEditPart = (CustomFullStateInvariantEditPartCN) visualPartMap.get(stateInvariantFigure);
- final View stateInvariantView = (View) stateInvariantEditPart.getModel();
- final StateInvariant stateInvariant = (StateInvariant) stateInvariantView.getElement();
+ final CustomFullStateInvariantEditPartCN stateInvariantEditPart = (CustomFullStateInvariantEditPartCN)visualPartMap.get(stateInvariantFigure);
+ final View stateInvariantView = (View)stateInvariantEditPart.getModel();
+ final StateInvariant stateInvariant = (StateInvariant)stateInvariantView.getElement();
final String id = StateInvariantUtils.getStateInvariantId(stateInvariant);
- if (id == null) {
+ if(id == null) {
Activator.log.error("null id for a StateInvariant", new Exception()); //$NON-NLS-1$
return -1;
}
final View lifelineView = StateDefinitionUtils.getParentLifelineView(stateInvariantView);
final View stateDefinition = StateDefinitionUtils.getStateDefinitionViewWithId(id, lifelineView);
- if (stateDefinition == null) {
+ if(stateDefinition == null) {
Activator.log.error("No StateDefinition found for the StateInvariant (id = " + id + ")", new Exception()); //$NON-NLS-1$//$NON-NLS-2$
return -1;
}
- final StateDefinitionEditPart stateDefinitionEditPart = (StateDefinitionEditPart) viewer.getEditPartRegistry().get(stateDefinition);
+ final StateDefinitionEditPart stateDefinitionEditPart = (StateDefinitionEditPart)viewer.getEditPartRegistry().get(stateDefinition);
final IFigure stateDefinitionFigure = stateDefinitionEditPart.getFigure();
final Rectangle bounds = stateDefinitionFigure.getBounds();
final int parentY = stateDefinitionFigure.getParent().getClientArea().y;
@@ -280,17 +280,15 @@ public class CustomFullLifelineTimelineCompartmentEditPartCN extends FullLifelin
IFigure previousFigure = null;
IFigure nextFigure = null;
- for (int i = 0; i < figures.size(); i++) {
+ for(int i = 0; i < figures.size(); i++) {
final IFigure figure = figures.get(i);
- final FullStateInvariantVerticalLineFigure verticalLineFigure = FigureUtils.findChildFigureInstance(figure,
- FullStateInvariantVerticalLineFigure.class);
+ final FullStateInvariantVerticalLineFigure verticalLineFigure = FigureUtils.findChildFigureInstance(figure, FullStateInvariantVerticalLineFigure.class);
final VerticalMarkFigure verticalMarkFigure = FigureUtils.findChildFigureInstance(figure, VerticalMarkFigure.class);
final DimensioningArrowFigure dimensioningArrowFigure = FigureUtils.findChildFigureInstance(figure, DimensioningArrowFigure.class);
- final GeneralOrderingHorizontalFigure generalOrderingHorizontalFigure = FigureUtils.findChildFigureInstance(figure,
- GeneralOrderingHorizontalFigure.class);
+ final GeneralOrderingHorizontalFigure generalOrderingHorizontalFigure = FigureUtils.findChildFigureInstance(figure, GeneralOrderingHorizontalFigure.class);
nextFigure = null;
- if (i < figures.size() - 1) {
+ if(i < figures.size() - 1) {
nextFigure = figures.get(i + 1);
}
@@ -298,19 +296,19 @@ public class CustomFullLifelineTimelineCompartmentEditPartCN extends FullLifelin
final Rectangle constraint = constraints[i];
// VerticalLine
- if (verticalLineFigure != null) {
+ if(verticalLineFigure != null) {
boolean showVerticalLine = false;
- if (nextFigure != null && previousFigure != null) {
+ if(nextFigure != null && previousFigure != null) {
final Rectangle prev = previousFigure.getBounds();
final int y = prev.y + prev.height / 2;
final int x = prev.x + prev.width / 2;
final Rectangle next = nextFigure.getBounds();
final int y2 = next.y + next.height / 2;
int y1 = y;
- final int sign = (int) Math.signum(y2 - y1);
+ final int sign = (int)Math.signum(y2 - y1);
// move the start of the line outside the OccurrenceSpecification
y1 += sign * (previousFigure.getBounds().height / 2);
- if (y != y2) {
+ if(y != y2) {
showVerticalLine = true;
}
final int verticalLineBoxWidth = 10;
@@ -319,20 +317,20 @@ public class CustomFullLifelineTimelineCompartmentEditPartCN extends FullLifelin
Activator.log.warn("VerticalLine not between two Figures"); //$NON-NLS-1$
}
figure.setVisible(showVerticalLine);
- } else if (verticalMarkFigure != null) {
+ } else if(verticalMarkFigure != null) {
// time observation or constraint
final Dimension size = verticalMarkFigure.getPreferredSize();
figure.setBounds(new Rectangle(constraint.x, constraint.y, size.width, size.height));
- } else if (dimensioningArrowFigure != null) {
+ } else if(dimensioningArrowFigure != null) {
// duration observation or constraint
final Dimension size = dimensioningArrowFigure.getPreferredSize();
- if (constraint.width == Integer.MAX_VALUE) {
+ if(constraint.width == Integer.MAX_VALUE) {
// it has no end => set the right side of the compartment as the end
figure.setBounds(new Rectangle(constraint.x, constraint.y, clientArea.width - constraint.x, size.height));
} else {
figure.setBounds(new Rectangle(constraint.x, constraint.y, constraint.width, size.height));
}
- } else if (generalOrderingHorizontalFigure != null) {
+ } else if(generalOrderingHorizontalFigure != null) {
// general ordering
final Dimension size = generalOrderingHorizontalFigure.getPreferredSize();
figure.setBounds(new Rectangle(constraint.x, constraint.y, constraint.width, size.height));
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullStateInvariantEditPartCN.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullStateInvariantEditPartCN.java
index 2a81902c086..ce6f13589db 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullStateInvariantEditPartCN.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullStateInvariantEditPartCN.java
@@ -64,11 +64,11 @@ public class CustomFullStateInvariantEditPartCN extends FullStateInvariantEditPa
public void performRequest(final Request request) {
// allow creating an OccurrenceSpecification when double-clicking on a StateInvariant line
// (in addition to the OccurrenceSpecification creation tool from the palette)
- if (request.getType() == REQ_OPEN && request instanceof LocationRequest) {
- final StateInvariant stateInvariant = (StateInvariant) ((View) getModel()).getElement();
+ if(request.getType() == REQ_OPEN && request instanceof LocationRequest) {
+ final StateInvariant stateInvariant = (StateInvariant)((View)getModel()).getElement();
final TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(stateInvariant);
// shift by 2 pixels to cut at the center of the OccurrenceSpecification
- final Point loc = new Point(((LocationRequest) request).getLocation()).translate(-SmallSquareFigure.RADIUS, 0);
+ final Point loc = new Point(((LocationRequest)request).getLocation()).translate(-SmallSquareFigure.RADIUS, 0);
final CompositeCommand compositeCommand = new CompositeCommand(Messages.CustomFullStateInvariantEditPartCN_CreateOccurrenceSpecification);
compositeCommand.add(new CutAndInsertOccurrenceSpecificationCommand(this, loc, false));
final EditPart timeline = EditPartUtils.findParentEditPartWithId(this, FullLifelineTimelineCompartmentEditPartCN.VISUAL_ID);
@@ -82,20 +82,20 @@ public class CustomFullStateInvariantEditPartCN extends FullStateInvariantEditPa
@Override
public Command getCommand(final Request request) {
- if (request instanceof ChangeBoundsRequest) {
- final ChangeBoundsRequest changeBoundsRequest = (ChangeBoundsRequest) request;
+ if(request instanceof ChangeBoundsRequest) {
+ final ChangeBoundsRequest changeBoundsRequest = (ChangeBoundsRequest)request;
// we allow moving an OccurrenceSpecification on top of a StateInvariant line
// in this case, we redirect the request to the parent timeline compartment
- if (RequestUtils.isChangeBoundsRequestFor(changeBoundsRequest, UMLPackage.eINSTANCE.getOccurrenceSpecification())) {
+ if(RequestUtils.isChangeBoundsRequestFor(changeBoundsRequest, UMLPackage.eINSTANCE.getOccurrenceSpecification())) {
return getTimelineCompartmentEditPart().getCommand(request);
}
- } else if (request instanceof EditCommandRequestWrapper) {
+ } else if(request instanceof EditCommandRequestWrapper) {
// we also need to forward this request, otherwise the feedback figure stays displayed
- final EditCommandRequestWrapper editCommandRequestWrapper = (EditCommandRequestWrapper) request;
+ final EditCommandRequestWrapper editCommandRequestWrapper = (EditCommandRequestWrapper)request;
final IEditCommandRequest editCommandRequest = editCommandRequestWrapper.getEditCommandRequest();
- if (editCommandRequest instanceof MoveRequest) {
- final MoveRequest moveRequest = (MoveRequest) editCommandRequest;
- if (moveRequest.getTargetContainer() instanceof StateInvariant) {
+ if(editCommandRequest instanceof MoveRequest) {
+ final MoveRequest moveRequest = (MoveRequest)editCommandRequest;
+ if(moveRequest.getTargetContainer() instanceof StateInvariant) {
return getTimelineCompartmentEditPart().getCommand(request);
}
}
@@ -104,15 +104,15 @@ public class CustomFullStateInvariantEditPartCN extends FullStateInvariantEditPa
}
private FullLifelineTimelineCompartmentEditPartCN getTimelineCompartmentEditPart() {
- final FullLifelineTimelineCompartmentEditPartCN timelineEditPart = (FullLifelineTimelineCompartmentEditPartCN) EditPartUtils.findParentEditPartWithId(
- this, FullLifelineTimelineCompartmentEditPartCN.VISUAL_ID);
+ final FullLifelineTimelineCompartmentEditPartCN timelineEditPart = (FullLifelineTimelineCompartmentEditPartCN)EditPartUtils.findParentEditPartWithId(this, FullLifelineTimelineCompartmentEditPartCN.VISUAL_ID);
return timelineEditPart;
}
@Override
protected void addBorderItem(final IFigure borderItemContainer, final IBorderItemEditPart borderItemEditPart) {
- if (borderItemEditPart instanceof FullStateInvariantAppliedStereotypeEditPart) {
+ if(borderItemEditPart instanceof FullStateInvariantAppliedStereotypeEditPart) {
final BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH) {
+
@Override
public int getPreferredSideOfParent() {
/*
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullStateInvariantVerticalLineEditPart.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullStateInvariantVerticalLineEditPart.java
index d7715a6ce12..2cbad2317a4 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullStateInvariantVerticalLineEditPart.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullStateInvariantVerticalLineEditPart.java
@@ -17,6 +17,7 @@ import org.eclipse.papyrus.uml.diagram.timing.custom.parts.NoScrollNoBorderDragE
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullStateInvariantVerticalLineEditPart;
public class CustomFullStateInvariantVerticalLineEditPart extends FullStateInvariantVerticalLineEditPart {
+
public CustomFullStateInvariantVerticalLineEditPart(final View view) {
super(view);
}
@@ -33,7 +34,7 @@ public class CustomFullStateInvariantVerticalLineEditPart extends FullStateInvar
@Override
public Command getCommand(final Request request) {
- if (request.getType() == REQ_DELETE || request.getType() == REQ_RECONNECT_TARGET) {
+ if(request.getType() == REQ_DELETE || request.getType() == REQ_RECONNECT_TARGET) {
// don't let the user remove vertical lines, or reconnect anything to a vertical line
return UnexecutableCommand.INSTANCE;
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomGateEditPart.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomGateEditPart.java
index 3fda430acb2..18dc672871c 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomGateEditPart.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomGateEditPart.java
@@ -12,7 +12,6 @@ import org.eclipse.gef.editpolicies.LayoutEditPolicy;
import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies.ExternalLabelPrimaryDragRoleEditPolicy;
import org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies.LayoutEditPolicyForLabel;
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.GateEditPart;
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.GateLabelEditPart;
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomGeneralOrderingEditPart.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomGeneralOrderingEditPart.java
index def16e6a153..f975300e85d 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomGeneralOrderingEditPart.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomGeneralOrderingEditPart.java
@@ -12,7 +12,6 @@ import org.eclipse.gef.DragTracker;
import org.eclipse.gef.Request;
import org.eclipse.gef.editpolicies.LayoutEditPolicy;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies.ExternalLabelPrimaryDragRoleEditPolicy;
import org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies.LayoutEditPolicyForLabel;
import org.eclipse.papyrus.uml.diagram.timing.custom.parts.NoScrollNoBorderDragEditPartsTracker;
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.GeneralOrderingEditPart;
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomInteractionCompartmentEditPartTN.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomInteractionCompartmentEditPartTN.java
index 07ce203cb41..83a370860e7 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomInteractionCompartmentEditPartTN.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomInteractionCompartmentEditPartTN.java
@@ -42,28 +42,29 @@ public class CustomInteractionCompartmentEditPartTN extends InteractionCompartme
@Override
public IFigure createFigure() {
- final ResizableCompartmentFigure result = (ResizableCompartmentFigure) super.createFigure();
+ final ResizableCompartmentFigure result = (ResizableCompartmentFigure)super.createFigure();
result.setTitleVisibility(false);
result.setBorder(null);
result.setLayoutManager(new FillLayout());
// each lifeline takes a height proportional to its number of states
result.getContentPane().setLayoutManager(new AbstractLayout() {
+
public void layout(final IFigure container) {
@SuppressWarnings("unchecked")
final List<IFigure> children = container.getChildren();
final Rectangle clientArea = container.getClientArea();
final Map<IFigure, Integer> numberOfStates = computeNumberOfStates(children);
double totalStates = 0;
- for (final Integer nStates : numberOfStates.values()) {
+ for(final Integer nStates : numberOfStates.values()) {
totalStates += Math.max(nStates.intValue(), 1);
}
int y = clientArea.y;
final int totalHeight = clientArea.height - Constants.MARGIN_BETWEEN_LIFELINES * (children.size() - 1);
- for (final IFigure child : children) {
+ for(final IFigure child : children) {
final Integer nStates = numberOfStates.get(child);
- if (nStates != null) {
- final int height = (int) (totalHeight * (Math.max(nStates.doubleValue(), 1) / totalStates));
+ if(nStates != null) {
+ final int height = (int)(totalHeight * (Math.max(nStates.doubleValue(), 1) / totalStates));
child.setBounds(new Rectangle(clientArea.x, y, clientArea.width, height));
y += height + Constants.MARGIN_BETWEEN_LIFELINES;
}
@@ -82,20 +83,19 @@ public class CustomInteractionCompartmentEditPartTN extends InteractionCompartme
protected Map<IFigure, Integer> computeNumberOfStates(final List<IFigure> children) {
final LinkedHashMap<IFigure, Integer> numberOfStatesPerLifeline = new LinkedHashMap<IFigure, Integer>();
final EditPartViewer viewer = CustomInteractionCompartmentEditPartTN.this.getRoot().getViewer();
- for (int i = 0; i < children.size(); i++) {
+ for(int i = 0; i < children.size(); i++) {
final IFigure child = children.get(i);
- if (FigureUtils.findChildFigureInstance(child, FullLifelineFigure.class) != null) {
+ if(FigureUtils.findChildFigureInstance(child, FullLifelineFigure.class) != null) {
@SuppressWarnings("unchecked")
final Map<IFigure, EditPart> visualPartMap = viewer.getVisualPartMap();
- final FullLifelineEditPartCN lifelineEditPart = (FullLifelineEditPartCN) visualPartMap.get(child);
- final View lifelineView = (View) lifelineEditPart.getModel();
+ final FullLifelineEditPartCN lifelineEditPart = (FullLifelineEditPartCN)visualPartMap.get(child);
+ final View lifelineView = (View)lifelineEditPart.getModel();
final int nStates = findNumberOfStatesDisplayedIn(lifelineView);
numberOfStatesPerLifeline.put(child, Integer.valueOf(nStates));
- } else if (FigureUtils.findChildFigureInstance(child, CompactLifelineFigure.class) != null) {
+ } else if(FigureUtils.findChildFigureInstance(child, CompactLifelineFigure.class) != null) {
numberOfStatesPerLifeline.put(child, Integer.valueOf(1));
} else {
- Activator.log
- .warn("Only instances of " + FullLifelineFigure.class.getSimpleName() + " are expected in the compartment " + CustomInteractionCompartmentEditPartTN.class.getSimpleName()); //$NON-NLS-1$//$NON-NLS-2$
+ Activator.log.warn("Only instances of " + FullLifelineFigure.class.getSimpleName() + " are expected in the compartment " + CustomInteractionCompartmentEditPartTN.class.getSimpleName()); //$NON-NLS-1$//$NON-NLS-2$
continue;
}
@@ -109,8 +109,8 @@ public class CustomInteractionCompartmentEditPartTN extends InteractionCompartme
@SuppressWarnings("unchecked")
final EList<View> children = stateDefinitionCompartment.getChildren();
final String stateDefID = Integer.toString(StateDefinitionEditPart.VISUAL_ID);
- for (final View view : children) {
- if (stateDefID.equals(view.getType())) {
+ for(final View view : children) {
+ if(stateDefID.equals(view.getType())) {
n++;
}
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomInteractionEditPartTN.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomInteractionEditPartTN.java
index 850f6da8645..ba0a089badc 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomInteractionEditPartTN.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomInteractionEditPartTN.java
@@ -40,6 +40,7 @@ import org.eclipse.papyrus.uml.diagram.timing.part.UMLVisualIDRegistry;
public class CustomInteractionEditPartTN extends InteractionEditPartTN {
private static final int HEADER_HEIGHT_PADDING = 4;
+
private static final int MIN_HEADER_HEIGHT = 21;
public CustomInteractionEditPartTN(final View view) {
@@ -63,30 +64,27 @@ public class CustomInteractionEditPartTN extends InteractionEditPartTN {
@SuppressWarnings("unchecked")
final List<IFigure> children = container.getChildren();
int consumedHeight = 0;
- for (int i = 0; i < children.size(); i++) {
+ for(int i = 0; i < children.size(); i++) {
final IFigure child = children.get(i);
- if (child.equals(interactionRectangleFigure.getHeaderLabelContainer())) {
- final int height = Math.max(interactionRectangleFigure.getHeaderLabel().getPreferredSize().height + HEADER_HEIGHT_PADDING,
- MIN_HEADER_HEIGHT);
+ if(child.equals(interactionRectangleFigure.getHeaderLabelContainer())) {
+ final int height = Math.max(interactionRectangleFigure.getHeaderLabel().getPreferredSize().height + HEADER_HEIGHT_PADDING, MIN_HEADER_HEIGHT);
child.setBounds(new Rectangle(clientArea.x, clientArea.y + consumedHeight, clientArea.width, height));
consumedHeight = consumedHeight + height;
- } else if (child.equals(interactionRectangleFigure.getCompartmentFigure())) {
- child.setBounds(new Rectangle(clientArea.x, clientArea.y + consumedHeight, clientArea.width, clientArea.height - 3 - consumedHeight
- - Constants.TIME_RULER_HEIGHT));
+ } else if(child.equals(interactionRectangleFigure.getCompartmentFigure())) {
+ child.setBounds(new Rectangle(clientArea.x, clientArea.y + consumedHeight, clientArea.width, clientArea.height - 3 - consumedHeight - Constants.TIME_RULER_HEIGHT));
- } else if (child instanceof StereotypePropertiesCompartment) {
+ } else if(child instanceof StereotypePropertiesCompartment) {
final int height = child.getPreferredSize().height;
child.setBounds(new Rectangle(clientArea.x, clientArea.y + consumedHeight, clientArea.width, height));
consumedHeight += height;
- } else if (child.equals(interactionRectangleFigure.getTimeRulerContainerFigure())) {
- child.setBounds(new Rectangle(clientArea.x, clientArea.y + clientArea.height - Constants.TIME_RULER_HEIGHT, clientArea.width,
- Constants.TIME_RULER_HEIGHT));
+ } else if(child.equals(interactionRectangleFigure.getTimeRulerContainerFigure())) {
+ child.setBounds(new Rectangle(clientArea.x, clientArea.y + clientArea.height - Constants.TIME_RULER_HEIGHT, clientArea.width, Constants.TIME_RULER_HEIGHT));
consumedHeight += Constants.TIME_RULER_HEIGHT;
- } else if (i == 0 && !(child instanceof WrappingLabel)) {
+ } else if(i == 0 && !(child instanceof WrappingLabel)) {
consumedHeight = consumedHeight + child.getPreferredSize().height;
child.setBounds(new Rectangle(clientArea.x, clientArea.y, clientArea.width, consumedHeight));
} else {
- if (i == 0 && !(child instanceof WrappingLabel)) {
+ if(i == 0 && !(child instanceof WrappingLabel)) {
consumedHeight = consumedHeight + child.getPreferredSize().height;
child.setBounds(new Rectangle(clientArea.x, clientArea.y, clientArea.width, consumedHeight));
} else {
@@ -108,14 +106,14 @@ public class CustomInteractionEditPartTN extends InteractionEditPartTN {
@Override
public Command getCommand(final Request request) {
// redirect the "drop objects" request to the compartment
- if (request instanceof DropObjectsRequest) {
- final DropObjectsRequest dropObjectsRequest = (DropObjectsRequest) request;
+ if(request instanceof DropObjectsRequest) {
+ final DropObjectsRequest dropObjectsRequest = (DropObjectsRequest)request;
final EditPart compartment = EditPartUtils.findFirstChildEditPartWithId(this, InteractionCompartmentEditPartTN.VISUAL_ID);
- if (compartment != null) {
+ if(compartment != null) {
return compartment.getCommand(dropObjectsRequest);
}
Activator.log.error(new IllegalStateException("No " + InteractionCompartmentEditPartTN.class.getSimpleName() + " found in the " //$NON-NLS-1$ //$NON-NLS-2$
- + CustomInteractionEditPartTN.class.getSimpleName()));
+ + CustomInteractionEditPartTN.class.getSimpleName()));
}
return super.getCommand(request);
}
@@ -126,10 +124,10 @@ public class CustomInteractionEditPartTN extends InteractionEditPartTN {
@Override
protected EditPolicy createChildEditPolicy(final EditPart child) {
- final View childView = (View) child.getModel();
+ final View childView = (View)child.getModel();
final int visualID = UMLVisualIDRegistry.getVisualID(childView);
// don't let Gates be resized
- if (visualID == GateEditPart.VISUAL_ID) {
+ if(visualID == GateEditPart.VISUAL_ID) {
return new BorderItemSelectionEditPolicy();
}
return new NonResizableEditPolicy();
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomMessageFoundEditPart.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomMessageFoundEditPart.java
index 1de626403bb..f844d954929 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomMessageFoundEditPart.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomMessageFoundEditPart.java
@@ -23,7 +23,7 @@ public class CustomMessageFoundEditPart extends MessageFoundEditPart {
@Override
public Command getCommand(final Request request) {
- if (request instanceof BendpointRequest) {
+ if(request instanceof BendpointRequest) {
// disable bendpoints on MessageFound (to avoid a bug with anchor locations,
// and because they are not appropriate anyway)
return UnexecutableCommand.INSTANCE;
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomMessageLostEditPart.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomMessageLostEditPart.java
index 04bb402ea0f..a489825c531 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomMessageLostEditPart.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomMessageLostEditPart.java
@@ -23,7 +23,7 @@ public class CustomMessageLostEditPart extends MessageLostEditPart {
@Override
public Command getCommand(final Request request) {
- if (request instanceof BendpointRequest) {
+ if(request instanceof BendpointRequest) {
// disable bendpoints on MessageLost (to avoid a bug with anchor locations,
// and because they are not appropriate anyway)
return UnexecutableCommand.INSTANCE;
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomMessageOccurrenceSpecificationEditPartCN.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomMessageOccurrenceSpecificationEditPartCN.java
index 06acf51507a..93561b580f7 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomMessageOccurrenceSpecificationEditPartCN.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomMessageOccurrenceSpecificationEditPartCN.java
@@ -14,7 +14,6 @@ import org.eclipse.gef.DragTracker;
import org.eclipse.gef.Request;
import org.eclipse.gef.editpolicies.LayoutEditPolicy;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies.ExternalLabelPrimaryDragRoleEditPolicy;
import org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies.LayoutEditPolicyForLabel;
import org.eclipse.papyrus.uml.diagram.timing.custom.parts.NoScrollNoBorderDragEditPartsTracker;
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.MessageOccurrenceSpecificationEditPartCN;
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomMessageOccurrenceSpecificationLabelEditPart.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomMessageOccurrenceSpecificationLabelEditPart.java
index 9c3750bc5e7..98cc4f5d681 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomMessageOccurrenceSpecificationLabelEditPart.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomMessageOccurrenceSpecificationLabelEditPart.java
@@ -14,6 +14,7 @@ import org.eclipse.papyrus.uml.diagram.timing.custom.parsers.OccurrenceSpecifica
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.MessageOccurrenceSpecificationLabelEditPart;
public class CustomMessageOccurrenceSpecificationLabelEditPart extends MessageOccurrenceSpecificationLabelEditPart {
+
private IParser parser;
public CustomMessageOccurrenceSpecificationLabelEditPart(final View view) {
@@ -22,7 +23,7 @@ public class CustomMessageOccurrenceSpecificationLabelEditPart extends MessageOc
@Override
public IParser getParser() {
- if (this.parser == null) {
+ if(this.parser == null) {
this.parser = new OccurrenceSpecificationNameParser();
}
return this.parser;
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomOccurrenceSpecificationEditPartCN.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomOccurrenceSpecificationEditPartCN.java
index 11881936a4d..c5455293011 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomOccurrenceSpecificationEditPartCN.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomOccurrenceSpecificationEditPartCN.java
@@ -14,7 +14,6 @@ import org.eclipse.gef.DragTracker;
import org.eclipse.gef.Request;
import org.eclipse.gef.editpolicies.LayoutEditPolicy;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies.ExternalLabelPrimaryDragRoleEditPolicy;
import org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies.LayoutEditPolicyForLabel;
import org.eclipse.papyrus.uml.diagram.timing.custom.parts.NoScrollNoBorderDragEditPartsTracker;
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.OccurrenceSpecificationEditPartCN;
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomOccurrenceSpecificationLabelEditPart.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomOccurrenceSpecificationLabelEditPart.java
index e6ca71b47ec..ac828ee1156 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomOccurrenceSpecificationLabelEditPart.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomOccurrenceSpecificationLabelEditPart.java
@@ -14,6 +14,7 @@ import org.eclipse.papyrus.uml.diagram.timing.custom.parsers.OccurrenceSpecifica
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.OccurrenceSpecificationLabelEditPart;
public class CustomOccurrenceSpecificationLabelEditPart extends OccurrenceSpecificationLabelEditPart {
+
private IParser parser;
public CustomOccurrenceSpecificationLabelEditPart(final View view) {
@@ -22,7 +23,7 @@ public class CustomOccurrenceSpecificationLabelEditPart extends OccurrenceSpecif
@Override
public IParser getParser() {
- if (this.parser == null) {
+ if(this.parser == null) {
this.parser = new OccurrenceSpecificationNameParser();
}
return this.parser;
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomStateDefinitionEditPart.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomStateDefinitionEditPart.java
index f0d33eb0b2d..95c4731406a 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomStateDefinitionEditPart.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomStateDefinitionEditPart.java
@@ -59,15 +59,14 @@ public class CustomStateDefinitionEditPart extends StateDefinitionEditPart {
@Override
public Command getCommand(final Request request) {
- if (request.getType() == REQ_DELETE) {
- final FullLifelineEditPartCN lifelineEditPart = (FullLifelineEditPartCN) EditPartUtils.findParentEditPartWithId(this,
- FullLifelineEditPartCN.VISUAL_ID);
- final Lifeline lifeline = (Lifeline) ((View) lifelineEditPart.getModel()).getElement();
- final View view = (View) getModel();
+ if(request.getType() == REQ_DELETE) {
+ final FullLifelineEditPartCN lifelineEditPart = (FullLifelineEditPartCN)EditPartUtils.findParentEditPartWithId(this, FullLifelineEditPartCN.VISUAL_ID);
+ final Lifeline lifeline = (Lifeline)((View)lifelineEditPart.getModel()).getElement();
+ final View view = (View)getModel();
final String id = StateDefinitionUtils.getStateDefinitionViewID(view);
- if (lifeline.getInteraction() != null) {
+ if(lifeline.getInteraction() != null) {
final List<StateInvariant> stateInvariants = StateInvariantUtils.findStateInvariantsWithId(id, lifeline.getInteraction());
- if (stateInvariants.size() > 0) {
+ if(stateInvariants.size() > 0) {
// cannot delete a StateDefinition used in a StateInvariant
return UnexecutableCommand.INSTANCE;
}
@@ -81,7 +80,7 @@ public class CustomStateDefinitionEditPart extends StateDefinitionEditPart {
return compoundCommand;
}
- if (request.getType() == REQ_RECONNECT_TARGET) {
+ if(request.getType() == REQ_RECONNECT_TARGET) {
// don't let the user reconnect anything to a state definition
return UnexecutableCommand.INSTANCE;
}
@@ -94,7 +93,7 @@ public class CustomStateDefinitionEditPart extends StateDefinitionEditPart {
// There is no semantic element, so we return null in order for Papyrus to handle
// the delete menu action enablement correctly.
// XXX warning: this might cause unforeseen bugs somewhere else.
- if (key == EObject.class) {
+ if(key == EObject.class) {
return null;
}
return super.getAdapter(key);
@@ -104,6 +103,7 @@ public class CustomStateDefinitionEditPart extends StateDefinitionEditPart {
public DragTracker getDragTracker(final Request request) {
// lock the drag to the containing compartment
return new DragEditPartsTrackerEx(this) {
+
@Override
protected boolean handleDragStarted() {
lockTargetEditPart(CustomStateDefinitionEditPart.this.getParent());
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomStateDefinitionLabelEditPart.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomStateDefinitionLabelEditPart.java
index 6b6905a82fb..86f6a82aeb0 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomStateDefinitionLabelEditPart.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomStateDefinitionLabelEditPart.java
@@ -28,7 +28,7 @@ public class CustomStateDefinitionLabelEditPart extends StateDefinitionLabelEdit
@Override
public Command getCommand(final Request request) {
- if (request.getType() == REQ_DELETE) {
+ if(request.getType() == REQ_DELETE) {
// if the StateDefinitionLabel is selected, then delete the parent StateDefinition
return getParent().getCommand(request);
}
@@ -41,7 +41,7 @@ public class CustomStateDefinitionLabelEditPart extends StateDefinitionLabelEdit
*/
@Override
public IParser getParser() {
- if (this.parser == null) {
+ if(this.parser == null) {
this.parser = new StateDefinitionParser();
}
return this.parser;
@@ -53,7 +53,7 @@ public class CustomStateDefinitionLabelEditPart extends StateDefinitionLabelEdit
// There is no semantic element, so we return null in order for Papyrus to handle
// the delete menu action enablement correctly.
// XXX warning: this might cause unforeseen bugs somewhere else.
- if (key == EObject.class) {
+ if(key == EObject.class) {
return null;
}
return super.getAdapter(key);
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTickEditPart.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTickEditPart.java
index b04f6ac382c..3ab76e8ec7d 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTickEditPart.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTickEditPart.java
@@ -14,7 +14,6 @@ import org.eclipse.gef.DragTracker;
import org.eclipse.gef.Request;
import org.eclipse.gef.editpolicies.LayoutEditPolicy;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies.ExternalLabelPrimaryDragRoleEditPolicy;
import org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies.LayoutEditPolicyForLabel;
import org.eclipse.papyrus.uml.diagram.timing.custom.parts.NoScrollNoBorderDragEditPartsTracker;
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.TickEditPart;
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimeConstraintEditPart.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimeConstraintEditPart.java
index f5d9e9b3f6f..9af67319b9b 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimeConstraintEditPart.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimeConstraintEditPart.java
@@ -14,7 +14,6 @@ import org.eclipse.gef.DragTracker;
import org.eclipse.gef.Request;
import org.eclipse.gef.editpolicies.LayoutEditPolicy;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies.ExternalLabelPrimaryDragRoleEditPolicy;
import org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies.LayoutEditPolicyForLabel;
import org.eclipse.papyrus.uml.diagram.timing.custom.parts.NoScrollNoBorderDragEditPartsTracker;
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.TimeConstraintEditPart;
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimeObservationEditPart.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimeObservationEditPart.java
index a2a2ff2ad3a..12d69cc56e1 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimeObservationEditPart.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimeObservationEditPart.java
@@ -14,7 +14,6 @@ import org.eclipse.gef.DragTracker;
import org.eclipse.gef.Request;
import org.eclipse.gef.editpolicies.LayoutEditPolicy;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies.ExternalLabelPrimaryDragRoleEditPolicy;
import org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies.LayoutEditPolicyForLabel;
import org.eclipse.papyrus.uml.diagram.timing.custom.parts.NoScrollNoBorderDragEditPartsTracker;
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.TimeObservationEditPart;
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimeRulerCompartmentEditPartCN.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimeRulerCompartmentEditPartCN.java
index 2b761123e10..3b3761502ed 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimeRulerCompartmentEditPartCN.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimeRulerCompartmentEditPartCN.java
@@ -23,7 +23,7 @@ public class CustomTimeRulerCompartmentEditPartCN extends TimeRulerCompartmentEd
@Override
public IFigure createFigure() {
- final ResizableCompartmentFigure result = (ResizableCompartmentFigure) super.createFigure();
+ final ResizableCompartmentFigure result = (ResizableCompartmentFigure)super.createFigure();
result.setTitleVisibility(false);
result.setLayoutManager(new FillLayout());
result.getContentPane().setLayoutManager(new TimeRulerLayout());
@@ -38,7 +38,7 @@ public class CustomTimeRulerCompartmentEditPartCN extends TimeRulerCompartmentEd
@Override
protected void refreshVisuals() {
super.refreshVisuals();
- ((ResizableCompartmentFigure) getFigure()).getScrollPane().setScrollBarVisibility(org.eclipse.draw2d.ScrollPane.NEVER);
+ ((ResizableCompartmentFigure)getFigure()).getScrollPane().setScrollBarVisibility(org.eclipse.draw2d.ScrollPane.NEVER);
refreshBounds();
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimingDiagramEditPart.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimingDiagramEditPart.java
index 53a5cea8884..0207d71df26 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimingDiagramEditPart.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimingDiagramEditPart.java
@@ -21,6 +21,7 @@ import org.eclipse.papyrus.uml.diagram.timing.edit.parts.InteractionEditPartTN;
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.TimingDiagramEditPart;
public class CustomTimingDiagramEditPart extends TimingDiagramEditPart {
+
public CustomTimingDiagramEditPart(final View view) {
super(view);
}
@@ -28,7 +29,7 @@ public class CustomTimingDiagramEditPart extends TimingDiagramEditPart {
@SuppressWarnings("unchecked")
@Override
public Command getCommand(final Request request) {
- if (request.getType() == RequestConstants.REQ_DROP && !canBeDropped(((GroupRequest) request).getEditParts())) {
+ if(request.getType() == RequestConstants.REQ_DROP && !canBeDropped(((GroupRequest)request).getEditParts())) {
// this fixes the bug where an OccurrenceSpecification could be moved out of its timeline
return UnexecutableCommand.INSTANCE;
}
@@ -36,8 +37,8 @@ public class CustomTimingDiagramEditPart extends TimingDiagramEditPart {
}
private static boolean canBeDropped(final List<EditPart> editParts) {
- for (final EditPart editPart : editParts) {
- if (!(editPart instanceof InteractionEditPartTN)) {
+ for(final EditPart editPart : editParts) {
+ if(!(editPart instanceof InteractionEditPartTN)) {
return false;
}
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomUMLEditPartFactory.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomUMLEditPartFactory.java
index a64aab50a8a..795f571b4ed 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomUMLEditPartFactory.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomUMLEditPartFactory.java
@@ -50,12 +50,13 @@ import org.eclipse.papyrus.uml.diagram.timing.edit.parts.UMLEditPartFactory;
import org.eclipse.papyrus.uml.diagram.timing.part.UMLVisualIDRegistry;
public class CustomUMLEditPartFactory extends UMLEditPartFactory {
+
@Override
public EditPart createEditPart(final EditPart context, final Object model) {
- if (model instanceof View) {
- final View view = (View) model;
+ if(model instanceof View) {
+ final View view = (View)model;
final int visualID = UMLVisualIDRegistry.getVisualID(view);
- switch (visualID) {
+ switch(visualID) {
case TimingDiagramEditPart.VISUAL_ID:// 1
return new CustomTimingDiagramEditPart(view);
case InteractionEditPartTN.VISUAL_ID:// 2
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/AbstractTimelineLayoutPolicy.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/AbstractTimelineLayoutPolicy.java
index 28d29ec4373..f32ec34a57d 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/AbstractTimelineLayoutPolicy.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/AbstractTimelineLayoutPolicy.java
@@ -59,16 +59,16 @@ public class AbstractTimelineLayoutPolicy extends XYLayoutEditPolicy {
@Override
public Command getCommand(final Request request) {
- if (request instanceof ChangeBoundsRequest && request.getType() == RequestConstants.REQ_ADD) {
+ if(request instanceof ChangeBoundsRequest && request.getType() == RequestConstants.REQ_ADD) {
// deny adding an element into another element (since this breaks everything)
request.setType(REQ_MOVE_CHILDREN);
}
- if (request == UPDATE_LAYOUT_REQUEST) {
+ if(request == UPDATE_LAYOUT_REQUEST) {
return getUpdateTimeElementsCommand();
}
final Command superCommand = super.getCommand(request);
// update the locations of time elements each time an element is added or moved in the timeline
- if (superCommand != null && (request instanceof ChangeBoundsRequest || request.getType() == RequestConstants.REQ_CREATE)) {
+ if(superCommand != null && (request instanceof ChangeBoundsRequest || request.getType() == RequestConstants.REQ_CREATE)) {
final CompoundCommand compoundCommand = new CompoundCommand();
compoundCommand.add(superCommand);
compoundCommand.add(getUpdateTimeElementsCommand());
@@ -78,33 +78,33 @@ public class AbstractTimelineLayoutPolicy extends XYLayoutEditPolicy {
}
/**
- * Returns a command that moves the given node (that represents an OccurrenceSpecification) <code>moveDeltaX</code>
- * pixels to the right (or left if negative).
+ * Returns a command that moves the given node (that represents an OccurrenceSpecification) <code>moveDeltaX</code> pixels to the right (or left
+ * if negative).
*
* @param occurrenceSpecificationNode
- * the node to move
+ * the node to move
* @param moveDelta
- * how much to move
+ * how much to move
* @param timelineCompartmentView
- * the parent compartment
+ * the parent compartment
* @param occurrenceSpecificationIndex
- * the index of the OccurrenceSpecification Node in its parent compartment
+ * the index of the OccurrenceSpecification Node in its parent compartment
* @param nodesToIgnore
- * these nodes will not constrain the new position
+ * these nodes will not constrain the new position
* @return the command
*/
- protected static Command getMoveOccurrenceSpecificationCommand(final Node occurrenceSpecificationNode, final Point moveDelta,
- final View timelineCompartmentView, final int occurrenceSpecificationIndex, final List<Node> nodesToIgnore) {
+ protected static Command getMoveOccurrenceSpecificationCommand(final Node occurrenceSpecificationNode, final Point moveDelta, final View timelineCompartmentView, final int occurrenceSpecificationIndex, final List<Node> nodesToIgnore) {
final LayoutConstraint layoutConstraint = occurrenceSpecificationNode.getLayoutConstraint();
- if (layoutConstraint instanceof Location) {
- final Location location = (Location) layoutConstraint;
+ if(layoutConstraint instanceof Location) {
+ final Location location = (Location)layoutConstraint;
final int posX = location.getX() + moveDelta.x;
final int posY = location.getY() + moveDelta.y;
final int min = findMin(timelineCompartmentView, occurrenceSpecificationIndex, nodesToIgnore);
final int max = findMax(timelineCompartmentView, occurrenceSpecificationIndex, nodesToIgnore);
- final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification) occurrenceSpecificationNode.getElement();
+ final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification)occurrenceSpecificationNode.getElement();
final TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(occurrenceSpecification);
return new ICommandProxy(new AbstractTransactionalCommand(editingDomain, Messages.AbstractTimelineLayoutPolicy_MoveOccurrenceSpecification, null) {
+
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
final Location loc = NotationFactory.eINSTANCE.createLocation();
@@ -124,23 +124,23 @@ public class AbstractTimelineLayoutPolicy extends XYLayoutEditPolicy {
* Find the maximum abscissa of the OccurrenceSpecification at the given index
*
* @param timelineCompartmentView
- * the parent timeline compartment view
+ * the parent timeline compartment view
* @param index
- * the index of the OccurrenceSpecification in the compartment view's children
+ * the index of the OccurrenceSpecification in the compartment view's children
* @param nodesToIgnore
* @param nodesToIgnore
- * these nodes will be ignored when computing the maximum position
+ * these nodes will be ignored when computing the maximum position
* @return the maximum abscissa
*/
protected static int findMax(final View timelineCompartmentView, final int index, final List<Node> nodesToIgnore) {
@SuppressWarnings("unchecked")
final EList<View> children = timelineCompartmentView.getChildren();
- for (int i = index + 1; i < children.size(); i++) {
+ for(int i = index + 1; i < children.size(); i++) {
final View childView = children.get(i);
- if (!nodesToIgnore.contains(childView) && childView.getElement() instanceof OccurrenceSpecification) {
- final LayoutConstraint layoutConstraint = ((Node) childView).getLayoutConstraint();
- if (layoutConstraint instanceof Location) {
- final Location location = (Location) layoutConstraint;
+ if(!nodesToIgnore.contains(childView) && childView.getElement() instanceof OccurrenceSpecification) {
+ final LayoutConstraint layoutConstraint = ((Node)childView).getLayoutConstraint();
+ if(layoutConstraint instanceof Location) {
+ final Location location = (Location)layoutConstraint;
return location.getX() - Constants.MINIMUM_DISTANCE_BETWEEN_OCCURRENCE_SPECIFICATIONS;
}
}
@@ -152,22 +152,22 @@ public class AbstractTimelineLayoutPolicy extends XYLayoutEditPolicy {
* Find the minimum abscissa of the OccurrenceSpecification at the given index
*
* @param timelineCompartmentView
- * the parent timeline compartment view
+ * the parent timeline compartment view
* @param index
- * the index of the OccurrenceSpecification in the compartment view's children
+ * the index of the OccurrenceSpecification in the compartment view's children
* @param nodesToIgnore
- * these nodes will be ignored when computing the minimum position
+ * these nodes will be ignored when computing the minimum position
* @return the minimum abscissa
*/
protected static int findMin(final View timelineCompartmentView, final int index, final List<Node> nodesToIgnore) {
@SuppressWarnings("unchecked")
final EList<View> children = timelineCompartmentView.getChildren();
- for (int i = index - 1; i >= 0; i--) {
+ for(int i = index - 1; i >= 0; i--) {
final View childView = children.get(i);
- if (!nodesToIgnore.contains(childView) && childView.getElement() instanceof OccurrenceSpecification) {
- final LayoutConstraint layoutConstraint = ((Node) childView).getLayoutConstraint();
- if (layoutConstraint instanceof Location) {
- final Location location = (Location) layoutConstraint;
+ if(!nodesToIgnore.contains(childView) && childView.getElement() instanceof OccurrenceSpecification) {
+ final LayoutConstraint layoutConstraint = ((Node)childView).getLayoutConstraint();
+ if(layoutConstraint instanceof Location) {
+ final Location location = (Location)layoutConstraint;
return location.getX() + Constants.MINIMUM_DISTANCE_BETWEEN_OCCURRENCE_SPECIFICATIONS;
}
}
@@ -177,57 +177,58 @@ public class AbstractTimelineLayoutPolicy extends XYLayoutEditPolicy {
/** Returns a command that updates the positions of time elements, relative to the element they are attached to */
protected Command getUpdateTimeElementsCommand() {
- final GraphicalEditPart timelineCompartmentEditPart = (GraphicalEditPart) getHost();
- final Node compartmentView = (Node) timelineCompartmentEditPart.getModel();
+ final GraphicalEditPart timelineCompartmentEditPart = (GraphicalEditPart)getHost();
+ final Node compartmentView = (Node)timelineCompartmentEditPart.getModel();
final boolean compact = timelineCompartmentEditPart instanceof CompactLifelineCompartmentEditPartCN;
final int width = timelineCompartmentEditPart.getFigure().getSize().width;
final TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(compartmentView);
return new ICommandProxy(new AbstractTransactionalCommand(editingDomain, Messages.AbstractTimelineLayoutPolicy_UpdateLocationOfTimeElements, null) {
+
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
@SuppressWarnings("unchecked")
final EList<View> children = compartmentView.getChildren();
- for (final View child : children) {
+ for(final View child : children) {
final EObject element = child.getElement();
- if (element instanceof TimeObservation) {
- final TimeObservation timeObservation = (TimeObservation) element;
- final Node timeObservationNode = ((Node) child);
+ if(element instanceof TimeObservation) {
+ final TimeObservation timeObservation = (TimeObservation)element;
+ final Node timeObservationNode = ((Node)child);
updateTimeElementLocation(timeObservationNode, timeObservation.getEvent(), children, compact, width);
- } else if (element instanceof TimeConstraint) {
- final TimeConstraint timeConstraint = (TimeConstraint) element;
- final Node timeConstraintNode = ((Node) child);
+ } else if(element instanceof TimeConstraint) {
+ final TimeConstraint timeConstraint = (TimeConstraint)element;
+ final Node timeConstraintNode = ((Node)child);
final EList<Element> constrainedElements = timeConstraint.getConstrainedElements();
- if (constrainedElements.size() > 0) {
+ if(constrainedElements.size() > 0) {
final Element constrainedElement = constrainedElements.get(0);
updateTimeElementLocation(timeConstraintNode, constrainedElement, children, compact, width);
}
- } else if (element instanceof DurationObservation) {
- final DurationObservation durationObservation = (DurationObservation) element;
- final Node durationObservationNode = ((Node) child);
+ } else if(element instanceof DurationObservation) {
+ final DurationObservation durationObservation = (DurationObservation)element;
+ final Node durationObservationNode = ((Node)child);
final EList<NamedElement> events = durationObservation.getEvents();
- if (events.size() == 2) {
+ if(events.size() == 2) {
final Element startElement = events.get(0);
final Element endElement = events.get(1);
updateDurationElementLocation(durationObservationNode, startElement, endElement, children);
- } else if (events.size() == 1) {
+ } else if(events.size() == 1) {
final Element startEndElement = events.get(0);
updateDurationElementLocation(durationObservationNode, startEndElement, startEndElement, children);
}
- } else if (element instanceof DurationConstraint) {
- final DurationConstraint durationConstraint = (DurationConstraint) element;
- final Node durationConstraintNode = ((Node) child);
+ } else if(element instanceof DurationConstraint) {
+ final DurationConstraint durationConstraint = (DurationConstraint)element;
+ final Node durationConstraintNode = ((Node)child);
final EList<Element> elements = durationConstraint.getConstrainedElements();
- if (elements.size() == 2) {
+ if(elements.size() == 2) {
final Element startElement = elements.get(0);
final Element endElement = elements.get(1);
updateDurationElementLocation(durationConstraintNode, startElement, endElement, children);
- } else if (elements.size() == 1) {
+ } else if(elements.size() == 1) {
final Element startEndElement = elements.get(0);
updateDurationElementLocation(durationConstraintNode, startEndElement, startEndElement, children);
}
- } else if (element instanceof GeneralOrdering) {
- final GeneralOrdering generalOrdering = (GeneralOrdering) element;
- final Node generalOrderingNode = ((Node) child);
+ } else if(element instanceof GeneralOrdering) {
+ final GeneralOrdering generalOrdering = (GeneralOrdering)element;
+ final Node generalOrderingNode = ((Node)child);
final OccurrenceSpecification before = generalOrdering.getBefore();
final OccurrenceSpecification after = generalOrdering.getAfter();
@@ -243,37 +244,36 @@ public class AbstractTimelineLayoutPolicy extends XYLayoutEditPolicy {
* Set the horizontal location of the given time element View, so that it is aligned with its associated element
*
* @param timeElementNode
- * the element to align
+ * the element to align
* @param alignmentElement
- * the element to align to
+ * the element to align to
* @param timelineViews
- * the views contained in the timeline
+ * the views contained in the timeline
* @param compact
- * whether this is a compact timeline
+ * whether this is a compact timeline
* @param max
- * the position to give the element if it has no end
+ * the position to give the element if it has no end
*/
- protected static void updateTimeElementLocation(final Node timeElementNode, final EObject alignmentElement, final EList<View> timelineViews,
- final boolean compact, final int max) {
+ protected static void updateTimeElementLocation(final Node timeElementNode, final EObject alignmentElement, final EList<View> timelineViews, final boolean compact, final int max) {
int occurrencePositionBefore = -1;
int occurrencePositionAfter = -1;
int lastOccurrencePosition = -1;
boolean after = false;
- for (final View view : timelineViews) {
- if (view instanceof Node && ViewUtils.isViewFor(view, UMLPackage.eINSTANCE.getOccurrenceSpecification())) {
- final Node node = (Node) view;
+ for(final View view : timelineViews) {
+ if(view instanceof Node && ViewUtils.isViewFor(view, UMLPackage.eINSTANCE.getOccurrenceSpecification())) {
+ final Node node = (Node)view;
final LayoutConstraint layoutConstraint = node.getLayoutConstraint();
- if (layoutConstraint instanceof Location) {
- final Location location = (Location) layoutConstraint;
+ if(layoutConstraint instanceof Location) {
+ final Location location = (Location)layoutConstraint;
lastOccurrencePosition = location.getX();
}
}
- if (after && view instanceof Node && ViewUtils.isViewFor(view, UMLPackage.eINSTANCE.getStateInvariant())) {
+ if(after && view instanceof Node && ViewUtils.isViewFor(view, UMLPackage.eINSTANCE.getStateInvariant())) {
// we found the first state change after the alignmentElement => memorize the occurrence position
occurrencePositionAfter = lastOccurrencePosition;
after = false;
}
- if (view.getElement() == alignmentElement) {
+ if(view.getElement() == alignmentElement) {
// memorize the first occurrence position before the alignmentElement
occurrencePositionBefore = lastOccurrencePosition;
after = true;
@@ -282,26 +282,26 @@ public class AbstractTimelineLayoutPolicy extends XYLayoutEditPolicy {
boolean firstEvent = true;
final EObject element = timeElementNode.getElement();
- if (element instanceof TimeObservation) {
- final TimeObservation timeObservation = (TimeObservation) element;
+ if(element instanceof TimeObservation) {
+ final TimeObservation timeObservation = (TimeObservation)element;
firstEvent = timeObservation.isFirstEvent();
- } else if (element instanceof TimeConstraint) {
- final TimeConstraint timeConstraint = (TimeConstraint) element;
+ } else if(element instanceof TimeConstraint) {
+ final TimeConstraint timeConstraint = (TimeConstraint)element;
firstEvent = timeConstraint.isFirstEvent();
}
- if (firstEvent) {
- if (occurrencePositionBefore != -1) {
+ if(firstEvent) {
+ if(occurrencePositionBefore != -1) {
setTimeElementNodeLocation(timeElementNode, occurrencePositionBefore);
} else {
- if (compact) {
+ if(compact) {
setTimeElementNodeLocation(timeElementNode, CustomCompactLifelineCompartmentEditPart.FIRST_STATE_OFFSET);
} else {
setTimeElementNodeLocation(timeElementNode, 0);
}
}
} else {
- if (occurrencePositionAfter != -1) {
+ if(occurrencePositionAfter != -1) {
setTimeElementNodeLocation(timeElementNode, occurrencePositionAfter);
} else {
// the margin avoids the element pushing the rest outside
@@ -316,44 +316,43 @@ public class AbstractTimelineLayoutPolicy extends XYLayoutEditPolicy {
* and end elements
*
* @param durationElementNode
- * the element to align
+ * the element to align
* @param startElement
- * the start element of the duration
+ * the start element of the duration
* @param endElement
- * the end element of the duration
+ * the end element of the duration
* @param timelineViews
- * the views contained in the timeline
+ * the views contained in the timeline
*/
- protected void updateDurationElementLocation(final Node durationElementNode, final Element startElement, final Element endElement,
- final EList<View> timelineViews) {
+ protected void updateDurationElementLocation(final Node durationElementNode, final Element startElement, final Element endElement, final EList<View> timelineViews) {
int lastOccurrencePosition = getOriginX();
int startPos = getOriginX();
int endPos = -1;
boolean onEndElement = false;
- for (final View view : timelineViews) {
- if (view instanceof Node) {
- final Node node = (Node) view;
+ for(final View view : timelineViews) {
+ if(view instanceof Node) {
+ final Node node = (Node)view;
final LayoutConstraint layoutConstraint = node.getLayoutConstraint();
- final Location location = (Location) layoutConstraint;
- if (onEndElement && ViewUtils.isViewFor(view, UMLPackage.eINSTANCE.getDestructionOccurrenceSpecification())) {
+ final Location location = (Location)layoutConstraint;
+ if(onEndElement && ViewUtils.isViewFor(view, UMLPackage.eINSTANCE.getDestructionOccurrenceSpecification())) {
// if there is a DestructionOccurrenceSpecification, then the duration must end on it
endPos = location.getX() + SmallSquareFigure.RADIUS + 1;
onEndElement = false;
}
- if (ViewUtils.isViewFor(view, UMLPackage.eINSTANCE.getOccurrenceSpecification())) {
+ if(ViewUtils.isViewFor(view, UMLPackage.eINSTANCE.getOccurrenceSpecification())) {
lastOccurrencePosition = location.getX();
- } else if (ViewUtils.isViewFor(view, UMLPackage.eINSTANCE.getStateInvariant())) {
- if (onEndElement) {
+ } else if(ViewUtils.isViewFor(view, UMLPackage.eINSTANCE.getStateInvariant())) {
+ if(onEndElement) {
endPos = lastOccurrencePosition + SmallSquareFigure.RADIUS + 1;
onEndElement = false;
}
}
}
- if (view.getElement() == startElement) {
+ if(view.getElement() == startElement) {
startPos = lastOccurrencePosition + SmallSquareFigure.RADIUS;
}
- if (view.getElement() == endElement) {
- if (endElement instanceof OccurrenceSpecification) {
+ if(view.getElement() == endElement) {
+ if(endElement instanceof OccurrenceSpecification) {
endPos = lastOccurrencePosition + SmallSquareFigure.RADIUS + 1;
} else {
// on a StateInvariant => the next state change (an OccurrenceSpecification followed by
@@ -363,7 +362,7 @@ public class AbstractTimelineLayoutPolicy extends XYLayoutEditPolicy {
}
}
- if (endPos == -1) {
+ if(endPos == -1) {
// the endElement has no end
endPos = Integer.MAX_VALUE;
}
@@ -386,13 +385,13 @@ public class AbstractTimelineLayoutPolicy extends XYLayoutEditPolicy {
final Location timeElementLocation;
final int y;
// it is a Bounds element when created; we change it to a Location
- if (layoutConstraint instanceof Bounds) {
- final Bounds initialBounds = (Bounds) layoutConstraint;
+ if(layoutConstraint instanceof Bounds) {
+ final Bounds initialBounds = (Bounds)layoutConstraint;
timeElementLocation = NotationFactory.eINSTANCE.createLocation();
// place it above the location where the user clicked
y = initialBounds.getY() - VerticalMarkFigure.PREFERRED_HEIGHT - 5;
- } else if (layoutConstraint instanceof Location) {
- timeElementLocation = (Location) layoutConstraint;
+ } else if(layoutConstraint instanceof Location) {
+ timeElementLocation = (Location)layoutConstraint;
y = timeElementLocation.getY();
} else {
timeElementLocation = NotationFactory.eINSTANCE.createLocation();
@@ -408,24 +407,24 @@ public class AbstractTimelineLayoutPolicy extends XYLayoutEditPolicy {
* Set the location of the given duration node
*
* @param durationElementNode
- * the node to position
+ * the node to position
* @param startPos
- * the horizontal starting position
+ * the horizontal starting position
* @param endPos
- * the horizontal ending position
+ * the horizontal ending position
*/
private static void setDurationElementNodeLocation(final Node durationElementNode, final int startPos, final int endPos) {
final LayoutConstraint layoutConstraint = durationElementNode.getLayoutConstraint();
final Bounds bounds;
- if (layoutConstraint instanceof Bounds) {
- bounds = (Bounds) layoutConstraint;
+ if(layoutConstraint instanceof Bounds) {
+ bounds = (Bounds)layoutConstraint;
} else {
bounds = NotationFactory.eINSTANCE.createBounds();
durationElementNode.setLayoutConstraint(bounds);
}
bounds.setX(startPos);
- if (endPos == Integer.MAX_VALUE) {
+ if(endPos == Integer.MAX_VALUE) {
bounds.setWidth(Integer.MAX_VALUE);
} else {
bounds.setWidth(endPos - startPos);
@@ -433,36 +432,34 @@ public class AbstractTimelineLayoutPolicy extends XYLayoutEditPolicy {
}
/**
- * Set the location of the given GeneralOrdering node so that it is aligned with the given <code>before</code> and
- * <code>after</code> occurrences.
+ * Set the location of the given GeneralOrdering node so that it is aligned with the given <code>before</code> and <code>after</code> occurrences.
*
* @param generalOrderingNode
- * the node to align
+ * the node to align
* @param before
- * the start element
+ * the start element
* @param after
- * the end element
+ * the end element
* @param timelineViews
- * all the Views in the timeline
+ * all the Views in the timeline
*/
- protected static void updateGeneralOrderingLocation(final Node generalOrderingNode, final OccurrenceSpecification before,
- final OccurrenceSpecification after, final EList<View> timelineViews) {
+ protected static void updateGeneralOrderingLocation(final Node generalOrderingNode, final OccurrenceSpecification before, final OccurrenceSpecification after, final EList<View> timelineViews) {
int startPos = -1;
int endPos = -1;
- for (final View view : timelineViews) {
- if (view instanceof Node) {
- final Node node = (Node) view;
+ for(final View view : timelineViews) {
+ if(view instanceof Node) {
+ final Node node = (Node)view;
final LayoutConstraint layoutConstraint = node.getLayoutConstraint();
- final Location location = (Location) layoutConstraint;
- if (view.getElement() == before) {
+ final Location location = (Location)layoutConstraint;
+ if(view.getElement() == before) {
startPos = location.getX() + SmallSquareFigure.RADIUS;
}
- if (view.getElement() == after) {
+ if(view.getElement() == after) {
endPos = location.getX() + SmallSquareFigure.RADIUS + 1;
}
}
}
- if (startPos != -1 && endPos != -1) {
+ if(startPos != -1 && endPos != -1) {
setGeneralOrderingNodeLocation(generalOrderingNode, startPos, endPos);
}
}
@@ -471,17 +468,17 @@ public class AbstractTimelineLayoutPolicy extends XYLayoutEditPolicy {
* Set the location of the given {@link GeneralOrdering} node
*
* @param generalOrderingNode
- * the node to position
+ * the node to position
* @param startPos
- * the horizontal starting position
+ * the horizontal starting position
* @param endPos
- * the horizontal ending position
+ * the horizontal ending position
*/
private static void setGeneralOrderingNodeLocation(final Node generalOrderingNode, final int startPos, final int endPos) {
final LayoutConstraint layoutConstraint = generalOrderingNode.getLayoutConstraint();
final Bounds bounds;
- if (layoutConstraint instanceof Bounds) {
- bounds = (Bounds) layoutConstraint;
+ if(layoutConstraint instanceof Bounds) {
+ bounds = (Bounds)layoutConstraint;
} else {
bounds = NotationFactory.eINSTANCE.createBounds();
generalOrderingNode.setLayoutConstraint(bounds);
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomCompactLifelineCompartmentItemSemanticEditPolicyCN.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomCompactLifelineCompartmentItemSemanticEditPolicyCN.java
index e56bfacf83b..e89697a86c4 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomCompactLifelineCompartmentItemSemanticEditPolicyCN.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomCompactLifelineCompartmentItemSemanticEditPolicyCN.java
@@ -29,7 +29,7 @@ public class CustomCompactLifelineCompartmentItemSemanticEditPolicyCN extends Co
@Override
protected Command getReorientRelationshipSourceCommand(final ReconnectRequest request) {
- if (request.getConnectionEditPart() instanceof MessageFoundEditPart) {
+ if(request.getConnectionEditPart() instanceof MessageFoundEditPart) {
// don't let it return an unexecutable command, since it prevents the MessageFound anchor from being dragged
return null;
}
@@ -38,7 +38,7 @@ public class CustomCompactLifelineCompartmentItemSemanticEditPolicyCN extends Co
@Override
protected Command getReorientRelationshipTargetCommand(final ReconnectRequest request) {
- if (request.getConnectionEditPart() instanceof MessageLostEditPart) {
+ if(request.getConnectionEditPart() instanceof MessageLostEditPart) {
// don't let it return an unexecutable command, since it prevents the MessageLost anchor from being dragged
return null;
}
@@ -49,7 +49,7 @@ public class CustomCompactLifelineCompartmentItemSemanticEditPolicyCN extends Co
@Override
protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
final IElementType requestElementType = req.getElementType();
- if (MessageUtils.isMessage(requestElementType)) {
+ if(MessageUtils.isMessage(requestElementType)) {
return getGEFWrapper(new CustomMessageCreateCommand(req));
}
return super.getCreateRelationshipCommand(req);
@@ -59,15 +59,15 @@ public class CustomCompactLifelineCompartmentItemSemanticEditPolicyCN extends Co
@Override
protected Command getCreateCommand(final CreateElementRequest req) {
final IElementType requestElementType = req.getElementType();
- if (requestElementType == UMLElementTypes.TimeObservation_16) {
+ if(requestElementType == UMLElementTypes.TimeObservation_16) {
return getGEFWrapper(new CustomTimeObservationCreateCommand(req));
- } else if (requestElementType == UMLElementTypes.TimeConstraint_15) {
+ } else if(requestElementType == UMLElementTypes.TimeConstraint_15) {
return getGEFWrapper(new CustomTimeConstraintCreateCommand(req));
- } else if (requestElementType == UMLElementTypes.DurationObservation_17) {
+ } else if(requestElementType == UMLElementTypes.DurationObservation_17) {
return getGEFWrapper(new CustomDurationObservationCreateCommand(req));
- } else if (requestElementType == UMLElementTypes.DurationConstraint_18) {
+ } else if(requestElementType == UMLElementTypes.DurationConstraint_18) {
return getGEFWrapper(new CustomDurationConstraintCreateCommand(req));
- } else if (requestElementType == UMLElementTypes.GeneralOrdering_67) {
+ } else if(requestElementType == UMLElementTypes.GeneralOrdering_67) {
return getGEFWrapper(new CustomGeneralOrderingCreateCommand(req));
}
return super.getCreateCommand(req);
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomCompactLifelineCompartmentLayoutEditPolicy.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomCompactLifelineCompartmentLayoutEditPolicy.java
index a25d7f0dad6..c317e340c99 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomCompactLifelineCompartmentLayoutEditPolicy.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomCompactLifelineCompartmentLayoutEditPolicy.java
@@ -62,7 +62,7 @@ public class CustomCompactLifelineCompartmentLayoutEditPolicy extends AbstractTi
@Override
protected Command getMoveChildrenCommand(final Request request) {
- if (RequestUtils.isChangeBoundsRequestFor(request, UMLPackage.eINSTANCE.getOccurrenceSpecification())) {
+ if(RequestUtils.isChangeBoundsRequestFor(request, UMLPackage.eINSTANCE.getOccurrenceSpecification())) {
return getMoveOccurrenceSpecificationsCommand(request);
}
return super.getMoveChildrenCommand(request);
@@ -70,21 +70,20 @@ public class CustomCompactLifelineCompartmentLayoutEditPolicy extends AbstractTi
@Override
protected Command getResizeChildrenCommand(final ChangeBoundsRequest request) {
- if (RequestUtils.isChangeBoundsRequestFor(request, UMLPackage.eINSTANCE.getStateInvariant())) {
+ if(RequestUtils.isChangeBoundsRequestFor(request, UMLPackage.eINSTANCE.getStateInvariant())) {
return getResizeStateInvariantsCommand(request);
}
return super.getResizeChildrenCommand(request);
}
private Command getResizeStateInvariantsCommand(final ChangeBoundsRequest request) {
- if (request.getResizeDirection() != PositionConstants.EAST) {
+ if(request.getResizeDirection() != PositionConstants.EAST) {
return UnexecutableCommand.INSTANCE;
}
final CompoundCommand compoundCommand = new CompoundCommand(Messages.CustomCompactLifelineCompartmentLayoutEditPolicy_ResizeStateInvariant);
- final CompactLifelineEditPartCN lifelineEditPart = (CompactLifelineEditPartCN) getHost().getParent();
+ final CompactLifelineEditPartCN lifelineEditPart = (CompactLifelineEditPartCN)getHost().getParent();
compoundCommand.add(new RefreshCommandForUndo(lifelineEditPart));
- final CompactLifelineCompartmentEditPartCN compartmentEditPart = (CompactLifelineCompartmentEditPartCN) EditPartUtils.findFirstChildEditPartWithId(
- lifelineEditPart, CompactLifelineCompartmentEditPartCN.VISUAL_ID);
+ final CompactLifelineCompartmentEditPartCN compartmentEditPart = (CompactLifelineCompartmentEditPartCN)EditPartUtils.findFirstChildEditPartWithId(lifelineEditPart, CompactLifelineCompartmentEditPartCN.VISUAL_ID);
final int widthDelta = FigureUtils.scaleByZoom(new Point(request.getSizeDelta().width, 0), lifelineEditPart.getFigure()).x;
@SuppressWarnings("unchecked")
@@ -93,33 +92,33 @@ public class CustomCompactLifelineCompartmentLayoutEditPolicy extends AbstractTi
final List<EditPart> children = compartmentEditPart.getChildren();
int deltaX = 0;
boolean moved = false;
- for (int i = 0; i < children.size(); i++) {
+ for(int i = 0; i < children.size(); i++) {
final EditPart childEditPart = children.get(i);
EditPart nextChildEditPart = null;
- if (i < children.size() - 1) {
+ if(i < children.size() - 1) {
nextChildEditPart = children.get(i + 1);
}
final Object model = childEditPart.getModel();
- if (model instanceof Node) {
- final Node childNode = (Node) model;
+ if(model instanceof Node) {
+ final Node childNode = (Node)model;
boolean move = deltaX != 0;
- if (OccurrenceSpecificationUtils.isOccurrenceSpecificationEditPart(childEditPart)) {
+ if(OccurrenceSpecificationUtils.isOccurrenceSpecificationEditPart(childEditPart)) {
// only move OccurrenceSpecifications followed by a StateInvariant (state changes)
move = move && nextChildEditPart instanceof CompactStateInvariantEditPartCN;
}
// if the element needs to be moved, then create the move command
- if (move && !TimeElementUtils.isTimeElementEditPart(childEditPart) && !GeneralOrderingUtils.isGeneralOrderingEditPart(childEditPart)) {
+ if(move && !TimeElementUtils.isTimeElementEditPart(childEditPart) && !GeneralOrderingUtils.isGeneralOrderingEditPart(childEditPart)) {
final LayoutConstraint layoutConstraint = childNode.getLayoutConstraint();
- if (!(layoutConstraint instanceof Location)) {
+ if(!(layoutConstraint instanceof Location)) {
Activator.log.error("Expected a LayoutConstraint", new Exception()); //$NON-NLS-1$
continue;
}
- final Location location = (Location) layoutConstraint;
+ final Location location = (Location)layoutConstraint;
final int newX = location.getX() + deltaX;
final TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(childNode);
- compoundCommand.add(new ICommandProxy(new AbstractTransactionalCommand(editingDomain,
- Messages.CustomCompactLifelineCompartmentLayoutEditPolicy_MoveElement, null) {
+ compoundCommand.add(new ICommandProxy(new AbstractTransactionalCommand(editingDomain, Messages.CustomCompactLifelineCompartmentLayoutEditPolicy_MoveElement, null) {
+
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
final Location loc = NotationFactory.eINSTANCE.createLocation();
@@ -130,13 +129,13 @@ public class CustomCompactLifelineCompartmentLayoutEditPolicy extends AbstractTi
}));
moved = true;
}
- if (editPartsToResize.contains(childEditPart)) {
+ if(editPartsToResize.contains(childEditPart)) {
// resizing a StateInvariant moves all the elements after it
deltaX += widthDelta;
}
}
}
- if (!moved) {
+ if(!moved) {
return UnexecutableCommand.INSTANCE;
}
compoundCommand.add(new RefreshCommandForDo(lifelineEditPart));
@@ -146,12 +145,12 @@ public class CustomCompactLifelineCompartmentLayoutEditPolicy extends AbstractTi
/** returns a NonResizableEditPolicy instead of a ResizableEditPolicy for some children */
@Override
protected EditPolicy createChildEditPolicy(final EditPart child) {
- final View childView = (View) child.getModel();
+ final View childView = (View)child.getModel();
final int visualID = UMLVisualIDRegistry.getVisualID(childView);
// make OccurrenceSpecifications, time and duration elements and general orderings non-resizable
- if (OccurrenceSpecificationUtils.isOccurrenceSpecificationEditPart(visualID) || TimeElementUtils.isTimeElementEditPart(visualID)
- || GeneralOrderingUtils.isGeneralOrderingEditPart(visualID)) {
+ if(OccurrenceSpecificationUtils.isOccurrenceSpecificationEditPart(visualID) || TimeElementUtils.isTimeElementEditPart(visualID) || GeneralOrderingUtils.isGeneralOrderingEditPart(visualID)) {
return new NonResizableEditPolicyEx() {
+
/** Override the command in order to pass all the moved EditParts in the request */
@Override
protected Command getMoveCommand(final ChangeBoundsRequest request) {
@@ -167,6 +166,7 @@ public class CustomCompactLifelineCompartmentLayoutEditPolicy extends AbstractTi
};
}
return new ResizableShapeEditPolicy() {
+
/** Override the command in order to pass all the resized EditParts in the request */
@Override
protected Command getResizeCommand(final ChangeBoundsRequest request) {
@@ -189,35 +189,31 @@ public class CustomCompactLifelineCompartmentLayoutEditPolicy extends AbstractTi
}
private Command getMoveOccurrenceSpecificationsCommand(final Request request) {
- final ChangeBoundsRequest changeBoundsRequest = (ChangeBoundsRequest) request;
+ final ChangeBoundsRequest changeBoundsRequest = (ChangeBoundsRequest)request;
final CompoundCommand compoundCommand = new CompoundCommand(Messages.CustomCompactLifelineCompartmentLayoutEditPolicy_MoveOccurrenceSpecification);
- final CompactLifelineEditPartCN lifelineEditPart = (CompactLifelineEditPartCN) getHost().getParent();
+ final CompactLifelineEditPartCN lifelineEditPart = (CompactLifelineEditPartCN)getHost().getParent();
compoundCommand.add(new RefreshCommandForUndo(lifelineEditPart));
- final CompactLifelineCompartmentEditPartCN timelineCompartmentEditPart = (CompactLifelineCompartmentEditPartCN) EditPartUtils
- .findFirstChildEditPartWithId(lifelineEditPart, CompactLifelineCompartmentEditPartCN.VISUAL_ID);
- final View timelineCompartmentView = (View) timelineCompartmentEditPart.getModel();
+ final CompactLifelineCompartmentEditPartCN timelineCompartmentEditPart = (CompactLifelineCompartmentEditPartCN)EditPartUtils.findFirstChildEditPartWithId(lifelineEditPart, CompactLifelineCompartmentEditPartCN.VISUAL_ID);
+ final View timelineCompartmentView = (View)timelineCompartmentEditPart.getModel();
@SuppressWarnings("unchecked")
final List<EditPart> editParts = changeBoundsRequest.getEditParts();
final List<Node> nodesToMove = new ArrayList<Node>();
- for (final EditPart editPart : editParts) {
+ for(final EditPart editPart : editParts) {
final Object model = editPart.getModel();
- if (model instanceof Node) {
- final Node node = (Node) model;
- if (node.getElement() instanceof OccurrenceSpecification) {
+ if(model instanceof Node) {
+ final Node node = (Node)model;
+ if(node.getElement() instanceof OccurrenceSpecification) {
nodesToMove.add(node);
}
}
}
- for (final Node node : nodesToMove) {
+ for(final Node node : nodesToMove) {
final int index = timelineCompartmentView.getChildren().indexOf(node);
- if (index >= 0) {
- compoundCommand
- .add(getMoveOccurrenceSpecificationCommand(node,
- FigureUtils.scaleByZoom(changeBoundsRequest.getMoveDelta(), lifelineEditPart.getFigure()), timelineCompartmentView, index,
- nodesToMove));
+ if(index >= 0) {
+ compoundCommand.add(getMoveOccurrenceSpecificationCommand(node, FigureUtils.scaleByZoom(changeBoundsRequest.getMoveDelta(), lifelineEditPart.getFigure()), timelineCompartmentView, index, nodesToMove));
}
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomCompactLifelineItemSemanticEditPolicyCN.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomCompactLifelineItemSemanticEditPolicyCN.java
index b5fd8dca216..c9c9191a6fb 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomCompactLifelineItemSemanticEditPolicyCN.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomCompactLifelineItemSemanticEditPolicyCN.java
@@ -21,10 +21,10 @@ public class CustomCompactLifelineItemSemanticEditPolicyCN extends CompactLifeli
@Override
protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
final IElementType requestElementType = req.getElementType();
- if (requestElementType == null) {
+ if(requestElementType == null) {
return null;
}
- if (MessageUtils.isMessage(requestElementType)) {
+ if(MessageUtils.isMessage(requestElementType)) {
return getGEFWrapper(new CustomMessageCreateCommand(req));
}
return super.getCreateRelationshipCommand(req);
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomCompactStateInvariantItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomCompactStateInvariantItemSemanticEditPolicy.java
index 858b50f2ab9..e57769aeadf 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomCompactStateInvariantItemSemanticEditPolicy.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomCompactStateInvariantItemSemanticEditPolicy.java
@@ -29,17 +29,17 @@ public class CustomCompactStateInvariantItemSemanticEditPolicy extends CompactSt
@Override
public Command getCommand(final Request request) {
- if (request.getType() == REQ_DELETE) {
+ if(request.getType() == REQ_DELETE) {
try {
- final View view = (View) getHost().getModel();
+ final View view = (View)getHost().getModel();
final Set<View> viewsToRemove = new HashSet<View>();
- if (view.getType().equals(Constants.compactStateInvariantId)) {
+ if(view.getType().equals(Constants.compactStateInvariantId)) {
viewsToRemove.addAll(StateInvariantUtils.getViewsToHide(view));
}
- if (viewsToRemove.size() > 0) {
+ if(viewsToRemove.size() > 0) {
final CompoundCommand compoundCommand = new CompoundCommand(Messages.hideStateInvariant);
compoundCommand.add(super.getCommand(request));
- for (final View viewToRemove : viewsToRemove) {
+ for(final View viewToRemove : viewsToRemove) {
compoundCommand.add(new ICommandProxy(new DeleteCommand(viewToRemove)));
}
return compoundCommand;
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomDestructionOccurrenceSpecificationItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomDestructionOccurrenceSpecificationItemSemanticEditPolicy.java
index efe69587c29..04a736c3460 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomDestructionOccurrenceSpecificationItemSemanticEditPolicy.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomDestructionOccurrenceSpecificationItemSemanticEditPolicy.java
@@ -19,7 +19,6 @@ import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.CustomMessage
import org.eclipse.papyrus.uml.diagram.timing.custom.utils.MessageUtils;
import org.eclipse.papyrus.uml.diagram.timing.custom.utils.OccurrenceSpecificationUtils;
import org.eclipse.papyrus.uml.diagram.timing.edit.policies.DestructionOccurrenceSpecificationItemSemanticEditPolicyCN;
-import org.eclipse.uml2.uml.DestructionOccurrenceSpecification;
/** Semantic edit policy for {@link DestructionOccurrenceSpecification}s */
public class CustomDestructionOccurrenceSpecificationItemSemanticEditPolicy extends DestructionOccurrenceSpecificationItemSemanticEditPolicyCN {
@@ -27,7 +26,7 @@ public class CustomDestructionOccurrenceSpecificationItemSemanticEditPolicy exte
/** Handles the "Hide Element" (remove only the view, and keep the semantic element) */
@Override
public Command getCommand(final Request request) {
- if (request.getType() == REQ_DELETE) {
+ if(request.getType() == REQ_DELETE) {
final Command baseCommand = super.getCommand(request);
return OccurrenceSpecificationUtils.getHideOccurrenceSpecificationCommand(getHost(), baseCommand);
}
@@ -37,10 +36,10 @@ public class CustomDestructionOccurrenceSpecificationItemSemanticEditPolicy exte
@Override
protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
final IElementType requestElementType = req.getElementType();
- if (requestElementType == null) {
+ if(requestElementType == null) {
return null;
}
- if (MessageUtils.isMessage(requestElementType)) {
+ if(MessageUtils.isMessage(requestElementType)) {
return getGEFWrapper(new CustomMessageCreateCommand(req));
}
return super.getCreateRelationshipCommand(req);
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullLifelineItemSemanticEditPolicyCN.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullLifelineItemSemanticEditPolicyCN.java
index 4b54d628712..98074eb819c 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullLifelineItemSemanticEditPolicyCN.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullLifelineItemSemanticEditPolicyCN.java
@@ -21,10 +21,10 @@ public class CustomFullLifelineItemSemanticEditPolicyCN extends FullLifelineItem
@Override
protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
final IElementType requestElementType = req.getElementType();
- if (requestElementType == null) {
+ if(requestElementType == null) {
return null;
}
- if (MessageUtils.isMessage(requestElementType)) {
+ if(MessageUtils.isMessage(requestElementType)) {
return getGEFWrapper(new CustomMessageCreateCommand(req));
}
return super.getCreateRelationshipCommand(req);
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullLifelineStateDefinitionCompartmentLayoutEditPolicy.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullLifelineStateDefinitionCompartmentLayoutEditPolicy.java
index 43788a09868..8acfa353c26 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullLifelineStateDefinitionCompartmentLayoutEditPolicy.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullLifelineStateDefinitionCompartmentLayoutEditPolicy.java
@@ -17,6 +17,6 @@ public class CustomFullLifelineStateDefinitionCompartmentLayoutEditPolicy extend
@Override
protected GraphicalEditPart getEditPartToRefresh() {
- return (GraphicalEditPart) EditPartUtils.findParentEditPartWithId(getHost(), FullLifelineEditPartCN.VISUAL_ID);
+ return (GraphicalEditPart)EditPartUtils.findParentEditPartWithId(getHost(), FullLifelineEditPartCN.VISUAL_ID);
}
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullLifelineTimelineCompartmentItemSemanticEditPolicyCN.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullLifelineTimelineCompartmentItemSemanticEditPolicyCN.java
index 07e5e529f40..92204bfb3f0 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullLifelineTimelineCompartmentItemSemanticEditPolicyCN.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullLifelineTimelineCompartmentItemSemanticEditPolicyCN.java
@@ -29,7 +29,7 @@ public class CustomFullLifelineTimelineCompartmentItemSemanticEditPolicyCN exten
@Override
protected Command getReorientRelationshipSourceCommand(final ReconnectRequest request) {
- if (request.getConnectionEditPart() instanceof MessageFoundEditPart) {
+ if(request.getConnectionEditPart() instanceof MessageFoundEditPart) {
// don't let it return an unexecutable command, since it prevents the MessageFound anchor from being dragged
return null;
}
@@ -38,7 +38,7 @@ public class CustomFullLifelineTimelineCompartmentItemSemanticEditPolicyCN exten
@Override
protected Command getReorientRelationshipTargetCommand(final ReconnectRequest request) {
- if (request.getConnectionEditPart() instanceof MessageLostEditPart) {
+ if(request.getConnectionEditPart() instanceof MessageLostEditPart) {
// don't let it return an unexecutable command, since it prevents the MessageLost anchor from being dragged
return null;
}
@@ -49,7 +49,7 @@ public class CustomFullLifelineTimelineCompartmentItemSemanticEditPolicyCN exten
@Override
protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
final IElementType requestElementType = req.getElementType();
- if (MessageUtils.isMessage(requestElementType)) {
+ if(MessageUtils.isMessage(requestElementType)) {
return getGEFWrapper(new CustomMessageCreateCommand(req));
}
return super.getCreateRelationshipCommand(req);
@@ -59,15 +59,15 @@ public class CustomFullLifelineTimelineCompartmentItemSemanticEditPolicyCN exten
@Override
protected Command getCreateCommand(final CreateElementRequest req) {
final IElementType requestElementType = req.getElementType();
- if (requestElementType == UMLElementTypes.TimeObservation_16) {
+ if(requestElementType == UMLElementTypes.TimeObservation_16) {
return getGEFWrapper(new CustomTimeObservationCreateCommand(req));
- } else if (requestElementType == UMLElementTypes.TimeConstraint_15) {
+ } else if(requestElementType == UMLElementTypes.TimeConstraint_15) {
return getGEFWrapper(new CustomTimeConstraintCreateCommand(req));
- } else if (requestElementType == UMLElementTypes.DurationObservation_17) {
+ } else if(requestElementType == UMLElementTypes.DurationObservation_17) {
return getGEFWrapper(new CustomDurationObservationCreateCommand(req));
- } else if (requestElementType == UMLElementTypes.DurationConstraint_18) {
+ } else if(requestElementType == UMLElementTypes.DurationConstraint_18) {
return getGEFWrapper(new CustomDurationConstraintCreateCommand(req));
- } else if (requestElementType == UMLElementTypes.GeneralOrdering_67) {
+ } else if(requestElementType == UMLElementTypes.GeneralOrdering_67) {
return getGEFWrapper(new CustomGeneralOrderingCreateCommand(req));
}
return super.getCreateCommand(req);
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullStateInvariantItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullStateInvariantItemSemanticEditPolicy.java
index 4a7372b3dde..c31f56c3da5 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullStateInvariantItemSemanticEditPolicy.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullStateInvariantItemSemanticEditPolicy.java
@@ -29,17 +29,17 @@ public class CustomFullStateInvariantItemSemanticEditPolicy extends FullStateInv
@Override
public Command getCommand(final Request request) {
- if (request.getType() == REQ_DELETE) {
+ if(request.getType() == REQ_DELETE) {
try {
- final View view = (View) getHost().getModel();
+ final View view = (View)getHost().getModel();
final Set<View> viewsToRemove = new HashSet<View>();
- if (view.getType().equals(Constants.fullStateInvariantId)) {
+ if(view.getType().equals(Constants.fullStateInvariantId)) {
viewsToRemove.addAll(StateInvariantUtils.getViewsToHide(view));
}
- if (viewsToRemove.size() > 0) {
+ if(viewsToRemove.size() > 0) {
final CompoundCommand compoundCommand = new CompoundCommand(Messages.hideStateInvariant);
compoundCommand.add(super.getCommand(request));
- for (final View viewToRemove : viewsToRemove) {
+ for(final View viewToRemove : viewsToRemove) {
compoundCommand.add(new ICommandProxy(new DeleteCommand(viewToRemove)));
}
return compoundCommand;
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomGateItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomGateItemSemanticEditPolicy.java
index ce3ca08f900..afe1d1d9c4b 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomGateItemSemanticEditPolicy.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomGateItemSemanticEditPolicy.java
@@ -18,7 +18,6 @@ import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.CustomMessage
import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.CustomMessageReorientCommand;
import org.eclipse.papyrus.uml.diagram.timing.custom.utils.MessageUtils;
import org.eclipse.papyrus.uml.diagram.timing.edit.policies.GateItemSemanticEditPolicy;
-import org.eclipse.uml2.uml.Gate;
/** Semantic edit policy for {@link Gate}s */
public class CustomGateItemSemanticEditPolicy extends GateItemSemanticEditPolicy {
@@ -26,7 +25,7 @@ public class CustomGateItemSemanticEditPolicy extends GateItemSemanticEditPolicy
/** Handles the "Hide Element" (remove only the view, and keep the semantic element) */
@Override
public Command getCommand(final Request request) {
- if (request.getType() == REQ_DELETE) {
+ if(request.getType() == REQ_DELETE) {
// TODO: delete elements linked to Gate
// final Command baseCommand = super.getCommand(request);
// return GateUtils.getHideGateCommand(getHost(), baseCommand);
@@ -37,10 +36,10 @@ public class CustomGateItemSemanticEditPolicy extends GateItemSemanticEditPolicy
@Override
protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
final IElementType requestElementType = req.getElementType();
- if (requestElementType == null) {
+ if(requestElementType == null) {
return null;
}
- if (MessageUtils.isMessage(requestElementType)) {
+ if(MessageUtils.isMessage(requestElementType)) {
return getGEFWrapper(new CustomMessageCreateCommand(req));
}
return super.getCreateRelationshipCommand(req);
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomInteractionCompartmentCreationEditPolicy.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomInteractionCompartmentCreationEditPolicy.java
index d4305cef77c..90c705d1b5d 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomInteractionCompartmentCreationEditPolicy.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomInteractionCompartmentCreationEditPolicy.java
@@ -45,14 +45,14 @@ public class CustomInteractionCompartmentCreationEditPolicy extends PapyrusCreat
@Override
protected Command getCreateCommand(final CreateViewRequest request) {
- final ICommandProxy superCommand = (ICommandProxy) super.getCreateCommand(request);
+ final ICommandProxy superCommand = (ICommandProxy)super.getCreateCommand(request);
final List<? extends ViewDescriptor> viewDescriptors = request.getViewDescriptors();
- if (request instanceof CreateViewAndElementRequest && viewDescriptors.size() == 1) {
+ if(request instanceof CreateViewAndElementRequest && viewDescriptors.size() == 1) {
final String semanticHint = viewDescriptors.get(0).getSemanticHint();
final TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(getHost().getModel());
- if (Integer.toString(CompactLifelineEditPartCN.VISUAL_ID).equals(semanticHint)) {
- final View interactionView = (View) getHost().getParent().getModel();
- final Interaction interaction = (Interaction) interactionView.getElement();
+ if(Integer.toString(CompactLifelineEditPartCN.VISUAL_ID).equals(semanticHint)) {
+ final View interactionView = (View)getHost().getParent().getModel();
+ final Interaction interaction = (Interaction)interactionView.getElement();
// note: only add a StateInvariant to the Lifeline if the request is a CreateViewAndElementRequest,
// and not merely a CreateViewRequest, because we don't want to create a new StateInvariant if this is
// only a drop for an existing Lifeline
@@ -64,7 +64,7 @@ public class CustomInteractionCompartmentCreationEditPolicy extends PapyrusCreat
compoundCommand.add(new RefreshCommandForDo(interactionEditPart));
return compoundCommand;
}
- if (Integer.toString(FullLifelineEditPartCN.VISUAL_ID).equals(semanticHint)) {
+ if(Integer.toString(FullLifelineEditPartCN.VISUAL_ID).equals(semanticHint)) {
final CompoundCommand compoundCommand = new CompoundCommand(Messages.CustomInteractionCompartmentCreationEditPolicy_CreateFullLifeline);
final InteractionEditPartTN interactionEditPart = getInteractionEditPart();
compoundCommand.add(new RefreshCommandForUndo(interactionEditPart));
@@ -82,20 +82,20 @@ public class CustomInteractionCompartmentCreationEditPolicy extends PapyrusCreat
// creates the compact lifeline View
compoundCommand.add(superCommand);
- final CommandResult superCommandResult = ((ICommandProxy) superCommand).getICommand().getCommandResult();
+ final CommandResult superCommandResult = ((ICommandProxy)superCommand).getICommand().getCommandResult();
final TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(interaction);
- if (editingDomain == null) {
+ if(editingDomain == null) {
throw new IllegalStateException("no editing domain"); //$NON-NLS-1$
}
- final AbstractTransactionalCommand initStateDefinitionCommand = new AbstractTransactionalCommand(editingDomain,
- Messages.CustomCompactLifelifeCompactStateInvariantCreationEditPolicy_InitializeStateInvariant, null) {
+ final AbstractTransactionalCommand initStateDefinitionCommand = new AbstractTransactionalCommand(editingDomain, Messages.CustomCompactLifelifeCompactStateInvariantCreationEditPolicy_InitializeStateInvariant, null) {
+
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
// the result from the super command that creates the view
- final ViewDescriptor viewDescriptor = (ViewDescriptor) superCommandResult.getReturnValue();
- final View compactLifelineView = (View) viewDescriptor.getAdapter(View.class);
+ final ViewDescriptor viewDescriptor = (ViewDescriptor)superCommandResult.getReturnValue();
+ final View compactLifelineView = (View)viewDescriptor.getAdapter(View.class);
final View compactLifelineCompartmentView = ViewUtils.findCompactTimelineCompartmentView(compactLifelineView);
StateInvariantUtils.createCompactStateInvariant(compactLifelineCompartmentView, -1, -1, -1);
return CommandResult.newOKCommandResult();
@@ -106,10 +106,10 @@ public class CustomInteractionCompartmentCreationEditPolicy extends PapyrusCreat
}
protected InteractionEditPartTN getInteractionEditPart() {
- return (InteractionEditPartTN) EditPartUtils.findParentEditPartWithId(getHost(), InteractionEditPartTN.VISUAL_ID);
+ return (InteractionEditPartTN)EditPartUtils.findParentEditPartWithId(getHost(), InteractionEditPartTN.VISUAL_ID);
}
protected CompactLifelineCompartmentEditPartCN getCompactLifelineCompartmentEditPart() {
- return (CompactLifelineCompartmentEditPartCN) EditPartUtils.findFirstChildEditPartWithId(getHost(), CompactLifelineCompartmentEditPartCN.VISUAL_ID);
+ return (CompactLifelineCompartmentEditPartCN)EditPartUtils.findFirstChildEditPartWithId(getHost(), CompactLifelineCompartmentEditPartCN.VISUAL_ID);
}
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomInteractionCompartmentItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomInteractionCompartmentItemSemanticEditPolicy.java
index 481c9975fe2..df9eb3059c1 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomInteractionCompartmentItemSemanticEditPolicy.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomInteractionCompartmentItemSemanticEditPolicy.java
@@ -27,8 +27,9 @@ public class CustomInteractionCompartmentItemSemanticEditPolicy extends Interact
@Override
protected Command getCreateCommand(final CreateElementRequest req) {
final IElementType elementType = req.getElementType();
- if (UMLElementTypes.Lifeline_19 == elementType) {
+ if(UMLElementTypes.Lifeline_19 == elementType) {
return getGEFWrapper(new FullLifelineCreateCommandCN(req) {
+
@Override
protected void doConfigure(final Lifeline newElement, final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
super.doConfigure(newElement, monitor, info);
@@ -36,8 +37,9 @@ public class CustomInteractionCompartmentItemSemanticEditPolicy extends Interact
}
});
}
- if (UMLElementTypes.Lifeline_20 == elementType) {
+ if(UMLElementTypes.Lifeline_20 == elementType) {
return getGEFWrapper(new CompactLifelineCreateCommandCN(req) {
+
@Override
protected void doConfigure(final Lifeline newElement, final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
super.doConfigure(newElement, monitor, info);
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomInteractionCreationEditPolicy.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomInteractionCreationEditPolicy.java
index 8814dc01c26..e7dab25d234 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomInteractionCreationEditPolicy.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomInteractionCreationEditPolicy.java
@@ -46,11 +46,11 @@ public class CustomInteractionCreationEditPolicy extends PapyrusCreationEditPoli
@Override
protected Command getCreateCommand(final CreateViewRequest request) {
- final ICommandProxy superCommand = (ICommandProxy) super.getCreateCommand(request);
+ final ICommandProxy superCommand = (ICommandProxy)super.getCreateCommand(request);
final List<? extends ViewDescriptor> viewDescriptors = request.getViewDescriptors();
- if (request instanceof CreateViewAndElementRequest && viewDescriptors.size() == 1) {
+ if(request instanceof CreateViewAndElementRequest && viewDescriptors.size() == 1) {
final String semanticHint = viewDescriptors.get(0).getSemanticHint();
- if (Integer.toString(GateEditPart.VISUAL_ID).equals(semanticHint)) {
+ if(Integer.toString(GateEditPart.VISUAL_ID).equals(semanticHint)) {
return getCreateGateCommand(request, superCommand);
}
}
@@ -62,19 +62,20 @@ public class CustomInteractionCreationEditPolicy extends PapyrusCreationEditPoli
final CompoundCommand compoundCommand = new CompoundCommand(Messages.CustomInteractionCreationEditPolicy_CreateGate);
compoundCommand.add(superCommand);
final ICommand iCommand = superCommand.getICommand();
- final TransactionalEditingDomain editingDomain = ((AbstractEMFOperation) iCommand).getEditingDomain();
+ final TransactionalEditingDomain editingDomain = ((AbstractEMFOperation)iCommand).getEditingDomain();
compoundCommand.add(new ICommandProxy(new AbstractTransactionalCommand(editingDomain, Messages.CustomInteractionCreationEditPolicy_PositionGate, null) {
+
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
final CommandResult commandResult = iCommand.getCommandResult();
final Object returnValue = commandResult.getReturnValue();
- final ViewAndElementDescriptor descriptor = (ViewAndElementDescriptor) returnValue;
- final Node node = (Node) descriptor.getAdapter(Node.class);
+ final ViewAndElementDescriptor descriptor = (ViewAndElementDescriptor)returnValue;
+ final Node node = (Node)descriptor.getAdapter(Node.class);
- final Node interactionView = (Node) ViewUtils.findSuperViewWithId(node, InteractionEditPartTN.VISUAL_ID);
- final Location interactionLocation = (Location) interactionView.getLayoutConstraint();
+ final Node interactionView = (Node)ViewUtils.findSuperViewWithId(node, InteractionEditPartTN.VISUAL_ID);
+ final Location interactionLocation = (Location)interactionView.getLayoutConstraint();
- final IFigure hostFigure = ((GraphicalEditPart) getHost()).getFigure();
+ final IFigure hostFigure = ((GraphicalEditPart)getHost()).getFigure();
final Point point = new Point(request.getLocation());
final Point origin = FigureUtils.getLayeredPaneOrigin(hostFigure);
point.translate(origin);
@@ -88,7 +89,7 @@ public class CustomInteractionCreationEditPolicy extends PapyrusCreationEditPoli
return CommandResult.newOKCommandResult();
}
}));
- compoundCommand.add(new RefreshCommandForDo((GraphicalEditPart) getHost()));
+ compoundCommand.add(new RefreshCommandForDo((GraphicalEditPart)getHost()));
return compoundCommand;
}
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomLifelineCompartmentGraphicalNodeEditPolicy.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomLifelineCompartmentGraphicalNodeEditPolicy.java
index 1f0fcd27e5f..660232a3b61 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomLifelineCompartmentGraphicalNodeEditPolicy.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomLifelineCompartmentGraphicalNodeEditPolicy.java
@@ -23,7 +23,6 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.INodeEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.GraphicalNodeEditPolicy;
import org.eclipse.papyrus.uml.diagram.timing.custom.Messages;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts.CustomFullLifelineEditPartCN;
import org.eclipse.papyrus.uml.diagram.timing.custom.utils.MessageUtils;
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.MessageFoundEditPart;
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.MessageLostEditPart;
@@ -33,45 +32,41 @@ public class CustomLifelineCompartmentGraphicalNodeEditPolicy extends GraphicalN
@Override
protected INodeEditPart getConnectionCompleteEditPart(final Request request) {
// connect to the Lifeline
- return (INodeEditPart) getHost().getParent();
+ return (INodeEditPart)getHost().getParent();
}
@Override
protected INodeEditPart getConnectableEditPart() {
// connect to the Lifeline
- return (INodeEditPart) getHost().getParent();
+ return (INodeEditPart)getHost().getParent();
}
/**
* Let the target anchor of a MessageLost be moved, by storing the desired location in an EAnnotation on the
- * connector, which will then be used in
- * {@link CustomFullLifelineEditPartCN#getTargetConnectionAnchor(ConnectionEditPart)}
+ * connector, which will then be used in {@link CustomFullLifelineEditPartCN#getTargetConnectionAnchor(ConnectionEditPart)}
*/
@Override
protected Command getReconnectTargetCommand(final ReconnectRequest request) {
final ConnectionEditPart connectionEditPart = request.getConnectionEditPart();
- if (connectionEditPart instanceof MessageLostEditPart) {
- final TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
- final IFigure sourceFigure = ((GraphicalEditPart) connectionEditPart.getSource()).getFigure();
- return MessageUtils.createMoveMessageAnchorCommand(request, connectionEditPart, sourceFigure,
- Messages.CustomLifelineCompartmentGraphicalNodeEditPolicy_SetMessageLostTargetLocation, editingDomain);
+ if(connectionEditPart instanceof MessageLostEditPart) {
+ final TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ final IFigure sourceFigure = ((GraphicalEditPart)connectionEditPart.getSource()).getFigure();
+ return MessageUtils.createMoveMessageAnchorCommand(request, connectionEditPart, sourceFigure, Messages.CustomLifelineCompartmentGraphicalNodeEditPolicy_SetMessageLostTargetLocation, editingDomain);
}
return super.getReconnectTargetCommand(request);
}
/**
* Let the target anchor of a MessageFound be moved, by storing the desired location in an EAnnotation on the
- * connector, which will then be used in
- * {@link CustomFullLifelineEditPartCN#getSourceConnectionAnchor(ConnectionEditPart)}
+ * connector, which will then be used in {@link CustomFullLifelineEditPartCN#getSourceConnectionAnchor(ConnectionEditPart)}
*/
@Override
protected Command getReconnectSourceCommand(final ReconnectRequest request) {
final ConnectionEditPart connectionEditPart = request.getConnectionEditPart();
- if (connectionEditPart instanceof MessageFoundEditPart) {
- final TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
- final IFigure targetFigure = ((GraphicalEditPart) connectionEditPart.getTarget()).getFigure();
- return MessageUtils.createMoveMessageAnchorCommand(request, connectionEditPart, targetFigure,
- Messages.CustomLifelineCompartmentGraphicalNodeEditPolicy_SetMessageFoundSourceLocation, editingDomain);
+ if(connectionEditPart instanceof MessageFoundEditPart) {
+ final TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ final IFigure targetFigure = ((GraphicalEditPart)connectionEditPart.getTarget()).getFigure();
+ return MessageUtils.createMoveMessageAnchorCommand(request, connectionEditPart, targetFigure, Messages.CustomLifelineCompartmentGraphicalNodeEditPolicy_SetMessageFoundSourceLocation, editingDomain);
}
return super.getReconnectTargetCommand(request);
}
@@ -86,7 +81,7 @@ public class CustomLifelineCompartmentGraphicalNodeEditPolicy extends GraphicalN
@Override
protected ConnectionAnchor getSourceConnectionAnchor(final CreateConnectionRequest request) {
final Point startLocation = MessageUtils.retrieveRequestStartLocation(request);
- if (startLocation != null) {
+ if(startLocation != null) {
return new XYAnchor(new Point(startLocation));
}
return super.getSourceConnectionAnchor(request);
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomLifelineNameEditPolicy.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomLifelineNameEditPolicy.java
index 21a01072f10..95920f05f8d 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomLifelineNameEditPolicy.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomLifelineNameEditPolicy.java
@@ -15,36 +15,37 @@ import org.eclipse.papyrus.uml.diagram.timing.edit.policies.UMLTextSelectionEdit
/** Shows feedback for the selection of a Lifeline name vertical label. */
public class CustomLifelineNameEditPolicy extends UMLTextSelectionEditPolicy {
+
@Override
protected void showPrimarySelection() {
- final LifelineVerticalLabel label = (LifelineVerticalLabel) getHostFigure();
+ final LifelineVerticalLabel label = (LifelineVerticalLabel)getHostFigure();
label.setSelected(true);
label.setFocus(true);
}
@Override
protected void showSelection() {
- final LifelineVerticalLabel label = (LifelineVerticalLabel) getHostFigure();
+ final LifelineVerticalLabel label = (LifelineVerticalLabel)getHostFigure();
label.setSelected(true);
label.setFocus(false);
}
@Override
protected void hideSelection() {
- final LifelineVerticalLabel label = (LifelineVerticalLabel) getHostFigure();
+ final LifelineVerticalLabel label = (LifelineVerticalLabel)getHostFigure();
label.setSelected(false);
label.setFocus(false);
}
@Override
protected void showFocus() {
- final LifelineVerticalLabel label = (LifelineVerticalLabel) getHostFigure();
+ final LifelineVerticalLabel label = (LifelineVerticalLabel)getHostFigure();
label.setFocus(true);
}
@Override
protected void hideFocus() {
- final LifelineVerticalLabel label = (LifelineVerticalLabel) getHostFigure();
+ final LifelineVerticalLabel label = (LifelineVerticalLabel)getHostFigure();
label.setFocus(false);
}
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomMessageOccurrenceSpecificationItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomMessageOccurrenceSpecificationItemSemanticEditPolicy.java
index e9dc44db16d..139856ca5e8 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomMessageOccurrenceSpecificationItemSemanticEditPolicy.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomMessageOccurrenceSpecificationItemSemanticEditPolicy.java
@@ -23,7 +23,6 @@ import org.eclipse.papyrus.uml.diagram.timing.edit.commands.TimeConstraintCreate
import org.eclipse.papyrus.uml.diagram.timing.edit.commands.TimeObservationCreateCommand;
import org.eclipse.papyrus.uml.diagram.timing.edit.policies.MessageOccurrenceSpecificationItemSemanticEditPolicyCN;
import org.eclipse.papyrus.uml.diagram.timing.providers.UMLElementTypes;
-import org.eclipse.uml2.uml.MessageOccurrenceSpecification;
/** Semantic edit policy for {@link MessageOccurrenceSpecification}s */
public class CustomMessageOccurrenceSpecificationItemSemanticEditPolicy extends MessageOccurrenceSpecificationItemSemanticEditPolicyCN {
@@ -31,7 +30,7 @@ public class CustomMessageOccurrenceSpecificationItemSemanticEditPolicy extends
/** Handles the "Hide Element" (remove only the view, and keep the semantic element) */
@Override
public Command getCommand(final Request request) {
- if (request.getType() == REQ_DELETE) {
+ if(request.getType() == REQ_DELETE) {
final Command baseCommand = super.getCommand(request);
return OccurrenceSpecificationUtils.getHideOccurrenceSpecificationCommand(getHost(), baseCommand);
}
@@ -41,10 +40,10 @@ public class CustomMessageOccurrenceSpecificationItemSemanticEditPolicy extends
@Override
protected Command getCreateCommand(final CreateElementRequest req) {
final IElementType elementType = req.getElementType();
- if (UMLElementTypes.TimeConstraint_15 == elementType) {
+ if(UMLElementTypes.TimeConstraint_15 == elementType) {
return getGEFWrapper(new TimeConstraintCreateCommand(req));
}
- if (UMLElementTypes.TimeObservation_16 == elementType) {
+ if(UMLElementTypes.TimeObservation_16 == elementType) {
return getGEFWrapper(new TimeObservationCreateCommand(req));
}
return super.getCreateCommand(req);
@@ -53,10 +52,10 @@ public class CustomMessageOccurrenceSpecificationItemSemanticEditPolicy extends
@Override
protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
final IElementType requestElementType = req.getElementType();
- if (requestElementType == null) {
+ if(requestElementType == null) {
return null;
}
- if (MessageUtils.isMessage(requestElementType)) {
+ if(MessageUtils.isMessage(requestElementType)) {
return getGEFWrapper(new CustomMessageCreateCommand(req));
}
return super.getCreateRelationshipCommand(req);
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomOccurrenceSpecificationItemSemanticEditPolicy.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomOccurrenceSpecificationItemSemanticEditPolicy.java
index df94b4ecfad..1ce6acf068e 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomOccurrenceSpecificationItemSemanticEditPolicy.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomOccurrenceSpecificationItemSemanticEditPolicy.java
@@ -23,8 +23,7 @@ import org.eclipse.papyrus.uml.diagram.timing.edit.policies.OccurrenceSpecificat
/**
* <ul>
* <li>Handles hiding an OccurrenceSpecification and the associated VerticalLine and StateInvariant
- * <li>Handles destroying an OccurrenceSpecification and the associated elements, while renaming the
- * OccurrenceSpecifications and StateInvariants
+ * <li>Handles destroying an OccurrenceSpecification and the associated elements, while renaming the OccurrenceSpecifications and StateInvariants
* <li>Creates the CustomMessageCreateCommand
* </ul>
*/
@@ -33,7 +32,7 @@ public class CustomOccurrenceSpecificationItemSemanticEditPolicy extends Occurre
/** Handles the "Hide Element" (remove only the view, and keep the semantic element) */
@Override
public Command getCommand(final Request request) {
- if (request.getType() == REQ_DELETE) {
+ if(request.getType() == REQ_DELETE) {
final Command baseCommand = super.getCommand(request);
return OccurrenceSpecificationUtils.getHideOccurrenceSpecificationCommand(getHost(), baseCommand);
}
@@ -43,10 +42,10 @@ public class CustomOccurrenceSpecificationItemSemanticEditPolicy extends Occurre
@Override
protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
final IElementType requestElementType = req.getElementType();
- if (requestElementType == null) {
+ if(requestElementType == null) {
return null;
}
- if (MessageUtils.isMessage(requestElementType)) {
+ if(MessageUtils.isMessage(requestElementType)) {
return getGEFWrapper(new CustomMessageCreateCommand(req));
}
return super.getCreateRelationshipCommand(req);
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomTimelineCompartmentLayoutEditPolicy.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomTimelineCompartmentLayoutEditPolicy.java
index 1386d6bfc31..374d48d8c08 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomTimelineCompartmentLayoutEditPolicy.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomTimelineCompartmentLayoutEditPolicy.java
@@ -71,6 +71,7 @@ import org.eclipse.uml2.uml.UMLPackage;
public class CustomTimelineCompartmentLayoutEditPolicy extends AbstractTimelineLayoutPolicy {
private static final String ALL_MOVED_EDITPARTS = "ALL_MOVED_EDITPARTS"; //$NON-NLS-1$
+
/** The height of the feedback figure when moving StateInvariants up or down. */
private static final int LAYOUT_FEEDBACK_HEIGHT = 4;
@@ -78,55 +79,55 @@ public class CustomTimelineCompartmentLayoutEditPolicy extends AbstractTimelineL
@Override
protected Command getMoveChildrenCommand(final Request request) {
- if (RequestUtils.isChangeBoundsRequestFor(request, UMLPackage.eINSTANCE.getStateInvariant())) {
+ if(RequestUtils.isChangeBoundsRequestFor(request, UMLPackage.eINSTANCE.getStateInvariant())) {
return getMoveStateInvariantCommand(request);
- } else if (RequestUtils.isChangeBoundsRequestFor(request, FullStateInvariantVerticalLineEditPart.class)) {
+ } else if(RequestUtils.isChangeBoundsRequestFor(request, FullStateInvariantVerticalLineEditPart.class)) {
return getMoveVerticalLinesCommand(request);
- } else if (RequestUtils.isChangeBoundsRequestFor(request, UMLPackage.eINSTANCE.getOccurrenceSpecification())) {
+ } else if(RequestUtils.isChangeBoundsRequestFor(request, UMLPackage.eINSTANCE.getOccurrenceSpecification())) {
return getMoveOccurrenceSpecificationsCommand(request);
}
return super.getMoveChildrenCommand(request);
}
private Command getMoveStateInvariantCommand(final Request request) {
- final ChangeBoundsRequest changeBoundsRequest = (ChangeBoundsRequest) request;
+ final ChangeBoundsRequest changeBoundsRequest = (ChangeBoundsRequest)request;
final Point location = changeBoundsRequest.getLocation();
- if (location == null) {
+ if(location == null) {
Activator.log.warn("Ignoring ChangeBoundsRequest without a Location"); //$NON-NLS-1$
return UnexecutableCommand.INSTANCE;
}
final int ordinate = location.y;
final CompoundCommand compoundCommand = new CompoundCommand(Messages.CustomTimelineCompartmentLayoutEditPolicy_MoveStateInvariant);
- final FullLifelineEditPartCN lifelineEditPart = (FullLifelineEditPartCN) getHost().getParent();
+ final FullLifelineEditPartCN lifelineEditPart = (FullLifelineEditPartCN)getHost().getParent();
compoundCommand.add(new RefreshCommandForUndo(lifelineEditPart));
final StateDefinitionEditPart stateDefinitionEditPart = StateDefinitionUtils.findStateDefinitionClosestToOrdinate(lifelineEditPart, ordinate);
- if (stateDefinitionEditPart == null) {
+ if(stateDefinitionEditPart == null) {
return UnexecutableCommand.INSTANCE;
}
- final View stateDefinitionView = ((View) stateDefinitionEditPart.getModel());
+ final View stateDefinitionView = ((View)stateDefinitionEditPart.getModel());
final String closestStateDefinitionName = StateDefinitionUtils.getStateDefinitionName(stateDefinitionView);
final String closestStateDefinitionId = StateDefinitionUtils.getStateDefinitionViewID(stateDefinitionView);
@SuppressWarnings("unchecked")
final List<EditPart> editParts = changeBoundsRequest.getEditParts();
- for (final EditPart editPart : editParts) {
- if (editPart instanceof FullStateInvariantEditPartCN) {
- final FullStateInvariantEditPartCN fullStateInvariantEditPart = (FullStateInvariantEditPartCN) editPart;
- final StateInvariant stateInvariant = (StateInvariant) ((View) (fullStateInvariantEditPart.getModel())).getElement();
+ for(final EditPart editPart : editParts) {
+ if(editPart instanceof FullStateInvariantEditPartCN) {
+ final FullStateInvariantEditPartCN fullStateInvariantEditPart = (FullStateInvariantEditPartCN)editPart;
+ final StateInvariant stateInvariant = (StateInvariant)((View)(fullStateInvariantEditPart.getModel())).getElement();
final TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(stateInvariant);
- if (editingDomain == null) {
+ if(editingDomain == null) {
throw new IllegalStateException("no editing domain"); //$NON-NLS-1$
}
- final AbstractTransactionalCommand updateStateInvariantCommand = new AbstractTransactionalCommand(editingDomain,
- Messages.CustomTimelineCompartmentLayoutEditPolicy_UpdateStateInvariant, null) {
+ final AbstractTransactionalCommand updateStateInvariantCommand = new AbstractTransactionalCommand(editingDomain, Messages.CustomTimelineCompartmentLayoutEditPolicy_UpdateStateInvariant, null) {
+
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
StateInvariantUtils.setStateInvariantId(stateInvariant, closestStateDefinitionId);
StateInvariantUtils.setInnerStateInvariantName(stateInvariant, closestStateDefinitionName);
- final View lifelineView = (View) lifelineEditPart.getModel();
- final Lifeline lifeline = (Lifeline) lifelineView.getElement();
+ final View lifelineView = (View)lifelineEditPart.getModel();
+ final Lifeline lifeline = (Lifeline)lifelineView.getElement();
LifelineUtils.updateFragmentNames(lifeline, lifelineView);
return CommandResult.newOKCommandResult();
}
@@ -143,15 +144,14 @@ public class CustomTimelineCompartmentLayoutEditPolicy extends AbstractTimelineL
* the layout).
*/
private Command getMoveVerticalLinesCommand(final Request request) {
- final ChangeBoundsRequest changeBoundsRequest = (ChangeBoundsRequest) request;
+ final ChangeBoundsRequest changeBoundsRequest = (ChangeBoundsRequest)request;
final CompoundCommand compoundCommand = new CompoundCommand(Messages.CustomTimelineCompartmentLayoutEditPolicy_MoveVerticalLine);
- final FullLifelineEditPartCN lifelineEditPart = (FullLifelineEditPartCN) getHost().getParent();
+ final FullLifelineEditPartCN lifelineEditPart = (FullLifelineEditPartCN)getHost().getParent();
compoundCommand.add(new RefreshCommandForUndo(lifelineEditPart));
- final FullLifelineTimelineCompartmentEditPartCN timelineCompartmentEditPart = (FullLifelineTimelineCompartmentEditPartCN) EditPartUtils
- .findFirstChildEditPartWithId(lifelineEditPart, FullLifelineTimelineCompartmentEditPartCN.VISUAL_ID);
- final View timelineCompartmentView = (View) timelineCompartmentEditPart.getModel();
+ final FullLifelineTimelineCompartmentEditPartCN timelineCompartmentEditPart = (FullLifelineTimelineCompartmentEditPartCN)EditPartUtils.findFirstChildEditPartWithId(lifelineEditPart, FullLifelineTimelineCompartmentEditPartCN.VISUAL_ID);
+ final View timelineCompartmentView = (View)timelineCompartmentEditPart.getModel();
@SuppressWarnings("unchecked")
final List<EditPart> editParts = changeBoundsRequest.getEditParts();
@@ -161,16 +161,16 @@ public class CustomTimelineCompartmentLayoutEditPolicy extends AbstractTimelineL
final List<Node> nodesToMove = new ArrayList<Node>();
final List<Integer> indexes = new ArrayList<Integer>();
final List<Node> allMovedNodes = getAllMovedNodes(request);
- for (final EditPart editPart : editParts) {
- if (editPart instanceof FullStateInvariantVerticalLineEditPart) {
- final FullStateInvariantVerticalLineEditPart verticalLineEditPart = (FullStateInvariantVerticalLineEditPart) editPart;
- final View verticalLineView = (View) verticalLineEditPart.getModel();
+ for(final EditPart editPart : editParts) {
+ if(editPart instanceof FullStateInvariantVerticalLineEditPart) {
+ final FullStateInvariantVerticalLineEditPart verticalLineEditPart = (FullStateInvariantVerticalLineEditPart)editPart;
+ final View verticalLineView = (View)verticalLineEditPart.getModel();
final int index = timelineCompartmentView.getChildren().indexOf(verticalLineView);
- if (index > 0) {
+ if(index > 0) {
final int occurrenceSpecificationIndex = index - 1;
- final View previousView = (View) timelineCompartmentView.getChildren().get(occurrenceSpecificationIndex);
- if (previousView.getElement() instanceof OccurrenceSpecification) {
- final Node occurrenceSpecificationNode = (Node) previousView;
+ final View previousView = (View)timelineCompartmentView.getChildren().get(occurrenceSpecificationIndex);
+ if(previousView.getElement() instanceof OccurrenceSpecification) {
+ final Node occurrenceSpecificationNode = (Node)previousView;
nodesToMove.add(occurrenceSpecificationNode);
indexes.add(Integer.valueOf(occurrenceSpecificationIndex));
}
@@ -178,7 +178,7 @@ public class CustomTimelineCompartmentLayoutEditPolicy extends AbstractTimelineL
}
}
int i = 0;
- for (final Node node : nodesToMove) {
+ for(final Node node : nodesToMove) {
compoundCommand.add(getMoveOccurrenceSpecificationCommand(node, moveDelta, timelineCompartmentView, indexes.get(i).intValue(), allMovedNodes));
i++;
}
@@ -187,15 +187,14 @@ public class CustomTimelineCompartmentLayoutEditPolicy extends AbstractTimelineL
}
private Command getMoveOccurrenceSpecificationsCommand(final Request request) {
- final ChangeBoundsRequest changeBoundsRequest = (ChangeBoundsRequest) request;
+ final ChangeBoundsRequest changeBoundsRequest = (ChangeBoundsRequest)request;
final CompoundCommand compoundCommand = new CompoundCommand(Messages.CustomTimelineCompartmentLayoutEditPolicy_MoveOccurrenceSpecification);
- final FullLifelineEditPartCN lifelineEditPart = (FullLifelineEditPartCN) getHost().getParent();
+ final FullLifelineEditPartCN lifelineEditPart = (FullLifelineEditPartCN)getHost().getParent();
compoundCommand.add(new RefreshCommandForUndo(lifelineEditPart));
- final FullLifelineTimelineCompartmentEditPartCN timelineCompartmentEditPart = (FullLifelineTimelineCompartmentEditPartCN) EditPartUtils
- .findFirstChildEditPartWithId(lifelineEditPart, FullLifelineTimelineCompartmentEditPartCN.VISUAL_ID);
- final View timelineCompartmentView = (View) timelineCompartmentEditPart.getModel();
+ final FullLifelineTimelineCompartmentEditPartCN timelineCompartmentEditPart = (FullLifelineTimelineCompartmentEditPartCN)EditPartUtils.findFirstChildEditPartWithId(lifelineEditPart, FullLifelineTimelineCompartmentEditPartCN.VISUAL_ID);
+ final View timelineCompartmentView = (View)timelineCompartmentEditPart.getModel();
@SuppressWarnings("unchecked")
final List<EditPart> editParts = changeBoundsRequest.getEditParts();
final Point moveDelta = FigureUtils.scaleByZoom(changeBoundsRequest.getMoveDelta(), lifelineEditPart.getFigure());
@@ -203,18 +202,18 @@ public class CustomTimelineCompartmentLayoutEditPolicy extends AbstractTimelineL
moveDelta.y = 0;
final List<Node> nodesToMove = new ArrayList<Node>();
final List<Node> allMovedNodes = getAllMovedNodes(request);
- for (final EditPart editPart : editParts) {
- if (OccurrenceSpecificationUtils.isOccurrenceSpecificationEditPart(editPart)) {
- final Node occurrenceSpecificationNode = (Node) editPart.getModel();
- final Rectangle figureBounds = ((GraphicalEditPart) editPart).getFigure().getBounds();
+ for(final EditPart editPart : editParts) {
+ if(OccurrenceSpecificationUtils.isOccurrenceSpecificationEditPart(editPart)) {
+ final Node occurrenceSpecificationNode = (Node)editPart.getModel();
+ final Rectangle figureBounds = ((GraphicalEditPart)editPart).getFigure().getBounds();
// constrain the move inside the timeline
moveDelta.x = Math.min(moveDelta.x, getHostFigure().getBounds().width - figureBounds.x - figureBounds.width - 2);
nodesToMove.add(occurrenceSpecificationNode);
}
}
- for (final Node node : nodesToMove) {
+ for(final Node node : nodesToMove) {
final int index = timelineCompartmentView.getChildren().indexOf(node);
- if (index >= 0) {
+ if(index >= 0) {
compoundCommand.add(getMoveOccurrenceSpecificationCommand(node, moveDelta, timelineCompartmentView, index, allMovedNodes));
}
}
@@ -227,22 +226,22 @@ public class CustomTimelineCompartmentLayoutEditPolicy extends AbstractTimelineL
private static List<Node> getAllMovedNodes(final Request request) {
final List<Node> allMovedNodes = new ArrayList<Node>();
final Map<Object, Object> extendedData = request.getExtendedData();
- if (extendedData != null) {
- List<EditPart> editParts = (List<EditPart>) extendedData.get(ALL_MOVED_EDITPARTS);
+ if(extendedData != null) {
+ List<EditPart> editParts = (List<EditPart>)extendedData.get(ALL_MOVED_EDITPARTS);
// when the request is sent directly, for example in unit tests
- if (editParts == null) {
- if (request instanceof GroupRequest) {
- final GroupRequest groupRequest = (GroupRequest) request;
+ if(editParts == null) {
+ if(request instanceof GroupRequest) {
+ final GroupRequest groupRequest = (GroupRequest)request;
editParts = groupRequest.getEditParts();
}
}
- if (editParts != null) {
- for (final EditPart editPart : editParts) {
- if (editPart instanceof GraphicalEditPart) {
- final GraphicalEditPart graphicalEditPart = (GraphicalEditPart) editPart;
+ if(editParts != null) {
+ for(final EditPart editPart : editParts) {
+ if(editPart instanceof GraphicalEditPart) {
+ final GraphicalEditPart graphicalEditPart = (GraphicalEditPart)editPart;
final Object model = graphicalEditPart.getModel();
- if (model instanceof Node) {
- final Node node = (Node) model;
+ if(model instanceof Node) {
+ final Node node = (Node)model;
allMovedNodes.add(node);
}
}
@@ -255,12 +254,10 @@ public class CustomTimelineCompartmentLayoutEditPolicy extends AbstractTimelineL
/** returns a NonResizableEditPolicy instead of a ResizableEditPolicy for some children */
@Override
protected EditPolicy createChildEditPolicy(final EditPart child) {
- final View childView = (View) child.getModel();
+ final View childView = (View)child.getModel();
final int visualID = UMLVisualIDRegistry.getVisualID(childView);
// make these EditParts non-resizable
- if (visualID == FullStateInvariantEditPartCN.VISUAL_ID || OccurrenceSpecificationUtils.isOccurrenceSpecificationEditPart(visualID)
- || visualID == FullStateInvariantVerticalLineEditPart.VISUAL_ID || TimeElementUtils.isTimeElementEditPart(visualID)
- || GeneralOrderingUtils.isGeneralOrderingEditPart(visualID)) {
+ if(visualID == FullStateInvariantEditPartCN.VISUAL_ID || OccurrenceSpecificationUtils.isOccurrenceSpecificationEditPart(visualID) || visualID == FullStateInvariantVerticalLineEditPart.VISUAL_ID || TimeElementUtils.isTimeElementEditPart(visualID) || GeneralOrderingUtils.isGeneralOrderingEditPart(visualID)) {
return createNonResizableEditPolicy();
}
return super.createChildEditPolicy(child);
@@ -268,6 +265,7 @@ public class CustomTimelineCompartmentLayoutEditPolicy extends AbstractTimelineL
private NonResizableEditPolicy createNonResizableEditPolicy() {
return new NonResizableEditPolicyEx() {
+
/**
* Overridden in order to keep the information about all EditParts being dragged simultaneously (the GEF
* NonResizableEditPolicy redirects a multi-part move to several moves each on a single part)
@@ -292,21 +290,20 @@ public class CustomTimelineCompartmentLayoutEditPolicy extends AbstractTimelineL
@Override
protected void showLayoutTargetFeedback(final Request request) {
- if (!RequestUtils.isChangeBoundsRequestFor(request, UMLPackage.eINSTANCE.getStateInvariant())) {
+ if(!RequestUtils.isChangeBoundsRequestFor(request, UMLPackage.eINSTANCE.getStateInvariant())) {
return;
}
eraseLayoutTargetFeedback();
- final ChangeBoundsRequest changeBoundsRequest = (ChangeBoundsRequest) request;
+ final ChangeBoundsRequest changeBoundsRequest = (ChangeBoundsRequest)request;
final int targetY = computeTargetOrdinate(changeBoundsRequest);
@SuppressWarnings("unchecked")
final List<GraphicalEditPart> editParts = changeBoundsRequest.getEditParts();
final double scale = FigureUtils.getScale(getHostFigure());
- for (final GraphicalEditPart editPart : editParts) {
+ for(final GraphicalEditPart editPart : editParts) {
final Rectangle figureBounds = editPart.getFigure().getBounds();
- final Rectangle containerBounds = ((GraphicalEditPart) getHost()).getFigure().getBounds();
- final Rectangle feedbackBounds = new Rectangle(containerBounds.x + figureBounds.x, targetY - LAYOUT_FEEDBACK_HEIGHT / 2, figureBounds.width,
- LAYOUT_FEEDBACK_HEIGHT);
+ final Rectangle containerBounds = ((GraphicalEditPart)getHost()).getFigure().getBounds();
+ final Rectangle feedbackBounds = new Rectangle(containerBounds.x + figureBounds.x, targetY - LAYOUT_FEEDBACK_HEIGHT / 2, figureBounds.width, LAYOUT_FEEDBACK_HEIGHT);
feedbackBounds.scale(scale);
this.layoutFeedbackFigures.add(createLayoutTargetFeedbackFigure(feedbackBounds));
}
@@ -314,7 +311,7 @@ public class CustomTimelineCompartmentLayoutEditPolicy extends AbstractTimelineL
private int computeTargetOrdinate(final ChangeBoundsRequest request) {
final int ordinate = request.getLocation().y;
- final FullLifelineEditPartCN lifelineEditPart = (FullLifelineEditPartCN) getHost().getParent();
+ final FullLifelineEditPartCN lifelineEditPart = (FullLifelineEditPartCN)getHost().getParent();
final StateDefinitionEditPart stateDefinitionEditPart = StateDefinitionUtils.findStateDefinitionClosestToOrdinate(lifelineEditPart, ordinate);
final Rectangle figureBounds = stateDefinitionEditPart.getFigure().getBounds();
@@ -333,14 +330,14 @@ public class CustomTimelineCompartmentLayoutEditPolicy extends AbstractTimelineL
@Override
protected void eraseLayoutTargetFeedback(final Request request) {
- if (!RequestUtils.isChangeBoundsRequestFor(request, UMLPackage.eINSTANCE.getStateInvariant())) {
+ if(!RequestUtils.isChangeBoundsRequestFor(request, UMLPackage.eINSTANCE.getStateInvariant())) {
return;
}
eraseLayoutTargetFeedback();
}
private void eraseLayoutTargetFeedback() {
- for (final IFigure figure : this.layoutFeedbackFigures) {
+ for(final IFigure figure : this.layoutFeedbackFigures) {
removeFeedback(figure);
}
this.layoutFeedbackFigures.clear();
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomTimingDiagramCreationEditPolicy.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomTimingDiagramCreationEditPolicy.java
index 2e6bdd2aba2..ab9c22abd48 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomTimingDiagramCreationEditPolicy.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomTimingDiagramCreationEditPolicy.java
@@ -36,15 +36,15 @@ public class CustomTimingDiagramCreationEditPolicy extends PapyrusCreationEditPo
protected Command getCreateCommand(final CreateViewRequest request) {
final Command superCommand = super.getCreateCommand(request);
final List<? extends ViewDescriptor> viewDescriptors = request.getViewDescriptors();
- if (request instanceof CreateViewAndElementRequest && viewDescriptors.size() == 1) {
+ if(request instanceof CreateViewAndElementRequest && viewDescriptors.size() == 1) {
final String semanticHint = viewDescriptors.get(0).getSemanticHint();
- if (Integer.toString(InteractionEditPartTN.VISUAL_ID).equals(semanticHint)) {
+ if(Integer.toString(InteractionEditPartTN.VISUAL_ID).equals(semanticHint)) {
final TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(getHost().getModel());
final CompoundCommand compoundCommand = new CompoundCommand(Messages.CustomTimingDiagramCreationEditPolicy_CreateInteraction);
- compoundCommand.add(new RefreshCommandForUndo((IGraphicalEditPart) getHost()));
+ compoundCommand.add(new RefreshCommandForUndo((IGraphicalEditPart)getHost()));
compoundCommand.add(superCommand);
compoundCommand.add(new ICommandProxy(TimeRulerUtils.getCreateFreeTimeRulerCommand(superCommand, editingDomain, true)));
- compoundCommand.add(new RefreshCommandForDo((IGraphicalEditPart) getHost()));
+ compoundCommand.add(new RefreshCommandForDo((IGraphicalEditPart)getHost()));
return compoundCommand;
}
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/ExternalLabelPrimaryDragRoleEditPolicy.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/ExternalLabelPrimaryDragRoleEditPolicy.java
index 40673b4380e..c4ee9ee3a8f 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/ExternalLabelPrimaryDragRoleEditPolicy.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/ExternalLabelPrimaryDragRoleEditPolicy.java
@@ -47,14 +47,14 @@ public class ExternalLabelPrimaryDragRoleEditPolicy extends NonResizableLabelEdi
@Override
protected List<?> createSelectionHandles() {
- final MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
+ final MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
@Override
protected Command getMoveCommand(final ChangeBoundsRequest request) {
- final LabelEditPart editPart = (LabelEditPart) getHost();
+ final LabelEditPart editPart = (LabelEditPart)getHost();
final IFigure parentFigure = getHostFigure().getParent();
final Rectangle parentBounds = parentFigure.getBounds();
@@ -70,9 +70,8 @@ public class ExternalLabelPrimaryDragRoleEditPolicy extends NonResizableLabelEdi
updatedBounds = updatedBounds.getTranslated(parentBounds.getLocation().getNegated());
final CompoundCommand compoundCommand = new CompoundCommand();
- compoundCommand.add(new RefreshCommandForUndo((GraphicalEditPart) editPart.getParent().getParent()));
- compoundCommand.add(new ICommandProxy(new SetBoundsCommand(editPart.getEditingDomain(), DiagramUIMessages.MoveLabelCommand_Label_Location,
- new EObjectAdapter((View) editPart.getModel()), updatedBounds)));
+ compoundCommand.add(new RefreshCommandForUndo((GraphicalEditPart)editPart.getParent().getParent()));
+ compoundCommand.add(new ICommandProxy(new SetBoundsCommand(editPart.getEditingDomain(), DiagramUIMessages.MoveLabelCommand_Label_Location, new EObjectAdapter((View)editPart.getModel()), updatedBounds)));
compoundCommand.add(new RefreshCommandForDo(editPart));
return compoundCommand;
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/FirstEventRefreshEditPolicy.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/FirstEventRefreshEditPolicy.java
index d540944d813..aa8b7a5554a 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/FirstEventRefreshEditPolicy.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/FirstEventRefreshEditPolicy.java
@@ -41,7 +41,7 @@ public class FirstEventRefreshEditPolicy extends GraphicalEditPolicy implements
@Override
public void activate() {
this.umlElement = getUMLElement();
- if (this.umlElement == null) {
+ if(this.umlElement == null) {
return;
}
// adds a listener on the UML element
@@ -53,7 +53,7 @@ public class FirstEventRefreshEditPolicy extends GraphicalEditPolicy implements
@Override
public void deactivate() {
// retrieve the UML element managed by the edit part
- if (this.umlElement == null) {
+ if(this.umlElement == null) {
return;
}
// remove the listener from the UML element
@@ -66,8 +66,8 @@ public class FirstEventRefreshEditPolicy extends GraphicalEditPolicy implements
* @return the diagram event broker
*/
protected DiagramEventBroker getDiagramEventBroker() {
- final TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
- if (editingDomain != null) {
+ final TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ if(editingDomain != null) {
return DiagramEventBroker.getInstance(editingDomain);
}
return null;
@@ -80,8 +80,8 @@ public class FirstEventRefreshEditPolicy extends GraphicalEditPolicy implements
*/
protected Element getUMLElement() {
final View view = getView();
- if (view != null) {
- return (Element) view.getElement();
+ if(view != null) {
+ return (Element)view.getElement();
}
return null;
}
@@ -92,14 +92,13 @@ public class FirstEventRefreshEditPolicy extends GraphicalEditPolicy implements
* @return the view controlled by the host edit part
*/
protected View getView() {
- return (View) getHost().getModel();
+ return (View)getHost().getModel();
}
public void notifyChanged(final Notification notification) {
- if (notification.getEventType() == Notification.SET) {
+ if(notification.getEventType() == Notification.SET) {
final Object feature = notification.getFeature();
- if (feature == UMLPackage.eINSTANCE.getTimeObservation_FirstEvent() || feature == UMLPackage.eINSTANCE.getTimeObservation_Event()
- || feature == UMLPackage.eINSTANCE.getTimeConstraint_FirstEvent() || feature == UMLPackage.eINSTANCE.getConstraint_ConstrainedElement()) {
+ if(feature == UMLPackage.eINSTANCE.getTimeObservation_FirstEvent() || feature == UMLPackage.eINSTANCE.getTimeObservation_Event() || feature == UMLPackage.eINSTANCE.getTimeConstraint_FirstEvent() || feature == UMLPackage.eINSTANCE.getConstraint_ConstrainedElement()) {
refreshView();
}
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/GenericListCompartmentLayoutEditPolicy.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/GenericListCompartmentLayoutEditPolicy.java
index c30501b2acb..ceeb6eed568 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/GenericListCompartmentLayoutEditPolicy.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/GenericListCompartmentLayoutEditPolicy.java
@@ -45,13 +45,15 @@ import org.eclipse.papyrus.uml.diagram.timing.custom.utils.ViewUtils;
public class GenericListCompartmentLayoutEditPolicy extends ConstrainedToolbarLayoutEditPolicy {
private static final int LAYOUT_FEEDBACK_HEIGHT = 4;
+
private static final int MARGIN_BEFORE_FIRST = 4;
+
private static final int MARGIN_AFTER_LAST = 4;
protected IFigure layoutFeedbackFigure = null;
protected GraphicalEditPart getEditPartToRefresh() {
- return (GraphicalEditPart) getHost();
+ return (GraphicalEditPart)getHost();
}
protected int getLayoutFeedbackHeight() {
@@ -61,7 +63,7 @@ public class GenericListCompartmentLayoutEditPolicy extends ConstrainedToolbarLa
@Override
protected EditPolicy createChildEditPolicy(final EditPart child) {
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (result == null) {
+ if(result == null) {
// add an edit policy so that children can be moved
result = new NonResizableEditPolicyEx();
}
@@ -70,22 +72,22 @@ public class GenericListCompartmentLayoutEditPolicy extends ConstrainedToolbarLa
@Override
protected Command getMoveChildrenCommand(final Request request) {
- if (request instanceof ChangeBoundsRequest) {
- final ChangeBoundsRequest changeBoundsRequest = (ChangeBoundsRequest) request;
+ if(request instanceof ChangeBoundsRequest) {
+ final ChangeBoundsRequest changeBoundsRequest = (ChangeBoundsRequest)request;
final InsertionPoint insertionPoint = computeClosestInsertionPoint(changeBoundsRequest.getLocation().y);
- if (insertionPoint == null) {
+ if(insertionPoint == null) {
return UnexecutableCommand.INSTANCE;
}
- final GraphicalEditPart hostEditPart = (GraphicalEditPart) getHost();
- final View compartmentView = (View) hostEditPart.getModel();
+ final GraphicalEditPart hostEditPart = (GraphicalEditPart)getHost();
+ final View compartmentView = (View)hostEditPart.getModel();
@SuppressWarnings("unchecked")
final List<EditPart> editParts = changeBoundsRequest.getEditParts();
- for (final EditPart editPart : editParts) {
- if (editPart instanceof GraphicalEditPart) {
- final GraphicalEditPart graphicalEditPart = (GraphicalEditPart) editPart;
- final View view = (View) graphicalEditPart.getModel();
+ for(final EditPart editPart : editParts) {
+ if(editPart instanceof GraphicalEditPart) {
+ final GraphicalEditPart graphicalEditPart = (GraphicalEditPart)editPart;
+ final View view = (View)graphicalEditPart.getModel();
final GraphicalEditPart editPartToRefresh = getEditPartToRefresh();
final CompoundCommand compoundCommand = new CompoundCommand();
@@ -101,20 +103,19 @@ public class GenericListCompartmentLayoutEditPolicy extends ConstrainedToolbarLa
@Override
protected void showLayoutTargetFeedback(final Request request) {
- if (request instanceof ChangeBoundsRequest) {
+ if(request instanceof ChangeBoundsRequest) {
eraseLayoutTargetFeedback();
- final ChangeBoundsRequest changeBoundsRequest = (ChangeBoundsRequest) request;
+ final ChangeBoundsRequest changeBoundsRequest = (ChangeBoundsRequest)request;
final InsertionPoint insertionPoint = computeClosestInsertionPoint(changeBoundsRequest.getLocation().y);
- if (insertionPoint == null) {
+ if(insertionPoint == null) {
return;
}
final Rectangle containerBounds = new Rectangle(getHostFigure().getBounds());
getHostFigure().translateToAbsolute(containerBounds);
final int layoutFeedbackHeight = getLayoutFeedbackHeight();
- final Rectangle feedbackBounds = new Rectangle(containerBounds.x, insertionPoint.getLocation() - layoutFeedbackHeight / 2, containerBounds.width,
- layoutFeedbackHeight);
+ final Rectangle feedbackBounds = new Rectangle(containerBounds.x, insertionPoint.getLocation() - layoutFeedbackHeight / 2, containerBounds.width, layoutFeedbackHeight);
final Point origin = FigureUtils.getLayeredPaneOrigin(getHostFigure());
feedbackBounds.translate(origin);
@@ -126,7 +127,9 @@ public class GenericListCompartmentLayoutEditPolicy extends ConstrainedToolbarLa
}
protected class InsertionPoint {
+
int index;
+
int location;
public InsertionPoint(final int index, final int location) {
@@ -146,13 +149,13 @@ public class GenericListCompartmentLayoutEditPolicy extends ConstrainedToolbarLa
protected InsertionPoint computeClosestInsertionPoint(final int offset) {
@SuppressWarnings("unchecked")
final List<GraphicalEditPart> children = getHost().getChildren();
- if (children.isEmpty()) {
+ if(children.isEmpty()) {
return null;
}
final List<InsertionPoint> insertionPoints = computeInsertionPoints(children);
final TreeMap<Integer, InsertionPoint> distanceMap = new TreeMap<Integer, InsertionPoint>();
- for (final InsertionPoint insertionPoint : insertionPoints) {
+ for(final InsertionPoint insertionPoint : insertionPoints) {
final int distance = Math.abs(offset - insertionPoint.getLocation());
distanceMap.put(Integer.valueOf(distance), insertionPoint);
}
@@ -172,19 +175,19 @@ public class GenericListCompartmentLayoutEditPolicy extends ConstrainedToolbarLa
final int size = children.size();
final List<InsertionPoint> insertionPoints = new ArrayList<GenericListCompartmentLayoutEditPolicy.InsertionPoint>();
Rectangle previousBounds = null;
- for (int i = 0; i < size; i++) {
+ for(int i = 0; i < size; i++) {
final GraphicalEditPart childEditPart = children.get(i);
final Rectangle bounds = new Rectangle(childEditPart.getFigure().getBounds());
getHostFigure().translateToAbsolute(bounds);
- if (previousBounds != null) {
+ if(previousBounds != null) {
// an insertion point between two figures
insertionPoints.add(new InsertionPoint(i, (previousBounds.y + previousBounds.height + bounds.y) / 2));
} else {
// an insertion point before the first figure
insertionPoints.add(new InsertionPoint(i, bounds.y - getMarginBeforeFirst()));
}
- if (i == size - 1) {
+ if(i == size - 1) {
// last insertion point: after the last figure
insertionPoints.add(new InsertionPoint(i + 1, bounds.y + bounds.height + getMarginAfterLast()));
}
@@ -209,7 +212,7 @@ public class GenericListCompartmentLayoutEditPolicy extends ConstrainedToolbarLa
}
protected void eraseLayoutTargetFeedback() {
- if (this.layoutFeedbackFigure != null) {
+ if(this.layoutFeedbackFigure != null) {
removeFeedback(this.layoutFeedbackFigure);
this.layoutFeedbackFigure = null;
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/LayoutEditPolicyForLabel.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/LayoutEditPolicyForLabel.java
index c1b5d9228e7..f7385ae724f 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/LayoutEditPolicyForLabel.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/LayoutEditPolicyForLabel.java
@@ -32,12 +32,12 @@ public class LayoutEditPolicyForLabel extends LayoutEditPolicy {
@Override
protected EditPolicy createChildEditPolicy(final EditPart child) {
- final View childView = (View) child.getModel();
- if (UMLVisualIDRegistry.getVisualID(childView) == this.labelVisualId) {
+ final View childView = (View)child.getModel();
+ if(UMLVisualIDRegistry.getVisualID(childView) == this.labelVisualId) {
return new ExternalLabelPrimaryDragRoleEditPolicy();
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (result == null) {
+ if(result == null) {
result = new NonResizableEditPolicy();
}
return result;
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/SelectionOnlyLayoutEditPolicy.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/SelectionOnlyLayoutEditPolicy.java
index 260fd49b1a6..7e0de86946e 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/SelectionOnlyLayoutEditPolicy.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/SelectionOnlyLayoutEditPolicy.java
@@ -17,6 +17,7 @@ import org.eclipse.gef.requests.CreateRequest;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy;
public class SelectionOnlyLayoutEditPolicy extends LayoutEditPolicy {
+
@Override
protected Command getMoveChildrenCommand(final Request request) {
return null;
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/TimeRulerVisibilityRefreshEditPolicy.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/TimeRulerVisibilityRefreshEditPolicy.java
index 7bc3a167fb8..af03e4a5887 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/TimeRulerVisibilityRefreshEditPolicy.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/TimeRulerVisibilityRefreshEditPolicy.java
@@ -40,7 +40,7 @@ public class TimeRulerVisibilityRefreshEditPolicy extends GraphicalEditPolicy im
public void activate() {
this.timeRulerCompartmentView = getListenedView();
- if (this.timeRulerCompartmentView == null) {
+ if(this.timeRulerCompartmentView == null) {
return;
}
// adds a listener on the View
@@ -51,7 +51,7 @@ public class TimeRulerVisibilityRefreshEditPolicy extends GraphicalEditPolicy im
@Override
public void deactivate() {
- if (this.timeRulerCompartmentView == null) {
+ if(this.timeRulerCompartmentView == null) {
return;
}
// remove the listener from the View
@@ -64,8 +64,8 @@ public class TimeRulerVisibilityRefreshEditPolicy extends GraphicalEditPolicy im
* @return the diagram event broker
*/
protected DiagramEventBroker getDiagramEventBroker() {
- final TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
- if (editingDomain != null) {
+ final TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ if(editingDomain != null) {
return DiagramEventBroker.getInstance(editingDomain);
}
return null;
@@ -73,20 +73,20 @@ public class TimeRulerVisibilityRefreshEditPolicy extends GraphicalEditPolicy im
protected View getListenedView() {
final View view = getView();
- if (view != null) {
+ if(view != null) {
return ViewUtils.findTimeRulerCompartmentView(view);
}
return null;
}
protected View getView() {
- return (View) getHost().getModel();
+ return (View)getHost().getModel();
}
public void notifyChanged(final Notification notification) {
- if (notification.getEventType() == Notification.SET) {
+ if(notification.getEventType() == Notification.SET) {
final Object feature = notification.getFeature();
- if (feature == NotationPackage.eINSTANCE.getView_Visible()) {
+ if(feature == NotationPackage.eINSTANCE.getView_Visible()) {
refreshFigure();
}
}
@@ -98,7 +98,7 @@ public class TimeRulerVisibilityRefreshEditPolicy extends GraphicalEditPolicy im
*/
public void refreshFigure() {
final boolean visible = getListenedView().isVisible();
- final IFigure figure = ((IGraphicalEditPart) getHost()).getFigure();
+ final IFigure figure = ((IGraphicalEditPart)getHost()).getFigure();
final LifelineFigure lifelineFigure = FigureUtils.findChildFigureInstance(figure, LifelineFigure.class);
lifelineFigure.setDisplayTimeRuler(visible);
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/TimingDiagramDragDropEditPolicy.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/TimingDiagramDragDropEditPolicy.java
index c8e9124ccba..2eda7e42da8 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/TimingDiagramDragDropEditPolicy.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/TimingDiagramDragDropEditPolicy.java
@@ -93,11 +93,7 @@ public class TimingDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
/** Elements for which we want to specialize the drop */
@SuppressWarnings("boxing")
- private static final Integer[] SPECIFIC_DROP_ELEMENT_IDS = { InteractionEditPartTN.VISUAL_ID, FullLifelineEditPartCN.VISUAL_ID,
- CompactLifelineEditPartCN.VISUAL_ID, MessageSyncEditPart.VISUAL_ID, MessageAsyncEditPart.VISUAL_ID, MessageReplyEditPart.VISUAL_ID,
- MessageCreateEditPart.VISUAL_ID, MessageDeleteEditPart.VISUAL_ID, MessageFoundEditPart.VISUAL_ID, MessageLostEditPart.VISUAL_ID,
- TimeObservationEditPart.VISUAL_ID, TimeConstraintEditPart.VISUAL_ID, DurationObservationEditPartCN.VISUAL_ID,
- DurationConstraintEditPartCN.VISUAL_ID, GeneralOrderingEditPart.VISUAL_ID, GateEditPart.VISUAL_ID };
+ private static final Integer[] SPECIFIC_DROP_ELEMENT_IDS = { InteractionEditPartTN.VISUAL_ID, FullLifelineEditPartCN.VISUAL_ID, CompactLifelineEditPartCN.VISUAL_ID, MessageSyncEditPart.VISUAL_ID, MessageAsyncEditPart.VISUAL_ID, MessageReplyEditPart.VISUAL_ID, MessageCreateEditPart.VISUAL_ID, MessageDeleteEditPart.VISUAL_ID, MessageFoundEditPart.VISUAL_ID, MessageLostEditPart.VISUAL_ID, TimeObservationEditPart.VISUAL_ID, TimeConstraintEditPart.VISUAL_ID, DurationObservationEditPartCN.VISUAL_ID, DurationConstraintEditPartCN.VISUAL_ID, GeneralOrderingEditPart.VISUAL_ID, GateEditPart.VISUAL_ID };
public TimingDiagramDragDropEditPolicy() {
super(TimingDiagramLinkMappingHelper.getInstance());
@@ -106,7 +102,7 @@ public class TimingDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
/** override the drop command */
@Override
protected Command getSpecificDropCommand(final DropObjectsRequest dropRequest, final Element semanticElement, final int nodeVISUALID, final int linkVISUALID) {
- switch (nodeVISUALID) {
+ switch(nodeVISUALID) {
case InteractionEditPartTN.VISUAL_ID:
return new ICommandProxy(dropMainElement(dropRequest, semanticElement, nodeVISUALID));
case FullLifelineEditPartCN.VISUAL_ID:
@@ -115,30 +111,30 @@ public class TimingDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
default:
}
- if (getHost().getModel() instanceof View) {
- final View hostView = (View) getHost().getModel();
- if (MessageUtils.isMessage(linkVISUALID)) {
- if (semanticElement instanceof Message) {
- return new ICommandProxy(DropUtils.getDropMessageCommand((Message) semanticElement, hostView, getViewer()));
+ if(getHost().getModel() instanceof View) {
+ final View hostView = (View)getHost().getModel();
+ if(MessageUtils.isMessage(linkVISUALID)) {
+ if(semanticElement instanceof Message) {
+ return new ICommandProxy(DropUtils.getDropMessageCommand((Message)semanticElement, hostView, getViewer()));
}
}
- if (nodeVISUALID == TimeObservationEditPart.VISUAL_ID) {
- return new ICommandProxy(DropUtils.getDropTimeObservationCommand((TimeObservation) semanticElement, hostView, getViewer()));
+ if(nodeVISUALID == TimeObservationEditPart.VISUAL_ID) {
+ return new ICommandProxy(DropUtils.getDropTimeObservationCommand((TimeObservation)semanticElement, hostView, getViewer()));
}
- if (nodeVISUALID == TimeConstraintEditPart.VISUAL_ID) {
- return new ICommandProxy(DropUtils.getDropTimeConstraintCommand((TimeConstraint) semanticElement, hostView, getViewer()));
+ if(nodeVISUALID == TimeConstraintEditPart.VISUAL_ID) {
+ return new ICommandProxy(DropUtils.getDropTimeConstraintCommand((TimeConstraint)semanticElement, hostView, getViewer()));
}
- if (nodeVISUALID == DurationObservationEditPartCN.VISUAL_ID) {
- return new ICommandProxy(DropUtils.getDropDurationObservationCommand((DurationObservation) semanticElement, hostView, getViewer()));
+ if(nodeVISUALID == DurationObservationEditPartCN.VISUAL_ID) {
+ return new ICommandProxy(DropUtils.getDropDurationObservationCommand((DurationObservation)semanticElement, hostView, getViewer()));
}
- if (nodeVISUALID == DurationConstraintEditPartCN.VISUAL_ID) {
- return new ICommandProxy(DropUtils.getDropDurationConstraintCommand((DurationConstraint) semanticElement, hostView, getViewer()));
+ if(nodeVISUALID == DurationConstraintEditPartCN.VISUAL_ID) {
+ return new ICommandProxy(DropUtils.getDropDurationConstraintCommand((DurationConstraint)semanticElement, hostView, getViewer()));
}
- if (nodeVISUALID == GeneralOrderingEditPart.VISUAL_ID) {
- return new ICommandProxy(DropUtils.getDropGeneralOrderingCommand((GeneralOrdering) semanticElement, hostView, getViewer()));
+ if(nodeVISUALID == GeneralOrderingEditPart.VISUAL_ID) {
+ return new ICommandProxy(DropUtils.getDropGeneralOrderingCommand((GeneralOrdering)semanticElement, hostView, getViewer()));
}
- if (nodeVISUALID == GateEditPart.VISUAL_ID) {
- return new ICommandProxy(DropUtils.getDropGateCommand((Gate) semanticElement, hostView, getViewer()));
+ if(nodeVISUALID == GateEditPart.VISUAL_ID) {
+ return new ICommandProxy(DropUtils.getDropGateCommand((Gate)semanticElement, hostView, getViewer()));
}
}
@@ -147,16 +143,16 @@ public class TimingDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
}
private ICommand dropLifeline(final DropObjectsRequest dropRequest, final Element semanticElement, final int nodeVISUALID) {
- if (!(semanticElement instanceof Lifeline)) {
+ if(!(semanticElement instanceof Lifeline)) {
throw new IllegalArgumentException();
}
- final Lifeline lifeline = (Lifeline) semanticElement;
+ final Lifeline lifeline = (Lifeline)semanticElement;
final CompositeCommand cc = new CompositeCommand(Messages.TimingDiagramDragDropEditPolicy_DropLifeline);
final ICommand dropMainElementCommand = dropMainElement(dropRequest, semanticElement, nodeVISUALID);
cc.add(dropMainElementCommand);
final LifelineType lifelineType = LifelineUtils.getLifelineType(lifeline);
- if (lifelineType == LifelineType.full) {
+ if(lifelineType == LifelineType.full) {
cc.add(dropStateDefinitions(lifeline, dropMainElementCommand.getCommandResult()));
}
cc.add(dropLifelineFragments(lifeline, dropMainElementCommand.getCommandResult(), lifelineType));
@@ -164,29 +160,29 @@ public class TimingDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
}
private static ICommand dropStateDefinitions(final Lifeline lifeline, final CommandResult lifelineCreateViewCommandResult) {
- if (lifelineCreateViewCommandResult == null) {
+ if(lifelineCreateViewCommandResult == null) {
return UnexecutableCommand.INSTANCE;
}
final TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(lifeline);
final Object returnValue = lifelineCreateViewCommandResult.getReturnValue();
return new AbstractTransactionalCommand(editingDomain, Messages.TimingDiagramDragDropEditPolicy_DropStateDefinitions, null, null) {
+
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- if (returnValue instanceof IAdaptable) {
- final IAdaptable adaptable = (IAdaptable) returnValue;
- final View lifelineView = (View) adaptable.getAdapter(View.class);
- if (lifelineView == null) {
+ if(returnValue instanceof IAdaptable) {
+ final IAdaptable adaptable = (IAdaptable)returnValue;
+ final View lifelineView = (View)adaptable.getAdapter(View.class);
+ if(lifelineView == null) {
return CommandResult.newErrorCommandResult("Parent Lifeline not found"); //$NON-NLS-1$
}
final View stateDefinitionCompartmentView = ViewUtils.findStateDefinitionCompartmentView(lifelineView);
final List<String> stateDefinitionIds = StateDefinitionUtils.getStateDefinitionIds(lifeline);
- for (final String stateDefinitionId : stateDefinitionIds) {
+ for(final String stateDefinitionId : stateDefinitionIds) {
final String stateDefinitionName = StateDefinitionUtils.getStateDefinitionName(stateDefinitionId, lifeline);
// create the View for the state definition
final UMLViewProvider umlViewProvider = new UMLViewProvider();
- final Node stateDefinitionView = umlViewProvider.createNode_9(null, stateDefinitionCompartmentView, -1, true,
- PreferencesHint.USE_DEFAULTS);
+ final Node stateDefinitionView = umlViewProvider.createNode_9(null, stateDefinitionCompartmentView, -1, true, PreferencesHint.USE_DEFAULTS);
// restore the same id
StateDefinitionUtils.setStateDefinitionViewID(stateDefinitionView, stateDefinitionId);
// set the name on the View
@@ -200,40 +196,40 @@ public class TimingDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
}
private static ICommand dropLifelineFragments(final Lifeline lifeline, final CommandResult lifelineCreateViewCommandResult, final LifelineType lifelineType) {
- if (lifelineCreateViewCommandResult == null) {
+ if(lifelineCreateViewCommandResult == null) {
return UnexecutableCommand.INSTANCE;
}
final TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(lifeline);
final Object returnValue = lifelineCreateViewCommandResult.getReturnValue();
return new AbstractTransactionalCommand(editingDomain, Messages.TimingDiagramDragDropEditPolicy_DropLifelineFragments, null, null) {
+
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- if (returnValue instanceof IAdaptable) {
- final IAdaptable adaptable = (IAdaptable) returnValue;
- final View lifelineView = (View) adaptable.getAdapter(View.class);
- if (lifelineView == null) {
+ if(returnValue instanceof IAdaptable) {
+ final IAdaptable adaptable = (IAdaptable)returnValue;
+ final View lifelineView = (View)adaptable.getAdapter(View.class);
+ if(lifelineView == null) {
return CommandResult.newErrorCommandResult("Parent Lifeline not found"); //$NON-NLS-1$
}
- final View compartmentView = (lifelineType == LifelineType.full ? ViewUtils.findFullLifelineCompartmentView(lifelineView) : ViewUtils
- .findCompactTimelineCompartmentView(lifelineView));
+ final View compartmentView = (lifelineType == LifelineType.full ? ViewUtils.findFullLifelineCompartmentView(lifelineView) : ViewUtils.findCompactTimelineCompartmentView(lifelineView));
final EList<InteractionFragment> fragments = lifeline.getCoveredBys();
final UMLViewProvider umlViewProvider = new UMLViewProvider();
int x = lifelineType == LifelineType.full ? 20 : CustomCompactLifelineCompartmentEditPart.FIRST_STATE_OFFSET;
boolean firstStateInvariant = true;
String previousStateInvariantName = ""; //$NON-NLS-1$
- for (final InteractionFragment fragment : fragments) {
- if (fragment instanceof StateInvariant) {
- if (!firstStateInvariant && lifelineType == LifelineType.full) {
+ for(final InteractionFragment fragment : fragments) {
+ if(fragment instanceof StateInvariant) {
+ if(!firstStateInvariant && lifelineType == LifelineType.full) {
// add a vertical line
umlViewProvider.createNode_39(null, compartmentView, -1, true, PreferencesHint.USE_DEFAULTS);
}
- final StateInvariant stateInvariant = (StateInvariant) fragment;
+ final StateInvariant stateInvariant = (StateInvariant)fragment;
final String stateInvariantName = StateInvariantUtils.getInnerStateInvariantName(stateInvariant);
- if (lifelineType == LifelineType.full) {
- if (Utils.safeEquals(stateInvariantName, previousStateInvariantName)) {
+ if(lifelineType == LifelineType.full) {
+ if(Utils.safeEquals(stateInvariantName, previousStateInvariantName)) {
x += 10;
} else {
x += 25;
@@ -243,40 +239,37 @@ public class TimingDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
}
// create the View for the state invariant
- if (lifelineType == LifelineType.full) {
+ if(lifelineType == LifelineType.full) {
umlViewProvider.createStateInvariant_11(stateInvariant, compartmentView, -1, true, PreferencesHint.USE_DEFAULTS);
- } else if (lifelineType == LifelineType.compact) {
+ } else if(lifelineType == LifelineType.compact) {
umlViewProvider.createStateInvariant_28(stateInvariant, compartmentView, -1, true, PreferencesHint.USE_DEFAULTS);
}
firstStateInvariant = false;
previousStateInvariantName = stateInvariantName;
- } else if (fragment instanceof DestructionOccurrenceSpecification) {
- final DestructionOccurrenceSpecification destructionOccurrenceSpecification = (DestructionOccurrenceSpecification) fragment;
+ } else if(fragment instanceof DestructionOccurrenceSpecification) {
+ final DestructionOccurrenceSpecification destructionOccurrenceSpecification = (DestructionOccurrenceSpecification)fragment;
// create the View for the occurrence specification
- final Node occurrenceSpecificationView = umlViewProvider.createDestructionOccurrenceSpecification_27(
- destructionOccurrenceSpecification, compartmentView, -1, true, PreferencesHint.USE_DEFAULTS);
+ final Node occurrenceSpecificationView = umlViewProvider.createDestructionOccurrenceSpecification_27(destructionOccurrenceSpecification, compartmentView, -1, true, PreferencesHint.USE_DEFAULTS);
final Location loc = NotationFactory.eINSTANCE.createLocation();
loc.setX(x);
loc.setY(0);
occurrenceSpecificationView.setLayoutConstraint(loc);
x += 10;
- } else if (fragment instanceof MessageOccurrenceSpecification) {
- final MessageOccurrenceSpecification occurrenceSpecification = (MessageOccurrenceSpecification) fragment;
+ } else if(fragment instanceof MessageOccurrenceSpecification) {
+ final MessageOccurrenceSpecification occurrenceSpecification = (MessageOccurrenceSpecification)fragment;
// create the View for the occurrence specification
- final Node occurrenceSpecificationView = umlViewProvider.createMessageOccurrenceSpecification_13(occurrenceSpecification,
- compartmentView, -1, true, PreferencesHint.USE_DEFAULTS);
+ final Node occurrenceSpecificationView = umlViewProvider.createMessageOccurrenceSpecification_13(occurrenceSpecification, compartmentView, -1, true, PreferencesHint.USE_DEFAULTS);
final Location loc = NotationFactory.eINSTANCE.createLocation();
loc.setX(x);
loc.setY(0);
occurrenceSpecificationView.setLayoutConstraint(loc);
x += 10;
- } else if (fragment instanceof OccurrenceSpecification) {
- final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification) fragment;
+ } else if(fragment instanceof OccurrenceSpecification) {
+ final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification)fragment;
// create the View for the occurrence specification
- final Node occurrenceSpecificationView = umlViewProvider.createOccurrenceSpecification_12(occurrenceSpecification, compartmentView,
- -1, true, PreferencesHint.USE_DEFAULTS);
+ final Node occurrenceSpecificationView = umlViewProvider.createOccurrenceSpecification_12(occurrenceSpecification, compartmentView, -1, true, PreferencesHint.USE_DEFAULTS);
final Location loc = NotationFactory.eINSTANCE.createLocation();
loc.setX(x);
@@ -294,10 +287,10 @@ public class TimingDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
}
private ICommand dropMainElement(final DropObjectsRequest dropRequest, final Element semanticElement, final int nodeVISUALID) {
- if (canBeDropped(semanticElement)) {
- final IHintedType type = ((IHintedType) getUMLElementType(nodeVISUALID));
+ if(canBeDropped(semanticElement)) {
+ final IHintedType type = ((IHintedType)getUMLElementType(nodeVISUALID));
String semanticHint = null;
- if (type != null) {
+ if(type != null) {
semanticHint = type.getSemanticHint();
}
return getDefaultDropNodeCommand(getHost(), semanticHint, dropRequest.getLocation(), semanticElement, dropRequest);
@@ -306,10 +299,9 @@ public class TimingDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
}
private boolean canBeDropped(final Element semanticElement) {
- final GraphicalEditPart graphicalParentEditPart = (GraphicalEditPart) getHost();
+ final GraphicalEditPart graphicalParentEditPart = (GraphicalEditPart)getHost();
final EObject graphicalParentObject = graphicalParentEditPart.resolveSemanticElement();
- return (graphicalParentObject instanceof org.eclipse.uml2.uml.Package && semanticElement instanceof Interaction)
- || (graphicalParentObject instanceof Interaction && semanticElement instanceof Lifeline);
+ return (graphicalParentObject instanceof org.eclipse.uml2.uml.Package && semanticElement instanceof Interaction) || (graphicalParentObject instanceof Interaction && semanticElement instanceof Lifeline);
}
/** @return the set of element ids for which we want to specialize the drop */
@@ -325,9 +317,7 @@ public class TimingDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
@Override
public int getNodeVisualID(final View containerView, final EObject domainElement) {
- if (domainElement instanceof Gate
- && (String.valueOf(InteractionEditPartTN.VISUAL_ID).equals(containerView.getType()) || String.valueOf(
- InteractionCompartmentEditPartTN.VISUAL_ID).equals(containerView.getType()))) {
+ if(domainElement instanceof Gate && (String.valueOf(InteractionEditPartTN.VISUAL_ID).equals(containerView.getType()) || String.valueOf(InteractionCompartmentEditPartTN.VISUAL_ID).equals(containerView.getType()))) {
// allow dropping a Gate directly on an Interaction or Interaction compartment
return GateEditPart.VISUAL_ID;
}
@@ -353,12 +343,12 @@ public class TimingDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPo
final List<Interaction> updatedInteractionsCache = new ArrayList<Interaction>();
final List<?> droppedObjects = dropRequest.getObjects();
- for (final Object droppedObject : droppedObjects) {
- if (droppedObject instanceof EObject) {
- final EObject droppedEObject = (EObject) droppedObject;
+ for(final Object droppedObject : droppedObjects) {
+ if(droppedObject instanceof EObject) {
+ final EObject droppedEObject = (EObject)droppedObject;
final Interaction interaction = InteractionUtils.getContainingInteraction(droppedEObject);
- if (interaction != null) {
- if (!updatedInteractionsCache.contains(interaction)) {
+ if(interaction != null) {
+ if(!updatedInteractionsCache.contains(interaction)) {
final ValidateInteractionCommand validateCommand = new ValidateInteractionCommand(getEditingDomain(), interaction, true);
cc.add(new ICommandProxy(validateCommand));
updatedInteractionsCache.add(interaction);
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/AbstractMessageFigure.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/AbstractMessageFigure.java
index 361da72be49..ef5c18bc1f7 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/AbstractMessageFigure.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/AbstractMessageFigure.java
@@ -23,6 +23,7 @@ import org.eclipse.swt.widgets.Display;
public abstract class AbstractMessageFigure extends UMLEdgeFigure {
protected static final Font LABEL_FONT = new Font(Display.getCurrent(), "SANS", 9, SWT.NORMAL); //$NON-NLS-1$
+
private WrappingLabel messageLabel;
@Override
@@ -66,28 +67,28 @@ public abstract class AbstractMessageFigure extends UMLEdgeFigure {
@Override
public void setLineWidth(final 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(final 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 static IMapMode getMapMode() {
return MapModeTypes.IDENTITY_MM;
}
-} \ No newline at end of file
+}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/CompactLifelineFigure.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/CompactLifelineFigure.java
index 05cd6777166..bf953e8ecd5 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/CompactLifelineFigure.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/CompactLifelineFigure.java
@@ -38,6 +38,7 @@ public class CompactLifelineFigure extends LifelineFigure {
@Override
protected void createContents() {
this.nameLabelContainerFigure = new InvisibleRectangleFigure() {
+
@SuppressWarnings("unused")
String DEBUG_ID = "CompactLifelineFigure_nameLabelContainerFigure"; //$NON-NLS-1$
};
@@ -48,20 +49,21 @@ public class CompactLifelineFigure extends LifelineFigure {
this.nameLabelContainerFigure.setLayoutManager(new CenterLayout());
this.lifelineDataContainerFigure = new InvisibleRectangleFigure() {
+
@SuppressWarnings("unused")
String DEBUG_ID = "CompactLifelineFigure_lifelineDataContainerFigure"; //$NON-NLS-1$
};
this.lifelineDataContainerFigure.setLayoutManager(new AbstractLayout() {
+
public void layout(final IFigure container) {
final Rectangle clientArea = container.getClientArea();
final List<?> children = container.getChildren();
- for (int i = 0; i < children.size(); i++) {
- final IFigure child = (IFigure) children.get(i);
- if (child == getTimelineContainerFigure()) {
+ for(int i = 0; i < children.size(); i++) {
+ final IFigure child = (IFigure)children.get(i);
+ if(child == getTimelineContainerFigure()) {
child.setBounds(new Rectangle(clientArea.x, clientArea.y, clientArea.width, clientArea.height - Constants.TIME_RULER_HEIGHT));
- } else if (child == getTimeRulerContainerFigure()) {
- child.setBounds(new Rectangle(clientArea.x, clientArea.y + clientArea.height - Constants.TIME_RULER_HEIGHT, clientArea.width,
- Constants.TIME_RULER_HEIGHT));
+ } else if(child == getTimeRulerContainerFigure()) {
+ child.setBounds(new Rectangle(clientArea.x, clientArea.y + clientArea.height - Constants.TIME_RULER_HEIGHT, clientArea.width, Constants.TIME_RULER_HEIGHT));
}
}
}
@@ -78,12 +80,14 @@ public class CompactLifelineFigure extends LifelineFigure {
private void createDataContainerContents() {
this.timelineContainerFigure = new InvisibleRectangleFigure() {
+
@SuppressWarnings("unused")
String DEBUG_ID = "CompactLifelineFigure_compactTimelineContainerFigure"; //$NON-NLS-1$
};
this.lifelineDataContainerFigure.add(this.timelineContainerFigure);
this.timeRulerContainerFigure = new TimeRulerFigure() {
+
@SuppressWarnings("unused")
String DEBUG_ID = "CompactLifelineFigure_timeRulerContainerFigure"; //$NON-NLS-1$
};
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/CompactStateFigure.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/CompactStateFigure.java
index 69e4a9ee317..d0e6c45e69d 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/CompactStateFigure.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/CompactStateFigure.java
@@ -27,12 +27,14 @@ import org.eclipse.swt.widgets.Display;
public class CompactStateFigure extends PapyrusNodeFigure implements IPapyrusUMLElementFigure {
public static final int PREFERRED_HEIGHT = 32;
+
private final WrappingLabel label;
+
private boolean infinite;
/**
* @param infinite
- * Whether the state has an end cap (the last state doesn't end)
+ * Whether the state has an end cap (the last state doesn't end)
*/
public void setInfinite(final boolean infinite) {
this.infinite = infinite;
@@ -67,28 +69,26 @@ public class CompactStateFigure extends PapyrusNodeFigure implements IPapyrusUML
final int cornerSize = Math.min(h / 3, w / 3);
final int[] polygon;
- if (this.infinite) {
- polygon = new int[] { x, middleY, x + cornerSize, y, x + w + 1, y, x + w + 1, y + h, x + cornerSize, y + h };
+ if(this.infinite) {
+ polygon = new int[]{ x, middleY, x + cornerSize, y, x + w + 1, y, x + w + 1, y + h, x + cornerSize, y + h };
} else {
- polygon = new int[] { x, middleY, x + cornerSize, y, x + w - cornerSize, y, x + w, middleY, x + w - cornerSize, y + h, x + cornerSize, y + h };
+ polygon = new int[]{ x, middleY, x + cornerSize, y, x + w - cornerSize, y, x + w, middleY, x + w - cornerSize, y + h, x + cornerSize, y + h };
}
g.setAntialias(SWT.ON);
- if (isUsingGradient()) {
+ if(isUsingGradient()) {
applyTransparency(g);
final Pattern pattern;
// apparently, patterns are not scaled automatically, so we need to scale the pattern so that it fits the
// current zoom level
final double scale = g.getAbsoluteScale();
- final int xScaled = (int) (this.bounds.x * scale);
- final int yScaled = (int) (this.bounds.y * scale);
- final int widthScaled = (int) (this.bounds.width * scale);
- final int heightScaled = (int) (height * scale);
- if (getGradientStyle() == GradientStyle.VERTICAL) {
- pattern = new Pattern(Display.getCurrent(), xScaled, yScaled, xScaled, yScaled + heightScaled, FigureUtilities.integerToColor(Integer
- .valueOf(getGradientColor2())), FigureUtilities.integerToColor(Integer.valueOf(getGradientColor1())));
+ final int xScaled = (int)(this.bounds.x * scale);
+ final int yScaled = (int)(this.bounds.y * scale);
+ final int widthScaled = (int)(this.bounds.width * scale);
+ final int heightScaled = (int)(height * scale);
+ if(getGradientStyle() == GradientStyle.VERTICAL) {
+ pattern = new Pattern(Display.getCurrent(), xScaled, yScaled, xScaled, yScaled + heightScaled, FigureUtilities.integerToColor(Integer.valueOf(getGradientColor2())), FigureUtilities.integerToColor(Integer.valueOf(getGradientColor1())));
} else {
- pattern = new Pattern(Display.getCurrent(), xScaled, yScaled, xScaled + widthScaled, this.bounds.y, FigureUtilities.integerToColor(Integer
- .valueOf(getGradientColor2())), FigureUtilities.integerToColor(Integer.valueOf(getGradientColor1())));
+ pattern = new Pattern(Display.getCurrent(), xScaled, yScaled, xScaled + widthScaled, this.bounds.y, FigureUtilities.integerToColor(Integer.valueOf(getGradientColor2())), FigureUtilities.integerToColor(Integer.valueOf(getGradientColor1())));
}
g.setBackgroundPattern(pattern);
g.fillPolygon(polygon);
@@ -122,13 +122,13 @@ public class CompactStateFigure extends PapyrusNodeFigure implements IPapyrusUML
* This function is useful in order to place an OccurrenceSpecification along the border of a StateInvariant.
*
* @param x
- * the x coordinate at which to compute the height
+ * the x coordinate at which to compute the height
* @param figureWidth
- * the width of the CompactStateFigure
+ * the width of the CompactStateFigure
* @param figureHeight
- * the height of the CompactStateFigure
+ * the height of the CompactStateFigure
* @param infinite
- * whether the figure ends with a cap (not infinite) or not (infinite)
+ * whether the figure ends with a cap (not infinite) or not (infinite)
* @return the half height at the given position
*/
public static int computeHalfHeightAtAbscissa(final int x, final int figureWidth, final int figureHeight, final boolean infinite) {
@@ -138,20 +138,20 @@ public class CompactStateFigure extends PapyrusNodeFigure implements IPapyrusUML
final int cornerSize = Math.min(height / 3, width / 3);
final int resultY;
- if (x < cornerSize) {
+ if(x < cornerSize) {
// on the left corner
final double slope = (height / 2.0) / cornerSize;
- resultY = (int) (x * slope);
- } else if (infinite) {
+ resultY = (int)(x * slope);
+ } else if(infinite) {
// on the straight border
resultY = halfHeight;
- } else if (x < width - cornerSize) {
+ } else if(x < width - cornerSize) {
// on the straight border
resultY = halfHeight;
} else {
// on the right corner
- final double slope = (double) halfHeight / cornerSize;
- resultY = (int) (halfHeight - ((x - width + cornerSize) * slope));
+ final double slope = (double)halfHeight / cornerSize;
+ resultY = (int)(halfHeight - ((x - width + cornerSize) * slope));
}
return resultY;
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/CustomInteractionRectangleFigure.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/CustomInteractionRectangleFigure.java
index f0c7b2e7798..ec8e8a1d965 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/CustomInteractionRectangleFigure.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/CustomInteractionRectangleFigure.java
@@ -41,10 +41,11 @@ public class CustomInteractionRectangleFigure extends InteractionRectangleFigure
protected InteractionFigure createInteractionFigureHeader() {
this.interactionLabel = new WrappingLabel() {
+
@Override
public Dimension getPreferredSize(final int wHint, final int hHint) {
final Dimension preferredSize = super.getPreferredSize(wHint, hHint);
- if (preferredSize.width == 0) {
+ if(preferredSize.width == 0) {
return preferredSize;
}
return new Dimension(preferredSize.width + 2, preferredSize.height + 2);
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/EllipseDecoration.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/EllipseDecoration.java
index f1e865d4cab..8bd8febf7b2 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/EllipseDecoration.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/EllipseDecoration.java
@@ -42,7 +42,7 @@ public class EllipseDecoration extends Ellipse implements RotatableDecoration {
private Rectangle getOptimizedBounds() {
final float lineInset = Math.max(1.0f, getLineWidthFloat()) / 2.0f;
- final int inset = (int) Math.floor(lineInset);
+ final int inset = (int)Math.floor(lineInset);
final Rectangle r = Rectangle.SINGLETON.setBounds(getBounds());
r.x += inset;
r.y += inset;
@@ -53,4 +53,4 @@ public class EllipseDecoration extends Ellipse implements RotatableDecoration {
protected void outlineShape(final Graphics graphics) {
// no outline
}
-} \ No newline at end of file
+}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/FullLifelineFigure.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/FullLifelineFigure.java
index 3a13e0ecc32..cb8518510dc 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/FullLifelineFigure.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/FullLifelineFigure.java
@@ -30,6 +30,7 @@ public class FullLifelineFigure extends LifelineFigure {
@Override
protected void createContents() {
this.nameLabelContainerFigure = new InvisibleRectangleFigure() {
+
@SuppressWarnings("unused")
String DEBUG_ID = "FullLifelineFigure_nameLabelContainerFigure"; //$NON-NLS-1$
};
@@ -40,20 +41,21 @@ public class FullLifelineFigure extends LifelineFigure {
this.nameLabelContainerFigure.setLayoutManager(new CenterLayout());
this.lifelineDataContainerFigure = new InvisibleRectangleFigure() {
+
@SuppressWarnings("unused")
String DEBUG_ID = "FullLifelineFigure_lifelineDataContainerFigure"; //$NON-NLS-1$
};
this.lifelineDataContainerFigure.setLayoutManager(new AbstractLayout() {
+
public void layout(final IFigure container) {
final Rectangle clientArea = container.getClientArea();
final List<?> children = container.getChildren();
- for (int i = 0; i < children.size(); i++) {
- final IFigure child = (IFigure) children.get(i);
- if (child == getChronogramContainerFigure()) {
+ for(int i = 0; i < children.size(); i++) {
+ final IFigure child = (IFigure)children.get(i);
+ if(child == getChronogramContainerFigure()) {
child.setBounds(new Rectangle(clientArea.x, clientArea.y, clientArea.width, clientArea.height - Constants.TIME_RULER_HEIGHT));
- } else if (child == getTimeRulerContainerFigure()) {
- child.setBounds(new Rectangle(clientArea.x, clientArea.y + clientArea.height - Constants.TIME_RULER_HEIGHT, clientArea.width,
- Constants.TIME_RULER_HEIGHT));
+ } else if(child == getTimeRulerContainerFigure()) {
+ child.setBounds(new Rectangle(clientArea.x, clientArea.y + clientArea.height - Constants.TIME_RULER_HEIGHT, clientArea.width, Constants.TIME_RULER_HEIGHT));
}
}
}
@@ -71,21 +73,22 @@ public class FullLifelineFigure extends LifelineFigure {
private void createDataContainerContents() {
this.chronogramContainerFigure = new InvisibleRectangleFigure() {
+
@SuppressWarnings("unused")
String DEBUG_ID = "FullLifelineFigure_chronogramContainerFigure"; //$NON-NLS-1$
};
this.lifelineDataContainerFigure.add(this.chronogramContainerFigure);
this.chronogramContainerFigure.setLayoutManager(new AbstractLayout() {
+
public void layout(final IFigure container) {
final Rectangle clientArea = container.getClientArea();
final List<?> children = container.getChildren();
- for (int i = 0; i < children.size(); i++) {
- final IFigure child = (IFigure) children.get(i);
- if (child == getStateDefinitionContainerFigure()) {
+ for(int i = 0; i < children.size(); i++) {
+ final IFigure child = (IFigure)children.get(i);
+ if(child == getStateDefinitionContainerFigure()) {
child.setBounds(new Rectangle(clientArea.x, clientArea.y, Constants.STATE_DEFINITIONS_WIDTH, clientArea.height));
- } else if (child == getTimelineContainerFigure()) {
- child.setBounds(new Rectangle(clientArea.x + Constants.STATE_DEFINITIONS_WIDTH, clientArea.y, clientArea.width
- - Constants.STATE_DEFINITIONS_WIDTH, clientArea.height));
+ } else if(child == getTimelineContainerFigure()) {
+ child.setBounds(new Rectangle(clientArea.x + Constants.STATE_DEFINITIONS_WIDTH, clientArea.y, clientArea.width - Constants.STATE_DEFINITIONS_WIDTH, clientArea.height));
}
}
}
@@ -98,6 +101,7 @@ public class FullLifelineFigure extends LifelineFigure {
createChronogramContainerContents();
this.timeRulerContainerFigure = new TimeRulerFigure() {
+
@SuppressWarnings("unused")
String DEBUG_ID = "FullLifelineFigure_timeRulerContainerFigure"; //$NON-NLS-1$
};
@@ -107,12 +111,14 @@ public class FullLifelineFigure extends LifelineFigure {
private void createChronogramContainerContents() {
this.stateDefinitionContainerFigure = new InvisibleRectangleFigure() {
+
@SuppressWarnings("unused")
String DEBUG_ID = "FullLifelineFigure_stateDefinitionContainerFigure"; //$NON-NLS-1$
};
this.chronogramContainerFigure.add(this.stateDefinitionContainerFigure);
this.timelineContainerFigure = new InvisibleRectangleFigure() {
+
@SuppressWarnings("unused")
String DEBUG_ID = "FullLifelineFigure_timelineContainerFigure"; //$NON-NLS-1$
};
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/GeneralOrderingHorizontalFigure.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/GeneralOrderingHorizontalFigure.java
index 7434b54a42f..1e2ba26aecc 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/GeneralOrderingHorizontalFigure.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/GeneralOrderingHorizontalFigure.java
@@ -39,14 +39,14 @@ public class GeneralOrderingHorizontalFigure extends PapyrusNodeFigure {
g.setLineWidth(1);
// horizontal line
- g.setLineDash(new int[] { 4, 4 });
+ g.setLineDash(new int[]{ 4, 4 });
g.drawLine(x, middleY, x + w, middleY);
- g.setLineDash(new int[] {});
+ g.setLineDash(new int[]{});
// arrow
g.setAntialias(SWT.ON);
g.setBackgroundColor(getForegroundColor());
- g.fillPolygon(new int[] { middleX - a, this.bounds.y, middleX + a, middleY, middleX - a, this.bounds.y + this.bounds.height });
+ g.fillPolygon(new int[]{ middleX - a, this.bounds.y, middleX + a, middleY, middleX - a, this.bounds.y + this.bounds.height });
g.popState();
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/InvisibleRectangleFigure.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/InvisibleRectangleFigure.java
index 4948f1c2e26..4ee68b24b97 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/InvisibleRectangleFigure.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/InvisibleRectangleFigure.java
@@ -12,10 +12,10 @@ package org.eclipse.papyrus.uml.diagram.timing.custom.figures;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.Shape;
/** A rectangle that is not painted: useful for simplifying layouts */
public class InvisibleRectangleFigure extends RectangleFigure {
+
/**
* Creates a RectangleFigure.
*/
@@ -37,4 +37,4 @@ public class InvisibleRectangleFigure extends RectangleFigure {
protected void outlineShape(final Graphics graphics) {
// don't draw an outline
}
-} \ No newline at end of file
+}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/LifelineFigure.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/LifelineFigure.java
index 458ae8c0207..e979c65d193 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/LifelineFigure.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/LifelineFigure.java
@@ -25,29 +25,35 @@ import org.eclipse.swt.graphics.Image;
public class LifelineFigure extends PapyrusNodeFigure implements IPapyrusNodeUMLElementFigure {
protected final int LABEL_WIDTH = 30;
+
protected RectangleFigure nameLabelContainerFigure;
+
protected LifelineVerticalLabel nameLabel;
+
protected RectangleFigure timeRulerContainerFigure;
+
protected RectangleFigure lifelineDataContainerFigure;
+
protected RectangleFigure timelineContainerFigure;
private boolean selected;
+
private boolean displayTimeRuler;
public LifelineFigure() {
setShadow(false);
createContents();
setLayoutManager(new AbstractLayout() {
+
public void layout(final IFigure container) {
final Rectangle clientArea = container.getClientArea();
final List<?> children = container.getChildren();
- for (int i = 0; i < children.size(); i++) {
- final IFigure child = (IFigure) children.get(i);
- if (child == getNameLabelContainerFigure()) {
+ for(int i = 0; i < children.size(); i++) {
+ final IFigure child = (IFigure)children.get(i);
+ if(child == getNameLabelContainerFigure()) {
child.setBounds(new Rectangle(clientArea.x, clientArea.y, LifelineFigure.this.LABEL_WIDTH, clientArea.height));
- } else if (child == getLifelineDataContainerFigure()) {
- child.setBounds(new Rectangle(clientArea.x + LifelineFigure.this.LABEL_WIDTH, clientArea.y, clientArea.width
- - LifelineFigure.this.LABEL_WIDTH, clientArea.height));
+ } else if(child == getLifelineDataContainerFigure()) {
+ child.setBounds(new Rectangle(clientArea.x + LifelineFigure.this.LABEL_WIDTH, clientArea.y, clientArea.width - LifelineFigure.this.LABEL_WIDTH, clientArea.height));
}
}
}
@@ -84,7 +90,7 @@ public class LifelineFigure extends PapyrusNodeFigure implements IPapyrusNodeUML
@Override
public void paintFigure(final Graphics graphics) {
super.paintFigure(graphics);
- if (this.selected) {
+ if(this.selected) {
graphics.pushState();
graphics.setForegroundColor(ColorConstants.black);
graphics.setLineWidth(1);
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/LifelineVerticalLabel.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/LifelineVerticalLabel.java
index 521a82c6a2b..9db8f3be301 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/LifelineVerticalLabel.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/LifelineVerticalLabel.java
@@ -21,11 +21,12 @@ import org.eclipse.swt.widgets.Display;
public class LifelineVerticalLabel extends VerticalLabel implements ILabelFigure {
private boolean selected;
+
private boolean focus;
@Override
public Color getBackgroundColor() {
- if (this.selected) {
+ if(this.selected) {
return Display.getDefault().getSystemColor(SWT.COLOR_LIST_SELECTION);
}
// the transparency color for the label
@@ -34,7 +35,7 @@ public class LifelineVerticalLabel extends VerticalLabel implements ILabelFigure
@Override
public Color getForegroundColor() {
- if (this.selected) {
+ if(this.selected) {
return Display.getDefault().getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT);
}
return super.getForegroundColor();
@@ -70,7 +71,7 @@ public class LifelineVerticalLabel extends VerticalLabel implements ILabelFigure
@Override
protected void paintFigure(final Graphics graphics) {
super.paintFigure(graphics);
- if (this.focus) {
+ if(this.focus) {
graphics.drawFocus(getBounds().getResized(-1, -1));
}
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/MessageDeleteFigure.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/MessageDeleteFigure.java
index dc41e0ad889..10499a9fd3e 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/MessageDeleteFigure.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/MessageDeleteFigure.java
@@ -19,6 +19,7 @@ public class MessageDeleteFigure extends AbstractMessageFigure {
@Override
protected RotatableDecoration createTargetDecoration() {
final PolygonDecoration df = new PolygonDecoration() {
+
@Override
protected void outlineShape(final Graphics g) {
// no outline: this is a filled arrow
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/MessageSyncFigure.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/MessageSyncFigure.java
index e679ea85951..7e50f113df1 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/MessageSyncFigure.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/MessageSyncFigure.java
@@ -19,6 +19,7 @@ public class MessageSyncFigure extends AbstractMessageFigure {
@Override
protected RotatableDecoration createTargetDecoration() {
final PolygonDecoration df = new PolygonDecoration() {
+
@Override
protected void outlineShape(final Graphics g) {
// no outline: this is a filled arrow
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/SmallSquareFigure.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/SmallSquareFigure.java
index ed8feee47a5..b837dd49b4e 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/SmallSquareFigure.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/SmallSquareFigure.java
@@ -19,6 +19,7 @@ import org.eclipse.swt.graphics.Image;
public class SmallSquareFigure extends PapyrusNodeFigure implements IPapyrusUMLElementFigure {
public static final int SQUARE_SIZE = 5;
+
/** How many pixels the Figure must be moved upwards and leftwards in order to center it */
public static final int RADIUS = SQUARE_SIZE / 2;
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/StateDefinitionFigure.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/StateDefinitionFigure.java
index 43deec99903..502914419b3 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/StateDefinitionFigure.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/StateDefinitionFigure.java
@@ -45,7 +45,7 @@ public class StateDefinitionFigure extends NodeNamedElementFigure {
}
private void paintFocusRectangle(final Graphics g) {
- if (isSelected()) {
+ if(isSelected()) {
g.pushState();
g.setXORMode(true);
g.setForegroundColor(ColorConstants.menuBackgroundSelected);
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/TimeRulerFigure.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/TimeRulerFigure.java
index f41e5684b87..9bd2d289b2d 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/TimeRulerFigure.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/TimeRulerFigure.java
@@ -13,6 +13,7 @@ import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.geometry.Rectangle;
public class TimeRulerFigure extends InvisibleRectangleFigure {
+
@Override
protected void outlineShape(final Graphics graphics) {
final Rectangle bounds = getBounds();
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/VerticalLabel.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/VerticalLabel.java
index 49ed0dfc66c..53d5565cd91 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/VerticalLabel.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/VerticalLabel.java
@@ -26,15 +26,19 @@ import org.eclipse.swt.widgets.Display;
public class VerticalLabel extends AbstractImageFigure {
private Image img;
+
private String myText;
+
private Font myImageFont;
+
private Color myForegroundColor;
+
private Color myBackgroundColor;
@Override
protected void paintFigure(final Graphics g) {
final Image image = getImage();
- if (image != null) {
+ if(image != null) {
g.drawImage(image, this.bounds.x, this.bounds.y);
}
}
@@ -49,7 +53,7 @@ public class VerticalLabel extends AbstractImageFigure {
/** {@inheritDoc} */
@Override
public void removeNotify() {
- if (this.img != null) {
+ if(this.img != null) {
this.img.dispose();
this.img = null;
}
@@ -59,20 +63,20 @@ public class VerticalLabel extends AbstractImageFigure {
/** {@inheritDoc} */
public Image getImage() {
boolean update = false;
- if (this.myImageFont != getFont()) {
+ if(this.myImageFont != getFont()) {
this.myImageFont = getFont();
update = true;
}
- if (needsUpdate(this.myForegroundColor, getForegroundColor())) {
+ if(needsUpdate(this.myForegroundColor, getForegroundColor())) {
this.myForegroundColor = getForegroundColor();
update = true;
}
- if (needsUpdate(this.myBackgroundColor, getBackgroundColor())) {
+ if(needsUpdate(this.myBackgroundColor, getBackgroundColor())) {
this.myBackgroundColor = getBackgroundColor();
update = true;
}
- if (update) {
+ if(update) {
updateImage();
}
return this.img;
@@ -82,7 +86,7 @@ public class VerticalLabel extends AbstractImageFigure {
* Updates the image with the string provided.
*
* @param text
- * to display
+ * to display
*/
public void setText(final String text) {
this.myText = text;
@@ -99,18 +103,18 @@ public class VerticalLabel extends AbstractImageFigure {
* @return image created
*/
public void updateImage() {
- if (this.img != null) {
+ if(this.img != null) {
this.img.dispose();
this.img = null;
}
- if (getText() == null || getFont() == null) {
+ if(getText() == null || getFont() == null) {
return;
}
setImage(createRotatedImageOfString(getText(), getFont(), getForegroundColor(), getBackgroundColor(), isOpaque()));
}
private void setImage(final Image image) {
- if (this.img == image) {
+ if(this.img == image) {
return;
}
this.img = image;
@@ -129,7 +133,7 @@ public class VerticalLabel extends AbstractImageFigure {
final int width = metrics.getAscent() + metrics.getDescent() + metrics.getLeading();
final ImageData data = new ImageData(width, height, 32, new PaletteData(0x0000ff00, 0x00ff0000, 0xff000000));
- if (!opaque) {
+ if(!opaque) {
data.transparentPixel = data.palette.getPixel(background.getRGB());
}
@@ -149,7 +153,7 @@ public class VerticalLabel extends AbstractImageFigure {
}
private static final boolean needsUpdate(final Color cachedColor, final Color actualColor) {
- if (cachedColor == null && actualColor == null) {
+ if(cachedColor == null && actualColor == null) {
return false;
}
return cachedColor == null || !cachedColor.equals(actualColor);
@@ -157,7 +161,7 @@ public class VerticalLabel extends AbstractImageFigure {
@Override
public Dimension getPreferredSize(final int wHint, final int hHint) {
- if (this.img != null) {
+ if(this.img != null) {
return new Rectangle(this.img.getBounds()).getSize();
}
return super.getPreferredSize(wHint, hHint);
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/VerticalMarkFigure.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/VerticalMarkFigure.java
index e653cd353e9..29859a226a6 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/VerticalMarkFigure.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/VerticalMarkFigure.java
@@ -18,6 +18,7 @@ import org.eclipse.swt.graphics.Image;
public class VerticalMarkFigure extends org.eclipse.draw2d.Figure implements IPapyrusUMLElementFigure {
public static final int PREFERRED_WIDTH = 5;
+
public static final int PREFERRED_HEIGHT = 12;
public VerticalMarkFigure() {
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/helper/TimingDiagramLinkMappingHelper.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/helper/TimingDiagramLinkMappingHelper.java
index f2a4e1ff641..4046168e1d9 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/helper/TimingDiagramLinkMappingHelper.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/helper/TimingDiagramLinkMappingHelper.java
@@ -29,7 +29,7 @@ public class TimingDiagramLinkMappingHelper implements ILinkMappingHelper {
* @return single instance of {@link TimingDiagramLinkMappingHelper}
*/
public static TimingDiagramLinkMappingHelper getInstance() {
- if (INSTANCE == null) {
+ if(INSTANCE == null) {
INSTANCE = new TimingDiagramLinkMappingHelper();
}
return INSTANCE;
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/helper/advice/DefaultTypeHelperAdvice.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/helper/advice/DefaultTypeHelperAdvice.java
index 6aeb6b7ca14..4e44ce591ad 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/helper/advice/DefaultTypeHelperAdvice.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/helper/advice/DefaultTypeHelperAdvice.java
@@ -24,12 +24,12 @@ public class DefaultTypeHelperAdvice extends AbstractEditHelperAdvice {
@Override
public boolean approveRequest(final IEditCommandRequest request) {
- if (request instanceof DestroyElementRequest) {
- final DestroyElementRequest destroyElementRequest = (DestroyElementRequest) request;
+ if(request instanceof DestroyElementRequest) {
+ final DestroyElementRequest destroyElementRequest = (DestroyElementRequest)request;
final EObject elementToDestroy = destroyElementRequest.getElementToDestroy();
- if (elementToDestroy instanceof View) {
- final View view = (View) elementToDestroy;
- if (VERTICAL_LINE_ID.equals(view.getType()) && TimingDiagramEditPart.MODEL_ID == ViewUtils.getContainingDiagramType(view)) {
+ if(elementToDestroy instanceof View) {
+ final View view = (View)elementToDestroy;
+ if(VERTICAL_LINE_ID.equals(view.getType()) && TimingDiagramEditPart.MODEL_ID == ViewUtils.getContainingDiagramType(view)) {
return false;
}
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/helper/advice/GateHelperAdvice.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/helper/advice/GateHelperAdvice.java
index 35064e4851a..7357fccc600 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/helper/advice/GateHelperAdvice.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/helper/advice/GateHelperAdvice.java
@@ -30,16 +30,16 @@ public class GateHelperAdvice extends AbstractEditHelperAdvice {
@Override
protected ICommand getAfterDestroyDependentsCommand(final DestroyDependentsRequest request) {
final EObject destructee = request.getElementToDestroy();
- if (destructee instanceof Gate) {
- final Gate gate = (Gate) destructee;
+ if(destructee instanceof Gate) {
+ final Gate gate = (Gate)destructee;
final Collection<EObject> elementsToDestroy = GateUtils.getElementsToDelete(gate);
- if (!elementsToDestroy.isEmpty()) {
+ if(!elementsToDestroy.isEmpty()) {
final CompositeCommand compositeCommand = new CompositeCommand(Messages.GateHelperAdvice_DestroyGate);
// destroy related elements
- for (final EObject eObject : elementsToDestroy) {
+ for(final EObject eObject : elementsToDestroy) {
final DestroyElementRequest destroyElementRequest = new DestroyElementRequest(eObject, false);
final DestroyElementCommand destroyElementCommand = new DestroyElementCommand(destroyElementRequest);
- if (destroyElementCommand.canExecute()) {
+ if(destroyElementCommand.canExecute()) {
compositeCommand.add(destroyElementCommand);
}
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/helper/advice/OccurrenceSpecificationHelperAdvice.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/helper/advice/OccurrenceSpecificationHelperAdvice.java
index 7c4ba3281b6..2ffc4272555 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/helper/advice/OccurrenceSpecificationHelperAdvice.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/helper/advice/OccurrenceSpecificationHelperAdvice.java
@@ -32,21 +32,21 @@ public class OccurrenceSpecificationHelperAdvice extends AbstractEditHelperAdvic
@Override
protected ICommand getAfterDestroyDependentsCommand(final DestroyDependentsRequest request) {
final EObject destructee = request.getElementToDestroy();
- if (destructee instanceof OccurrenceSpecification) {
- final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification) destructee;
+ if(destructee instanceof OccurrenceSpecification) {
+ final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification)destructee;
final Collection<EObject> elementsToDestroy = OccurrenceSpecificationUtils.getElementsToDelete(occurrenceSpecification);
- if (!elementsToDestroy.isEmpty()) {
+ if(!elementsToDestroy.isEmpty()) {
final CompositeCommand compositeCommand = new CompositeCommand(Messages.OccurrenceSpecificationHelperAdvice_DestroyOccurrenceSpecification);
// destroy related elements
- for (final EObject eObject : elementsToDestroy) {
+ for(final EObject eObject : elementsToDestroy) {
final DestroyElementRequest destroyElementRequest = new DestroyElementRequest(eObject, false);
final DestroyElementCommand destroyElementCommand = new DestroyElementCommand(destroyElementRequest);
- if (destroyElementCommand.canExecute()) {
+ if(destroyElementCommand.canExecute()) {
compositeCommand.add(destroyElementCommand);
}
}
final IUndoableOperation updateFragmentNamesCommand = LifelineUtils.getUpdateFragmentNamesCommand(occurrenceSpecification);
- if (updateFragmentNamesCommand != null) {
+ if(updateFragmentNamesCommand != null) {
compositeCommand.add(updateFragmentNamesCommand);
}
return compositeCommand;
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/helper/advice/StateInvariantHelperAdvice.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/helper/advice/StateInvariantHelperAdvice.java
index 62bf11b0b54..8e3ddff7506 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/helper/advice/StateInvariantHelperAdvice.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/helper/advice/StateInvariantHelperAdvice.java
@@ -34,19 +34,19 @@ public class StateInvariantHelperAdvice extends AbstractEditHelperAdvice {
@Override
protected ICommand getAfterDestroyDependentsCommand(final DestroyDependentsRequest request) {
final EObject destructee = request.getElementToDestroy();
- if (destructee instanceof StateInvariant) {
+ if(destructee instanceof StateInvariant) {
try {
- final StateInvariant stateInvariant = (StateInvariant) destructee;
+ final StateInvariant stateInvariant = (StateInvariant)destructee;
final Collection<EObject> elementsToDestroy = StateInvariantUtils.getElementsToDelete(stateInvariant);
- if (!elementsToDestroy.isEmpty()) {
+ if(!elementsToDestroy.isEmpty()) {
final CompositeCommand compositeCommand = new CompositeCommand(Messages.StateInvariantHelperAdvice_DestroyStateInvariant);
- for (final EObject eObject : elementsToDestroy) {
+ for(final EObject eObject : elementsToDestroy) {
final DestroyElementRequest destroyElementRequest = new DestroyElementRequest(eObject, false);
compositeCommand.add(new DestroyElementCommand(destroyElementRequest));
}
final IUndoableOperation updateFragmentNamesCommand = LifelineUtils.getUpdateFragmentNamesCommand(stateInvariant);
- if (updateFragmentNamesCommand != null) {
+ if(updateFragmentNamesCommand != null) {
compositeCommand.add(updateFragmentNamesCommand);
}
return compositeCommand;
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/layouts/FillLayout.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/layouts/FillLayout.java
index 3ba7e926a21..1d365eb2a64 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/layouts/FillLayout.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/layouts/FillLayout.java
@@ -19,14 +19,15 @@ import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Rectangle;
public class FillLayout extends AbstractLayout {
+
public void layout(final IFigure container) {
final Rectangle clientArea = container.getClientArea();
final List<?> children = container.getChildren();
- for (int i = 0; i < children.size(); i++) {
- final IFigure child = (IFigure) children.get(i);
+ for(int i = 0; i < children.size(); i++) {
+ final IFigure child = (IFigure)children.get(i);
child.setBounds(clientArea);
- if (child instanceof FreeformLayer) {
- final FreeformLayer freeformLayer = (FreeformLayer) child;
+ if(child instanceof FreeformLayer) {
+ final FreeformLayer freeformLayer = (FreeformLayer)child;
freeformLayer.setFreeformBounds(clientArea);
}
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/layouts/TimeRulerLayout.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/layouts/TimeRulerLayout.java
index 788ddab1b29..ef14640691a 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/layouts/TimeRulerLayout.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/layouts/TimeRulerLayout.java
@@ -29,7 +29,7 @@ public class TimeRulerLayout extends AbstractLayout {
final Rectangle clientArea = container.getParent().getClientArea();
@SuppressWarnings("unchecked")
final List<IFigure> children = container.getChildren();
- for (int i = 0; i < children.size(); i++) {
+ for(int i = 0; i < children.size(); i++) {
final IFigure child = children.get(i);
child.setBounds(clientArea);
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parsers/CompactStateInvariantNameParser.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parsers/CompactStateInvariantNameParser.java
index 995ad070342..8639de0bc92 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parsers/CompactStateInvariantNameParser.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parsers/CompactStateInvariantNameParser.java
@@ -48,7 +48,7 @@ public class CompactStateInvariantNameParser implements ISemanticParser {
public String getEditString(final IAdaptable adaptable, final int flags) {
final StateInvariant stateInvariant = getStateInvariant(adaptable);
final String name = StateInvariantUtils.getInnerStateInvariantName(stateInvariant);
- if (name == null) {
+ if(name == null) {
return ""; //$NON-NLS-1$
}
return name;
@@ -61,17 +61,18 @@ public class CompactStateInvariantNameParser implements ISemanticParser {
public ICommand getParseCommand(final IAdaptable adaptable, final String newString, final int flags) {
final StateInvariant stateInvariant = getStateInvariant(adaptable);
final TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(stateInvariant);
- if (editingDomain == null) {
+ if(editingDomain == null) {
return UnexecutableCommand.INSTANCE;
}
return new AbstractTransactionalCommand(editingDomain, Messages.CompactStateInvariantNameParser_SetStateInvariantName, null) {
+
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
// set the name on the Constraint and OpaqueExpression
StateInvariantUtils.setInnerStateInvariantName(stateInvariant, newString);
// set the name directly on the StateInvariant (note that this triggers a refresh of the label)
stateInvariant.setName(newString);
- for (final Lifeline coveredLifeline : stateInvariant.getCovereds()) {
+ for(final Lifeline coveredLifeline : stateInvariant.getCovereds()) {
LifelineUtils.updateFragmentNames(coveredLifeline, null);
// XXX what if the StateInvariant appears both on a compact and on a full lifeline?
StateDefinitionUtils.updateStateDefinitionNamesForCompactLifeline(coveredLifeline);
@@ -82,13 +83,13 @@ public class CompactStateInvariantNameParser implements ISemanticParser {
}
private static StateInvariant getStateInvariant(final IAdaptable adaptable) {
- return (StateInvariant) adaptable.getAdapter(EObject.class);
+ return (StateInvariant)adaptable.getAdapter(EObject.class);
}
public String getPrintString(final IAdaptable adaptable, final int flags) {
final StateInvariant stateInvariant = getStateInvariant(adaptable);
final String name = StateInvariantUtils.getInnerStateInvariantName(stateInvariant);
- if (name == null || name.length() == 0) {
+ if(name == null || name.length() == 0) {
return Messages.CompactStateInvariantNameParser_Unnamed;
}
return name;
@@ -104,12 +105,12 @@ public class CompactStateInvariantNameParser implements ISemanticParser {
public List<?> getSemanticElementsBeingParsed(final EObject element) {
final List<EObject> list = new ArrayList<EObject>();
- if (element instanceof StateInvariant) {
- final StateInvariant stateInvariant = (StateInvariant) element;
+ if(element instanceof StateInvariant) {
+ final StateInvariant stateInvariant = (StateInvariant)element;
final Constraint invariant = stateInvariant.getInvariant();
- if (invariant != null) {
+ if(invariant != null) {
final ValueSpecification specification = invariant.getSpecification();
- if (specification != null) {
+ if(specification != null) {
list.add(specification);
}
}
@@ -119,7 +120,6 @@ public class CompactStateInvariantNameParser implements ISemanticParser {
public boolean areSemanticElementsAffected(final EObject listener, final Object notification) {
final EStructuralFeature feature = EcoreUtils.getEStructuralFeature(notification);
- return UMLPackage.eINSTANCE.getStateInvariant_Invariant().equals(feature) || UMLPackage.eINSTANCE.getConstraint_Specification().equals(feature)
- || UMLPackage.eINSTANCE.getOpaqueExpression_Body().equals(feature);
+ return UMLPackage.eINSTANCE.getStateInvariant_Invariant().equals(feature) || UMLPackage.eINSTANCE.getConstraint_Specification().equals(feature) || UMLPackage.eINSTANCE.getOpaqueExpression_Body().equals(feature);
}
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parsers/ConstraintParser.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parsers/ConstraintParser.java
index 8a84c116423..aef1e6718a5 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parsers/ConstraintParser.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parsers/ConstraintParser.java
@@ -32,10 +32,8 @@ import org.eclipse.papyrus.uml.diagram.timing.custom.Messages;
import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EcoreUtils;
import org.eclipse.uml2.uml.Constraint;
import org.eclipse.uml2.uml.Duration;
-import org.eclipse.uml2.uml.DurationConstraint;
import org.eclipse.uml2.uml.DurationInterval;
import org.eclipse.uml2.uml.LiteralString;
-import org.eclipse.uml2.uml.TimeConstraint;
import org.eclipse.uml2.uml.TimeExpression;
import org.eclipse.uml2.uml.TimeInterval;
import org.eclipse.uml2.uml.UMLPackage;
@@ -45,10 +43,13 @@ import org.eclipse.uml2.uml.ValueSpecification;
public class ConstraintParser implements ISemanticParser {
private static final String ERROR = "<error>"; //$NON-NLS-1$
+
private static final Pattern pattern = Pattern.compile("\\{(.*?)\\.\\.(.*?)\\}"); //$NON-NLS-1$
private class MinMax {
+
LiteralString min;
+
LiteralString max;
public MinMax(final LiteralString min, final LiteralString max) {
@@ -72,7 +73,7 @@ public class ConstraintParser implements ISemanticParser {
public String getEditString(final IAdaptable element, final int flags) {
final Constraint constraint = doAdapt(element);
final MinMax minMax = getMinMax(constraint);
- if (minMax == null) {
+ if(minMax == null) {
return ERROR;
}
return getMinMaxLabel(minMax);
@@ -85,11 +86,11 @@ public class ConstraintParser implements ISemanticParser {
public ICommand getParseCommand(final IAdaptable element, final String newString, final int flags) {
final Constraint constraint = doAdapt(element);
final MinMax minMax = getMinMax(constraint);
- if (minMax == null) {
+ if(minMax == null) {
return UnexecutableCommand.INSTANCE;
}
final Matcher matcher = ConstraintParser.pattern.matcher(newString);
- if (matcher.matches()) {
+ if(matcher.matches()) {
final String min = matcher.group(1);
final String max = matcher.group(2);
final TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(constraint);
@@ -99,14 +100,14 @@ public class ConstraintParser implements ISemanticParser {
}
private MinMax getMinMax(final Constraint constraint) {
- if (constraint == null) {
+ if(constraint == null) {
return null;
}
final ValueSpecification specification = constraint.getSpecification();
- if (specification instanceof TimeInterval) {
- return getTimeIntervalMinMax((TimeInterval) specification);
- } else if (specification instanceof DurationInterval) {
- return getDurationIntervalMinMax((DurationInterval) specification);
+ if(specification instanceof TimeInterval) {
+ return getTimeIntervalMinMax((TimeInterval)specification);
+ } else if(specification instanceof DurationInterval) {
+ return getDurationIntervalMinMax((DurationInterval)specification);
}
return null;
@@ -116,21 +117,21 @@ public class ConstraintParser implements ISemanticParser {
final ValueSpecification min = timeInterval.getMin();
final ValueSpecification max = timeInterval.getMax();
- if (!(min instanceof TimeExpression) || !(max instanceof TimeExpression)) {
+ if(!(min instanceof TimeExpression) || !(max instanceof TimeExpression)) {
return null;
}
- final TimeExpression minTime = (TimeExpression) min;
- final TimeExpression maxTime = (TimeExpression) max;
+ final TimeExpression minTime = (TimeExpression)min;
+ final TimeExpression maxTime = (TimeExpression)max;
final ValueSpecification minValue = minTime.getExpr();
final ValueSpecification maxValue = maxTime.getExpr();
- if (!(minValue instanceof LiteralString) || !(maxValue instanceof LiteralString)) {
+ if(!(minValue instanceof LiteralString) || !(maxValue instanceof LiteralString)) {
return null;
}
- final LiteralString minStr = (LiteralString) minValue;
- final LiteralString maxStr = (LiteralString) maxValue;
+ final LiteralString minStr = (LiteralString)minValue;
+ final LiteralString maxStr = (LiteralString)maxValue;
return new MinMax(minStr, maxStr);
}
@@ -139,21 +140,21 @@ public class ConstraintParser implements ISemanticParser {
final ValueSpecification min = durationInterval.getMin();
final ValueSpecification max = durationInterval.getMax();
- if (!(min instanceof Duration) || !(max instanceof Duration)) {
+ if(!(min instanceof Duration) || !(max instanceof Duration)) {
return null;
}
- final Duration minDuration = (Duration) min;
- final Duration maxDuration = (Duration) max;
+ final Duration minDuration = (Duration)min;
+ final Duration maxDuration = (Duration)max;
final ValueSpecification minValue = minDuration.getExpr();
final ValueSpecification maxValue = maxDuration.getExpr();
- if (!(minValue instanceof LiteralString) || !(maxValue instanceof LiteralString)) {
+ if(!(minValue instanceof LiteralString) || !(maxValue instanceof LiteralString)) {
return null;
}
- final LiteralString minStr = (LiteralString) minValue;
- final LiteralString maxStr = (LiteralString) maxValue;
+ final LiteralString minStr = (LiteralString)minValue;
+ final LiteralString maxStr = (LiteralString)maxValue;
return new MinMax(minStr, maxStr);
}
@@ -162,12 +163,12 @@ public class ConstraintParser implements ISemanticParser {
return ParserEditStatus.EDITABLE_STATUS;
}
- private static ICommand createSetMinMaxCommand(final Constraint constraint, final MinMax minMax, final String min, final String max,
- final TransactionalEditingDomain editingDomain) {
- if (editingDomain == null) {
+ private static ICommand createSetMinMaxCommand(final Constraint constraint, final MinMax minMax, final String min, final String max, final TransactionalEditingDomain editingDomain) {
+ if(editingDomain == null) {
return UnexecutableCommand.INSTANCE;
}
return new AbstractTransactionalCommand(editingDomain, Messages.ConstraintParser_SetConstraint, null) {
+
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
minMax.getMin().setValue(min);
@@ -184,13 +185,13 @@ public class ConstraintParser implements ISemanticParser {
* Obtain the constraint element from the adaptable.
*
* @param element
- * the given IAdaptable
+ * the given IAdaptable
* @return the constraint or null if it can't be found.
*/
protected static Constraint doAdapt(final IAdaptable element) {
final Object obj = element.getAdapter(EObject.class);
- if (obj instanceof Constraint) {
- return (Constraint) obj;
+ if(obj instanceof Constraint) {
+ return (Constraint)obj;
}
return null;
}
@@ -205,10 +206,10 @@ public class ConstraintParser implements ISemanticParser {
public List<?> getSemanticElementsBeingParsed(final EObject element) {
final List<EObject> list = new ArrayList<EObject>();
- if (element instanceof Constraint) {
- final Constraint constraint = (Constraint) element;
+ if(element instanceof Constraint) {
+ final Constraint constraint = (Constraint)element;
final MinMax minMax = getMinMax(constraint);
- if (minMax != null) {
+ if(minMax != null) {
list.add(minMax.getMin());
list.add(minMax.getMax());
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parsers/OccurrenceSpecificationNameParser.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parsers/OccurrenceSpecificationNameParser.java
index b791193fd39..2c775757a05 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parsers/OccurrenceSpecificationNameParser.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parsers/OccurrenceSpecificationNameParser.java
@@ -37,7 +37,7 @@ public class OccurrenceSpecificationNameParser implements IParser {
public String getEditString(final IAdaptable adaptable, final int flags) {
final OccurrenceSpecification occurrenceSpecification = getOccurrenceSpecification(adaptable);
- if (occurrenceSpecification == null) {
+ if(occurrenceSpecification == null) {
return ""; //$NON-NLS-1$
}
return nonNullString(occurrenceSpecification.getName());
@@ -49,14 +49,15 @@ public class OccurrenceSpecificationNameParser implements IParser {
public ICommand getParseCommand(final IAdaptable adaptable, final String newString, final int flags) {
final OccurrenceSpecification occurrenceSpecification = getOccurrenceSpecification(adaptable);
- if (occurrenceSpecification == null) {
+ if(occurrenceSpecification == null) {
return UnexecutableCommand.INSTANCE;
}
final TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(occurrenceSpecification);
- if (editingDomain == null) {
+ if(editingDomain == null) {
return UnexecutableCommand.INSTANCE;
}
return new AbstractTransactionalCommand(editingDomain, Messages.OccurrenceSpecificationNameParser_SetOccurrenceSpecificationName, null) {
+
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
occurrenceSpecification.setName(newString);
@@ -68,7 +69,7 @@ public class OccurrenceSpecificationNameParser implements IParser {
public String getPrintString(final IAdaptable adaptable, final int flags) {
final OccurrenceSpecification occurrenceSpecification = getOccurrenceSpecification(adaptable);
- if (occurrenceSpecification == null || OccurrenceSpecificationUtils.isAutogeneratedName(occurrenceSpecification)) {
+ if(occurrenceSpecification == null || OccurrenceSpecificationUtils.isAutogeneratedName(occurrenceSpecification)) {
// don't display the auto-generated name (pollutes the view without any benefit)
return ""; //$NON-NLS-1$
}
@@ -85,14 +86,14 @@ public class OccurrenceSpecificationNameParser implements IParser {
private static OccurrenceSpecification getOccurrenceSpecification(final IAdaptable adaptable) {
final Object adapter = adaptable.getAdapter(EObject.class);
- if (adapter instanceof OccurrenceSpecification) {
- return (OccurrenceSpecification) adapter;
+ if(adapter instanceof OccurrenceSpecification) {
+ return (OccurrenceSpecification)adapter;
}
return null;
}
private static String nonNullString(final String string) {
- if (string == null) {
+ if(string == null) {
return ""; //$NON-NLS-1$
}
return string;
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parsers/StateDefinitionParser.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parsers/StateDefinitionParser.java
index dc14e4ac885..d085c89faac 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parsers/StateDefinitionParser.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parsers/StateDefinitionParser.java
@@ -35,10 +35,10 @@ import org.eclipse.uml2.uml.Lifeline;
public class StateDefinitionParser implements IParser {
public String getEditString(final IAdaptable adaptable, final int flags) {
- final View stateDefinitionLabelView = (View) adaptable.getAdapter(View.class);
- final View stateDefinitionView = (View) stateDefinitionLabelView.eContainer();
+ final View stateDefinitionLabelView = (View)adaptable.getAdapter(View.class);
+ final View stateDefinitionView = (View)stateDefinitionLabelView.eContainer();
final String name = StateDefinitionUtils.getStateDefinitionName(stateDefinitionView);
- if (name == null) {
+ if(name == null) {
return ""; //$NON-NLS-1$
}
return name;
@@ -49,16 +49,17 @@ public class StateDefinitionParser implements IParser {
}
public ICommand getParseCommand(final IAdaptable adaptable, final String newString, final int flags) {
- final View stateDefinitionLabelView = (View) adaptable.getAdapter(View.class);
- final View stateDefinitionView = (View) stateDefinitionLabelView.eContainer();
+ final View stateDefinitionLabelView = (View)adaptable.getAdapter(View.class);
+ final View stateDefinitionView = (View)stateDefinitionLabelView.eContainer();
final View lifelineView = ViewUtils.findSuperViewWithId(stateDefinitionView, FullLifelineEditPartCN.VISUAL_ID);
- final Lifeline lifeline = (Lifeline) lifelineView.getElement();
+ final Lifeline lifeline = (Lifeline)lifelineView.getElement();
final TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(lifeline);
- if (editingDomain == null) {
+ if(editingDomain == null) {
return UnexecutableCommand.INSTANCE;
}
return new AbstractTransactionalCommand(editingDomain, Messages.StateDefinitionParser_SetStateDefinitionName, null) {
+
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
StateDefinitionUtils.setStateDefinitionName(stateDefinitionView, newString);
@@ -69,10 +70,10 @@ public class StateDefinitionParser implements IParser {
}
public String getPrintString(final IAdaptable adaptable, final int flags) {
- final View stateDefinitionLabelView = (View) adaptable.getAdapter(View.class);
- final View stateDefinitionView = (View) stateDefinitionLabelView.eContainer();
+ final View stateDefinitionLabelView = (View)adaptable.getAdapter(View.class);
+ final View stateDefinitionView = (View)stateDefinitionLabelView.eContainer();
final String name = StateDefinitionUtils.getStateDefinitionName(stateDefinitionView);
- if (name == null || name.length() == 0) {
+ if(name == null || name.length() == 0) {
return Messages.StateDefinitionParser_Unnamed;
}
return name;
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/AbstractTwoPointCreationTool.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/AbstractTwoPointCreationTool.java
index 4f60487d5e5..546b00923fa 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/AbstractTwoPointCreationTool.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/AbstractTwoPointCreationTool.java
@@ -33,12 +33,15 @@ public abstract class AbstractTwoPointCreationTool extends AspectUnspecifiedType
/** The tool is in this state after clicking on the start element of the duration */
private static final int STATE_FIRST = 1 << 16;
+
/** A request parameter that indicates the first clicked element */
public final static String FIRST_TARGET = "FIRST_TARGET"; //$NON-NLS-1$
+
/** A request parameter that indicates the second clicked element */
public final static String SECOND_TARGET = "SECOND_TARGET"; //$NON-NLS-1$
protected EditPart first = null;
+
protected EditPart second = null;
public AbstractTwoPointCreationTool(final IElementType elementType) {
@@ -63,7 +66,7 @@ public abstract class AbstractTwoPointCreationTool extends AspectUnspecifiedType
@Override
protected boolean handleButtonDown(final int button) {
- if (button != 1) {
+ if(button != 1) {
setState(STATE_INVALID);
handleInvalidInput();
}
@@ -71,13 +74,13 @@ public abstract class AbstractTwoPointCreationTool extends AspectUnspecifiedType
final Command command = getCommand();
final EditPart targetEditPart = getTargetEditPart();
- if (isInState(STATE_INITIAL) && command.canExecute()) {
+ if(isInState(STATE_INITIAL) && command.canExecute()) {
this.first = targetEditPart;
setState(STATE_FIRST);
// make it possible to double-click so that the first and second elements are the same
handleMove();
firstElementSelected();
- } else if (isInState(STATE_FIRST) && command.canExecute()) {
+ } else if(isInState(STATE_FIRST) && command.canExecute()) {
this.second = targetEditPart;
eraseTargetFeedback();
// update the request and command with the second edit part
@@ -93,18 +96,18 @@ public abstract class AbstractTwoPointCreationTool extends AspectUnspecifiedType
@Override
protected Request createTargetRequest() {
final CreateAspectUnspecifiedTypeRequest request = new CreateAspectUnspecifiedTypeRequest(getElementTypes(), getPreferencesHint()) {
+
@SuppressWarnings("unchecked")
@Override
protected void createRequests() {
- final IElementType elementType = (IElementType) getElementTypes().get(0);
+ final IElementType elementType = (IElementType)getElementTypes().get(0);
// set the first and second edit parts on the CreateElementRequest that will be received
// by the create command
final CreateElementRequest createElementRequest = new CreateElementRequest(elementType);
createElementRequest.setParameter(FIRST_TARGET, AbstractTwoPointCreationTool.this.first);
createElementRequest.setParameter(SECOND_TARGET, AbstractTwoPointCreationTool.this.second);
- final ViewAndElementDescriptor viewDescriptor = new ViewAndElementDescriptor(new CreateElementRequestAdapter(createElementRequest), Node.class,
- getGraphicalHint((IHintedType) elementType), getPreferencesHint());
+ final ViewAndElementDescriptor viewDescriptor = new ViewAndElementDescriptor(new CreateElementRequestAdapter(createElementRequest), Node.class, getGraphicalHint((IHintedType)elementType), getPreferencesHint());
final Request request = new CreateViewAndElementRequest(viewDescriptor);
request.setExtendedData(getExtendedData());
request.setType(getType());
@@ -151,7 +154,7 @@ public abstract class AbstractTwoPointCreationTool extends AspectUnspecifiedType
final Request request = getTargetRequest();
final EditPart firstTarget;
final EditPart secondTarget;
- if (isInState(STATE_INITIAL)) {
+ if(isInState(STATE_INITIAL)) {
firstTarget = getTargetEditPart();
secondTarget = null;
} else {
@@ -159,13 +162,14 @@ public abstract class AbstractTwoPointCreationTool extends AspectUnspecifiedType
secondTarget = getTargetEditPart();
}
- if (!validateFirstTarget(firstTarget)) {
+ if(!validateFirstTarget(firstTarget)) {
return UnexecutableCommand.INSTANCE;
}
- if (isInState(STATE_INITIAL)) {
+ if(isInState(STATE_INITIAL)) {
// dummy executable command (to accept a creation in progress)
return new Command() {
+
@Override
public void execute() {
throw new IllegalStateException("This dummy command must never be executed"); //$NON-NLS-1$
@@ -173,7 +177,7 @@ public abstract class AbstractTwoPointCreationTool extends AspectUnspecifiedType
};
}
- if (!validateSecondTarget(firstTarget, secondTarget)) {
+ if(!validateSecondTarget(firstTarget, secondTarget)) {
return UnexecutableCommand.INSTANCE;
}
return getCommand(firstTarget, secondTarget, request);
@@ -183,11 +187,11 @@ public abstract class AbstractTwoPointCreationTool extends AspectUnspecifiedType
* Return the creation command that should be executed after clicking the second node.
*
* @param firstTarget
- * the first node that was clicked
+ * the first node that was clicked
* @param secondTarget
- * the second node that was clicked
+ * the second node that was clicked
* @param request
- * the request for which a creation command should be returned
+ * the request for which a creation command should be returned
* @return the creation command
*/
protected abstract Command getCommand(EditPart firstTarget, EditPart secondTarget, Request request);
@@ -196,7 +200,7 @@ public abstract class AbstractTwoPointCreationTool extends AspectUnspecifiedType
* Validate the first selection
*
* @param firstTarget
- * the first selected element
+ * the first selected element
* @return whether the first selected element is valid
*/
protected abstract boolean validateFirstTarget(final EditPart firstTarget);
@@ -205,9 +209,9 @@ public abstract class AbstractTwoPointCreationTool extends AspectUnspecifiedType
* Validate the second selection
*
* @param firstTarget
- * the first selected element
+ * the first selected element
* @param secondTarget
- * the second selected element
+ * the second selected element
* @return whether the second selected element is valid
*/
protected abstract boolean validateSecondTarget(final EditPart firstTarget, final EditPart secondTarget);
@@ -222,24 +226,23 @@ public abstract class AbstractTwoPointCreationTool extends AspectUnspecifiedType
* Set a help message in the status bar.
*
* @param message
- * a message that should help the user using the tool
+ * a message that should help the user using the tool
*/
protected static void setStatusMessage(final String message) {
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getEditorSite().getActionBars().getStatusLineManager()
- .setMessage(message);
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getEditorSite().getActionBars().getStatusLineManager().setMessage(message);
}
/** Does the View for the first EditPart appear before the View for the second EditPart in their container? */
protected static boolean ordered(final EditPart first, final EditPart second) {
- if (!(first.getModel() instanceof View) || !(second.getModel() instanceof View)) {
+ if(!(first.getModel() instanceof View) || !(second.getModel() instanceof View)) {
return false;
}
- final View firstView = (View) first.getModel();
- final View secondView = (View) second.getModel();
- if (firstView.eContainer() != secondView.eContainer()) {
+ final View firstView = (View)first.getModel();
+ final View secondView = (View)second.getModel();
+ if(firstView.eContainer() != secondView.eContainer()) {
return false;
}
- final View compartment = (View) firstView.eContainer();
+ final View compartment = (View)firstView.eContainer();
final int firstIndex = compartment.getChildren().indexOf(firstView);
final int secondIndex = compartment.getChildren().indexOf(secondView);
return firstIndex <= secondIndex;
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/CustomPaletteFactory.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/CustomPaletteFactory.java
index 768a2653d5a..ef6a986918e 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/CustomPaletteFactory.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/CustomPaletteFactory.java
@@ -50,55 +50,70 @@ import org.eclipse.papyrus.uml.diagram.timing.providers.UMLElementTypes;
import org.eclipse.uml2.uml.UMLPackage;
public class CustomPaletteFactory extends UMLPaletteFactory {
+
private final static String CREATEOCCURRENCESPECIFICATIONCREATIONTOOL = "createOccurrenceSpecificationCreationTool"; //$NON-NLS-1$
+
private final static String CREATEDESTRUCTIONOCCURRENCESPECIFICATIONCREATIONTOOL = "createDestructionOccurrenceSpecificationCreationTool"; //$NON-NLS-1$
+
private final static String CREATESTATEDEFINITIONCREATIONTOOL = "createStateDefinitionCreationTool"; //$NON-NLS-1$
+
private final static String CREATEMESSAGESYNCCREATIONTOOL = "createMessageSyncCreationTool"; //$NON-NLS-1$
+
private final static String CREATEMESSAGEASYNCCREATIONTOOL = "createMessageAsyncCreationTool"; //$NON-NLS-1$
+
private final static String CREATEMESSAGEREPLYCREATIONTOOL = "createMessageReplyCreationTool"; //$NON-NLS-1$
+
private final static String CREATECREATEMESSAGECREATIONTOOL = "createCreateMessageCreationTool"; //$NON-NLS-1$
+
private final static String CREATEDELETEMESSAGECREATIONTOOL = "createDeleteMessageCreationTool"; //$NON-NLS-1$
+
private final static String CREATELOSTMESSAGECREATIONTOOL = "createLostMessageCreationTool"; //$NON-NLS-1$
+
private final static String CREATEFOUNDMESSAGECREATIONTOOL = "createFoundMessageCreationTool"; //$NON-NLS-1$
+
private final static String CREATETIMEOBSERVATIONCREATIONTOOL = "createTimeObservationCreationTool"; //$NON-NLS-1$
+
private final static String CREATETIMECONSTRAINTCREATIONTOOL = "createTimeConstraintCreationTool"; //$NON-NLS-1$
+
private final static String CREATEDURATIONOBSERVATIONCREATIONTOOL = "createDurationObservationCreationTool"; //$NON-NLS-1$
+
private final static String CREATEDURATIONCONSTRAINTCREATIONTOOL = "createDurationConstraintCreationTool"; //$NON-NLS-1$
+
private final static String CREATEGENERALORDERINGCREATIONTOOL = "createGeneralOrderingCreationTool"; //$NON-NLS-1$
public final static String ORIGINAL_TARGET = "ORIGINAL_TARGET"; //$NON-NLS-1$
@Override
public Tool createTool(final String toolId) {
- if (toolId.equals(CREATEOCCURRENCESPECIFICATIONCREATIONTOOL)) {
+ if(toolId.equals(CREATEOCCURRENCESPECIFICATIONCREATIONTOOL)) {
return createOccurrenceSpecificationCreationTool();
- } else if (toolId.equals(CREATEDESTRUCTIONOCCURRENCESPECIFICATIONCREATIONTOOL)) {
+ } else if(toolId.equals(CREATEDESTRUCTIONOCCURRENCESPECIFICATIONCREATIONTOOL)) {
return createDestructionOccurrenceSpecificationCreationTool();
- } else if (toolId.equals(CREATESTATEDEFINITIONCREATIONTOOL)) {
+ } else if(toolId.equals(CREATESTATEDEFINITIONCREATIONTOOL)) {
return createStateDefinitionCreationTool();
- } else if (toolId.equals(CREATEMESSAGESYNCCREATIONTOOL)) {
+ } else if(toolId.equals(CREATEMESSAGESYNCCREATIONTOOL)) {
return createSyncMessageCreationTool();
- } else if (toolId.equals(CREATEMESSAGEASYNCCREATIONTOOL)) {
+ } else if(toolId.equals(CREATEMESSAGEASYNCCREATIONTOOL)) {
return createAsyncMessageCreationTool();
- } else if (toolId.equals(CREATEMESSAGEREPLYCREATIONTOOL)) {
+ } else if(toolId.equals(CREATEMESSAGEREPLYCREATIONTOOL)) {
return createReplyMessageCreationTool();
- } else if (toolId.equals(CREATECREATEMESSAGECREATIONTOOL)) {
+ } else if(toolId.equals(CREATECREATEMESSAGECREATIONTOOL)) {
return createCreateMessageCreationTool();
- } else if (toolId.equals(CREATEDELETEMESSAGECREATIONTOOL)) {
+ } else if(toolId.equals(CREATEDELETEMESSAGECREATIONTOOL)) {
return createDeleteMessageCreationTool();
- } else if (toolId.equals(CREATELOSTMESSAGECREATIONTOOL)) {
+ } else if(toolId.equals(CREATELOSTMESSAGECREATIONTOOL)) {
return createLostMessageCreationTool();
- } else if (toolId.equals(CREATEFOUNDMESSAGECREATIONTOOL)) {
+ } else if(toolId.equals(CREATEFOUNDMESSAGECREATIONTOOL)) {
return createFoundMessageCreationTool();
- } else if (toolId.equals(CREATETIMEOBSERVATIONCREATIONTOOL)) {
+ } else if(toolId.equals(CREATETIMEOBSERVATIONCREATIONTOOL)) {
return createTimeObservationCreationTool();
- } else if (toolId.equals(CREATETIMECONSTRAINTCREATIONTOOL)) {
+ } else if(toolId.equals(CREATETIMECONSTRAINTCREATIONTOOL)) {
return createTimeConstraintCreationTool();
- } else if (toolId.equals(CREATEDURATIONOBSERVATIONCREATIONTOOL)) {
+ } else if(toolId.equals(CREATEDURATIONOBSERVATIONCREATIONTOOL)) {
return createDurationObservationCreationTool();
- } else if (toolId.equals(CREATEDURATIONCONSTRAINTCREATIONTOOL)) {
+ } else if(toolId.equals(CREATEDURATIONCONSTRAINTCREATIONTOOL)) {
return createDurationConstraintCreationTool();
- } else if (toolId.equals(CREATEGENERALORDERINGCREATIONTOOL)) {
+ } else if(toolId.equals(CREATEGENERALORDERINGCREATIONTOOL)) {
return createNewGeneralOrderingCreationTool();
}
return super.createTool(toolId);
@@ -122,6 +137,7 @@ public class CustomPaletteFactory extends UMLPaletteFactory {
private static Tool createNewTimeTool(final IElementType elementType) {
return new AspectUnspecifiedTypeCreationTool(Collections.singletonList(elementType)) {
+
/**
* Redirect the creation request to the parent (Lifeline compartment), but keep the original target in the
* extended data for the creation command.
@@ -130,8 +146,7 @@ public class CustomPaletteFactory extends UMLPaletteFactory {
protected Command getCommand() {
EditPart target = getTargetEditPart();
final Request request = getTargetRequest();
- if (target != null
- && EditPartUtils.isEditPartFor(target, UMLPackage.eINSTANCE.getOccurrenceSpecification(), UMLPackage.eINSTANCE.getStateInvariant())) {
+ if(target != null && EditPartUtils.isEditPartFor(target, UMLPackage.eINSTANCE.getOccurrenceSpecification(), UMLPackage.eINSTANCE.getStateInvariant())) {
@SuppressWarnings("unchecked")
final Map<Object, Object> extendedData = request.getExtendedData();
extendedData.put(ORIGINAL_TARGET, target);
@@ -165,9 +180,10 @@ public class CustomPaletteFactory extends UMLPaletteFactory {
types.add(UMLElementTypes.Node_9);
final Tool tool = new AspectUnspecifiedTypeCreationTool(types) {
+
@Override
protected Command getCommand() {
- if (!(getTargetEditPart() instanceof FullLifelineStateDefinitionCompartmentEditPartCN)) {
+ if(!(getTargetEditPart() instanceof FullLifelineStateDefinitionCompartmentEditPartCN)) {
return UnexecutableCommand.INSTANCE;
}
return super.getCommand();
@@ -198,17 +214,18 @@ public class CustomPaletteFactory extends UMLPaletteFactory {
private static Tool createLostMessageCreationTool() {
return new AspectUnspecifiedTypeConnectionTool(Collections.singletonList(UMLElementTypes.Message_50)) {
+
@Override
protected Command getCommand() {
final Object type = getTargetRequest().getType();
- if (RequestConstants.REQ_CONNECTION_END == type) {
- final CreateAspectUnspecifiedTypeConnectionRequest request = (CreateAspectUnspecifiedTypeConnectionRequest) getTargetRequest();
+ if(RequestConstants.REQ_CONNECTION_END == type) {
+ final CreateAspectUnspecifiedTypeConnectionRequest request = (CreateAspectUnspecifiedTypeConnectionRequest)getTargetRequest();
final EditPart sourceEditPart = request.getSourceEditPart();
// Note: the bounds must be computed before executing the command because the source may be an
// OccurrenceSpecification that will get swapped to a MessageOccurrenceSpecification, thereby
// changing the Figure and EditPart.
- final IFigure figure = ((GraphicalEditPart) sourceEditPart).getFigure();
+ final IFigure figure = ((GraphicalEditPart)sourceEditPart).getFigure();
final Point figureLocation = new Point(figure.getBounds().getCenter());
figure.getParent().translateToAbsolute(figureLocation);
final Point location = request.getLocation();
@@ -221,8 +238,8 @@ public class CustomPaletteFactory extends UMLPaletteFactory {
final TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(sourceEditPart.getModel());
// add a command that sets the initial anchor position using an EAnnotation
- compoundCommand.add(new ICommandProxy(new AbstractTransactionalCommand(editingDomain, Messages.CustomPaletteFactory_SetLostMessageOrigin,
- null) {
+ compoundCommand.add(new ICommandProxy(new AbstractTransactionalCommand(editingDomain, Messages.CustomPaletteFactory_SetLostMessageOrigin, null) {
+
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
final Connector connector = findCreatedConnector(superCommand);
@@ -239,23 +256,24 @@ public class CustomPaletteFactory extends UMLPaletteFactory {
private static Tool createFoundMessageCreationTool() {
return new AspectUnspecifiedTypeConnectionTool(Collections.singletonList(UMLElementTypes.Message_53)) {
+
@Override
protected Command getCommand() {
- final CreateAspectUnspecifiedTypeConnectionRequest request = (CreateAspectUnspecifiedTypeConnectionRequest) getTargetRequest();
+ final CreateAspectUnspecifiedTypeConnectionRequest request = (CreateAspectUnspecifiedTypeConnectionRequest)getTargetRequest();
final EditPart targetEditPart = request.getTargetEditPart();
final Object type = getTargetRequest().getType();
- if (RequestConstants.REQ_CONNECTION_START == type) {
+ if(RequestConstants.REQ_CONNECTION_START == type) {
MessageUtils.saveRequestStartLocation(request);
}
- if (RequestConstants.REQ_CONNECTION_END == type) {
+ if(RequestConstants.REQ_CONNECTION_END == type) {
final Point startLocation = MessageUtils.retrieveRequestStartLocation(request);
// Note: the bounds must be computed before executing the command because the source may be an
// OccurrenceSpecification that will get swapped to a MessageOccurrenceSpecification, thereby
// changing the Figure and EditPart.
- final IFigure figure = ((GraphicalEditPart) targetEditPart).getFigure();
+ final IFigure figure = ((GraphicalEditPart)targetEditPart).getFigure();
final Point figureLocation = new Point(figure.getBounds().getCenter());
figure.getParent().translateToAbsolute(figureLocation);
final double scale = FigureUtils.getScale(figure);
@@ -267,8 +285,8 @@ public class CustomPaletteFactory extends UMLPaletteFactory {
final TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(targetEditPart.getModel());
// add a command that sets the initial anchor position using an EAnnotation
- compoundCommand.add(new ICommandProxy(new AbstractTransactionalCommand(editingDomain, Messages.CustomPaletteFactory_SetFoundMessageTarget,
- null) {
+ compoundCommand.add(new ICommandProxy(new AbstractTransactionalCommand(editingDomain, Messages.CustomPaletteFactory_SetFoundMessageTarget, null) {
+
@Override
protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
final Connector connector = findCreatedConnector(superCommand);
@@ -285,19 +303,19 @@ public class CustomPaletteFactory extends UMLPaletteFactory {
/** Find the Connector in the haystack (buried deep in a CommandResult within the command). */
protected static Connector findCreatedConnector(final Command command) {
- if (command instanceof ICommandProxy) {
- final ICommandProxy commandProxy = (ICommandProxy) command;
+ if(command instanceof ICommandProxy) {
+ final ICommandProxy commandProxy = (ICommandProxy)command;
final ICommand iCommand = commandProxy.getICommand();
final CommandResult commandResult = iCommand.getCommandResult();
final Object returnValue = commandResult.getReturnValue();
- if (returnValue instanceof List<?>) {
- final List<?> resultList = (List<?>) returnValue;
- for (final Object resultElement : resultList) {
- if (resultElement instanceof ConnectionViewAndElementDescriptor) {
- final ConnectionViewAndElementDescriptor connectionViewAndElementDescriptor = (ConnectionViewAndElementDescriptor) resultElement;
- final View view = (View) connectionViewAndElementDescriptor.getAdapter(View.class);
- if (view instanceof Connector) {
- final Connector connector = (Connector) view;
+ if(returnValue instanceof List<?>) {
+ final List<?> resultList = (List<?>)returnValue;
+ for(final Object resultElement : resultList) {
+ if(resultElement instanceof ConnectionViewAndElementDescriptor) {
+ final ConnectionViewAndElementDescriptor connectionViewAndElementDescriptor = (ConnectionViewAndElementDescriptor)resultElement;
+ final View view = (View)connectionViewAndElementDescriptor.getAdapter(View.class);
+ if(view instanceof Connector) {
+ final Connector connector = (Connector)view;
return connector;
}
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/DestructionOccurrenceSpecificationCreationTool.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/DestructionOccurrenceSpecificationCreationTool.java
index fa23f53c96c..f53f89118d0 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/DestructionOccurrenceSpecificationCreationTool.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/DestructionOccurrenceSpecificationCreationTool.java
@@ -44,15 +44,14 @@ public class DestructionOccurrenceSpecificationCreationTool extends CreationTool
@Override
protected Command getCommand() {
final EditPart targetEditPart = getTargetEditPart();
- final CompositeCommand compositeCommand = new CompositeCommand(
- Messages.DestructionOccurrenceSpecificationCreationTool_CreateDestructionOccurrenceSpecification);
+ final CompositeCommand compositeCommand = new CompositeCommand(Messages.DestructionOccurrenceSpecificationCreationTool_CreateDestructionOccurrenceSpecification);
EditPart timeline;
- if (targetEditPart instanceof FullStateInvariantEditPartCN) {
- final FullStateInvariantEditPartCN fullStateInvariantEditPartCN = (FullStateInvariantEditPartCN) targetEditPart;
+ if(targetEditPart instanceof FullStateInvariantEditPartCN) {
+ final FullStateInvariantEditPartCN fullStateInvariantEditPartCN = (FullStateInvariantEditPartCN)targetEditPart;
timeline = EditPartUtils.findParentEditPartWithId(targetEditPart, FullLifelineTimelineCompartmentEditPartCN.VISUAL_ID);
compositeCommand.add(new CutAndInsertOccurrenceSpecificationCommand(fullStateInvariantEditPartCN, getLocation(), true));
- } else if (targetEditPart instanceof CompactStateInvariantEditPartCN) {
- final CompactStateInvariantEditPartCN compactStateInvariantEditPartCN = (CompactStateInvariantEditPartCN) targetEditPart;
+ } else if(targetEditPart instanceof CompactStateInvariantEditPartCN) {
+ final CompactStateInvariantEditPartCN compactStateInvariantEditPartCN = (CompactStateInvariantEditPartCN)targetEditPart;
timeline = EditPartUtils.findParentEditPartWithId(targetEditPart, CompactLifelineCompartmentEditPartCN.VISUAL_ID);
compositeCommand.add(new CutAndInsertOccurrenceSpecificationCompactLifelineCommand(compactStateInvariantEditPartCN, getLocation(), true));
} else {
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/DurationCreationTool.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/DurationCreationTool.java
index 91a28227ca5..4f460889aba 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/DurationCreationTool.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/DurationCreationTool.java
@@ -24,14 +24,12 @@ public class DurationCreationTool extends AbstractTwoPointCreationTool {
@Override
protected boolean validateFirstTarget(final EditPart firstTarget) {
- return firstTarget != null
- && EditPartUtils.isEditPartFor(firstTarget, UMLPackage.eINSTANCE.getOccurrenceSpecification(), UMLPackage.eINSTANCE.getStateInvariant());
+ return firstTarget != null && EditPartUtils.isEditPartFor(firstTarget, UMLPackage.eINSTANCE.getOccurrenceSpecification(), UMLPackage.eINSTANCE.getStateInvariant());
}
@Override
protected boolean validateSecondTarget(final EditPart firstTarget, final EditPart secondTarget) {
- if (secondTarget == null
- || !EditPartUtils.isEditPartFor(secondTarget, UMLPackage.eINSTANCE.getOccurrenceSpecification(), UMLPackage.eINSTANCE.getStateInvariant())) {
+ if(secondTarget == null || !EditPartUtils.isEditPartFor(secondTarget, UMLPackage.eINSTANCE.getOccurrenceSpecification(), UMLPackage.eINSTANCE.getStateInvariant())) {
return false;
}
return ordered(firstTarget, secondTarget);
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/FloatingMessageAnchor.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/FloatingMessageAnchor.java
index b1b5ea96f77..91a2286abcc 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/FloatingMessageAnchor.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/FloatingMessageAnchor.java
@@ -20,7 +20,9 @@ import org.eclipse.papyrus.uml.diagram.timing.custom.utils.MessageUtils;
* gets its relative location from an EAnnotation stored on the Connector.
*/
public class FloatingMessageAnchor extends ConnectionAnchorBase {
+
private final ConnectionEditPart connectionEditPart;
+
private final Point defaultOffset;
public FloatingMessageAnchor(final ConnectionEditPart connEditPart, final Point defaultOffset) {
@@ -38,9 +40,9 @@ public class FloatingMessageAnchor extends ConnectionAnchorBase {
public Point getLocation(final Point reference) {
final Point point = MessageUtils.getMessageConnectorLocation(this.connectionEditPart);
- if (point != null) {
+ if(point != null) {
return new Point(reference.x + point.x, reference.y + point.y);
}
return new Point(reference.x + this.defaultOffset.x, reference.y + this.defaultOffset.y);
}
-} \ No newline at end of file
+}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/GeneralOrderingCreationTool.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/GeneralOrderingCreationTool.java
index 0aa648b9642..3018ae310ec 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/GeneralOrderingCreationTool.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/GeneralOrderingCreationTool.java
@@ -29,7 +29,7 @@ public class GeneralOrderingCreationTool extends AbstractTwoPointCreationTool {
@Override
protected boolean validateSecondTarget(final EditPart firstTarget, final EditPart secondTarget) {
- if (secondTarget == null || !EditPartUtils.isEditPartFor(secondTarget, UMLPackage.eINSTANCE.getOccurrenceSpecification())) {
+ if(secondTarget == null || !EditPartUtils.isEditPartFor(secondTarget, UMLPackage.eINSTANCE.getOccurrenceSpecification())) {
return false;
}
return ordered(firstTarget, secondTarget);
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/OccurrenceSpecificationCreationTool.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/OccurrenceSpecificationCreationTool.java
index 527cd94994b..062f7505474 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/OccurrenceSpecificationCreationTool.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/OccurrenceSpecificationCreationTool.java
@@ -46,12 +46,12 @@ public class OccurrenceSpecificationCreationTool extends CreationTool {
final EditPart targetEditPart = getTargetEditPart();
final CompositeCommand compositeCommand = new CompositeCommand(Messages.OccurrenceSpecificationCreationTool_CreateOccurrenceSpecification);
EditPart timeline;
- if (targetEditPart instanceof FullStateInvariantEditPartCN) {
- final FullStateInvariantEditPartCN fullStateInvariantEditPartCN = (FullStateInvariantEditPartCN) targetEditPart;
+ if(targetEditPart instanceof FullStateInvariantEditPartCN) {
+ final FullStateInvariantEditPartCN fullStateInvariantEditPartCN = (FullStateInvariantEditPartCN)targetEditPart;
timeline = EditPartUtils.findParentEditPartWithId(targetEditPart, FullLifelineTimelineCompartmentEditPartCN.VISUAL_ID);
compositeCommand.add(new CutAndInsertOccurrenceSpecificationCommand(fullStateInvariantEditPartCN, getLocation(), false));
- } else if (targetEditPart instanceof CompactStateInvariantEditPartCN) {
- final CompactStateInvariantEditPartCN compactStateInvariantEditPartCN = (CompactStateInvariantEditPartCN) targetEditPart;
+ } else if(targetEditPart instanceof CompactStateInvariantEditPartCN) {
+ final CompactStateInvariantEditPartCN compactStateInvariantEditPartCN = (CompactStateInvariantEditPartCN)targetEditPart;
timeline = EditPartUtils.findParentEditPartWithId(targetEditPart, CompactLifelineCompartmentEditPartCN.VISUAL_ID);
compositeCommand.add(new AddOccurrenceSpecificationInCompactLifelineCommand(compactStateInvariantEditPartCN, getLocation()));
} else {
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/PropertyDiagramUpdater.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/PropertyDiagramUpdater.java
index 0aa144c31b8..d92283f08ea 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/PropertyDiagramUpdater.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/PropertyDiagramUpdater.java
@@ -38,53 +38,53 @@ public class PropertyDiagramUpdater implements ICustomDiagramUpdater {
}
public static List<UMLNodeDescriptor> getLifelineFullLifelineTimelineCompartment_8SemanticChildren(final View view) {
- if (false == view.eContainer() instanceof View) {
+ if(false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- final View containerView = (View) view.eContainer();
- if (!containerView.isSetElement()) {
+ final View containerView = (View)view.eContainer();
+ if(!containerView.isSetElement()) {
return Collections.emptyList();
}
- final Lifeline modelElement = (Lifeline) containerView.getElement();
+ final Lifeline modelElement = (Lifeline)containerView.getElement();
final LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- if ((modelElement).getCoveredBys().size() > 0) {
+ if((modelElement).getCoveredBys().size() > 0) {
final Interaction interaction = modelElement.getInteraction();
- for (final Object element : interaction.getFragments()) {
+ for(final Object element : interaction.getFragments()) {
- final InteractionFragment childElement = (InteractionFragment) element;
+ final InteractionFragment childElement = (InteractionFragment)element;
final int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if (visualID == FullStateInvariantEditPartCN.VISUAL_ID) {
+ if(visualID == FullStateInvariantEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if (visualID == OccurrenceSpecificationEditPartCN.VISUAL_ID) {
+ if(visualID == OccurrenceSpecificationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if (visualID == MessageOccurrenceSpecificationEditPartCN.VISUAL_ID) {
+ if(visualID == MessageOccurrenceSpecificationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if (visualID == DestructionOccurrenceSpecificationEditPartCN.VISUAL_ID) {
+ if(visualID == DestructionOccurrenceSpecificationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
}
- if ((modelElement).getCoveredBys().size() > 0) {
+ if((modelElement).getCoveredBys().size() > 0) {
final Interaction interaction = modelElement.getInteraction();
- for (final Object element : interaction.getOwnedRules()) {
- final Constraint childElement = (Constraint) element;
+ for(final Object element : interaction.getOwnedRules()) {
+ final Constraint childElement = (Constraint)element;
final int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if (visualID == DurationConstraintEditPartCN.VISUAL_ID) {
+ if(visualID == DurationConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if (visualID == DurationObservationEditPartCN.VISUAL_ID) {
+ if(visualID == DurationObservationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -94,53 +94,53 @@ public class PropertyDiagramUpdater implements ICustomDiagramUpdater {
}
public static List<UMLNodeDescriptor> createLifelineCompactLifelineCompartment_23Children(final View view) {
- if (false == view.eContainer() instanceof View) {
+ if(false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- final View containerView = (View) view.eContainer();
- if (!containerView.isSetElement()) {
+ final View containerView = (View)view.eContainer();
+ if(!containerView.isSetElement()) {
return Collections.emptyList();
}
- final Lifeline modelElement = (Lifeline) containerView.getElement();
+ final Lifeline modelElement = (Lifeline)containerView.getElement();
final LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- if ((modelElement).getCoveredBys().size() > 0) {
+ if((modelElement).getCoveredBys().size() > 0) {
final Interaction interaction = modelElement.getInteraction();
- for (final Object element : interaction.getFragments()) {
+ for(final Object element : interaction.getFragments()) {
- final InteractionFragment childElement = (InteractionFragment) element;
+ final InteractionFragment childElement = (InteractionFragment)element;
final int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if (visualID == CompactStateInvariantEditPartCN.VISUAL_ID) {
+ if(visualID == CompactStateInvariantEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if (visualID == OccurrenceSpecificationEditPartCN.VISUAL_ID) {
+ if(visualID == OccurrenceSpecificationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if (visualID == MessageOccurrenceSpecificationEditPartCN.VISUAL_ID) {
+ if(visualID == MessageOccurrenceSpecificationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if (visualID == DestructionOccurrenceSpecificationEditPartCN.VISUAL_ID) {
+ if(visualID == DestructionOccurrenceSpecificationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
}
- if ((modelElement).getCoveredBys().size() > 0) {
+ if((modelElement).getCoveredBys().size() > 0) {
final Interaction interaction = modelElement.getInteraction();
- for (final Object element : interaction.getOwnedRules()) {
- final Constraint childElement = (Constraint) element;
+ for(final Object element : interaction.getOwnedRules()) {
+ final Constraint childElement = (Constraint)element;
final int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if (visualID == DurationConstraintEditPartCN.VISUAL_ID) {
+ if(visualID == DurationConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if (visualID == DurationObservationEditPartCN.VISUAL_ID) {
+ if(visualID == DurationObservationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/SpecificTypeCreationTool.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/SpecificTypeCreationTool.java
index 49ec232aeaa..e3393a48ac6 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/SpecificTypeCreationTool.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/SpecificTypeCreationTool.java
@@ -21,16 +21,18 @@ import org.eclipse.papyrus.uml.diagram.common.service.AspectUnspecifiedTypeConne
/** A creation tool that only allows creating connections between specific types. */
public class SpecificTypeCreationTool extends AspectUnspecifiedTypeConnectionTool {
+
private final Collection<EClass> sourceTypes;
+
private final Collection<EClass> targetTypes;
/**
* @param connectionTypeToCreate
- * the element type of the connection to create
+ * the element type of the connection to create
* @param sourceTypes
- * the connection will only be allowed if the source is of one of these types
+ * the connection will only be allowed if the source is of one of these types
* @param targetTypes
- * the connection will only be allowed if the target is of one of these types
+ * the connection will only be allowed if the target is of one of these types
*/
public SpecificTypeCreationTool(final IElementType connectionTypeToCreate, final Collection<EClass> sourceTypes, final Collection<EClass> targetTypes) {
super(Collections.singletonList(connectionTypeToCreate));
@@ -42,20 +44,20 @@ public class SpecificTypeCreationTool extends AspectUnspecifiedTypeConnectionToo
protected Command getCommand() {
final EditPart targetEditPart = getTargetEditPart();
EObject element = null;
- if (targetEditPart != null && targetEditPart.getModel() instanceof View) {
- element = ((View) targetEditPart.getModel()).getElement();
+ if(targetEditPart != null && targetEditPart.getModel() instanceof View) {
+ element = ((View)targetEditPart.getModel()).getElement();
}
// only allow creating a connection that starts from the sourceType
- if (isInState(STATE_INITIAL)) {
- if (!isOfType(element, this.sourceTypes)) {
+ if(isInState(STATE_INITIAL)) {
+ if(!isOfType(element, this.sourceTypes)) {
return null;
}
}
// only allow creating a connection that goes to the targetType
- if (isInState(STATE_CONNECTION_STARTED) || isInState(STATE_TERMINAL)) {
- if (!isOfType(element, this.targetTypes)) {
+ if(isInState(STATE_CONNECTION_STARTED) || isInState(STATE_TERMINAL)) {
+ if(!isOfType(element, this.targetTypes)) {
return null;
}
}
@@ -63,11 +65,11 @@ public class SpecificTypeCreationTool extends AspectUnspecifiedTypeConnectionToo
}
private static boolean isOfType(final EObject element, final Collection<EClass> types) {
- for (final EClass eClass : types) {
- if (eClass.isInstance(element)) {
+ for(final EClass eClass : types) {
+ if(eClass.isInstance(element)) {
return true;
}
}
return false;
}
-} \ No newline at end of file
+}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/providers/CustomEditPolicyProvider.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/providers/CustomEditPolicyProvider.java
index b26e7cebb35..35a16df7f83 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/providers/CustomEditPolicyProvider.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/providers/CustomEditPolicyProvider.java
@@ -40,19 +40,19 @@ public class CustomEditPolicyProvider extends AbstractProvider implements IEditP
* {@inheritDoc}
*/
public void createEditPolicies(final EditPart editPart) {
- if (!(editPart instanceof AppliedStereotypeMultilinePropertyEditPart)) {
+ if(!(editPart instanceof AppliedStereotypeMultilinePropertyEditPart)) {
// editPart.installEditPolicy(NavigationEditPolicy.NAVIGATION_POLICY, new NavigationEditPolicy());
- if (editPart instanceof IPrimaryEditPart) {
+ if(editPart instanceof IPrimaryEditPart) {
// if (EMFHelper.getEObject(editPart) != null) {
// editPart.installEditPolicy(AppliedStereotypeCommentCreationEditPolicy.APPLIED_STEREOTYPE_COMMENT,
// new AppliedStereotypeCommentCreationEditPolicy());
// }
- if (!(editPart instanceof ConnectionEditPart)) {
+ if(!(editPart instanceof ConnectionEditPart)) {
// editPart.installEditPolicy(EditPolicyRoles.POPUPBAR_ROLE, new HyperLinkPopupBarEditPolicy());
}
}
- if (editPart instanceof NamedElementEditPart) {
+ if(editPart instanceof NamedElementEditPart) {
editPart.installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeCompartmentEditPolicy());
}
}
@@ -63,14 +63,14 @@ public class CustomEditPolicyProvider extends AbstractProvider implements IEditP
* {@inheritDoc}
*/
public boolean provides(final IOperation operation) {
- final CreateEditPoliciesOperation epOperation = (CreateEditPoliciesOperation) operation;
- if (!(epOperation.getEditPart() instanceof GraphicalEditPart) && !(epOperation.getEditPart() instanceof ConnectionEditPart)) {
+ final CreateEditPoliciesOperation epOperation = (CreateEditPoliciesOperation)operation;
+ if(!(epOperation.getEditPart() instanceof GraphicalEditPart) && !(epOperation.getEditPart() instanceof ConnectionEditPart)) {
return false;
}
final EditPart gep = epOperation.getEditPart();
- final String diagramType = ((View) gep.getModel()).getDiagram().getType();
- if (!TimingDiagramEditPart.MODEL_ID.equals(diagramType)) {
+ final String diagramType = ((View)gep.getModel()).getDiagram().getType();
+ if(!TimingDiagramEditPart.MODEL_ID.equals(diagramType)) {
return false;
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/providers/StereotypePropertiesEditPartProvider.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/providers/StereotypePropertiesEditPartProvider.java
index 3896319ebd0..e2fc2878dc4 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/providers/StereotypePropertiesEditPartProvider.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/providers/StereotypePropertiesEditPartProvider.java
@@ -56,19 +56,19 @@ public class StereotypePropertiesEditPartProvider extends RestrictedAbstractEdit
*/
@Override
public boolean provides(final IOperation operation) {
- if (operation instanceof CreateGraphicEditPartOperation) {
- final View newView = ((IEditPartOperation) operation).getView();
- if (newView == null) {
+ if(operation instanceof CreateGraphicEditPartOperation) {
+ final View newView = ((IEditPartOperation)operation).getView();
+ if(newView == null) {
return false;
}
final String graphicalType = newView.getType();
- if ((newView instanceof Node) && (!this.nodeMap.containsKey(graphicalType))) {
+ if((newView instanceof Node) && (!this.nodeMap.containsKey(graphicalType))) {
return false;
}
- if ((newView instanceof Edge) && (!this.edgeMap.containsKey(graphicalType))) {
+ if((newView instanceof Edge) && (!this.edgeMap.containsKey(graphicalType))) {
return false;
}
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/Constants.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/Constants.java
index 43ba86f4579..89063dc39b5 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/Constants.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/Constants.java
@@ -13,6 +13,7 @@ import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullStateInvariantEditP
import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullStateInvariantVerticalLineEditPart;
public final class Constants {
+
private Constants() {
// not instantiable
}
@@ -24,10 +25,14 @@ public final class Constants {
public static final int MINIMUM_DISTANCE_BETWEEN_OCCURRENCE_SPECIFICATIONS = 4;
public static final int MARGIN_BETWEEN_LIFELINES = 8;
+
public static final int TIME_RULER_HEIGHT = 30;
+
public static final int STATE_DEFINITIONS_WIDTH = 100;
public static final String fullStateInvariantId = Integer.toString(FullStateInvariantEditPartCN.VISUAL_ID);
+
public static final String compactStateInvariantId = Integer.toString(CompactStateInvariantEditPartCN.VISUAL_ID);
+
public static final String verticalLineId = Integer.toString(FullStateInvariantVerticalLineEditPart.VISUAL_ID);
}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/DropUtils.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/DropUtils.java
index b582ce4c60b..6ac554738a6 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/DropUtils.java
+++ b/