Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src/org/eclipse/papyrus/uml/diagram/communication/edit/parts/InteractionEditPart.java')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src/org/eclipse/papyrus/uml/diagram/communication/edit/parts/InteractionEditPart.java709
1 files changed, 353 insertions, 356 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src/org/eclipse/papyrus/uml/diagram/communication/edit/parts/InteractionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src/org/eclipse/papyrus/uml/diagram/communication/edit/parts/InteractionEditPart.java
index 6a6c1305105..fdf4cf31bd9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src/org/eclipse/papyrus/uml/diagram/communication/edit/parts/InteractionEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src/org/eclipse/papyrus/uml/diagram/communication/edit/parts/InteractionEditPart.java
@@ -1,356 +1,353 @@
-/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.BasicCompartment;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.GetChildLayoutEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.RoundedRectangleNodePlateFigure;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.SelectableBorderedNodeFigure;
-import org.eclipse.papyrus.uml.diagram.common.editparts.AbstractInteractionEditPart;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideCompartmentEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.locator.RoundedRectangleLabelPositionLocator;
-import org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.CommunicationGraphicalNodeEditPolicy;
-import org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.CustomDiagramDragDropEditPolicy;
-import org.eclipse.papyrus.uml.diagram.communication.custom.figures.InteractionRectangleFigure;
-import org.eclipse.papyrus.uml.diagram.communication.edit.policies.InteractionItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class InteractionEditPart extends AbstractInteractionEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 8002;
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public InteractionEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new InteractionItemSemanticEditPolicy());
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CommunicationGraphicalNodeEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
- installEditPolicy(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY, new ShowHideCompartmentEditPolicy());
- installEditPolicy(EditPolicy.LAYOUT_ROLE, new GetChildLayoutEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- @Override
- protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View) child.getModel();
- switch (UMLVisualIDRegistry.getVisualID(childView)) {
- case InteractionFloatingLabelEditPart.VISUAL_ID:
- return new BorderItemSelectionEditPolicy() {
-
- @Override
- protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
- mh.setBorder(null);
- return Collections.singletonList(mh);
- }
- }
- ;
- }
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- @Override
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- @Override
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- * Papyrus codeGen
- *
- * @generated
- **/
- @Override
- protected void handleNotificationEvent(Notification event) {
- /*
- * when a node have external node labels, the methods refreshChildren() remove the EditPart corresponding to the Label from the EditPart
- * Registry. After that, we can't reset the visibility to true (using the Show/Hide Label Action)!
- */
- if (NotationPackage.eINSTANCE.getView_Visible().equals(event.getFeature())) {
- Object notifier = event.getNotifier();
- List<?> modelChildren = ((View) getModel()).getChildren();
- if (false == notifier instanceof Edge
- && false == notifier instanceof BasicCompartment) {
- if (modelChildren.contains(event.getNotifier())) {
- return;
- }
- }
- }
- super.handleNotificationEvent(event);
-
- }
-
- /**
- * @generated
- */
- @Override
- protected IFigure createNodeShape() {
- return primaryShape = new InteractionRectangleFigure();
- }
-
- /**
- * org.eclipse.papyrus.uml.diagram.communication.custom.figures.InteractionRectangleFigure
- *
- * @generated
- */
- @Override
- public InteractionRectangleFigure getPrimaryShape() {
- return (InteractionRectangleFigure) primaryShape;
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if (childEditPart instanceof InteractionNameEditPart) {
- ((InteractionNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
- return true;
- }
-
-
- if (childEditPart instanceof InteractionCompartmentEditPart) {
- IFigure pane = getPrimaryShape().getCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((InteractionCompartmentEditPart) childEditPart).getFigure());
- return true;
- }
-
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if (childEditPart instanceof InteractionNameEditPart) {
- return true;
- }
- if (childEditPart instanceof InteractionCompartmentEditPart) {
- IFigure pane = getPrimaryShape().getCompartmentFigure();
- pane.remove(((InteractionCompartmentEditPart) childEditPart).getFigure());
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- @Override
- protected void addChildVisual(EditPart childEditPart, int index) {
- if (addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
- /**
- * @generated
- */
- @Override
- protected void removeChildVisual(EditPart childEditPart) {
- if (removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- /**
- * @generated
- */
- @Override
- protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if (editPart instanceof InteractionCompartmentEditPart) {
- return getPrimaryShape().getCompartmentFigure();
- }
- if (editPart instanceof IBorderItemEditPart) {
- return getBorderedFigure().getBorderItemContainer();
- }
- return getContentPane();
- }
-
- /**
- * @generated
- */
- @Override
- protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if (borderItemEditPart instanceof InteractionFloatingLabelEditPart) {
- IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
- borderItemContainer.add(borderItemEditPart.getFigure(), locator);
- } else
- {
- super.addBorderItem(borderItemContainer, borderItemEditPart);
- }
- }
-
- /**
- * @generated
- */
- @Override
- protected NodeFigure createNodePlate() {
- RoundedRectangleNodePlateFigure result = new RoundedRectangleNodePlateFigure(857, 757);
- return result;
- }
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- @Override
- protected NodeFigure createMainFigure() {
- return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
-
- }
-
- /**
- * Default implementation treats passed figure as content pane.
- * Respects layout one may have set for generated figure.
- *
- * @param nodeShape
- * instance of generated figure class
- * @generated
- */
- @Override
- protected IFigure setupContentPane(IFigure nodeShape) {
- if (nodeShape.getLayoutManager() == null) {
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(5);
- nodeShape.setLayoutManager(layout);
- }
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- @Override
- public IFigure getContentPane() {
- if (contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- @Override
- protected void setForegroundColor(Color color) {
- if (primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- @Override
- protected void setLineWidth(int width) {
- super.setLineWidth(width);
- }
-
- /**
- * @generated
- */
- @Override
- protected void setLineType(int style) {
- if (primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- @Override
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(UMLVisualIDRegistry.getType(InteractionNameEditPart.VISUAL_ID));
- }
-}
+/**
+ * Copyright (c) 2014 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ */
+package org.eclipse.papyrus.uml.diagram.communication.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.BasicCompartment;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultGraphicalNodeEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.GetChildLayoutEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure;
+import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.RoundedRectangleNodePlateFigure;
+import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.SelectableBorderedNodeFigure;
+import org.eclipse.papyrus.uml.diagram.common.editparts.AbstractInteractionEditPart;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideCompartmentEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.locator.RoundedRectangleLabelPositionLocator;
+import org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.CommunicationGraphicalNodeEditPolicy;
+import org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.CustomDiagramDragDropEditPolicy;
+import org.eclipse.papyrus.uml.diagram.communication.custom.figures.InteractionRectangleFigure;
+import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * @generated
+ */
+public class InteractionEditPart extends AbstractInteractionEditPart {
+
+ /**
+ * @generated
+ */
+ public static final String VISUAL_ID = "8002";
+
+ /**
+ * @generated
+ */
+ protected IFigure contentPane;
+
+ /**
+ * @generated
+ */
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
+ public InteractionEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+ installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
+ installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CommunicationGraphicalNodeEditPolicy());
+ installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
+ installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
+ installEditPolicy(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY, new ShowHideCompartmentEditPolicy());
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, new GetChildLayoutEditPolicy());
+ // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
+ // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
+ }
+
+ /**
+ * @generated
+ */
+ protected LayoutEditPolicy createLayoutEditPolicy() {
+ org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
+
+ @Override
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ View childView = (View)child.getModel();
+ String vid = UMLVisualIDRegistry.getVisualID(childView);
+ if(vid != null) {
+ switch(vid) {
+ case InteractionFloatingLabelEditPart.VISUAL_ID:
+ return new BorderItemSelectionEditPolicy() {
+
+ @Override
+ protected List<?> createSelectionHandles() {
+ MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ mh.setBorder(null);
+ return Collections.singletonList(mh);
+ }
+ };
+ }
+ }
+ EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(result == null) {
+ result = new NonResizableEditPolicy();
+ }
+ return result;
+ }
+
+ @Override
+ protected Command getMoveChildrenCommand(Request request) {
+ return null;
+ }
+
+ @Override
+ protected Command getCreateCommand(CreateRequest request) {
+ return null;
+ }
+ };
+ return lep;
+ }
+
+ /**
+ * Papyrus codeGen
+ *
+ * @generated
+ **/
+ @Override
+ protected void handleNotificationEvent(Notification event) {
+ /*
+ * when a node have external node labels, the methods refreshChildren() remove the EditPart corresponding to the Label from the EditPart
+ * Registry. After that, we can't reset the visibility to true (using the Show/Hide Label Action)!
+ */
+ if(NotationPackage.eINSTANCE.getView_Visible().equals(event.getFeature())) {
+ Object notifier = event.getNotifier();
+ List<?> modelChildren = ((View)getModel()).getChildren();
+ if(false == notifier instanceof Edge && false == notifier instanceof BasicCompartment) {
+ if(modelChildren.contains(event.getNotifier())) {
+ return;
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ protected IFigure createNodeShape() {
+ return primaryShape = new InteractionRectangleFigure();
+ }
+
+ /**
+ * org.eclipse.papyrus.uml.diagram.communication.custom.figures.InteractionRectangleFigure
+ *
+ * @generated
+ */
+ @Override
+ public InteractionRectangleFigure getPrimaryShape() {
+ return (InteractionRectangleFigure)primaryShape;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean addFixedChild(EditPart childEditPart) {
+ if(childEditPart instanceof InteractionNameEditPart) {
+ ((InteractionNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ return true;
+ }
+ if(childEditPart instanceof InteractionCompartmentEditPart) {
+ IFigure pane = getPrimaryShape().getCompartmentFigure();
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((InteractionCompartmentEditPart)childEditPart).getFigure());
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean removeFixedChild(EditPart childEditPart) {
+ if(childEditPart instanceof InteractionNameEditPart) {
+ return true;
+ }
+ if(childEditPart instanceof InteractionCompartmentEditPart) {
+ IFigure pane = getPrimaryShape().getCompartmentFigure();
+ pane.remove(((InteractionCompartmentEditPart)childEditPart).getFigure());
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ protected void addChildVisual(EditPart childEditPart, int index) {
+ if(addFixedChild(childEditPart)) {
+ return;
+ }
+ super.addChildVisual(childEditPart, -1);
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ protected void removeChildVisual(EditPart childEditPart) {
+ if(removeFixedChild(childEditPart)) {
+ return;
+ }
+ super.removeChildVisual(childEditPart);
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
+ if(editPart instanceof InteractionCompartmentEditPart) {
+ return getPrimaryShape().getCompartmentFigure();
+ }
+ if(editPart instanceof IBorderItemEditPart) {
+ return getBorderedFigure().getBorderItemContainer();
+ }
+ return getContentPane();
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
+ if(borderItemEditPart instanceof InteractionFloatingLabelEditPart) {
+ IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
+ borderItemContainer.add(borderItemEditPart.getFigure(), locator);
+ } else {
+ super.addBorderItem(borderItemContainer, borderItemEditPart);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ protected NodeFigure createNodePlate() {
+ RoundedRectangleNodePlateFigure result = new RoundedRectangleNodePlateFigure(857, 757);
+ return result;
+ }
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+ @Override
+ protected NodeFigure createMainFigure() {
+ return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+ }
+
+ /**
+ * Default implementation treats passed figure as content pane.
+ * Respects layout one may have set for generated figure.
+ *
+ * @param nodeShape
+ * instance of generated figure class
+ * @generated
+ */
+ @Override
+ protected IFigure setupContentPane(IFigure nodeShape) {
+ if(nodeShape.getLayoutManager() == null) {
+ ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
+ layout.setSpacing(5);
+ nodeShape.setLayoutManager(layout);
+ }
+ return nodeShape; // use nodeShape itself as contentPane
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public IFigure getContentPane() {
+ if(contentPane != null) {
+ return contentPane;
+ }
+ return super.getContentPane();
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ protected void setForegroundColor(Color color) {
+ if(primaryShape != null) {
+ primaryShape.setForegroundColor(color);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ protected void setLineWidth(int width) {
+ super.setLineWidth(width);
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ protected void setLineType(int style) {
+ if(primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public EditPart getPrimaryChildEditPart() {
+ return getChildBySemanticHint(UMLVisualIDRegistry.getType(InteractionNameEditPart.VISUAL_ID));
+ }
+}

Back to the top