diff options
| author | Pierre Guilet | 2018-07-11 09:26:27 +0000 |
|---|---|---|
| committer | Pierre Guilet | 2018-08-09 16:20:18 +0000 |
| commit | fc136a892b32a867e75d8e0b218a8c3868d8103a (patch) | |
| tree | 8e2f2712137ca6f1eca6ff7c5c50feac94faed93 | |
| parent | 254f806c763563051ced8e39ae9defd1c9cb1d10 (diff) | |
| download | org.eclipse.sirius-fc136a892b32a867e75d8e0b218a8c3868d8103a.tar.gz org.eclipse.sirius-fc136a892b32a867e75d8e0b218a8c3868d8103a.tar.xz org.eclipse.sirius-fc136a892b32a867e75d8e0b218a8c3868d8103a.zip | |
[527109] Add a dropdown menu containing the diagram editor modes
A drop down menu has been added to the tabbar. This menu contains the
actions to activate the edit modes (default, showing and layouting mode)
These action were previously present as a checked button out of a drop
down menu.
Remove the property system allowing to activate/deactivate the show/hide
mode functionality. It is now always activated.
Add tests.
Bug: 527109
Change-Id: I2ed775115f327612ff3f63ca56d460bd056f463f
Signed-off-by: Pierre Guilet <pierre.guilet@obeo.fr>
48 files changed, 2971 insertions, 496 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/figure/OperandFigure.java b/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/figure/OperandFigure.java index 7e40681c9d..17403af53b 100644 --- a/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/figure/OperandFigure.java +++ b/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/figure/OperandFigure.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2015 THALES GLOBAL SERVICES and others. + * Copyright (c) 2010, 2018 THALES GLOBAL SERVICES and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -39,17 +39,16 @@ public class OperandFigure extends GradientRoundedRectangle { * the current operand */ public OperandFigure(final Dimension dimension, final BackgroundStyle backgroundStyle, Operand operand) { - super(dimension, backgroundStyle); + super(dimension, backgroundStyle, null); this.operand = operand; this.setFill(false); this.setOutline(false); } - + /** - * The outline of the shape is disabled for Operands which have a specific - * border figure. + * The outline of the shape is disabled for Operands which have a specific border figure. */ @Override public void setOutline(boolean b) { @@ -78,8 +77,7 @@ public class OperandFigure extends GradientRoundedRectangle { } /** - * Check if it is the last operand. In that case we do not need to paint the - * operand separator. + * Check if it is the last operand. In that case we do not need to paint the operand separator. */ private boolean isLastOperand() { boolean isLast = false; diff --git a/plugins/org.eclipse.sirius.diagram.ui/icons/defaultMode.png b/plugins/org.eclipse.sirius.diagram.ui/icons/defaultMode.png Binary files differnew file mode 100644 index 0000000000..41a013842b --- /dev/null +++ b/plugins/org.eclipse.sirius.diagram.ui/icons/defaultMode.png diff --git a/plugins/org.eclipse.sirius.diagram.ui/icons/showingMode_activate.gif b/plugins/org.eclipse.sirius.diagram.ui/icons/showingMode_activate.gif Binary files differdeleted file mode 100644 index 30ed929871..0000000000 --- a/plugins/org.eclipse.sirius.diagram.ui/icons/showingMode_activate.gif +++ /dev/null diff --git a/plugins/org.eclipse.sirius.diagram.ui/icons/showingMode_activate.png b/plugins/org.eclipse.sirius.diagram.ui/icons/showingMode_activate.png Binary files differnew file mode 100644 index 0000000000..1b4fb5f9ea --- /dev/null +++ b/plugins/org.eclipse.sirius.diagram.ui/icons/showingMode_activate.png diff --git a/plugins/org.eclipse.sirius.diagram.ui/plugin.properties b/plugins/org.eclipse.sirius.diagram.ui/plugin.properties index fd11ce1513..d57a8035b3 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/plugin.properties +++ b/plugins/org.eclipse.sirius.diagram.ui/plugin.properties @@ -852,6 +852,8 @@ DeactivateRulesCommand_label = Deactivate validation rules DefaultLayerName = Default DefaultTabbarContributorProvider_contributionError = Cannot instantiate the ITabbarContributor contribution DefaultTabbarContributorProvider_contributionError_withId = Cannot instantiate the ITabbarContributor contribution in {0} extension +DefaultModeAction_statusOn=Standard Mode +DefaultModeAction_Label=Standard Mode DeleteRelatedNoteAttachmentsTask_label = Delete Related GMF note attachments DeleteRelatedNotesTask_label = Delete Related GMF notes DeselectAllAction_label = Deselect All @@ -921,10 +923,10 @@ DistributeMenuAction_text = &Distribute DistributeMenuAction_tooltip = Distribute selected shapes DocumentationPropertySection_defaultLabel = Documentation: DocumentationPropertySection_description = Use this field to save notes about this representation. -DoubleClickEditPolicy_layerConfirmDialogTitle=Layer activation confirmation -DoubleClickEditPolicy_layerConfirmDialogBody=Making visible this diagram element will activate the layer ''{0}''. Do you still want to make it visible?" -DoubleClickEditPolicy_filterConfirmDialogTitle=Filter deactivation confirmation -DoubleClickEditPolicy_filterConfirmDialogBody=Making visible this diagram element will deactivate the filter(s) ''{0}''. Do you still want to make it visible?" +DoubleClickEditPolicy_layerConfirmDialogBody=Making visible this diagram element will activate the layer ''{0}''. +DoubleClickEditPolicy_confirmDialogTitle=Filter/layer update confirmation +DoubleClickEditPolicy_filterConfirmDialogBody=Making visible this diagram element will deactivate the filter(s) ''{0}''. +DoubleClickEditPolicy_confirmDialogAsking=Do you still want to make it visible? EclipseImageSelectorDescriptor_extensionLoadingError = Error while loading the extension {0} EdgeGroupMoveMessage = Move edge group EdgeReconnectionHelper_invalidReconnectionKind = reconnectionKind must be ReconnectionKind.RECONNECT_SOURCE or ReconnectionKind.RECONNECT_TARGET @@ -982,8 +984,7 @@ LayoutDataHelperImpl_unkownLayoutData = Layoutdata of type {0} is unknown LayoutData_illegalTarget = The target of a LayoutData can only be an AbstractDNode, a DEdge or a DDiagram. LayoutData_unhandledDiagramElementKind = This kind of diagram element ({0}) is not yet managed by the LayoutDataManager. LayoutProviderDescriptor_initializationErrorMsg = CoreException during the initialization of the AIR Layout Provider {0} -LayoutingModeSwitchingAction_activate = Activate Layouting Mode -LayoutingModeSwitchingAction_deactivate = Deactivate Layouting Mode +LayoutingModeSwitchingAction_label = Layouting Mode LayoutingModeSwitchingAction_statusOn = Layouting Mode LocationURI_ParsePb_Blank = The location URI has not been set. It must start at least by one of the accepted schemes: "{0}" or "{1}" LocationURI_ParsePb_MoreThanTwoLocations = A maximum of two locations URI separated by a {0} can be set. You have currently {1} locations @@ -1098,13 +1099,12 @@ SetLayoutingModeCommandAndUpdateActionImage_activateLabel = Activating Layouting SetLayoutingModeCommandAndUpdateActionImage_deactivateLabel = Deactivating Layouting mode SetLayoutingModeCommand_activateLabel = Activating Layouting mode SetLayoutingModeCommand_deactivateLabel = Deactivating Layouting mode -SetShowingModeCommandAndUpdateActionImage_activateLabel = Activating Showing mode -SetShowingModeCommandAndUpdateActionImage_deactivateLabel = Deactivating Showing mode +SetShowingModeCommandAndUpdateActionImage_activateLabel = Activating Visibility mode +SetShowingModeCommandAndUpdateActionImage_deactivateLabel = Deactivating Visibility mode SetStyleToWorkspaceImageAction_text = Set style to workspace image ShiftDirectBorderedNodesOperation_name = Shift bordered nodes'' positions by {0} -ShowingModeSwitchingAction_activate= Activate Showing mode -ShowingModeSwitchingAction_deactivate= Deactivate Showing mode -ShowingModeSwitchingAction_statusOn = Showing Mode +ShowingModeSwitchingAction_label= Visibility Mode +ShowingModeSwitchingAction_statusOn = Visibility Mode SimpleImageTranscoder_svgImageTranscodingError = Error transcoding SVG image SimpleStyleConfiguration_iconFileNotFound = Icon file "{0}" not found SiriusBaseItemSemanticEditPolicy_deleteCmdLabel = Delete element diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/view/ShowingViewUtil.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/view/ShowingViewUtil.java index d3d566d32f..2c2bdb1d2f 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/view/ShowingViewUtil.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/view/ShowingViewUtil.java @@ -18,6 +18,7 @@ import java.util.stream.Collectors; import org.eclipse.draw2d.Graphics; import org.eclipse.draw2d.IFigure; +import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EObject; import org.eclipse.gef.editparts.AbstractGraphicalEditPart; import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart; @@ -25,8 +26,14 @@ import org.eclipse.gmf.runtime.notation.Edge; import org.eclipse.gmf.runtime.notation.NotationPackage; import org.eclipse.gmf.runtime.notation.View; import org.eclipse.sirius.diagram.DDiagram; +import org.eclipse.sirius.diagram.DDiagramElement; +import org.eclipse.sirius.diagram.GraphicalFilter; +import org.eclipse.sirius.diagram.HideFilter; +import org.eclipse.sirius.diagram.HideLabelFilter; +import org.eclipse.sirius.diagram.business.internal.metamodel.spec.DEdgeSpec; import org.eclipse.sirius.diagram.ui.business.api.query.ViewQuery; import org.eclipse.sirius.diagram.ui.edit.internal.part.DiagramElementEditPartOperation; +import org.eclipse.sirius.diagram.ui.tools.api.figure.SiriusWrapLabel; /** * This utility class contains methods to handle {@link View} and to take in consideration the activation status of the @@ -257,7 +264,16 @@ public final class ShowingViewUtil { public static void initGraphicsForVisibleAndInvisibleElements(IFigure figure, Graphics graphics, View correspondingView) { graphics.pushState(); ViewQuery viewQuery = new ViewQuery(correspondingView); - if (figure.isVisible() != correspondingView.isVisible() && viewQuery.isInShowingMode()) { + if (figure instanceof SiriusWrapLabel) { + // labels do not have any view associated so we have to check the filters on the node view containing the + // label. + EList<GraphicalFilter> graphicalFilters = ((DDiagramElement) correspondingView.getElement()).getGraphicalFilters(); + boolean isLabelFiltered = graphicalFilters.stream().anyMatch(HideLabelFilter.class::isInstance) || graphicalFilters.stream().anyMatch(HideFilter.class::isInstance) + || (correspondingView instanceof Edge && !((DEdgeSpec) correspondingView.getElement()).isVisible()); + if (isLabelFiltered && viewQuery.isInShowingMode()) { + graphics.setAlpha(50); + } + } else if (figure.isVisible() != correspondingView.isVisible() && viewQuery.isInShowingMode()) { graphics.setAlpha(50); } } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramElementContainerEditPart.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramElementContainerEditPart.java index 2c2c325b21..187339b18b 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramElementContainerEditPart.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramElementContainerEditPart.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2017 THALES GLOBAL SERVICES and others. + * Copyright (c) 2007, 2018 THALES GLOBAL SERVICES and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -447,18 +447,19 @@ public abstract class AbstractDiagramElementContainerEditPart extends AbstractBo final DDiagramElementContainer container = (DDiagramElementContainer) diagramElement; ContainerStyle ownedStyle = container.getOwnedStyle(); if (ownedStyle instanceof ShapeContainerStyle) { - shapeFigure = new ViewNodeContainerParallelogram(); + shapeFigure = new ViewNodeContainerParallelogram((View) getModel()); } else if (ownedStyle instanceof WorkspaceImage) { - shapeFigure = new ViewNodeContainerRectangleFigureDesc(); + shapeFigure = new ViewNodeContainerRectangleFigureDesc((View) getModel()); } } else { deactivate(); } if (shapeFigure == null) { if (isRegion()) { - shapeFigure = new RegionRoundedGradientRectangle(DiagramContainerEditPartOperation.getCornerDimension(this), DiagramContainerEditPartOperation.getBackgroundStyle(this)); + shapeFigure = new RegionRoundedGradientRectangle(DiagramContainerEditPartOperation.getCornerDimension(this), DiagramContainerEditPartOperation.getBackgroundStyle(this), + (View) getModel()); } else { - shapeFigure = new GradientRoundedRectangle(DiagramContainerEditPartOperation.getCornerDimension(this), DiagramContainerEditPartOperation.getBackgroundStyle(this)); + shapeFigure = new GradientRoundedRectangle(DiagramContainerEditPartOperation.getCornerDimension(this), DiagramContainerEditPartOperation.getBackgroundStyle(this), (View) getModel()); } } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/DoubleClickEditPolicy.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/DoubleClickEditPolicy.java index c13969e565..ee95b70892 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/DoubleClickEditPolicy.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/DoubleClickEditPolicy.java @@ -11,9 +11,12 @@ package org.eclipse.sirius.diagram.ui.graphical.edit.policies; import java.text.MessageFormat; +import java.util.AbstractMap.SimpleEntry; +import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.List; +import java.util.Map.Entry; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; @@ -176,64 +179,124 @@ public class DoubleClickEditPolicy extends OpenEditPolicy { compoundCommand.append(emfCommandFactory.buildRevealLabelCommand(ddiagramElement)); compoundCommand.append(emfCommandFactory.buildRevealElementsCommand(elementSet)); } else { - getCommandToDeactivateFiltersHidingElement(parentDiagram, compoundCommand, elementSet); - getCommandToActivateLayerIfNeeded(parentDiagram, ddiagramElement, compoundCommand); - compoundCommand.append(emfCommandFactory.buildRevealElementsCommand(elementSet)); + Entry<String, org.eclipse.emf.common.command.Command> filterEntry = getCommandToDeactivateFiltersHidingElementAndParents(parentDiagram, elementSet); + Entry<String, org.eclipse.emf.common.command.Command> layerEntry = getCommandToActivateLayerShowingElementAndPArents(parentDiagram, elementSet); + + if (filterEntry != null || layerEntry != null) { + boolean confirm = prepareLayerActivationAndFilterDeactivationCommands(compoundCommand, filterEntry, layerEntry); + if (confirm) { + compoundCommand.append(emfCommandFactory.buildRevealElementsCommand(elementSet)); + } + } else { + compoundCommand.append(emfCommandFactory.buildRevealElementsCommand(elementSet)); + } + } return compoundCommand; } /** - * If no activated layer contains the mapping to make visible, then we search for the layer containing it and we - * create a command to activate it. + * Asks user if element must be made visible by activating needed layers and deactivating needed filters and if yes, + * add required command in the given compound command. * - * @param parentDiagram - * @param ddiagramElement * @param compoundCommand + * the command where to put layer and filter commands if user confirms. + * @param filterEntry + * filters needed to be deactivated and their names. + * @param layerEntry + * layers needed to be activated and their names. */ - private void getCommandToActivateLayerIfNeeded(DDiagram parentDiagram, final DDiagramElement ddiagramElement, CompoundCommand compoundCommand) { + private boolean prepareLayerActivationAndFilterDeactivationCommands(CompoundCommand compoundCommand, Entry<String, org.eclipse.emf.common.command.Command> filterEntry, + Entry<String, org.eclipse.emf.common.command.Command> layerEntry) { + String message = ""; //$NON-NLS-1$ + if (filterEntry != null) { + message += MessageFormat.format(Messages.DoubleClickEditPolicy_filterConfirmDialogBody, filterEntry.getKey()); + } + if (layerEntry != null) { + if (filterEntry != null) { + message += "\n"; //$NON-NLS-1$ + } + message += MessageFormat.format(Messages.DoubleClickEditPolicy_layerConfirmDialogBody, layerEntry.getKey()); + + } + message += "\n" + Messages.DoubleClickEditPolicy_confirmDialogAsking; //$NON-NLS-1$ + boolean confirm = MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), Messages.DoubleClickEditPolicy_confirmDialogTitle, message); + if (confirm) { + if (layerEntry != null) { + compoundCommand.append(layerEntry.getValue()); + } + if (filterEntry != null) { + compoundCommand.append(filterEntry.getValue()); + } + + } + return confirm; + } + + /** + * Return the command activating layers that are needed to show all elements in the given set and the name of the + * layer to activate. + * + * @param parentDiagram + * the parent diagram. + * @param elementSet + * the element to show as well as all its parents. + * @return the command activating layers that are needed to show all element in the given set and the name of the + * layers to activate. + */ + private Entry<String, org.eclipse.emf.common.command.Command> getCommandToActivateLayerShowingElementAndPArents(DDiagram parentDiagram, final Set<DDiagramElement> elementSet) { + CompoundCommand layerCompoundCommand = new CompoundCommand(); Optional<Session> optionalSession = Session.of(parentDiagram); - optionalSession.ifPresent(session -> { - DiagramMappingsManager mappingManager = DiagramMappingsManagerRegistry.INSTANCE.getDiagramMappingsManager(session, parentDiagram); - if (mappingManager.getActiveParentLayers(ddiagramElement.getDiagramElementMapping()).size() <= 0) { - Layer layerToActivate = getLayerToActivate(parentDiagram, ddiagramElement, mappingManager); - if (layerToActivate != null) { - boolean confirm = MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), Messages.DoubleClickEditPolicy_layerConfirmDialogTitle, - MessageFormat.format(Messages.DoubleClickEditPolicy_layerConfirmDialogBody, layerToActivate.getName())); - if (confirm) { + List<String> layersToActivateList = new ArrayList<>(); + if (optionalSession.isPresent()) { + DiagramMappingsManager mappingManager = DiagramMappingsManagerRegistry.INSTANCE.getDiagramMappingsManager(optionalSession.get(), parentDiagram); + for (DDiagramElement dDiagramElement : elementSet) { + if (mappingManager.getActiveParentLayers(dDiagramElement.getDiagramElementMapping()).size() <= 0) { + Layer layerToActivate = getLayerToActivate(parentDiagram, dDiagramElement, mappingManager); + if (layerToActivate != null) { final TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(parentDiagram); - ChangeLayerActivationCommand changeLayerActivationCommand = new ChangeLayerActivationCommand(domain, parentDiagram, layerToActivate, new NullProgressMonitor()); - compoundCommand.append(changeLayerActivationCommand); + layerCompoundCommand.append(new ChangeLayerActivationCommand(domain, parentDiagram, layerToActivate, new NullProgressMonitor())); + layersToActivateList.add(layerToActivate.getName()); } } } - }); + } + return layerCompoundCommand.getCommandList().size() > 0 + ? new SimpleEntry<String, org.eclipse.emf.common.command.Command>(layersToActivateList.stream().collect(Collectors.joining(", ")), layerCompoundCommand) //$NON-NLS-1$ + : null; } - private void getCommandToDeactivateFiltersHidingElement(DDiagram parentDiagram, CompoundCommand compoundCommand, Set<DDiagramElement> elementSet) { + /** + * Return the command deactivating filters to show all elements in the given set and the name of the filters to + * deactivate. + * + * @param parentDiagram + * the parent diagram. + * @param elementSet + * the element to show as well as all its parents. + * @return the command deactivating filters to show all elements in the given set and the name of the filters to + * deactivate. + */ + private Entry<String, org.eclipse.emf.common.command.Command> getCommandToDeactivateFiltersHidingElementAndParents(DDiagram parentDiagram, Set<DDiagramElement> elementSet) { Set<GraphicalFilter> graphicalFilters = elementSet.stream().flatMap(element -> element.getGraphicalFilters().stream()).filter(elmt -> elmt instanceof AppliedCompositeFilters) .collect(Collectors.toSet()); - + DCommand command = null; + String filterStrings = null; if (graphicalFilters.size() > 0) { - String filterStrings = graphicalFilters.stream().flatMap(elmt -> ((AppliedCompositeFilters) elmt).getCompositeFilterDescriptions().stream()).map(elt -> elt.getName()) + filterStrings = graphicalFilters.stream().flatMap(elmt -> ((AppliedCompositeFilters) elmt).getCompositeFilterDescriptions().stream()).map(elt -> elt.getName()) .collect(Collectors.joining(", ")); //$NON-NLS-1$ - boolean confirm = MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), Messages.DoubleClickEditPolicy_filterConfirmDialogTitle, - MessageFormat.format(Messages.DoubleClickEditPolicy_filterConfirmDialogBody, filterStrings)); - if (confirm) { - final TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(parentDiagram); - final DCommand command = new SiriusCommand(domain, null); - for (GraphicalFilter graphicalFilter : graphicalFilters) { - EList<CompositeFilterDescription> compositeFilterDescriptions = ((AppliedCompositeFilters) graphicalFilter).getCompositeFilterDescriptions(); - for (CompositeFilterDescription compositeFilterDescription : compositeFilterDescriptions) { - command.getTasks().add(new FilterUpdateTask(parentDiagram, compositeFilterDescription, false)); - } + final TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(parentDiagram); + command = new SiriusCommand(domain, null); + for (GraphicalFilter graphicalFilter : graphicalFilters) { + EList<CompositeFilterDescription> compositeFilterDescriptions = ((AppliedCompositeFilters) graphicalFilter).getCompositeFilterDescriptions(); + for (CompositeFilterDescription compositeFilterDescription : compositeFilterDescriptions) { + command.getTasks().add(new FilterUpdateTask(parentDiagram, compositeFilterDescription, false)); } - command.setLabel(MessageFormat.format(Messages.ChangeFilterActivation_deactivateFilter, filterStrings)); - compoundCommand.append(command); - } + command.setLabel(MessageFormat.format(Messages.ChangeFilterActivation_deactivateFilter, filterStrings)); } + return command != null ? new SimpleEntry<String, org.eclipse.emf.common.command.Command>(filterStrings, command) : null; } private Layer getLayerToActivate(DDiagram parentDiagram, final DDiagramElement ddiagramElement, DiagramMappingsManager mappingManager) { diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/AbstractDEdgeNameEditPart.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/AbstractDEdgeNameEditPart.java index 7d2544dcea..ef1f8cac0a 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/AbstractDEdgeNameEditPart.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/AbstractDEdgeNameEditPart.java @@ -73,7 +73,7 @@ public class AbstractDEdgeNameEditPart extends AbstractGeneratedDiagramNameEditP public void setLabel(SiriusWrapLabel figure) { if (figure instanceof SiriusWrapLabelWithAttachmentWithModel) { - ((SiriusWrapLabelWithAttachmentWithModel) figure).setModel((View) getModel()); + ((SiriusWrapLabelWithAttachmentWithModel) figure).setModel((View) getParent().getModel()); } unregisterVisuals(); setFigure(figure); diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/AbstractDNodeListCompartmentEditPart.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/AbstractDNodeListCompartmentEditPart.java index ea768f72ed..bcd4d86dc1 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/AbstractDNodeListCompartmentEditPart.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/AbstractDNodeListCompartmentEditPart.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2017 THALES GLOBAL SERVICES and others. + * Copyright (c) 2011, 2018 THALES GLOBAL SERVICES and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -183,7 +183,9 @@ public abstract class AbstractDNodeListCompartmentEditPart extends ListCompartme } private void configureBorder(ResizableCompartmentFigure rcf) { - if (hasLabelBorderStyle() || isLabelHidden() || isCollapsed()) { + ViewQuery viewQuery = new ViewQuery((View) this.getModel()); + boolean isInShowingMode = viewQuery.isInShowingMode(); + if (hasLabelBorderStyle() || (isLabelHidden() && !isInShowingMode) || isCollapsed()) { if (rcf.getBorder() instanceof LineBorder || rcf.getBorder() == null) { // Do not draw the top line border for free form containers. rcf.setBorder(new MarginBorder(getMapMode().DPtoLP(1), 0, 0, 0)); @@ -260,6 +262,7 @@ public abstract class AbstractDNodeListCompartmentEditPart extends ListCompartme super.removeNotationalListeners(); removeListenerFilter("ShowingMode"); //$NON-NLS-1$ } + /* * (non-Javadoc) * @see org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart#setVisibility(boolean) diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DDiagramEditPart.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DDiagramEditPart.java index 9567515726..d065bd1618 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DDiagramEditPart.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DDiagramEditPart.java @@ -99,7 +99,7 @@ public class DDiagramEditPart extends AbstractDDiagramEditPart { @Override public void deactivate() { - deactivateLayoutingMode(); + deactivateModes(); super.deactivate(); } @@ -117,9 +117,9 @@ public class DDiagramEditPart extends AbstractDDiagramEditPart { } /** - * Deactivates the Layouting Mode of the {@link DDiagram} (if needed). + * Deactivates the Layouting and show/hide Modes of the {@link DDiagram} (if needed). */ - private void deactivateLayoutingMode() { + private void deactivateModes() { if (getModel() instanceof Diagram) { Diagram diagramGMF = (Diagram) getModel(); try { @@ -129,6 +129,12 @@ public class DDiagramEditPart extends AbstractDDiagramEditPart { if (dDiagram.isIsInLayoutingMode()) { getEditingDomain().getCommandStack().execute(new SetLayoutingModeCommand(getEditingDomain(), dDiagram, false)); } + if (dDiagram.isIsInShowingMode()) { + String commandLabel = dDiagram.isIsInShowingMode() ? Messages.SetShowingModeCommandAndUpdateActionImage_deactivateLabel + : Messages.SetShowingModeCommandAndUpdateActionImage_activateLabel; + + getEditingDomain().getCommandStack().execute(new SetShowingModeCommand(getEditingDomain(), dDiagram, commandLabel, false)); + } } } catch (IllegalStateException e) { // If the DDiagram associated to this GMF Diagram is not @@ -138,6 +144,47 @@ public class DDiagramEditPart extends AbstractDDiagramEditPart { } /** + * A command that changes the show/hide activation status of the given {@link DDiagram}. + * + * @author <a href="mailto:pierre.guilet@obeo.fr">Pierre Guilet</a> + * + */ + public static class SetShowingModeCommand extends SiriusCommand { + + /** + * The {@link DDiagram} on witch the layouting mode should be switched. + */ + private DDiagram diagram; + + /** + * Indicates whether the Layouting Mode should be enabled. + */ + private boolean showingModeShouldBeEnabled; + + /** + * Constructor. + * + * @param editingDomain + * the editing domain + * @param diagram + * the {@link DDiagram} on witch the layouting mode should be switched + * @param showingModeShouldBeEnabled + * indicates whether the show/hide mode should be enabled or disabled + */ + public SetShowingModeCommand(TransactionalEditingDomain editingDomain, DDiagram diagram, String label, boolean showingModeShouldBeEnabled) { + super(editingDomain, label); + this.diagram = diagram; + this.showingModeShouldBeEnabled = showingModeShouldBeEnabled; + } + + @Override + protected void doExecute() { + this.diagram.setIsInShowingMode(showingModeShouldBeEnabled); + } + + } + + /** * A command that changes the LayoutingMode of the given {@link DDiagram}. * * @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a> diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DNode2EditPart.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DNode2EditPart.java index 6dd8ebe6a7..330866d746 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DNode2EditPart.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DNode2EditPart.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2016 THALES GLOBAL SERVICES. + * Copyright (c) 2007, 2018 THALES GLOBAL SERVICES. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.internal.edit.parts; +import org.eclipse.draw2d.Graphics; import org.eclipse.draw2d.IFigure; import org.eclipse.draw2d.StackLayout; import org.eclipse.emf.ecore.EObject; @@ -30,6 +31,7 @@ import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure; import org.eclipse.gmf.runtime.notation.View; import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.DNode; +import org.eclipse.sirius.diagram.ui.business.internal.view.ShowingViewUtil; import org.eclipse.sirius.diagram.ui.edit.api.part.AbstractDiagramBorderNodeEditPart; import org.eclipse.sirius.diagram.ui.internal.edit.policies.BorderedNodeLayoutEditPolicy; import org.eclipse.sirius.diagram.ui.internal.edit.policies.DNode2ItemSemanticEditPolicy; @@ -129,7 +131,7 @@ public class DNode2EditPart extends AbstractDiagramBorderNodeEditPart { * @was-generated */ protected IFigure createNodeShape() { - return primaryShape = new ViewNodeFigure(); + return primaryShape = new ViewNodeFigure((View) getModel()); } /** @@ -169,8 +171,7 @@ public class DNode2EditPart extends AbstractDiagramBorderNodeEditPart { /** * {@inheritDoc} * - * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#reorderChild(org.eclipse.gef.EditPart, - * int) + * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#reorderChild(org.eclipse.gef.EditPart, int) */ @Override protected void reorderChild(final EditPart child, final int index) { @@ -190,7 +191,18 @@ public class DNode2EditPart extends AbstractDiagramBorderNodeEditPart { final DStylizable viewNode = (DStylizable) eObj; final StyleConfiguration styleConfiguration = IStyleConfigurationRegistry.INSTANCE.getStyleConfiguration(((DDiagramElement) eObj).getDiagramElementMapping(), viewNode.getStyle()); final AnchorProvider anchorProvider = styleConfiguration.getAnchorProvider(); - result = new AirDefaultSizeNodeFigure(getMapMode().DPtoLP(5), getMapMode().DPtoLP(5), anchorProvider); + result = new AirDefaultSizeNodeFigure(getMapMode().DPtoLP(5), getMapMode().DPtoLP(5), anchorProvider) { + @Override + public void paint(Graphics graphics) { + ShowingViewUtil.initGraphicsForVisibleAndInvisibleElements(this, graphics, (View) getModel()); + try { + super.paint(graphics); + graphics.restoreState(); + } finally { + graphics.popState(); + } + } + }; nodePlate = result; } return result; @@ -221,9 +233,8 @@ public class DNode2EditPart extends AbstractDiagramBorderNodeEditPart { } /** - * Creates figure for this edit part. Body of this method does not depend on - * settings in generation model so you may safely remove <i>generated</i> - * tag and modify it. + * Creates figure for this edit part. Body of this method does not depend on settings in generation model so you may + * safely remove <i>generated</i> tag and modify it. * * @not-generated : remove the layout manager to fix the size */ @@ -238,8 +249,8 @@ public class DNode2EditPart extends AbstractDiagramBorderNodeEditPart { } /** - * Default implementation treats passed figure as content pane. Respects - * layout one may have set for generated figure. + * Default implementation treats passed figure as content pane. Respects layout one may have set for generated + * figure. * * @param nodeShape * instance of generated figure class diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DNode3EditPart.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DNode3EditPart.java index efaf9fb22a..4b95b22d88 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DNode3EditPart.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DNode3EditPart.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 THALES GLOBAL SERVICES. + * Copyright (c) 2007, 2018 THALES GLOBAL SERVICES. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -224,7 +224,7 @@ public class DNode3EditPart extends AbstractDiagramNodeEditPart { * @was-generated */ protected IFigure createNodeShape() { - final ViewNodeFigure figure = new ViewNodeFigure(); + final ViewNodeFigure figure = new ViewNodeFigure((View) getModel()); return primaryShape = figure; } @@ -286,9 +286,8 @@ public class DNode3EditPart extends AbstractDiagramNodeEditPart { } /** - * Creates figure for this edit part. Body of this method does not depend on - * settings in generation model so you may safely remove <i>generated</i> - * tag and modify it. + * Creates figure for this edit part. Body of this method does not depend on settings in generation model so you may + * safely remove <i>generated</i> tag and modify it. * * @not-generated : remove the layout manager to fix the size */ @@ -305,8 +304,8 @@ public class DNode3EditPart extends AbstractDiagramNodeEditPart { } /** - * Default implementation treats passed figure as content pane. Respects - * layout one may have set for generated figure. + * Default implementation treats passed figure as content pane. Respects layout one may have set for generated + * figure. * * @param nodeShape * instance of generated figure class diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DNode4EditPart.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DNode4EditPart.java index f6a051f132..a617a1f08a 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DNode4EditPart.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DNode4EditPart.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2016 THALES GLOBAL SERVICES. + * Copyright (c) 2007, 2018 THALES GLOBAL SERVICES. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.internal.edit.parts; +import org.eclipse.draw2d.Graphics; import org.eclipse.draw2d.IFigure; import org.eclipse.draw2d.StackLayout; import org.eclipse.emf.ecore.EObject; @@ -27,6 +28,7 @@ import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure; import org.eclipse.gmf.runtime.notation.View; import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.DNode; +import org.eclipse.sirius.diagram.ui.business.internal.view.ShowingViewUtil; import org.eclipse.sirius.diagram.ui.edit.api.part.AbstractDiagramBorderNodeEditPart; import org.eclipse.sirius.diagram.ui.internal.edit.policies.BorderedNodeLayoutEditPolicy; import org.eclipse.sirius.diagram.ui.internal.edit.policies.DNode4ItemSemanticEditPolicy; @@ -105,7 +107,7 @@ public class DNode4EditPart extends AbstractDiagramBorderNodeEditPart { * @was-generated */ protected IFigure createNodeShape() { - return primaryShape = new ViewNodeFigure(); + return primaryShape = new ViewNodeFigure((View) getModel()); } /** @@ -152,7 +154,18 @@ public class DNode4EditPart extends AbstractDiagramBorderNodeEditPart { final DStylizable viewNode = (DStylizable) eObj; final StyleConfiguration styleConfiguration = IStyleConfigurationRegistry.INSTANCE.getStyleConfiguration(((DDiagramElement) eObj).getDiagramElementMapping(), viewNode.getStyle()); final AnchorProvider anchorProvider = styleConfiguration.getAnchorProvider(); - result = new AirDefaultSizeNodeFigure(getMapMode().DPtoLP(5), getMapMode().DPtoLP(5), anchorProvider); + result = new AirDefaultSizeNodeFigure(getMapMode().DPtoLP(5), getMapMode().DPtoLP(5), anchorProvider) { + @Override + public void paint(Graphics graphics) { + ShowingViewUtil.initGraphicsForVisibleAndInvisibleElements(this, graphics, (View) getModel()); + try { + super.paint(graphics); + graphics.restoreState(); + } finally { + graphics.popState(); + } + } + }; nodePlate = result; } return result; @@ -183,9 +196,8 @@ public class DNode4EditPart extends AbstractDiagramBorderNodeEditPart { } /** - * Creates figure for this edit part. Body of this method does not depend on - * settings in generation model so you may safely remove <i>generated</i> - * tag and modify it. + * Creates figure for this edit part. Body of this method does not depend on settings in generation model so you may + * safely remove <i>generated</i> tag and modify it. * * @not-generated : remove the layout manager to fix the size */ @@ -200,8 +212,8 @@ public class DNode4EditPart extends AbstractDiagramBorderNodeEditPart { } /** - * Default implementation treats passed figure as content pane. Respects - * layout one may have set for generated figure. + * Default implementation treats passed figure as content pane. Respects layout one may have set for generated + * figure. * * @param nodeShape * instance of generated figure class diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DNodeEditPart.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DNodeEditPart.java index 92502d7af2..cd5323050e 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DNodeEditPart.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DNodeEditPart.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 THALES GLOBAL SERVICES. + * Copyright (c) 2007, 2018 THALES GLOBAL SERVICES. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -224,7 +224,7 @@ public class DNodeEditPart extends AbstractDiagramNodeEditPart { * @was-generated */ protected IFigure createNodeShape() { - final ViewNodeFigure figure = new ViewNodeFigure(); + final ViewNodeFigure figure = new ViewNodeFigure((View) getModel()); return primaryShape = figure; } @@ -286,9 +286,8 @@ public class DNodeEditPart extends AbstractDiagramNodeEditPart { } /** - * Creates figure for this edit part. Body of this method does not depend on - * settings in generation model so you may safely remove <i>generated</i> - * tag and modify it. + * Creates figure for this edit part. Body of this method does not depend on settings in generation model so you may + * safely remove <i>generated</i> tag and modify it. * * @not-generated : remove the layout manager to fix the size */ @@ -305,8 +304,8 @@ public class DNodeEditPart extends AbstractDiagramNodeEditPart { } /** - * Default implementation treats passed figure as content pane. Respects - * layout one may have set for generated figure. + * Default implementation treats passed figure as content pane. Respects layout one may have set for generated + * figure. * * @param nodeShape * instance of generated figure class diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DNodeListElementEditPart.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DNodeListElementEditPart.java index 0d8a4528f6..1a06ab45ee 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DNodeListElementEditPart.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DNodeListElementEditPart.java @@ -193,12 +193,16 @@ public class DNodeListElementEditPart extends AbstractGeneratedDiagramNameEditPa SiriusWrapLabel safeWrapLabel = new SiriusWrapLabel() { @Override public void paint(Graphics graphics) { - ShowingViewUtil.initGraphicsForVisibleAndInvisibleElements(this, graphics, (View) getModel()); - try { + if (getModel() instanceof View) { + ShowingViewUtil.initGraphicsForVisibleAndInvisibleElements(this, graphics, (View) getModel()); + try { + super.paint(graphics); + graphics.restoreState(); + } finally { + graphics.popState(); + } + } else { super.paint(graphics); - graphics.restoreState(); - } finally { - graphics.popState(); } } }; diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DNodeNameEditPart.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DNodeNameEditPart.java index 12d85e549b..37ff9840d3 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DNodeNameEditPart.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DNodeNameEditPart.java @@ -164,12 +164,16 @@ public class DNodeNameEditPart extends AbstractGeneratedDiagramNameEditPart impl @Override public void paint(Graphics graphics) { - ShowingViewUtil.initGraphicsForVisibleAndInvisibleElements(this, graphics, (View) getModel()); - try { + if (getModel() instanceof View) { + ShowingViewUtil.initGraphicsForVisibleAndInvisibleElements(this, graphics, (View) getModel()); + try { + super.paint(graphics); + graphics.restoreState(); + } finally { + graphics.popState(); + } + } else { super.paint(graphics); - graphics.restoreState(); - } finally { - graphics.popState(); } } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/SiriusNoteEditPart.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/SiriusNoteEditPart.java index 607507aad1..ade17e732a 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/SiriusNoteEditPart.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/SiriusNoteEditPart.java @@ -14,6 +14,8 @@ package org.eclipse.sirius.diagram.ui.internal.edit.parts; import java.util.List; import java.util.Optional; +import org.eclipse.draw2d.Graphics; +import org.eclipse.draw2d.geometry.Insets; import org.eclipse.emf.common.notify.Adapter; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.impl.AdapterImpl; @@ -22,7 +24,11 @@ import org.eclipse.gef.Request; import org.eclipse.gmf.runtime.diagram.ui.editparts.DescriptionCompartmentEditPart; import org.eclipse.gmf.runtime.diagram.ui.editparts.NoteEditPart; import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; +import org.eclipse.gmf.runtime.diagram.ui.figures.NoteFigure; import org.eclipse.gmf.runtime.diagram.ui.internal.editparts.DiagramNameCompartmentEditPart; +import org.eclipse.gmf.runtime.diagram.ui.internal.properties.Properties; +import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode; +import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure; import org.eclipse.gmf.runtime.notation.NotationPackage; import org.eclipse.gmf.runtime.notation.View; import org.eclipse.sirius.business.api.helper.SiriusUtil; @@ -47,6 +53,8 @@ public class SiriusNoteEditPart extends NoteEditPart { /* this handles removal of diagram link notes when the referenced diagram is deleted */ static final Adapter LINK_ADAPTER = new DiagramLinkAdapter(); + private boolean diagramLinkMode = false; + /** * Default constructor. * @@ -122,6 +130,40 @@ public class SiriusNoteEditPart extends NoteEditPart { ShowingViewUtil.setConnectionsVisibility(this, (View) getModel(), SELECTED_NONE, visibility); } + @Override + protected NodeFigure createNodeFigure() { + // we call super to set diagramLinkMode to true but use our own figure to be able to set it with transparency. + super.createNodeFigure(); + IMapMode mm = getMapMode(); + int insetSize = mm.DPtoLP(5); + Insets insets = new Insets(insetSize, insetSize, insetSize, mm.DPtoLP(NoteFigure.CLIP_MARGIN_DP)); + NoteFigure noteFigure = new NoteFigure(mm.DPtoLP(100), mm.DPtoLP(56), insets) { + @Override + public void paint(Graphics graphics) { + ShowingViewUtil.initGraphicsForVisibleAndInvisibleElements(this, graphics, (View) getModel()); + try { + super.paint(graphics); + graphics.restoreState(); + } finally { + graphics.popState(); + } + } + }; + Object model = getModel(); + if (model != null && model instanceof View) { + View notationView = (View) model; + if (notationView != null && (notationView.getEAnnotation(Properties.DIAGRAMLINK_ANNOTATION) != null || notationView.getType() == null || notationView.getType().length() == 0)) { + noteFigure.setDiagramLinkMode(true); + insets.right = insetSize; // there is no dangling corner in diagram link, set right margin to be the + // same as left + + // The default size is the minimum. + noteFigure.setDefaultSize(insetSize, insetSize); + } + } + return noteFigure; + } + /* * (non-Javadoc) * @see org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart#setVisibility(boolean) diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/GradientRoundedRectangle.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/GradientRoundedRectangle.java index 670a348039..d56061f759 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/GradientRoundedRectangle.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/GradientRoundedRectangle.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2013 THALES GLOBAL SERVICES. + * Copyright (c) 2018 THALES GLOBAL SERVICES. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -15,13 +15,14 @@ import org.eclipse.draw2d.MarginBorder; import org.eclipse.draw2d.RoundedRectangle; import org.eclipse.draw2d.geometry.Dimension; import org.eclipse.gmf.runtime.draw2d.ui.mapmode.MapModeUtil; +import org.eclipse.gmf.runtime.notation.View; import org.eclipse.sirius.diagram.BackgroundStyle; +import org.eclipse.sirius.diagram.ui.business.internal.view.ShowingViewUtil; import org.eclipse.sirius.diagram.ui.tools.api.graphical.edit.styles.IContainerLabelOffsets; import org.eclipse.swt.graphics.Color; /** - * Basic implementation of RoundedRectangle shape with gradient and label - * capabilities. + * Basic implementation of RoundedRectangle shape with gradient and label capabilities. * * @author mporhel */ @@ -33,6 +34,8 @@ public class GradientRoundedRectangle extends RoundedRectangle implements ViewNo private BackgroundStyle backgroundStyle; + private View view; + /** * Create a new {@link GradientRoundedRectangle}. * @@ -40,9 +43,11 @@ public class GradientRoundedRectangle extends RoundedRectangle implements ViewNo * dimension of the corner (with radius, height radius) * @param backgroundStyle * style of the wanted gradient - * + * @param view + * the model view of the part showing the figure. */ - public GradientRoundedRectangle(final Dimension dimension, final BackgroundStyle backgroundStyle) { + public GradientRoundedRectangle(final Dimension dimension, final BackgroundStyle backgroundStyle, View view) { + this.view = view; this.backgroundStyle = backgroundStyle; this.setCornerDimensions(new Dimension(MapModeUtil.getMapMode().DPtoLP(dimension.width), MapModeUtil.getMapMode().DPtoLP(dimension.height))); createBorder(); @@ -51,9 +56,29 @@ public class GradientRoundedRectangle extends RoundedRectangle implements ViewNo /** * Create a new {@link GradientRoundedRectangle}. + * + * @param view + * the model view of the part showing the figure. */ - public GradientRoundedRectangle() { - this(new Dimension(8, 8), BackgroundStyle.GRADIENT_LEFT_TO_RIGHT_LITERAL); + public GradientRoundedRectangle(View view) { + this(new Dimension(8, 8), BackgroundStyle.GRADIENT_LEFT_TO_RIGHT_LITERAL, view); + } + + @Override + public void paint(Graphics graphics) { + + if (view != null) { + ShowingViewUtil.initGraphicsForVisibleAndInvisibleElements(this, graphics, view); + try { + super.paint(graphics); + graphics.restoreState(); + } finally { + graphics.popState(); + } + } else { + super.paint(graphics); + } + } /** @@ -71,6 +96,7 @@ public class GradientRoundedRectangle extends RoundedRectangle implements ViewNo * * @see ViewGradientFigureDesc#getGradientColor() */ + @Override public Color getGradientColor() { return this.gradientColor; } @@ -79,7 +105,22 @@ public class GradientRoundedRectangle extends RoundedRectangle implements ViewNo * Create the content of the figure. */ protected void createContents() { - fLabelFigure = new SiriusWrapLabel(); + fLabelFigure = new SiriusWrapLabel() { + @Override + public void paint(Graphics graphics) { + if (view != null) { + ShowingViewUtil.initGraphicsForVisibleAndInvisibleElements(this, graphics, view); + try { + super.paint(graphics); + graphics.restoreState(); + } finally { + graphics.popState(); + } + } else { + super.paint(graphics); + } + } + }; fLabelFigure.setText(" "); //$NON-NLS-1$ fLabelFigure.setTextWrap(true); this.add(fLabelFigure); @@ -98,6 +139,7 @@ public class GradientRoundedRectangle extends RoundedRectangle implements ViewNo * @see org.eclipse.sirius.diagram.ui.tools.api.figure.ViewNodeContainerFigureDesc#getLabelFigure() * @return the label figure. */ + @Override public SiriusWrapLabel getLabelFigure() { return fLabelFigure; } @@ -120,6 +162,7 @@ public class GradientRoundedRectangle extends RoundedRectangle implements ViewNo * * @see ViewGradientFigureDesc#getBackgroundStyle() */ + @Override public BackgroundStyle getBackgroundStyle() { return backgroundStyle; } @@ -127,6 +170,7 @@ public class GradientRoundedRectangle extends RoundedRectangle implements ViewNo /** * {@inheritDoc} */ + @Override public int getCornerHeight() { return this.getCornerDimensions().height; } @@ -134,6 +178,7 @@ public class GradientRoundedRectangle extends RoundedRectangle implements ViewNo /** * {@inheritDoc} */ + @Override public int getCornerWidth() { return this.getCornerDimensions().width; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/ViewNodeContainerParallelogram.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/ViewNodeContainerParallelogram.java index 26dbecef9b..c62659c6d2 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/ViewNodeContainerParallelogram.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/ViewNodeContainerParallelogram.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 THALES GLOBAL SERVICES. + * Copyright (c) 2007, 2018 THALES GLOBAL SERVICES. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -10,7 +10,10 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.tools.api.figure; +import org.eclipse.draw2d.Graphics; import org.eclipse.draw2d.MarginBorder; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.sirius.diagram.ui.business.internal.view.ShowingViewUtil; import org.eclipse.sirius.diagram.ui.tools.api.graphical.edit.styles.IContainerLabelOffsets; /** @@ -23,17 +26,49 @@ public class ViewNodeContainerParallelogram extends ParallelogramFigure implemen private SiriusWrapLabel fContainerLabelFigure; + private View view; + /** * Constructor. + * + * @param view + * the model view of the part showing the figure. */ - public ViewNodeContainerParallelogram() { + public ViewNodeContainerParallelogram(View view) { // setLayoutManager(new XYLayout()); + this.view = view; createContents(); this.setBorder(new MarginBorder(IContainerLabelOffsets.LABEL_OFFSET, 0, 0, 0)); } + @Override + public void paint(Graphics graphics) { + if (view != null) { + ShowingViewUtil.initGraphicsForVisibleAndInvisibleElements(this, graphics, view); + try { + super.paint(graphics); + graphics.restoreState(); + } finally { + graphics.popState(); + } + } else { + super.paint(graphics); + } + } + private void createContents() { - fContainerLabelFigure = new SiriusWrapLabel(); + fContainerLabelFigure = new SiriusWrapLabel() { + @Override + public void paint(Graphics graphics) { + ShowingViewUtil.initGraphicsForVisibleAndInvisibleElements(this, graphics, view); + try { + super.paint(graphics); + graphics.restoreState(); + } finally { + graphics.popState(); + } + } + }; fContainerLabelFigure.setText(" "); //$NON-NLS-1$ fContainerLabelFigure.setTextWrap(true); this.add(fContainerLabelFigure); @@ -44,6 +79,7 @@ public class ViewNodeContainerParallelogram extends ParallelogramFigure implemen * * @see org.eclipse.sirius.diagram.ui.tools.api.figure.ViewNodeContainerFigureDesc#getLabelFigure() */ + @Override public SiriusWrapLabel getLabelFigure() { return fContainerLabelFigure; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/ViewNodeContainerRectangleFigureDesc.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/ViewNodeContainerRectangleFigureDesc.java index 0b0d5d8649..986b51a12f 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/ViewNodeContainerRectangleFigureDesc.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/ViewNodeContainerRectangleFigureDesc.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008, 2009 THALES GLOBAL SERVICES. + * Copyright (c) 2007, 2018 THALES GLOBAL SERVICES. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -10,13 +10,15 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.tools.api.figure; +import org.eclipse.draw2d.Graphics; import org.eclipse.draw2d.MarginBorder; import org.eclipse.draw2d.RectangleFigure; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.sirius.diagram.ui.business.internal.view.ShowingViewUtil; import org.eclipse.sirius.diagram.ui.tools.api.graphical.edit.styles.IContainerLabelOffsets; /** - * Basic implementation of {@link ViewNodeContainerFigureDesc} with a rectangle - * shape. + * Basic implementation of {@link ViewNodeContainerFigureDesc} with a rectangle shape. * * @author cbrun * @@ -25,17 +27,53 @@ public class ViewNodeContainerRectangleFigureDesc extends RectangleFigure implem private SiriusWrapLabel fContainerLabelFigure; + private View view; + /** * Create a new {@link ViewNodeContainerFigureDesc}. + * + * @param view + * the model view of the part showing the figure. */ - public ViewNodeContainerRectangleFigureDesc() { + public ViewNodeContainerRectangleFigureDesc(View view) { + this.view = view; this.setFill(false); createContents(); this.setBorder(new MarginBorder(IContainerLabelOffsets.LABEL_OFFSET, 0, 0, 0)); } + @Override + public void paint(Graphics graphics) { + if (view != null) { + ShowingViewUtil.initGraphicsForVisibleAndInvisibleElements(this, graphics, view); + try { + super.paint(graphics); + graphics.restoreState(); + } finally { + graphics.popState(); + } + } else { + super.paint(graphics); + } + } + private void createContents() { - fContainerLabelFigure = new SiriusWrapLabel(); + fContainerLabelFigure = new SiriusWrapLabel() { + @Override + public void paint(Graphics graphics) { + if (view != null) { + ShowingViewUtil.initGraphicsForVisibleAndInvisibleElements(this, graphics, view); + try { + super.paint(graphics); + graphics.restoreState(); + } finally { + graphics.popState(); + } + } else { + super.paint(graphics); + } + } + }; fContainerLabelFigure.setText(" "); //$NON-NLS-1$ fContainerLabelFigure.setTextWrap(true); this.add(fContainerLabelFigure); @@ -47,6 +85,7 @@ public class ViewNodeContainerRectangleFigureDesc extends RectangleFigure implem * @was-generated * @see org.eclipse.sirius.diagram.ui.tools.api.figure.ViewNodeContainerFigureDesc#getLabelFigure() */ + @Override public SiriusWrapLabel getLabelFigure() { return fContainerLabelFigure; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/ui/actions/ActionIds.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/ui/actions/ActionIds.java index ac023f3fdf..7be0e7ee6f 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/ui/actions/ActionIds.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/ui/actions/ActionIds.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2017 THALES GLOBAL SERVICES and others. + * Copyright (c) 2009, 2018 THALES GLOBAL SERVICES and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -154,4 +154,9 @@ public interface ActionIds { /** Action's id to straighten to right. */ String STRAIGHTEN_BOTTOM_SIDE_PINNED = RequestConstants.REQ_STRAIGHTEN + "BottomSidePinned"; //$NON-NLS-1$ + /** + * The default mode id. + */ + String DEFAULT_MODE = "defaultMode"; //$NON-NLS-1$ + } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/LayoutingModeSwitchingAction.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/LayoutingModeSwitchingAction.java index 96adc9fee0..d0ab2402d1 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/LayoutingModeSwitchingAction.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/LayoutingModeSwitchingAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2015 THALES GLOBAL SERVICES and others. + * Copyright (c) 2011, 2018 THALES GLOBAL SERVICES and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -10,11 +10,10 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar; -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.core.runtime.IStatus; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.emf.transaction.util.TransactionUtil; import org.eclipse.gef.Request; @@ -23,22 +22,19 @@ import org.eclipse.gef.commands.UnexecutableCommand; import org.eclipse.gmf.runtime.common.core.command.CommandResult; import org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction; import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; -import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand; -import org.eclipse.gmf.runtime.notation.Diagram; import org.eclipse.jface.action.IStatusLineManager; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.sirius.common.ui.tools.api.util.EclipseUIUtil; import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.business.api.diagramtype.DiagramTypeDescriptorRegistry; import org.eclipse.sirius.diagram.business.api.diagramtype.IDiagramTypeDescriptor; -import org.eclipse.sirius.diagram.ui.edit.api.part.IDDiagramEditPart; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.image.DiagramImagesPath; import org.eclipse.sirius.diagram.ui.tools.api.ui.actions.ActionIds; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IEditorSite; -import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.part.EditorActionBarContributor; /** @@ -50,9 +46,8 @@ import org.eclipse.ui.part.EditorActionBarContributor; public class LayoutingModeSwitchingAction extends DiagramAction { /** - * Icon used in the tabbar to allow end-user to activate layouting mode. It - * is also used in the editor's status line to indicate that LayoutingMode - * is active. + * Icon used in the tabbar to allow end-user to activate layouting mode. It is also used in the editor's status line + * to indicate that LayoutingMode is active. */ private static final ImageDescriptor ACTIVATE_LAYOUTING_MODE_IMAGE_DESCRIPTOR = DiagramUIPlugin.Implementation.getBundledImageDescriptor(DiagramImagesPath.LAYOUTING_MODE_ACTIVE_ICON); @@ -64,14 +59,13 @@ public class LayoutingModeSwitchingAction extends DiagramAction { /** * Default constructor. * - * @param workbenchPage - * The workbench page associated with this action + * @param iWorkbenchPart + * The workbench part associated with this action * @param editorDiagram - * the {@link DDiagram} on witch the layouting mode should be - * switched + * the {@link DDiagram} on witch the layouting mode should be switched */ - public LayoutingModeSwitchingAction(IWorkbenchPage workbenchPage, DDiagram editorDiagram) { - super(workbenchPage); + public LayoutingModeSwitchingAction(IWorkbenchPart iWorkbenchPart, DDiagram editorDiagram) { + super(iWorkbenchPart); setId(ActionIds.SWITCH_LAYOUTING_MODE); this.ddiagram = editorDiagram; setImageDescriptor(ACTIVATE_LAYOUTING_MODE_IMAGE_DESCRIPTOR); @@ -79,19 +73,12 @@ public class LayoutingModeSwitchingAction extends DiagramAction { } /** - * Switches the text associated to this Action according to the current - * LayoutMode status (activated or not) and updates this editor's - * statusLine. + * Switches the text associated to this Action according to the current LayoutMode status (activated or not) and + * updates this editor's statusLine. */ private void setTextAndStatusAccordingToLayoutingMode() { // Step 1 : updating action's text and image - if (this.ddiagram != null && this.ddiagram.isIsInLayoutingMode()) { - setText(Messages.LayoutingModeSwitchingAction_deactivate); - setChecked(true); - } else { - setText(Messages.LayoutingModeSwitchingAction_activate); - setChecked(false); - } + setText(Messages.LayoutingModeSwitchingAction_label); // Step 2 : updating the editor's status bar IEditorPart activeEditor = EclipseUIUtil.getActiveEditor(); @@ -128,7 +115,7 @@ public class LayoutingModeSwitchingAction extends DiagramAction { */ @Override public int getStyle() { - return AS_CHECK_BOX; + return AS_UNSPECIFIED; } /** @@ -151,37 +138,27 @@ public class LayoutingModeSwitchingAction extends DiagramAction { @Override protected Command getCommand() { Command returnedCommand = UnexecutableCommand.INSTANCE; - List<?> selectedObjects = getSelectedObjects(); - if (!selectedObjects.isEmpty()) { - if (selectedObjects.iterator().next() instanceof IDDiagramEditPart) { - IDDiagramEditPart diagramEP = (IDDiagramEditPart) selectedObjects.iterator().next(); - if (diagramEP.getModel() instanceof Diagram) { - Diagram diagramGMF = (Diagram) diagramEP.getModel(); - if (diagramGMF.getElement() instanceof DDiagram) { - returnedCommand = getCommandForDDiagram((DDiagram) diagramGMF.getElement()); - } - } - } - } - - return returnedCommand; - } - - /** - * Returns a command that switches the LayoutingMode of the given - * {@link DDiagram}. - * - * @param diagram - * the {@link DDiagram} on witch the layouting mode should be - * switched - * @return a command that switches the LayoutingMode of the given - * {@link DDiagram} - */ - private Command getCommandForDDiagram(DDiagram diagram) { - Command returnedCommand = UnexecutableCommand.INSTANCE; - TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(diagram); + TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(ddiagram); if (editingDomain != null) { - returnedCommand = new ICommandProxy(new SetLayoutingModeCommandAndUpdateActionImage(editingDomain, diagram, !diagram.isIsInLayoutingMode())); + setTextAndStatusAccordingToLayoutingMode(); + String commandLabel = ddiagram.isIsInShowingMode() ? Messages.SetShowingModeCommandAndUpdateActionImage_deactivateLabel : Messages.SetShowingModeCommandAndUpdateActionImage_activateLabel; + returnedCommand = new ICommandProxy(new SetShowingModeCommand(TransactionUtil.getEditingDomain(ddiagram), ddiagram, commandLabel, false)) + .chain(new ICommandProxy(new SetLayoutingModeCommand(editingDomain, ddiagram, true) { + + @Override + protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { + CommandResult doExecuteWithResult = super.doExecuteWithResult(monitor, info); + if (IStatus.OK == doExecuteWithResult.getStatus().getCode()) { + setTextAndStatusAccordingToLayoutingMode(); + } + return doExecuteWithResult; + + } + + })); + if (ddiagram.isIsInLayoutingMode()) { + setText(Messages.SetLayoutingModeCommandAndUpdateActionImage_deactivateLabel); + } } return returnedCommand; } @@ -203,8 +180,7 @@ public class LayoutingModeSwitchingAction extends DiagramAction { * * @param diagram * the diagram to inspect - * @return true if the given ddiagram is allowing layouting mode, false - * otherwise + * @return true if the given ddiagram is allowing layouting mode, false otherwise */ public static boolean diagramAllowsLayoutingMode(DDiagram diagram) { // If an aird has been opened from the Package Explorer View, then we @@ -229,64 +205,6 @@ public class LayoutingModeSwitchingAction extends DiagramAction { } /** - * A command that changes the LayoutingMode of the given {@link DDiagram} - * and updates the image assocatied to the Action. - * - * @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a> - * - */ - public class SetLayoutingModeCommandAndUpdateActionImage extends AbstractTransactionalCommand { - - /** - * The {@link DDiagram} on witch the layouting mode should be switched. - */ - private DDiagram diagram; - - /** - * Indicates whether the Layouting Mode should be enabled. - */ - private boolean layoutingModeShouldBeEnabled; - - /** - * Constructor. - * - * @param editingDomain - * the editing domain - * @param diagram - * the {@link DDiagram} on witch the layouting mode should be - * switched - * @param layoutingModeShouldBeEnabled - * indicates whether the layouting mode should be enabled or - * disabled - */ - public SetLayoutingModeCommandAndUpdateActionImage(TransactionalEditingDomain editingDomain, DDiagram diagram, boolean layoutingModeShouldBeEnabled) { - super(editingDomain, Messages.SetLayoutingModeCommandAndUpdateActionImage_activateLabel, null); - this.diagram = diagram; - this.layoutingModeShouldBeEnabled = layoutingModeShouldBeEnabled; - if (this.diagram.isIsInLayoutingMode()) { - setText(Messages.SetLayoutingModeCommandAndUpdateActionImage_deactivateLabel); - } - } - - /** - * - * {@inheritDoc} - * - * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, - * org.eclipse.core.runtime.IAdaptable) - */ - @Override - protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - CommandResult commandResult = CommandResult.newOKCommandResult(); - if (LayoutingModeSwitchingAction.diagramAllowsLayoutingMode(diagram)) { - this.diagram.setIsInLayoutingMode(layoutingModeShouldBeEnabled); - setTextAndStatusAccordingToLayoutingMode(); - } - return commandResult; - } - } - - /** * * {@inheritDoc} * diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/SetLayoutingModeCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/SetLayoutingModeCommand.java new file mode 100644 index 0000000000..4d14dfd331 --- /dev/null +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/SetLayoutingModeCommand.java @@ -0,0 +1,72 @@ +/******************************************************************************* + * Copyright (c) 2018 THALES GLOBAL SERVICES and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Obeo - initial API and implementation + *******************************************************************************/ +package org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar; + +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.sirius.diagram.DDiagram; +import org.eclipse.sirius.diagram.ui.provider.Messages; + +/** + * A command that changes the LayoutingMode of the given {@link DDiagram} and updates the image assocatied to the + * Action. + * + * @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a> + * + */ +public class SetLayoutingModeCommand extends AbstractTransactionalCommand { + + /** + * The {@link DDiagram} on witch the layouting mode should be switched. + */ + private DDiagram diagram; + + /** + * Indicates whether the Layouting Mode should be enabled. + */ + private boolean layoutingModeShouldBeEnabled; + + /** + * Constructor. + * + * @param editingDomain + * the editing domain + * @param diagram + * the {@link DDiagram} on witch the layouting mode should be switched + * @param layoutingModeShouldBeEnabled + * indicates whether the layouting mode should be enabled or disabled + */ + public SetLayoutingModeCommand(TransactionalEditingDomain editingDomain, DDiagram diagram, boolean layoutingModeShouldBeEnabled) { + super(editingDomain, Messages.SetLayoutingModeCommandAndUpdateActionImage_activateLabel, null); + this.diagram = diagram; + this.layoutingModeShouldBeEnabled = layoutingModeShouldBeEnabled; + } + + /** + * + * {@inheritDoc} + * + * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, + * org.eclipse.core.runtime.IAdaptable) + */ + @Override + protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { + CommandResult commandResult = CommandResult.newOKCommandResult(); + if (LayoutingModeSwitchingAction.diagramAllowsLayoutingMode(diagram)) { + this.diagram.setIsInLayoutingMode(layoutingModeShouldBeEnabled); + } + return commandResult; + } +} diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/SetShowingModeCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/SetShowingModeCommand.java new file mode 100644 index 0000000000..fa4d04ad04 --- /dev/null +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/SetShowingModeCommand.java @@ -0,0 +1,57 @@ +/******************************************************************************* + * Copyright (c) 2018 THALES GLOBAL SERVICES and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Obeo - initial API and implementation + *******************************************************************************/ +package org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar; + +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.sirius.diagram.DDiagram; + +/** + * Command switching the status of the feature {@link DDiagram#isIsInShowingMode()}. + * + * @author <a href="mailto:pierre.guilet@obeo.fr">Pierre Guilet</a> + * + */ +public class SetShowingModeCommand extends AbstractTransactionalCommand { + + private DDiagram diagram; + + private boolean activate; + + /** + * Init the command. + * + * @param domain + * the {@link TransactionalEditingDomain} to use. + * @param diagram + * the {@link DDiagram} to use. + * @param label + * the label to use. + * @param activate + * true if the mode should be activated. False if it should be disabled. + */ + public SetShowingModeCommand(TransactionalEditingDomain domain, DDiagram diagram, String label, boolean activate) { + super(domain, label, null); + this.diagram = diagram; + this.activate = activate; + } + + @Override + protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { + diagram.setIsInShowingMode(activate); + return CommandResult.newOKCommandResult(); + } + +} diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/ShowingModeSwitchingAction.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/ShowingModeSwitchingAction.java index 7d597067f5..410412c649 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/ShowingModeSwitchingAction.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/ShowingModeSwitchingAction.java @@ -10,11 +10,10 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar; -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.core.runtime.IStatus; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.emf.transaction.util.TransactionUtil; import org.eclipse.gef.Request; @@ -23,20 +22,17 @@ import org.eclipse.gef.commands.UnexecutableCommand; import org.eclipse.gmf.runtime.common.core.command.CommandResult; import org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction; import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; -import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand; -import org.eclipse.gmf.runtime.notation.Diagram; import org.eclipse.jface.action.IStatusLineManager; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.sirius.common.ui.tools.api.util.EclipseUIUtil; import org.eclipse.sirius.diagram.DDiagram; -import org.eclipse.sirius.diagram.ui.edit.api.part.IDDiagramEditPart; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.image.DiagramImagesPath; import org.eclipse.sirius.diagram.ui.tools.api.ui.actions.ActionIds; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IEditorSite; -import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.part.EditorActionBarContributor; /** @@ -61,19 +57,18 @@ public class ShowingModeSwitchingAction extends DiagramAction { /** * Default constructor. * - * @param workbenchPage - * The workbench page associated with this action + * @param iWorkbenchPart + * The workbench part associated with this action * @param editorDiagram * the {@link DDiagram} on witch the showing mode should be switched */ - public ShowingModeSwitchingAction(IWorkbenchPage workbenchPage, DDiagram editorDiagram) { - super(workbenchPage); + public ShowingModeSwitchingAction(IWorkbenchPart iWorkbenchPart, DDiagram editorDiagram) { + super(iWorkbenchPart); setId(ActionIds.SWITCH_SHOWING_MODE); this.ddiagram = editorDiagram; if (ddiagram != null) { setImageDescriptor(ACTIVATE_SHOW_HIDE_MODE_IMAGE_DESCRIPTOR); setTextAndStatusAccordingToShowingMode(); - setChecked(ddiagram.isIsInShowingMode()); } } @@ -83,13 +78,7 @@ public class ShowingModeSwitchingAction extends DiagramAction { */ private void setTextAndStatusAccordingToShowingMode() { // Step 1 : updating action's text and image - if (this.ddiagram != null && this.ddiagram.isIsInShowingMode()) { - setText(Messages.ShowingModeSwitchingAction_deactivate); - setChecked(true); - } else { - setText(Messages.ShowingModeSwitchingAction_activate); - setChecked(false); - } + setText(Messages.ShowingModeSwitchingAction_label); // Step 2 : updating the editor's status bar IEditorPart activeEditor = EclipseUIUtil.getActiveEditor(); @@ -118,77 +107,25 @@ public class ShowingModeSwitchingAction extends DiagramAction { } } - /** - * - * {@inheritDoc} - * - * @see org.eclipse.jface.action.Action#getStyle() - */ @Override public int getStyle() { - return AS_CHECK_BOX; + return AS_UNSPECIFIED; } - /** - * - * {@inheritDoc} - * - * @see org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction#isSelectionListener() - */ @Override protected boolean isSelectionListener() { return false; } - /** - * - * {@inheritDoc} - * - * @see org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction#getCommand() - */ @Override protected Command getCommand() { Command returnedCommand = UnexecutableCommand.INSTANCE; - List<?> selectedObjects = getSelectedObjects(); - if (!selectedObjects.isEmpty()) { - Object nextObject = selectedObjects.iterator().next(); - if (nextObject instanceof IDDiagramEditPart) { - IDDiagramEditPart diagramEP = (IDDiagramEditPart) nextObject; - if (diagramEP.getModel() instanceof Diagram && ((Diagram) diagramEP.getModel()).getElement() instanceof DDiagram) { - Diagram diagramGMF = (Diagram) diagramEP.getModel(); - returnedCommand = switchShowingModeCommand((DDiagram) diagramGMF.getElement()); - } - } - } + returnedCommand = switchShowingModeCommand(ddiagram); return returnedCommand; } /** - * Command switching the status of the feature {@link DDiagram#isIsInShowingMode()}. - * - * @author <a href="mailto:pierre.guilet@obeo.fr">Pierre Guilet</a> - * - */ - private class ShowingModeSwitch extends AbstractTransactionalCommand { - - private DDiagram diagram; - - ShowingModeSwitch(TransactionalEditingDomain domain, DDiagram diagram, String label) { - super(domain, label, null); - this.diagram = diagram; - } - - @Override - protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - diagram.setIsInShowingMode(!diagram.isIsInShowingMode()); - setTextAndStatusAccordingToShowingMode(); - return CommandResult.newOKCommandResult(); - } - - } - - /** * Returns a command that deactivate the showing mode of the given {@link DDiagram}. * * @param diagram @@ -200,29 +137,29 @@ public class ShowingModeSwitchingAction extends DiagramAction { TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(diagram); if (editingDomain != null) { String commandLabel = diagram.isIsInShowingMode() ? Messages.SetShowingModeCommandAndUpdateActionImage_deactivateLabel : Messages.SetShowingModeCommandAndUpdateActionImage_activateLabel; - returnedCommand = new ICommandProxy(new ShowingModeSwitch(editingDomain, diagram, commandLabel)); + returnedCommand = new ICommandProxy(new SetLayoutingModeCommand(TransactionUtil.getEditingDomain(ddiagram), ddiagram, false)) + .chain(new ICommandProxy(new SetShowingModeCommand(editingDomain, diagram, commandLabel, true) { + + @Override + protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { + CommandResult doExecuteWithResult = super.doExecuteWithResult(monitor, info); + if (IStatus.OK == doExecuteWithResult.getStatus().getCode()) { + setTextAndStatusAccordingToShowingMode(); + } + return doExecuteWithResult; + } + + })); } return returnedCommand; } - /** - * - * {@inheritDoc} - * - * @see org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction#dispose() - */ @Override public void dispose() { ddiagram = null; super.dispose(); } - /** - * - * {@inheritDoc} - * - * @see org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction#createTargetRequest() - */ @Override protected Request createTargetRequest() { return null; diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/TabbarFillerWithContributions.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/TabbarFillerWithContributions.java index 0166084f17..5e8a90d81b 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/TabbarFillerWithContributions.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/TabbarFillerWithContributions.java @@ -20,6 +20,7 @@ import org.eclipse.jface.action.Separator; import org.eclipse.jface.action.ToolBarManager; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.ui.edit.api.part.AbstractDDiagramEditPart; import org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar.contributions.TabbarContributionFactory; import org.eclipse.sirius.diagram.ui.tools.internal.menu.PopupMenuContribution; @@ -32,8 +33,6 @@ import org.eclipse.ui.IWorkbenchPage; */ public class TabbarFillerWithContributions extends AbstractTabbarFiller { - private static final String SHOWING_MODE_SYSTEM_PROPERTY = "org.eclipse.sirius.ui.activateShowingMode"; //$NON-NLS-1$ - private static final String ARRANGE_SELECTION = "org.eclipse.sirius.diagram.ui.tabbar.arrangeselection"; //$NON-NLS-1$ private static final String REFRESH = "org.eclipse.sirius.diagram.ui.tabbar.refresh"; //$NON-NLS-1$ @@ -56,6 +55,8 @@ public class TabbarFillerWithContributions extends AbstractTabbarFiller { private static final String SIZE = "org.eclipse.sirius.diagram.ui.tabbar.size"; //$NON-NLS-1$ + private static final String MODES = "org.eclipse.sirius.diagram.ui.tabbar.modes"; //$NON-NLS-1$ + private List<IContributionItem> dynamicContributions = new ArrayList<IContributionItem>(); private ArrayList<IContributionItem> diagramContributionItems = new ArrayList<>(); @@ -150,6 +151,7 @@ public class TabbarFillerWithContributions extends AbstractTabbarFiller { initSeparator(REFRESH); initSeparator(LAYER_FILTER); initSeparator(HIDE_PIN); + initSeparator(MODES); initSeparator(PAST); initSeparator(HIDE_DELETE); initSeparator(ZOOM); @@ -180,6 +182,7 @@ public class TabbarFillerWithContributions extends AbstractTabbarFiller { addContributionItem(diagramContributionItems, HIDE_PIN, contributionFactory.createSelectPinnedElementsContribution(part)); addContributionItem(diagramContributionItems, HIDE_PIN, contributionFactory.createSelectHiddenElementsContribution(part)); + addContributionItem(diagramContributionItems, MODES, contributionFactory.createModesMenuManager((DDiagram) part.getDiagram().getElement())); addContributionItem(diagramContributionItems, PAST, contributionFactory.createPasteFormatContribution(part)); @@ -187,10 +190,6 @@ public class TabbarFillerWithContributions extends AbstractTabbarFiller { addContributionItem(diagramContributionItems, ZOOM, contributionFactory.createZoomOutContribution(part)); addContributionItem(diagramContributionItems, ZOOM, contributionFactory.createZoomInContribution(part)); - if (Boolean.getBoolean(SHOWING_MODE_SYSTEM_PROPERTY)) { - addContributionItem(diagramContributionItems, EXPORT, contributionFactory.createShowingModeContributionItem(part, manager)); - } - addContributionItem(diagramContributionItems, EXPORT, contributionFactory.createLayoutingModeContributionItem(part)); addContributionItem(diagramContributionItems, EXPORT, contributionFactory.createSaveAsImageContributionItem()); } @@ -210,7 +209,7 @@ public class TabbarFillerWithContributions extends AbstractTabbarFiller { IContributionItem pinElementContributionItem = contributionFactory.createPinElementContribution(part); addContributionItem(diagramElementContributionItems, HIDE_PIN, contributionFactory.createUnPinElementContribution(part, pinElementContributionItem)); addContributionItem(diagramElementContributionItems, HIDE_PIN, pinElementContributionItem); - + addContributionItem(diagramElementContributionItems, MODES, contributionFactory.createModesMenuManager((DDiagram) part.getDiagram().getElement())); addContributionItem(diagramElementContributionItems, PAST, contributionFactory.createCopyFormatContribution(part)); addContributionItem(diagramElementContributionItems, HIDE_DELETE, contributionFactory.createDeleteFromModelContribution(part)); diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/contributions/ModesMenuManager.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/contributions/ModesMenuManager.java new file mode 100644 index 0000000000..6ed9ba1a53 --- /dev/null +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/contributions/ModesMenuManager.java @@ -0,0 +1,140 @@ +/******************************************************************************* + * Copyright (c) 2018 THALES GLOBAL SERVICES and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Obeo - initial API and implementation + *******************************************************************************/ +package org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar.contributions; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +import org.eclipse.gmf.runtime.common.ui.action.ActionMenuManager; +import org.eclipse.jface.action.Action; +import org.eclipse.jface.action.ActionContributionItem; +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.action.IContributionItem; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.sirius.common.ui.tools.api.util.EclipseUIUtil; +import org.eclipse.sirius.diagram.DDiagram; +import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; +import org.eclipse.sirius.diagram.ui.tools.api.editor.DDiagramEditor; +import org.eclipse.sirius.diagram.ui.tools.api.image.DiagramImagesPath; +import org.eclipse.sirius.diagram.ui.tools.api.ui.actions.ActionIds; +import org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar.LayoutingModeSwitchingAction; +import org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar.ShowingModeSwitchingAction; +import org.eclipse.ui.IWorkbenchPage; + +/** + * Menu manager used to display a drop down menu allowing to choose the edit mode for a diagram editor. The available + * modes are the default one, the layouting and show/hide mode. + * + * @author <a href="mailto:pierre.guilet@obeo.fr">Pierre Guilet</a> + * + */ +public class ModesMenuManager extends ActionMenuManager { + + /** + * The default mode menu action containing the UI for the straighten menu manager + */ + private static class StandardModeMenuAction extends Action { + StandardModeMenuAction() { + setText(Messages.DefaultModeAction_Label); + ImageDescriptor imageDesc = DiagramUIPlugin.Implementation.getBundledImageDescriptor(DiagramImagesPath.DEFAULT_MODE); + setImageDescriptor(imageDesc); + setHoverImageDescriptor(imageDesc); + } + } + + /** + * Creates a new instance of the menu manager. + * + * @param page + * the current {@link IWorkbenchPage}. + * @param editorDiagram + * the current {@link DDiagram}. + */ + public ModesMenuManager(IWorkbenchPage page, DDiagram editorDiagram) { + super(ActionIds.DEFAULT_MODE, new StandardModeMenuAction(), true); + } + + /** + * Set the default action id for this menu manager. + * + * @param actionId + * the action id to set + */ + public void setDefaultAction(String actionId) { + for (final IContributionItem item : getItems()) { + if (item instanceof ActionContributionItem) { + if (actionId.equals(((ActionContributionItem) item).getAction().getId())) { + final IAction defaultAction = ((ActionContributionItem) item).getAction(); + setHandler(defaultAction); + super.setDefaultAction(defaultAction); + return; + } + } + } + } + + /** + * We should use reflection to access the default handler method + * + * @param defaultAction + * the default action to set + */ + private void setHandler(final IAction defaultAction) { + Method method; + try { + method = MenuCreatorAction.class.getDeclaredMethod("setActionHandler", IAction.class); //$NON-NLS-1$ + method.setAccessible(true); + method.invoke(super.action, defaultAction); + } catch (SecurityException e) { + /* do nothing should not happen */ + } catch (NoSuchMethodException e) { + /* do nothing should not happen */ + } catch (IllegalArgumentException e) { + /* do nothing should not happen */ + } catch (IllegalAccessException e) { + /* do nothing should not happen */ + } catch (InvocationTargetException e) { + /* do nothing should not happen */ + } + } + + @Override + public void setVisible(boolean visible) { + super.setVisible(visible); + if (isEmpty() && visible) { + + IWorkbenchPage page = EclipseUIUtil.getActivePage(); + + if (page != null && page.getActivePart() instanceof DDiagramEditor) { + final DDiagramEditor editor = (DDiagramEditor) page.getActivePart(); + DDiagram editorDiagram = (DDiagram) editor.getRepresentation(); + add(new StandardModeAction(page.getActivePart(), editorDiagram)); + add(new ShowingModeSwitchingAction(page.getActivePart(), editorDiagram)); + if (LayoutingModeSwitchingAction.diagramAllowsLayoutingMode(editorDiagram)) { + add(new LayoutingModeSwitchingAction(page.getActivePart(), editorDiagram)); + } + if (editorDiagram.isIsInLayoutingMode()) { + setDefaultAction(ActionIds.SWITCH_LAYOUTING_MODE); + } else if (editorDiagram.isIsInShowingMode()) { + setDefaultAction(ActionIds.SWITCH_SHOWING_MODE); + } else { + setDefaultAction(ActionIds.DEFAULT_MODE); + } + + } + } else if (!isEmpty() && !visible) { + remove(ActionIds.SWITCH_LAYOUTING_MODE); + remove(ActionIds.SWITCH_SHOWING_MODE); + remove(ActionIds.DEFAULT_MODE); + } + } +} diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/contributions/StandardModeAction.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/contributions/StandardModeAction.java new file mode 100644 index 0000000000..719dfe020a --- /dev/null +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/contributions/StandardModeAction.java @@ -0,0 +1,178 @@ +/******************************************************************************* + * Copyright (c) 2018 THALES GLOBAL SERVICES. + * All rights reserved. This program and 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: + * Obeo - initial API and implementation + *******************************************************************************/ +package org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar.contributions; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.transaction.util.TransactionUtil; +import org.eclipse.gef.Request; +import org.eclipse.gef.commands.Command; +import org.eclipse.gef.commands.UnexecutableCommand; +import org.eclipse.gmf.runtime.common.core.command.CommandResult; +import org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction; +import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; +import org.eclipse.jface.action.IStatusLineManager; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.sirius.common.ui.tools.api.util.EclipseUIUtil; +import org.eclipse.sirius.diagram.DDiagram; +import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; +import org.eclipse.sirius.diagram.ui.tools.api.image.DiagramImagesPath; +import org.eclipse.sirius.diagram.ui.tools.api.ui.actions.ActionIds; +import org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar.SetLayoutingModeCommand; +import org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar.SetShowingModeCommand; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IEditorSite; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.part.EditorActionBarContributor; + +/** + * This action deactivate the layouting and show/hide mode if they are activated to go back to standard edit mode. + * + * @author <a href="mailto:pierre.guilet@obeo.fr">Pierre Guilet</a> + * + */ +public class StandardModeAction extends DiagramAction { + + /** + * Icon used in the tabbar to allow end-user to activate the showing mode. It is also used in the editor's status + * line to indicate that showing mode is active. + */ + private static final ImageDescriptor DEFAULT_MODE_IMAGE_DESCRIPTOR = DiagramUIPlugin.Implementation.getBundledImageDescriptor(DiagramImagesPath.DEFAULT_MODE); + + /** + * The {@link DDiagram} on witch the showing mode should be switched. + */ + private DDiagram ddiagram; + + /** + * Default constructor. + * + * @param iWorkbenchPart + * The workbench part associated with this action + * @param editorDiagram + * the {@link DDiagram} on witch the showing mode should be switched + */ + public StandardModeAction(IWorkbenchPart iWorkbenchPart, DDiagram editorDiagram) { + super(iWorkbenchPart); + setId(ActionIds.DEFAULT_MODE); + this.ddiagram = editorDiagram; + if (ddiagram != null) { + setImageDescriptor(DEFAULT_MODE_IMAGE_DESCRIPTOR); + setTextAndStatusAccordingToDefaultMode(); + } + } + + /** + * Switches the text associated to this Action and updates this editor's statusLine. + */ + private void setTextAndStatusAccordingToDefaultMode() { + // Step 1 : updating action's text and image + setText(Messages.DefaultModeAction_Label); + + // Step 2 : updating the editor's status bar + IEditorPart activeEditor = EclipseUIUtil.getActiveEditor(); + if (activeEditor != null) { + // Step 2.1 : trying to get the status line manager + IEditorSite site = (IEditorSite) activeEditor.getSite(); + EditorActionBarContributor actionBarContributor = null; + IStatusLineManager statusLineManager = null; + if (site != null && site.getActionBarContributor() instanceof EditorActionBarContributor) { + actionBarContributor = (EditorActionBarContributor) site.getActionBarContributor(); + } + if (actionBarContributor != null && actionBarContributor.getActionBars() != null) { + statusLineManager = actionBarContributor.getActionBars().getStatusLineManager(); + } + + // Step 2.2 : if statusLineManager can be found + if (statusLineManager != null) { + // we update it according to the DDiagram showing mode status + String statusMessage = Messages.DefaultModeAction_statusOn; + statusLineManager.setMessage(DiagramUIPlugin.getPlugin().getImage(DEFAULT_MODE_IMAGE_DESCRIPTOR), statusMessage); + } + } + } + + /** + * + * {@inheritDoc} + * + * @see org.eclipse.jface.action.Action#getStyle() + */ + @Override + public int getStyle() { + return AS_UNSPECIFIED; + } + + /** + * + * {@inheritDoc} + * + * @see org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction#isSelectionListener() + */ + @Override + protected boolean isSelectionListener() { + return false; + } + + /** + * + * {@inheritDoc} + * + * @see org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction#getCommand() + */ + @Override + protected Command getCommand() { + Command returnedCommand = UnexecutableCommand.INSTANCE; + if (getWorkbenchPart() != null) { + String commandLabel = ddiagram.isIsInShowingMode() ? Messages.SetShowingModeCommandAndUpdateActionImage_deactivateLabel : Messages.SetShowingModeCommandAndUpdateActionImage_activateLabel; + returnedCommand = new ICommandProxy(new SetShowingModeCommand(TransactionUtil.getEditingDomain(ddiagram), ddiagram, commandLabel, false)) + .chain(new ICommandProxy(new SetLayoutingModeCommand(TransactionUtil.getEditingDomain(ddiagram), ddiagram, false) { + + @Override + protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { + CommandResult doExecuteWithResult = super.doExecuteWithResult(monitor, info); + if (IStatus.OK == doExecuteWithResult.getStatus().getCode()) { + setTextAndStatusAccordingToDefaultMode(); + } + return doExecuteWithResult; + } + })); + } + return returnedCommand; + } + + /** + * + * {@inheritDoc} + * + * @see org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction#dispose() + */ + @Override + public void dispose() { + ddiagram = null; + super.dispose(); + } + + /** + * + * {@inheritDoc} + * + * @see org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction#createTargetRequest() + */ + @Override + protected Request createTargetRequest() { + return null; + } + +} diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/contributions/TabbarContributionFactory.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/contributions/TabbarContributionFactory.java index 702f4cecc7..b4d4dea55c 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/contributions/TabbarContributionFactory.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/contributions/TabbarContributionFactory.java @@ -23,6 +23,7 @@ import org.eclipse.jface.action.ContributionItem; import org.eclipse.jface.action.IAction; import org.eclipse.jface.action.IContributionItem; import org.eclipse.jface.action.ToolBarManager; +import org.eclipse.sirius.common.ui.tools.api.util.EclipseUIUtil; import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.description.DiagramDescription; import org.eclipse.sirius.diagram.ui.part.SiriusDiagramActionBarContributor; @@ -555,7 +556,7 @@ public class TabbarContributionFactory { final DDiagramEditor editor = (DDiagramEditor) part; DDiagram editorDiagram = (DDiagram) editor.getRepresentation(); if (LayoutingModeSwitchingAction.diagramAllowsLayoutingMode(editorDiagram)) { - LayoutingModeSwitchingAction layoutingModeSwitchingAction = new LayoutingModeSwitchingAction(site.getPage(), editorDiagram); + LayoutingModeSwitchingAction layoutingModeSwitchingAction = new LayoutingModeSwitchingAction(part, editorDiagram); return new TabbarActionContributionItem(layoutingModeSwitchingAction); } } @@ -563,6 +564,20 @@ public class TabbarContributionFactory { } /** + * Creates the {@link ModesMenuManager} allowing to choose a diagram editor edit mode. + * + * @param editorDiagram + * the diagram from which the menu is made available. + * @return the {@link ModesMenuManager}. + */ + public IContributionItem createModesMenuManager(DDiagram editorDiagram) { + ModesMenuManager modesMenu = null; + modesMenu = new ModesMenuManager(EclipseUIUtil.getActivePage(), editorDiagram); + modesMenu.setVisible(true); + return modesMenu; + } + + /** * Creates the Showing Mode contribution item. This button enables a special "showing mode" in which invisible * diagram elements are temporarily revealed to allow user to easily make them visible. * @@ -577,7 +592,7 @@ public class TabbarContributionFactory { if (site != null && part instanceof DDiagramEditor) { final DDiagramEditor editor = (DDiagramEditor) part; DDiagram editorDiagram = (DDiagram) editor.getRepresentation(); - ShowingModeSwitchingAction showingModeSwitchingAction = new ShowingModeSwitchingAction(site.getPage(), editorDiagram); + ShowingModeSwitchingAction showingModeSwitchingAction = new ShowingModeSwitchingAction(part, editorDiagram); TabbarActionContributionItem tabbarActionContributionItem = new TabbarActionContributionItem(showingModeSwitchingAction); return tabbarActionContributionItem; diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/figure/RegionRoundedGradientRectangle.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/figure/RegionRoundedGradientRectangle.java index f8521ddcb2..ddc40acf42 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/figure/RegionRoundedGradientRectangle.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/figure/RegionRoundedGradientRectangle.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2015 Obeo. + * Copyright (c) 2015, 2018 Obeo. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -16,25 +16,22 @@ import org.eclipse.draw2d.Graphics; import org.eclipse.draw2d.PositionConstants; import org.eclipse.draw2d.geometry.Dimension; import org.eclipse.draw2d.geometry.Rectangle; +import org.eclipse.gmf.runtime.notation.View; import org.eclipse.sirius.diagram.BackgroundStyle; import org.eclipse.sirius.diagram.ui.tools.api.figure.GradientRoundedRectangle; /** - * Specific {@link GradientRoundedRectangle} able to use a different dimension - * for chosen corners. + * Specific {@link GradientRoundedRectangle} able to use a different dimension for chosen corners. * - * This is currently used to render region, and will always be configured to - * have outline == false. + * This is currently used to render region, and will always be configured to have outline == false. * - * fillShape(Graphics) draws the chosen corners with the additional dimension - * and the other ones with the main corner dimension. - * - * outlineShape(Graphics) currently calls super.outlineShape() and will draw the - * outline corresponding to a standard RoundedCorner with the same corner + * fillShape(Graphics) draws the chosen corners with the additional dimension and the other ones with the main corner * dimension. * - * outlineShape(Graphics) will never be called as setOutline will do nothing and - * the outline is set to false + * outlineShape(Graphics) currently calls super.outlineShape() and will draw the outline corresponding to a standard + * RoundedCorner with the same corner dimension. + * + * outlineShape(Graphics) will never be called as setOutline will do nothing and the outline is set to false * * @author mporhel */ @@ -51,16 +48,16 @@ public class RegionRoundedGradientRectangle extends GradientRoundedRectangle { * dimension of the corner (with radius, height radius) * @param backgroundStyle * style of the wanted gradient - * + * @param view + * the model view of the part showing the figure. */ - public RegionRoundedGradientRectangle(final Dimension dimension, final BackgroundStyle backgroundStyle) { - super(dimension, backgroundStyle); + public RegionRoundedGradientRectangle(final Dimension dimension, final BackgroundStyle backgroundStyle, View view) { + super(dimension, backgroundStyle, view); setOutline(false); } /** - * The outline of the shape is disabled for regions which have a specific - * border figure. + * The outline of the shape is disabled for regions which have a specific border figure. */ @Override public void setOutline(boolean b) { @@ -68,19 +65,15 @@ public class RegionRoundedGradientRectangle extends GradientRoundedRectangle { } /** - * Sets the dimensions of each corner. This will form the radii of the arcs - * which form the additional corners. + * Sets the dimensions of each corner. This will form the radii of the arcs which form the additional corners. * * @param d - * the dimensions of the corner, it should be smaller than the - * main corner dimension to be visible. + * the dimensions of the corner, it should be smaller than the main corner dimension to be visible. * * @param chosenCorners - * the chosen corners, see values of the BitSet for the following - * indexes: {@link PositionConstants.NORTH_WEST}, - * {@link PositionConstants.NORTH_EAST}, - * {@link PositionConstants.SOUTH_EAST}, - * {@link PositionConstants.SOUTH_WEST}. + * the chosen corners, see values of the BitSet for the following indexes: + * {@link PositionConstants.NORTH_WEST}, {@link PositionConstants.NORTH_EAST}, + * {@link PositionConstants.SOUTH_EAST}, {@link PositionConstants.SOUTH_WEST}. */ public void setAdditionalCornerDimensions(Dimension d, BitSet chosenCorners) { positions.clear(); @@ -106,14 +99,11 @@ public class RegionRoundedGradientRectangle extends GradientRoundedRectangle { } /** - * Return a {@link BitSet} knowing the chosen corner, see values of the - * BitSet for the following indexes: {@link PositionConstants.NORTH_WEST}, - * {@link PositionConstants.NORTH_EAST}, - * {@link PositionConstants.SOUTH_EAST}, + * Return a {@link BitSet} knowing the chosen corner, see values of the BitSet for the following indexes: + * {@link PositionConstants.NORTH_WEST}, {@link PositionConstants.NORTH_EAST}, {@link PositionConstants.SOUTH_EAST}, * {@link PositionConstants.SOUTH_WEST}. * - * @return the positions of the corner to draw with the additional corner - * dimension. + * @return the positions of the corner to draw with the additional corner dimension. */ public BitSet getAdditionalDimensionCorners() { return positions; diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/figure/ViewNodeFigure.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/figure/ViewNodeFigure.java index c96a9ee8d2..2d859eb124 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/figure/ViewNodeFigure.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/figure/ViewNodeFigure.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2015 Obeo. + * Copyright (c) 2015, 2018 Obeo. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -12,8 +12,11 @@ package org.eclipse.sirius.diagram.ui.tools.internal.figure; import org.eclipse.draw2d.ColorConstants; import org.eclipse.draw2d.FlowLayout; +import org.eclipse.draw2d.Graphics; import org.eclipse.draw2d.PositionConstants; import org.eclipse.draw2d.RectangleFigure; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.sirius.diagram.ui.business.internal.view.ShowingViewUtil; import org.eclipse.sirius.diagram.ui.tools.api.figure.SiriusWrapLabel; /** @@ -22,12 +25,33 @@ import org.eclipse.sirius.diagram.ui.tools.api.figure.SiriusWrapLabel; * @author pcdavid */ public class ViewNodeFigure extends RectangleFigure { - private final SiriusWrapLabel nodeLabel = new SiriusWrapLabel(); + private final SiriusWrapLabel nodeLabel = new SiriusWrapLabel() { + @Override + public void paint(Graphics graphics) { + if (view != null) { + ShowingViewUtil.initGraphicsForVisibleAndInvisibleElements(this, graphics, view); + try { + super.paint(graphics); + graphics.restoreState(); + } finally { + graphics.popState(); + } + } else { + super.paint(graphics); + } + } + }; + + private View view; /** * Create a new figure. + * + * @param view + * the model view of the part showing the figure. */ - public ViewNodeFigure() { + public ViewNodeFigure(View view) { + this.view = view; final FlowLayout layoutThis = new FlowLayout(); layoutThis.setStretchMinorAxis(false); layoutThis.setMinorAlignment(FlowLayout.ALIGN_TOPLEFT); @@ -50,6 +74,21 @@ public class ViewNodeFigure extends RectangleFigure { nodeLabel.setForegroundColor(ColorConstants.black); } + @Override + public void paint(Graphics graphics) { + if (view != null) { + ShowingViewUtil.initGraphicsForVisibleAndInvisibleElements(this, graphics, view); + try { + super.paint(graphics); + graphics.restoreState(); + } finally { + graphics.popState(); + } + } else { + super.paint(graphics); + } + } + /** * Return the figure for this node's label. * diff --git a/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/provider/Messages.java b/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/provider/Messages.java index fe3ff7892c..16e604b25c 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/provider/Messages.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/provider/Messages.java @@ -681,10 +681,7 @@ public final class Messages { public static String LayoutDataHelperImpl_unkownLayoutData; @TranslatableMessage - public static String LayoutingModeSwitchingAction_activate; - - @TranslatableMessage - public static String LayoutingModeSwitchingAction_deactivate; + public static String LayoutingModeSwitchingAction_label; @TranslatableMessage public static String LocationURI_ParsePb_Blank; @@ -705,10 +702,7 @@ public final class Messages { public static String LocationURI_ParsePb_WrongScheme; @TranslatableMessage - public static String ShowingModeSwitchingAction_activate; - - @TranslatableMessage - public static String ShowingModeSwitchingAction_deactivate; + public static String ShowingModeSwitchingAction_label; @TranslatableMessage public static String ShowingModeSwitchingAction_statusOn; @@ -1542,16 +1536,22 @@ public final class Messages { public static String LayoutAlgorithmProviderRegistry_classInitialization; @TranslatableMessage - public static String DoubleClickEditPolicy_filterConfirmDialogTitle; - - @TranslatableMessage public static String DoubleClickEditPolicy_filterConfirmDialogBody; @TranslatableMessage public static String DoubleClickEditPolicy_layerConfirmDialogBody; @TranslatableMessage - public static String DoubleClickEditPolicy_layerConfirmDialogTitle; + public static String DoubleClickEditPolicy_confirmDialogTitle; + + @TranslatableMessage + public static String DefaultModeAction_statusOn; + + @TranslatableMessage + public static String DefaultModeAction_Label; + + @TranslatableMessage + public static String DoubleClickEditPolicy_confirmDialogAsking; // CHECKSTYLE:ON diff --git a/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/tools/api/image/DiagramImagesPath.java b/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/tools/api/image/DiagramImagesPath.java index e1ae2202f8..fbd1a46852 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/tools/api/image/DiagramImagesPath.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/tools/api/image/DiagramImagesPath.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2017 THALES GLOBAL SERVICES and others. + * Copyright (c) 2007, 2018 THALES GLOBAL SERVICES and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -135,7 +135,7 @@ public interface DiagramImagesPath { String LAYOUTING_MODE_ACTIVE_ICON = "icons/layoutingMode_activate.png"; //$NON-NLS-1$ /** Showing mode icon. */ - String SHOWING_MODE_ACTIVE_ICON = "icons/showingMode_activate.gif"; //$NON-NLS-1$ + String SHOWING_MODE_ACTIVE_ICON = "icons/showingMode_activate.png"; //$NON-NLS-1$ /** path of the image displayed thanks to this decorator. */ String HAS_DIAG_IMG = "icons/HasLink.gif"; //$NON-NLS-1$ @@ -226,4 +226,9 @@ public interface DiagramImagesPath { * Path of the action's image to straighten to top. */ String STRAIGHTEN_WITH_TOP_PINNED = "icons/straightenWithTopPinned.png"; //$NON-NLS-1$ + + /** + * Path of the action's image to straighten to top. + */ + String DEFAULT_MODE = "icons/defaultMode.png"; //$NON-NLS-1$ } diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/AbstractDiagramCommandBuilder.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/AbstractDiagramCommandBuilder.java index 8ced083c64..2ee75ed505 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/AbstractDiagramCommandBuilder.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/AbstractDiagramCommandBuilder.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2015 THALES GLOBAL SERVICES. + * Copyright (c) 2009, 2018 THALES GLOBAL SERVICES. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -26,20 +26,19 @@ import org.eclipse.sirius.ecore.extender.business.api.accessor.exception.MetaCla import org.eclipse.sirius.ext.base.Option; import org.eclipse.sirius.tools.api.command.DCommand; import org.eclipse.sirius.tools.api.interpreter.InterpreterUtil; +import org.eclipse.sirius.viewpoint.DRepresentationElement; import org.eclipse.sirius.viewpoint.DSemanticDecorator; import org.eclipse.sirius.viewpoint.description.tool.AbstractToolDescription; /** - * Default implementation for - * {@link org.eclipse.sirius.tools.internal.command.builders.CommandBuilder}. + * Default implementation for {@link org.eclipse.sirius.tools.internal.command.builders.CommandBuilder}. * * @author mchauvin */ public abstract class AbstractDiagramCommandBuilder extends org.eclipse.sirius.tools.internal.command.builders.AbstractCommandBuilder { /** - * Check the precondition of the specified tool with the specified container - * and diagram. + * Check the precondition of the specified tool with the specified container and diagram. * * @param diagram * the diagram container @@ -52,8 +51,7 @@ public abstract class AbstractDiagramCommandBuilder extends org.eclipse.sirius.t } /** - * Check the precondition of the specified tool with the specified - * container. + * Check the precondition of the specified tool with the specified container. * * @param diagramElement * the diagram element container @@ -106,8 +104,7 @@ public abstract class AbstractDiagramCommandBuilder extends org.eclipse.sirius.t } /** - * Add a refresh task to the diagram which contains the diagram element - * given as parameter. + * Add a refresh task to the diagram which contains the diagram element given as parameter. * * @param diagramElement * the diagram element. @@ -150,13 +147,11 @@ public abstract class AbstractDiagramCommandBuilder extends org.eclipse.sirius.t } /** - * Indicates if the given element is contained in a {@link DDiagram} that is - * in Layouting mode. + * Indicates if the given element is contained in a {@link DDiagram} that is in Layouting mode. * * @param element * the {@link DDiagram} or any {@link DDiagramElement} - * @return true if the given element is contained in a {@link DDiagram} that - * is in Layouting mode + * @return true if the given element is contained in a {@link DDiagram} that is in Layouting mode */ public boolean isInLayoutingModeDiagram(EObject element) { // Step 1 : getting the DDiagram @@ -178,8 +173,30 @@ public abstract class AbstractDiagramCommandBuilder extends org.eclipse.sirius.t } /** - * Check the precondition of the specified tool with the specified - * container. + * Indicates if the given element is contained in a {@link DDiagram} that is in showing mode. + * + * @param element + * the {@link DDiagram} or any {@link DDiagramElement} + * @return true if the given element is contained in a {@link DDiagram} that is in showing mode + */ + public boolean isInShowingModeDiagram(DRepresentationElement element) { + DDiagram ddiagram = null; + + if (element instanceof DDiagram) { + ddiagram = (DDiagram) element; + } else { + if (element instanceof DDiagramElement) { + ddiagram = ((DDiagramElement) element).getParentDiagram(); + } + } + if (ddiagram != null) { + return ddiagram.isIsInShowingMode(); + } + return false; + } + + /** + * Check the precondition of the specified tool with the specified container. * * @param container * the container variable. diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/DirectEditCommandBuilder.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/DirectEditCommandBuilder.java index 2a854e93db..64bb184b06 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/DirectEditCommandBuilder.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/DirectEditCommandBuilder.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2015 THALES GLOBAL SERVICES. + * Copyright (c) 2011, 2018 THALES GLOBAL SERVICES. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -81,9 +81,8 @@ public class DirectEditCommandBuilder extends AbstractDiagramCommandBuilder { * @return true if the label can be direct edited, false otherwise */ public boolean canDirectEdit() { - // Layouting mode on diagrams, if the diagram is in - // LayoutingMode, we do not allow direct edit. - boolean valid = !isInLayoutingModeDiagram(repElement); + // if the diagram is in LayoutingMode or show/hide mode, we do not allow direct edit. + boolean valid = !isInLayoutingModeDiagram(repElement) && !isInShowingModeDiagram(repElement); valid = valid && checkPrecondition((DDiagramElement) repElement, directEditTool); return valid; } diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/DoubleClickCommandBuilder.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/DoubleClickCommandBuilder.java index e9628d70f8..369aed8bcc 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/DoubleClickCommandBuilder.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/DoubleClickCommandBuilder.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2015 THALES GLOBAL SERVICES. + * Copyright (c) 2007, 2018 THALES GLOBAL SERVICES. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -83,11 +83,9 @@ public class DoubleClickCommandBuilder extends AbstractDiagramCommandBuilder { } private boolean canDoubleClick() { - // Layouting mode on diagrams - // if the dDiagram is in layoutMode - // We disable this double click, unless the tool is only containing - // Navigation descriptions - boolean valid = !(isInLayoutingModeDiagram(dDiagramElement) && !(tool.getInitialOperation().getFirstModelOperations() instanceof Navigation)); + // if the dDiagram is in layoutMode or show/hide mode, we disable this double click, unless the tool is only + // containing Navigation descriptions + boolean valid = !((isInLayoutingModeDiagram(dDiagramElement) || !isInShowingModeDiagram(dDiagramElement)) && !(tool.getInitialOperation().getFirstModelOperations() instanceof Navigation)); valid = valid && checkPrecondition(dDiagramElement, tool); return valid; } diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/DragAndDropCommandBuilder.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/DragAndDropCommandBuilder.java index 234a944d58..fd7fa87cea 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/DragAndDropCommandBuilder.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/DragAndDropCommandBuilder.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2015 THALES GLOBAL SERVICES. + * Copyright (c) 2009, 2018 THALES GLOBAL SERVICES. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -124,9 +124,8 @@ public class DragAndDropCommandBuilder extends AbstractDiagramCommandBuilder { @Override public Command buildCommand() { if (permissionAuthority.canEditInstance(container) && permissionAuthority.canEditInstance(dragSemantic ? droppedElement : diagramElement) - // Layouting mode on diagrams - // if the ddiagram is in LayoutingMode, we do not allow DnD - && !isInLayoutingModeDiagram(diagramElement)) { + // if the ddiagram is in LayoutingMode or show/hide mode, we do not allow DnD + && !isInLayoutingModeDiagram(diagramElement) && !isInShowingModeDiagram(diagramElement)) { if (container instanceof DSemanticDecorator) { final EObject semanticContainer = ((DSemanticDecorator) container).getTarget(); diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/ReconnectionCommandBuilder.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/ReconnectionCommandBuilder.java index bf04076b54..31b9449d27 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/ReconnectionCommandBuilder.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/ReconnectionCommandBuilder.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2016 THALES GLOBAL SERVICES and others. + * Copyright (c) 2009, 2018 THALES GLOBAL SERVICES and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -103,10 +103,11 @@ public class ReconnectionCommandBuilder extends AbstractDiagramCommandBuilder { Command result = UnexecutableCommand.INSTANCE; - if (permissionAuthority.canEditInstance(reconnectionSource) && permissionAuthority.canEditInstance(reconnectionTarget) && permissionAuthority.canEditInstance(edge) - // Layouting mode on diagrams - // if the ddiagram is in LayoutingMode, we do not allow reconnection - && !isInLayoutingModeDiagram(edge)) { + // if the ddiagram is in LayoutingMode or show/hide mode, we do not allow reconnection + + boolean canEdit = permissionAuthority.canEditInstance(reconnectionSource) && permissionAuthority.canEditInstance(reconnectionTarget) && permissionAuthority.canEditInstance(edge); + canEdit = canEdit && !isInLayoutingModeDiagram(edge) && !isInShowingModeDiagram(edge); + if (canEdit) { final EObject semanticSource = SiriusUtil.getNearestDecorateSemanticElement(reconnectionSource).getTarget(); final EObject semanticTarget = SiriusUtil.getNearestDecorateSemanticElement(reconnectionTarget).getTarget(); @@ -217,14 +218,11 @@ public class ReconnectionCommandBuilder extends AbstractDiagramCommandBuilder { } /** - * Creates a task that will initialize the otherEnd variable to its correct - * value. + * Creates a task that will initialize the otherEnd variable to its correct value. * * @param variables - * the map of variables that will be used during this - * reconnection command - * @return a task that will initialize the otherEnd variable to its correct - * value + * the map of variables that will be used during this reconnection command + * @return a task that will initialize the otherEnd variable to its correct value */ protected ICommandTask getOtherEndVariableCreationTask(final Map<AbstractVariable, Object> variables) { final OtherEndVariable otherEndVariable = getOtherEndVariable(); @@ -258,8 +256,7 @@ public class ReconnectionCommandBuilder extends AbstractDiagramCommandBuilder { /** * Returns the value to assign to the otherEnd variable. * - * @return the end of the Edge before reconnection that is not represented - * by the SourceView variable + * @return the end of the Edge before reconnection that is not represented by the SourceView variable */ protected Object getOtherEndValue() { // If the reconnectionSource is equals to the sourceNode of the edge @@ -272,8 +269,7 @@ public class ReconnectionCommandBuilder extends AbstractDiagramCommandBuilder { } /** - * Variable representing the end of the Edge before reconnection that is not - * represented by the SourceView variable. + * Variable representing the end of the Edge before reconnection that is not represented by the SourceView variable. * * @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a> */ diff --git a/plugins/org.eclipse.sirius.tests.swtbot/data/unit/editModes/vp2120.aird b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/editModes/vp2120.aird new file mode 100644 index 0000000000..d856223244 --- /dev/null +++ b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/editModes/vp2120.aird @@ -0,0 +1,659 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:diagram="http://www.eclipse.org/sirius/diagram/1.1.0" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/sirius/diagram/description/style/1.1.0" xmlns:viewpoint="http://www.eclipse.org/sirius/1.1.0" xsi:schemaLocation="http://www.eclipse.org/sirius/description/1.1.0 http://www.eclipse.org/sirius/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/style/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description/style"> + <viewpoint:DAnalysis xmi:id="_Tf_kgIUYEeC3ftmLixaZXg" selectedViews="_T6-QUIUYEeC3ftmLixaZXg _Dvn0gIVDEeCnb7qGDutJ5Q" version="13.0.0.201804031646"> + <semanticResources>vp2120.ecore</semanticResources> + <ownedViews xmi:type="viewpoint:DView" xmi:id="_T6-QUIUYEeC3ftmLixaZXg"> + <viewpoint xmi:type="description:Viewpoint" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']"/> + <ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" xmi:id="_lhQoYIWtEeietsu_nBwfgQ" name="new LayoutingMode Diagram" repPath="#_le3bsIWtEeietsu_nBwfgQ"> + <description xmi:type="description_1:DiagramDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']"/> + <target xmi:type="ecore:EPackage" href="vp2120.ecore#/"/> + </ownedRepresentationDescriptors> + </ownedViews> + <ownedViews xmi:type="viewpoint:DView" xmi:id="_Dvn0gIVDEeCnb7qGDutJ5Q"> + <viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.sirius.sample.ecore.design/description/ecore.odesign#//@ownedViewpoints[name='Design']"/> + </ownedViews> + </viewpoint:DAnalysis> + <diagram:DSemanticDiagram xmi:id="_deplMIVIEeCSGf835_Mdqg" name="new LayoutingMode Diagram" uid="_le3bsIWtEeietsu_nBwfgQ"> + <ownedAnnotationEntries xmi:type="description:AnnotationEntry" xmi:id="_dfQCIIVIEeCSGf835_Mdqg" source="GMF_DIAGRAMS"> + <data xmi:type="notation:Diagram" xmi:id="_dfQCIYVIEeCSGf835_Mdqg" type="Sirius" element="_deplMIVIEeCSGf835_Mdqg" measurementUnit="Pixel"> + <children xmi:type="notation:Node" xmi:id="_aCXVMIspEeiSiblR-QI2Dg" type="2002" element="_aB7QUIspEeiSiblR-QI2Dg"> + <children xmi:type="notation:Node" xmi:id="_aCX8QIspEeiSiblR-QI2Dg" type="5006"/> + <children xmi:type="notation:Node" xmi:id="_aCX8QYspEeiSiblR-QI2Dg" type="7001"> + <styles xmi:type="notation:SortingStyle" xmi:id="_aCX8QospEeiSiblR-QI2Dg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_aCX8Q4spEeiSiblR-QI2Dg"/> + </children> + <children xmi:type="notation:Node" xmi:id="_aCYjV4spEeiSiblR-QI2Dg" type="3012" element="_aB8edIspEeiSiblR-QI2Dg"> + <children xmi:type="notation:Node" xmi:id="_aCZKYIspEeiSiblR-QI2Dg" type="5010"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_aCZKYYspEeiSiblR-QI2Dg" x="-32" y="21"/> + </children> + <children xmi:type="notation:Node" xmi:id="_aCaYgIspEeiSiblR-QI2Dg" type="3003" element="_aB9FgIspEeiSiblR-QI2Dg"> + <styles xmi:type="notation:ShapeStyle" xmi:id="_aCaYgYspEeiSiblR-QI2Dg" fontName="Segoe UI"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_aCaYgospEeiSiblR-QI2Dg"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_aCYjWIspEeiSiblR-QI2Dg" fontName="Segoe UI" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_aCYjWYspEeiSiblR-QI2Dg" x="150" y="25" width="20" height="20"/> + </children> + <children xmi:type="notation:Node" xmi:id="_iNd0UJpREeiRuck0XXiZ-A" type="3012" element="_iL7jQJpREeiRuck0XXiZ-A"> + <children xmi:type="notation:Node" xmi:id="_iNlJEJpREeiRuck0XXiZ-A" type="5010"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_iNlJEZpREeiRuck0XXiZ-A" x="-18" y="21"/> + </children> + <children xmi:type="notation:Node" xmi:id="_iNrPsJpREeiRuck0XXiZ-A" type="3003" element="_iL8xYJpREeiRuck0XXiZ-A"> + <styles xmi:type="notation:ShapeStyle" xmi:id="_iNrPsZpREeiRuck0XXiZ-A" fontName="Noto Sans"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_iNrPsppREeiRuck0XXiZ-A"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_iNd0UZpREeiRuck0XXiZ-A" fontName="Noto Sans" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_iNd0UppREeiRuck0XXiZ-A" x="55" y="60" width="20" height="20"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_aCXVMYspEeiSiblR-QI2Dg" fontName="Segoe UI" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_aCXVMospEeiSiblR-QI2Dg" x="510" y="415" width="150" height="70"/> + </children> + <children xmi:type="notation:Node" xmi:id="_aCX8RIspEeiSiblR-QI2Dg" type="2002" element="_aB8ecIspEeiSiblR-QI2Dg"> + <children xmi:type="notation:Node" xmi:id="_aCX8R4spEeiSiblR-QI2Dg" type="5006"/> + <children xmi:type="notation:Node" xmi:id="_aCX8SIspEeiSiblR-QI2Dg" type="7001"> + <styles xmi:type="notation:SortingStyle" xmi:id="_aCX8SYspEeiSiblR-QI2Dg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_aCX8SospEeiSiblR-QI2Dg"/> + </children> + <children xmi:type="notation:Node" xmi:id="_aCaYg4spEeiSiblR-QI2Dg" type="3012" element="_aB9Fg4spEeiSiblR-QI2Dg"> + <children xmi:type="notation:Node" xmi:id="_aCaYhospEeiSiblR-QI2Dg" type="5010"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_aCaYh4spEeiSiblR-QI2Dg" x="21"/> + </children> + <children xmi:type="notation:Node" xmi:id="_aCa_lYspEeiSiblR-QI2Dg" type="3003" element="_aB9FhIspEeiSiblR-QI2Dg"> + <styles xmi:type="notation:ShapeStyle" xmi:id="_aCa_lospEeiSiblR-QI2Dg" fontName="Segoe UI"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_aCa_l4spEeiSiblR-QI2Dg"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_aCaYhIspEeiSiblR-QI2Dg" fontName="Segoe UI" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_aCaYhYspEeiSiblR-QI2Dg" x="-20" y="25" width="20" height="20"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_aCX8RYspEeiSiblR-QI2Dg" fontName="Segoe UI" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_aCX8RospEeiSiblR-QI2Dg" x="835" y="284" width="150" height="70"/> + </children> + <children xmi:type="notation:Node" xmi:id="_aCYjUIspEeiSiblR-QI2Dg" type="2002" element="_aB8ecospEeiSiblR-QI2Dg"> + <children xmi:type="notation:Node" xmi:id="_aCYjU4spEeiSiblR-QI2Dg" type="5006"/> + <children xmi:type="notation:Node" xmi:id="_aCYjVIspEeiSiblR-QI2Dg" type="7001"> + <styles xmi:type="notation:SortingStyle" xmi:id="_aCYjVYspEeiSiblR-QI2Dg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_aCYjVospEeiSiblR-QI2Dg"/> + </children> + <children xmi:type="notation:Node" xmi:id="_aCa_mIspEeiSiblR-QI2Dg" type="3012" element="_aB9skYspEeiSiblR-QI2Dg"> + <children xmi:type="notation:Node" xmi:id="_aCa_m4spEeiSiblR-QI2Dg" type="5010"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_aCa_nIspEeiSiblR-QI2Dg" x="-37" y="-17"/> + </children> + <children xmi:type="notation:Node" xmi:id="_aCbmqIspEeiSiblR-QI2Dg" type="3003" element="_aB9skospEeiSiblR-QI2Dg"> + <styles xmi:type="notation:ShapeStyle" xmi:id="_aCbmqYspEeiSiblR-QI2Dg" fontName="Segoe UI"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_aCbmqospEeiSiblR-QI2Dg"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_aCa_mYspEeiSiblR-QI2Dg" fontName="Segoe UI" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_aCa_mospEeiSiblR-QI2Dg" x="150" y="25" width="20" height="20"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_aCYjUYspEeiSiblR-QI2Dg" fontName="Segoe UI" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_aCYjUospEeiSiblR-QI2Dg" x="313" y="304" width="150" height="70"/> + </children> + <children xmi:type="notation:Node" xmi:id="_u_w8MIspEeiSiblR-QI2Dg" visible="false" type="2003" element="_u_E_sIspEeiSiblR-QI2Dg"> + <children xmi:type="notation:Node" xmi:id="_u_w8M4spEeiSiblR-QI2Dg" type="5007"/> + <children xmi:type="notation:Node" xmi:id="_u_w8NIspEeiSiblR-QI2Dg" type="7004"> + <children xmi:type="notation:Node" xmi:id="_u_2bwIspEeiSiblR-QI2Dg" visible="false" type="3010" element="_u_TpMIspEeiSiblR-QI2Dg"> + <styles xmi:type="notation:FontStyle" xmi:id="_u_2bwYspEeiSiblR-QI2Dg" fontName="Segoe UI" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Location" xmi:id="_u_2bwospEeiSiblR-QI2Dg" x="6" y="28"/> + </children> + <styles xmi:type="notation:SortingStyle" xmi:id="_u_w8NYspEeiSiblR-QI2Dg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_u_w8NospEeiSiblR-QI2Dg"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_u_w8MYspEeiSiblR-QI2Dg" fontName="Segoe UI" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_u_w8MospEeiSiblR-QI2Dg" x="4" y="4" width="99" height="47"/> + </children> + <children xmi:type="notation:Node" xmi:id="_u_w8N4spEeiSiblR-QI2Dg" visible="false" type="2003" element="_u_FmwIspEeiSiblR-QI2Dg"> + <children xmi:type="notation:Node" xmi:id="_u_w8OospEeiSiblR-QI2Dg" type="5007"/> + <children xmi:type="notation:Node" xmi:id="_u_w8O4spEeiSiblR-QI2Dg" type="7004"> + <children xmi:type="notation:Node" xmi:id="_u_2bw4spEeiSiblR-QI2Dg" visible="false" type="3010" element="_u_U3UIspEeiSiblR-QI2Dg"> + <styles xmi:type="notation:FontStyle" xmi:id="_u_2bxIspEeiSiblR-QI2Dg" fontName="Segoe UI" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Location" xmi:id="_u_2bxYspEeiSiblR-QI2Dg" x="9" y="28"/> + </children> + <styles xmi:type="notation:SortingStyle" xmi:id="_u_w8PIspEeiSiblR-QI2Dg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_u_w8PYspEeiSiblR-QI2Dg"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_u_w8OIspEeiSiblR-QI2Dg" fontName="Segoe UI" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_u_w8OYspEeiSiblR-QI2Dg" x="115" y="4" width="105" height="47"/> + </children> + <children xmi:type="notation:Node" xmi:id="_u_w8PospEeiSiblR-QI2Dg" visible="false" type="2003" element="_u_GN0IspEeiSiblR-QI2Dg"> + <children xmi:type="notation:Node" xmi:id="_u_xjQIspEeiSiblR-QI2Dg" type="5007"/> + <children xmi:type="notation:Node" xmi:id="_u_xjQYspEeiSiblR-QI2Dg" type="7004"> + <children xmi:type="notation:Node" xmi:id="_u_2bxospEeiSiblR-QI2Dg" visible="false" type="3010" element="_u_U3UospEeiSiblR-QI2Dg"> + <styles xmi:type="notation:FontStyle" xmi:id="_u_2bx4spEeiSiblR-QI2Dg" fontName="Segoe UI" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Location" xmi:id="_u_2byIspEeiSiblR-QI2Dg" x="9" y="28"/> + </children> + <styles xmi:type="notation:SortingStyle" xmi:id="_u_xjQospEeiSiblR-QI2Dg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_u_xjQ4spEeiSiblR-QI2Dg"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_u_w8P4spEeiSiblR-QI2Dg" fontName="Segoe UI" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_u_w8QIspEeiSiblR-QI2Dg" x="232" y="4" width="105" height="47"/> + </children> + <children xmi:type="notation:Node" xmi:id="_0M4hUIspEeiSiblR-QI2Dg" visible="false" type="2002" element="_0Mv-cIspEeiSiblR-QI2Dg"> + <children xmi:type="notation:Node" xmi:id="_0M4hU4spEeiSiblR-QI2Dg" type="5006"/> + <children xmi:type="notation:Node" xmi:id="_0M4hVIspEeiSiblR-QI2Dg" type="7001"> + <children xmi:type="notation:Node" xmi:id="_kUi6MIsqEeiSiblR-QI2Dg" visible="false" type="3008" element="_kTX1gIsqEeiSiblR-QI2Dg"> + <children xmi:type="notation:Node" xmi:id="_kUjhQIsqEeiSiblR-QI2Dg" type="5005"/> + <children xmi:type="notation:Node" xmi:id="_kUwVkIsqEeiSiblR-QI2Dg" type="7002"> + <children xmi:type="notation:Node" xmi:id="_tKVPIIsqEeiSiblR-QI2Dg" visible="false" type="3007" element="_tIwh0IsqEeiSiblR-QI2Dg"> + <children xmi:type="notation:Node" xmi:id="_tKVPI4sqEeiSiblR-QI2Dg" type="5003"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_tKVPJIsqEeiSiblR-QI2Dg" y="5"/> + </children> + <children xmi:type="notation:Node" xmi:id="_tKVPJYsqEeiSiblR-QI2Dg" type="3003" element="_tIwh0YsqEeiSiblR-QI2Dg"> + <styles xmi:type="notation:ShapeStyle" xmi:id="_tKVPJosqEeiSiblR-QI2Dg" fontName="Segoe UI"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_tKVPJ4sqEeiSiblR-QI2Dg"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_tKVPIYsqEeiSiblR-QI2Dg" fontName="Segoe UI" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_tKVPIosqEeiSiblR-QI2Dg" width="30" height="30"/> + </children> + <styles xmi:type="notation:SortingStyle" xmi:id="_kUwVkYsqEeiSiblR-QI2Dg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_kUwVkosqEeiSiblR-QI2Dg"/> + <styles xmi:type="notation:DrawerStyle" xmi:id="_kU44cIsqEeiSiblR-QI2Dg"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_kUi6MYsqEeiSiblR-QI2Dg" fontName="Segoe UI"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_kUi6MosqEeiSiblR-QI2Dg"/> + </children> + <styles xmi:type="notation:SortingStyle" xmi:id="_0M4hVYspEeiSiblR-QI2Dg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_0M4hVospEeiSiblR-QI2Dg"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_0M4hUYspEeiSiblR-QI2Dg" fontName="Segoe UI" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_0M4hUospEeiSiblR-QI2Dg" x="-5" y="75"/> + </children> + <children xmi:type="notation:Node" xmi:id="_0M4hV4spEeiSiblR-QI2Dg" visible="false" type="2002" element="_0MxMkIspEeiSiblR-QI2Dg"> + <children xmi:type="notation:Node" xmi:id="_0M4hWospEeiSiblR-QI2Dg" type="5006"/> + <children xmi:type="notation:Node" xmi:id="_0M5IYIspEeiSiblR-QI2Dg" type="7001"> + <children xmi:type="notation:Node" xmi:id="_kU5fgIsqEeiSiblR-QI2Dg" visible="false" type="3008" element="_kTYckIsqEeiSiblR-QI2Dg"> + <children xmi:type="notation:Node" xmi:id="_kU5fg4sqEeiSiblR-QI2Dg" type="5005"/> + <children xmi:type="notation:Node" xmi:id="_kU6GkIsqEeiSiblR-QI2Dg" type="7002"> + <children xmi:type="notation:Node" xmi:id="_u_rAIIsqEeiSiblR-QI2Dg" visible="false" type="3007" element="_u-tW0IsqEeiSiblR-QI2Dg"> + <children xmi:type="notation:Node" xmi:id="_u_rAI4sqEeiSiblR-QI2Dg" type="5003"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_u_rAJIsqEeiSiblR-QI2Dg" y="5"/> + </children> + <children xmi:type="notation:Node" xmi:id="_u_rAJYsqEeiSiblR-QI2Dg" type="3003" element="_u-t94IsqEeiSiblR-QI2Dg"> + <styles xmi:type="notation:ShapeStyle" xmi:id="_u_rAJosqEeiSiblR-QI2Dg" fontName="Segoe UI"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_u_rAJ4sqEeiSiblR-QI2Dg"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_u_rAIYsqEeiSiblR-QI2Dg" fontName="Segoe UI" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_u_rAIosqEeiSiblR-QI2Dg" width="30" height="30"/> + </children> + <styles xmi:type="notation:SortingStyle" xmi:id="_kU6GkYsqEeiSiblR-QI2Dg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_kU6GkosqEeiSiblR-QI2Dg"/> + <styles xmi:type="notation:DrawerStyle" xmi:id="_kU6Gk4sqEeiSiblR-QI2Dg"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_kU5fgYsqEeiSiblR-QI2Dg" fontName="Segoe UI"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_kU5fgosqEeiSiblR-QI2Dg"/> + </children> + <styles xmi:type="notation:SortingStyle" xmi:id="_0M5IYYspEeiSiblR-QI2Dg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_0M5IYospEeiSiblR-QI2Dg"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_0M4hWIspEeiSiblR-QI2Dg" fontName="Segoe UI" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_0M4hWYspEeiSiblR-QI2Dg" x="160" y="235"/> + </children> + <children xmi:type="notation:Node" xmi:id="_0M5IY4spEeiSiblR-QI2Dg" visible="false" type="2002" element="_0MxzoIspEeiSiblR-QI2Dg"> + <children xmi:type="notation:Node" xmi:id="_0M5IZospEeiSiblR-QI2Dg" type="5006"/> + <children xmi:type="notation:Node" xmi:id="_0M5IZ4spEeiSiblR-QI2Dg" type="7001"> + <children xmi:type="notation:Node" xmi:id="_kU6GlIsqEeiSiblR-QI2Dg" visible="false" type="3008" element="_kTZDoIsqEeiSiblR-QI2Dg"> + <children xmi:type="notation:Node" xmi:id="_kU6Gl4sqEeiSiblR-QI2Dg" type="5005"/> + <children xmi:type="notation:Node" xmi:id="_kU6toIsqEeiSiblR-QI2Dg" type="7002"> + <children xmi:type="notation:Node" xmi:id="_u_rnMIsqEeiSiblR-QI2Dg" visible="false" type="3007" element="_u-t94YsqEeiSiblR-QI2Dg"> + <children xmi:type="notation:Node" xmi:id="_u_rnM4sqEeiSiblR-QI2Dg" type="5003"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_u_rnNIsqEeiSiblR-QI2Dg" y="5"/> + </children> + <children xmi:type="notation:Node" xmi:id="_u_rnNYsqEeiSiblR-QI2Dg" type="3003" element="_u-uk8IsqEeiSiblR-QI2Dg"> + <styles xmi:type="notation:ShapeStyle" xmi:id="_u_rnNosqEeiSiblR-QI2Dg" fontName="Segoe UI"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_u_rnN4sqEeiSiblR-QI2Dg"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_u_rnMYsqEeiSiblR-QI2Dg" fontName="Segoe UI" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_u_rnMosqEeiSiblR-QI2Dg" width="30" height="30"/> + </children> + <styles xmi:type="notation:SortingStyle" xmi:id="_kU6toYsqEeiSiblR-QI2Dg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_kU6toosqEeiSiblR-QI2Dg"/> + <styles xmi:type="notation:DrawerStyle" xmi:id="_kU6to4sqEeiSiblR-QI2Dg"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_kU6GlYsqEeiSiblR-QI2Dg" fontName="Segoe UI"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_kU6GlosqEeiSiblR-QI2Dg"/> + </children> + <styles xmi:type="notation:SortingStyle" xmi:id="_0M5IaIspEeiSiblR-QI2Dg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_0M5IaYspEeiSiblR-QI2Dg"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_0M5IZIspEeiSiblR-QI2Dg" fontName="Segoe UI" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_0M5IZYspEeiSiblR-QI2Dg" x="335" y="215"/> + </children> + <children xmi:type="notation:Node" xmi:id="_d4hTQIwtEeiIecNcb01lxg" visible="false" type="2002" element="_d3xFUIwtEeiIecNcb01lxg"> + <children xmi:type="notation:Node" xmi:id="_d40OMIwtEeiIecNcb01lxg" type="5006"/> + <children xmi:type="notation:Node" xmi:id="_d45twIwtEeiIecNcb01lxg" type="7001"> + <children xmi:type="notation:Node" xmi:id="_d5Es4IwtEeiIecNcb01lxg" visible="false" type="3007" element="_d3-gsIwtEeiIecNcb01lxg"> + <children xmi:type="notation:Node" xmi:id="_d5KzgIwtEeiIecNcb01lxg" type="5003"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_d5KzgYwtEeiIecNcb01lxg" y="5"/> + </children> + <children xmi:type="notation:Node" xmi:id="_d5UkgIwtEeiIecNcb01lxg" type="3003" element="_d3-gsYwtEeiIecNcb01lxg"> + <styles xmi:type="notation:ShapeStyle" xmi:id="_d5UkgYwtEeiIecNcb01lxg" fontName="Segoe UI"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_d5UkgowtEeiIecNcb01lxg" x="5" y="6" width="30" height="30"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_d5Es4YwtEeiIecNcb01lxg" fontName="Segoe UI" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_d5Es4owtEeiIecNcb01lxg" x="28" y="29" width="40" height="41"/> + </children> + <styles xmi:type="notation:SortingStyle" xmi:id="_d45twYwtEeiIecNcb01lxg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_d45twowtEeiIecNcb01lxg"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_d4hTQYwtEeiIecNcb01lxg" fontName="Segoe UI" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_d4hTQowtEeiIecNcb01lxg" x="350" y="105"/> + </children> + <children xmi:type="notation:Node" xmi:id="_d45tw4wtEeiIecNcb01lxg" visible="false" type="2002" element="_d39SkIwtEeiIecNcb01lxg"> + <children xmi:type="notation:Node" xmi:id="_d46U0IwtEeiIecNcb01lxg" type="5006"/> + <children xmi:type="notation:Node" xmi:id="_d46U0YwtEeiIecNcb01lxg" type="7001"> + <children xmi:type="notation:Node" xmi:id="_d5VLkIwtEeiIecNcb01lxg" visible="false" type="3007" element="_d3_HwIwtEeiIecNcb01lxg"> + <children xmi:type="notation:Node" xmi:id="_d5VLk4wtEeiIecNcb01lxg" type="5003"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_d5VLlIwtEeiIecNcb01lxg" y="5"/> + </children> + <children xmi:type="notation:Node" xmi:id="_d5VyoIwtEeiIecNcb01lxg" type="3003" element="_d3_HwYwtEeiIecNcb01lxg"> + <styles xmi:type="notation:ShapeStyle" xmi:id="_d5VyoYwtEeiIecNcb01lxg" fontName="Segoe UI"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_d5VyoowtEeiIecNcb01lxg" x="5" y="6" width="30" height="30"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_d5VLkYwtEeiIecNcb01lxg" fontName="Segoe UI" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_d5VLkowtEeiIecNcb01lxg" x="30" y="29" width="40" height="41"/> + </children> + <styles xmi:type="notation:SortingStyle" xmi:id="_d46U0owtEeiIecNcb01lxg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_d46U04wtEeiIecNcb01lxg"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_d45txIwtEeiIecNcb01lxg" fontName="Segoe UI" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_d45txYwtEeiIecNcb01lxg" x="-20" y="165"/> + </children> + <children xmi:type="notation:Node" xmi:id="_d46U1IwtEeiIecNcb01lxg" visible="false" type="2002" element="_d395oIwtEeiIecNcb01lxg"> + <children xmi:type="notation:Node" xmi:id="_d4674IwtEeiIecNcb01lxg" type="5006"/> + <children xmi:type="notation:Node" xmi:id="_d4674YwtEeiIecNcb01lxg" type="7001"> + <children xmi:type="notation:Node" xmi:id="_d5Vyo4wtEeiIecNcb01lxg" visible="false" type="3007" element="_d3_u0IwtEeiIecNcb01lxg"> + <children xmi:type="notation:Node" xmi:id="_d5WZsIwtEeiIecNcb01lxg" type="5003"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_d5WZsYwtEeiIecNcb01lxg" y="5"/> + </children> + <children xmi:type="notation:Node" xmi:id="_d5XAwIwtEeiIecNcb01lxg" type="3003" element="_d3_u0YwtEeiIecNcb01lxg"> + <styles xmi:type="notation:ShapeStyle" xmi:id="_d5XAwYwtEeiIecNcb01lxg" fontName="Segoe UI"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_d5XAwowtEeiIecNcb01lxg" x="5" y="6" width="30" height="30"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_d5VypIwtEeiIecNcb01lxg" fontName="Segoe UI" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_d5VypYwtEeiIecNcb01lxg" x="30" y="29" width="40" height="41"/> + </children> + <styles xmi:type="notation:SortingStyle" xmi:id="_d4674owtEeiIecNcb01lxg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_d46744wtEeiIecNcb01lxg"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_d46U1YwtEeiIecNcb01lxg" fontName="Segoe UI" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_d46U1owtEeiIecNcb01lxg" x="185" y="115"/> + </children> + <children xmi:type="notation:Node" xmi:id="_LKsP4I5WEeiIecNcb01lxg" type="2002" element="_LJZPYI5WEeiIecNcb01lxg"> + <children xmi:type="notation:Node" xmi:id="_LKs28I5WEeiIecNcb01lxg" type="5006"/> + <children xmi:type="notation:Node" xmi:id="_LKs28Y5WEeiIecNcb01lxg" type="7001"> + <styles xmi:type="notation:SortingStyle" xmi:id="_LKs28o5WEeiIecNcb01lxg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_LKs2845WEeiIecNcb01lxg"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_LKsP4Y5WEeiIecNcb01lxg" fontName="Segoe UI" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_LKsP4o5WEeiIecNcb01lxg" x="203" y="420"/> + </children> + <styles xmi:type="notation:DiagramStyle" xmi:id="_dfQCIoVIEeCSGf835_Mdqg"/> + <edges xmi:type="notation:Edge" xmi:id="_aCcNsIspEeiSiblR-QI2Dg" type="4001" element="_aB-ToIspEeiSiblR-QI2Dg" source="_aCYjV4spEeiSiblR-QI2Dg" target="_aCaYg4spEeiSiblR-QI2Dg"> + <children xmi:type="notation:Node" xmi:id="_aCcNtIspEeiSiblR-QI2Dg" type="6001"> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_TpExcI5WEeiIecNcb01lxg" y="-10"/> + </children> + <children xmi:type="notation:Node" xmi:id="_aCcNtospEeiSiblR-QI2Dg" type="6002"> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_TpExcY5WEeiIecNcb01lxg" x="36" y="35"/> + </children> + <children xmi:type="notation:Node" xmi:id="_aCcNuIspEeiSiblR-QI2Dg" type="6003"> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_TpExco5WEeiIecNcb01lxg" y="10"/> + </children> + <styles xmi:type="notation:ConnectorStyle" xmi:id="_aCcNsYspEeiSiblR-QI2Dg"/> + <styles xmi:type="notation:FontStyle" xmi:id="_aCcNsospEeiSiblR-QI2Dg" fontName="Segoe UI" fontHeight="8"/> + <styles xmi:type="notation:StringValueStyle" xmi:id="_d_pO8IwtEeiIecNcb01lxg" name="junctionPoints" stringValue="(352.0,117.0)"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_aCcNs4spEeiSiblR-QI2Dg" points="[0, 0, -153, 131]$[153, -131, 0, 0]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_aCc0wIspEeiSiblR-QI2Dg" id="(1.0,0.5)"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_aCc0wYspEeiSiblR-QI2Dg" id="(0.0,0.5)"/> + </edges> + <edges xmi:type="notation:Edge" xmi:id="_aCc0wospEeiSiblR-QI2Dg" type="4001" element="_aCVgAIspEeiSiblR-QI2Dg" source="_aCa_mIspEeiSiblR-QI2Dg" target="_aCaYg4spEeiSiblR-QI2Dg"> + <children xmi:type="notation:Node" xmi:id="_aCdb0IspEeiSiblR-QI2Dg" type="6001"> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_aCdb0YspEeiSiblR-QI2Dg" x="30" y="-104"/> + </children> + <children xmi:type="notation:Node" xmi:id="_aCdb0ospEeiSiblR-QI2Dg" type="6002"> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_aCdb04spEeiSiblR-QI2Dg" x="11" y="18"/> + </children> + <children xmi:type="notation:Node" xmi:id="_aCdb1IspEeiSiblR-QI2Dg" type="6003"> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_aCdb1YspEeiSiblR-QI2Dg" x="-54" y="-87"/> + </children> + <styles xmi:type="notation:ConnectorStyle" xmi:id="_aCc0w4spEeiSiblR-QI2Dg"/> + <styles xmi:type="notation:FontStyle" xmi:id="_aCc0xIspEeiSiblR-QI2Dg" fontName="Segoe UI" fontHeight="8"/> + <styles xmi:type="notation:StringValueStyle" xmi:id="_d_p2AIwtEeiIecNcb01lxg" name="junctionPoints" stringValue="()"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_aCc0xYspEeiSiblR-QI2Dg" points="[0, 0, -350, 20]$[350, -20, 0, 0]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_aCdb1ospEeiSiblR-QI2Dg" id="(1.0,0.5)"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_aCdb14spEeiSiblR-QI2Dg" id="(0.0,0.5)"/> + </edges> + <edges xmi:type="notation:Edge" xmi:id="_PNDSEI5WEeiIecNcb01lxg" type="4001" element="_PLucYI5WEeiIecNcb01lxg" source="_aCXVMIspEeiSiblR-QI2Dg" target="_LKsP4I5WEeiIecNcb01lxg"> + <children xmi:type="notation:Node" xmi:id="_PNHjgI5WEeiIecNcb01lxg" type="6001"> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PNHjgY5WEeiIecNcb01lxg" x="-18" y="-104"/> + </children> + <children xmi:type="notation:Node" xmi:id="_PNLN4I5WEeiIecNcb01lxg" type="6002"> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PNLN4Y5WEeiIecNcb01lxg" x="9" y="36"/> + </children> + <children xmi:type="notation:Node" xmi:id="_PNO4QI5WEeiIecNcb01lxg" type="6003"> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PNO4QY5WEeiIecNcb01lxg" x="-27" y="31"/> + </children> + <styles xmi:type="notation:ConnectorStyle" xmi:id="_PNDSEY5WEeiIecNcb01lxg" routing="Rectilinear"/> + <styles xmi:type="notation:FontStyle" xmi:id="_PNDSEo5WEeiIecNcb01lxg" fontName="Segoe UI" fontHeight="8"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_PNDSE45WEeiIecNcb01lxg" points="[-74, -15, 233, -20]$[-233, -15, 74, -20]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_PNYpQI5WEeiIecNcb01lxg" id="(0.5,0.5)"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_PNYpQY5WEeiIecNcb01lxg" id="(0.5,0.5)"/> + </edges> + </data> + </ownedAnnotationEntries> + <ownedAnnotationEntries xmi:type="description:AnnotationEntry" xmi:id="_lhTrsIWtEeietsu_nBwfgQ" source="DANNOTATION_CUSTOMIZATION_KEY"> + <data xmi:type="diagram:ComputedStyleDescriptionRegistry" xmi:id="_lhTrsYWtEeietsu_nBwfgQ"/> + </ownedAnnotationEntries> + <ownedDiagramElements xmi:type="diagram:DNodeContainer" xmi:id="_aB7QUIspEeiSiblR-QI2Dg" name="new Package 1" outgoingEdges="_PLucYI5WEeiIecNcb01lxg"> + <target xmi:type="ecore:EPackage" href="vp2120.ecore#//new%20Package%201"/> + <semanticElements xmi:type="ecore:EPackage" href="vp2120.ecore#//new%20Package%201"/> + <ownedBorderedNodes xmi:type="diagram:DNode" xmi:id="_aB8edIspEeiSiblR-QI2Dg" name="new EClass 3" outgoingEdges="_aB-ToIspEeiSiblR-QI2Dg" width="2" height="2"> + <target xmi:type="ecore:EClass" href="vp2120.ecore#//new%20Package%201/new%20EClass%203"/> + <semanticElements xmi:type="ecore:EClass" href="vp2120.ecore#//new%20Package%201/new%20EClass%203"/> + <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> + <arrangeConstraints>KEEP_SIZE</arrangeConstraints> + <arrangeConstraints>KEEP_RATIO</arrangeConstraints> + <ownedStyle xmi:type="diagram:Square" xmi:id="_aB9FgIspEeiSiblR-QI2Dg" borderColor="173,127,168" width="2" height="2" color="239,41,41"> + <description xmi:type="style:SquareDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L2']/@containerMappings[name='CM_EPackage']/@borderedNodeMappings[name='BN_EClass']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:NodeMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L2']/@containerMappings[name='CM_EPackage']/@borderedNodeMappings[name='BN_EClass']"/> + </ownedBorderedNodes> + <ownedBorderedNodes xmi:type="diagram:DNode" xmi:id="_iL7jQJpREeiRuck0XXiZ-A" name="EClass7" width="2" height="2"> + <target xmi:type="ecore:EClass" href="vp2120.ecore#//new%20Package%201/EClass7"/> + <semanticElements xmi:type="ecore:EClass" href="vp2120.ecore#//new%20Package%201/EClass7"/> + <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> + <arrangeConstraints>KEEP_SIZE</arrangeConstraints> + <arrangeConstraints>KEEP_RATIO</arrangeConstraints> + <ownedStyle xmi:type="diagram:Square" xmi:id="_iL8xYJpREeiRuck0XXiZ-A" borderColor="173,127,168" width="2" height="2" color="239,41,41"> + <description xmi:type="style:SquareDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L2']/@containerMappings[name='CM_EPackage']/@borderedNodeMappings[name='BN_EClass']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:NodeMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L2']/@containerMappings[name='CM_EPackage']/@borderedNodeMappings[name='BN_EClass']"/> + </ownedBorderedNodes> + <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> + <arrangeConstraints>KEEP_SIZE</arrangeConstraints> + <arrangeConstraints>KEEP_RATIO</arrangeConstraints> + <ownedStyle xmi:type="diagram:FlatContainerStyle" xmi:id="_aB7QUYspEeiSiblR-QI2Dg" borderSize="1" borderSizeComputationExpression="1" borderColor="39,76,114" backgroundColor="114,159,207" foregroundColor="204,242,166"> + <description xmi:type="style:FlatContainerStyleDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L2']/@containerMappings[name='CM_EPackage']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:ContainerMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L2']/@containerMappings[name='CM_EPackage']"/> + </ownedDiagramElements> + <ownedDiagramElements xmi:type="diagram:DNodeContainer" xmi:id="_aB8ecIspEeiSiblR-QI2Dg" name="new EPackage 2"> + <target xmi:type="ecore:EPackage" href="vp2120.ecore#//new%20EPackage%202"/> + <semanticElements xmi:type="ecore:EPackage" href="vp2120.ecore#//new%20EPackage%202"/> + <ownedBorderedNodes xmi:type="diagram:DNode" xmi:id="_aB9Fg4spEeiSiblR-QI2Dg" name="new EClass 4" incomingEdges="_aB-ToIspEeiSiblR-QI2Dg _aCVgAIspEeiSiblR-QI2Dg" width="2" height="2"> + <target xmi:type="ecore:EClass" href="vp2120.ecore#//new%20EPackage%202/new%20EClass%204"/> + <semanticElements xmi:type="ecore:EClass" href="vp2120.ecore#//new%20EPackage%202/new%20EClass%204"/> + <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> + <arrangeConstraints>KEEP_SIZE</arrangeConstraints> + <arrangeConstraints>KEEP_RATIO</arrangeConstraints> + <ownedStyle xmi:type="diagram:Square" xmi:id="_aB9FhIspEeiSiblR-QI2Dg" borderColor="173,127,168" width="2" height="2" color="239,41,41"> + <description xmi:type="style:SquareDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L2']/@containerMappings[name='CM_EPackage']/@borderedNodeMappings[name='BN_EClass']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:NodeMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L2']/@containerMappings[name='CM_EPackage']/@borderedNodeMappings[name='BN_EClass']"/> + </ownedBorderedNodes> + <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> + <arrangeConstraints>KEEP_SIZE</arrangeConstraints> + <arrangeConstraints>KEEP_RATIO</arrangeConstraints> + <ownedStyle xmi:type="diagram:FlatContainerStyle" xmi:id="_aB8ecYspEeiSiblR-QI2Dg" borderSize="1" borderSizeComputationExpression="1" borderColor="39,76,114" backgroundColor="114,159,207" foregroundColor="204,242,166"> + <description xmi:type="style:FlatContainerStyleDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L2']/@containerMappings[name='CM_EPackage']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:ContainerMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L2']/@containerMappings[name='CM_EPackage']"/> + </ownedDiagramElements> + <ownedDiagramElements xmi:type="diagram:DNodeContainer" xmi:id="_aB8ecospEeiSiblR-QI2Dg" name="new EPackage 3"> + <target xmi:type="ecore:EPackage" href="vp2120.ecore#//new%20EPackage%203"/> + <semanticElements xmi:type="ecore:EPackage" href="vp2120.ecore#//new%20EPackage%203"/> + <ownedBorderedNodes xmi:type="diagram:DNode" xmi:id="_aB9skYspEeiSiblR-QI2Dg" name="new EClass 5" outgoingEdges="_aCVgAIspEeiSiblR-QI2Dg" width="2" height="2"> + <target xmi:type="ecore:EClass" href="vp2120.ecore#//new%20EPackage%203/new%20EClass%205"/> + <semanticElements xmi:type="ecore:EClass" href="vp2120.ecore#//new%20EPackage%203/new%20EClass%205"/> + <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> + <arrangeConstraints>KEEP_SIZE</arrangeConstraints> + <arrangeConstraints>KEEP_RATIO</arrangeConstraints> + <ownedStyle xmi:type="diagram:Square" xmi:id="_aB9skospEeiSiblR-QI2Dg" borderColor="173,127,168" width="2" height="2" color="239,41,41"> + <description xmi:type="style:SquareDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L2']/@containerMappings[name='CM_EPackage']/@borderedNodeMappings[name='BN_EClass']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:NodeMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L2']/@containerMappings[name='CM_EPackage']/@borderedNodeMappings[name='BN_EClass']"/> + </ownedBorderedNodes> + <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> + <arrangeConstraints>KEEP_SIZE</arrangeConstraints> + <arrangeConstraints>KEEP_RATIO</arrangeConstraints> + <ownedStyle xmi:type="diagram:FlatContainerStyle" xmi:id="_aB8ec4spEeiSiblR-QI2Dg" borderSize="1" borderSizeComputationExpression="1" borderColor="39,76,114" backgroundColor="114,159,207" foregroundColor="204,242,166"> + <description xmi:type="style:FlatContainerStyleDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L2']/@containerMappings[name='CM_EPackage']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:ContainerMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L2']/@containerMappings[name='CM_EPackage']"/> + </ownedDiagramElements> + <ownedDiagramElements xmi:type="diagram:DEdge" xmi:id="_aB-ToIspEeiSiblR-QI2Dg" name="'center'" sourceNode="_aB8edIspEeiSiblR-QI2Dg" targetNode="_aB9Fg4spEeiSiblR-QI2Dg" beginLabel="'begin'" endLabel="'end'"> + <target xmi:type="ecore:EReference" href="vp2120.ecore#//new%20Package%201/new%20EClass%203/eRef"/> + <semanticElements xmi:type="ecore:EReference" href="vp2120.ecore#//new%20Package%201/new%20EClass%203/eRef"/> + <ownedStyle xmi:type="diagram:EdgeStyle" xmi:id="_aB-ToYspEeiSiblR-QI2Dg"> + <customFeatures>routingStyle</customFeatures> + <description xmi:type="style:EdgeStyleDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@defaultLayer/@edgeMappings[name='EM_Ref']/@style"/> + <beginLabelStyle xmi:type="diagram:BeginLabelStyle" xmi:id="_aB-ToospEeiSiblR-QI2Dg"/> + <centerLabelStyle xmi:type="diagram:CenterLabelStyle" xmi:id="_aB-To4spEeiSiblR-QI2Dg"/> + <endLabelStyle xmi:type="diagram:EndLabelStyle" xmi:id="_aB-TpIspEeiSiblR-QI2Dg"/> + </ownedStyle> + <actualMapping xmi:type="description_1:EdgeMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@defaultLayer/@edgeMappings[name='EM_Ref']"/> + </ownedDiagramElements> + <ownedDiagramElements xmi:type="diagram:DEdge" xmi:id="_aCVgAIspEeiSiblR-QI2Dg" name="'center'" sourceNode="_aB9skYspEeiSiblR-QI2Dg" targetNode="_aB9Fg4spEeiSiblR-QI2Dg" beginLabel="'begin'" endLabel="'end'"> + <target xmi:type="ecore:EReference" href="vp2120.ecore#//new%20EPackage%203/new%20EClass%205/eRef2"/> + <semanticElements xmi:type="ecore:EReference" href="vp2120.ecore#//new%20EPackage%203/new%20EClass%205/eRef2"/> + <ownedStyle xmi:type="diagram:EdgeStyle" xmi:id="_aCVgAYspEeiSiblR-QI2Dg"> + <customFeatures>routingStyle</customFeatures> + <description xmi:type="style:EdgeStyleDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@defaultLayer/@edgeMappings[name='EM_Ref']/@style"/> + <beginLabelStyle xmi:type="diagram:BeginLabelStyle" xmi:id="_aCVgAospEeiSiblR-QI2Dg"/> + <centerLabelStyle xmi:type="diagram:CenterLabelStyle" xmi:id="_aCVgA4spEeiSiblR-QI2Dg"/> + <endLabelStyle xmi:type="diagram:EndLabelStyle" xmi:id="_aCVgBIspEeiSiblR-QI2Dg"/> + </ownedStyle> + <actualMapping xmi:type="description_1:EdgeMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@defaultLayer/@edgeMappings[name='EM_Ref']"/> + </ownedDiagramElements> + <ownedDiagramElements xmi:type="diagram:DNodeList" xmi:id="_u_E_sIspEeiSiblR-QI2Dg" name="new Package 1" visible="false"> + <target xmi:type="ecore:EPackage" href="vp2120.ecore#//new%20Package%201"/> + <semanticElements xmi:type="ecore:EPackage" href="vp2120.ecore#//new%20Package%201"/> + <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> + <arrangeConstraints>KEEP_SIZE</arrangeConstraints> + <arrangeConstraints>KEEP_RATIO</arrangeConstraints> + <ownedStyle xmi:type="diagram:FlatContainerStyle" xmi:id="_u_E_sYspEeiSiblR-QI2Dg" borderSize="1" borderSizeComputationExpression="1"> + <description xmi:type="style:FlatContainerStyleDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L3']/@containerMappings[name='listPackage']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:ContainerMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L3']/@containerMappings[name='listPackage']"/> + <ownedElements xmi:type="diagram:DNodeListElement" xmi:id="_u_TpMIspEeiSiblR-QI2Dg" name="new EClass 3" visible="false"> + <target xmi:type="ecore:EClass" href="vp2120.ecore#//new%20Package%201/new%20EClass%203"/> + <semanticElements xmi:type="ecore:EClass" href="vp2120.ecore#//new%20Package%201/new%20EClass%203"/> + <ownedStyle xmi:type="diagram:Square" xmi:id="_u_UQQIspEeiSiblR-QI2Dg" labelPosition="node"> + <description xmi:type="style:SquareDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L3']/@containerMappings[name='listPackage']/@subNodeMappings[name='eClass']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:NodeMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L3']/@containerMappings[name='listPackage']/@subNodeMappings[name='eClass']"/> + </ownedElements> + </ownedDiagramElements> + <ownedDiagramElements xmi:type="diagram:DNodeList" xmi:id="_u_FmwIspEeiSiblR-QI2Dg" name="new EPackage 2" visible="false"> + <target xmi:type="ecore:EPackage" href="vp2120.ecore#//new%20EPackage%202"/> + <semanticElements xmi:type="ecore:EPackage" href="vp2120.ecore#//new%20EPackage%202"/> + <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> + <arrangeConstraints>KEEP_SIZE</arrangeConstraints> + <arrangeConstraints>KEEP_RATIO</arrangeConstraints> + <ownedStyle xmi:type="diagram:FlatContainerStyle" xmi:id="_u_FmwYspEeiSiblR-QI2Dg" borderSize="1" borderSizeComputationExpression="1"> + <description xmi:type="style:FlatContainerStyleDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L3']/@containerMappings[name='listPackage']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:ContainerMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L3']/@containerMappings[name='listPackage']"/> + <ownedElements xmi:type="diagram:DNodeListElement" xmi:id="_u_U3UIspEeiSiblR-QI2Dg" name="new EClass 4" visible="false"> + <target xmi:type="ecore:EClass" href="vp2120.ecore#//new%20EPackage%202/new%20EClass%204"/> + <semanticElements xmi:type="ecore:EClass" href="vp2120.ecore#//new%20EPackage%202/new%20EClass%204"/> + <ownedStyle xmi:type="diagram:Square" xmi:id="_u_U3UYspEeiSiblR-QI2Dg" labelPosition="node"> + <description xmi:type="style:SquareDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L3']/@containerMappings[name='listPackage']/@subNodeMappings[name='eClass']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:NodeMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L3']/@containerMappings[name='listPackage']/@subNodeMappings[name='eClass']"/> + </ownedElements> + </ownedDiagramElements> + <ownedDiagramElements xmi:type="diagram:DNodeList" xmi:id="_u_GN0IspEeiSiblR-QI2Dg" name="new EPackage 3" visible="false"> + <target xmi:type="ecore:EPackage" href="vp2120.ecore#//new%20EPackage%203"/> + <semanticElements xmi:type="ecore:EPackage" href="vp2120.ecore#//new%20EPackage%203"/> + <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> + <arrangeConstraints>KEEP_SIZE</arrangeConstraints> + <arrangeConstraints>KEEP_RATIO</arrangeConstraints> + <ownedStyle xmi:type="diagram:FlatContainerStyle" xmi:id="_u_GN0YspEeiSiblR-QI2Dg" borderSize="1" borderSizeComputationExpression="1"> + <description xmi:type="style:FlatContainerStyleDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L3']/@containerMappings[name='listPackage']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:ContainerMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L3']/@containerMappings[name='listPackage']"/> + <ownedElements xmi:type="diagram:DNodeListElement" xmi:id="_u_U3UospEeiSiblR-QI2Dg" name="new EClass 5" visible="false"> + <target xmi:type="ecore:EClass" href="vp2120.ecore#//new%20EPackage%203/new%20EClass%205"/> + <semanticElements xmi:type="ecore:EClass" href="vp2120.ecore#//new%20EPackage%203/new%20EClass%205"/> + <ownedStyle xmi:type="diagram:Square" xmi:id="_u_U3U4spEeiSiblR-QI2Dg" labelPosition="node"> + <description xmi:type="style:SquareDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L3']/@containerMappings[name='listPackage']/@subNodeMappings[name='eClass']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:NodeMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L3']/@containerMappings[name='listPackage']/@subNodeMappings[name='eClass']"/> + </ownedElements> + </ownedDiagramElements> + <ownedDiagramElements xmi:type="diagram:DNodeContainer" xmi:id="_0Mv-cIspEeiSiblR-QI2Dg" name="new Package 1" visible="false" childrenPresentation="HorizontalStack"> + <target xmi:type="ecore:EPackage" href="vp2120.ecore#//new%20Package%201"/> + <semanticElements xmi:type="ecore:EPackage" href="vp2120.ecore#//new%20Package%201"/> + <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> + <arrangeConstraints>KEEP_SIZE</arrangeConstraints> + <arrangeConstraints>KEEP_RATIO</arrangeConstraints> + <ownedStyle xmi:type="diagram:FlatContainerStyle" xmi:id="_0MwlgIspEeiSiblR-QI2Dg" borderSize="1" borderSizeComputationExpression="1" borderColor="39,76,114" backgroundColor="114,159,207" foregroundColor="204,242,166"> + <description xmi:type="style:FlatContainerStyleDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L5']/@containerMappings[name='CM_EPackage']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:ContainerMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L5']/@containerMappings[name='CM_EPackage']"/> + <ownedDiagramElements xmi:type="diagram:DNodeContainer" xmi:id="_kTX1gIsqEeiSiblR-QI2Dg" visible="false"> + <target xmi:type="ecore:EClass" href="vp2120.ecore#//new%20Package%201/new%20EClass%203"/> + <semanticElements xmi:type="ecore:EClass" href="vp2120.ecore#//new%20Package%201/new%20EClass%203"/> + <actualMapping xmi:type="description_1:ContainerMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L5']/@containerMappings[name='CM_EPackage']/@subContainerMappings[name='eCLass']"/> + <ownedDiagramElements xmi:type="diagram:DNode" xmi:id="_tIwh0IsqEeiSiblR-QI2Dg" name="eAtt1" visible="false" width="3" height="3" resizeKind="NSEW"> + <target xmi:type="ecore:EAttribute" href="vp2120.ecore#//new%20Package%201/new%20EClass%203/eAtt1"/> + <semanticElements xmi:type="ecore:EAttribute" href="vp2120.ecore#//new%20Package%201/new%20EClass%203/eAtt1"/> + <ownedStyle xmi:type="diagram:Square" xmi:id="_tIwh0YsqEeiSiblR-QI2Dg" labelPosition="node"> + <description xmi:type="style:SquareDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L5']/@containerMappings[name='CM_EPackage']/@subContainerMappings[name='eCLass']/@subNodeMappings[name='eAtt']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:NodeMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L5']/@containerMappings[name='CM_EPackage']/@subContainerMappings[name='eCLass']/@subNodeMappings[name='eAtt']"/> + </ownedDiagramElements> + </ownedDiagramElements> + </ownedDiagramElements> + <ownedDiagramElements xmi:type="diagram:DNodeContainer" xmi:id="_0MxMkIspEeiSiblR-QI2Dg" name="new EPackage 2" visible="false" childrenPresentation="HorizontalStack"> + <target xmi:type="ecore:EPackage" href="vp2120.ecore#//new%20EPackage%202"/> + <semanticElements xmi:type="ecore:EPackage" href="vp2120.ecore#//new%20EPackage%202"/> + <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> + <arrangeConstraints>KEEP_SIZE</arrangeConstraints> + <arrangeConstraints>KEEP_RATIO</arrangeConstraints> + <ownedStyle xmi:type="diagram:FlatContainerStyle" xmi:id="_0MxMkYspEeiSiblR-QI2Dg" borderSize="1" borderSizeComputationExpression="1" borderColor="39,76,114" backgroundColor="114,159,207" foregroundColor="204,242,166"> + <description xmi:type="style:FlatContainerStyleDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L5']/@containerMappings[name='CM_EPackage']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:ContainerMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L5']/@containerMappings[name='CM_EPackage']"/> + <ownedDiagramElements xmi:type="diagram:DNodeContainer" xmi:id="_kTYckIsqEeiSiblR-QI2Dg" visible="false"> + <target xmi:type="ecore:EClass" href="vp2120.ecore#//new%20EPackage%202/new%20EClass%204"/> + <semanticElements xmi:type="ecore:EClass" href="vp2120.ecore#//new%20EPackage%202/new%20EClass%204"/> + <actualMapping xmi:type="description_1:ContainerMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L5']/@containerMappings[name='CM_EPackage']/@subContainerMappings[name='eCLass']"/> + <ownedDiagramElements xmi:type="diagram:DNode" xmi:id="_u-tW0IsqEeiSiblR-QI2Dg" name="eAtt2" visible="false" width="3" height="3" resizeKind="NSEW"> + <target xmi:type="ecore:EAttribute" href="vp2120.ecore#//new%20EPackage%202/new%20EClass%204/eAtt2"/> + <semanticElements xmi:type="ecore:EAttribute" href="vp2120.ecore#//new%20EPackage%202/new%20EClass%204/eAtt2"/> + <ownedStyle xmi:type="diagram:Square" xmi:id="_u-t94IsqEeiSiblR-QI2Dg" labelPosition="node"> + <description xmi:type="style:SquareDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L5']/@containerMappings[name='CM_EPackage']/@subContainerMappings[name='eCLass']/@subNodeMappings[name='eAtt']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:NodeMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L5']/@containerMappings[name='CM_EPackage']/@subContainerMappings[name='eCLass']/@subNodeMappings[name='eAtt']"/> + </ownedDiagramElements> + </ownedDiagramElements> + </ownedDiagramElements> + <ownedDiagramElements xmi:type="diagram:DNodeContainer" xmi:id="_0MxzoIspEeiSiblR-QI2Dg" name="new EPackage 3" visible="false" childrenPresentation="HorizontalStack"> + <target xmi:type="ecore:EPackage" href="vp2120.ecore#//new%20EPackage%203"/> + <semanticElements xmi:type="ecore:EPackage" href="vp2120.ecore#//new%20EPackage%203"/> + <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> + <arrangeConstraints>KEEP_SIZE</arrangeConstraints> + <arrangeConstraints>KEEP_RATIO</arrangeConstraints> + <ownedStyle xmi:type="diagram:FlatContainerStyle" xmi:id="_0MxzoYspEeiSiblR-QI2Dg" borderSize="1" borderSizeComputationExpression="1" borderColor="39,76,114" backgroundColor="114,159,207" foregroundColor="204,242,166"> + <description xmi:type="style:FlatContainerStyleDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L5']/@containerMappings[name='CM_EPackage']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:ContainerMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L5']/@containerMappings[name='CM_EPackage']"/> + <ownedDiagramElements xmi:type="diagram:DNodeContainer" xmi:id="_kTZDoIsqEeiSiblR-QI2Dg" visible="false"> + <target xmi:type="ecore:EClass" href="vp2120.ecore#//new%20EPackage%203/new%20EClass%205"/> + <semanticElements xmi:type="ecore:EClass" href="vp2120.ecore#//new%20EPackage%203/new%20EClass%205"/> + <actualMapping xmi:type="description_1:ContainerMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L5']/@containerMappings[name='CM_EPackage']/@subContainerMappings[name='eCLass']"/> + <ownedDiagramElements xmi:type="diagram:DNode" xmi:id="_u-t94YsqEeiSiblR-QI2Dg" name="eAtt3" visible="false" width="3" height="3" resizeKind="NSEW"> + <target xmi:type="ecore:EAttribute" href="vp2120.ecore#//new%20EPackage%203/new%20EClass%205/eAtt3"/> + <semanticElements xmi:type="ecore:EAttribute" href="vp2120.ecore#//new%20EPackage%203/new%20EClass%205/eAtt3"/> + <ownedStyle xmi:type="diagram:Square" xmi:id="_u-uk8IsqEeiSiblR-QI2Dg" labelPosition="node"> + <description xmi:type="style:SquareDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L5']/@containerMappings[name='CM_EPackage']/@subContainerMappings[name='eCLass']/@subNodeMappings[name='eAtt']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:NodeMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L5']/@containerMappings[name='CM_EPackage']/@subContainerMappings[name='eCLass']/@subNodeMappings[name='eAtt']"/> + </ownedDiagramElements> + </ownedDiagramElements> + </ownedDiagramElements> + <ownedDiagramElements xmi:type="diagram:DNodeContainer" xmi:id="_d3xFUIwtEeiIecNcb01lxg" name="new Package 1" visible="false"> + <target xmi:type="ecore:EPackage" href="vp2120.ecore#//new%20Package%201"/> + <semanticElements xmi:type="ecore:EPackage" href="vp2120.ecore#//new%20Package%201"/> + <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> + <arrangeConstraints>KEEP_SIZE</arrangeConstraints> + <arrangeConstraints>KEEP_RATIO</arrangeConstraints> + <ownedStyle xmi:type="diagram:FlatContainerStyle" xmi:id="_d32k4IwtEeiIecNcb01lxg" borderSize="1" borderSizeComputationExpression="1" borderColor="39,76,114" backgroundColor="114,159,207" foregroundColor="204,242,166"> + <description xmi:type="style:FlatContainerStyleDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L4']/@containerMappings[name='CM_EPackage']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:ContainerMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L4']/@containerMappings[name='CM_EPackage']"/> + <ownedDiagramElements xmi:type="diagram:DNode" xmi:id="_d3-gsIwtEeiIecNcb01lxg" name="new EClass 3" visible="false" width="3" height="3" resizeKind="NSEW"> + <target xmi:type="ecore:EClass" href="vp2120.ecore#//new%20Package%201/new%20EClass%203"/> + <semanticElements xmi:type="ecore:EClass" href="vp2120.ecore#//new%20Package%201/new%20EClass%203"/> + <ownedStyle xmi:type="diagram:Square" xmi:id="_d3-gsYwtEeiIecNcb01lxg" labelPosition="node"> + <description xmi:type="style:SquareDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L4']/@containerMappings[name='CM_EPackage']/@subNodeMappings[name='eClass']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:NodeMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L4']/@containerMappings[name='CM_EPackage']/@subNodeMappings[name='eClass']"/> + </ownedDiagramElements> + </ownedDiagramElements> + <ownedDiagramElements xmi:type="diagram:DNodeContainer" xmi:id="_d39SkIwtEeiIecNcb01lxg" name="new EPackage 2" visible="false"> + <target xmi:type="ecore:EPackage" href="vp2120.ecore#//new%20EPackage%202"/> + <semanticElements xmi:type="ecore:EPackage" href="vp2120.ecore#//new%20EPackage%202"/> + <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> + <arrangeConstraints>KEEP_SIZE</arrangeConstraints> + <arrangeConstraints>KEEP_RATIO</arrangeConstraints> + <ownedStyle xmi:type="diagram:FlatContainerStyle" xmi:id="_d39SkYwtEeiIecNcb01lxg" borderSize="1" borderSizeComputationExpression="1" borderColor="39,76,114" backgroundColor="114,159,207" foregroundColor="204,242,166"> + <description xmi:type="style:FlatContainerStyleDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L4']/@containerMappings[name='CM_EPackage']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:ContainerMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L4']/@containerMappings[name='CM_EPackage']"/> + <ownedDiagramElements xmi:type="diagram:DNode" xmi:id="_d3_HwIwtEeiIecNcb01lxg" name="new EClass 4" visible="false" width="3" height="3" resizeKind="NSEW"> + <target xmi:type="ecore:EClass" href="vp2120.ecore#//new%20EPackage%202/new%20EClass%204"/> + <semanticElements xmi:type="ecore:EClass" href="vp2120.ecore#//new%20EPackage%202/new%20EClass%204"/> + <ownedStyle xmi:type="diagram:Square" xmi:id="_d3_HwYwtEeiIecNcb01lxg" labelPosition="node"> + <description xmi:type="style:SquareDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L4']/@containerMappings[name='CM_EPackage']/@subNodeMappings[name='eClass']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:NodeMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L4']/@containerMappings[name='CM_EPackage']/@subNodeMappings[name='eClass']"/> + </ownedDiagramElements> + </ownedDiagramElements> + <ownedDiagramElements xmi:type="diagram:DNodeContainer" xmi:id="_d395oIwtEeiIecNcb01lxg" name="new EPackage 3" visible="false"> + <target xmi:type="ecore:EPackage" href="vp2120.ecore#//new%20EPackage%203"/> + <semanticElements xmi:type="ecore:EPackage" href="vp2120.ecore#//new%20EPackage%203"/> + <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> + <arrangeConstraints>KEEP_SIZE</arrangeConstraints> + <arrangeConstraints>KEEP_RATIO</arrangeConstraints> + <ownedStyle xmi:type="diagram:FlatContainerStyle" xmi:id="_d395oYwtEeiIecNcb01lxg" borderSize="1" borderSizeComputationExpression="1" borderColor="39,76,114" backgroundColor="114,159,207" foregroundColor="204,242,166"> + <description xmi:type="style:FlatContainerStyleDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L4']/@containerMappings[name='CM_EPackage']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:ContainerMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L4']/@containerMappings[name='CM_EPackage']"/> + <ownedDiagramElements xmi:type="diagram:DNode" xmi:id="_d3_u0IwtEeiIecNcb01lxg" name="new EClass 5" visible="false" width="3" height="3" resizeKind="NSEW"> + <target xmi:type="ecore:EClass" href="vp2120.ecore#//new%20EPackage%203/new%20EClass%205"/> + <semanticElements xmi:type="ecore:EClass" href="vp2120.ecore#//new%20EPackage%203/new%20EClass%205"/> + <ownedStyle xmi:type="diagram:Square" xmi:id="_d3_u0YwtEeiIecNcb01lxg" labelPosition="node"> + <description xmi:type="style:SquareDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L4']/@containerMappings[name='CM_EPackage']/@subNodeMappings[name='eClass']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:NodeMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L4']/@containerMappings[name='CM_EPackage']/@subNodeMappings[name='eClass']"/> + </ownedDiagramElements> + </ownedDiagramElements> + <ownedDiagramElements xmi:type="diagram:DNodeContainer" xmi:id="_LJZPYI5WEeiIecNcb01lxg" name="EPackage4" incomingEdges="_PLucYI5WEeiIecNcb01lxg"> + <target xmi:type="ecore:EPackage" href="vp2120.ecore#//new%20Package%201/EPackage4"/> + <semanticElements xmi:type="ecore:EPackage" href="vp2120.ecore#//new%20Package%201/EPackage4"/> + <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> + <arrangeConstraints>KEEP_SIZE</arrangeConstraints> + <arrangeConstraints>KEEP_RATIO</arrangeConstraints> + <ownedStyle xmi:type="diagram:FlatContainerStyle" xmi:id="_LJZ2cI5WEeiIecNcb01lxg" borderSize="1" borderSizeComputationExpression="1" borderColor="39,76,114" backgroundColor="114,159,207" foregroundColor="204,242,166"> + <description xmi:type="style:FlatContainerStyleDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L2']/@containerMappings[name='CM_EPackage']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:ContainerMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L2']/@containerMappings[name='CM_EPackage']"/> + </ownedDiagramElements> + <ownedDiagramElements xmi:type="diagram:DEdge" xmi:id="_PLucYI5WEeiIecNcb01lxg" name="center" sourceNode="_aB7QUIspEeiSiblR-QI2Dg" targetNode="_LJZPYI5WEeiIecNcb01lxg" beginLabel="beginLabelTest" endLabel="end"> + <target xmi:type="ecore:EPackage" href="vp2120.ecore#//new%20Package%201/EPackage4"/> + <semanticElements xmi:type="ecore:EPackage" href="vp2120.ecore#//new%20Package%201/EPackage4"/> + <ownedStyle xmi:type="diagram:EdgeStyle" xmi:id="_PLvqgI5WEeiIecNcb01lxg" size="0" routingStyle="manhattan"> + <description xmi:type="style:EdgeStyleDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L2']/@edgeMappings[name='Ref3']/@style"/> + <beginLabelStyle xmi:type="diagram:BeginLabelStyle" xmi:id="_PLvqgY5WEeiIecNcb01lxg"/> + <centerLabelStyle xmi:type="diagram:CenterLabelStyle" xmi:id="_PLvqgo5WEeiIecNcb01lxg"/> + <endLabelStyle xmi:type="diagram:EndLabelStyle" xmi:id="_PLvqg45WEeiIecNcb01lxg"/> + </ownedStyle> + <actualMapping xmi:type="description_1:EdgeMapping" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L2']/@edgeMappings[name='Ref3']"/> + </ownedDiagramElements> + <description xmi:type="description_1:DiagramDescription" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']"/> + <filterVariableHistory xmi:type="diagram:FilterVariableHistory" xmi:id="_deplMYVIEeCSGf835_Mdqg"/> + <activatedLayers xmi:type="description_1:Layer" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@defaultLayer"/> + <activatedLayers xmi:type="description_1:AdditionalLayer" href="vp2120.odesign#//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L2']"/> + <target xmi:type="ecore:EPackage" href="vp2120.ecore#/"/> + </diagram:DSemanticDiagram> +</xmi:XMI> diff --git a/plugins/org.eclipse.sirius.tests.swtbot/data/unit/editModes/vp2120.ecore b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/editModes/vp2120.ecore new file mode 100644 index 0000000000..42e3d38369 --- /dev/null +++ b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/editModes/vp2120.ecore @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="rootPackage"> + <eClassifiers xsi:type="ecore:EClass" name="new EClass 2" eSuperTypes="#//new%20Package%201/new%20EClass%203"> + <eOperations name="new Operation"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="new Attribute"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="new EClass"/> + <eSubpackages name="new Package 1"> + <eClassifiers xsi:type="ecore:EClass" name="new EClass 3"> + <eStructuralFeatures xsi:type="ecore:EReference" name="eRef" eType="#//new%20EPackage%202/new%20EClass%204"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="eAtt1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EShort"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="EClass7"/> + <eSubpackages name="EPackage4" nsURI="EPackage4" nsPrefix="EPackage4"/> + </eSubpackages> + <eSubpackages name="new EPackage 2"> + <eClassifiers xsi:type="ecore:EClass" name="new EClass 4"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="eAtt2" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EShort"/> + </eClassifiers> + </eSubpackages> + <eSubpackages name="new EPackage 3"> + <eClassifiers xsi:type="ecore:EClass" name="new EClass 5"> + <eStructuralFeatures xsi:type="ecore:EReference" name="eRef2" eType="#//new%20EPackage%202/new%20EClass%204"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="eAtt3" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EShort"/> + </eClassifiers> + </eSubpackages> +</ecore:EPackage> diff --git a/plugins/org.eclipse.sirius.tests.swtbot/data/unit/editModes/vp2120.odesign b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/editModes/vp2120.odesign new file mode 100644 index 0000000000..b3bfdbf297 --- /dev/null +++ b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/editModes/vp2120.odesign @@ -0,0 +1,188 @@ +<?xml version="1.0" encoding="UTF-8"?> +<description:Group xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:filter="http://www.eclipse.org/sirius/diagram/description/filter/1.1.0" xmlns:style="http://www.eclipse.org/sirius/diagram/description/style/1.1.0" xmlns:tool="http://www.eclipse.org/sirius/diagram/description/tool/1.1.0" xmlns:tool_1="http://www.eclipse.org/sirius/description/tool/1.1.0" name="LayoutingMode" version="12.0.0.2017041100"> + <ownedViewpoints name="LayoutingMode" modelFileExtension="ecore"> + <ownedRepresentations xsi:type="description_1:DiagramDescription" name="LayoutingMode Diagram" domainClass="EPackage"> + <filters xsi:type="filter:CompositeFilterDescription" name="f1"> + <filters xsi:type="filter:MappingFilter" mappings="//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L2']/@containerMappings[name='CM_EPackage']"/> + </filters> + <layout xsi:type="description_1:CustomLayoutConfiguration" id="org.eclipse.elk.layered" label="ELK Layered" description="Layer-based algorithm provided by the Eclipse Layout Kernel. Arranges as many edges as possible into one direction by placing nodes into subsequent layers. This implementation supports different routing styles (straight, orthogonal, splines); if orthogonal routing is selected, arbitrary port constraints are respected, thus enabling the layout of block diagrams such as actor-oriented models or circuit schematics. Furthermore, full layout of compound graphs with cross-hierarchy edges is supported when the respective option is activated on the top level."/> + <defaultLayer name="Default"> + <nodeMappings name="NM_EEnum" label="NM_EEnum" semanticCandidatesExpression="aql:self.eContents()->filter(ecore::EEnum)" domainClass="EEnum"> + <style xsi:type="style:EllipseNodeDescription"> + <borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + <color xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='light_blue']"/> + </style> + </nodeMappings> + <edgeMappings name="EM_Ref" semanticCandidatesExpression="feature:eAllContents" sourceMapping="//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L2']/@containerMappings[name='CM_EPackage']/@borderedNodeMappings[name='BN_EClass']" targetMapping="//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L2']/@containerMappings[name='CM_EPackage']/@borderedNodeMappings[name='BN_EClass']" targetFinderExpression="aql:self.eReferenceType" sourceFinderExpression="feature:eContainer" domainClass="EReference" useDomainElement="true" reconnections="//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@defaultLayer/@toolSections.0/@ownedTools[name='reconnect']"> + <style sizeComputationExpression="[eContents()->size()/]" routingStyle="manhattan"> + <strokeColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='gray']"/> + <beginLabelStyleDescription labelExpression="'begin'"> + <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + </beginLabelStyleDescription> + <centerLabelStyleDescription labelExpression="'center'"> + <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + </centerLabelStyleDescription> + <endLabelStyleDescription labelExpression="'end'"> + <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + </endLabelStyleDescription> + </style> + </edgeMappings> + <toolSections name="tools"> + <ownedTools xsi:type="tool:ContainerCreationDescription" name="modifyModel" forceRefresh="true" containerMappings="//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L2']/@containerMappings[name='CM_EPackage']"> + <variable name="container"/> + <viewVariable name="containerView"/> + <initialOperation> + <firstModelOperations xsi:type="tool_1:ChangeContext" browseExpression="var:container"> + <subModelOperations xsi:type="tool_1:CreateInstance" typeName="EPackage" referenceName="eSubpackages"> + <subModelOperations xsi:type="tool_1:SetValue" featureName="name" valueExpression="newP"/> + <subModelOperations xsi:type="tool_1:CreateInstance" typeName="EClass" referenceName="eClassifiers"> + <subModelOperations xsi:type="tool_1:SetValue" featureName="name" valueExpression="newP"/> + </subModelOperations> + </subModelOperations> + <subModelOperations xsi:type="tool_1:CreateInstance" typeName="EEnum" referenceName="eClassifiers"> + <subModelOperations xsi:type="tool_1:SetValue" featureName="name" valueExpression="newEnum"/> + </subModelOperations> + </firstModelOperations> + </initialOperation> + </ownedTools> + <ownedTools xsi:type="tool:ContainerDropDescription" name="drop brodered" mappings="//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L2']/@containerMappings[name='CM_EPackage']/@borderedNodeMappings[name='BN_EClass']"> + <oldContainer name="oldSemanticContainer"/> + <newContainer name="newSemanticContainer"/> + <element name="element"/> + <newViewContainer name="newContainerView"/> + <initialOperation> + <firstModelOperations xsi:type="tool_1:ChangeContext" browseExpression="var:newSemanticContainer"> + <subModelOperations xsi:type="tool_1:SetValue" featureName="eClassifiers" valueExpression="var:element"/> + </firstModelOperations> + </initialOperation> + </ownedTools> + <ownedTools xsi:type="tool:DoubleClickDescription" name="DoubleClick on Package" mappings="//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L2']/@containerMappings[name='CM_EPackage']"> + <element name="element"/> + <elementView name="elementView"/> + <initialOperation> + <firstModelOperations xsi:type="tool:Navigation" createIfNotExistent="true" diagramDescription="//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']"/> + </initialOperation> + </ownedTools> + <ownedTools xsi:type="tool:DoubleClickDescription" name="DoubleClick On Class" forceRefresh="true" mappings="//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L2']/@containerMappings[name='CM_EPackage']/@borderedNodeMappings[name='BN_EClass']"> + <element name="element"/> + <elementView name="elementView"/> + <initialOperation> + <firstModelOperations xsi:type="tool_1:SetValue" featureName="name" valueExpression="aql:self.name + '_RENAMMED'"/> + </initialOperation> + </ownedTools> + <ownedTools xsi:type="tool:ReconnectEdgeDescription" name="reconnect"> + <source name="source"/> + <target name="target"/> + <sourceView name="sourceView"/> + <targetView name="targetView"/> + <element name="element"/> + <initialOperation> + <firstModelOperations xsi:type="tool_1:ChangeContext" browseExpression="var:element"> + <subModelOperations xsi:type="tool_1:SetValue" featureName="eType" valueExpression="var:target"/> + </firstModelOperations> + </initialOperation> + <edgeView name="edgeView"/> + </ownedTools> + <ownedTools xsi:type="tool:DirectEditLabel" name="directEdit"> + <mask mask="{0}"/> + <initialOperation> + <firstModelOperations xsi:type="tool_1:SetValue" featureName="name" valueExpression="var:arg0"/> + </initialOperation> + </ownedTools> + <ownedTools xsi:type="tool:NodeCreationDescription" name="createEClass" nodeMappings="//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L2']/@containerMappings[name='CM_EPackage']/@borderedNodeMappings[name='BN_EClass']"> + <variable name="container"/> + <viewVariable name="containerView"/> + <initialOperation> + <firstModelOperations xsi:type="tool_1:CreateInstance" typeName="ecore::EClass" referenceName="eClassifiers"/> + </initialOperation> + </ownedTools> + </toolSections> + </defaultLayer> + <additionalLayers name="L2" activeByDefault="true"> + <edgeMappings name="Ref3" semanticCandidatesExpression="feature:eAllContents" sourceMapping="//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L2']/@containerMappings[name='CM_EPackage']" targetMapping="//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@additionalLayers[name='L2']/@containerMappings[name='CM_EPackage']" targetFinderExpression="aql:self" sourceFinderExpression="feature:eContainer" domainClass="ecore::EPackage" useDomainElement="true" reconnections="//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@defaultLayer/@toolSections.0/@ownedTools[name='reconnect']"> + <style sizeComputationExpression="[eContents()->size()/]" routingStyle="manhattan"> + <strokeColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='gray']"/> + <beginLabelStyleDescription labelExpression="beginLabelTest"> + <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + </beginLabelStyleDescription> + <centerLabelStyleDescription labelExpression="center"> + <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + </centerLabelStyleDescription> + <endLabelStyleDescription labelExpression="end"> + <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + </endLabelStyleDescription> + </style> + </edgeMappings> + <containerMappings name="CM_EPackage" doubleClickDescription="//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@defaultLayer/@toolSections.0/@ownedTools[name='DoubleClick%20on%20Package']" domainClass="EPackage" dropDescriptions="//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@defaultLayer/@toolSections.0/@ownedTools[name='drop%20brodered']"> + <borderedNodeMappings name="BN_EClass" labelDirectEdit="//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@defaultLayer/@toolSections.0/@ownedTools[name='directEdit']" semanticCandidatesExpression="aql:self.eContents()->filter(ecore::EClass)" doubleClickDescription="//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@defaultLayer/@toolSections.0/@ownedTools[name='DoubleClick%20On%20Class']" domainClass="EClass"> + <style xsi:type="style:SquareDescription" width="2" height="2"> + <borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='purple']"/> + <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + <color xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='red']"/> + </style> + </borderedNodeMappings> + <style xsi:type="style:FlatContainerStyleDescription" arcWidth="1" arcHeight="1" borderSizeComputationExpression="1"> + <borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='dark_blue']"/> + <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + <backgroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='blue']"/> + <foregroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='light_green']"/> + </style> + </containerMappings> + </additionalLayers> + <additionalLayers name="L3"> + <containerMappings name="listPackage" semanticCandidatesExpression="aql:self.eContents()->filter(ecore::EPackage)" domainClass="ecore::EPackage" childrenPresentation="List"> + <subNodeMappings name="eClass" semanticCandidatesExpression="feature:eAllContents" domainClass="ecore::EClass"> + <style xsi:type="style:SquareDescription" labelPosition="node" resizeKind="NSEW"> + <borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + <color xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='gray']"/> + </style> + </subNodeMappings> + <style xsi:type="style:FlatContainerStyleDescription" borderSizeComputationExpression="1"> + <borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + <backgroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='white']"/> + <foregroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='light_gray']"/> + </style> + </containerMappings> + </additionalLayers> + <additionalLayers name="L4"> + <containerMappings name="CM_EPackage" semanticCandidatesExpression="aql:self.eContents()->filter(ecore::EPackage)" domainClass="EPackage" dropDescriptions="//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@defaultLayer/@toolSections.0/@ownedTools[name='drop%20brodered']"> + <subNodeMappings name="eClass" semanticCandidatesExpression="feature:eAllContents" domainClass="ecore::EClass"> + <style xsi:type="style:SquareDescription" labelPosition="node" resizeKind="NSEW"> + <borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + <color xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='gray']"/> + </style> + </subNodeMappings> + <style xsi:type="style:FlatContainerStyleDescription" arcWidth="1" arcHeight="1" borderSizeComputationExpression="1"> + <borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='dark_blue']"/> + <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + <backgroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='blue']"/> + <foregroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='light_green']"/> + </style> + </containerMappings> + </additionalLayers> + <additionalLayers name="L5"> + <containerMappings name="CM_EPackage" semanticCandidatesExpression="aql:self.eContents()->filter(ecore::EPackage)" domainClass="EPackage" dropDescriptions="//@ownedViewpoints[name='LayoutingMode']/@ownedRepresentations[name='LayoutingMode%20Diagram']/@defaultLayer/@toolSections.0/@ownedTools[name='drop%20brodered']" childrenPresentation="HorizontalStack"> + <subContainerMappings name="eCLass" semanticCandidatesExpression="feature:eAllContents" domainClass="ecore::EClass"> + <subNodeMappings name="eAtt" semanticCandidatesExpression="feature:eAllContents" domainClass="ecore::EAttribute"> + <style xsi:type="style:SquareDescription" labelPosition="node" resizeKind="NSEW"> + <borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + <color xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='gray']"/> + </style> + </subNodeMappings> + </subContainerMappings> + <style xsi:type="style:FlatContainerStyleDescription" arcWidth="1" arcHeight="1" borderSizeComputationExpression="1"> + <borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='dark_blue']"/> + <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + <backgroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='blue']"/> + <foregroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='light_green']"/> + </style> + </containerMappings> + </additionalLayers> + </ownedRepresentations> + </ownedViewpoints> +</description:Group> diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/AbstractModeTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/AbstractModeTest.java new file mode 100644 index 0000000000..3c7da0cad5 --- /dev/null +++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/AbstractModeTest.java @@ -0,0 +1,259 @@ +/******************************************************************************* + * Copyright (c) 2018 THALES GLOBAL SERVICES. + * All rights reserved. This program and 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: + * Obeo - initial API and implementation + *******************************************************************************/ +package org.eclipse.sirius.tests.swtbot; + +import static org.junit.Assert.assertNotEquals; + +import java.util.List; + +import org.eclipse.emf.ecore.ENamedElement; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.gef.EditPart; +import org.eclipse.gmf.runtime.notation.Edge; +import org.eclipse.sirius.business.api.session.SessionStatus; +import org.eclipse.sirius.diagram.DDiagram; +import org.eclipse.sirius.diagram.business.internal.metamodel.spec.DEdgeSpec; +import org.eclipse.sirius.diagram.ui.internal.edit.parts.DEdgeEditPart; +import org.eclipse.sirius.diagram.ui.provider.Messages; +import org.eclipse.sirius.tests.support.api.ICondition; +import org.eclipse.sirius.tests.support.api.TestsUtil; +import org.eclipse.sirius.tests.swtbot.support.api.AbstractSiriusSwtBotGefTestCase; +import org.eclipse.sirius.tests.swtbot.support.api.business.UIResource; +import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusDiagramEditor; +import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotUtils; +import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefConnectionEditPart; +import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart; +import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException; +import org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarDropDownButton; + +/** + * Contains methods to test the layouting and show/hide edit modes. + * + * @author <a href="mailto:pierre.guilet@obeo.fr">Pierre Guilet</a> + * + */ +public abstract class AbstractModeTest extends AbstractSiriusSwtBotGefTestCase { + + private static final String DATA_UNIT_DIR = "/data/unit/editModes/"; + + private static final String SEMANTIC_MODEL_NAME = "vp2120.ecore"; + + private static final String MODELER_NAME = "vp2120.odesign"; + + private static final String SESSION_FILE_NAME = "vp2120.aird"; + + /** + * Representation description name. + */ + protected static final String REPRESENTATION_DESCRIPTION_NAME = "LayoutingMode Diagram"; + + /** + * Representation instance name. + */ + protected static final String REPRESENTATION_INSTANCE_NAME = "new " + REPRESENTATION_DESCRIPTION_NAME; + + @Override + protected void onSetUpBeforeClosingWelcomePage() throws Exception { + copyFileToTestProject(Activator.PLUGIN_ID, DATA_UNIT_DIR, SEMANTIC_MODEL_NAME, SESSION_FILE_NAME, MODELER_NAME); + } + + @Override + protected void onSetUpAfterOpeningDesignerPerspective() throws Exception { + sessionAirdResource = new UIResource(designerProject, "/", SESSION_FILE_NAME); + localSession = designerPerspective.openSessionFromFile(sessionAirdResource); + editor = (SWTBotSiriusDiagramEditor) openRepresentation(localSession.getOpenedSession(), REPRESENTATION_DESCRIPTION_NAME, REPRESENTATION_INSTANCE_NAME, DDiagram.class); + } + + /** + * Ensures that a tool has been applied or not (according to the given + * shouldHaveBeenApplied value), by checking the Session's status. + * + * @param shouldHaveBeenApplied + * indicates whether a tool should have been applied or not + */ + protected void assertToolHasBeenApplied(boolean shouldHaveBeenApplied) { + TestsUtil.waitUntil(new ICondition() { + + @Override + public boolean test() throws Exception { + return shouldHaveBeenApplied == localSession.getOpenedSession().getStatus().equals(SessionStatus.DIRTY); + } + + @Override + public String getFailureMessage() { + String message = null; + if (shouldHaveBeenApplied) { + message = "Tool should have been applied as Layouting mode is disabled"; + } else { + message = "Tool should not have been applied as Layouting mode is activated"; + } + return message; + } + }); + + } + + /** + * Ensures that a direct edit tool has been applied or not (according to the + * given shouldHaveBeenApplied value). + * + * @param originalEditPartName + * the part name before direct edit. + * @param shouldHaveBeenApplied + * indicates whether the direct edit should have been applied or + * not + */ + protected void assertDirectEditToolHasBeenApplied(String originalEditPartName, boolean shouldHaveBeenApplied) { + if (shouldHaveBeenApplied) { + try { + editor.getEditPart(originalEditPartName).part(); + fail("Direct edit should have been applied"); + } catch (WidgetNotFoundException e) { + } + } else { + try { + editor.getEditPart(originalEditPartName).part(); + } catch (WidgetNotFoundException e) { + fail("Direct edit should have not been applied"); + } + } + } + + /** + * Ensures that a drag and drop tool has been applied or not (according to + * the given shouldHaveBeenApplied value), by checking the Session's status. + * + * @param draggedObject + * the dragged object. + * @param parentObject + * the parent of the dragged object. + * @param shouldHaveBeenApplied + * indicates whether a tool should have been applied or not + */ + protected void assertDragAndDropToolHasBeenApplied(String draggedObject, String parentObject, boolean shouldHaveBeenApplied) { + SWTBotGefEditPart draggedEditPart = editor.getEditPart(draggedObject); + SWTBotGefEditPart parentEditPart = editor.getEditPart(parentObject); + TestsUtil.waitUntil(new ICondition() { + + @Override + public boolean test() throws Exception { + if (shouldHaveBeenApplied) { + return !draggedEditPart.part().getParent().equals(parentEditPart.part()); + } + return shouldHaveBeenApplied == draggedEditPart.part().getParent().equals(parentEditPart.part()); + } + + @Override + public String getFailureMessage() { + String message = null; + if (shouldHaveBeenApplied) { + message = "Drag and drop was not applied"; + } else { + message = "Drag and drop should not have been applied"; + } + return message; + } + }); + + } + + /** + * Returns the SWT bot edge part of the part with the given name. + * + * @param edgeName + * the name of the parent to look for. + * @return the SWT bot part of the part with the given name. + */ + protected SWTBotGefEditPart getEdgePart(String edgeName) { + List<SWTBotGefConnectionEditPart> connectionsEditPart = editor.getConnectionsEditPart(); + for (SWTBotGefConnectionEditPart swtBotGefConnectionEditPart : connectionsEditPart) { + DEdgeEditPart edgePart = ((DEdgeEditPart) swtBotGefConnectionEditPart.part()); + Edge edge = (Edge) edgePart.getModel(); + EObject target = ((DEdgeSpec) edge.getElement()).getTarget(); + String name = target instanceof ENamedElement ? ((ENamedElement) target).getName() : ""; + if (edgeName.equals(name)) { + return swtBotGefConnectionEditPart; + } + } + return null; + } + + /** + * Ensures that an edge reconnection has been applied or not (according to + * the given shouldHaveBeenApplied value). + * + * @param targetPartName + * the original target before reconnection + * @param edgeName + * the name of the reconnected edge + * @param shouldHaveBeenApplied + * indicates whether a tool should have been applied or not + */ + protected void assertEdgeReconnectionToolHasBeenApplied(String targetPartName, String edgeName, boolean shouldHaveBeenApplied) { + SWTBotGefEditPart swtEdgePart = getEdgePart(edgeName); + DEdgeEditPart edgePart = (DEdgeEditPart) swtEdgePart.part(); + EditPart target = edgePart.getTarget(); + EditPart expectedTargetPart = editor.getEditPart(targetPartName).part().getParent(); + if (shouldHaveBeenApplied) { + assertNotEquals("Reconnection should have been done but failed.", expectedTargetPart, target); + } else { + assertEquals("Reconnection should have not been done but was executed.", expectedTargetPart, target); + } + } + + /** + * Activates the Show/Hide mode using the tabbar button. + */ + protected void activateShowHideModeUsingTabbar() { + SWTBotGefEditPart editPart = editor.getSWTBotGefViewer().mainEditPart(); + editPart.click(); + SWTBotUtils.waitAllUiEvents(); + SWTBotToolbarDropDownButton toolbarDropDownButton = editor.bot().toolbarDropDownButton(4); + SWTBotUtils.waitAllUiEvents(); + toolbarDropDownButton.menuItem(Messages.ShowingModeSwitchingAction_label).click(); + } + + /** + * Switch layer activation status. + * + * @param layerName + * The name of the layer to switch. + */ + protected void switchLayer(String layerName) { + SWTBotGefEditPart editPart = editor.getSWTBotGefViewer().mainEditPart(); + editPart.click(); + SWTBotUtils.waitAllUiEvents(); + SWTBotToolbarDropDownButton toolbarDropDownButton = editor.bot().toolbarDropDownButton(2); + SWTBotUtils.waitAllUiEvents(); + toolbarDropDownButton.menuItem(layerName).click(); + } + + /** + * Activate the standard mode. + */ + protected void activateStandardModeUsingTabbar() { + SWTBotGefEditPart editPart = editor.getSWTBotGefViewer().mainEditPart(); + editPart.click(); + SWTBotToolbarDropDownButton toolbarDropDownButton = editor.bot().toolbarDropDownButton(4); + toolbarDropDownButton.menuItem(Messages.DefaultModeAction_Label).click(); + } + + /** + * Activates the Layouting mode using the tabbar button. + */ + protected void activateLayoutingModeUsingTabbar() { + SWTBotGefEditPart editPart = editor.getSWTBotGefViewer().mainEditPart(); + editPart.click(); + SWTBotToolbarDropDownButton toolbarDropDownButton = editor.bot().toolbarDropDownButton(4); + toolbarDropDownButton.menuItem(Messages.LayoutingModeSwitchingAction_label).click(); + } + +} diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EditModeTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EditModeTest.java new file mode 100644 index 0000000000..f26d444b88 --- /dev/null +++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EditModeTest.java @@ -0,0 +1,700 @@ +/******************************************************************************* + * Copyright (c) 2018 THALES GLOBAL SERVICES. + * All rights reserved. This program and 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: + * Obeo - initial API and implementation + *******************************************************************************/ +package org.eclipse.sirius.tests.swtbot; + +import java.util.List; + +import org.eclipse.draw2d.geometry.Point; +import org.eclipse.draw2d.geometry.PointList; +import org.eclipse.gef.EditPart; +import org.eclipse.gef.GraphicalEditPart; +import org.eclipse.gef.editparts.AbstractConnectionEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderItemEditPart; +import org.eclipse.gmf.runtime.notation.Node; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.sirius.diagram.DDiagram; +import org.eclipse.sirius.diagram.HideFilter; +import org.eclipse.sirius.diagram.HideLabelFilter; +import org.eclipse.sirius.diagram.business.internal.metamodel.spec.DNodeContainerSpec; +import org.eclipse.sirius.diagram.business.internal.metamodel.spec.DNodeListElementSpec; +import org.eclipse.sirius.diagram.business.internal.metamodel.spec.DNodeListSpec; +import org.eclipse.sirius.diagram.business.internal.metamodel.spec.DNodeSpec; +import org.eclipse.sirius.diagram.ui.internal.edit.parts.DDiagramEditPart; +import org.eclipse.sirius.diagram.ui.internal.edit.parts.DNode3EditPart; +import org.eclipse.sirius.diagram.ui.internal.edit.parts.DNode4EditPart; +import org.eclipse.sirius.diagram.ui.internal.edit.parts.DNodeContainerEditPart; +import org.eclipse.sirius.diagram.ui.internal.edit.parts.DNodeContainerViewNodeContainerCompartmentEditPart; +import org.eclipse.sirius.diagram.ui.internal.edit.parts.DNodeListEditPart; +import org.eclipse.sirius.diagram.ui.internal.edit.parts.DNodeListElementEditPart; +import org.eclipse.sirius.diagram.ui.internal.edit.parts.DNodeNameEditPart; +import org.eclipse.sirius.tests.support.api.ICondition; +import org.eclipse.sirius.tests.support.api.TestsUtil; +import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusDiagramEditor; +import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper; +import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotUtils; +import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefConnectionEditPart; +import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart; +import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException; +import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; +import org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarDropDownButton; +import org.hamcrest.Description; +import org.hamcrest.Matcher; + +/** + * Tests that the show/hide mode behave as expected and that the menu to change + * the active mode is also working. + * + * @author <a href="mailto:pierre.guilet@obeo.fr">Pierre Guilet</a> + * + */ +public class EditModeTest extends AbstractModeTest { + + private void reconnectEdge(String source, String target, String newTargetName) { + SWTBotGefEditPart sourceEditPartBot = getEditPart(source, AbstractBorderItemEditPart.class); + SWTBotGefEditPart targetEditPartBot = getEditPart(target, AbstractBorderItemEditPart.class); + SWTBotGefEditPart newtargetEditPartBot = getEditPart(newTargetName, AbstractBorderItemEditPart.class); + SWTBotGefConnectionEditPart connectionEditPartBot = editor.getConnectionEditPart(sourceEditPartBot, targetEditPartBot).get(0); + + // Reconnect target of first connection + PointList connection1Points = ((AbstractConnectionEditPart) connectionEditPartBot.part()).getConnectionFigure().getPoints().getCopy(); + Point from = connection1Points.getLastPoint(); + Point to = editor.getBounds(newtargetEditPartBot).getLocation(); + connectionEditPartBot.select(); + editor.drag(from, to); + } + + private void testReconnect(Mode startingMode, Mode testedMode) { + switch (startingMode) { + case LAYOUTING: + activateLayoutingModeUsingTabbar(); + break; + case SHOWHIDE: + activateShowHideModeUsingTabbar(); + break; + case STANDARD: + reconnectEdge("new EClass 3", "new EClass 4", "new EClass 5"); + // -> tool should have been applied + assertEdgeReconnectionToolHasBeenApplied("new EClass 4", "eRef", true); + editor.save(); + editor.setFocus(); + break; + default: + break; + } + + switch (testedMode) { + case LAYOUTING: + activateLayoutingModeUsingTabbar(); + break; + case SHOWHIDE: + activateShowHideModeUsingTabbar(); + break; + default: + break; + } + + // applying tool + reconnectEdge("new EClass 5", "new EClass 4", "new EClass 3"); + SWTBotUtils.waitAllUiEvents(); + // -> tool should not have been applied + assertEdgeReconnectionToolHasBeenApplied("new EClass 4", "eRef2", false); + + if (startingMode == Mode.STANDARD) { + editor.close(); + editor = (SWTBotSiriusDiagramEditor) openRepresentation(localSession.getOpenedSession(), REPRESENTATION_DESCRIPTION_NAME, REPRESENTATION_INSTANCE_NAME, DDiagram.class); + editor = SWTBotSiriusHelper.getSiriusDiagramEditor(editor.getTitle()); + reconnectEdge("new EClass 3", "new EClass 5", "EClass7"); + + // -> tool should have been applied + assertEdgeReconnectionToolHasBeenApplied("new EClass 4", "eRef", true); + } + } + + private void testDragAndDrop(Mode startingMode, Mode testedMode) { + + switch (startingMode) { + case LAYOUTING: + activateLayoutingModeUsingTabbar(); + break; + case SHOWHIDE: + activateShowHideModeUsingTabbar(); + break; + case STANDARD: + editor.drag(getEditPart("new EClass 5").parent(), ((GraphicalEditPart) getEditPart("new EPackage 2").part()).getFigure().getBounds().getLocation()); + SWTBotUtils.waitAllUiEvents(); + // -> tool should have been applied + assertDragAndDropToolHasBeenApplied("new EClass 5", "new EPackage 3", true); + SWTBotGefEditPart rootEditPart = editor.rootEditPart(); + editor.click(rootEditPart); + TestsUtil.waitUntil(new ICondition() { + + @Override + public boolean test() throws Exception { + ISelection selection = editor.getSelection(); + return ((StructuredSelection) selection).getFirstElement() instanceof DDiagramEditPart; + } + + @Override + public String getFailureMessage() { + return "diagram was never selected"; + } + }); + editor.save(); + editor.setFocus(); + break; + default: + break; + } + + switch (testedMode) { + case LAYOUTING: + activateLayoutingModeUsingTabbar(); + break; + case SHOWHIDE: + activateShowHideModeUsingTabbar(); + break; + default: + break; + } + + // applying tool + SWTBotUtils.waitAllUiEvents(); + editor.drag(getEditPart("new EClass 3").parent(), ((GraphicalEditPart) getEditPart("new EPackage 2").part()).getFigure().getBounds().getLocation()); + SWTBotUtils.waitAllUiEvents(); + // -> tool should not have been applied + assertDragAndDropToolHasBeenApplied("new EClass 3", "new Package 1", false); + + if (startingMode == Mode.STANDARD) { + // reopening diagram and applying tool + editor = (SWTBotSiriusDiagramEditor) openRepresentation(localSession.getOpenedSession(), REPRESENTATION_DESCRIPTION_NAME, REPRESENTATION_INSTANCE_NAME, DDiagram.class); + editor = SWTBotSiriusHelper.getSiriusDiagramEditor(editor.getTitle()); + + editor.drag(getEditPart("new EClass 3").parent(), ((GraphicalEditPart) getEditPart("new EPackage 2").part()).getFigure().getBounds().getLocation()); + SWTBotUtils.waitAllUiEvents(); + // -> tool should have been applied + assertDragAndDropToolHasBeenApplied("new EClass 3", "new Package 1", true); + } + } + + private void testDirectEdit(Mode startingMode, Mode testedMode) { + switch (startingMode) { + case LAYOUTING: + activateLayoutingModeUsingTabbar(); + break; + case SHOWHIDE: + activateShowHideModeUsingTabbar(); + break; + case STANDARD: + + // applying tool + editor.directEditType("newValue", getEditPart("new EClass 3")); + SWTBotUtils.waitAllUiEvents(); + // -> tool should have been applied + assertDirectEditToolHasBeenApplied("new EClass 3", true); + editor.save(); + editor.setFocus(); + break; + default: + break; + } + + switch (testedMode) { + case LAYOUTING: + activateLayoutingModeUsingTabbar(); + break; + case SHOWHIDE: + activateShowHideModeUsingTabbar(); + break; + default: + break; + } + + // applying tool + editor.directEditType("newValue2", getEditPart("new EClass 4")); + SWTBotUtils.waitAllUiEvents(); + // -> tool should not have been applied + assertDirectEditToolHasBeenApplied("new EClass 4", false); + + if (startingMode == Mode.STANDARD) { + // reopening diagram and applying tool + editor.close(); + editor = (SWTBotSiriusDiagramEditor) openRepresentation(localSession.getOpenedSession(), REPRESENTATION_DESCRIPTION_NAME, REPRESENTATION_INSTANCE_NAME, DDiagram.class); + editor = SWTBotSiriusHelper.getSiriusDiagramEditor(editor.getTitle()); + editor.directEditType("newValue3", getEditPart("new EClass 4")); + SWTBotUtils.waitAllUiEvents(); + // -> tool should have been applied + assertDirectEditToolHasBeenApplied("new EClass 4", true); + } + } + + private enum Mode { + STANDARD, LAYOUTING, SHOWHIDE + } + + /** + * Ensures that activating the Layouting mode when standard mode is + * activated forbids edge DnD tools applying. + */ + public void testLayoutingModeOnDragAndDropFromStandardMode() { + testDragAndDrop(Mode.STANDARD, Mode.LAYOUTING); + } + + /** + * Ensures that activating the Layouting mode when standard mode is + * activated forbids edge direct edit tools applying. + */ + public void testLayoutingModeOnDirectEditFromStandardMode() { + testDirectEdit(Mode.STANDARD, Mode.LAYOUTING); + } + + /** + * Ensures that activating the Layouting mode when standard mode is + * activated forbids edge reconnection tools applying. + */ + public void testLayoutingModeOnEdgeReconnectionFromStandardMode() { + testReconnect(Mode.STANDARD, Mode.LAYOUTING); + } + + /** + * Ensures that activating the Layouting mode when show/hide mode is + * activated forbids edge DnD tools applying. + */ + public void testLayoutingModeOnDragAndDropFromShowHideMode() { + testDragAndDrop(Mode.SHOWHIDE, Mode.LAYOUTING); + } + + /** + * Ensures that activating the Layouting mode when show/hide mode is + * activated forbids edge direct edit tools applying. + */ + public void testLayoutingModeOnDirectEditFromShowHideMode() { + testDirectEdit(Mode.SHOWHIDE, Mode.LAYOUTING); + } + + /** + * Ensures that activating the Layouting mode when show/hide mode is + * activated forbids edge reconnection tools applying. + */ + public void testLayoutingModeOnEdgeReconnectionFromShowHideMode() { + testReconnect(Mode.SHOWHIDE, Mode.LAYOUTING); + } + + /** + * Ensures that activating the showing mode when standard mode is activated + * forbids edge DnD tools applying. + */ + public void testShowHideOnDragAndDropFromStandardMode() { + testDragAndDrop(Mode.STANDARD, Mode.SHOWHIDE); + } + + /** + * Ensures that activating the showing mode when standard mode is activated + * forbids edge direct edit tools applying. + */ + public void testShowHideOnDirectEditFromStandardMode() { + testDirectEdit(Mode.STANDARD, Mode.SHOWHIDE); + } + + /** + * Ensures that activating the showing mode when standard mode is activated + * forbids edge reconnection tools applying. + */ + public void testShowHideOnEdgeReconnectionFromStandardMode() { + testReconnect(Mode.STANDARD, Mode.SHOWHIDE); + } + + /** + * Ensures that activating the show/hide mode when Layouting mode is + * activated forbids edge DnD tools applying. + */ + public void testShowHideOnDragAndDropFromLayoutingMode() { + testDragAndDrop(Mode.LAYOUTING, Mode.SHOWHIDE); + } + + /** + * Ensures that activating the show/hide mode when Layouting mode is + * activated forbids edge direct edit tools applying. + */ + public void testShowHideOnDirectEditFromSLayoutingMode() { + testDirectEdit(Mode.LAYOUTING, Mode.SHOWHIDE); + } + + /** + * Ensures that activating the show/hide mode when Layouting mode is + * activated forbids edge reconnection tools applying. + */ + public void testShowHideOnEdgeReconnectionFromLayoutingMode() { + testReconnect(Mode.LAYOUTING, Mode.SHOWHIDE); + } + + /** + * Verify that a double click on a visible node label hides it and vice + * versa. + */ + public void testShowHideDoubleClickOnNodeLabel() { + SWTBotGefEditPart swtBotDNodeEditPart = getEditPart("new EClass 4", DNode4EditPart.class); + EditPart part = swtBotDNodeEditPart.part(); + DNodeSpec element = (DNodeSpec) ((Node) part.getModel()).getElement(); + assertFalse("The node should not have its label filtered.", element.getGraphicalFilters().stream().anyMatch(HideLabelFilter.class::isInstance)); + + activateShowHideModeUsingTabbar(); + SWTBotGefEditPart swtBotEditPart = getEditPart("new EClass 4", DNodeNameEditPart.class); + swtBotEditPart.doubleClick(); + SWTBotUtils.waitAllUiEvents(); + + assertTrue("The node should have its label filtered.", element.getGraphicalFilters().stream().anyMatch(HideLabelFilter.class::isInstance)); + + swtBotEditPart.doubleClick(); + SWTBotUtils.waitAllUiEvents(); + + assertFalse("The node should not have its label filtered.", element.getGraphicalFilters().stream().anyMatch(HideLabelFilter.class::isInstance)); + + } + + /** + * Verify that a double click on a visible bordered node hides it and vice + * versa. + */ + public void testShowHideDoubleClickOnBorderedNode() { + SWTBotGefEditPart swtBotDNodeEditPart = getEditPart("new EClass 4", DNode4EditPart.class); + EditPart part = swtBotDNodeEditPart.part(); + DNodeSpec element = (DNodeSpec) ((Node) part.getModel()).getElement(); + assertFalse("The node should not have its label filtered.", element.getGraphicalFilters().stream().anyMatch(HideFilter.class::isInstance)); + + activateShowHideModeUsingTabbar(); + swtBotDNodeEditPart.doubleClick(); + SWTBotUtils.waitAllUiEvents(); + + assertTrue("The node should be filtered.", element.getGraphicalFilters().stream().anyMatch(HideFilter.class::isInstance)); + + swtBotDNodeEditPart.doubleClick(); + SWTBotUtils.waitAllUiEvents(); + + assertFalse("The node should not be filtered.", element.getGraphicalFilters().stream().anyMatch(HideFilter.class::isInstance)); + + } + + /** + * Verify that a double click on a visible container hides it and vice + * versa. + */ + public void testShowHideDoubleClickOnContainer() { + SWTBotGefEditPart swtBotDNodeEditPart = getEditPart("new EPackage 2", DNodeContainerEditPart.class); + EditPart part = swtBotDNodeEditPart.part(); + DNodeContainerSpec element = (DNodeContainerSpec) ((Node) part.getModel()).getElement(); + assertFalse("The container should not have its label filtered.", element.getGraphicalFilters().stream().anyMatch(HideFilter.class::isInstance)); + + activateShowHideModeUsingTabbar(); + swtBotDNodeEditPart.doubleClick(); + SWTBotUtils.waitAllUiEvents(); + + assertTrue("The container should be filtered.", element.getGraphicalFilters().stream().anyMatch(HideFilter.class::isInstance)); + + swtBotDNodeEditPart.doubleClick(); + SWTBotUtils.waitAllUiEvents(); + + assertFalse("The container should not be filtered.", element.getGraphicalFilters().stream().anyMatch(HideFilter.class::isInstance)); + + } + + /** + * Verify that a double click on a visible edge hides it and vice versa. + */ + // public void testShowHideDoubleClickOnEdge() { + // SWTBotGefEditPart swtBotDNodeEditPart = getEdgePart("EPackage4"); + // EditPart part = swtBotDNodeEditPart.part(); + // DEdgeSpec element = (DEdgeSpec) ((Edge) part.getModel()).getElement(); + // assertFalse("The edge should not have its label filtered.", + // element.getGraphicalFilters().stream().anyMatch(HideFilter.class::isInstance)); + // + // activateShowHideModeUsingTabbar(); + // SWTBotUtils.waitAllUiEvents(); + // doubleClickOnEdge(swtBotDNodeEditPart); + // + // SWTBotUtils.waitAllUiEvents(); + // + // assertTrue("The edge should be filtered.", + // element.getGraphicalFilters().stream().anyMatch(HideFilter.class::isInstance)); + // + // doubleClickOnEdge(swtBotDNodeEditPart); + // SWTBotUtils.waitAllUiEvents(); + // + // assertFalse("The edge should not be filtered.", + // element.getGraphicalFilters().stream().anyMatch(HideFilter.class::isInstance)); + // + // } + + /** + * Verify that a double click on a visible edge labels hide it and vice + * versa. + */ + // public void testShowHideDoubleClickOnEdgeLabel() { + // SWTBotGefEditPart swtBotDNodeEditPart = getEditPart("beginLabelTest", + // DEdgeBeginNameEditPart.class); + // EditPart part = swtBotDNodeEditPart.part(); + // DEdgeSpec element = (DEdgeSpec) ((Node) part.getModel()).getElement(); + // assertFalse("The edge should not have its label filtered.", + // element.getGraphicalFilters().stream().anyMatch(HideLabelFilter.class::isInstance)); + // + // activateShowHideModeUsingTabbar(); + // SWTBotUtils.waitAllUiEvents(); + // swtBotDNodeEditPart.doubleClick(); + // + // SWTBotUtils.waitAllUiEvents(); + // + // assertTrue("The edge should be filtered.", + // element.getGraphicalFilters().stream().anyMatch(HideLabelFilter.class::isInstance)); + // + // swtBotDNodeEditPart.doubleClick(); + // SWTBotUtils.waitAllUiEvents(); + // + // assertFalse("The edge should not be filtered.", + // element.getGraphicalFilters().stream().anyMatch(HideLabelFilter.class::isInstance)); + // + // } + + /** + * Verify that a double click on a visible list container hides it and vice + * versa. + */ + public void testShowHideDoubleClickOnListContainer() { + switchLayer("L2"); + switchLayer("L3"); + SWTBotUtils.waitAllUiEvents(); + + SWTBotGefEditPart swtBotDNodeEditPart = getEditPart("new Package 1", DNodeListEditPart.class); + EditPart part = swtBotDNodeEditPart.part(); + DNodeListSpec element = (DNodeListSpec) ((Node) part.getModel()).getElement(); + assertFalse("The node should not have its label filtered.", element.getGraphicalFilters().stream().anyMatch(HideFilter.class::isInstance)); + + activateShowHideModeUsingTabbar(); + swtBotDNodeEditPart.doubleClick(); + SWTBotUtils.waitAllUiEvents(); + + assertTrue("The node should be filtered.", element.getGraphicalFilters().stream().anyMatch(HideFilter.class::isInstance)); + + swtBotDNodeEditPart.doubleClick(); + SWTBotUtils.waitAllUiEvents(); + + assertFalse("The node should not be filtered.", element.getGraphicalFilters().stream().anyMatch(HideFilter.class::isInstance)); + + } + + /** + * Verify that a double click on a visible list node hides it and vice + * versa. + */ + public void testShowHideDoubleClickOnListNode() { + switchLayer("L2"); + switchLayer("L3"); + SWTBotUtils.waitAllUiEvents(); + + SWTBotGefEditPart swtBotDNodeEditPart = getEditPart("new EClass 3", DNodeListElementEditPart.class); + EditPart part = swtBotDNodeEditPart.part(); + DNodeListElementSpec element = (DNodeListElementSpec) ((Node) part.getModel()).getElement(); + assertFalse("The node should not have its label filtered.", element.getGraphicalFilters().stream().anyMatch(HideFilter.class::isInstance)); + + activateShowHideModeUsingTabbar(); + swtBotDNodeEditPart.doubleClick(); + SWTBotUtils.waitAllUiEvents(); + + assertTrue("The node should be filtered.", element.getGraphicalFilters().stream().anyMatch(HideFilter.class::isInstance)); + + swtBotDNodeEditPart.doubleClick(); + SWTBotUtils.waitAllUiEvents(); + + assertFalse("The node should not be filtered.", element.getGraphicalFilters().stream().anyMatch(HideFilter.class::isInstance)); + + } + + /** + * Verify that a double click on a visible node hides it and vice versa. + */ + public void testShowHideDoubleClickOnFilteredNode() { + switchLayer("L2"); + switchLayer("L4"); + SWTBotGefEditPart swtBotDNodeEditPart = getEditPart("new EClass 4", DNode3EditPart.class); + EditPart part = swtBotDNodeEditPart.part(); + DNodeSpec element = (DNodeSpec) ((Node) part.getModel()).getElement(); + assertFalse("The node should not have its label filtered.", element.getGraphicalFilters().stream().anyMatch(HideFilter.class::isInstance)); + + activateShowHideModeUsingTabbar(); + swtBotDNodeEditPart.doubleClick(); + SWTBotUtils.waitAllUiEvents(); + + assertTrue("The node should be filtered.", element.getGraphicalFilters().stream().anyMatch(HideFilter.class::isInstance)); + + swtBotDNodeEditPart.doubleClick(); + SWTBotUtils.waitAllUiEvents(); + + assertFalse("The node should not be filtered.", element.getGraphicalFilters().stream().anyMatch(HideFilter.class::isInstance)); + + } + + /** + * Verify that a double click on a visible compartment container hides it + * and vice versa. + */ + public void testShowHideDoubleClickOnCompartmentContainer() { + switchLayer("L2"); + switchLayer("L5"); + + SWTBotUtils.waitAllUiEvents(); + + List<SWTBotGefEditPart> editParts = getAvailableCompartmentEditParts(); + + SWTBotGefEditPart swtBotDNodeEditPart = editParts.get(0); + EditPart part = swtBotDNodeEditPart.part(); + DNodeContainerSpec element = (DNodeContainerSpec) ((Node) part.getModel()).getElement(); + assertFalse("The node should not have its label filtered.", element.getGraphicalFilters().stream().anyMatch(HideFilter.class::isInstance)); + + activateShowHideModeUsingTabbar(); + swtBotDNodeEditPart.doubleClick(); + SWTBotUtils.waitAllUiEvents(); + + assertTrue("The compartment should be filtered.", element.getGraphicalFilters().stream().anyMatch(HideFilter.class::isInstance)); + + swtBotDNodeEditPart.doubleClick(); + SWTBotUtils.waitAllUiEvents(); + + assertFalse("The compartment should not be filtered.", element.getGraphicalFilters().stream().anyMatch(HideFilter.class::isInstance)); + + } + + /** + * Verify that a double click on an invisible container filtered by a filter + * asks the user to remove this filter and make it visible if yes is chosen. + */ + public void testShowHideDoubleClickOnFilteredContainer() { + SWTBotToolbarDropDownButton toolbarDropDownButton = editor.bot().toolbarDropDownButton(3); + toolbarDropDownButton.menuItem("f1").click(); + SWTBotUtils.waitAllUiEvents(); + + try { + getEditPart("new EPackage 2", DNodeContainerEditPart.class); + fail("Part should be not visible at all."); + } catch (WidgetNotFoundException | AssertionError e) { + } + + activateShowHideModeUsingTabbar(); + SWTBotGefEditPart swtBotDNodeEditPart = getEditPart("new EPackage 2", DNodeContainerEditPart.class); + EditPart part = swtBotDNodeEditPart.part(); + DNodeContainerSpec element = (DNodeContainerSpec) ((Node) part.getModel()).getElement(); + assertFalse("The container should not be visible", element.isVisible()); + + swtBotDNodeEditPart.doubleClick(); + + SWTBotShell activeShell = editor.bot().activeShell(); + assertEquals("The dialog to deactivate the filter has not shown up.", "Filter/layer update confirmation", activeShell.getText()); + activeShell.bot().button("OK").click(); + + assertTrue("The container should be visible", element.isVisible()); + } + + /** + * Verify that a double click on an invisible container that belongs to a + * layer that is not activated asks the user to activate it. And that + * activating the layer make the element visible. + */ + public void testShowHideDoubleClickOnUnshownContainer() { + switchLayer("L2"); + SWTBotUtils.waitAllUiEvents(); + + activateShowHideModeUsingTabbar(); + + SWTBotGefEditPart swtBotDNodeEditPart = getEditPart("new EPackage 2", DNodeContainerEditPart.class); + EditPart part = swtBotDNodeEditPart.part(); + DNodeContainerSpec element = (DNodeContainerSpec) ((Node) part.getModel()).getElement(); + assertFalse("The container should not be visible", element.isVisible()); + + swtBotDNodeEditPart.doubleClick(); + + SWTBotShell activeShell = editor.bot().activeShell(); + assertEquals("The dialog to activate the layer has not shown up.", "Filter/layer update confirmation", activeShell.getText()); + activeShell.bot().button("OK").click(); + + assertTrue("The container should be visible", element.isVisible()); + } + + private List<SWTBotGefEditPart> getAvailableCompartmentEditParts() { + TestsUtil.waitUntil(new ICondition() { + + @Override + public boolean test() throws Exception { + List<SWTBotGefEditPart> editParts = getCompartmentEditParts(); + return editParts.size() > 0; + } + + @Override + public String getFailureMessage() { + return "No compartment parts found."; + } + + }); + return getCompartmentEditParts(); + } + + private List<SWTBotGefEditPart> getCompartmentEditParts() { + List<SWTBotGefEditPart> editParts = editor.getSWTBotGefViewer().editParts(new Matcher<EditPart>() { + + @Override + public void describeTo(Description description) { + } + + @Override + public boolean matches(Object item) { + EditPart editPart = (EditPart) item; + return editPart instanceof DNodeContainerViewNodeContainerCompartmentEditPart; + } + + @Override + public void describeMismatch(Object item, Description mismatchDescription) { + } + + @Override + public void _dont_implement_Matcher___instead_extend_BaseMatcher_() { + } + }); + return editParts; + } + + private SWTBotGefEditPart getEditPart(String partName, Class classType) { + TestsUtil.waitUntil(new ICondition() { + + @Override + public boolean test() throws Exception { + try { + editor.getEditPart(partName, classType); + } catch (WidgetNotFoundException e) { + return false; + } + return true; + } + + @Override + public String getFailureMessage() { + return partName + " not found."; + } + }); + SWTBotGefEditPart swtBotDNodeEditPart = editor.getEditPart(partName, classType); + return swtBotDNodeEditPart; + } + + private SWTBotGefEditPart getEditPart(String partName) { + return getEditPart(partName, GraphicalEditPart.class); + } + + private void doubleClickOnEdge(SWTBotGefEditPart swtBotDNodeEditPart) { + Point firstPoint = ((AbstractConnectionEditPart) swtBotDNodeEditPart.part()).getConnectionFigure().getPoints().getCopy().getFirstPoint(); + editor.getCanvas().mouseMoveDoubleClick(firstPoint.x, firstPoint.y); + } +} diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/LayoutingModeTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/LayoutingModeTest.java index 4af4bb225e..efc19b97d8 100644 --- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/LayoutingModeTest.java +++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/LayoutingModeTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2017 THALES GLOBAL SERVICES. + * Copyright (c) 2010, 2018 THALES GLOBAL SERVICES. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -16,58 +16,28 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; import org.eclipse.jface.action.IStatusLineManager; import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.ui.tools.internal.util.EditPartQuery; -import org.eclipse.sirius.tests.swtbot.support.api.AbstractSiriusSwtBotGefTestCase; -import org.eclipse.sirius.tests.swtbot.support.api.business.UIResource; import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusDiagramEditor; import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotUtils; -import org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarToggleButton; import org.eclipse.ui.IEditorSite; import org.eclipse.ui.part.EditorActionBarContributor; import org.junit.Assert; /** * <p> - * Ensures that the Sirius's UI allows to activate/deactivate the Layouting - * Mode, and checks that, when activated, the Diagram's status line is updated. + * Ensures that the Sirius's UI allows to activate/deactivate the Layouting Mode, and checks that, when activated, the + * Diagram's status line is updated. * </p> * * @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a> */ -public class LayoutingModeTest extends AbstractSiriusSwtBotGefTestCase { - - private static final String DATA_UNIT_DIR = "/data/unit/layoutingMode/"; - - private static final String SEMANTIC_MODEL_NAME = "vp2120.ecore"; - - private static final String MODELER_NAME = "vp2120.odesign"; - - private static final String SESSION_FILE_NAME = "vp2120.aird"; - - private static final String REPRESENTATION_DESCRIPTION_NAME = "LayoutingMode Diagram"; - - private static final String REPRESENTATION_INSTANCE_NAME = "new " + REPRESENTATION_DESCRIPTION_NAME; - - @Override - protected void onSetUpBeforeClosingWelcomePage() throws Exception { - copyFileToTestProject(Activator.PLUGIN_ID, DATA_UNIT_DIR, SEMANTIC_MODEL_NAME, SESSION_FILE_NAME, MODELER_NAME); - } - - @Override - protected void onSetUpAfterOpeningDesignerPerspective() throws Exception { - sessionAirdResource = new UIResource(designerProject, "/", SESSION_FILE_NAME); - localSession = designerPerspective.openSessionFromFile(sessionAirdResource); - editor = (SWTBotSiriusDiagramEditor) openRepresentation(localSession.getOpenedSession(), REPRESENTATION_DESCRIPTION_NAME, REPRESENTATION_INSTANCE_NAME, DDiagram.class); - } +public class LayoutingModeTest extends AbstractModeTest { /** * Ensures that : * <ul> - * <li>it is possible to activate/deactivate the LayoutingMode through the - * Tabbar</li> - * <li>when activated, the Layouting mode forbids Drag and Drop operations - * </li> - * <li>when activate, the diagram's status line indicates that Layouting - * mode is on</li> + * <li>it is possible to activate/deactivate the LayoutingMode through the Tabbar</li> + * <li>when activated, the Layouting mode forbids Drag and Drop operations</li> + * <li>when activate, the diagram's status line indicates that Layouting mode is on</li> * </ul> * * @throws Exception @@ -78,17 +48,17 @@ public class LayoutingModeTest extends AbstractSiriusSwtBotGefTestCase { // Step 2 : when clicking on the tabbar icon // layouting mode should be activated - switchLayoutingModeUsingTabbar(); + activateLayoutingModeUsingTabbar(); checkLayoutingModeisInExpectedState(true); // Step 3 : when clicking on the tabbar icon // layouting mode should be disabled - switchLayoutingModeUsingTabbar(); + activateStandardModeUsingTabbar(); checkLayoutingModeisInExpectedState(false); // Step 4 : when activating layouting mode and reopening diagram, // layouting mode should be disabled - switchLayoutingModeUsingTabbar(); + activateLayoutingModeUsingTabbar(); checkLayoutingModeisInExpectedState(true); editor.close(); editor = (SWTBotSiriusDiagramEditor) openRepresentation(localSession.getOpenedSession(), REPRESENTATION_DESCRIPTION_NAME, REPRESENTATION_INSTANCE_NAME, DDiagram.class); @@ -117,8 +87,8 @@ public class LayoutingModeTest extends AbstractSiriusSwtBotGefTestCase { } /** - * Ensures that the editor's status line displays the expected message, - * according to the enablement of the layouting mode. + * Ensures that the editor's status line displays the expected message, according to the enablement of the layouting + * mode. * * @param layoutingModeIsActive * indicates whether layoutingMode should be active or not @@ -145,12 +115,4 @@ public class LayoutingModeTest extends AbstractSiriusSwtBotGefTestCase { assertEquals(layoutingModeIsActive, statusLineMessage.equals("Layouting Mode")); } - /** - * Activates/deactivates the Layouting mode using the tabbar button. - */ - private void switchLayoutingModeUsingTabbar() { - SWTBotToolbarToggleButton switchLayoutingModeButton = editor.bot().toolbarToggleButton(0); - switchLayoutingModeButton.click(); - } - } diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/suite/AllTestSuite.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/suite/AllTestSuite.java index 52fab2825d..9cbbde6710 100644 --- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/suite/AllTestSuite.java +++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/suite/AllTestSuite.java @@ -150,6 +150,7 @@ public class AllTestSuite extends TestCase { suite.addTestSuite(ResetStylePropertiesToDefaultValuesActionTests.class); suite.addTestSuite(MoveBorderNodeTest.class); suite.addTestSuite(LayoutingModeTest.class); + suite.addTestSuite(EditModeTest.class); suite.addTestSuite(LabelSelectionTest.class); suite.addTestSuite(KeyboardDeleteFromDiagramTests.class); suite.addTestSuite(CustomClipboardSupportTest.class); diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tabbar/TabBarTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tabbar/TabBarTest.java index 7ffdff1cbb..66adf27d0f 100644 --- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tabbar/TabBarTest.java +++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tabbar/TabBarTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2017 THALES GLOBAL SERVICES and others. + * Copyright (c) 2010, 2018 THALES GLOBAL SERVICES and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -89,13 +89,12 @@ public class TabBarTest extends AbstractSiriusSwtBotGefTestCase { private static final String FILE_DIR = "/"; - private static final String[] DIAGRAM_TOOLBARDROPDOWNBUTTONS_TOOLTIPS = { "Arrange All", "Select &All", "Layers", "Filters", Messages.PasteFormatAction_toolTipText }; + private static final String[] DIAGRAM_TOOLBARDROPDOWNBUTTONS_TOOLTIPS = { "Arrange All", "Select &All", "Layers", "Filters", Messages.PasteFormatAction_toolTipText, + Messages.DefaultModeAction_statusOn }; private static final String[] DIAGRAM_TOOLBARBUTTONS_TOOLTIPS = { Messages.SiriusDiagramActionBarContributor_refreshDiagram, Messages.SelectHiddenElementsAction_tooltip, Messages.SelectPinnedElementsAction_tooltip, "Zoom In (Ctrl+=)", "Zoom Out (Ctrl+-)", Messages.SaveAsImageFileAction_label }; - private static final String[] DIAGRAM_TOOLBARTOGGLEBUTTONS_TOOLTIPS = { Messages.LayoutingModeSwitchingAction_activate }; - private static final String[] CONTAINER_TOOLBARDROPDOWNBUTTONS_TOOLTIPS = { "Arrange Selection", "Align Left", DistributeAction.getTooltip(DistributeAction.GAPS_HORIZONTALLY), "Straighten to top", "Font Color", "Fill &Color", "Li&ne Color", "Line Style" }; @@ -429,7 +428,7 @@ public class TabBarTest extends AbstractSiriusSwtBotGefTestCase { assertFieldsAreDisposed(item, Predicates.or(privateEnclosingClassAccessor, acceptedNonDisposedField)); } } - + // Check that non primitive or String fields are disposed, ie have a null // value. private void assertFieldsAreDisposed(Object obj, Predicate<Field> skippedFieldPredicate) { @@ -520,13 +519,6 @@ public class TabBarTest extends AbstractSiriusSwtBotGefTestCase { } assertTrue("The toolbarButton with tooltip " + expectedTooltip + " should be enabled", button.isEnabled()); } - for (int i = 0; i < DIAGRAM_TOOLBARTOGGLEBUTTONS_TOOLTIPS.length; i++) { - String expectedTooltip = DIAGRAM_TOOLBARTOGGLEBUTTONS_TOOLTIPS[i]; - SWTBotToolbarToggleButton toggleButton = editor.bot().toolbarToggleButton(i); - assertEquals("The toolbarToggleButton index " + i + " does not have the expected tooltip", DIAGRAM_TOOLBARTOGGLEBUTTONS_TOOLTIPS[i], toggleButton.getToolTipText()); - assertTrue("The toolbarToggleButton with tooltip " + expectedTooltip + " should be enabled", toggleButton.isEnabled()); - - } if (!activeExtensions) { checkButtonNotPresent(TABBAR_EXTENSION_ON_DIAGRAM); diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tabbar/TabbarContributorExtensionTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tabbar/TabbarContributorExtensionTest.java index a5ed6be35f..603d8d5ed4 100644 --- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tabbar/TabbarContributorExtensionTest.java +++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/tabbar/TabbarContributorExtensionTest.java @@ -40,7 +40,8 @@ import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart; import org.eclipse.ui.PlatformUI; /** - * Test case to check the tabbar extension point. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=481573 + * Test case to check the tabbar extension point. See + * https://bugs.eclipse.org/bugs/show_bug.cgi?id=481573 * * @author Florian Barbin */ @@ -80,26 +81,28 @@ public class TabbarContributorExtensionTest extends AbstractSiriusSwtBotGefTestC } /** - * Test that the default tabbar is properly displayed when no contributor is provided. + * Test that the default tabbar is properly displayed when no contributor is + * provided. */ public void testTabbarCountWithoutContributor() { editor = (SWTBotSiriusDiagramEditor) openRepresentation(localSession.getOpenedSession(), REPRESENTATION_NAME, REPRESENTATION_INSTANCE_NAME, DDiagram.class); selectDiagramElement(); SWTBotUtils.waitAllUiEvents(); int count = getTabbarItemsCount(); - assertEquals("Unexpected number of tabbar contribution items", 29, count); + assertEquals("Unexpected number of tabbar contribution items", 31, count); selectDiagram(); SWTBotUtils.waitAllUiEvents(); count = getTabbarItemsCount(); - assertEquals("Unexpected number of tabbar contribution items", 19, count); + assertEquals("Unexpected number of tabbar contribution items", 20, count); selectEdge(); SWTBotUtils.waitAllUiEvents(); count = getTabbarItemsCount(); - assertEquals("Unexpected number of tabbar contribution items", 29, count); + assertEquals("Unexpected number of tabbar contribution items", 31, count); } /** - * Tests that the custom tabbar is properly displayed when it is installed via extension point. + * Tests that the custom tabbar is properly displayed when it is installed + * via extension point. */ public void testCustomTabbarContributor() { registerExtension(); |
