Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcletavernie2013-02-04 09:53:14 +0000
committercletavernie2013-02-04 09:53:14 +0000
commitb4f92c06b153f91fbbbfa172e883be364aa55e2b (patch)
tree5111ba4bb111f6dc7f82764dc311ce6114eaa9cb /incoming
parent3d5e6004d9b6977504cf8b1bf8d45f76659e9043 (diff)
downloadorg.eclipse.papyrus-b4f92c06b153f91fbbbfa172e883be364aa55e2b.tar.gz
org.eclipse.papyrus-b4f92c06b153f91fbbbfa172e883be364aa55e2b.tar.xz
org.eclipse.papyrus-b4f92c06b153f91fbbbfa172e883be364aa55e2b.zip
397389: [Timing Diagram] Papyrus shall support UML2 timing diagram
https://bugs.eclipse.org/bugs/show_bug.cgi?id=397389 Move oep.uml.diagram.timing to its final SVN location
Diffstat (limited to 'incoming')
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/.classpath8
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/.gitignore1
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/.options7
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/.project28
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/.settings/net.sf.jautodoc.prefs9
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/FIXME.txt8
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/META-INF/MANIFEST.MF76
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/README.txt18
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/TODO.txt9
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/about.html28
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/build.properties22
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/CreateTimingDiagramCommand.java49
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/CreateTimingDiagramWithNavigationHandler.java21
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/LifelineVerticalLabelCellEditorLocator.java46
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/Messages.java195
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/OperationForbiddenException.java23
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/SwitchLifelineAction.java42
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/TimingDiagramCreationCondition.java34
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/TimingDiagramEditorFactory.java23
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/UmlTimingDiagramForMultiEditor.java105
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/AbstractChangeLifelineTypeCommand.java79
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/AbstractRefreshCommand.java56
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/AddOccurrenceSpecificationInCompactLifelineCommand.java119
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/ChangeLifelineFromCompactToFull.java36
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/ChangeLifelineFromFullToCompact.java35
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CreateTickCommand.java89
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomDurationConstraintCreateCommand.java87
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomDurationObservationCreateCommand.java67
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomGeneralOrderingCreateCommand.java52
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomMessageCreateCommand.java134
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomMessageReorientCommand.java124
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomTimeConstraintCreateCommand.java84
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomTimeObservationCreateCommand.java55
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CutAndInsertOccurrenceSpecificationCommand.java138
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CutAndInsertOccurrenceSpecificationCompactLifelineCommand.java165
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/DeleteStateDefinitionCommand.java51
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/RefreshCommandForDo.java34
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/RefreshCommandForUndo.java30
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/SwitchLifelineCommand.java589
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/ToggleTimeRulerVisibility.java85
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/ValidateInteractionCommand.java57
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactLifelineCompartmentEditPart.java258
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactLifelineEditPartCN.java135
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactLifelineTimeRulerCompartmentEditPartCN.java53
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactStateInvariantEditPartCN.java83
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactStateInvariantNameEditPart.java44
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomDestructionOccurrenceSpecificationEditPartCN.java43
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomDestructionOccurrenceSpecificationLabelEditPart.java31
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomDurationConstraintEditPart.java41
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomDurationObservationEditPart.java41
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFreeTimeRulerCompartmentEditPart.java151
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFreeTimingRulerEditPart.java74
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullLifelineEditPartCN.java138
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullLifelineStateDefinitionCompartmentEditPartCN.java130
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullLifelineTimeRulerCompartmentEditPartCN.java53
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullLifelineTimelineCompartmentEditPartCN.java342
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullStateInvariantEditPartCN.java131
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullStateInvariantVerticalLineEditPart.java43
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomGateEditPart.java36
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomGeneralOrderingEditPart.java41
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomInteractionCompartmentEditPartTN.java126
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomInteractionEditPartTN.java148
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomMessageFoundEditPart.java34
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomMessageLostEditPart.java34
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomMessageOccurrenceSpecificationEditPartCN.java43
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomMessageOccurrenceSpecificationLabelEditPart.java31
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomOccurrenceSpecificationEditPartCN.java43
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomOccurrenceSpecificationLabelEditPart.java31
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomStateDefinitionEditPart.java114
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomStateDefinitionLabelEditPart.java61
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTickEditPart.java43
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimeConstraintEditPart.java43
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimeObservationEditPart.java43
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimeRulerCompartmentEditPartCN.java51
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimingDiagramEditPart.java47
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomUMLEditPartFactory.java137
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/AbstractTimelineLayoutPolicy.java490
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomCompactLifelineCompartmentItemSemanticEditPolicyCN.java76
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomCompactLifelineCompartmentLayoutEditPolicy.java228
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomCompactLifelineItemSemanticEditPolicyCN.java32
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomCompactStateInvariantItemSemanticEditPolicy.java53
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomDestructionOccurrenceSpecificationItemSemanticEditPolicy.java53
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullLifelineItemSemanticEditPolicyCN.java32
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullLifelineStateDefinitionCompartmentCreationEditPolicy.java107
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullLifelineStateDefinitionCompartmentLayoutEditPolicy.java22
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullLifelineTimelineCompartmentItemSemanticEditPolicyCN.java75
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullStateInvariantItemSemanticEditPolicy.java53
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomGateItemSemanticEditPolicy.java52
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomInteractionCompartmentCreationEditPolicy.java115
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomInteractionCompartmentItemSemanticEditPolicy.java52
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomInteractionCompartmentLayoutEditPolicy.java14
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomInteractionCreationEditPolicy.java95
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomLifelineCompartmentGraphicalNodeEditPolicy.java89
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomLifelineNameEditPolicy.java51
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomMessageOccurrenceSpecificationItemSemanticEditPolicy.java69
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomOccurrenceSpecificationItemSemanticEditPolicy.java58
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomTimelineCompartmentLayoutEditPolicy.java345
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomTimingDiagramCreationEditPolicy.java53
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/ExternalLabelPrimaryDragRoleEditPolicy.java78
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/FirstEventRefreshEditPolicy.java114
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/GenericListCompartmentLayoutEditPolicy.java226
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/LayoutEditPolicyForLabel.java56
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/SelectionOnlyLayoutEditPolicy.java37
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/TimeRulerVisibilityRefreshEditPolicy.java105
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/TimingDiagramDragDropEditPolicy.java363
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/AbstractMessageFigure.java94
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/CompactLifelineFigure.java96
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/CompactStateFigure.java177
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/CrossFigure.java66
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/CustomInteractionRectangleFigure.java71
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/DimensioningArrowFigure.java67
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/EllipseDecoration.java56
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/FullLifelineFigure.java135
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/FullStateFigure.java62
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/FullStateInvariantVerticalLineFigure.java35
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/GateFigure.java51
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/GeneralOrderingHorizontalFigure.java59
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/InvisibleRectangleFigure.java40
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/LifelineFigure.java145
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/LifelineVerticalLabel.java78
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/MessageAsyncFigure.java31
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/MessageCreateFigure.java37
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/MessageDeleteFigure.java41
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/MessageFoundFigure.java39
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/MessageLostFigure.java40
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/MessageReplyFigure.java40
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/MessageSyncFigure.java40
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/SmallSquareFigure.java52
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/StateDefinitionFigure.java65
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/TimeRulerFigure.java23
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/TimingRulerFigure.java39
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/VerticalLabel.java169
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/VerticalMarkFigure.java48
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/helper/TimingDiagramLinkMappingHelper.java61
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/helper/advice/DefaultTypeHelperAdvice.java40
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/helper/advice/GateHelperAdvice.java51
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/helper/advice/OccurrenceSpecificationHelperAdvice.java57
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/helper/advice/StateInvariantHelperAdvice.java60
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/layouts/FillLayout.java40
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/layouts/TimeRulerLayout.java44
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/locator/LabelInCompartmentLocator.java30
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/messages.properties93
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parsers/CompactStateInvariantNameParser.java125
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parsers/ConstraintParser.java224
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parsers/OccurrenceSpecificationNameParser.java101
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parsers/StateDefinitionParser.java89
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parsers/TickParser.java45
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/AbstractTwoPointCreationTool.java250
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/CustomPaletteFactory.java327
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/DestructionOccurrenceSpecificationCreationTool.java64
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/DurationCreationTool.java56
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/FloatingMessageAnchor.java48
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/GeneralOrderingCreationTool.java53
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/NoScrollNoBorderDragEditPartsTracker.java20
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/OccurrenceSpecificationCreationTool.java64
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/PropertyDiagramUpdater.java152
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/parts/SpecificTypeCreationTool.java75
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/providers/CustomUMLEditPartProvider.java22
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/Constants.java38
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/DropUtils.java378
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/EcoreUtils.java138
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/EditPartUtils.java127
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/FigureUtils.java148
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/GateUtils.java45
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/GeneralOrderingUtils.java51
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/InteractionUtils.java39
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/LifelineUtils.java269
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/MessageUtils.java331
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/ModelValidationUtils.java246
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/OccurrenceSpecificationUtils.java443
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/RequestUtils.java78
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/StateDefinitionUtils.java304
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/StateInvariantUtils.java436
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/TickUtils.java172
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/TimeElementUtils.java59
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/TimeRulerUtils.java110
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/Utils.java148
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/utils/ViewUtils.java273
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/icons/obj16/Diagram_Timing.gifbin91 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/icons/obj16/UMLDiagramFile.gifbin339 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/icons/obj16/destruction.pngbin188 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/icons/obj16/event.pngbin389 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/icons/obj16/stateDefinition.pngbin451 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/icons/obj16/tick.pngbin171 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/icons/wizban/NewUMLWizard.gifbin2466 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/messages.properties116
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/model/timingdiagram.gmfgen2164
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/plugin.properties71
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/plugin.xml1502
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/CompactLifelineCreateCommandCN.java126
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/CompactStateInvariantCreateCommandCN.java126
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/DestructionOccurrenceSpecificationCreateCommandCN.java126
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/DurationConstraintCreateCommandCN.java126
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/DurationObservationCreateCommandCN.java126
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/FullLifelineCreateCommandCN.java126
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/FullStateInvariantCreateCommandCN.java126
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/GateCreateCommand.java126
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/GeneralOrderingCreateCommand.java126
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/InteractionCreateCommandTN.java126
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/LifelineCreateCommand.java126
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageAsyncCreateCommand.java166
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageAsyncReorientCommand.java170
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageCreateCreateCommand.java166
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageCreateReorientCommand.java170
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageDeleteCreateCommand.java166
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageDeleteReorientCommand.java170
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageFoundCreateCommand.java160
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageFoundReorientCommand.java170
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageLostCreateCommand.java160
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageLostReorientCommand.java170
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageOccurrenceSpecificationCreateCommandCN.java126
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageReplyCreateCommand.java166
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageReplyReorientCommand.java170
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageSyncCreateCommand.java166
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/MessageSyncReorientCommand.java170
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/OccurrenceSpecificationCreateCommandCN.java126
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/TimeConstraintCreateCommand.java126
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/commands/TimeObservationCreateCommand.java126
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/helpers/CompactLifelineEditHelper.java19
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/helpers/CompactStateInvariantEditHelper.java19
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/helpers/DestructionOccurrenceSpecificationEditHelper.java17
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/helpers/DurationConstraintEditHelper.java17
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/helpers/DurationObservationEditHelper.java17
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/helpers/FullLifelineEditHelper.java19
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/helpers/FullStateInvariantEditHelper.java17
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/helpers/GateEditHelper.java17
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/helpers/GeneralOrderingEditHelper.java17
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/helpers/InteractionEditHelper.java17
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/helpers/LifelineEditHelper.java17
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/helpers/MessageAsyncEditHelper.java19
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/helpers/MessageCreateEditHelper.java19
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/helpers/MessageDeleteEditHelper.java19
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/helpers/MessageFoundEditHelper.java19
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/helpers/MessageLostEditHelper.java19
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/helpers/MessageOccurrenceSpecificationEditHelper.java17
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/helpers/MessageReplyEditHelper.java19
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/helpers/MessageSyncEditHelper.java17
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/helpers/OccurrenceSpecificationEditHelper.java17
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/helpers/PackageEditHelper.java17
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/helpers/TimeConstraintEditHelper.java17
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/helpers/TimeObservationEditHelper.java17
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/helpers/UMLBaseEditHelper.java20
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/CompactLifelineCompartmentEditPartCN.java134
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/CompactLifelineEditPartCN.java456
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/CompactLifelineNameEditPart.java796
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/CompactLifelineTimeRulerCompartmentEditPartCN.java135
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/CompactStateInvariantEditPartCN.java447
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/CompactStateInvariantNameEditPart.java793
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/DestructionOccurrenceSpecificationAppliedStereotypeEditPart.java776
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/DestructionOccurrenceSpecificationEditPartCN.java538
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/DestructionOccurrenceSpecificationLabelEditPart.java780
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/DurationConstraintEditPartCN.java354
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/DurationConstraintSpecificationEditPart.java780
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/DurationObservationEditPartCN.java354
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/DurationObservationNameEditPart.java780
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/FreeTimeRulerCompartmentEditPart.java127
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/FreeTimingRulerEditPartCN.java310
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/FullLifelineEditPartCN.java474
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/FullLifelineNameEditPart.java796
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/FullLifelineStateDefinitionCompartmentEditPartCN.java140
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/FullLifelineTimeRulerCompartmentEditPartCN.java135
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/FullLifelineTimelineCompartmentEditPartCN.java134
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/FullStateInvariantAppliedStereotypeEditPart.java776
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/FullStateInvariantEditPartCN.java386
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/FullStateInvariantVerticalLineEditPart.java243
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/GateEditPart.java533
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/GateLabelEditPart.java780
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/GeneralOrderingEditPart.java354
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/GeneralOrderingNameEditPart.java780
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/InteractionCompartmentEditPartTN.java142
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/InteractionEditPartTN.java481
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/InteractionNameEditPart.java793
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/LifelineEditPart.java323
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/LinearTimeRulerCompartmentEditPart.java124
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/LinearTimingRulerEditPartCN.java310
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageAsyncAppliedStereotypeEditPart.java752
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageAsyncEditPart.java123
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageAsyncNameLabelEditPart.java752
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageCreateAppliedStereotypeEditPart.java752
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageCreateEditPart.java123
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageCreateNameLabelEditPart.java752
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageDeleteAppliedStereotypeEditPart.java752
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageDeleteEditPart.java123
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageDeleteNameLabelEditPart.java752
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageFoundAppliedStereotypeEditPart.java752
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageFoundEditPart.java123
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageFoundNameLabelEditPart.java752
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageLostAppliedStereotypeEditPart.java752
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageLostEditPart.java123
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageLostNameLabelEditPart.java752
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageOccurrenceSpecificationAppliedStereotypeEditPart.java776
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageOccurrenceSpecificationEditPartCN.java566
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageOccurrenceSpecificationLabelEditPart.java780
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageReplyAppliedStereotypeEditPart.java752
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageReplyEditPart.java123
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageReplyNameLabelEditPart.java752
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageSyncAppliedStereotypeEditPart.java752
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageSyncEditPart.java123
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageSyncNameLabelEditPart.java752
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/OccurrenceSpecificationAppliedStereotypeEditPart.java776
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/OccurrenceSpecificationEditPartCN.java392
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/OccurrenceSpecificationLabelEditPart.java780
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/StateDefinitionEditPart.java324
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/StateDefinitionLabelEditPart.java793
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/StateInvariantAppliedStereotypeEditPart.java776
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/TickEditPart.java287
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/TickNameEditPart.java781
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/TimeConstraintAppliedStereotypeEditPart.java776
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/TimeConstraintEditPart.java364
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/TimeConstraintSpecificationEditPart.java780
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/TimeObservationAppliedStereotypeEditPart.java776
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/TimeObservationEditPart.java364
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/TimeObservationNameEditPart.java780
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/TimeRulerCompartmentEditPartCN.java135
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/TimingDiagramEditPart.java119
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/UMLEditPartFactory.java333
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/CompactLifelineCompartmentItemSemanticEditPolicyCN.java120
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/CompactLifelineItemSemanticEditPolicyCN.java156
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/CompactLifelineTimeRulerCompartmentItemSemanticEditPolicyCN.java57
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/CompactStateInvariantItemSemanticEditPolicyCN.java156
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/DestructionOccurrenceSpecificationItemSemanticEditPolicyCN.java247
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/DurationConstraintItemSemanticEditPolicyCN.java156
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/DurationObservationItemSemanticEditPolicyCN.java156
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullLifelineItemSemanticEditPolicyCN.java156
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullLifelineStateDefinitionCompartmentItemSemanticEditPolicyCN.java57
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullLifelineTimeRulerCompartmentItemSemanticEditPolicyCN.java57
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullLifelineTimelineCompartmentItemSemanticEditPolicyCN.java120
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/FullStateInvariantItemSemanticEditPolicyCN.java156
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/GateItemSemanticEditPolicy.java247
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/GeneralOrderingItemSemanticEditPolicy.java156
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/InteractionCompartmentItemSemanticEditPolicyTN.java71
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/InteractionNodeItemSemanticEditPolicyTN.java189
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/LifelineItemSemanticEditPolicy.java156
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageAsyncItemSemanticEditPolicy.java156
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageCreateItemSemanticEditPolicy.java156
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageDeleteItemSemanticEditPolicy.java156
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageFoundItemSemanticEditPolicy.java156
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageLostItemSemanticEditPolicy.java156
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageOccurrenceSpecificationItemSemanticEditPolicyCN.java247
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageReplyItemSemanticEditPolicy.java156
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/MessageSyncItemSemanticEditPolicy.java156
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/OccurrenceSpecificationItemSemanticEditPolicyCN.java156
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/TimeConstraintItemSemanticEditPolicy.java156
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/TimeObservationItemSemanticEditPolicy.java156
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/TimeRulerCompartmentItemSemanticEditPolicyCN.java57
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/TimingDiagramEditPartFactoryItemSemanticEditPolicy.java101
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/UMLBaseItemSemanticEditPolicy.java491
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/UMLTextNonResizableEditPolicy.java242
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/policies/UMLTextSelectionEditPolicy.java225
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/expressions/UMLAbstractExpression.java170
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/expressions/UMLOCLFactory.java191
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/navigator/UMLAbstractNavigatorItem.java68
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/navigator/UMLDomainNavigatorContentProvider.java227
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/navigator/UMLDomainNavigatorItem.java118
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/navigator/UMLDomainNavigatorLabelProvider.java104
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/navigator/UMLNavigatorActionProvider.java182
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/navigator/UMLNavigatorContentProvider.java343
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/navigator/UMLNavigatorGroup.java109
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/navigator/UMLNavigatorItem.java96
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/navigator/UMLNavigatorLabelProvider.java178
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/navigator/UMLNavigatorLinkHelper.java112
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/navigator/UMLNavigatorSorter.java38
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/parsers/AbstractParser.java429
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/parsers/MessageFormatParser.java202
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/DeleteElementAction.java3
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/DiagramEditorContextMenuProvider.java60
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/Messages.java529
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/ModelElementSelectionPage.java153
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLCreationWizard.java168
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLCreationWizardPage.java95
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLDiagramActionBarContributor.java60
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLDiagramContentInitializer.java434
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLDiagramEditor.java537
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLDiagramEditorPlugin.java331
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLDiagramEditorUtil.java375
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLDiagramUpdateCommand.java88
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLDiagramUpdater.java1648
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLDocumentProvider.java1007
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLInitDiagramFileAction.java96
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLLinkDescriptor.java36
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLMatchingStrategy.java44
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLNewDiagramFileWizard.java177
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLNodeDescriptor.java28
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLPaletteFactory.java398
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLUriEditorInputTester.java32
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/UMLVisualIDRegistry.java901
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/part/ValidateAction.java263
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/CompactLifelinePreferencePage.java127
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/CompactStateInvariantPreferencePage.java71
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/DestructionOccurrenceSpecificationPreferencePage.java71
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/DiagramAppearancePreferencePage.java28
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/DiagramConnectionsPreferencePage.java28
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/DiagramGeneralPreferencePage.java30
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/DiagramPreferenceInitializer.java91
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/DiagramPrintingPreferencePage.java28
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/DiagramRulersAndGridPreferencePage.java28
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/DurationConstraintPreferencePage.java71
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/DurationObservationPreferencePage.java71
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/FreeTimingRulerPreferencePage.java126
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/FullLifelinePreferencePage.java128
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/FullStateInvariantPreferencePage.java71
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/GatePreferencePage.java71
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/GeneralOrderingPreferencePage.java71
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/InteractionPreferencePage.java127
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/LifelinePreferencePage.java71
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/LinearTimingRulerPreferencePage.java126
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/MessageAsyncPreferencePage.java46
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/MessageCreatePreferencePage.java46
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/MessageDeletePreferencePage.java46
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/MessageFoundPreferencePage.java46
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/MessageLostPreferencePage.java46
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/MessageOccurrenceSpecificationPreferencePage.java71
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/MessageReplyPreferencePage.java46
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/MessageSyncPreferencePage.java46
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/OccurrenceSpecificationPreferencePage.java71
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/StateDefinitionPreferencePage.java71
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/TickPreferencePage.java71
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/TimeConstraintPreferencePage.java71
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/TimeObservationPreferencePage.java71
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/preferences/VerticalLineStateInvariantPreferencePage.java71
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/providers/ElementInitializers.java34
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/providers/UMLEditPartProvider.java153
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/providers/UMLElementTypes.java490
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/providers/UMLIconProvider.java41
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/providers/UMLMarkerNavigationProvider.java92
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/providers/UMLModelingAssistantProvider.java469
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/providers/UMLParserProvider.java800
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/providers/UMLValidationDecoratorProvider.java71
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/providers/UMLValidationProvider.java76
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/providers/UMLViewProvider.java1413
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/sheet/UMLPropertySection.java122
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/sheet/UMLSheetLabelProvider.java88
433 files changed, 0 insertions, 85023 deletions
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/.classpath b/incoming/org.eclipse.papyrus.uml.diagram.timing/.classpath
deleted file mode 100644
index 744fb582747..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="custom-src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/.gitignore b/incoming/org.eclipse.papyrus.uml.diagram.timing/.gitignore
deleted file mode 100644
index e660fd93d31..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-bin/
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/.options b/incoming/org.eclipse.papyrus.uml.diagram.timing/.options
deleted file mode 100644
index 4ff17c4606e..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/.options
+++ /dev/null
@@ -1,7 +0,0 @@
-# Tracing options for the org.eclipse.papyrus.uml.diagram.timing plug-in
-
-# Common issues
-org.eclipse.papyrus.uml.diagram.timing/debug=false
-
-# Visual IDs
-org.eclipse.papyrus.uml.diagram.timing/debug/visualID=false
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/.project b/incoming/org.eclipse.papyrus.uml.diagram.timing/.project
deleted file mode 100644
index 4306e573035..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.papyrus.uml.diagram.timing</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/.settings/net.sf.jautodoc.prefs b/incoming/org.eclipse.papyrus.uml.diagram.timing/.settings/net.sf.jautodoc.prefs
deleted file mode 100644
index 65bd3258203..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/.settings/net.sf.jautodoc.prefs
+++ /dev/null
@@ -1,9 +0,0 @@
-add_header=true
-add_todo=false
-create_dummy_doc=false
-eclipse.preferences.version=1
-header_text=/*****************************************************************************\r\n * Copyright (c) 2012 CEA LIST.\r\n *\r\n * \r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n *\r\n *****************************************************************************/
-project_specific_settings=true
-replace_header=true
-replacements=<?xml version\="1.0" standalone\="yes"?>\n\n<replacements>\n<replacement key\="get" scope\="1" mode\="0">Gets the</replacement>\n<replacement key\="set" scope\="1" mode\="0">Sets the</replacement>\n<replacement key\="add" scope\="1" mode\="0">Adds the</replacement>\n<replacement key\="edit" scope\="1" mode\="0">Edits the</replacement>\n<replacement key\="remove" scope\="1" mode\="0">Removes the</replacement>\n<replacement key\="init" scope\="1" mode\="0">Inits the</replacement>\n<replacement key\="parse" scope\="1" mode\="0">Parses the</replacement>\n<replacement key\="create" scope\="1" mode\="0">Creates the</replacement>\n<replacement key\="build" scope\="1" mode\="0">Builds the</replacement>\n<replacement key\="is" scope\="1" mode\="0">Checks if is</replacement>\n<replacement key\="print" scope\="1" mode\="0">Prints the</replacement>\n<replacement key\="has" scope\="1" mode\="0">Checks for</replacement>\n</replacements>\n\n
-single_line_comment=false
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/.settings/org.eclipse.core.resources.prefs b/incoming/org.eclipse.papyrus.uml.diagram.timing/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 8afa69c6c6e..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-eclipse.preferences.version=1
-encoding//custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/messages.properties=ISO-8859-1
-encoding/<project>=UTF-8
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/FIXME.txt b/incoming/org.eclipse.papyrus.uml.diagram.timing/FIXME.txt
deleted file mode 100644
index e10702e0ef5..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/FIXME.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-- after renaming a message, we need to undo twice to undo the renaming (there are two "Message Update" commands to undo)
- => Bug 395439 - XText MessagePopupEditor creates two identical commands
-- Bug 395485 - XText validation error when clicking while XText editor is opening
-- Bug 395490 - SelectByTypeHandler fails when Views with no semantic element are present
-- Bug 395800 - NPE in UnloadHandler with notational-only Views
-- when resizing an interaction or adding a lifeline or more state definitions, existing lifelines get smaller and some of their contents (time elements, general orderings and labels) may get hidden
- => automatically move contents back inside the Lifelines?
- or automatically enlarge the Interaction to make all contents fit?
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/META-INF/MANIFEST.MF b/incoming/org.eclipse.papyrus.uml.diagram.timing/META-INF/MANIFEST.MF
deleted file mode 100644
index a180809b99e..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,76 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.papyrus.uml.diagram.timing; singleton:=true
-Bundle-Vendor: %providerName
-Bundle-Version: 0.10.0.qualifier
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-ClassPath: .
-Bundle-Activator: org.eclipse.papyrus.uml.diagram.timing.part.UMLDiagramEditorPlugin
-Bundle-ActivationPolicy: lazy
-Require-Bundle: org.eclipse.emf.ecore,
- org.eclipse.core.runtime,
- org.eclipse.core.resources,
- org.eclipse.core.expressions,
- org.eclipse.jface,
- org.eclipse.ui.ide,
- org.eclipse.ui.views,
- org.eclipse.ui.navigator,
- org.eclipse.ui.navigator.resources,
- org.eclipse.emf.ecore.xmi,
- org.eclipse.emf.edit.ui,
- org.eclipse.gmf.runtime.emf.core,
- org.eclipse.gmf.runtime.emf.commands.core,
- org.eclipse.gmf.runtime.emf.ui.properties,
- org.eclipse.gmf.runtime.diagram.ui,
- org.eclipse.papyrus.uml.diagram.common,
- org.eclipse.papyrus.infra.gmfdiag.common,
- org.eclipse.papyrus.uml.service.types,
- org.eclipse.papyrus.infra.widgets,
- org.eclipse.gmf.runtime.diagram.ui.properties,
- org.eclipse.gmf.runtime.diagram.ui.providers,
- org.eclipse.gmf.runtime.diagram.ui.providers.ide,
- org.eclipse.gmf.runtime.diagram.ui.render,
- org.eclipse.gmf.runtime.diagram.ui.resources.editor,
- org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide,
- org.eclipse.gmf.runtime.draw2d.ui;visibility:=reexport,
- org.eclipse.uml2.uml;visibility:=reexport,
- org.eclipse.uml2.uml.edit;visibility:=reexport,
- org.eclipse.emf.ecore.edit;visibility:=reexport,
- org.eclipse.ocl.ecore;visibility:=reexport,
- org.eclipse.emf.validation;visibility:=reexport,
- org.eclipse.gef,
- org.eclipse.papyrus.infra.gmfdiag.preferences,
- org.eclipse.papyrus.extensionpoints.editors,
- org.eclipse.gmf.tooling.runtime;bundle-version="3.0.0",
- org.eclipse.draw2d;visibility:=reexport,
- org.eclipse.papyrus.infra.services.edit,
- org.eclipse.papyrus.infra.core;bundle-version="0.10.0",
- org.eclipse.papyrus.infra.core.log;bundle-version="0.10.0",
- org.eclipse.papyrus.infra.core.sasheditor;bundle-version="0.10.0",
- org.eclipse.papyrus.infra.extendedtypes;bundle-version="0.10.0",
- org.eclipse.papyrus.infra.gmfdiag.navigation;bundle-version="0.10.0",
- org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="0.10.0",
- org.eclipse.papyrus.infra.widgets.toolbox;bundle-version="0.10.0"
-Export-Package: org.eclipse.papyrus.uml.diagram.timing.custom;x-friends:=org.eclipse.papyrus.uml.diagram.timing.tests,
- org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands;x-friends:=org.eclipse.papyrus.uml.diagram.timing.tests,
- org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;x-friends:=org.eclipse.papyrus.uml.diagram.timing.tests,
- org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies;x-friends:=org.eclipse.papyrus.uml.diagram.timing.tests,
- org.eclipse.papyrus.uml.diagram.timing.custom.figures;x-friends:=org.eclipse.papyrus.uml.diagram.timing.tests,
- org.eclipse.papyrus.uml.diagram.timing.custom.layouts;x-friends:=org.eclipse.papyrus.uml.diagram.timing.tests,
- org.eclipse.papyrus.uml.diagram.timing.custom.parsers;x-friends:=org.eclipse.papyrus.uml.diagram.timing.tests,
- org.eclipse.papyrus.uml.diagram.timing.custom.parts;x-friends:=org.eclipse.papyrus.uml.diagram.timing.tests,
- org.eclipse.papyrus.uml.diagram.timing.custom.providers;x-friends:=org.eclipse.papyrus.uml.diagram.timing.tests,
- org.eclipse.papyrus.uml.diagram.timing.custom.utils;x-friends:=org.eclipse.papyrus.uml.diagram.timing.tests,
- org.eclipse.papyrus.uml.diagram.timing.edit.commands;x-friends:=org.eclipse.papyrus.uml.diagram.timing.tests,
- org.eclipse.papyrus.uml.diagram.timing.edit.helpers;x-friends:=org.eclipse.papyrus.uml.diagram.timing.tests,
- org.eclipse.papyrus.uml.diagram.timing.edit.parts;x-friends:=org.eclipse.papyrus.uml.diagram.timing.tests,
- org.eclipse.papyrus.uml.diagram.timing.edit.policies;x-friends:=org.eclipse.papyrus.uml.diagram.timing.tests,
- org.eclipse.papyrus.uml.diagram.timing.navigator;x-friends:=org.eclipse.papyrus.uml.diagram.timing.tests,
- org.eclipse.papyrus.uml.diagram.timing.parsers;x-friends:=org.eclipse.papyrus.uml.diagram.timing.tests,
- org.eclipse.papyrus.uml.diagram.timing.part;x-friends:=org.eclipse.papyrus.uml.diagram.timing.tests,
- org.eclipse.papyrus.uml.diagram.timing.preferences;x-friends:=org.eclipse.papyrus.uml.diagram.timing.tests,
- org.eclipse.papyrus.uml.diagram.timing.providers;x-friends:=org.eclipse.papyrus.uml.diagram.timing.tests,
- org.eclipse.papyrus.uml.diagram.timing.sheet;x-friends:=org.eclipse.papyrus.uml.diagram.timing.tests
-Eclipse-LazyStart: true
-Bundle-Localization: plugin
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/README.txt b/incoming/org.eclipse.papyrus.uml.diagram.timing/README.txt
deleted file mode 100644
index 75b6e030ea2..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/README.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-How to regenerate:
-- launch a runtime instance of Eclipse
-- open timingdiagram.gmfgen
-- right-click the root element (the ResourceSet), and choose "Generate Papyrus Diagram"
-- select the "src" folder, and do a regex replace of:
- @generated\R \*/\R(public (?:abstract )?class)
- to:
- @generated\R */\R@SuppressWarnings("all")\R// disable warnings on generated code\R\1
-- select the "org.eclipse.papyrus.uml.diagram.timing" project in the development Eclipse, and do "Source > Clean Up..." in the main menu (with Eclipse >= 4.3M4 or patch from Bug 394296 applied)
-- with EGit, select the project and do "Team > Add to Index" so that the files don't appear as new
-
-
-pay attention to these modifications in generated code:
-- UMLEditPartFactory#getTextCellEditorLocator : modified in the super class instead of overridden because it is static
-- CustomPaletteFactory in plugin.xml
-
-to reset the generated src folder from git:
-git checkout HEAD -- src && git clean -f src \ No newline at end of file
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/TODO.txt b/incoming/org.eclipse.papyrus.uml.diagram.timing/TODO.txt
deleted file mode 100644
index f77ea85d8b9..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/TODO.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-- make the location of time elements relative to the center line of a compact timeline (instead of the top left corner)
- so that they stay put when the lifeline height changes
-- reconnect a DurationObservation or DurationConstraint to the new StateInvariant when a StateInvariant is cut in two (inserting an occurrence)
-- more unit tests (see /org.eclipse.papyrus.uml.diagram.timing.tests/TODO.txt)
-
-
-dropped features:
-- zooming on Lifelines
-- message labels : will be handled generically on all links in Papyrus sometime in the future
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/about.html b/incoming/org.eclipse.papyrus.uml.diagram.timing/about.html
deleted file mode 100644
index 82d49bf5f81..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/build.properties b/incoming/org.eclipse.papyrus.uml.diagram.timing/build.properties
deleted file mode 100644
index d25a8c073a5..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/build.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-###############################################################################
-# Copyright (c) 2012 CEA LIST.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-###############################################################################
-bin.includes = .,\
- icons/,\
- META-INF/,\
- plugin.xml,\
- messages.properties,\
- plugin.properties,\
- .options,\
- about.html
-jars.compile.order = .
-source.. = src/,\
- custom-src/
-output.. = bin/
-src.includes = about.html
-
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/CreateTimingDiagramCommand.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/CreateTimingDiagramCommand.java
deleted file mode 100644
index 10bc699759d..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/CreateTimingDiagramCommand.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom;
-
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.papyrus.infra.gmfdiag.common.AbstractPapyrusGmfCreateDiagramCommandHandler;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.TimingDiagramEditPart;
-
-/**
- * A command to create a new Timing Diagram. This command is used by all UI (toolbar, model explorer, creation wizards)
- * to create a new Timing Diagram.
- */
-public class CreateTimingDiagramCommand extends AbstractPapyrusGmfCreateDiagramCommandHandler {
-
- /**
- * Name of the Diagram
- */
- protected static final String TIMING_DIAGRAM_NAME = "TimingDiagram"; //$NON-NLS-1$
-
- @Override
- protected String getDefaultDiagramName() {
- return TIMING_DIAGRAM_NAME;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getDiagramNotationID() {
- return TimingDiagramEditPart.MODEL_ID;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected PreferencesHint getPreferenceHint() {
- return org.eclipse.papyrus.uml.diagram.timing.part.UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/CreateTimingDiagramWithNavigationHandler.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/CreateTimingDiagramWithNavigationHandler.java
deleted file mode 100644
index 8855b26a55b..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/CreateTimingDiagramWithNavigationHandler.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom;
-
-import org.eclipse.papyrus.infra.gmfdiag.navigation.CreateDiagramWithNavigationHandler;
-
-public class CreateTimingDiagramWithNavigationHandler extends CreateDiagramWithNavigationHandler {
-
- public CreateTimingDiagramWithNavigationHandler() {
- super(new CreateTimingDiagramCommand(), new TimingDiagramCreationCondition());
- }
-
-}
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
deleted file mode 100644
index 77599c26567..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/LifelineVerticalLabelCellEditorLocator.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom;
-
-import org.eclipse.draw2d.FigureUtilities;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.LifelineVerticalLabel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Text;
-
-public class LifelineVerticalLabelCellEditorLocator implements CellEditorLocator {
-
- private final LifelineVerticalLabel figure;
-
- public LifelineVerticalLabelCellEditorLocator(final LifelineVerticalLabel figure) {
- this.figure = figure;
- }
-
- public void relocate(final CellEditor celleditor) {
- 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()) {
- 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()))) {
- 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
deleted file mode 100644
index 9f03e2f79a9..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/Messages.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-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
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
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
deleted file mode 100644
index 8d5c9eddacf..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/OperationForbiddenException.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-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() {
- super();
- }
-
- public OperationForbiddenException(final String message) {
- super(message);
- }
-}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/SwitchLifelineAction.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/SwitchLifelineAction.java
deleted file mode 100644
index 9e7341ad8b7..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/SwitchLifelineAction.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.SwitchLifelineCommand;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-public class SwitchLifelineAction implements IObjectActionDelegate {
-
- public final static String ID = "org.eclipse.papyrus.uml.diagram.timing.custom.SwitchLifelineActionID"; //$NON-NLS-1$
-
- public void run(final IAction action) {
- final SwitchLifelineCommand handler = new SwitchLifelineCommand();
- try {
- handler.execute(null);
- } catch (final ExecutionException e) {
- Activator.log.error("Error switching lifeline", e); //$NON-NLS-1$
- }
-
- }
-
- public void selectionChanged(final IAction action, final ISelection selection) {
- // nothing
-
- }
-
- public void setActivePart(final IAction action, final IWorkbenchPart targetPart) {
- // nothing
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/TimingDiagramCreationCondition.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/TimingDiagramCreationCondition.java
deleted file mode 100644
index ccb59f22bb9..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/TimingDiagramCreationCondition.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.infra.core.extension.commands.PerspectiveContextDependence;
-
-/** Checks if a Timing diagram can be added to the selected element. */
-public class TimingDiagramCreationCondition extends PerspectiveContextDependence {
-
- /**
- * @return whether the diagram can be created.
- */
- @Override
- public boolean create(final EObject selectedElement) {
- return true;
-
- // FIXME: condition?
-
- // if (super.create(selectedElement)) {
- // return selectedElement instanceof org.eclipse.uml2.uml.Package;
- // }
- // return false;
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/TimingDiagramEditorFactory.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/TimingDiagramEditorFactory.java
deleted file mode 100644
index 4631d65f045..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/TimingDiagramEditorFactory.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom;
-
-import org.eclipse.papyrus.infra.gmfdiag.common.GmfEditorFactory;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.TimingDiagramEditPart;
-
-public class TimingDiagramEditorFactory extends GmfEditorFactory {
-
- public TimingDiagramEditorFactory() {
- super(UmlTimingDiagramForMultiEditor.class, TimingDiagramEditPart.MODEL_ID);
-
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/UmlTimingDiagramForMultiEditor.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/UmlTimingDiagramForMultiEditor.java
deleted file mode 100644
index d70fee9babf..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/UmlTimingDiagramForMultiEditor.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.emf.common.ui.URIEditorInput;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.papyrus.infra.core.editor.BackboneException;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
-import org.eclipse.papyrus.uml.diagram.timing.part.UMLDiagramEditorPlugin;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.PartInitException;
-
-/** An editor to be used in multitabs editor. This editor extends the original UML Diagram. */
-public class UmlTimingDiagramForMultiEditor extends org.eclipse.papyrus.uml.diagram.timing.part.UMLDiagramEditor {
-
- /** The location of diagram icon in the plug-in */
- private static final String DIAG_IMG_PATH = "icons/obj16/Diagram_Timing.gif"; //$NON-NLS-1$
-
- /** The image descriptor of the diagram icon */
- private static final ImageDescriptor DIAG_IMG_DESC = UMLDiagramEditorPlugin.getBundledImageDescriptor(UmlTimingDiagramForMultiEditor.DIAG_IMG_PATH);
-
- /** The editor splitter. */
- private Composite splitter;
-
- /**
- * Constructor for SashSystem v2. Context and required objects are retrieved from the ServiceRegistry.
- *
- * @throws BackboneException
- * @throws ServiceException
- *
- */
- public UmlTimingDiagramForMultiEditor(final ServicesRegistry servicesRegistry, final Diagram diagram) throws BackboneException, ServiceException {
- super(servicesRegistry, diagram);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void init(final IEditorSite site, final IEditorInput input) throws PartInitException {
- super.init(site, input);
- setPartName(getDiagram().getName());
- setTitleImage(DIAG_IMG_DESC.createImage());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void setInput(final IEditorInput input) {
- try {
- // Provide an URI with fragment in order to reuse the same Resource
- // and set the diagram to the fragment.
- final URIEditorInput uriInput = new URIEditorInput(EcoreUtil.getURI(getDiagram()));
- doSetInput(uriInput, true);
- } catch (final CoreException x) {
- final String title = Messages.UmlTimingDiagramForMultiEditor_editorOpeningErrorTitle;
- final String msg = Messages.UmlTimingDiagramForMultiEditor_editorOpeningErrorMessage;
- final Shell shell = getSite().getShell();
- ErrorDialog.openError(shell, title, msg, x.getStatus());
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createGraphicalViewer(final Composite parent) {
- this.splitter = parent;
- super.createGraphicalViewer(parent);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void setFocus() {
- this.splitter.setFocus();
- super.setFocus();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getEditingDomainID() {
- return "org.eclipse.papyrus.uml.diagram.timing.EditingDomain"; //$NON-NLS-1$
- }
-}
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
deleted file mode 100644
index 45000ab0f89..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/AbstractChangeLifelineTypeCommand.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands;
-
-import java.util.Collections;
-import java.util.Iterator;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.LifelineUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.LifelineUtils.LifelineType;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.ViewUtils;
-import org.eclipse.papyrus.uml.diagram.timing.providers.UMLViewProvider;
-import org.eclipse.uml2.uml.Lifeline;
-
-public abstract class AbstractChangeLifelineTypeCommand extends AbstractTransactionalCommand {
-
- protected IGraphicalEditPart lifelineEditPart;
-
- /**
- * Constructor of this command
- *
- * @param domain
- * the transactional editing domain to execute the transaction
- * @param lifelineEditPart
- * the editpart that will be transformed
- * @param changeLifelineFromCompactToFull_commandLabel
- */
- public AbstractChangeLifelineTypeCommand(final TransactionalEditingDomain domain, final IGraphicalEditPart lifelineEditPart, final String commandLabel) {
- super(domain, commandLabel, Collections.EMPTY_LIST);
- this.lifelineEditPart = lifelineEditPart;
- }
-
- @Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final EditPart parentEditPart = this.lifelineEditPart.getParent();
- // creation of the node
- final UMLViewProvider umlViewProvider = new UMLViewProvider();
- final Lifeline lifeline = (Lifeline)this.lifelineEditPart.resolveSemanticElement();
- final View view = this.lifelineEditPart.getNotationView();
- 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());
- // copy all EAnnotations
- final Iterator<EAnnotation> iter = this.lifelineEditPart.getNotationView().getEAnnotations().iterator();
- while(iter.hasNext()) {
- final EAnnotation annotation = EcoreUtil.copy(iter.next());
- lifelineNode.getEAnnotations().add(annotation);
- }
- LifelineUtils.setLifelineType(lifeline, getTargetLifelineType());
-
- // select the new Lifeline View
- parentEditPart.refresh();
- ViewUtils.selectInViewer(lifelineNode, parentEditPart.getViewer());
-
- return CommandResult.newOKCommandResult(lifelineNode);
- }
-
- protected abstract LifelineType getTargetLifelineType();
-
- protected abstract Node createTargetLifelineView(final UMLViewProvider umlViewProvider, final Lifeline lifeline, final View containerView, final int index);
-}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/AbstractRefreshCommand.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/AbstractRefreshCommand.java
deleted file mode 100644
index fb13cae6ca7..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/AbstractRefreshCommand.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands;
-
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.RootEditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.papyrus.infra.gmfdiag.common.helper.DiagramHelper;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Refresh the {@link IFigure} of a given {@link GraphicalEditPart}.
- */
-public abstract class AbstractRefreshCommand extends Command {
-
- private final GraphicalEditPart editPartToRefresh;
-
- private final RootEditPart rootEditPart;
-
- public AbstractRefreshCommand(final GraphicalEditPart editPartToRefresh) {
- this.editPartToRefresh = editPartToRefresh;
- this.rootEditPart = editPartToRefresh.getRoot();
- }
-
- public GraphicalEditPart getEditPartToRefresh() {
- return this.editPartToRefresh;
- }
-
- protected void refresh() {
- Display.getDefault().asyncExec(new Runnable() {
-
- public void run() {
- if(AbstractRefreshCommand.this.editPartToRefresh.isActive()) {
- DiagramHelper.refresh(AbstractRefreshCommand.this.editPartToRefresh, true);
- // this is needed in order to update the bounds of the Figures from their layout manager constraints
- AbstractRefreshCommand.this.editPartToRefresh.getFigure().invalidateTree();
- } else if(AbstractRefreshCommand.this.rootEditPart.isActive()) {
- /*
- * If the EditPart we needed to refresh is not active anymore, then it probably means that we undid its
- * creation, and re-created the object as part of a redo, with a different EditPart. In this case, just
- * refresh everything.
- */
- DiagramHelper.refresh(AbstractRefreshCommand.this.rootEditPart, true);
- }
- }
- });
- }
-}
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
deleted file mode 100644
index 5ffe7ffd3fd..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/AddOccurrenceSpecificationInCompactLifelineCommand.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.Location;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.NotationFactory;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.Messages;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.OccurrenceSpecificationUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineCompartmentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactStateInvariantEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.providers.UMLViewProvider;
-import org.eclipse.uml2.uml.Lifeline;
-import org.eclipse.uml2.uml.OccurrenceSpecification;
-import org.eclipse.uml2.uml.StateInvariant;
-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
- * @param location
- * 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);
- this.compactStateInvariantEditPartCN = compactStateInvariantEditPartCN;
- this.location = location;
- 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();
- 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 View timelineCompartmentView = (View)timelineCompartmentEditPart.getModel();
-
- // translate the coordinates
- final Point pt = new Point(this.location);
- timelineCompartmentEditPart.getFigure().translateToRelative(pt);
- pt.translate(timelineCompartmentEditPart.getFigure().getBounds().getTopLeft().getNegated());
-
- // find where to insert the OccurrenceSpecification
- 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);
- final EObject element = view.getElement();
- insertionIndexInFragments = this.lifeline.getInteraction().getFragments().indexOf(element);
- insertionIndexInCoveredBys = this.lifeline.getCoveredBys().indexOf(element);
- } else {
- insertionIndexInFragments = -1;
- insertionIndexInCoveredBys = -1;
- }
-
- // create the occurrence specification at the right index
- final OccurrenceSpecification newOccurrenceSpecification = UMLFactory.eINSTANCE.createOccurrenceSpecification();
- if(insertionIndexInFragments == -1) {
- this.lifeline.getInteraction().getFragments().add(newOccurrenceSpecification);
- } else {
- this.lifeline.getInteraction().getFragments().add(insertionIndexInFragments, newOccurrenceSpecification);
- }
- if(insertionIndexInCoveredBys == -1) {
- this.lifeline.getCoveredBys().add(newOccurrenceSpecification);
- } else {
- this.lifeline.getCoveredBys().add(insertionIndexInCoveredBys, newOccurrenceSpecification);
- }
-
- // 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 Location loc = NotationFactory.eINSTANCE.createLocation();
- loc.setX(pt.x);
- loc.setY(pt.y);
- occurrenceSpecificationView.setLayoutConstraint(loc);
-
- return CommandResult.newOKCommandResult(newOccurrenceSpecification);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/ChangeLifelineFromCompactToFull.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/ChangeLifelineFromCompactToFull.java
deleted file mode 100644
index 5c3ca61760d..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/ChangeLifelineFromCompactToFull.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands;
-
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.Messages;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.LifelineUtils.LifelineType;
-import org.eclipse.papyrus.uml.diagram.timing.providers.UMLViewProvider;
-import org.eclipse.uml2.uml.Lifeline;
-
-public class ChangeLifelineFromCompactToFull extends AbstractChangeLifelineTypeCommand {
-
- public ChangeLifelineFromCompactToFull(final TransactionalEditingDomain domain, final IGraphicalEditPart lifelineView) {
- super(domain, lifelineView, Messages.ChangeLifelineFromCompactToFull_commandLabel);
- }
-
- @Override
- protected LifelineType getTargetLifelineType() {
- return LifelineType.full;
- }
-
- @Override
- protected Node createTargetLifelineView(final UMLViewProvider umlViewProvider, final Lifeline lifeline, final View containerView, final int index) {
- return umlViewProvider.createLifeline_19(lifeline, containerView, index, true, this.lifelineEditPart.getDiagramPreferencesHint());
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/ChangeLifelineFromFullToCompact.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/ChangeLifelineFromFullToCompact.java
deleted file mode 100644
index e01c4e87be2..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/ChangeLifelineFromFullToCompact.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands;
-
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.Messages;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.LifelineUtils.LifelineType;
-import org.eclipse.papyrus.uml.diagram.timing.providers.UMLViewProvider;
-import org.eclipse.uml2.uml.Lifeline;
-
-public class ChangeLifelineFromFullToCompact extends AbstractChangeLifelineTypeCommand {
-
- public ChangeLifelineFromFullToCompact(final TransactionalEditingDomain domain, final IGraphicalEditPart lifelineView) {
- super(domain, lifelineView, Messages.ChangeLifelineFromFullToCompact_commandLabel);
- }
-
- @Override
- protected LifelineType getTargetLifelineType() {
- return LifelineType.compact;
- }
-
- @Override
- protected Node createTargetLifelineView(final UMLViewProvider umlViewProvider, final Lifeline lifeline, final View containerView, final int index) {
- return umlViewProvider.createLifeline_20(lifeline, containerView, index, true, this.lifelineEditPart.getDiagramPreferencesHint());
- }
-}
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
deleted file mode 100644
index 638957b0d83..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CreateTickCommand.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.handlers.GraphicalCommandHandler;
-import org.eclipse.papyrus.uml.diagram.timing.custom.Messages;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.TickUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.TimeRulerUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.ViewUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.DestructionOccurrenceSpecificationEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.MessageOccurrenceSpecificationEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.OccurrenceSpecificationEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.providers.UMLViewProvider;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.uml2.uml.OccurrenceSpecification;
-
-public class CreateTickCommand extends GraphicalCommandHandler {
-
- @Override
- 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));
- }
- }
- }
- return cmd;
- }
-
- private static Command attachTick(final GraphicalEditPart osEditPart) {
- final IGraphicalEditPart tickContainer = TimeRulerUtils.findClosestTimeRuler(osEditPart);
- 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 TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(osEditPart.getEditingDomain());
- 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)) {
- 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();
- final Node tickNode = umlViewProvider.createNode_26(null, tickContainerView, ViewUtil.APPEND, true, osEditPart.getDiagramPreferencesHint());
- TickUtils.associateTickNodeToOccurrenceNode(tickNode, osView, false);
- tickContainer.refresh();
- ViewUtils.performEditRequest(tickNode, osEditPart.getViewer());
- return CommandResult.newOKCommandResult(tickNode);
- }
- };
- return new ICommandProxy(createTickCommand);
- }
-}
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
deleted file mode 100644
index c7bb7f9abb5..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomDurationConstraintCreateCommand.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.parts.AbstractTwoPointCreationTool;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EcoreUtils;
-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.NamedElement;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLFactory;
-
-public class CustomDurationConstraintCreateCommand extends EditElementCommand {
-
- public CustomDurationConstraintCreateCommand(final CreateElementRequest req) {
- super(req.getLabel(), null, req);
- }
-
- @Override
- public boolean canExecute() {
- return true;
- }
-
- @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 DurationConstraint durationConstraint = UMLFactory.eINSTANCE.createDurationConstraint();
- 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) {
- 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) {
- durationConstraint.getConstrainedElements().add(firstTargetElement);
- } else {
- durationConstraint.getConstrainedElements().add(firstTargetElement);
- durationConstraint.getConstrainedElements().add(secondTargetElement);
- durationConstraint.getFirstEvents().add(Boolean.TRUE);
- durationConstraint.getFirstEvents().add(Boolean.FALSE);
- }
-
- final DurationInterval durationInterval = UMLFactory.eINSTANCE.createDurationInterval();
- durationConstraint.setSpecification(durationInterval);
-
- final Duration minTime = UMLFactory.eINSTANCE.createDuration();
- final Duration maxTime = UMLFactory.eINSTANCE.createDuration();
- containingPackage.getPackagedElements().add(minTime);
- containingPackage.getPackagedElements().add(maxTime);
- durationInterval.setMin(minTime);
- durationInterval.setMax(maxTime);
-
- final LiteralString minExpr = UMLFactory.eINSTANCE.createLiteralString();
- final LiteralString maxExpr = UMLFactory.eINSTANCE.createLiteralString();
- minTime.setExpr(minExpr);
- maxTime.setExpr(maxExpr);
- minExpr.setValue("d1"); //$NON-NLS-1$
- maxExpr.setValue("d2"); //$NON-NLS-1$
-
- request.setNewElement(durationConstraint);
- return CommandResult.newOKCommandResult(durationConstraint);
- }
-}
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
deleted file mode 100644
index ef85b9bd198..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomDurationObservationCreateCommand.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.parts.AbstractTwoPointCreationTool;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EcoreUtils;
-import org.eclipse.uml2.uml.DurationObservation;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLFactory;
-
-public class CustomDurationObservationCreateCommand extends EditElementCommand {
-
- public CustomDurationObservationCreateCommand(final CreateElementRequest req) {
- super(req.getLabel(), null, req);
- }
-
- @Override
- public boolean canExecute() {
- return true;
- }
-
- @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 DurationObservation durationObservation = UMLFactory.eINSTANCE.createDurationObservation();
- 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) {
- 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) {
- durationObservation.getEvents().add(firstTargetElement);
- } else {
- durationObservation.getEvents().add(firstTargetElement);
- durationObservation.getEvents().add(secondTargetElement);
- durationObservation.getFirstEvents().add(Boolean.TRUE);
- durationObservation.getFirstEvents().add(Boolean.FALSE);
- }
-
- request.setNewElement(durationObservation);
- return CommandResult.newOKCommandResult(durationObservation);
- }
-}
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
deleted file mode 100644
index 4a9dc0661dc..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomGeneralOrderingCreateCommand.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.parts.AbstractTwoPointCreationTool;
-import org.eclipse.uml2.uml.GeneralOrdering;
-import org.eclipse.uml2.uml.OccurrenceSpecification;
-import org.eclipse.uml2.uml.UMLFactory;
-
-public class CustomGeneralOrderingCreateCommand extends EditElementCommand {
-
- public CustomGeneralOrderingCreateCommand(final CreateElementRequest req) {
- super(req.getLabel(), null, req);
- }
-
- @Override
- public boolean canExecute() {
- return true;
- }
-
- @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 GeneralOrdering generalOrdering = UMLFactory.eINSTANCE.createGeneralOrdering();
- final OccurrenceSpecification beforeOccurrence = (OccurrenceSpecification)((View)firstTarget.getModel()).getElement();
- final OccurrenceSpecification afterOccurrence = (OccurrenceSpecification)((View)secondTarget.getModel()).getElement();
-
- beforeOccurrence.getGeneralOrderings().add(generalOrdering);
- generalOrdering.setBefore(beforeOccurrence);
- generalOrdering.setAfter(afterOccurrence);
- beforeOccurrence.getToAfters().add(generalOrdering);
-
- return CommandResult.newOKCommandResult(generalOrdering);
- }
-}
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
deleted file mode 100644
index 567b3ebfe8b..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomMessageCreateCommand.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EcoreUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.MessageUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.OccurrenceSpecificationUtils;
-import org.eclipse.uml2.uml.DestructionOccurrenceSpecification;
-import org.eclipse.uml2.uml.Gate;
-import org.eclipse.uml2.uml.Interaction;
-import org.eclipse.uml2.uml.Lifeline;
-import org.eclipse.uml2.uml.Message;
-import org.eclipse.uml2.uml.MessageEnd;
-import org.eclipse.uml2.uml.MessageKind;
-import org.eclipse.uml2.uml.MessageSort;
-import org.eclipse.uml2.uml.OccurrenceSpecification;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * Creates a Message between MessageOccurrenceSpecifications. Converts OccurrenceSpecifications to
- * MessageOccurrenceSpecifications if needed
- */
-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) {
- super(request.getLabel(), null, request);
- this.source = request.getSource();
- this.target = request.getTarget();
- this.messageKind = MessageUtils.getMessageKind(request.getElementType());
- this.messageSort = MessageUtils.getMessageSort(request.getElementType());
- this.interaction = EcoreUtils.getContaining(this.source, Interaction.class);
- }
-
- @Override
- public boolean canExecute() {
- 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)) {
- return false;
- }
- // no create message can target a destruction
- 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)) {
- return false;
- }
- } 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)) {
- return false;
- }
- } else if(this.target != null && !(MessageUtils.isPotentialMessageEnd(this.target))) {
- return false;
- }
- if(this.source == null) {
- return true; // link creation is in progress; source is not defined yet
- }
- if(this.interaction == null) {
- return false;
- }
- return true;
- }
-
- @Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- 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(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);
- // a "lost" message goes to nowhere
- final MessageEnd messageTarget = this.messageKind == MessageKind.LOST_LITERAL ? null : MessageUtils.convertToMessageOccurrenceSpecification(this.target, destruction);
-
- if(!MessageUtils.isValidMessage(this.messageSort, this.messageKind, messageSource, messageTarget)) {
- throw new ExecutionException("Invalid Message"); //$NON-NLS-1$
- }
-
- final Message newMessage = UMLFactory.eINSTANCE.createMessage();
- this.interaction.getMessages().add(newMessage);
- newMessage.setSendEvent(messageSource);
- newMessage.setReceiveEvent(messageTarget);
- newMessage.setMessageSort(this.messageSort);
- newMessage.setName(""); //$NON-NLS-1$
-
- ((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
deleted file mode 100644
index 27d6f58fc78..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomMessageReorientCommand.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.DropUtils;
-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.custom.utils.ViewUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.InteractionEditPartTN;
-import org.eclipse.uml2.uml.Message;
-import org.eclipse.uml2.uml.MessageEnd;
-import org.eclipse.uml2.uml.MessageKind;
-import org.eclipse.uml2.uml.MessageSort;
-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) {
- super(request.getLabel(), request.getRelationship(), request);
- this.viewer = viewer;
- this.reorientDirection = request.getDirection();
- this.newEnd = request.getNewRelationshipEnd();
- }
-
- @Override
- public boolean canExecute() {
- if(!(getElementToEdit() instanceof Message)) {
- return false;
- }
- final Message message = (Message)getElementToEdit();
-
- final EObject source;
- final EObject target;
- if(this.reorientDirection == ReorientRequest.REORIENT_SOURCE) {
- source = this.newEnd;
- target = message.getReceiveEvent();
- } else {
- source = message.getSendEvent();
- target = this.newEnd;
- }
- final MessageSort messageSort = message.getMessageSort();
- final MessageKind messageKind = message.getMessageKind();
- return MessageUtils.isValidMessage(messageSort, messageKind, source, target);
- }
-
- @Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- 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 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) {
- message.setSendEvent(newMessageEnd);
- } else if(reorientTarget) {
- message.setReceiveEvent(newMessageEnd);
- }
-
- 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(creation) {
- OccurrenceSpecificationUtils.deleteEverythingBefore((OccurrenceSpecification)newMessageEnd, null);
- }
- // re-create the Message View that was deleted by GMF
- for(final View parentInteractionView : parentInteractionViews) {
- DropUtils.getDropMessageCommand(message, parentInteractionView, this.viewer).execute(new NullProgressMonitor(), null);
- }
- }
-
- return CommandResult.newOKCommandResult(message);
- }
-
- 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) {
- final View interactionView = ViewUtils.findSuperViewWithId(view, InteractionEditPartTN.VISUAL_ID);
- if(interactionView != null) {
- interactionViews.add(interactionView);
- }
- }
- return interactionViews;
- }
-}
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
deleted file mode 100644
index 1cce0cd04f0..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomTimeConstraintCreateCommand.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.parts.CustomPaletteFactory;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EcoreUtils;
-import org.eclipse.uml2.uml.Interaction;
-import org.eclipse.uml2.uml.LiteralString;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.TimeConstraint;
-import org.eclipse.uml2.uml.TimeExpression;
-import org.eclipse.uml2.uml.TimeInterval;
-import org.eclipse.uml2.uml.UMLFactory;
-
-public class CustomTimeConstraintCreateCommand extends EditElementCommand {
-
- public CustomTimeConstraintCreateCommand(final CreateElementRequest req) {
- super(req.getLabel(), null, req);
- }
-
- @Override
- public boolean canExecute() {
- return true;
- }
-
- @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();
-
- // 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) {
- 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) {
- return CommandResult.newErrorCommandResult("The container must be in an Interaction"); //$NON-NLS-1$
- }
-
- containingInteraction.getOwnedRules().add(timeConstraint);
- timeConstraint.getConstrainedElements().clear();
- timeConstraint.getConstrainedElements().add(targetElement);
-
- final TimeInterval timeInterval = UMLFactory.eINSTANCE.createTimeInterval();
- timeConstraint.setSpecification(timeInterval);
-
- final TimeExpression minTime = UMLFactory.eINSTANCE.createTimeExpression();
- final TimeExpression maxTime = UMLFactory.eINSTANCE.createTimeExpression();
- containingPackage.getPackagedElements().add(minTime);
- containingPackage.getPackagedElements().add(maxTime);
- timeInterval.setMin(minTime);
- timeInterval.setMax(maxTime);
-
- final LiteralString minExpr = UMLFactory.eINSTANCE.createLiteralString();
- final LiteralString maxExpr = UMLFactory.eINSTANCE.createLiteralString();
- minTime.setExpr(minExpr);
- maxTime.setExpr(maxExpr);
- minExpr.setValue("t1"); //$NON-NLS-1$
- maxExpr.setValue("t2"); //$NON-NLS-1$
-
- ((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
deleted file mode 100644
index e0bc540df0d..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CustomTimeObservationCreateCommand.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.parts.CustomPaletteFactory;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EcoreUtils;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.TimeObservation;
-import org.eclipse.uml2.uml.UMLFactory;
-
-public class CustomTimeObservationCreateCommand extends EditElementCommand {
-
- public CustomTimeObservationCreateCommand(final CreateElementRequest req) {
- super(req.getLabel(), null, req);
- }
-
- @Override
- public boolean canExecute() {
- return true;
- }
-
- @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();
-
- // 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) {
- return CommandResult.newErrorCommandResult("The container must be in a Package"); //$NON-NLS-1$
- }
- containingPackage.getPackagedElements().add(timeObservation);
- timeObservation.setEvent(targetElement);
- ((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/CutAndInsertOccurrenceSpecificationCommand.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CutAndInsertOccurrenceSpecificationCommand.java
deleted file mode 100644
index ee17495e259..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CutAndInsertOccurrenceSpecificationCommand.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.Location;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.NotationFactory;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.Messages;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.LifelineUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.OccurrenceSpecificationUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.StateInvariantUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.ViewUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineTimelineCompartmentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullStateInvariantEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.providers.UMLViewProvider;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.uml2.uml.Lifeline;
-import org.eclipse.uml2.uml.OccurrenceSpecification;
-import org.eclipse.uml2.uml.StateInvariant;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/** This command cuts a StateInvariant in two at a given Location, and inserts an OccurrenceSpecification. */
-public class CutAndInsertOccurrenceSpecificationCommand extends AbstractTransactionalCommand {
-
- private final FullStateInvariantEditPartCN fullStateInvariantEditPartCN;
-
- private final Point location;
-
- private final FullLifelineEditPartCN lifelineEditPart;
-
- private final Lifeline lifeline;
-
- private final boolean destruction;
-
- /**
- * @param fullStateInvariantEditPartCN
- * the state invariant to cut in two
- * @param location
- * where the user clicked: the horizontal coordinate indicates where to insert the
- * OccurrenceSpecification
- * @param destruction
- * whether to create a DestructionOccurrenceSpecification
- */
- public CutAndInsertOccurrenceSpecificationCommand(final FullStateInvariantEditPartCN fullStateInvariantEditPartCN, final Point location, final boolean destruction) {
- super(getEditingDomain(fullStateInvariantEditPartCN), Messages.CutAndInsertOccurrenceSpecificationCommand_CreateOccurrenceSpecification, null);
- this.fullStateInvariantEditPartCN = fullStateInvariantEditPartCN;
- this.location = location;
- this.destruction = destruction;
- this.lifelineEditPart = (FullLifelineEditPartCN)EditPartUtils.findParentEditPartWithId(this.fullStateInvariantEditPartCN, FullLifelineEditPartCN.VISUAL_ID);
- this.lifeline = (Lifeline)((View)this.lifelineEditPart.getModel()).getElement();
- }
-
- private static TransactionalEditingDomain getEditingDomain(final FullStateInvariantEditPartCN fullStateInvariantEditPart) {
- final StateInvariant stateInvariant = (StateInvariant)((View)fullStateInvariantEditPart.getModel()).getElement();
- return TransactionUtil.getEditingDomain(stateInvariant);
- }
-
- @Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final FullLifelineTimelineCompartmentEditPartCN timelineCompartmentEditPart = (FullLifelineTimelineCompartmentEditPartCN)EditPartUtils.findFirstChildEditPartWithId(this.lifelineEditPart, FullLifelineTimelineCompartmentEditPartCN.VISUAL_ID);
- final View timelineCompartmentView = (View)timelineCompartmentEditPart.getModel();
- final View stateInvariantView = (View)this.fullStateInvariantEditPartCN.getModel();
- final StateInvariant firstStateInvariant = (StateInvariant)stateInvariantView.getElement();
-
- final int indexInFragments = this.lifeline.getInteraction().getFragments().indexOf(firstStateInvariant);
- final int indexInCoveredBys = this.lifeline.getCoveredBys().indexOf(firstStateInvariant);
- final int indexInCompartment = timelineCompartmentView.getChildren().indexOf(stateInvariantView);
-
- // create occurrence specification
- final OccurrenceSpecification newOccurrenceSpecification = this.destruction ? UMLFactory.eINSTANCE.createDestructionOccurrenceSpecification() : UMLFactory.eINSTANCE.createOccurrenceSpecification();
- OccurrenceSpecificationUtils.setAutogeneratedName(newOccurrenceSpecification, true);
- this.lifeline.getInteraction().getFragments().add(indexInFragments + 1, newOccurrenceSpecification);
- this.lifeline.getCoveredBys().add(indexInCoveredBys + 1, newOccurrenceSpecification);
-
- // create View for occurrence specification
- final UMLViewProvider umlViewProvider = new UMLViewProvider();
-
- final Node occurrenceSpecificationView;
- if(this.destruction) {
- occurrenceSpecificationView = umlViewProvider.createDestructionOccurrenceSpecification_27(newOccurrenceSpecification, timelineCompartmentView, indexInCompartment + 1, true, PreferencesHint.USE_DEFAULTS);
- } else {
- occurrenceSpecificationView = umlViewProvider.createOccurrenceSpecification_12(newOccurrenceSpecification, timelineCompartmentView, indexInCompartment + 1, true, PreferencesHint.USE_DEFAULTS);
- }
- final Location loc = NotationFactory.eINSTANCE.createLocation();
- final Point pt = new Point(this.location);
- timelineCompartmentEditPart.getFigure().translateToRelative(pt);
- pt.translate(timelineCompartmentEditPart.getFigure().getBounds().getTopLeft().getNegated());
- loc.setX(pt.x);
- loc.setY(pt.y);
- occurrenceSpecificationView.setLayoutConstraint(loc);
-
- if(this.destruction) {
- OccurrenceSpecificationUtils.deleteEverythingAfter(newOccurrenceSpecification, occurrenceSpecificationView);
- } else {
- // create a VerticalLine View to link the two StateInvariants
- umlViewProvider.createNode_39(null, timelineCompartmentView, indexInCompartment + 2, true, PreferencesHint.USE_DEFAULTS);
-
- // get first state invariant id
- final String id = StateInvariantUtils.getStateInvariantId(firstStateInvariant);
-
- // create a second state invariant with the same state id (on the same state)
- StateInvariantUtils.createStateInvariant(id, this.lifelineEditPart, indexInFragments + 2, indexInCoveredBys + 2, indexInCompartment + 3);
- }
-
- // update the names of the adjacent occurrences
- LifelineUtils.updateFragmentNames(this.lifeline, (View)this.lifelineEditPart.getModel());
-
- Display.getDefault().asyncExec(new Runnable() {
-
- public void run() {
- timelineCompartmentEditPart.refresh();
- ViewUtils.selectInViewer(occurrenceSpecificationView, CutAndInsertOccurrenceSpecificationCommand.this.lifelineEditPart.getViewer());
- }
- });
-
- return CommandResult.newOKCommandResult(newOccurrenceSpecification);
- }
-}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CutAndInsertOccurrenceSpecificationCompactLifelineCommand.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CutAndInsertOccurrenceSpecificationCompactLifelineCommand.java
deleted file mode 100644
index d7195c7150e..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/CutAndInsertOccurrenceSpecificationCompactLifelineCommand.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.Location;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.NotationFactory;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.Messages;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.LifelineUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.OccurrenceSpecificationUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.StateInvariantUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.ViewUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineCompartmentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactStateInvariantEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.providers.UMLViewProvider;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.uml2.uml.Lifeline;
-import org.eclipse.uml2.uml.OccurrenceSpecification;
-import org.eclipse.uml2.uml.StateInvariant;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * This command cuts a StateInvariant in two StateInvariants, with an OccurrenceSpecification in between the two
- * StateInvariants.
- */
-public class CutAndInsertOccurrenceSpecificationCompactLifelineCommand extends AbstractTransactionalCommand {
-
- private final CompactStateInvariantEditPartCN compactStateInvariantEditPartCN;
-
- private final Point location;
-
- private final CompactLifelineEditPartCN lifelineEditPart;
-
- private final Lifeline lifeline;
-
- private final boolean destruction;
-
- /**
- * @param fullStateInvariantEditPartCN
- * the state invariant to cut in two
- * @param location
- * where the user clicked: the horizontal coordinate indicates where to insert the
- * OccurrenceSpecification
- * @param destruction
- * whether to create a DestructionOccurrenceSpecification
- */
- public CutAndInsertOccurrenceSpecificationCompactLifelineCommand(final CompactStateInvariantEditPartCN compactStateInvariantEditPartCN, final Point location, final boolean destruction) {
- super(getEditingDomain(compactStateInvariantEditPartCN), Messages.CutAndInsertOccurrenceSpecificationCompactLifelineCommand_CreateOccurrenceSpecification, null);
- this.compactStateInvariantEditPartCN = compactStateInvariantEditPartCN;
- this.location = location;
- this.destruction = destruction;
- 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();
- 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 View timelineCompartmentView = (View)timelineCompartmentEditPart.getModel();
-
- // translate the coordinates
- final Point pt = new Point(this.location);
- timelineCompartmentEditPart.getFigure().translateToRelative(pt);
- pt.translate(timelineCompartmentEditPart.getFigure().getBounds().getTopLeft().getNegated());
-
- // find where to insert the OccurrenceSpecification
- int insertionIndexInCompartment = OccurrenceSpecificationUtils.findInsertionIndexFor(pt, timelineCompartmentView, timelineCompartmentEditPart.getViewer());
- int insertionIndexInFragments;
- int insertionIndexInCoveredBys;
- 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);
- } else {
- insertionIndexInFragments = -1;
- insertionIndexInCoveredBys = -1;
- }
-
- // create the occurrence specification at the right index
- final OccurrenceSpecification newOccurrenceSpecification = this.destruction ? UMLFactory.eINSTANCE.createDestructionOccurrenceSpecification() : UMLFactory.eINSTANCE.createOccurrenceSpecification();
- OccurrenceSpecificationUtils.setAutogeneratedName(newOccurrenceSpecification, true);
- if(insertionIndexInFragments == -1) {
- this.lifeline.getInteraction().getFragments().add(newOccurrenceSpecification);
- } else {
- this.lifeline.getInteraction().getFragments().add(insertionIndexInFragments, newOccurrenceSpecification);
- }
- if(insertionIndexInCoveredBys == -1) {
- this.lifeline.getCoveredBys().add(newOccurrenceSpecification);
- } else {
- this.lifeline.getCoveredBys().add(insertionIndexInCoveredBys, newOccurrenceSpecification);
- }
-
- // create the View for the occurrence specification
- final UMLViewProvider umlViewProvider = new UMLViewProvider();
-
- final Node occurrenceSpecificationView;
- if(this.destruction) {
- occurrenceSpecificationView = umlViewProvider.createDestructionOccurrenceSpecification_27(newOccurrenceSpecification, timelineCompartmentView, insertionIndexInCompartment, true, PreferencesHint.USE_DEFAULTS);
- } else {
- occurrenceSpecificationView = umlViewProvider.createOccurrenceSpecification_12(newOccurrenceSpecification, timelineCompartmentView, insertionIndexInCompartment, true, PreferencesHint.USE_DEFAULTS);
- }
-
- final Location loc = NotationFactory.eINSTANCE.createLocation();
- loc.setX(pt.x);
- loc.setY(pt.y);
- occurrenceSpecificationView.setLayoutConstraint(loc);
-
- if(this.destruction) {
- OccurrenceSpecificationUtils.deleteEverythingAfter(newOccurrenceSpecification, occurrenceSpecificationView);
- } else {
- // increase the indices for inserting the state invariant (don't increase -1 since it means "at the end")
- if(insertionIndexInFragments != -1) {
- insertionIndexInFragments++;
- }
- if(insertionIndexInCoveredBys != -1) {
- insertionIndexInCoveredBys++;
- }
- if(insertionIndexInCompartment != -1) {
- insertionIndexInCompartment++;
- }
-
- // create a new state invariant
- StateInvariantUtils.createCompactStateInvariant(timelineCompartmentView, insertionIndexInFragments, insertionIndexInCoveredBys, insertionIndexInCompartment);
- }
-
- LifelineUtils.updateFragmentNames(this.lifeline, null);
-
- Display.getDefault().asyncExec(new Runnable() {
-
- public void run() {
- timelineCompartmentEditPart.refresh();
- ViewUtils.selectInViewer(occurrenceSpecificationView, CutAndInsertOccurrenceSpecificationCompactLifelineCommand.this.lifelineEditPart.getViewer());
- }
- });
-
- return CommandResult.newOKCommandResult(newOccurrenceSpecification);
- }
-
-}
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
deleted file mode 100644
index 2e06ea6c57d..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/DeleteStateDefinitionCommand.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.papyrus.uml.diagram.timing.custom.Messages;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.StateDefinitionUtils;
-import org.eclipse.uml2.uml.Lifeline;
-
-/**
- * This command removes the "semantic" part of a StateDefinition : the EAnnotation on the Lifeline.
- */
-public class DeleteStateDefinitionCommand extends AbstractTransactionalCommand {
-
- private final String id;
-
- private final Lifeline lifeline;
-
- /**
- * @param id
- * the id of the state definition to delete
- * @param lifeline
- * the lifeline
- * @param domain
- * the editing domain
- */
- public DeleteStateDefinitionCommand(final String id, final Lifeline lifeline, final TransactionalEditingDomain domain) {
- super(domain, Messages.DeleteStateDefinitionCommand_DeleteStateDefinition, null);
- this.id = id;
- this.lifeline = lifeline;
- }
-
- @Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- StateDefinitionUtils.removeStateDefinitionEAnnotationFromLifeline(this.id, this.lifeline);
- return CommandResult.newOKCommandResult();
- }
-}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/RefreshCommandForDo.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/RefreshCommandForDo.java
deleted file mode 100644
index 23b0cba7c26..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/RefreshCommandForDo.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands;
-
-import org.eclipse.gef.GraphicalEditPart;
-
-/**
- * Refresh the {@link IFigure} of a given {@link GraphicalEditPart} on execute and redo of this command. This command
- * must be placed at the end of a {@link CompoundCommand}, as the execute and redo are done in forward order.
- */
-public class RefreshCommandForDo extends AbstractRefreshCommand {
-
- public RefreshCommandForDo(final GraphicalEditPart editPartToRefresh) {
- super(editPartToRefresh);
- }
-
- @Override
- public void execute() {
- refresh();
- }
-
- @Override
- public void redo() {
- refresh();
- }
-}
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
deleted file mode 100644
index 8fafa31ecb0..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/RefreshCommandForUndo.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands;
-
-import org.eclipse.gef.GraphicalEditPart;
-
-/**
- * Refresh the {@link IFigure} of a given {@link GraphicalEditPart} on undo of this command. <br/>
- * <strong>This command must be created before the other ones in a CompoundCommand</strong> since the commands are
- * executed in reverse when undoing.
- */
-public class RefreshCommandForUndo extends AbstractRefreshCommand {
-
- public RefreshCommandForUndo(final GraphicalEditPart editPartToRefresh) {
- super(editPartToRefresh);
- }
-
- @Override
- public void undo() {
- refresh();
- }
-}
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
deleted file mode 100644
index 885f22fc316..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/SwitchLifelineCommand.java
+++ /dev/null
@@ -1,589 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.notation.DescriptionStyle;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.Location;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.NotationFactory;
-import org.eclipse.gmf.runtime.notation.Style;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.handlers.GraphicalCommandHandler;
-import org.eclipse.papyrus.uml.diagram.timing.custom.Messages;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts.CustomCompactLifelineCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.DropUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.StateDefinitionUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.StateInvariantUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.TickUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.TimeRulerUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.Utils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.ViewUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FreeTimeRulerCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.TickNameEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.uml.diagram.timing.providers.UMLViewProvider;
-import org.eclipse.uml2.uml.DestructionOccurrenceSpecification;
-import org.eclipse.uml2.uml.DurationConstraint;
-import org.eclipse.uml2.uml.DurationObservation;
-import org.eclipse.uml2.uml.GeneralOrdering;
-import org.eclipse.uml2.uml.InteractionFragment;
-import org.eclipse.uml2.uml.Lifeline;
-import org.eclipse.uml2.uml.Message;
-import org.eclipse.uml2.uml.MessageOccurrenceSpecification;
-import org.eclipse.uml2.uml.OccurrenceSpecification;
-import org.eclipse.uml2.uml.StateInvariant;
-import org.eclipse.uml2.uml.TimeConstraint;
-import org.eclipse.uml2.uml.TimeObservation;
-import org.eclipse.uml2.uml.UMLPackage;
-
-public class SwitchLifelineCommand extends GraphicalCommandHandler {
-
- private Command switchLifeline(final IGraphicalEditPart lifelineEditPart) {
- final EditPartViewer viewer = lifelineEditPart.getViewer();
- final View lifelineView = (View)lifelineEditPart.getModel();
- final View timeRulerCompartmentView = ViewUtils.findTimeRulerCompartmentView(lifelineView);
- final boolean timeRulerVisible = timeRulerCompartmentView.isVisible();
- 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
- final Map<OccurrenceSpecification, List<Node>> ticksAssociations = computeAllTicksAssociations(lifelineView);
- // 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()));
- cc.add(new ICommandProxy(getNameUnnamedStateInvariants(lifeline)));
- final ICommand createCommand = new ChangeLifelineFromCompactToFull(getEditingDomain(), lifelineEditPart);
- cc.add(new ICommandProxy(createCommand));
- cc.add(new ICommandProxy(getFreeTimeRulerCreationCommand(createCommand, timeRulerVisible)));
- cc.add(new ICommandProxy(getStateDefinitionCreationForFullLifelineCommand(lifeline, createCommand)));
- cc.add(new ICommandProxy(getFragmentsCreationForFullLifelineCommand(lifeline, createCommand)));
- cc.add(new ICommandProxy(getTicksAssociationCommand(createCommand, ticksAssociations)));
- 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 ICommandProxy(getMessagesCreationCommand(createCommand, viewer)));
- cc.add(new ICommandProxy(getLinkedElementsCreationCommand(createCommand, viewer)));
- cc.add(new RefreshCommandForDo((GraphicalEditPart)lifelineEditPart.getParent()));
- return cc;
- } 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)));
- cc.add(new ICommandProxy(getFragmentsCreationForCompactLifelineCommand(lifeline, createCommand)));
- cc.add(new ICommandProxy(getTicksAssociationCommand(createCommand, ticksAssociations)));
- 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 ICommandProxy(getMessagesCreationCommand(createCommand, viewer)));
- cc.add(new ICommandProxy(getLinkedElementsCreationCommand(createCommand, viewer)));
- cc.add(new RefreshCommandForDo((GraphicalEditPart)lifelineEditPart.getParent()));
- return cc;
- }
- throw new IllegalArgumentException("expected a Lifeline edit part"); //$NON-NLS-1$
- }
-
- /** Compute the map of OccurrenceSpecifications to corresponding tick Views. */
- private static Map<OccurrenceSpecification, List<Node>> computeAllTicksAssociations(final View lifelineView) {
- final Map<OccurrenceSpecification, List<Node>> map = new HashMap<OccurrenceSpecification, List<Node>>();
- 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();
- final List<Node> associatedTickViews = TickUtils.getAssociatedTickViews(child);
- map.put(occurrenceSpecification, associatedTickViews);
- }
- }
- return map;
- }
-
- /**
- * Compute the map of OccurrenceSpecifications to corresponding tick names, for the ticks found in the given
- * Lifeline's time ruler.
- */
- private static Map<OccurrenceSpecification, String> computeLifelineTicksAssociations(final View lifelineView) {
- // there should be a single tick corresponding to an OccurrenceSpecification in this lifeline time ruler
- // hence this map from OccurrenceSpecification to a tick name
- final Map<OccurrenceSpecification, String> map = new HashMap<OccurrenceSpecification, String>();
- final View timeRulerCompartment = ViewUtils.findFirstChildViewWithId(lifelineView, FreeTimeRulerCompartmentEditPart.VISUAL_ID);
- @SuppressWarnings("unchecked")
- final EList<View> children = timeRulerCompartment.getChildren();
- for(final View tickView : children) {
- final Node associatedOccurrenceView = TickUtils.getAssociatedOccurrenceView(tickView);
- final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification)associatedOccurrenceView.getElement();
- final String description = getTickLabelDescription(tickView);
- map.put(occurrenceSpecification, description);
- }
- return map;
- }
-
- protected static void setTickLabelDescription(final Node tickNode, final String tickName) {
- final View labelView = ViewUtils.findFirstChildViewWithId(tickNode, TickNameEditPart.VISUAL_ID);
- 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;
- descriptionStyle.setDescription(tickName);
- }
- }
- }
- }
-
- private static String getTickLabelDescription(final View tickView) {
- final View labelView = ViewUtils.findFirstChildViewWithId(tickView, TickNameEditPart.VISUAL_ID);
- 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;
- return descriptionStyle.getDescription();
- }
- }
- }
- return ""; //$NON-NLS-1$
- }
-
- /** 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) {
- 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();
- final List<Node> tickNodes = ticksAssociations.get(occurrenceSpecification);
- if(tickNodes != null) {
- for(final Node tickNode : tickNodes) {
- TickUtils.associateTickNodeToOccurrenceNode(tickNode, (Node)child, true);
- }
- }
- }
- }
- return CommandResult.newOKCommandResult();
- }
- };
- }
-
- /** 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) {
- 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()) {
- 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);
- setTickLabelDescription(tickNode, tickName);
- TickUtils.associateTickNodeToOccurrenceNode(tickNode, occurrenceView, false);
- }
- return CommandResult.newOKCommandResult();
- }
- };
- }
-
- /** Find the View corresponding to the given OccurrenceSpecification in the given timeline compartment View */
- 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;
- }
- }
- return null;
- }
-
- /**
- * Unnamed state invariants cause issues because they have no attached StateDefinition, so we set a name and update
- * the StateDefinitions.
- */
- 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) {
- containsUnnamedStateInvariants = true;
- StateInvariantUtils.setInnerStateInvariantName(stateInvariant, Messages.SwitchLifelineCommand_unnamed);
- }
- }
- }
- if(containsUnnamedStateInvariants) {
- StateDefinitionUtils.updateStateDefinitionNamesForCompactLifeline(lifeline);
- }
- return CommandResult.newOKCommandResult();
- }
- };
- }
-
- private static void addDestroyViewsAndEdgesRecursivelyCommand(final CompoundCommand cc, final View view) {
- @SuppressWarnings("unchecked")
- final EList<View> children = view.getChildren();
- 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) {
- cc.add(new ICommandProxy(new DestroyElementCommand(new DestroyElementRequest(edge, false))));
- }
- 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))));
-
- }
-
- 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) {
- return CommandResult.newErrorCommandResult("Parent Lifeline not found"); //$NON-NLS-1$
- }
- 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 EList<InteractionFragment> coveredBys = lifeline.getCoveredBys();
- final Set<EObject> referencingElements = new HashSet<EObject>();
- 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;
- executeCommand(DropUtils.getDropMessageCommand(referencingMessage, lifelineView, viewer));
- }
- return CommandResult.newOKCommandResult();
- }
- };
- }
-
- 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) {
- 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 Lifeline lifeline = (Lifeline)lifelineView.getElement();
- final EList<InteractionFragment> coveredBys = lifeline.getCoveredBys();
- final Set<EObject> referencingElements = new HashSet<EObject>();
- 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;
- executeCommand(DropUtils.getDropTimeObservationCommand(timeObservation, lifelineView, viewer));
- } 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;
- executeCommand(DropUtils.getDropDurationObservationCommand(durationObservation, lifelineView, viewer));
- } 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;
- executeCommand(DropUtils.getDropGeneralOrderingCommand(generalOrdering, lifelineView, viewer));
- }
- }
- return CommandResult.newOKCommandResult();
- }
- };
- }
-
- 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) {
- 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) {
- 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);
- // restore the same id
- StateDefinitionUtils.setStateDefinitionViewID(stateDefinitionView, stateDefinitionId);
- // set the name on the View
- StateDefinitionUtils.setStateDefinitionName(stateDefinitionView, stateDefinitionName);
- }
-
- return CommandResult.newOKCommandResult();
- }
- };
- }
-
- 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) {
- return CommandResult.newErrorCommandResult("Parent Lifeline not found"); //$NON-NLS-1$
- }
- TimeRulerUtils.createFreeTimeRuler(lifelineView);
- final View timeRulerCompartmentView = ViewUtils.findTimeRulerCompartmentView(lifelineView);
- // restore the same visibility as before the switch
- timeRulerCompartmentView.setVisible(timeRulerVisible);
- return CommandResult.newOKCommandResult();
- }
- };
- }
-
- 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) {
- return CommandResult.newErrorCommandResult("Parent Lifeline not found"); //$NON-NLS-1$
- }
- final UMLViewProvider umlViewProvider = new UMLViewProvider();
- final View stateInvariantCompartmentView = ViewUtils.findCompactTimelineCompartmentView(lifelineView);
- String previousStateInvariantName = ""; //$NON-NLS-1$
- int indexInCompartment = 0;
- int x = CustomCompactLifelineCompartmentEditPart.FIRST_STATE_OFFSET;
- 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;
- final String stateInvariantName = StateInvariantUtils.getInnerStateInvariantName(stateInvariant);
- 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);
- 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);
- 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);
- indexInCompartment++;
- occurrenceSpecificationView.setLayoutConstraint(loc);
- x += 10;
- }
- }
-
- return CommandResult.newOKCommandResult();
- }
- };
- }
-
- 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) {
- return CommandResult.newErrorCommandResult("Parent Lifeline not found"); //$NON-NLS-1$
- }
- final View timelineCompartmentView = ViewUtils.findFullLifelineCompartmentView(lifelineView);
-
- final EList<InteractionFragment> fragments = lifeline.getCoveredBys();
- final UMLViewProvider umlViewProvider = new UMLViewProvider();
- int x = 20;
- boolean firstStateInvariant = true;
- String previousStateInvariantName = ""; //$NON-NLS-1$
- StateInvariant previousStateInvariant = null;
- boolean needStateInvariant = false;
- 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) {
- umlViewProvider.createStateInvariant_11(previousStateInvariant, timelineCompartmentView, -1, true, PreferencesHint.USE_DEFAULTS);
- }
-
- 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 String stateInvariantName = StateInvariantUtils.getInnerStateInvariantName(stateInvariant);
- if(Utils.safeEquals(stateInvariantName, previousStateInvariantName)) {
- x += 10;
- } else {
- x += 25;
- }
- // create the View for the state invariant
- umlViewProvider.createStateInvariant_11(stateInvariant, timelineCompartmentView, -1, true, PreferencesHint.USE_DEFAULTS);
- firstStateInvariant = false;
- previousStateInvariantName = stateInvariantName;
- previousStateInvariant = stateInvariant;
- needStateInvariant = false;
- } 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);
- occurrenceSpecificationView.setLayoutConstraint(loc);
- needStateInvariant = false;
- x += 10;
- } 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);
- occurrenceSpecificationView.setLayoutConstraint(loc);
- needStateInvariant = true;
- x += 10;
- } 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);
- occurrenceSpecificationView.setLayoutConstraint(loc);
- needStateInvariant = true;
- x += 10;
- }
- }
-
- // we always need the timeline to end with a StateInvariant
- if(needStateInvariant && previousStateInvariant != null) {
- umlViewProvider.createStateInvariant_11(previousStateInvariant, timelineCompartmentView, -1, true, PreferencesHint.USE_DEFAULTS);
- }
-
- return CommandResult.newOKCommandResult();
- }
- };
- }
-
- @Override
- 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) {
- cmd.add(switchLifeline(selectedElement));
- }
- }
- return cmd;
- }
-
- protected static void executeCommand(final ICommand command) throws ExecutionException {
- 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
deleted file mode 100644
index edb24a1c7b3..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/ToggleTimeRulerVisibility.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands;
-
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.handlers.GraphicalCommandHandler;
-import org.eclipse.papyrus.uml.diagram.timing.custom.Messages;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.CompactLifelineFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.FullLifelineFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.LifelineFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.FigureUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.ViewUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.InteractionEditPartTN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.LifelineEditPart;
-
-public class ToggleTimeRulerVisibility extends GraphicalCommandHandler {
-
- @Override
- protected Command getCommand() throws ExecutionException {
- final CompoundCommand cmd = new CompoundCommand(Messages.ToggleTimeRulerVisibility_ToggleTimeRulerVisibility);
- 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) {
- cmd.add(new RefreshCommandForUndo(interactionEditPart));
- first = false;
- }
- }
- cmd.add(toggleTimeRulerVisibility(selectedEditPart));
- }
- }
- 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();
- }
- });
- }
-
- protected static final LifelineFigure getLifelineFigure(final IFigure figure) {
- LifelineFigure result = null;
- result = FigureUtils.findChildFigureInstance(figure, FullLifelineFigure.class);
- 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
deleted file mode 100644
index ceb23345c42..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/commands/ValidateInteractionCommand.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.papyrus.uml.diagram.timing.custom.Messages;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.ModelValidationUtils;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.uml2.uml.Interaction;
-
-public class ValidateInteractionCommand extends AbstractTransactionalCommand {
-
- private final Interaction interaction;
-
- private final boolean interactive;
-
- /**
- * @param domain
- * the editing domain
- * @param interaction
- * the interaction to validate
- * @param interactive
- * 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);
- this.interaction = interaction;
- this.interactive = interactive;
- }
-
- @Override
- 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();
- }
- });
- return result[0] ? CommandResult.newOKCommandResult() : CommandResult.newErrorCommandResult("Invalid model"); //$NON-NLS-1$
- }
-
- protected boolean validate() {
- return ModelValidationUtils.validate(this.interaction, true, this.interactive);
- }
-}
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
deleted file mode 100644
index 9a8ebc130f1..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactLifelineCompartmentEditPart.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.requests.CreateConnectionRequest;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.diagram.ui.layout.FreeFormLayoutEx;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.CompactStateFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.CrossFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.DimensioningArrowFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.GeneralOrderingHorizontalFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.SmallSquareFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.VerticalMarkFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.layouts.FillLayout;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.Constants;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.FigureUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineCompartmentEditPartCN;
-
-public class CustomCompactLifelineCompartmentEditPart extends CompactLifelineCompartmentEditPartCN {
-
- /**
- * This offset lets compact states align with full states, which appear after the state definition compartment
- * (which is 100 pixels wide)
- */
- public static final int FIRST_STATE_OFFSET = Constants.STATE_DEFINITIONS_WIDTH;
-
- public CustomCompactLifelineCompartmentEditPart(final View view) {
- super(view);
- }
-
- @Override
- public IFigure 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)) {
- container.getParent().setLayoutManager(new FillLayout());
- }
-
- // The grand-parent is a FreeformViewport, which lets its child expand outside of its clientArea, and
- // constantly resets the bounds (in org.eclipse.draw2d.FreeformViewport#readjustScrollBars)
- // So, layout based on the grand-parent's clientArea.
- final Rectangle clientArea = container.getParent().getClientArea();
- @SuppressWarnings("unchecked")
- final List<IFigure> children = container.getChildren();
- int x = clientArea.x + FIRST_STATE_OFFSET;
- final int centerY = clientArea.y + clientArea.height / 2;
- int currentStateInvariantX = 0;
- int currentStateInvariantWidth = 0;
- int currentStateInvariantHeight = 0;
- int lastOccurrenceX = 0;
- boolean currentStateInvariantInfinite = false;
-
- boolean destruction = false;
- int destructionX = Integer.MAX_VALUE;
- 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);
- destruction = true;
- destructionX = constraint.x;
- }
- }
-
- IFigure nextChild = null;
- for(int i = 0; i < children.size(); i++) {
- final IFigure child = children.get(i);
- if(i < children.size() - 1) {
- nextChild = children.get(i + 1);
- } else {
- nextChild = null;
- }
-
- final IFigure occurrenceFigure = getOccurrenceChild(child);
- 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);
-
- // This is the bounds that the user tries to set. We further constrain these bounds.
- final Rectangle constraint = (Rectangle)getConstraint(child);
-
- // OccurrenceSpecification, MessageOccurrenceSpecification or DestructionOccurrenceSpecification
- if(occurrenceFigure != null) {
- final Dimension preferredSize = occurrenceFigure.getPreferredSize();
-
- 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));
- x = constraint.x + preferredSize.width;
- } else {
- int posX = constraint.x;
- // make sure the OccurrenceSpecification stays
- // within the bounds of its containing StateInvariant
- posX = Math.max(posX, currentStateInvariantX - SmallSquareFigure.RADIUS);
- posX = Math.min(posX, currentStateInvariantX + currentStateInvariantWidth - SmallSquareFigure.RADIUS);
- // also make sure it doesn't appear before the previous occurrence
- posX = Math.max(posX, lastOccurrenceX);
-
- // 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 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)) {
- posY = topPos;
- } else {
- posY = bottomPos;
- }
- child.setBounds(new Rectangle(posX, posY, preferredSize.width, preferredSize.height));
- x = posX + preferredSize.width;
- lastOccurrenceX = x;
- }
- }
- // StateInvariant
- 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) {
- stateInvariantFigure.setInfinite(false);
- currentStateInvariantInfinite = false;
- width = ((Rectangle)getConstraint(nextStateChangeOccurrence)).x - x;
- } else if(destruction) {
- stateInvariantFigure.setInfinite(false);
- currentStateInvariantInfinite = false;
- width = destructionX - x;
- } else {
- stateInvariantFigure.setInfinite(true);
- currentStateInvariantInfinite = true;
- // if the StateInvariant is the last element, then it continues until the end
- width = clientArea.width - x;
- }
- child.setBounds(new Rectangle(x, centerY - height / 2, width, height));
- currentStateInvariantX = x;
- currentStateInvariantWidth = width;
- currentStateInvariantHeight = height;
- x += width;
- } 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) {
- // duration observation or constraint
- final Dimension size = dimensioningArrowFigure.getPreferredSize();
- 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) {
- // general ordering
- final Dimension size = generalOrderingHorizontalFigure.getPreferredSize();
- child.setBounds(new Rectangle(constraint.x, constraint.y, constraint.width, size.height));
- }
- }
- }
-
- @Override
- protected Dimension calculatePreferredSize(final IFigure container, final int wHint, final int hHint) {
- return new Dimension(-1, -1);
- }
- });
-
- return figure;
- }
-
- protected static IFigure getOccurrenceChild(final IFigure child) {
- IFigure occurrenceFigure = FigureUtils.findChildFigureInstance(child, SmallSquareFigure.class);
- 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++) {
- 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) {
- return figure1;
- }
- }
- return null;
- }
-
- /**
- * Hide the scrollbar
- *
- * @see http://wiki.eclipse.org/Papyrus_Developer_Guide/NoScrollbar
- */
- @Override
- protected void refreshVisuals() {
- super.refreshVisuals();
- ((ResizableCompartmentFigure)getFigure()).getScrollPane().setScrollBarVisibility(org.eclipse.draw2d.ScrollPane.NEVER);
- refreshBounds();
- }
-
- @Override
- public boolean isSelectable() {
- // No need to select the compartment.
- // This saves one click when selecting something inside.
- return false;
- }
-
- @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) {
- createConnectionRequest.setTargetEditPart(getParent());
- }
- return getParent().getCommand(request);
- } else if(RequestConstants.REQ_CONNECTION_END.equals(request.getType())) {
- if(createConnectionRequest.getSourceEditPart() instanceof CompactLifelineCompartmentEditPartCN) {
- createConnectionRequest.setSourceEditPart(getParent());
- }
- return getParent().getCommand(request);
- }
- }
- return super.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
deleted file mode 100644
index 3af3202be66..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactLifelineEditPartCN.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-import java.util.List;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.ConnectionAnchor;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.XYAnchor;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.ConnectionEditPart;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gef.requests.LocationRequest;
-import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.CompactLifelineFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.parts.FloatingMessageAnchor;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.Constants;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.FigureUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.MessageUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineEditPartCN;
-
-public class CustomCompactLifelineEditPartCN extends CompactLifelineEditPartCN {
-
- public CustomCompactLifelineEditPartCN(final View view) {
- super(view);
- }
-
- @Override
- public void setSelected(final int value) {
- super.setSelected(value);
- // set selection on figure
- final CompactLifelineFigure lifelineFigure = FigureUtils.findChildFigureInstance(getFigure(), CompactLifelineFigure.class);
- lifelineFigure.setSelected(value != EditPart.SELECTED_NONE);
- // repaint
- getFigure().getParent().repaint();
- }
-
- @Override
- protected NodeFigure createNodeFigure() {
- final NodeFigure nodeFigure = super.createNodeFigure();
- 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++) {
- final IFigure child = children.get(i);
- 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) {
- final Rectangle bounds = new Rectangle(clientArea);
- bounds.height = timeRulerHeight;
- bounds.y = clientArea.y + clientArea.height - timeRulerHeight;
- child.setBounds(bounds);
- } else {
- child.setBounds(new Rectangle(clientArea.x, clientArea.y + clientArea.height, clientArea.width, 0));
- }
- }
- }
- }
-
- @Override
- protected Dimension calculatePreferredSize(final IFigure container, final int wHint, final int hHint) {
- return new Dimension(-1, -1);
- }
- });
- return nodeFigure;
- }
-
- @Override
- 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());
- return super.handleDragStarted();
- }
- };
- }
-
- @Override
- public ConnectionAnchor getTargetConnectionAnchor(final ConnectionEditPart connEditPart) {
- return new FloatingMessageAnchor(connEditPart, new Point(15, -15));
- }
-
- @Override
- public ConnectionAnchor getSourceConnectionAnchor(final ConnectionEditPart connEditPart) {
- return new FloatingMessageAnchor(connEditPart, new Point(-15, 15));
- }
-
- /** Display feedback at the start location (where the create request was started) */
- @Override
- public ConnectionAnchor getTargetConnectionAnchor(final Request request) {
- if(request instanceof CreateRequest) {
- return new XYAnchor(MessageUtils.getLastStartLocation());
- }
- return super.getTargetConnectionAnchor(request);
- }
-
- /** Display feedback at the cursor location */
- @Override
- public ConnectionAnchor getSourceConnectionAnchor(final Request 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
deleted file mode 100644
index 364c5509d55..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactLifelineTimeRulerCompartmentEditPartCN.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.layouts.FillLayout;
-import org.eclipse.papyrus.uml.diagram.timing.custom.layouts.TimeRulerLayout;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineTimeRulerCompartmentEditPartCN;
-
-public class CustomCompactLifelineTimeRulerCompartmentEditPartCN extends CompactLifelineTimeRulerCompartmentEditPartCN implements EditPart {
-
- public CustomCompactLifelineTimeRulerCompartmentEditPartCN(final View view) {
- super(view);
- }
-
- @Override
- public IFigure createFigure() {
- final ResizableCompartmentFigure result = (ResizableCompartmentFigure)super.createFigure();
- result.setBorder(null);
- result.setTitleVisibility(false);
- result.setLayoutManager(new FillLayout());
- result.getContentPane().setLayoutManager(new TimeRulerLayout());
- return result;
- }
-
- /**
- * Hide the scrollbar
- *
- * @see http://wiki.eclipse.org/Papyrus_Developer_Guide/NoScrollbar
- */
- @Override
- protected void refreshVisuals() {
- super.refreshVisuals();
- ((ResizableCompartmentFigure)getFigure()).getScrollPane().setScrollBarVisibility(org.eclipse.draw2d.ScrollPane.NEVER);
- refreshBounds();
- }
-
- @Override
- public boolean isSelectable() {
- // No need to select the compartment.
- // This saves one click when selecting something inside.
- return false;
- }
-}
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
deleted file mode 100644
index 9f0faf04bfc..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactStateInvariantEditPartCN.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.requests.LocationRequest;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
-import org.eclipse.papyrus.uml.diagram.timing.custom.Messages;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.CutAndInsertOccurrenceSpecificationCompactLifelineCommand;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies.AbstractTimelineLayoutPolicy;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.SmallSquareFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineCompartmentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactStateInvariantEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.StateInvariantAppliedStereotypeEditPart;
-import org.eclipse.uml2.uml.StateInvariant;
-
-public class CustomCompactStateInvariantEditPartCN extends CompactStateInvariantEditPartCN {
-
- public CustomCompactStateInvariantEditPartCN(final View view) {
- super(view);
- }
-
- @Override
- 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();
- 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 CompositeCommand compositeCommand = new CompositeCommand(Messages.CustomCompactStateInvariantEditPartCN_CreateOccurrenceSpecification);
- compositeCommand.add(new CutAndInsertOccurrenceSpecificationCompactLifelineCommand(this, loc, false));
- final EditPart timeline = EditPartUtils.findParentEditPartWithId(this, CompactLifelineCompartmentEditPartCN.VISUAL_ID);
- final Command updateLayoutCommand = timeline.getCommand(AbstractTimelineLayoutPolicy.UPDATE_LAYOUT_REQUEST);
- compositeCommand.add(new CommandProxy(updateLayoutCommand));
- editingDomain.getCommandStack().execute(new GMFtoEMFCommandWrapper(compositeCommand));
- } else {
- super.performRequest(request);
- }
- }
-
- @Override
- protected void addBorderItem(final IFigure borderItemContainer, final IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof StateInvariantAppliedStereotypeEditPart) {
- final BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH) {
-
- @Override
- public int getPreferredSideOfParent() {
- /*
- * Avoids an infinite layout bug that makes the UI thread freeze indefinitely, because
- * BorderItemLocator continuously switches from PositionConstants.TOP to PositionConstants.MIDDLE.
- */
- return PositionConstants.TOP;
- }
- };
- locator.setBorderItemOffset(new Dimension(-20, -20));
- borderItemContainer.add(borderItemEditPart.getFigure(), locator);
- } else {
- super.addBorderItem(borderItemContainer, borderItemEditPart);
- }
- }
-}
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
deleted file mode 100644
index 7e29568ca08..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomCompactStateInvariantNameEditPart.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-import org.eclipse.gef.Request;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.parsers.CompactStateInvariantNameParser;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactStateInvariantNameEditPart;
-
-public class CustomCompactStateInvariantNameEditPart extends CompactStateInvariantNameEditPart {
-
- private IParser parser;
-
- public CustomCompactStateInvariantNameEditPart(final View view) {
- super(view);
- }
-
- @Override
- public void performRequest(final Request request) {
- if(request.getType() == REQ_OPEN) {
- // double-click on the label is handled by the parent (to cut the CompactStateInvariant)
- getParent().performRequest(request);
- } else {
- super.performRequest(request);
- }
- }
-
- @Override
- public IParser getParser() {
- 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
deleted file mode 100644
index 68867e161a2..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomDestructionOccurrenceSpecificationEditPartCN.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-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.LayoutEditPolicyForLabel;
-import org.eclipse.papyrus.uml.diagram.timing.custom.parts.NoScrollNoBorderDragEditPartsTracker;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.DestructionOccurrenceSpecificationEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.DestructionOccurrenceSpecificationLabelEditPart;
-
-public class CustomDestructionOccurrenceSpecificationEditPartCN extends DestructionOccurrenceSpecificationEditPartCN {
-
- public CustomDestructionOccurrenceSpecificationEditPartCN(final View view) {
- super(view);
- }
-
- /**
- * The drag tracker has been specialized in order to constrain movement inside its container without scroll bar
- *
- * @see http://wiki.eclipse.org/Papyrus_Developer_Guide/NoScrollbar
- */
- @Override
- public DragTracker getDragTracker(final Request request) {
- return new NoScrollNoBorderDragEditPartsTracker(this);
- }
-
- /** Use {@link ExternalLabelPrimaryDragRoleEditPolicy} to display a link while dragging */
- @Override
- protected LayoutEditPolicy createLayoutEditPolicy() {
- return new LayoutEditPolicyForLabel(DestructionOccurrenceSpecificationLabelEditPart.VISUAL_ID);
- }
-}
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
deleted file mode 100644
index e26c8bffc85..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomDestructionOccurrenceSpecificationLabelEditPart.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.parsers.OccurrenceSpecificationNameParser;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.DestructionOccurrenceSpecificationLabelEditPart;
-
-public class CustomDestructionOccurrenceSpecificationLabelEditPart extends DestructionOccurrenceSpecificationLabelEditPart {
-
- private IParser parser;
-
- public CustomDestructionOccurrenceSpecificationLabelEditPart(final View view) {
- super(view);
- }
-
- @Override
- public IParser getParser() {
- 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
deleted file mode 100644
index 80af177a20d..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomDurationConstraintEditPart.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-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.LayoutEditPolicyForLabel;
-import org.eclipse.papyrus.uml.diagram.timing.custom.parts.NoScrollNoBorderDragEditPartsTracker;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.DurationConstraintEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.DurationConstraintSpecificationEditPart;
-
-public class CustomDurationConstraintEditPart extends DurationConstraintEditPartCN {
-
- public CustomDurationConstraintEditPart(final View view) {
- super(view);
- }
-
- /**
- * The drag tracker has been specialized in order to constrain movement inside its container without scroll bar
- *
- * @see http://wiki.eclipse.org/Papyrus_Developer_Guide/NoScrollbar
- */
- @Override
- public DragTracker getDragTracker(final Request request) {
- return new NoScrollNoBorderDragEditPartsTracker(this);
- }
-
- /** Use {@link ExternalLabelPrimaryDragRoleEditPolicy} to display a link while dragging */
- @Override
- protected LayoutEditPolicy createLayoutEditPolicy() {
- return new LayoutEditPolicyForLabel(DurationConstraintSpecificationEditPart.VISUAL_ID);
- }
-}
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
deleted file mode 100644
index 85f53e373ec..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomDurationObservationEditPart.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-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.LayoutEditPolicyForLabel;
-import org.eclipse.papyrus.uml.diagram.timing.custom.parts.NoScrollNoBorderDragEditPartsTracker;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.DurationObservationEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.DurationObservationNameEditPart;
-
-public class CustomDurationObservationEditPart extends DurationObservationEditPartCN {
-
- public CustomDurationObservationEditPart(final View view) {
- super(view);
- }
-
- /**
- * The drag tracker has been specialized in order to constrain movement inside its container without scroll bar
- *
- * @see http://wiki.eclipse.org/Papyrus_Developer_Guide/NoScrollbar
- */
- @Override
- public DragTracker getDragTracker(final Request request) {
- return new NoScrollNoBorderDragEditPartsTracker(this);
- }
-
- /** Use {@link ExternalLabelPrimaryDragRoleEditPolicy} to display a link while dragging */
- @Override
- protected LayoutEditPolicy createLayoutEditPolicy() {
- return new LayoutEditPolicyForLabel(DurationObservationNameEditPart.VISUAL_ID);
- }
-}
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
deleted file mode 100644
index 457f2e5b81d..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFreeTimeRulerCompartmentEditPart.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.figures.BorderedNodeFigure;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.diagram.ui.layout.FreeFormLayoutEx;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.InteractionRectangleFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.CompactLifelineFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.CrossFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.FullLifelineFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.SmallSquareFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.layouts.FillLayout;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.Constants;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.FigureUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.TickUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FreeTimeRulerCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.InteractionEditPartTN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.TickEditPart;
-
-public class CustomFreeTimeRulerCompartmentEditPart extends FreeTimeRulerCompartmentEditPart {
-
- public CustomFreeTimeRulerCompartmentEditPart(final View view) {
- super(view);
- }
-
- @Override
- public IFigure createFigure() {
- final ResizableCompartmentFigure result = (ResizableCompartmentFigure)super.createFigure();
- result.setTitleVisibility(false);
- result.setBorder(null);
- result.getScrollPane().setBorder(null);
- result.setLayoutManager(new FreeFormLayoutEx() {
-
- @Override
- public void layout(final IFigure container) {
- try {
- layoutTicks(container);
- } catch (final Exception e) {
- Activator.log.error("Error in ticks layout", e); //$NON-NLS-1$
- }
- }
- });
- return result;
- }
-
- /**
- * Hide the scrollbar
- *
- * @see http://wiki.eclipse.org/Papyrus_Developer_Guide/NoScrollbar
- */
- @Override
- protected void refreshVisuals() {
- super.refreshVisuals();
- ((ResizableCompartmentFigure)getFigure()).getScrollPane().setScrollBarVisibility(org.eclipse.draw2d.ScrollPane.NEVER);
- refreshBounds();
- }
-
- @Override
- public boolean isSelectable() {
- // No need to select the compartment.
- // This saves one click when selecting something inside.
- return false;
- }
-
- protected void layoutTicks(final IFigure container) {
- final EditPartViewer viewer = CustomFreeTimeRulerCompartmentEditPart.this.getRoot().getViewer();
-
- @SuppressWarnings("unchecked")
- final Map<IFigure, EditPart> visualPartMap = viewer.getVisualPartMap();
- final InteractionRectangleFigure interactionFigure = FigureUtils.findParentFigureInstance(container, InteractionRectangleFigure.class);
- final List<SmallSquareFigure> osFigures = FigureUtils.findChildFigureInstances(interactionFigure, SmallSquareFigure.class);
- final List<CrossFigure> destructionOSFigures = FigureUtils.findChildFigureInstances(interactionFigure, CrossFigure.class);
-
- final List<EditPart> osEditParts = new ArrayList<EditPart>();
-
- for(final SmallSquareFigure figure : osFigures) {
- final EditPart editPart = visualPartMap.get(FigureUtils.findParentFigureInstance(figure, BorderedNodeFigure.class));
- if(editPart != null) {
- osEditParts.add(editPart);
- }
- }
- for(final CrossFigure figure : destructionOSFigures) {
- final EditPart editPart = visualPartMap.get(FigureUtils.findParentFigureInstance(figure, BorderedNodeFigure.class));
- if(editPart != null) {
- osEditParts.add(editPart);
- }
- }
-
- // reset the layout so that the BorderItemsAwareFreeFormLayer fills its parent FreeformViewport
- if(!(container.getParent().getLayoutManager() instanceof FillLayout)) {
- container.getParent().setLayoutManager(new FillLayout());
- }
-
- // The grand-parent is a FreeformViewport, which lets its child expand outside of its clientArea, and
- // constantly resets the bounds (in org.eclipse.draw2d.FreeformViewport#readjustScrollBars)
- // So, layout based on the grand-parent's clientArea.
- // final Rectangle clientArea = container.getParent().getClientArea();
- @SuppressWarnings("unchecked")
- final List<IFigure> children = container.getChildren();
-
- 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) {
- 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 IGraphicalEditPart occurrenceSpecificationEditPart = TickUtils.findOccurrenceSpecificationEditPartFromTickEditPart(tickEditPart, viewer);
- if(occurrenceSpecificationEditPart != null) {
- final CompartmentEditPart timelineCompartment = EditPartUtils.findParentTimelineCompartment(occurrenceSpecificationEditPart);
- final GraphicalEditPart interactionEditPart = (InteractionEditPartTN)EditPartUtils.findParentEditPartWithId(timelineCompartment, InteractionEditPartTN.VISUAL_ID);
- final int startX;
- if(fullLifeline) {
- startX = Constants.STATE_DEFINITIONS_WIDTH + 1;
- } else if(compactLifeline) {
- startX = 1;
- } else {
- startX = timelineCompartment.getFigure().getBounds().x - interactionEditPart.getFigure().getBounds().x;
- }
- final Dimension markSize = verticalMarkFigure.getPreferredSize();
- final IFigure osFigure = occurrenceSpecificationEditPart.getFigure();
- final Rectangle osBounds = osFigure.getBounds();
- verticalMarkFigure.setBounds(new Rectangle(startX + osBounds.x - 1, 0, markSize.width, markSize.height));
- }
- }
- }
- }
-
-}
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
deleted file mode 100644
index bb5f4faf5a6..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFreeTimingRulerEditPart.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.ScrollPane;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.Request;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ShapeCompartmentFigure;
-import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.TimingRulerFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.layouts.FillLayout;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.FigureUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FreeTimingRulerEditPartCN;
-
-public class CustomFreeTimingRulerEditPart extends FreeTimingRulerEditPartCN {
-
- public CustomFreeTimingRulerEditPart(final View view) {
- super(view);
- }
-
- @Override
- 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());
- }
- 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());
- // ((ScrollPane) child).setBorder(null);
- ((ScrollPane)child).setScrollBarVisibility(org.eclipse.draw2d.ScrollPane.NEVER);
- // ((ScrollPane) child).getViewport().setBounds(container.getBounds());
- }
- }
- compartmentFigure.setBounds(container.getBounds());
- }
- }
- });
-
- return this.primaryShape;
- }
-
- @Override
- public boolean isSelectable() {
- return false;
- }
-
- @Override
- 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());
- return super.handleDragStarted();
- }
- };
- }
-}
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
deleted file mode 100644
index 10045576637..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullLifelineEditPartCN.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-import java.util.List;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.ConnectionAnchor;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.XYAnchor;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.ConnectionEditPart;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gef.requests.LocationRequest;
-import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.FullLifelineFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.parts.FloatingMessageAnchor;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.Constants;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.FigureUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.MessageUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineEditPartCN;
-
-public class CustomFullLifelineEditPartCN extends FullLifelineEditPartCN {
-
- public CustomFullLifelineEditPartCN(final View view) {
- super(view);
- }
-
- @Override
- public void setSelected(final int value) {
- super.setSelected(value);
- // set selection on figure
- final FullLifelineFigure lifelineFigure = FigureUtils.findChildFigureInstance(getFigure(), FullLifelineFigure.class);
- lifelineFigure.setSelected(value != EditPart.SELECTED_NONE);
- // repaint
- getFigure().getParent().repaint();
- }
-
- @Override
- protected NodeFigure createNodeFigure() {
- final NodeFigure nodeFigure = super.createNodeFigure();
- 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++) {
- final IFigure child = children.get(i);
- 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) {
- final Rectangle bounds = new Rectangle(clientArea);
- bounds.height = timeRulerHeight;
- bounds.y = clientArea.y + clientArea.height - timeRulerHeight;
- child.setBounds(bounds);
- } else {
- child.setBounds(new Rectangle(clientArea.x, clientArea.y + clientArea.height, clientArea.width, 0));
- }
- }
- }
- }
-
- @Override
- protected Dimension calculatePreferredSize(final IFigure container, final int wHint, final int hHint) {
- return new Dimension(-1, -1);
- }
- });
- return nodeFigure;
- }
-
- @Override
- 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());
- return super.handleDragStarted();
- }
- };
- }
-
- @Override
- public ConnectionAnchor getTargetConnectionAnchor(final ConnectionEditPart connEditPart) {
- return new FloatingMessageAnchor(connEditPart, new Point(20, -20));
- }
-
- @Override
- public ConnectionAnchor getSourceConnectionAnchor(final ConnectionEditPart connEditPart) {
- return new FloatingMessageAnchor(connEditPart, new Point(-20, 20));
- }
-
- /** Display feedback at the start location (where the create request was started) */
- @Override
- public ConnectionAnchor getTargetConnectionAnchor(final Request request) {
- if(request instanceof CreateRequest) {
- return new XYAnchor(MessageUtils.getLastStartLocation());
- }
- return super.getTargetConnectionAnchor(request);
- }
-
- /** Display feedback at the cursor location */
- @Override
- public ConnectionAnchor getSourceConnectionAnchor(final Request 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
deleted file mode 100644
index a58cc7cb9a9..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullLifelineStateDefinitionCompartmentEditPartCN.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.draw2d.XYLayout;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.Messages;
-import org.eclipse.papyrus.uml.diagram.timing.custom.layouts.FillLayout;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineStateDefinitionCompartmentEditPartCN;
-
-public class CustomFullLifelineStateDefinitionCompartmentEditPartCN extends FullLifelineStateDefinitionCompartmentEditPartCN {
-
- private WrappingLabel stateDefsAffordanceLabel;
-
- public CustomFullLifelineStateDefinitionCompartmentEditPartCN(final View view) {
- super(view);
- }
-
- @Override
- public IFigure createFigure() {
- final ResizableCompartmentFigure result = (ResizableCompartmentFigure)super.createFigure();
- result.setBorder(null);
- result.getScrollPane().getContents().setBorder(null);
-
- result.setLayoutManager(new StackLayout());
-
- // 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)) {
- container.getParent().setLayoutManager(new FillLayout());
- }
-
- // The grand-parent is a FreeformViewport, which lets its child expand outside of its clientArea, and
- // constantly resets the bounds (in org.eclipse.draw2d.FreeformViewport#readjustScrollBars)
- // So, layout based on the grand-parent's clientArea.
- final Rectangle clientArea = container.getParent().getClientArea();
- final int nChildren = container.getChildren().size();
- final int margin;
- final int spacing;
- if(nChildren == 1) {
- margin = clientArea.height / 2;
- spacing = 0;
- } else {
- margin = clientArea.height / (nChildren - 1) / 3;
- spacing = (clientArea.height - 2 * margin) / (nChildren - 1);
- }
-
- 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
- final int h = ps.height / 2;
- final int x = clientArea.x + clientArea.width / 2 - w / 2;
- final int y = clientArea.y + margin + spacing * i - h / 2;
- child.setBounds(new Rectangle(x, y, w, h));
- }
- }
-
- @Override
- protected Dimension calculatePreferredSize(final IFigure container, final int wHint, final int hHint) {
- return null;
- }
- });
- result.setTitleVisibility(false);
- createStateDefsAffordanceLabel(result);
- return result;
- }
-
- /**
- * Hide the scrollbar
- *
- * @see http://wiki.eclipse.org/Papyrus_Developer_Guide/NoScrollbar
- */
- @Override
- protected void refreshVisuals() {
- super.refreshVisuals();
- ((ResizableCompartmentFigure)getFigure()).getScrollPane().setScrollBarVisibility(org.eclipse.draw2d.ScrollPane.NEVER);
- refreshBounds();
- }
-
- @Override
- public boolean isSelectable() {
- // No need to select the compartment.
- // This saves one click when selecting something inside.
- return false;
- }
-
- /**
- * Display a Label when there are no StateDefinitions, so that the user knows that they must add at least a
- * StateDefinition.
- */
- private void createStateDefsAffordanceLabel(final IFigure parent) {
- this.stateDefsAffordanceLabel = new WrappingLabel();
- this.stateDefsAffordanceLabel.setTextWrap(true);
- this.stateDefsAffordanceLabel.setAlignment(PositionConstants.CENTER);
- this.stateDefsAffordanceLabel.setTextJustification(PositionConstants.CENTER);
- this.stateDefsAffordanceLabel.setText(Messages.CustomFullLifelineStateDefinitionCompartmentEditPartCN_AddStateDefinitionsHere);
- this.stateDefsAffordanceLabel.setForegroundColor(ColorConstants.gray);
- parent.add(this.stateDefsAffordanceLabel);
- this.stateDefsAffordanceLabel.setBounds(new Rectangle(parent.getBounds()));
- this.stateDefsAffordanceLabel.setVisible(false);
- }
-
- @Override
- protected void refreshChildren() {
- super.refreshChildren();
- this.stateDefsAffordanceLabel.setVisible(getChildren().size() == 0);
- }
-}
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
deleted file mode 100644
index 71fd2b5b84b..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullLifelineTimeRulerCompartmentEditPartCN.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.layouts.FillLayout;
-import org.eclipse.papyrus.uml.diagram.timing.custom.layouts.TimeRulerLayout;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineTimeRulerCompartmentEditPartCN;
-
-public class CustomFullLifelineTimeRulerCompartmentEditPartCN extends FullLifelineTimeRulerCompartmentEditPartCN implements EditPart {
-
- public CustomFullLifelineTimeRulerCompartmentEditPartCN(final View view) {
- super(view);
- }
-
- @Override
- public IFigure createFigure() {
- final ResizableCompartmentFigure result = (ResizableCompartmentFigure)super.createFigure();
- result.setBorder(null);
- result.setTitleVisibility(false);
- result.setLayoutManager(new FillLayout());
- result.getContentPane().setLayoutManager(new TimeRulerLayout());
- return result;
- }
-
- /**
- * Hide the scrollbar
- *
- * @see http://wiki.eclipse.org/Papyrus_Developer_Guide/NoScrollbar
- */
- @Override
- protected void refreshVisuals() {
- super.refreshVisuals();
- ((ResizableCompartmentFigure)getFigure()).getScrollPane().setScrollBarVisibility(org.eclipse.draw2d.ScrollPane.NEVER);
- refreshBounds();
- }
-
- @Override
- public boolean isSelectable() {
- // No need to select the compartment.
- // This saves one click when selecting something inside.
- return false;
- }
-}
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
deleted file mode 100644
index a80ee321816..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullLifelineTimelineCompartmentEditPartCN.java
+++ /dev/null
@@ -1,342 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.draw2d.FreeformViewport;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.requests.CreateConnectionRequest;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.diagram.ui.layout.FreeFormLayoutEx;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.CrossFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.DimensioningArrowFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.FullStateFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.FullStateInvariantVerticalLineFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.GeneralOrderingHorizontalFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.SmallSquareFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.VerticalMarkFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.layouts.FillLayout;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.FigureUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.StateDefinitionUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.StateInvariantUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineTimelineCompartmentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.StateDefinitionEditPart;
-import org.eclipse.uml2.uml.StateInvariant;
-
-public class CustomFullLifelineTimelineCompartmentEditPartCN extends FullLifelineTimelineCompartmentEditPartCN {
-
- public CustomFullLifelineTimelineCompartmentEditPartCN(final View view) {
- super(view);
- }
-
- @Override
- public IFigure 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)) {
- freeformViewport.setLayoutManager(new FillLayout());
- }
- // reset the origin if it changed (for example, clicking on a label partly
- // outside the compartment reveals it by scrolling)
- freeformViewport.setViewLocation(0, 0);
- }
-
- // The grand-parent is a FreeformViewport, which lets its child expand outside of its clientArea, and
- // constantly resets the bounds (in org.eclipse.draw2d.FreeformViewport#readjustScrollBars)
- // So, layout based on the grand-parent's clientArea.
- final Rectangle clientArea = container.getParent().getClientArea();
- @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));
- }
-
- /*
- * This is a 2-pass layout: first, layout the OccurrenceSpecifications and StateInvariants. Then, layout
- * the VerticalLines, which depend on the bounds of both its previous and following element
- * StateInvariants, and the time elements.
- */
- layoutOccurrenceSpecificationsAndStateInvariants(viewer, clientArea, children, constraints);
- layoutVerticalLinesAndTimeElements(children, clientArea, constraints);
- }
-
- @Override
- protected Dimension calculatePreferredSize(final IFigure container, final int wHint, final int hHint) {
- return new Dimension(-1, -1);
- }
- });
-
- return figure;
- }
-
- /**
- * Hide the scrollbar
- *
- * @see http://wiki.eclipse.org/Papyrus_Developer_Guide/NoScrollbar
- */
- @Override
- protected void refreshVisuals() {
- super.refreshVisuals();
- ((ResizableCompartmentFigure)getFigure()).getScrollPane().setScrollBarVisibility(org.eclipse.draw2d.ScrollPane.NEVER);
- refreshBounds();
- }
-
- @Override
- public boolean isSelectable() {
- // No need to select the compartment.
- // This saves one click when selecting something inside.
- return false;
- }
-
- @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) {
- createConnectionRequest.setTargetEditPart(getParent());
- }
- return getParent().getCommand(request);
- } else if(RequestConstants.REQ_CONNECTION_END.equals(request.getType())) {
- if(createConnectionRequest.getSourceEditPart() instanceof FullLifelineTimelineCompartmentEditPartCN) {
- createConnectionRequest.setSourceEditPart(getParent());
- }
- return getParent().getCommand(request);
- }
- }
- return super.getCommand(request);
- }
-
- /** First pass of the layout */
- protected static void layoutOccurrenceSpecificationsAndStateInvariants(final EditPartViewer viewer, final Rectangle clientArea, final List<IFigure> figures, final Rectangle[] constraints) {
-
- int x = clientArea.x;
- int y = -1;
- int prevY = -1;
- Rectangle nextConstraint = null;
- IFigure nextFigure = null;
- IFigure nextChildFigure = null;
- 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) {
- continue;
- }
-
- // This is the bounds that the user tries to set. We further constrain these bounds.
- final Rectangle constraint = constraints[i];
-
- nextConstraint = null;
- nextFigure = null;
- for(int j = i + 1; j < figures.size(); j++) {
- final IFigure f = figures.get(j);
- nextChildFigure = FigureUtils.findChildFigureInstance(f, FullStateFigure.class);
- if(nextChildFigure == null) {
- nextChildFigure = FigureUtils.findChildFigureInstance(f, SmallSquareFigure.class);
- }
- if(nextChildFigure == null) {
- nextChildFigure = FigureUtils.findChildFigureInstance(f, CrossFigure.class);
- }
- if(nextChildFigure != null) {
- nextConstraint = constraints[j];
- nextFigure = f;
- break;
- }
- }
-
- IFigure occurrenceFigure = null;
- if(smallSquareFigure != null) {
- occurrenceFigure = smallSquareFigure;
- } else if(crossFigure != null) {
- occurrenceFigure = crossFigure;
- }
-
- // OccurrenceSpecification, MessageOccurrenceSpecification or DestructionOccurrenceSpecification
- if(occurrenceFigure != null) {
- final int occurrenceY;
- if(y == -1) {
- // the Lifeline starts by an OccurrenceSpecification => align it with the following StateInvariant
- 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$
- occurrenceY = 10;
- }
- } else {
- occurrenceY = y;
- }
-
- // set the OccurrenceSpecification y-coordinate to the one from the previous StateInvariant
- // keep the x-coordinate as-is
- final Dimension preferredSize = occurrenceFigure.getPreferredSize();
- figure.setBounds(new Rectangle(constraint.x, occurrenceY - preferredSize.height / 2, preferredSize.width, preferredSize.height));
- x = constraint.x + preferredSize.width;
- }
-
- // StateInvariant
- if(stateInvariantFigure != null) {
- final int computedY = computeVerticalPosition(figure, viewer);
- stateInvariantFigure.setPosY(computedY);
-
- if(y == -1) {
- // first state invariant
- prevY = computedY;
- } else {
- prevY = y;
- }
-
- y = computedY;
-
- final int width;
- if(nextConstraint != null) {
- // the StateInvariant stops where the next occurrence begins
- width = nextConstraint.x - x;
- } else {
- // if the StateInvariant is the last element, then it continues until the end
- width = clientArea.width - x;
- }
-
- 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 {
- // a StateInvariant on the top or bottom of the previous OccurrenceSpecification
- // => shift the line to eliminate the seam with the vertical line which is shifted too
- figure.setBounds(new Rectangle(x - SmallSquareFigure.RADIUS - 1, y - 5, width + SmallSquareFigure.RADIUS + 1, 10));
- }
- x += width;
- }
- }
- }
-
- 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 String id = StateInvariantUtils.getStateInvariantId(stateInvariant);
- 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) {
- 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 IFigure stateDefinitionFigure = stateDefinitionEditPart.getFigure();
- final Rectangle bounds = stateDefinitionFigure.getBounds();
- final int parentY = stateDefinitionFigure.getParent().getClientArea().y;
- return bounds.y + bounds.height / 2 - parentY;
- }
-
- /**
- * Second pass of the layout: layout the VerticalLines, which depend on the bounds of both their previous and
- * following StateInvariants, the time elements, which can be bound to an OccurrenceSpecification or StateInvariant,
- * and the GeneralOrderings, which can be linked to OccurrenceSpecifications.
- */
- protected static void layoutVerticalLinesAndTimeElements(final List<IFigure> figures, final Rectangle clientArea, final Rectangle[] constraints) {
-
- IFigure previousFigure = null;
- IFigure nextFigure = null;
- for(int i = 0; i < figures.size(); i++) {
- final IFigure figure = figures.get(i);
- 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);
-
- nextFigure = null;
- if(i < figures.size() - 1) {
- nextFigure = figures.get(i + 1);
- }
-
- // This is the bounds that the user tries to set. We further constrain these bounds.
- final Rectangle constraint = constraints[i];
-
- // VerticalLine
- if(verticalLineFigure != null) {
- boolean showVerticalLine = false;
- 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);
- // move the start of the line outside the OccurrenceSpecification
- y1 += sign * (previousFigure.getBounds().height / 2);
- if(y != y2) {
- showVerticalLine = true;
- }
- final int verticalLineBoxWidth = 10;
- figure.setBounds(new Rectangle(x - verticalLineBoxWidth / 2, Math.min(y1, y2), verticalLineBoxWidth, Math.abs(y2 - y1)));
- } else {
- Activator.log.warn("VerticalLine not between two Figures"); //$NON-NLS-1$
- }
- figure.setVisible(showVerticalLine);
- } 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) {
- // duration observation or constraint
- final Dimension size = dimensioningArrowFigure.getPreferredSize();
- 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) {
- // general ordering
- final Dimension size = generalOrderingHorizontalFigure.getPreferredSize();
- figure.setBounds(new Rectangle(constraint.x, constraint.y, constraint.width, size.height));
- }
-
- previousFigure = figure;
- }
- }
-}
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
deleted file mode 100644
index ce6f13589db..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullStateInvariantEditPartCN.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gef.requests.LocationRequest;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator;
-import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.MoveRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
-import org.eclipse.papyrus.uml.diagram.timing.custom.Messages;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.CutAndInsertOccurrenceSpecificationCommand;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies.AbstractTimelineLayoutPolicy;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.SmallSquareFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.parts.NoScrollNoBorderDragEditPartsTracker;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.RequestUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineTimelineCompartmentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullStateInvariantAppliedStereotypeEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullStateInvariantEditPartCN;
-import org.eclipse.uml2.uml.StateInvariant;
-import org.eclipse.uml2.uml.UMLPackage;
-
-public class CustomFullStateInvariantEditPartCN extends FullStateInvariantEditPartCN {
-
- public CustomFullStateInvariantEditPartCN(final View view) {
- super(view);
- }
-
- /**
- * The drag tracker has been specialized in order to constrain movement inside its container without scroll bar
- *
- * @see http://wiki.eclipse.org/Papyrus_Developer_Guide/NoScrollbar
- */
- @Override
- public DragTracker getDragTracker(final Request request) {
- return new NoScrollNoBorderDragEditPartsTracker(this);
- }
-
- @Override
- 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();
- 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 CompositeCommand compositeCommand = new CompositeCommand(Messages.CustomFullStateInvariantEditPartCN_CreateOccurrenceSpecification);
- compositeCommand.add(new CutAndInsertOccurrenceSpecificationCommand(this, loc, false));
- final EditPart timeline = EditPartUtils.findParentEditPartWithId(this, FullLifelineTimelineCompartmentEditPartCN.VISUAL_ID);
- final Command updateLayoutCommand = timeline.getCommand(AbstractTimelineLayoutPolicy.UPDATE_LAYOUT_REQUEST);
- compositeCommand.add(new CommandProxy(updateLayoutCommand));
- editingDomain.getCommandStack().execute(new GMFtoEMFCommandWrapper(compositeCommand));
- } else {
- super.performRequest(request);
- }
- }
-
- @Override
- public Command getCommand(final Request 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())) {
- return getTimelineCompartmentEditPart().getCommand(request);
- }
- } else if(request instanceof EditCommandRequestWrapper) {
- // we also need to forward this request, otherwise the feedback figure stays displayed
- final EditCommandRequestWrapper editCommandRequestWrapper = (EditCommandRequestWrapper)request;
- final IEditCommandRequest editCommandRequest = editCommandRequestWrapper.getEditCommandRequest();
- if(editCommandRequest instanceof MoveRequest) {
- final MoveRequest moveRequest = (MoveRequest)editCommandRequest;
- if(moveRequest.getTargetContainer() instanceof StateInvariant) {
- return getTimelineCompartmentEditPart().getCommand(request);
- }
- }
- }
- return super.getCommand(request);
- }
-
- private FullLifelineTimelineCompartmentEditPartCN getTimelineCompartmentEditPart() {
- 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) {
- final BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH) {
-
- @Override
- public int getPreferredSideOfParent() {
- /*
- * Avoids an infinite layout bug that makes the UI thread freeze indefinitely, because
- * BorderItemLocator continuously switches from PositionConstants.TOP to PositionConstants.MIDDLE.
- */
- return PositionConstants.TOP;
- }
- };
- locator.setBorderItemOffset(new Dimension(-20, -20));
- borderItemContainer.add(borderItemEditPart.getFigure(), locator);
- } else {
- super.addBorderItem(borderItemContainer, borderItemEditPart);
- }
- }
-}
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
deleted file mode 100644
index 2cbad2317a4..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomFullStateInvariantVerticalLineEditPart.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.parts.NoScrollNoBorderDragEditPartsTracker;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullStateInvariantVerticalLineEditPart;
-
-public class CustomFullStateInvariantVerticalLineEditPart extends FullStateInvariantVerticalLineEditPart {
-
- public CustomFullStateInvariantVerticalLineEditPart(final View view) {
- super(view);
- }
-
- /**
- * The drag tracker has been specialized in order to constrain movement inside its container without scroll bar
- *
- * @see http://wiki.eclipse.org/Papyrus_Developer_Guide/NoScrollbar
- */
- @Override
- public DragTracker getDragTracker(final Request request) {
- return new NoScrollNoBorderDragEditPartsTracker(this);
- }
-
- @Override
- public Command getCommand(final Request request) {
- 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;
- }
- return super.getCommand(request);
- }
-}
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
deleted file mode 100644
index 18dc672871c..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomGateEditPart.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-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.LayoutEditPolicyForLabel;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.GateEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.GateLabelEditPart;
-
-public class CustomGateEditPart extends GateEditPart {
-
- public CustomGateEditPart(final View view) {
- super(view);
- }
-
- @Override
- protected NodeFigure createNodePlate() {
- // make it a bit larger than the GateFigure itself in order to make it easier to select
- return new DefaultSizeNodeFigure(10, 10);
- }
-
- /** Use {@link ExternalLabelPrimaryDragRoleEditPolicy} to display a link while dragging */
- @Override
- protected LayoutEditPolicy createLayoutEditPolicy() {
- return new LayoutEditPolicyForLabel(GateLabelEditPart.VISUAL_ID);
- }
-}
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
deleted file mode 100644
index f975300e85d..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomGeneralOrderingEditPart.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-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.LayoutEditPolicyForLabel;
-import org.eclipse.papyrus.uml.diagram.timing.custom.parts.NoScrollNoBorderDragEditPartsTracker;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.GeneralOrderingEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.GeneralOrderingNameEditPart;
-
-public class CustomGeneralOrderingEditPart extends GeneralOrderingEditPart {
-
- public CustomGeneralOrderingEditPart(final View view) {
- super(view);
- }
-
- /**
- * The drag tracker has been specialized in order to constrain movement inside its container without scroll bar
- *
- * @see http://wiki.eclipse.org/Papyrus_Developer_Guide/NoScrollbar
- */
- @Override
- public DragTracker getDragTracker(final Request request) {
- return new NoScrollNoBorderDragEditPartsTracker(this);
- }
-
- /** Use {@link ExternalLabelPrimaryDragRoleEditPolicy} to display a link while dragging */
- @Override
- protected LayoutEditPolicy createLayoutEditPolicy() {
- return new LayoutEditPolicyForLabel(GeneralOrderingNameEditPart.VISUAL_ID);
- }
-}
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
deleted file mode 100644
index 83a370860e7..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomInteractionCompartmentEditPartTN.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.CompactLifelineFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.FullLifelineFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.layouts.FillLayout;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.Constants;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.FigureUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.ViewUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.InteractionCompartmentEditPartTN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.StateDefinitionEditPart;
-
-public class CustomInteractionCompartmentEditPartTN extends InteractionCompartmentEditPartTN {
-
- public CustomInteractionCompartmentEditPartTN(final View view) {
- super(view);
- }
-
- @Override
- public IFigure 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()) {
- 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) {
- final Integer nStates = numberOfStates.get(child);
- 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;
- }
- }
- }
-
- @Override
- protected Dimension calculatePreferredSize(final IFigure container, final int wHint, final int hHint) {
- return new Dimension(-1, -1);
- }
- });
-
- return result;
- }
-
- 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++) {
- final IFigure child = children.get(i);
- 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 int nStates = findNumberOfStatesDisplayedIn(lifelineView);
- numberOfStatesPerLifeline.put(child, Integer.valueOf(nStates));
- } 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$
- continue;
- }
-
- }
- return numberOfStatesPerLifeline;
- }
-
- protected static int findNumberOfStatesDisplayedIn(final View lifelineView) {
- int n = 0;
- final View stateDefinitionCompartment = ViewUtils.findStateDefinitionCompartmentView(lifelineView);
- @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())) {
- n++;
- }
- }
- return n;
- }
-
- @Override
- public boolean isSelectable() {
- // No need to select the compartment.
- // This saves one click when selecting something inside.
- return false;
- }
-}
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
deleted file mode 100644
index ba0a089badc..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomInteractionEditPartTN.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-import java.util.List;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.StereotypePropertiesCompartment;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.CustomInteractionRectangleFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.Constants;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.GateEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.InteractionCompartmentEditPartTN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.InteractionEditPartTN;
-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) {
- super(view);
- }
-
- @Override
- protected IFigure createNodeShape() {
- final CustomInteractionRectangleFigure interactionRectangleFigure = new CustomInteractionRectangleFigure();
- interactionRectangleFigure.getCompartmentFigure().setOutline(false);
- interactionRectangleFigure.getNameLabel().setVisible(false);
- // disable the shadow because it stays behind after move then Ctrl+Z
- interactionRectangleFigure.setShadow(false);
-
- interactionRectangleFigure.setLayoutManager(new AbstractLayout() {
-
- public void layout(final IFigure container) {
- // TODO futur use
- // final boolean displayTimeRuler = interactionRectangleFigure.isDisplayTimeRuler();
- final Rectangle clientArea = container.getClientArea();
- @SuppressWarnings("unchecked")
- final List<IFigure> children = container.getChildren();
- int consumedHeight = 0;
- 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);
- 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 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));
- consumedHeight += Constants.TIME_RULER_HEIGHT;
- } 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)) {
- consumedHeight = consumedHeight + child.getPreferredSize().height;
- child.setBounds(new Rectangle(clientArea.x, clientArea.y, clientArea.width, consumedHeight));
- } else {
- child.setBounds(new Rectangle(clientArea.x, clientArea.y, 0, 0));
- }
- }
- }
- }
-
- @Override
- protected Dimension calculatePreferredSize(final IFigure container, final int wHint, final int hHint) {
- return new Dimension(-1, -1);
- }
- });
-
- return this.primaryShape = interactionRectangleFigure;
- }
-
- @Override
- public Command getCommand(final Request request) {
- // redirect the "drop objects" request to the compartment
- if(request instanceof DropObjectsRequest) {
- final DropObjectsRequest dropObjectsRequest = (DropObjectsRequest)request;
- final EditPart compartment = EditPartUtils.findFirstChildEditPartWithId(this, InteractionCompartmentEditPartTN.VISUAL_ID);
- 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()));
- }
- return super.getCommand(request);
- }
-
- @Override
- protected LayoutEditPolicy createLayoutEditPolicy() {
- final org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- @Override
- protected EditPolicy createChildEditPolicy(final EditPart child) {
- final View childView = (View)child.getModel();
- final int visualID = UMLVisualIDRegistry.getVisualID(childView);
- // don't let Gates be resized
- if(visualID == GateEditPart.VISUAL_ID) {
- return new BorderItemSelectionEditPolicy();
- }
- return new NonResizableEditPolicy();
- }
-
- @Override
- protected Command getMoveChildrenCommand(final Request request) {
- return null;
- }
-
- @Override
- protected Command getCreateCommand(final CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-}
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
deleted file mode 100644
index f844d954929..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomMessageFoundEditPart.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.requests.BendpointRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.MessageFoundEditPart;
-
-public class CustomMessageFoundEditPart extends MessageFoundEditPart {
-
- public CustomMessageFoundEditPart(final View view) {
- super(view);
- }
-
- @Override
- public Command getCommand(final Request request) {
- 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;
- }
- return super.getCommand(request);
- }
-
-}
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
deleted file mode 100644
index a489825c531..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomMessageLostEditPart.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.requests.BendpointRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.MessageLostEditPart;
-
-public class CustomMessageLostEditPart extends MessageLostEditPart {
-
- public CustomMessageLostEditPart(final View view) {
- super(view);
- }
-
- @Override
- public Command getCommand(final Request request) {
- 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;
- }
- return super.getCommand(request);
- }
-
-}
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
deleted file mode 100644
index 93561b580f7..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomMessageOccurrenceSpecificationEditPartCN.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-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.LayoutEditPolicyForLabel;
-import org.eclipse.papyrus.uml.diagram.timing.custom.parts.NoScrollNoBorderDragEditPartsTracker;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.MessageOccurrenceSpecificationEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.MessageOccurrenceSpecificationLabelEditPart;
-
-public class CustomMessageOccurrenceSpecificationEditPartCN extends MessageOccurrenceSpecificationEditPartCN {
-
- public CustomMessageOccurrenceSpecificationEditPartCN(final View view) {
- super(view);
- }
-
- /**
- * The drag tracker has been specialized in order to constrain movement inside its container without scroll bar
- *
- * @see http://wiki.eclipse.org/Papyrus_Developer_Guide/NoScrollbar
- */
- @Override
- public DragTracker getDragTracker(final Request request) {
- return new NoScrollNoBorderDragEditPartsTracker(this);
- }
-
- /** Use {@link ExternalLabelPrimaryDragRoleEditPolicy} to display a link while dragging */
- @Override
- protected LayoutEditPolicy createLayoutEditPolicy() {
- return new LayoutEditPolicyForLabel(MessageOccurrenceSpecificationLabelEditPart.VISUAL_ID);
- }
-}
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
deleted file mode 100644
index 98cc4f5d681..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomMessageOccurrenceSpecificationLabelEditPart.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.parsers.OccurrenceSpecificationNameParser;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.MessageOccurrenceSpecificationLabelEditPart;
-
-public class CustomMessageOccurrenceSpecificationLabelEditPart extends MessageOccurrenceSpecificationLabelEditPart {
-
- private IParser parser;
-
- public CustomMessageOccurrenceSpecificationLabelEditPart(final View view) {
- super(view);
- }
-
- @Override
- public IParser getParser() {
- 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
deleted file mode 100644
index c5455293011..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomOccurrenceSpecificationEditPartCN.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-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.LayoutEditPolicyForLabel;
-import org.eclipse.papyrus.uml.diagram.timing.custom.parts.NoScrollNoBorderDragEditPartsTracker;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.OccurrenceSpecificationEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.OccurrenceSpecificationLabelEditPart;
-
-public class CustomOccurrenceSpecificationEditPartCN extends OccurrenceSpecificationEditPartCN {
-
- public CustomOccurrenceSpecificationEditPartCN(final View view) {
- super(view);
- }
-
- /**
- * The drag tracker has been specialized in order to constrain movement inside its container without scroll bar
- *
- * @see http://wiki.eclipse.org/Papyrus_Developer_Guide/NoScrollbar
- */
- @Override
- public DragTracker getDragTracker(final Request request) {
- return new NoScrollNoBorderDragEditPartsTracker(this);
- }
-
- /** Use {@link ExternalLabelPrimaryDragRoleEditPolicy} to display a link while dragging */
- @Override
- protected LayoutEditPolicy createLayoutEditPolicy() {
- return new LayoutEditPolicyForLabel(OccurrenceSpecificationLabelEditPart.VISUAL_ID);
- }
-}
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
deleted file mode 100644
index ac828ee1156..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomOccurrenceSpecificationLabelEditPart.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.parsers.OccurrenceSpecificationNameParser;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.OccurrenceSpecificationLabelEditPart;
-
-public class CustomOccurrenceSpecificationLabelEditPart extends OccurrenceSpecificationLabelEditPart {
-
- private IParser parser;
-
- public CustomOccurrenceSpecificationLabelEditPart(final View view) {
- super(view);
- }
-
- @Override
- public IParser getParser() {
- 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
deleted file mode 100644
index 95c4731406a..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomStateDefinitionEditPart.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.Messages;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.DeleteStateDefinitionCommand;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.RefreshCommandForDo;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.RefreshCommandForUndo;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.StateDefinitionFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.FigureUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.StateDefinitionUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.StateInvariantUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.StateDefinitionEditPart;
-import org.eclipse.uml2.uml.Lifeline;
-import org.eclipse.uml2.uml.StateInvariant;
-
-public class CustomStateDefinitionEditPart extends StateDefinitionEditPart {
-
- public CustomStateDefinitionEditPart(final View view) {
- super(view);
- }
-
- @Override
- public void setSelected(final int value) {
- super.setSelected(value);
- // set selection on figure
- final StateDefinitionFigure stateDefinitionFigure = FigureUtils.findChildFigureInstance(getFigure(), StateDefinitionFigure.class);
- stateDefinitionFigure.setSelected(value != EditPart.SELECTED_NONE);
- // repaint compartment
- final ResizableCompartmentFigure compartmentFigure = FigureUtils.findParentFigureInstance(getFigure(), ResizableCompartmentFigure.class);
- compartmentFigure.repaint();
- }
-
- @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();
- final String id = StateDefinitionUtils.getStateDefinitionViewID(view);
- if(lifeline.getInteraction() != null) {
- final List<StateInvariant> stateInvariants = StateInvariantUtils.findStateInvariantsWithId(id, lifeline.getInteraction());
- if(stateInvariants.size() > 0) {
- // cannot delete a StateDefinition used in a StateInvariant
- return UnexecutableCommand.INSTANCE;
- }
- }
- final TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(view);
- final CompoundCommand compoundCommand = new CompoundCommand(Messages.CustomStateDefinitionEditPart_DeleteStateDefinition);
- compoundCommand.add(new RefreshCommandForUndo(lifelineEditPart));
- compoundCommand.add(new ICommandProxy(new DeleteCommand(editingDomain, view)));
- compoundCommand.add(new ICommandProxy(new DeleteStateDefinitionCommand(id, lifeline, editingDomain)));
- compoundCommand.add(new RefreshCommandForDo(lifelineEditPart));
- return compoundCommand;
- }
-
- if(request.getType() == REQ_RECONNECT_TARGET) {
- // don't let the user reconnect anything to a state definition
- return UnexecutableCommand.INSTANCE;
- }
- return super.getCommand(request);
- }
-
- @Override
- public Object getAdapter(@SuppressWarnings("rawtypes") final Class key) {
- // GMF returns the View by default, but Papyrus expects a semantic element.
- // 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) {
- return null;
- }
- return super.getAdapter(key);
- }
-
- @Override
- 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());
- return super.handleDragStarted();
- }
- };
- }
-}
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
deleted file mode 100644
index 86f6a82aeb0..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomStateDefinitionLabelEditPart.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.parsers.StateDefinitionParser;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.StateDefinitionLabelEditPart;
-
-public class CustomStateDefinitionLabelEditPart extends StateDefinitionLabelEditPart {
-
- private IParser parser;
-
- public CustomStateDefinitionLabelEditPart(final View view) {
- super(view);
- }
-
- @Override
- public Command getCommand(final Request request) {
- if(request.getType() == REQ_DELETE) {
- // if the StateDefinitionLabel is selected, then delete the parent StateDefinition
- return getParent().getCommand(request);
- }
- return super.getCommand(request);
- }
-
- /**
- * Generation bug prevents getting the parser for the label EditPart (seems to look for a parser on the parent
- * EditPart). So, return the right parser here.
- */
- @Override
- public IParser getParser() {
- if(this.parser == null) {
- this.parser = new StateDefinitionParser();
- }
- return this.parser;
- }
-
- @Override
- public Object getAdapter(@SuppressWarnings("rawtypes") final Class key) {
- // GMF returns the View by default, but Papyrus expects a semantic element.
- // 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) {
- 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
deleted file mode 100644
index 3ab76e8ec7d..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTickEditPart.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-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.LayoutEditPolicyForLabel;
-import org.eclipse.papyrus.uml.diagram.timing.custom.parts.NoScrollNoBorderDragEditPartsTracker;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.TickEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.TickNameEditPart;
-
-public class CustomTickEditPart extends TickEditPart {
-
- public CustomTickEditPart(final View view) {
- super(view);
- }
-
- /**
- * The drag tracker has been specialized in order to constrain movement inside its container without scroll bar
- *
- * @see http://wiki.eclipse.org/Papyrus_Developer_Guide/NoScrollbar
- */
- @Override
- public DragTracker getDragTracker(final Request request) {
- return new NoScrollNoBorderDragEditPartsTracker(this);
- }
-
- /** Use {@link ExternalLabelPrimaryDragRoleEditPolicy} to display a link while dragging */
- @Override
- protected LayoutEditPolicy createLayoutEditPolicy() {
- return new LayoutEditPolicyForLabel(TickNameEditPart.VISUAL_ID);
- }
-}
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
deleted file mode 100644
index 9af67319b9b..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimeConstraintEditPart.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-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.LayoutEditPolicyForLabel;
-import org.eclipse.papyrus.uml.diagram.timing.custom.parts.NoScrollNoBorderDragEditPartsTracker;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.TimeConstraintEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.TimeConstraintSpecificationEditPart;
-
-public class CustomTimeConstraintEditPart extends TimeConstraintEditPart {
-
- public CustomTimeConstraintEditPart(final View view) {
- super(view);
- }
-
- /**
- * The drag tracker has been specialized in order to constrain movement inside its container without scroll bar
- *
- * @see http://wiki.eclipse.org/Papyrus_Developer_Guide/NoScrollbar
- */
- @Override
- public DragTracker getDragTracker(final Request request) {
- return new NoScrollNoBorderDragEditPartsTracker(this);
- }
-
- /** Use {@link ExternalLabelPrimaryDragRoleEditPolicy} to display a link while dragging */
- @Override
- protected LayoutEditPolicy createLayoutEditPolicy() {
- return new LayoutEditPolicyForLabel(TimeConstraintSpecificationEditPart.VISUAL_ID);
- }
-}
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
deleted file mode 100644
index 12d69cc56e1..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimeObservationEditPart.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-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.LayoutEditPolicyForLabel;
-import org.eclipse.papyrus.uml.diagram.timing.custom.parts.NoScrollNoBorderDragEditPartsTracker;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.TimeObservationEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.TimeObservationNameEditPart;
-
-public class CustomTimeObservationEditPart extends TimeObservationEditPart {
-
- public CustomTimeObservationEditPart(final View view) {
- super(view);
- }
-
- /**
- * The drag tracker has been specialized in order to constrain movement inside its container without scroll bar
- *
- * @see http://wiki.eclipse.org/Papyrus_Developer_Guide/NoScrollbar
- */
- @Override
- public DragTracker getDragTracker(final Request request) {
- return new NoScrollNoBorderDragEditPartsTracker(this);
- }
-
- /** Use {@link ExternalLabelPrimaryDragRoleEditPolicy} to display a link while dragging */
- @Override
- protected LayoutEditPolicy createLayoutEditPolicy() {
- return new LayoutEditPolicyForLabel(TimeObservationNameEditPart.VISUAL_ID);
- }
-}
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
deleted file mode 100644
index 3b3761502ed..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimeRulerCompartmentEditPartCN.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.layouts.FillLayout;
-import org.eclipse.papyrus.uml.diagram.timing.custom.layouts.TimeRulerLayout;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.TimeRulerCompartmentEditPartCN;
-
-public class CustomTimeRulerCompartmentEditPartCN extends TimeRulerCompartmentEditPartCN {
-
- public CustomTimeRulerCompartmentEditPartCN(final View view) {
- super(view);
- }
-
- @Override
- public IFigure createFigure() {
- final ResizableCompartmentFigure result = (ResizableCompartmentFigure)super.createFigure();
- result.setTitleVisibility(false);
- result.setLayoutManager(new FillLayout());
- result.getContentPane().setLayoutManager(new TimeRulerLayout());
- return result;
- }
-
- /**
- * Hide the scrollbar
- *
- * @see http://wiki.eclipse.org/Papyrus_Developer_Guide/NoScrollbar
- */
- @Override
- protected void refreshVisuals() {
- super.refreshVisuals();
- ((ResizableCompartmentFigure)getFigure()).getScrollPane().setScrollBarVisibility(org.eclipse.draw2d.ScrollPane.NEVER);
- refreshBounds();
- }
-
- @Override
- public boolean isSelectable() {
- // No need to select the compartment.
- // This saves one click when selecting something inside.
- return false;
- }
-}
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
deleted file mode 100644
index 0207d71df26..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomTimingDiagramEditPart.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-import java.util.List;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.requests.GroupRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.notation.View;
-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);
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Command getCommand(final Request request) {
- 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;
- }
- return super.getCommand(request);
- }
-
- private static boolean canBeDropped(final List<EditPart> editParts) {
- for(final EditPart editPart : editParts) {
- if(!(editPart instanceof InteractionEditPartTN)) {
- return false;
- }
- }
- return true;
- }
-}
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
deleted file mode 100644
index 795f571b4ed..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/parts/CustomUMLEditPartFactory.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineCompartmentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineTimeRulerCompartmentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactStateInvariantEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactStateInvariantNameEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.DestructionOccurrenceSpecificationEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.DestructionOccurrenceSpecificationLabelEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.DurationConstraintEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.DurationObservationEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FreeTimeRulerCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FreeTimingRulerEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineStateDefinitionCompartmentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineTimeRulerCompartmentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineTimelineCompartmentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullStateInvariantEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullStateInvariantVerticalLineEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.GateEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.GeneralOrderingEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.InteractionCompartmentEditPartTN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.InteractionEditPartTN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.MessageOccurrenceSpecificationEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.MessageOccurrenceSpecificationLabelEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.OccurrenceSpecificationEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.OccurrenceSpecificationLabelEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.StateDefinitionEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.StateDefinitionLabelEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.TickEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.TimeConstraintEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.TimeObservationEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.TimeRulerCompartmentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.TimingDiagramEditPart;
-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;
- final int visualID = UMLVisualIDRegistry.getVisualID(view);
- switch(visualID) {
- case TimingDiagramEditPart.VISUAL_ID:// 1
- return new CustomTimingDiagramEditPart(view);
- case InteractionEditPartTN.VISUAL_ID:// 2
- return new CustomInteractionEditPartTN(view);
- case InteractionCompartmentEditPartTN.VISUAL_ID:// 5
- return new CustomInteractionCompartmentEditPartTN(view);
- case FullLifelineStateDefinitionCompartmentEditPartCN.VISUAL_ID: // 7
- return new CustomFullLifelineStateDefinitionCompartmentEditPartCN(view);
- case FullLifelineTimelineCompartmentEditPartCN.VISUAL_ID: // 8
- return new CustomFullLifelineTimelineCompartmentEditPartCN(view);
- case StateDefinitionEditPart.VISUAL_ID:// 9
- return new CustomStateDefinitionEditPart(view);
- case OccurrenceSpecificationLabelEditPart.VISUAL_ID: // 10
- return new CustomOccurrenceSpecificationLabelEditPart(view);
- case FullStateInvariantEditPartCN.VISUAL_ID: // 11
- return new CustomFullStateInvariantEditPartCN(view);
- case OccurrenceSpecificationEditPartCN.VISUAL_ID: // 12
- return new CustomOccurrenceSpecificationEditPartCN(view);
- case MessageOccurrenceSpecificationEditPartCN.VISUAL_ID: // 13
- return new CustomMessageOccurrenceSpecificationEditPartCN(view);
- case MessageOccurrenceSpecificationLabelEditPart.VISUAL_ID: // 14
- return new CustomMessageOccurrenceSpecificationLabelEditPart(view);
- case TimeConstraintEditPart.VISUAL_ID: // 15
- return new CustomTimeConstraintEditPart(view);
- case TimeObservationEditPart.VISUAL_ID: // 16
- return new CustomTimeObservationEditPart(view);
- case DurationObservationEditPartCN.VISUAL_ID: // 17
- return new CustomDurationObservationEditPart(view);
- case DurationConstraintEditPartCN.VISUAL_ID: // 18
- return new CustomDurationConstraintEditPart(view);
- case FullLifelineEditPartCN.VISUAL_ID:// 19
- return new CustomFullLifelineEditPartCN(view);
- case CompactLifelineEditPartCN.VISUAL_ID:// 20
- return new CustomCompactLifelineEditPartCN(view);
- case CompactLifelineCompartmentEditPartCN.VISUAL_ID:// 23
- return new CustomCompactLifelineCompartmentEditPart(view);
- case FreeTimingRulerEditPartCN.VISUAL_ID: // 24
- return new CustomFreeTimingRulerEditPart(view);
- case TickEditPart.VISUAL_ID: // 26
- return new CustomTickEditPart(view);
- case DestructionOccurrenceSpecificationEditPartCN.VISUAL_ID: // 27
- return new CustomDestructionOccurrenceSpecificationEditPartCN(view);
- case CompactStateInvariantEditPartCN.VISUAL_ID:// 28
- return new CustomCompactStateInvariantEditPartCN(view);
- case TimeRulerCompartmentEditPartCN.VISUAL_ID: // 29
- return new CustomTimeRulerCompartmentEditPartCN(view);
- case CompactStateInvariantNameEditPart.VISUAL_ID:// 31
- return new CustomCompactStateInvariantNameEditPart(view);
- case DestructionOccurrenceSpecificationLabelEditPart.VISUAL_ID: // 32
- return new CustomDestructionOccurrenceSpecificationLabelEditPart(view);
- case StateDefinitionLabelEditPart.VISUAL_ID:// 38
- return new CustomStateDefinitionLabelEditPart(view);
- case FullStateInvariantVerticalLineEditPart.VISUAL_ID:// 39
- return new CustomFullStateInvariantVerticalLineEditPart(view);
- case MessageLostEditPart.VISUAL_ID: // 50
- return new CustomMessageLostEditPart(view);
- case MessageFoundEditPart.VISUAL_ID: // 53
- return new CustomMessageFoundEditPart(view);
- case GeneralOrderingEditPart.VISUAL_ID: // 67
- return new CustomGeneralOrderingEditPart(view);
- case GateEditPart.VISUAL_ID: // 69
- return new CustomGateEditPart(view);
- case FreeTimeRulerCompartmentEditPart.VISUAL_ID: // 80
- return new CustomFreeTimeRulerCompartmentEditPart(view);
- case FullLifelineTimeRulerCompartmentEditPartCN.VISUAL_ID: // 82
- return new CustomFullLifelineTimeRulerCompartmentEditPartCN(view);
- case CompactLifelineTimeRulerCompartmentEditPartCN.VISUAL_ID: // 83
- return new CustomCompactLifelineTimeRulerCompartmentEditPartCN(view);
- default:
- // when adding cases to this switch, also add the corresponding IDs in the extension
- // org.eclipse.gmf.runtime.diagram.ui.editpartProviders
- }
- }
- return super.createEditPart(context, model);
- }
-
- // getTextCellEditorLocator is modified in the super class instead of overridden because it is static
-}
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
deleted file mode 100644
index f32ec34a57d..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/AbstractTimelineLayoutPolicy.java
+++ /dev/null
@@ -1,490 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies;
-
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.XYLayoutEditPolicy;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.Bounds;
-import org.eclipse.gmf.runtime.notation.LayoutConstraint;
-import org.eclipse.gmf.runtime.notation.Location;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.NotationFactory;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.Messages;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts.CustomCompactLifelineCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.SmallSquareFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.VerticalMarkFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.Constants;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.ViewUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineCompartmentEditPartCN;
-import org.eclipse.uml2.uml.DurationConstraint;
-import org.eclipse.uml2.uml.DurationObservation;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.GeneralOrdering;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.OccurrenceSpecification;
-import org.eclipse.uml2.uml.TimeConstraint;
-import org.eclipse.uml2.uml.TimeObservation;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/** This factors out common code between the layouts for the compact and full Lifelines. */
-public class AbstractTimelineLayoutPolicy extends XYLayoutEditPolicy {
-
- public static final Request UPDATE_LAYOUT_REQUEST = new Request("UPDATE_LAYOUT"); //$NON-NLS-1$
-
- @Override
- public Command getCommand(final Request request) {
- 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) {
- 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)) {
- final CompoundCommand compoundCommand = new CompoundCommand();
- compoundCommand.add(superCommand);
- compoundCommand.add(getUpdateTimeElementsCommand());
- return compoundCommand;
- }
- return superCommand;
- }
-
- /**
- * 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
- * @param moveDelta
- * how much to move
- * @param timelineCompartmentView
- * the parent compartment
- * @param occurrenceSpecificationIndex
- * the index of the OccurrenceSpecification Node in its parent compartment
- * @param nodesToIgnore
- * 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) {
- final LayoutConstraint layoutConstraint = occurrenceSpecificationNode.getLayoutConstraint();
- 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 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();
- // constrain the new position between the previous and next OccurrenceSpecifications
- final int newX = Math.max(Math.min(posX, max), min);
- loc.setX(newX);
- loc.setY(posY);
- occurrenceSpecificationNode.setLayoutConstraint(loc);
- return CommandResult.newOKCommandResult();
- }
- });
- }
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * Find the maximum abscissa of the OccurrenceSpecification at the given index
- *
- * @param timelineCompartmentView
- * the parent timeline compartment view
- * @param index
- * 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
- * @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++) {
- 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;
- return location.getX() - Constants.MINIMUM_DISTANCE_BETWEEN_OCCURRENCE_SPECIFICATIONS;
- }
- }
- }
- return Integer.MAX_VALUE;
- }
-
- /**
- * Find the minimum abscissa of the OccurrenceSpecification at the given index
- *
- * @param timelineCompartmentView
- * the parent timeline compartment view
- * @param index
- * the index of the OccurrenceSpecification in the compartment view's children
- * @param nodesToIgnore
- * 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--) {
- 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;
- return location.getX() + Constants.MINIMUM_DISTANCE_BETWEEN_OCCURRENCE_SPECIFICATIONS;
- }
- }
- }
- return 0;
- }
-
- /** 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 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) {
- final EObject element = child.getElement();
- 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);
- final EList<Element> constrainedElements = timeConstraint.getConstrainedElements();
- 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);
- final EList<NamedElement> events = durationObservation.getEvents();
- 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) {
- 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);
- final EList<Element> elements = durationConstraint.getConstrainedElements();
- 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) {
- 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);
-
- final OccurrenceSpecification before = generalOrdering.getBefore();
- final OccurrenceSpecification after = generalOrdering.getAfter();
- updateGeneralOrderingLocation(generalOrderingNode, before, after, children);
- }
- }
- return CommandResult.newOKCommandResult();
- }
- });
- }
-
- /**
- * 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
- * @param alignmentElement
- * the element to align to
- * @param timelineViews
- * the views contained in the timeline
- * @param compact
- * whether this is a compact timeline
- * @param max
- * 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) {
- 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;
- final LayoutConstraint layoutConstraint = node.getLayoutConstraint();
- if(layoutConstraint instanceof Location) {
- final Location location = (Location)layoutConstraint;
- lastOccurrencePosition = location.getX();
- }
- }
- 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) {
- // memorize the first occurrence position before the alignmentElement
- occurrencePositionBefore = lastOccurrencePosition;
- after = true;
- }
- }
-
- boolean firstEvent = true;
- final EObject element = timeElementNode.getElement();
- if(element instanceof TimeObservation) {
- final TimeObservation timeObservation = (TimeObservation)element;
- firstEvent = timeObservation.isFirstEvent();
- } else if(element instanceof TimeConstraint) {
- final TimeConstraint timeConstraint = (TimeConstraint)element;
- firstEvent = timeConstraint.isFirstEvent();
- }
-
- if(firstEvent) {
- if(occurrencePositionBefore != -1) {
- setTimeElementNodeLocation(timeElementNode, occurrencePositionBefore);
- } else {
- if(compact) {
- setTimeElementNodeLocation(timeElementNode, CustomCompactLifelineCompartmentEditPart.FIRST_STATE_OFFSET);
- } else {
- setTimeElementNodeLocation(timeElementNode, 0);
- }
- }
- } else {
- if(occurrencePositionAfter != -1) {
- setTimeElementNodeLocation(timeElementNode, occurrencePositionAfter);
- } else {
- // the margin avoids the element pushing the rest outside
- final int margin = 5;
- setTimeElementNodeLocation(timeElementNode, max - margin);
- }
- }
- }
-
- /**
- * Set the horizontal location of the given duration element View, so that it is aligned with its associated start
- * and end elements
- *
- * @param durationElementNode
- * the element to align
- * @param startElement
- * the start element of the duration
- * @param endElement
- * the end element of the duration
- * @param timelineViews
- * the views contained in the timeline
- */
- 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;
- final LayoutConstraint layoutConstraint = node.getLayoutConstraint();
- 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())) {
- lastOccurrencePosition = location.getX();
- } else if(ViewUtils.isViewFor(view, UMLPackage.eINSTANCE.getStateInvariant())) {
- if(onEndElement) {
- endPos = lastOccurrencePosition + SmallSquareFigure.RADIUS + 1;
- onEndElement = false;
- }
- }
- }
- if(view.getElement() == startElement) {
- startPos = lastOccurrencePosition + SmallSquareFigure.RADIUS;
- }
- 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
- // a StateInvariant) will determine the end of the StateInvariant
- onEndElement = true;
- }
- }
- }
-
- if(endPos == -1) {
- // the endElement has no end
- endPos = Integer.MAX_VALUE;
- }
- setDurationElementNodeLocation(durationElementNode, startPos, endPos);
-
- }
-
- // meant to be overridden
- @SuppressWarnings("static-method")
- protected int getOriginX() {
- return 0;
- }
-
- /**
- * Set the location of the given time element to the given horizontal coordinate. The vertical coordinate is set to
- * the location where the user clicked initially. Then we let the user change the vertical coordinate freely.
- */
- protected static void setTimeElementNodeLocation(final Node timeElementNode, final int x) {
- final LayoutConstraint layoutConstraint = timeElementNode.getLayoutConstraint();
- 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;
- 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;
- y = timeElementLocation.getY();
- } else {
- timeElementLocation = NotationFactory.eINSTANCE.createLocation();
- y = 0;
- }
-
- timeElementLocation.setX(x);
- timeElementLocation.setY(y);
- timeElementNode.setLayoutConstraint(timeElementLocation);
- }
-
- /**
- * Set the location of the given duration node
- *
- * @param durationElementNode
- * the node to position
- * @param startPos
- * the horizontal starting position
- * @param endPos
- * 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;
- } else {
- bounds = NotationFactory.eINSTANCE.createBounds();
- durationElementNode.setLayoutConstraint(bounds);
- }
- bounds.setX(startPos);
- if(endPos == Integer.MAX_VALUE) {
- bounds.setWidth(Integer.MAX_VALUE);
- } else {
- bounds.setWidth(endPos - startPos);
- }
- }
-
- /**
- * 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
- * @param before
- * the start element
- * @param after
- * the end element
- * @param timelineViews
- * all the Views in the timeline
- */
- 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;
- final LayoutConstraint layoutConstraint = node.getLayoutConstraint();
- final Location location = (Location)layoutConstraint;
- if(view.getElement() == before) {
- startPos = location.getX() + SmallSquareFigure.RADIUS;
- }
- if(view.getElement() == after) {
- endPos = location.getX() + SmallSquareFigure.RADIUS + 1;
- }
- }
- }
- if(startPos != -1 && endPos != -1) {
- setGeneralOrderingNodeLocation(generalOrderingNode, startPos, endPos);
- }
- }
-
- /**
- * Set the location of the given {@link GeneralOrdering} node
- *
- * @param generalOrderingNode
- * the node to position
- * @param startPos
- * the horizontal starting position
- * @param endPos
- * 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;
- } else {
- bounds = NotationFactory.eINSTANCE.createBounds();
- generalOrderingNode.setLayoutConstraint(bounds);
- }
- bounds.setX(startPos);
- bounds.setWidth(endPos - startPos);
- }
-
-}
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
deleted file mode 100644
index e89697a86c4..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomCompactLifelineCompartmentItemSemanticEditPolicyCN.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.requests.ReconnectRequest;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.CustomDurationConstraintCreateCommand;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.CustomDurationObservationCreateCommand;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.CustomGeneralOrderingCreateCommand;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.CustomTimeConstraintCreateCommand;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.CustomTimeObservationCreateCommand;
-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;
-import org.eclipse.papyrus.uml.diagram.timing.edit.policies.CompactLifelineCompartmentItemSemanticEditPolicyCN;
-import org.eclipse.papyrus.uml.diagram.timing.providers.UMLElementTypes;
-
-public class CustomCompactLifelineCompartmentItemSemanticEditPolicyCN extends CompactLifelineCompartmentItemSemanticEditPolicyCN {
-
- @Override
- protected Command getReorientRelationshipSourceCommand(final ReconnectRequest request) {
- if(request.getConnectionEditPart() instanceof MessageFoundEditPart) {
- // don't let it return an unexecutable command, since it prevents the MessageFound anchor from being dragged
- return null;
- }
- return super.getReorientRelationshipSourceCommand(request);
- }
-
- @Override
- protected Command getReorientRelationshipTargetCommand(final ReconnectRequest request) {
- if(request.getConnectionEditPart() instanceof MessageLostEditPart) {
- // don't let it return an unexecutable command, since it prevents the MessageLost anchor from being dragged
- return null;
- }
- return super.getReorientRelationshipTargetCommand(request);
- }
-
- /** Allows creating a found Message that originates from a Lifeline */
- @Override
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
- if(MessageUtils.isMessage(requestElementType)) {
- return getGEFWrapper(new CustomMessageCreateCommand(req));
- }
- return super.getCreateRelationshipCommand(req);
- }
-
- /** Allows creating a time element or general ordering with a custom command */
- @Override
- protected Command getCreateCommand(final CreateElementRequest req) {
- final IElementType requestElementType = req.getElementType();
- if(requestElementType == UMLElementTypes.TimeObservation_16) {
- return getGEFWrapper(new CustomTimeObservationCreateCommand(req));
- } else if(requestElementType == UMLElementTypes.TimeConstraint_15) {
- return getGEFWrapper(new CustomTimeConstraintCreateCommand(req));
- } else if(requestElementType == UMLElementTypes.DurationObservation_17) {
- return getGEFWrapper(new CustomDurationObservationCreateCommand(req));
- } else if(requestElementType == UMLElementTypes.DurationConstraint_18) {
- return getGEFWrapper(new CustomDurationConstraintCreateCommand(req));
- } 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
deleted file mode 100644
index c317e340c99..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomCompactLifelineCompartmentLayoutEditPolicy.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableEditPolicyEx;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableShapeEditPolicy;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.LayoutConstraint;
-import org.eclipse.gmf.runtime.notation.Location;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.NotationFactory;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.timing.custom.Messages;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.RefreshCommandForDo;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.RefreshCommandForUndo;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts.CustomCompactLifelineCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.FigureUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.GeneralOrderingUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.OccurrenceSpecificationUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.RequestUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.TimeElementUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineCompartmentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactStateInvariantEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.part.UMLVisualIDRegistry;
-import org.eclipse.uml2.uml.OccurrenceSpecification;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * This edit policy handles moving (through drag&drop) the elements in the compartment of a compact Lifeline.
- */
-public class CustomCompactLifelineCompartmentLayoutEditPolicy extends AbstractTimelineLayoutPolicy {
-
- @Override
- protected Command getMoveChildrenCommand(final Request request) {
- if(RequestUtils.isChangeBoundsRequestFor(request, UMLPackage.eINSTANCE.getOccurrenceSpecification())) {
- return getMoveOccurrenceSpecificationsCommand(request);
- }
- return super.getMoveChildrenCommand(request);
- }
-
- @Override
- protected Command getResizeChildrenCommand(final ChangeBoundsRequest request) {
- 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) {
- return UnexecutableCommand.INSTANCE;
- }
- final CompoundCommand compoundCommand = new CompoundCommand(Messages.CustomCompactLifelineCompartmentLayoutEditPolicy_ResizeStateInvariant);
- final CompactLifelineEditPartCN lifelineEditPart = (CompactLifelineEditPartCN)getHost().getParent();
- compoundCommand.add(new RefreshCommandForUndo(lifelineEditPart));
- 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")
- final List<EditPart> editPartsToResize = request.getEditParts();
- @SuppressWarnings("unchecked")
- final List<EditPart> children = compartmentEditPart.getChildren();
- int deltaX = 0;
- boolean moved = false;
- for(int i = 0; i < children.size(); i++) {
- final EditPart childEditPart = children.get(i);
- EditPart nextChildEditPart = null;
- if(i < children.size() - 1) {
- nextChildEditPart = children.get(i + 1);
- }
-
- final Object model = childEditPart.getModel();
- if(model instanceof Node) {
- final Node childNode = (Node)model;
- boolean move = deltaX != 0;
- 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)) {
- final LayoutConstraint layoutConstraint = childNode.getLayoutConstraint();
- if(!(layoutConstraint instanceof Location)) {
- Activator.log.error("Expected a LayoutConstraint", new Exception()); //$NON-NLS-1$
- continue;
- }
- 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) {
-
- @Override
- protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- final Location loc = NotationFactory.eINSTANCE.createLocation();
- loc.setX(newX);
- childNode.setLayoutConstraint(loc);
- return CommandResult.newOKCommandResult();
- }
- }));
- moved = true;
- }
- if(editPartsToResize.contains(childEditPart)) {
- // resizing a StateInvariant moves all the elements after it
- deltaX += widthDelta;
- }
- }
- }
- if(!moved) {
- return UnexecutableCommand.INSTANCE;
- }
- compoundCommand.add(new RefreshCommandForDo(lifelineEditPart));
- return compoundCommand;
- }
-
- /** returns a NonResizableEditPolicy instead of a ResizableEditPolicy for some children */
- @Override
- protected EditPolicy createChildEditPolicy(final EditPart child) {
- 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)) {
- return new NonResizableEditPolicyEx() {
-
- /** Override the command in order to pass all the moved EditParts in the request */
- @Override
- protected Command getMoveCommand(final ChangeBoundsRequest request) {
- final ChangeBoundsRequest req = new ChangeBoundsRequest(REQ_MOVE_CHILDREN);
- // all the request's EditParts instead of just the host
- req.setEditParts(request.getEditParts());
- req.setMoveDelta(request.getMoveDelta());
- req.setSizeDelta(request.getSizeDelta());
- req.setLocation(request.getLocation());
- req.setExtendedData(request.getExtendedData());
- return getHost().getParent().getCommand(req);
- }
- };
- }
- return new ResizableShapeEditPolicy() {
-
- /** Override the command in order to pass all the resized EditParts in the request */
- @Override
- protected Command getResizeCommand(final ChangeBoundsRequest request) {
- final ChangeBoundsRequest req = new ChangeBoundsRequest(REQ_RESIZE_CHILDREN);
- // all the request's EditParts instead of just the host
- req.setEditParts(request.getEditParts());
- req.setMoveDelta(request.getMoveDelta());
- req.setSizeDelta(request.getSizeDelta());
- req.setLocation(request.getLocation());
- req.setExtendedData(request.getExtendedData());
- req.setResizeDirection(request.getResizeDirection());
- return getHost().getParent().getCommand(req);
- }
-
- @Override
- public boolean isDragAllowed() {
- return false;
- }
- };
- }
-
- private Command getMoveOccurrenceSpecificationsCommand(final Request request) {
- final ChangeBoundsRequest changeBoundsRequest = (ChangeBoundsRequest)request;
-
- final CompoundCommand compoundCommand = new CompoundCommand(Messages.CustomCompactLifelineCompartmentLayoutEditPolicy_MoveOccurrenceSpecification);
- 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();
-
- @SuppressWarnings("unchecked")
- final List<EditPart> editParts = changeBoundsRequest.getEditParts();
- final List<Node> nodesToMove = new ArrayList<Node>();
- for(final EditPart editPart : editParts) {
- final Object model = editPart.getModel();
- if(model instanceof Node) {
- final Node node = (Node)model;
- if(node.getElement() instanceof OccurrenceSpecification) {
- nodesToMove.add(node);
- }
- }
- }
- 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));
- }
- }
-
- compoundCommand.add(new RefreshCommandForDo(lifelineEditPart));
- return compoundCommand;
- }
-
- @Override
- protected int getOriginX() {
- return CustomCompactLifelineCompartmentEditPart.FIRST_STATE_OFFSET;
- }
-}
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
deleted file mode 100644
index c9c9191a6fb..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomCompactLifelineItemSemanticEditPolicyCN.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.MessageUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.policies.CompactLifelineItemSemanticEditPolicyCN;
-
-public class CustomCompactLifelineItemSemanticEditPolicyCN extends CompactLifelineItemSemanticEditPolicyCN {
-
- /** Allows creating a a lost Message that targets a Lifeline, or a found Message that originates from a Lifeline */
- @Override
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
- return null;
- }
- 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
deleted file mode 100644
index e57769aeadf..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomCompactStateInvariantItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.Messages;
-import org.eclipse.papyrus.uml.diagram.timing.custom.OperationForbiddenException;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.Constants;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.StateInvariantUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.policies.CompactStateInvariantItemSemanticEditPolicyCN;
-
-/** Hides related Views (OccurrenceSpecifications, etc.) when hiding a compact StateInvariant. */
-public class CustomCompactStateInvariantItemSemanticEditPolicy extends CompactStateInvariantItemSemanticEditPolicyCN {
-
- @Override
- public Command getCommand(final Request request) {
- if(request.getType() == REQ_DELETE) {
- try {
- final View view = (View)getHost().getModel();
- final Set<View> viewsToRemove = new HashSet<View>();
- if(view.getType().equals(Constants.compactStateInvariantId)) {
- viewsToRemove.addAll(StateInvariantUtils.getViewsToHide(view));
- }
- if(viewsToRemove.size() > 0) {
- final CompoundCommand compoundCommand = new CompoundCommand(Messages.hideStateInvariant);
- compoundCommand.add(super.getCommand(request));
- for(final View viewToRemove : viewsToRemove) {
- compoundCommand.add(new ICommandProxy(new DeleteCommand(viewToRemove)));
- }
- return compoundCommand;
- }
- } catch (final OperationForbiddenException e) {
- return UnexecutableCommand.INSTANCE;
- }
- }
- return super.getCommand(request);
- }
-}
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
deleted file mode 100644
index 04a736c3460..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomDestructionOccurrenceSpecificationItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies;
-
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.CustomMessageCreateCommand;
-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.custom.utils.OccurrenceSpecificationUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.policies.DestructionOccurrenceSpecificationItemSemanticEditPolicyCN;
-
-/** Semantic edit policy for {@link DestructionOccurrenceSpecification}s */
-public class CustomDestructionOccurrenceSpecificationItemSemanticEditPolicy extends DestructionOccurrenceSpecificationItemSemanticEditPolicyCN {
-
- /** 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) {
- final Command baseCommand = super.getCommand(request);
- return OccurrenceSpecificationUtils.getHideOccurrenceSpecificationCommand(getHost(), baseCommand);
- }
- return super.getCommand(request);
- }
-
- @Override
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
- return null;
- }
- if(MessageUtils.isMessage(requestElementType)) {
- return getGEFWrapper(new CustomMessageCreateCommand(req));
- }
- return super.getCreateRelationshipCommand(req);
- }
-
- @Override
- protected Command getReorientRelationshipCommand(final ReorientRelationshipRequest req) {
- return new ICommandProxy(new CustomMessageReorientCommand(req, getHost().getViewer()));
- }
-
-}
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
deleted file mode 100644
index 98074eb819c..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullLifelineItemSemanticEditPolicyCN.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.MessageUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.policies.FullLifelineItemSemanticEditPolicyCN;
-
-public class CustomFullLifelineItemSemanticEditPolicyCN extends FullLifelineItemSemanticEditPolicyCN {
-
- /** Allows creating a a lost Message that targets a Lifeline, or a found Message that originates from a Lifeline */
- @Override
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
- return null;
- }
- 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/CustomFullLifelineStateDefinitionCompartmentCreationEditPolicy.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullLifelineStateDefinitionCompartmentCreationEditPolicy.java
deleted file mode 100644
index fa9e76e1e08..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullLifelineStateDefinitionCompartmentCreationEditPolicy.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies;
-
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.Messages;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.RefreshCommandForDo;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.RefreshCommandForUndo;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.LifelineUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.StateDefinitionUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.StateInvariantUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.StateDefinitionEditPart;
-import org.eclipse.uml2.uml.Lifeline;
-
-/**
- * This EditPolicy creates a StateInvariant when the first StateDefinition is created, and links the StateInvariant to
- * the StateDefinition.
- */
-public class CustomFullLifelineStateDefinitionCompartmentCreationEditPolicy extends CreationEditPolicy {
-
- public CustomFullLifelineStateDefinitionCompartmentCreationEditPolicy() {
- }
-
- @Override
- protected Command getCreateCommand(final CreateViewRequest request) {
- final Command superCommand = super.getCreateCommand(request);
- final List<? extends ViewDescriptor> viewDescriptors = request.getViewDescriptors();
- if(viewDescriptors.size() == 1 && Integer.toString(StateDefinitionEditPart.VISUAL_ID).equals(viewDescriptors.get(0).getSemanticHint())) {
- final View lifelineView = (View)getHost().getParent().getModel();
- final Lifeline lifeline = (Lifeline)lifelineView.getElement();
- final List<?> children = getHost().getChildren();
- final boolean firstStateDefinition = children.size() == 0;
- return createStateDefinitionCommand(superCommand, lifeline, firstStateDefinition);
- }
- return super.getCreateCommand(request);
- }
-
- private Command createStateDefinitionCommand(final Command superCommand, final Lifeline lifeline, final boolean first) {
- final CompoundCommand compoundCommand = new CompoundCommand(Messages.CustomFullLifelineStateDefinitionCompartmentCreationEditPolicy_CreateStateDefinition);
- final FullLifelineEditPartCN lifelineEditPart = getLifelineEditPart();
- compoundCommand.add(new RefreshCommandForUndo(lifelineEditPart));
- // creates the state definition View
- compoundCommand.add(superCommand);
-
- final CommandResult superCommandResult = ((ICommandProxy)superCommand).getICommand().getCommandResult();
-
- final TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(lifeline);
- if(editingDomain == null) {
- throw new IllegalStateException("no editing domain"); //$NON-NLS-1$
- }
-
- final AbstractTransactionalCommand initStateDefinitionCommand = new AbstractTransactionalCommand(editingDomain, Messages.CustomFullLifelineStateDefinitionCompartmentCreationEditPolicy_InitializeStateDefinition, 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 stateDefinitionView = (View)viewDescriptor.getAdapter(View.class);
-
- // create the annotation for the StateDefinition
- StateDefinitionUtils.initNewStateDefinitionName(stateDefinitionView);
-
- if(first) {
- final String id = StateDefinitionUtils.getStateDefinitionViewID(stateDefinitionView);
- StateInvariantUtils.createStateInvariant(id, lifelineEditPart, -1, -1, -1);
- final View lifelineView = (View)lifelineEditPart.getModel();
- final Lifeline lifeline = (Lifeline)lifelineView.getElement();
- LifelineUtils.updateFragmentNames(lifeline, lifelineView);
- }
- return CommandResult.newOKCommandResult();
- }
- };
- compoundCommand.add(new ICommandProxy(initStateDefinitionCommand));
- compoundCommand.add(new RefreshCommandForDo(getLifelineEditPart()));
- return compoundCommand;
- }
-
- protected FullLifelineEditPartCN getLifelineEditPart() {
- return (FullLifelineEditPartCN)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/CustomFullLifelineStateDefinitionCompartmentLayoutEditPolicy.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullLifelineStateDefinitionCompartmentLayoutEditPolicy.java
deleted file mode 100644
index 8acfa353c26..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullLifelineStateDefinitionCompartmentLayoutEditPolicy.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies;
-
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineEditPartCN;
-
-/** Handles re-ordering StateDefinitions inside their compartment through drag&drop */
-public class CustomFullLifelineStateDefinitionCompartmentLayoutEditPolicy extends GenericListCompartmentLayoutEditPolicy {
-
- @Override
- protected GraphicalEditPart getEditPartToRefresh() {
- 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
deleted file mode 100644
index 92204bfb3f0..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullLifelineTimelineCompartmentItemSemanticEditPolicyCN.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.requests.ReconnectRequest;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.CustomDurationConstraintCreateCommand;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.CustomDurationObservationCreateCommand;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.CustomGeneralOrderingCreateCommand;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.CustomMessageCreateCommand;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.CustomTimeConstraintCreateCommand;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.CustomTimeObservationCreateCommand;
-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;
-import org.eclipse.papyrus.uml.diagram.timing.edit.policies.FullLifelineTimelineCompartmentItemSemanticEditPolicyCN;
-import org.eclipse.papyrus.uml.diagram.timing.providers.UMLElementTypes;
-
-public class CustomFullLifelineTimelineCompartmentItemSemanticEditPolicyCN extends FullLifelineTimelineCompartmentItemSemanticEditPolicyCN {
-
- @Override
- protected Command getReorientRelationshipSourceCommand(final ReconnectRequest request) {
- if(request.getConnectionEditPart() instanceof MessageFoundEditPart) {
- // don't let it return an unexecutable command, since it prevents the MessageFound anchor from being dragged
- return null;
- }
- return super.getReorientRelationshipSourceCommand(request);
- }
-
- @Override
- protected Command getReorientRelationshipTargetCommand(final ReconnectRequest request) {
- if(request.getConnectionEditPart() instanceof MessageLostEditPart) {
- // don't let it return an unexecutable command, since it prevents the MessageLost anchor from being dragged
- return null;
- }
- return super.getReorientRelationshipTargetCommand(request);
- }
-
- /** Allows creating a found Message that originates from a Lifeline */
- @Override
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
- if(MessageUtils.isMessage(requestElementType)) {
- return getGEFWrapper(new CustomMessageCreateCommand(req));
- }
- return super.getCreateRelationshipCommand(req);
- }
-
- /** Allows creating a time element or general ordering with a custom command */
- @Override
- protected Command getCreateCommand(final CreateElementRequest req) {
- final IElementType requestElementType = req.getElementType();
- if(requestElementType == UMLElementTypes.TimeObservation_16) {
- return getGEFWrapper(new CustomTimeObservationCreateCommand(req));
- } else if(requestElementType == UMLElementTypes.TimeConstraint_15) {
- return getGEFWrapper(new CustomTimeConstraintCreateCommand(req));
- } else if(requestElementType == UMLElementTypes.DurationObservation_17) {
- return getGEFWrapper(new CustomDurationObservationCreateCommand(req));
- } else if(requestElementType == UMLElementTypes.DurationConstraint_18) {
- return getGEFWrapper(new CustomDurationConstraintCreateCommand(req));
- } 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
deleted file mode 100644
index c31f56c3da5..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomFullStateInvariantItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.Messages;
-import org.eclipse.papyrus.uml.diagram.timing.custom.OperationForbiddenException;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.Constants;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.StateInvariantUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.policies.FullStateInvariantItemSemanticEditPolicyCN;
-
-/** Hides related Views (OccurrenceSpecifications, VerticalLine) when hiding a full StateInvariant. */
-public class CustomFullStateInvariantItemSemanticEditPolicy extends FullStateInvariantItemSemanticEditPolicyCN {
-
- @Override
- public Command getCommand(final Request request) {
- if(request.getType() == REQ_DELETE) {
- try {
- final View view = (View)getHost().getModel();
- final Set<View> viewsToRemove = new HashSet<View>();
- if(view.getType().equals(Constants.fullStateInvariantId)) {
- viewsToRemove.addAll(StateInvariantUtils.getViewsToHide(view));
- }
- if(viewsToRemove.size() > 0) {
- final CompoundCommand compoundCommand = new CompoundCommand(Messages.hideStateInvariant);
- compoundCommand.add(super.getCommand(request));
- for(final View viewToRemove : viewsToRemove) {
- compoundCommand.add(new ICommandProxy(new DeleteCommand(viewToRemove)));
- }
- return compoundCommand;
- }
- } catch (final OperationForbiddenException e) {
- return UnexecutableCommand.INSTANCE;
- }
- }
- return super.getCommand(request);
- }
-}
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
deleted file mode 100644
index afe1d1d9c4b..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomGateItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies;
-
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.CustomMessageCreateCommand;
-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;
-
-/** Semantic edit policy for {@link Gate}s */
-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) {
- // TODO: delete elements linked to Gate
- // final Command baseCommand = super.getCommand(request);
- // return GateUtils.getHideGateCommand(getHost(), baseCommand);
- }
- return super.getCommand(request);
- }
-
- @Override
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
- return null;
- }
- if(MessageUtils.isMessage(requestElementType)) {
- return getGEFWrapper(new CustomMessageCreateCommand(req));
- }
- return super.getCreateRelationshipCommand(req);
- }
-
- @Override
- protected Command getReorientRelationshipCommand(final ReorientRelationshipRequest req) {
- return new ICommandProxy(new CustomMessageReorientCommand(req, getHost().getViewer()));
- }
-}
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
deleted file mode 100644
index 90c705d1b5d..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomInteractionCompartmentCreationEditPolicy.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies;
-
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.PapyrusCreationEditPolicy;
-import org.eclipse.papyrus.uml.diagram.timing.custom.Messages;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.RefreshCommandForDo;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.RefreshCommandForUndo;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.StateInvariantUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.TimeRulerUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.ViewUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineCompartmentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.InteractionEditPartTN;
-import org.eclipse.uml2.uml.Interaction;
-
-public class CustomInteractionCompartmentCreationEditPolicy extends PapyrusCreationEditPolicy {
-
- public CustomInteractionCompartmentCreationEditPolicy() {
- }
-
- @Override
- protected Command getCreateCommand(final CreateViewRequest request) {
- final ICommandProxy superCommand = (ICommandProxy)super.getCreateCommand(request);
- final List<? extends ViewDescriptor> viewDescriptors = request.getViewDescriptors();
- 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();
- // 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
- final CompoundCommand compoundCommand = new CompoundCommand(Messages.CustomInteractionCompartmentCreationEditPolicy_CreateCompactLifeline);
- final InteractionEditPartTN interactionEditPart = getInteractionEditPart();
- compoundCommand.add(new RefreshCommandForUndo(interactionEditPart));
- compoundCommand.add(createCompactStateInvariantCommand(superCommand, interaction));
- compoundCommand.add(new ICommandProxy(TimeRulerUtils.getCreateFreeTimeRulerCommand(superCommand, editingDomain, false)));
- compoundCommand.add(new RefreshCommandForDo(interactionEditPart));
- return compoundCommand;
- }
- 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));
- compoundCommand.add(superCommand);
- compoundCommand.add(new ICommandProxy(TimeRulerUtils.getCreateFreeTimeRulerCommand(superCommand, editingDomain, false)));
- compoundCommand.add(new RefreshCommandForDo(interactionEditPart));
- return compoundCommand;
- }
- }
- return superCommand;
- }
-
- private static Command createCompactStateInvariantCommand(final Command superCommand, final Interaction interaction) {
- final CompoundCommand compoundCommand = new CompoundCommand(Messages.CustomCompactLifelifeCompactStateInvariantCreationEditPolicy_CreateStateInvariant);
- // creates the compact lifeline View
- compoundCommand.add(superCommand);
-
- final CommandResult superCommandResult = ((ICommandProxy)superCommand).getICommand().getCommandResult();
-
- final TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(interaction);
- if(editingDomain == null) {
- throw new IllegalStateException("no editing domain"); //$NON-NLS-1$
- }
-
- 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 View compactLifelineCompartmentView = ViewUtils.findCompactTimelineCompartmentView(compactLifelineView);
- StateInvariantUtils.createCompactStateInvariant(compactLifelineCompartmentView, -1, -1, -1);
- return CommandResult.newOKCommandResult();
- }
- };
- compoundCommand.add(new ICommandProxy(initStateDefinitionCommand));
- return compoundCommand;
- }
-
- protected InteractionEditPartTN getInteractionEditPart() {
- return (InteractionEditPartTN)EditPartUtils.findParentEditPartWithId(getHost(), InteractionEditPartTN.VISUAL_ID);
- }
-
- protected CompactLifelineCompartmentEditPartCN getCompactLifelineCompartmentEditPart() {
- 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
deleted file mode 100644
index df9eb3059c1..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomInteractionCompartmentItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.LifelineUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.LifelineUtils.LifelineType;
-import org.eclipse.papyrus.uml.diagram.timing.edit.commands.CompactLifelineCreateCommandCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.commands.FullLifelineCreateCommandCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.policies.InteractionCompartmentItemSemanticEditPolicyTN;
-import org.eclipse.papyrus.uml.diagram.timing.providers.UMLElementTypes;
-import org.eclipse.uml2.uml.Lifeline;
-
-public class CustomInteractionCompartmentItemSemanticEditPolicy extends InteractionCompartmentItemSemanticEditPolicyTN {
-
- @Override
- protected Command getCreateCommand(final CreateElementRequest req) {
- final IElementType elementType = req.getElementType();
- 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);
- LifelineUtils.setLifelineType(newElement, LifelineType.full);
- }
- });
- }
- 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);
- LifelineUtils.setLifelineType(newElement, LifelineType.compact);
- }
- });
- }
- 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/CustomInteractionCompartmentLayoutEditPolicy.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomInteractionCompartmentLayoutEditPolicy.java
deleted file mode 100644
index 62ca97effcb..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomInteractionCompartmentLayoutEditPolicy.java
+++ /dev/null
@@ -1,14 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies;
-
-/** Handles re-ordering Lifelines inside their interaction compartment through drag&drop */
-public class CustomInteractionCompartmentLayoutEditPolicy extends GenericListCompartmentLayoutEditPolicy {
- // nothing to customize for now
-}
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
deleted file mode 100644
index e7dab25d234..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomInteractionCreationEditPolicy.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies;
-
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.workspace.AbstractEMFOperation;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest.ViewAndElementDescriptor;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.Location;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.NotationFactory;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.PapyrusCreationEditPolicy;
-import org.eclipse.papyrus.uml.diagram.timing.custom.Messages;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.RefreshCommandForDo;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.FigureUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.ViewUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.GateEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.InteractionEditPartTN;
-
-public class CustomInteractionCreationEditPolicy extends PapyrusCreationEditPolicy {
-
- public CustomInteractionCreationEditPolicy() {
- }
-
- @Override
- protected Command getCreateCommand(final CreateViewRequest request) {
- final ICommandProxy superCommand = (ICommandProxy)super.getCreateCommand(request);
- final List<? extends ViewDescriptor> viewDescriptors = request.getViewDescriptors();
- if(request instanceof CreateViewAndElementRequest && viewDescriptors.size() == 1) {
- final String semanticHint = viewDescriptors.get(0).getSemanticHint();
- if(Integer.toString(GateEditPart.VISUAL_ID).equals(semanticHint)) {
- return getCreateGateCommand(request, superCommand);
- }
- }
- return superCommand;
- }
-
- /** Override the base creation command in order to position the new Gate Node where the user clicks */
- private Command getCreateGateCommand(final CreateViewRequest request, final ICommandProxy superCommand) {
- final CompoundCommand compoundCommand = new CompoundCommand(Messages.CustomInteractionCreationEditPolicy_CreateGate);
- compoundCommand.add(superCommand);
- final ICommand iCommand = superCommand.getICommand();
- 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 Node interactionView = (Node)ViewUtils.findSuperViewWithId(node, InteractionEditPartTN.VISUAL_ID);
- final Location interactionLocation = (Location)interactionView.getLayoutConstraint();
-
- final IFigure hostFigure = ((GraphicalEditPart)getHost()).getFigure();
- final Point point = new Point(request.getLocation());
- final Point origin = FigureUtils.getLayeredPaneOrigin(hostFigure);
- point.translate(origin);
- final Point location = FigureUtils.scaleByZoom(point, hostFigure);
-
- final Location loc = NotationFactory.eINSTANCE.createLocation();
- loc.setX(location.x - interactionLocation.getX());
- loc.setY(location.y - interactionLocation.getY());
- node.setLayoutConstraint(loc);
-
- return CommandResult.newOKCommandResult();
- }
- }));
- 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
deleted file mode 100644
index 660232a3b61..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomLifelineCompartmentGraphicalNodeEditPolicy.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies;
-
-import org.eclipse.draw2d.ConnectionAnchor;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.XYAnchor;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.ConnectionEditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.requests.CreateConnectionRequest;
-import org.eclipse.gef.requests.ReconnectRequest;
-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.utils.MessageUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.MessageLostEditPart;
-
-public class CustomLifelineCompartmentGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
-
- @Override
- protected INodeEditPart getConnectionCompleteEditPart(final Request request) {
- // connect to the Lifeline
- return (INodeEditPart)getHost().getParent();
- }
-
- @Override
- protected INodeEditPart getConnectableEditPart() {
- // connect to the Lifeline
- 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)}
- */
- @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);
- }
- 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)}
- */
- @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);
- }
- return super.getReconnectTargetCommand(request);
- }
-
- /** Returns the anchor for target feedback when creating a lost message */
- @Override
- protected ConnectionAnchor getTargetConnectionAnchor(final CreateConnectionRequest request) {
- return new XYAnchor(new Point(request.getLocation()));
- }
-
- /** Returns the anchor for source feedback when creating a found message */
- @Override
- protected ConnectionAnchor getSourceConnectionAnchor(final CreateConnectionRequest request) {
- final Point startLocation = MessageUtils.retrieveRequestStartLocation(request);
- 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
deleted file mode 100644
index 95920f05f8d..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomLifelineNameEditPolicy.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies;
-
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.LifelineVerticalLabel;
-import org.eclipse.papyrus.uml.diagram.timing.edit.policies.UMLTextSelectionEditPolicy;
-
-/** 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();
- label.setSelected(true);
- label.setFocus(true);
- }
-
- @Override
- protected void showSelection() {
- final LifelineVerticalLabel label = (LifelineVerticalLabel)getHostFigure();
- label.setSelected(true);
- label.setFocus(false);
- }
-
- @Override
- protected void hideSelection() {
- final LifelineVerticalLabel label = (LifelineVerticalLabel)getHostFigure();
- label.setSelected(false);
- label.setFocus(false);
- }
-
- @Override
- protected void showFocus() {
- final LifelineVerticalLabel label = (LifelineVerticalLabel)getHostFigure();
- label.setFocus(true);
- }
-
- @Override
- protected void hideFocus() {
- 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
deleted file mode 100644
index 139856ca5e8..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomMessageOccurrenceSpecificationItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies;
-
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.CustomMessageCreateCommand;
-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.custom.utils.OccurrenceSpecificationUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.commands.TimeConstraintCreateCommand;
-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;
-
-/** Semantic edit policy for {@link MessageOccurrenceSpecification}s */
-public class CustomMessageOccurrenceSpecificationItemSemanticEditPolicy extends MessageOccurrenceSpecificationItemSemanticEditPolicyCN {
-
- /** 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) {
- final Command baseCommand = super.getCommand(request);
- return OccurrenceSpecificationUtils.getHideOccurrenceSpecificationCommand(getHost(), baseCommand);
- }
- return super.getCommand(request);
- }
-
- @Override
- protected Command getCreateCommand(final CreateElementRequest req) {
- final IElementType elementType = req.getElementType();
- if(UMLElementTypes.TimeConstraint_15 == elementType) {
- return getGEFWrapper(new TimeConstraintCreateCommand(req));
- }
- if(UMLElementTypes.TimeObservation_16 == elementType) {
- return getGEFWrapper(new TimeObservationCreateCommand(req));
- }
- return super.getCreateCommand(req);
- }
-
- @Override
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
- return null;
- }
- if(MessageUtils.isMessage(requestElementType)) {
- return getGEFWrapper(new CustomMessageCreateCommand(req));
- }
- return super.getCreateRelationshipCommand(req);
- }
-
- @Override
- protected Command getReorientRelationshipCommand(final ReorientRelationshipRequest req) {
- return new ICommandProxy(new CustomMessageReorientCommand(req, getHost().getViewer()));
- }
-
-}
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
deleted file mode 100644
index 1ce6acf068e..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomOccurrenceSpecificationItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies;
-
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.CustomMessageCreateCommand;
-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.custom.utils.OccurrenceSpecificationUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.policies.OccurrenceSpecificationItemSemanticEditPolicyCN;
-
-/**
- * <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>Creates the CustomMessageCreateCommand
- * </ul>
- */
-public class CustomOccurrenceSpecificationItemSemanticEditPolicy extends OccurrenceSpecificationItemSemanticEditPolicyCN {
-
- /** 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) {
- final Command baseCommand = super.getCommand(request);
- return OccurrenceSpecificationUtils.getHideOccurrenceSpecificationCommand(getHost(), baseCommand);
- }
- return super.getCommand(request);
- }
-
- @Override
- protected Command getCreateRelationshipCommand(final CreateRelationshipRequest req) {
- final IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
- return null;
- }
- if(MessageUtils.isMessage(requestElementType)) {
- return getGEFWrapper(new CustomMessageCreateCommand(req));
- }
- return super.getCreateRelationshipCommand(req);
- }
-
- @Override
- protected Command getReorientRelationshipCommand(final ReorientRelationshipRequest req) {
- return new ICommandProxy(new CustomMessageReorientCommand(req, getHost().getViewer()));
- }
-}
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
deleted file mode 100644
index 374d48d8c08..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomTimelineCompartmentLayoutEditPolicy.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gef.requests.GroupRequest;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableEditPolicyEx;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.timing.custom.Messages;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.RefreshCommandForDo;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.RefreshCommandForUndo;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.FigureUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.GeneralOrderingUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.LifelineUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.OccurrenceSpecificationUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.RequestUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.StateDefinitionUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.StateInvariantUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.TimeElementUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineTimelineCompartmentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullStateInvariantEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullStateInvariantVerticalLineEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.StateDefinitionEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.part.UMLVisualIDRegistry;
-import org.eclipse.uml2.uml.Lifeline;
-import org.eclipse.uml2.uml.OccurrenceSpecification;
-import org.eclipse.uml2.uml.StateInvariant;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * This edit policy handles moving (through drag&drop) the elements in a Timeline compartment: StateInvariants,
- * OccurrenceSpecifications, etc.
- */
-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;
-
- private final List<IFigure> layoutFeedbackFigures = new ArrayList<IFigure>();
-
- @Override
- protected Command getMoveChildrenCommand(final Request request) {
- if(RequestUtils.isChangeBoundsRequestFor(request, UMLPackage.eINSTANCE.getStateInvariant())) {
- return getMoveStateInvariantCommand(request);
- } else if(RequestUtils.isChangeBoundsRequestFor(request, FullStateInvariantVerticalLineEditPart.class)) {
- return getMoveVerticalLinesCommand(request);
- } 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 Point location = changeBoundsRequest.getLocation();
- 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();
- compoundCommand.add(new RefreshCommandForUndo(lifelineEditPart));
- final StateDefinitionEditPart stateDefinitionEditPart = StateDefinitionUtils.findStateDefinitionClosestToOrdinate(lifelineEditPart, ordinate);
- if(stateDefinitionEditPart == null) {
- return UnexecutableCommand.INSTANCE;
- }
- 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();
- final TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(stateInvariant);
- if(editingDomain == null) {
- throw new IllegalStateException("no editing domain"); //$NON-NLS-1$
- }
-
- 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();
- LifelineUtils.updateFragmentNames(lifeline, lifelineView);
- return CommandResult.newOKCommandResult();
- }
- };
- compoundCommand.add(new ICommandProxy(updateStateInvariantCommand));
- }
- }
- compoundCommand.add(new RefreshCommandForDo(lifelineEditPart));
- return compoundCommand;
- }
-
- /**
- * When moving a VerticalLine, we actually move the OccurrenceSpecification that precedes it (that is important for
- * the layout).
- */
- private Command getMoveVerticalLinesCommand(final Request request) {
- final ChangeBoundsRequest changeBoundsRequest = (ChangeBoundsRequest)request;
-
- final CompoundCommand compoundCommand = new CompoundCommand(Messages.CustomTimelineCompartmentLayoutEditPolicy_MoveVerticalLine);
- 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();
-
- @SuppressWarnings("unchecked")
- final List<EditPart> editParts = changeBoundsRequest.getEditParts();
- final Point moveDelta = FigureUtils.scaleByZoom(changeBoundsRequest.getMoveDelta(), lifelineEditPart.getFigure());
- // no vertical move
- moveDelta.y = 0;
- 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();
- final int index = timelineCompartmentView.getChildren().indexOf(verticalLineView);
- 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;
- nodesToMove.add(occurrenceSpecificationNode);
- indexes.add(Integer.valueOf(occurrenceSpecificationIndex));
- }
- }
- }
- }
- int i = 0;
- for(final Node node : nodesToMove) {
- compoundCommand.add(getMoveOccurrenceSpecificationCommand(node, moveDelta, timelineCompartmentView, indexes.get(i).intValue(), allMovedNodes));
- i++;
- }
- compoundCommand.add(new RefreshCommandForDo(lifelineEditPart));
- return compoundCommand;
- }
-
- private Command getMoveOccurrenceSpecificationsCommand(final Request request) {
- final ChangeBoundsRequest changeBoundsRequest = (ChangeBoundsRequest)request;
-
- final CompoundCommand compoundCommand = new CompoundCommand(Messages.CustomTimelineCompartmentLayoutEditPolicy_MoveOccurrenceSpecification);
- 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();
- @SuppressWarnings("unchecked")
- final List<EditPart> editParts = changeBoundsRequest.getEditParts();
- final Point moveDelta = FigureUtils.scaleByZoom(changeBoundsRequest.getMoveDelta(), lifelineEditPart.getFigure());
- // no vertical move
- 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();
- // 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) {
- final int index = timelineCompartmentView.getChildren().indexOf(node);
- if(index >= 0) {
- compoundCommand.add(getMoveOccurrenceSpecificationCommand(node, moveDelta, timelineCompartmentView, index, allMovedNodes));
- }
- }
-
- compoundCommand.add(new RefreshCommandForDo(lifelineEditPart));
- return compoundCommand;
- }
-
- @SuppressWarnings("unchecked")
- 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);
- // when the request is sent directly, for example in unit tests
- 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;
- final Object model = graphicalEditPart.getModel();
- if(model instanceof Node) {
- final Node node = (Node)model;
- allMovedNodes.add(node);
- }
- }
- }
- }
- }
- return allMovedNodes;
- }
-
- /** returns a NonResizableEditPolicy instead of a ResizableEditPolicy for some children */
- @Override
- protected EditPolicy createChildEditPolicy(final EditPart child) {
- 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)) {
- return createNonResizableEditPolicy();
- }
- return super.createChildEditPolicy(child);
- }
-
- 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)
- */
- @Override
- protected Command getMoveCommand(final ChangeBoundsRequest request) {
- final ChangeBoundsRequest req = new ChangeBoundsRequest(REQ_MOVE_CHILDREN);
- // we lose the information when we do that:
- req.setEditParts(getHost());
- @SuppressWarnings("unchecked")
- final Map<Object, Object> extendedData = request.getExtendedData();
- // so we store it in the extended data
- extendedData.put(ALL_MOVED_EDITPARTS, request.getEditParts());
- req.setMoveDelta(request.getMoveDelta());
- req.setSizeDelta(request.getSizeDelta());
- req.setLocation(request.getLocation());
- req.setExtendedData(extendedData);
- return getHost().getParent().getCommand(req);
- }
- };
- }
-
- @Override
- protected void showLayoutTargetFeedback(final Request request) {
- if(!RequestUtils.isChangeBoundsRequestFor(request, UMLPackage.eINSTANCE.getStateInvariant())) {
- return;
- }
- eraseLayoutTargetFeedback();
- 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) {
- 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);
- feedbackBounds.scale(scale);
- this.layoutFeedbackFigures.add(createLayoutTargetFeedbackFigure(feedbackBounds));
- }
- }
-
- private int computeTargetOrdinate(final ChangeBoundsRequest request) {
- final int ordinate = request.getLocation().y;
- final FullLifelineEditPartCN lifelineEditPart = (FullLifelineEditPartCN)getHost().getParent();
- final StateDefinitionEditPart stateDefinitionEditPart = StateDefinitionUtils.findStateDefinitionClosestToOrdinate(lifelineEditPart, ordinate);
-
- final Rectangle figureBounds = stateDefinitionEditPart.getFigure().getBounds();
- return figureBounds.y + figureBounds.height / 2;
- }
-
- protected IFigure createLayoutTargetFeedbackFigure(final Rectangle bounds) {
- final RectangleFigure r = new RectangleFigure();
- r.setForegroundColor(ColorConstants.darkBlue);
- r.setBackgroundColor(ColorConstants.lightBlue);
- r.setBounds(bounds);
- r.validate();
- addFeedback(r);
- return r;
- }
-
- @Override
- protected void eraseLayoutTargetFeedback(final Request request) {
- if(!RequestUtils.isChangeBoundsRequestFor(request, UMLPackage.eINSTANCE.getStateInvariant())) {
- return;
- }
- eraseLayoutTargetFeedback();
- }
-
- private void eraseLayoutTargetFeedback() {
- 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
deleted file mode 100644
index ab9c22abd48..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/CustomTimingDiagramCreationEditPolicy.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies;
-
-import java.util.List;
-
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.PapyrusCreationEditPolicy;
-import org.eclipse.papyrus.uml.diagram.timing.custom.Messages;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.RefreshCommandForDo;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.RefreshCommandForUndo;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.TimeRulerUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.InteractionEditPartTN;
-
-/** Adds a free time ruler to new Interactions. */
-public class CustomTimingDiagramCreationEditPolicy extends PapyrusCreationEditPolicy {
-
- public CustomTimingDiagramCreationEditPolicy() {
- }
-
- @Override
- 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) {
- final String semanticHint = viewDescriptors.get(0).getSemanticHint();
- 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(superCommand);
- compoundCommand.add(new ICommandProxy(TimeRulerUtils.getCreateFreeTimeRulerCommand(superCommand, editingDomain, true)));
- compoundCommand.add(new RefreshCommandForDo((IGraphicalEditPart)getHost()));
- return compoundCommand;
- }
- }
- return superCommand;
- }
-}
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
deleted file mode 100644
index c4ee9ee3a8f..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/ExternalLabelPrimaryDragRoleEditPolicy.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
- * Nicolas Bros (Mia-Software) - remove dead code, refresh on execute/undo/redo
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SetBoundsCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableLabelEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.RefreshCommandForDo;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.RefreshCommandForUndo;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.FigureUtils;
-
-/**
- * This policy provides the selection handles, feedback and move command for an external node label. The expected
- * behavior is to provide an external label that can freely move and with a link feedback towards its parent figure
- * during the move.
- *
- * @author nbros : I copied this class from
- * org.eclipse.papyrus.uml.diagram.clazz.custom.policies.ExternalLabelPrimaryDragRoleEditPolicy, removed dead
- * code, added a Refresh, and constrained the bounds within the containing compartment.
- */
-public class ExternalLabelPrimaryDragRoleEditPolicy extends NonResizableLabelEditPolicy {
-
- @Override
- protected List<?> createSelectionHandles() {
- 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 IFigure parentFigure = getHostFigure().getParent();
- final Rectangle parentBounds = parentFigure.getBounds();
-
- // First, start from the original bounds
- Rectangle updatedBounds = new Rectangle(getInitialFeedbackBounds());
- // Add the delta corresponding to the move
- updatedBounds = updatedBounds.getTranslated(FigureUtils.scaleByZoom(request.getMoveDelta(), parentFigure));
- // Constrain the bounds within the containing compartment if any
- updatedBounds = FigureUtils.constrainBoundsWithinContainingCompartment(updatedBounds, getHostFigure());
- // Then translate the bounds so that they are relative to the figure (BorderItemContainerFigure)
- // to which the label is attached
- 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 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
deleted file mode 100644
index aa8b7a5554a..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/FirstEventRefreshEditPolicy.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.GraphicalEditPolicy;
-import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
-import org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.Utils;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * This EditPolicy adds a notification listener on the UML element of its EditPart in order to refresh the notation
- * model in response to changes in the semantic model.
- */
-public class FirstEventRefreshEditPolicy extends GraphicalEditPolicy implements NotificationListener, IPapyrusListener {
-
- public static final String VIEW_REFRESH_ROLE = "ViewRefreshRole"; //$NON-NLS-1$
-
- private Element umlElement;
-
- public FirstEventRefreshEditPolicy() {
- super();
- }
-
- @Override
- public void activate() {
- this.umlElement = getUMLElement();
- if(this.umlElement == null) {
- return;
- }
- // adds a listener on the UML element
- getDiagramEventBroker().addNotificationListener(this.umlElement, this);
- // initial refresh
- refreshView();
- }
-
- @Override
- public void deactivate() {
- // retrieve the UML element managed by the edit part
- if(this.umlElement == null) {
- return;
- }
- // remove the listener from the UML element
- getDiagramEventBroker().removeNotificationListener(this.umlElement, this);
- }
-
- /**
- * Gets the diagram event broker from the editing domain.
- *
- * @return the diagram event broker
- */
- protected DiagramEventBroker getDiagramEventBroker() {
- final TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
- if(editingDomain != null) {
- return DiagramEventBroker.getInstance(editingDomain);
- }
- return null;
- }
-
- /**
- * Returns the uml element controlled by the host edit part
- *
- * @return the uml element controlled by the host edit part
- */
- protected Element getUMLElement() {
- final View view = getView();
- if(view != null) {
- return (Element)view.getElement();
- }
- return null;
- }
-
- /**
- * Returns the view controlled by the host edit part
- *
- * @return the view controlled by the host edit part
- */
- protected View getView() {
- return (View)getHost().getModel();
- }
-
- public void notifyChanged(final Notification notification) {
- 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()) {
- refreshView();
- }
- }
- }
-
- /** Refreshes the View for the element controlled by the edit part with this edit policy */
- public void refreshView() {
- final EditPart compartmentEditPart = EditPartUtils.findParentTimelineCompartment(getHost());
- final Command command = compartmentEditPart.getCommand(AbstractTimelineLayoutPolicy.UPDATE_LAYOUT_REQUEST);
- final TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(getView());
- Utils.executeLaterUnprotected(command, domain);
- }
-}
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
deleted file mode 100644
index ceeb6eed568..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/GenericListCompartmentLayoutEditPolicy.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.TreeMap;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConstrainedToolbarLayoutEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableEditPolicyEx;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.RefreshCommandForDo;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.RefreshCommandForUndo;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.FigureUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.ViewUtils;
-
-/**
- * Handles re-ordering Views inside their compartment through drag&drop. This policy is meant to be installed on a list
- * compartment.
- */
-// meant to be overridden
-@SuppressWarnings("static-method")
-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();
- }
-
- protected int getLayoutFeedbackHeight() {
- return LAYOUT_FEEDBACK_HEIGHT;
- }
-
- @Override
- protected EditPolicy createChildEditPolicy(final EditPart child) {
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
- // add an edit policy so that children can be moved
- result = new NonResizableEditPolicyEx();
- }
- return result;
- }
-
- @Override
- protected Command getMoveChildrenCommand(final Request request) {
- if(request instanceof ChangeBoundsRequest) {
- final ChangeBoundsRequest changeBoundsRequest = (ChangeBoundsRequest)request;
-
- final InsertionPoint insertionPoint = computeClosestInsertionPoint(changeBoundsRequest.getLocation().y);
- if(insertionPoint == null) {
- return UnexecutableCommand.INSTANCE;
- }
-
- 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();
-
- final GraphicalEditPart editPartToRefresh = getEditPartToRefresh();
- final CompoundCommand compoundCommand = new CompoundCommand();
- compoundCommand.add(new RefreshCommandForUndo(editPartToRefresh));
- compoundCommand.add(new ICommandProxy(ViewUtils.getMoveViewCommand(compartmentView, view, insertionPoint.getIndex())));
- compoundCommand.add(new RefreshCommandForDo(editPartToRefresh));
- return compoundCommand;
- }
- }
- }
- return null;
- }
-
- @Override
- protected void showLayoutTargetFeedback(final Request request) {
- if(request instanceof ChangeBoundsRequest) {
- eraseLayoutTargetFeedback();
- final ChangeBoundsRequest changeBoundsRequest = (ChangeBoundsRequest)request;
-
- final InsertionPoint insertionPoint = computeClosestInsertionPoint(changeBoundsRequest.getLocation().y);
- 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 Point origin = FigureUtils.getLayeredPaneOrigin(getHostFigure());
- feedbackBounds.translate(origin);
- final double scale = FigureUtils.getScale(getHostFigure());
- feedbackBounds.width *= scale;
- feedbackBounds.height *= scale;
- this.layoutFeedbackFigure = createLayoutTargetFeedbackFigure(feedbackBounds);
- }
- }
-
- protected class InsertionPoint {
-
- int index;
-
- int location;
-
- public InsertionPoint(final int index, final int location) {
- this.index = index;
- this.location = location;
- }
-
- public int getIndex() {
- return this.index;
- }
-
- public int getLocation() {
- return this.location;
- }
- }
-
- protected InsertionPoint computeClosestInsertionPoint(final int offset) {
- @SuppressWarnings("unchecked")
- final List<GraphicalEditPart> children = getHost().getChildren();
- 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) {
- final int distance = Math.abs(offset - insertionPoint.getLocation());
- distanceMap.put(Integer.valueOf(distance), insertionPoint);
- }
- final Entry<Integer, InsertionPoint> firstEntry = distanceMap.firstEntry();
- return firstEntry.getValue();
- }
-
- protected int getMarginBeforeFirst() {
- return MARGIN_BEFORE_FIRST;
- }
-
- protected int getMarginAfterLast() {
- return MARGIN_AFTER_LAST;
- }
-
- protected List<InsertionPoint> computeInsertionPoints(final List<GraphicalEditPart> children) {
- final int size = children.size();
- final List<InsertionPoint> insertionPoints = new ArrayList<GenericListCompartmentLayoutEditPolicy.InsertionPoint>();
- Rectangle previousBounds = null;
- 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) {
- // 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) {
- // last insertion point: after the last figure
- insertionPoints.add(new InsertionPoint(i + 1, bounds.y + bounds.height + getMarginAfterLast()));
- }
- previousBounds = bounds;
- }
- return insertionPoints;
- }
-
- protected IFigure createLayoutTargetFeedbackFigure(final Rectangle bounds) {
- final RectangleFigure r = new RectangleFigure();
- r.setForegroundColor(ColorConstants.darkBlue);
- r.setBackgroundColor(ColorConstants.lightBlue);
- r.setBounds(bounds);
- r.validate();
- addFeedback(r);
- return r;
- }
-
- @Override
- protected void eraseLayoutTargetFeedback(final Request request) {
- eraseLayoutTargetFeedback();
- }
-
- protected void eraseLayoutTargetFeedback() {
- if(this.layoutFeedbackFigure != null) {
- removeFeedback(this.layoutFeedbackFigure);
- this.layoutFeedbackFigure = null;
- }
- }
-
- @Override
- protected Command getCreateCommand(final CreateRequest request) {
- return 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
deleted file mode 100644
index f7385ae724f..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/LayoutEditPolicyForLabel.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.part.UMLVisualIDRegistry;
-
-/**
- * Returns {@link ExternalLabelPrimaryDragRoleEditPolicy} for the associated label in order to display a link between
- * the label and associated edit part while dragging the label.
- */
-public class LayoutEditPolicyForLabel extends LayoutEditPolicy {
-
- private final int labelVisualId;
-
- public LayoutEditPolicyForLabel(final int labelVisualId) {
- this.labelVisualId = labelVisualId;
- }
-
- @Override
- protected EditPolicy createChildEditPolicy(final EditPart child) {
- 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) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- @Override
- protected Command getMoveChildrenCommand(final Request request) {
- return null;
- }
-
- @Override
- protected Command getCreateCommand(final CreateRequest request) {
- return null;
- }
-
-}
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
deleted file mode 100644
index 7e0de86946e..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/SelectionOnlyLayoutEditPolicy.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-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;
- }
-
- @Override
- protected Command getCreateCommand(final CreateRequest request) {
- return null;
- }
-
- @Override
- protected EditPolicy createChildEditPolicy(final EditPart child) {
- final NonResizableEditPolicy nonResizableEditPolicy = new NonResizableEditPolicy();
- nonResizableEditPolicy.setDragAllowed(false);
- return nonResizableEditPolicy;
- }
-}
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
deleted file mode 100644
index af03e4a5887..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/TimeRulerVisibilityRefreshEditPolicy.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.editpolicies.GraphicalEditPolicy;
-import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
-import org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener;
-import org.eclipse.papyrus.uml.diagram.timing.custom.figures.LifelineFigure;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.FigureUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.ViewUtils;
-
-/**
- * This EditPolicy adds a notification listener on the time ruler View that listens for its visibility and updates the
- * {@link LifelineFigure#setDisplayTimeRuler(boolean) LifelineFigure's time ruler visibility}
- */
-public class TimeRulerVisibilityRefreshEditPolicy extends GraphicalEditPolicy implements NotificationListener, IPapyrusListener {
-
- public static final String ROLE = "TimeRulerVisibilityRefreshRole"; //$NON-NLS-1$
-
- private View timeRulerCompartmentView;
-
- public TimeRulerVisibilityRefreshEditPolicy() {
- super();
- }
-
- @Override
- public void activate() {
-
- this.timeRulerCompartmentView = getListenedView();
- if(this.timeRulerCompartmentView == null) {
- return;
- }
- // adds a listener on the View
- getDiagramEventBroker().addNotificationListener(this.timeRulerCompartmentView, this);
- // initial refresh (so that the figure has the right visibility when the diagram is first opened)
- refreshFigure();
- }
-
- @Override
- public void deactivate() {
- if(this.timeRulerCompartmentView == null) {
- return;
- }
- // remove the listener from the View
- getDiagramEventBroker().removeNotificationListener(this.timeRulerCompartmentView, this);
- }
-
- /**
- * Gets the diagram event broker from the editing domain.
- *
- * @return the diagram event broker
- */
- protected DiagramEventBroker getDiagramEventBroker() {
- final TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
- if(editingDomain != null) {
- return DiagramEventBroker.getInstance(editingDomain);
- }
- return null;
- }
-
- protected View getListenedView() {
- final View view = getView();
- if(view != null) {
- return ViewUtils.findTimeRulerCompartmentView(view);
- }
- return null;
- }
-
- protected View getView() {
- return (View)getHost().getModel();
- }
-
- public void notifyChanged(final Notification notification) {
- if(notification.getEventType() == Notification.SET) {
- final Object feature = notification.getFeature();
- if(feature == NotationPackage.eINSTANCE.getView_Visible()) {
- refreshFigure();
- }
- }
- }
-
- /**
- * Refreshes the "displayTimeRuler" attribute of the LifelineFigure so that it matches the visibility of the
- * TimeRulerCompartment View.
- */
- public void refreshFigure() {
- final boolean visible = getListenedView().isVisible();
- 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
deleted file mode 100644
index 2eda7e42da8..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/edit/policies/TimingDiagramDragDropEditPolicy.java
+++ /dev/null
@@ -1,363 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.custom.edit.policies;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
-import org.eclipse.gmf.runtime.notation.Location;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.NotationFactory;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.CommonDiagramDragDropEditPolicy;
-import org.eclipse.papyrus.uml.diagram.timing.custom.Messages;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.commands.ValidateInteractionCommand;
-import org.eclipse.papyrus.uml.diagram.timing.custom.edit.parts.CustomCompactLifelineCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.custom.helper.TimingDiagramLinkMappingHelper;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.DropUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.InteractionUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.LifelineUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.LifelineUtils.LifelineType;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.MessageUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.StateDefinitionUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.StateInvariantUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.Utils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.ViewUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.DurationConstraintEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.DurationObservationEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.GateEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.GeneralOrderingEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.InteractionCompartmentEditPartTN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.InteractionEditPartTN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.MessageAsyncEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.MessageCreateEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.MessageDeleteEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.MessageFoundEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.MessageLostEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.MessageReplyEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.MessageSyncEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.TimeConstraintEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.TimeObservationEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.uml.diagram.timing.providers.UMLElementTypes;
-import org.eclipse.papyrus.uml.diagram.timing.providers.UMLViewProvider;
-import org.eclipse.uml2.uml.DestructionOccurrenceSpecification;
-import org.eclipse.uml2.uml.DurationConstraint;
-import org.eclipse.uml2.uml.DurationObservation;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Gate;
-import org.eclipse.uml2.uml.GeneralOrdering;
-import org.eclipse.uml2.uml.Interaction;
-import org.eclipse.uml2.uml.InteractionFragment;
-import org.eclipse.uml2.uml.Lifeline;
-import org.eclipse.uml2.uml.Message;
-import org.eclipse.uml2.uml.MessageOccurrenceSpecification;
-import org.eclipse.uml2.uml.OccurrenceSpecification;
-import org.eclipse.uml2.uml.StateInvariant;
-import org.eclipse.uml2.uml.TimeConstraint;
-import org.eclipse.uml2.uml.TimeObservation;
-
-public class TimingDiagramDragDropEditPolicy extends CommonDiagramDragDropEditPolicy {
-
- /** 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 };
-
- public TimingDiagramDragDropEditPolicy() {
- super(TimingDiagramLinkMappingHelper.getInstance());
- }
-
- /** override the drop command */
- @Override
- protected Command getSpecificDropCommand(final DropObjectsRequest dropRequest, final Element semanticElement, final int nodeVISUALID, final int linkVISUALID) {
- switch(nodeVISUALID) {
- case InteractionEditPartTN.VISUAL_ID:
- return new ICommandProxy(dropMainElement(dropRequest, semanticElement, nodeVISUALID));
- case FullLifelineEditPartCN.VISUAL_ID:
- case CompactLifelineEditPartCN.VISUAL_ID:
- return new ICommandProxy(dropLifeline(dropRequest, semanticElement, nodeVISUALID));
- 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(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 == 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 == 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()));
- }
- }
-
- return super.getSpecificDropCommand(dropRequest, semanticElement, nodeVISUALID, linkVISUALID);
-
- }
-
- private ICommand dropLifeline(final DropObjectsRequest dropRequest, final Element semanticElement, final int nodeVISUALID) {
- if(!(semanticElement instanceof Lifeline)) {
- throw new IllegalArgumentException();
- }
- 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) {
- cc.add(dropStateDefinitions(lifeline, dropMainElementCommand.getCommandResult()));
- }
- cc.add(dropLifelineFragments(lifeline, dropMainElementCommand.getCommandResult(), lifelineType));
- return cc;
- }
-
- private static ICommand dropStateDefinitions(final Lifeline lifeline, final CommandResult lifelineCreateViewCommandResult) {
- 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) {
- 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) {
- 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);
- // restore the same id
- StateDefinitionUtils.setStateDefinitionViewID(stateDefinitionView, stateDefinitionId);
- // set the name on the View
- StateDefinitionUtils.setStateDefinitionName(stateDefinitionView, stateDefinitionName);
- }
-
- }
- return CommandResult.newOKCommandResult();
- }
- };
- }
-
- private static ICommand dropLifelineFragments(final Lifeline lifeline, final CommandResult lifelineCreateViewCommandResult, final LifelineType lifelineType) {
- 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) {
- return CommandResult.newErrorCommandResult("Parent Lifeline not found"); //$NON-NLS-1$
- }
-
- 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) {
- // add a vertical line
- umlViewProvider.createNode_39(null, compartmentView, -1, true, PreferencesHint.USE_DEFAULTS);
- }
- final StateInvariant stateInvariant = (StateInvariant)fragment;
- final String stateInvariantName = StateInvariantUtils.getInnerStateInvariantName(stateInvariant);
-
- if(lifelineType == LifelineType.full) {
- if(Utils.safeEquals(stateInvariantName, previousStateInvariantName)) {
- x += 10;
- } else {
- x += 25;
- }
- } else {
- x += 60;
- }
-
- // create the View for the state invariant
- if(lifelineType == LifelineType.full) {
- umlViewProvider.createStateInvariant_11(stateInvariant, compartmentView, -1, true, PreferencesHint.USE_DEFAULTS);
- } 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;
- // create the View for the occurrence specification
- 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;
- // create the View for the occurrence specification
- 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)