diff options
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInCreateLinkObjectActionEditPart.java')
-rw-r--r-- | plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInCreateLinkObjectActionEditPart.java | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInCreateLinkObjectActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInCreateLinkObjectActionEditPart.java index cfa720851bb..c1a03181672 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInCreateLinkObjectActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInCreateLinkObjectActionEditPart.java @@ -46,7 +46,7 @@ public class OutputPinInCreateLinkObjectActionEditPart extends AbstractPinEditPa /** * @generated */ - public static final int VISUAL_ID = 3202; + public static final String VISUAL_ID = "3202"; /** * @generated @@ -72,12 +72,9 @@ public class OutputPinInCreateLinkObjectActionEditPart extends AbstractPinEditPa super.createDefaultEditPolicies(); installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, getPrimaryDragEditPolicy()); installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy()); - installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); - installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); + installEditPolicy(EditPolicyRoles.OPEN_ROLE, new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies @@ -92,22 +89,25 @@ public class OutputPinInCreateLinkObjectActionEditPart extends AbstractPinEditPa @Override protected EditPolicy createChildEditPolicy(EditPart child) { - View childView = (View) child.getModel(); - switch (UMLVisualIDRegistry.getVisualID(childView)) { - case OutputPinInCreateLinkObjectActionLabelEditPart.VISUAL_ID: - case OutputPinInCreateLinkObjectActionAppliedStereotypeLabelEditPart.VISUAL_ID: - return new BorderItemSelectionEditPolicy() { + View childView = (View)child.getModel(); + String vid = UMLVisualIDRegistry.getVisualID(childView); + if(vid != null) { + switch(vid) { + case OutputPinInCreateLinkObjectActionLabelEditPart.VISUAL_ID: + case OutputPinInCreateLinkObjectActionAppliedStereotypeLabelEditPart.VISUAL_ID: + return new BorderItemSelectionEditPolicy() { - @Override - protected List<?> createSelectionHandles() { - MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost()); - mh.setBorder(null); - return Collections.singletonList(mh); - } - }; + @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) { + if(result == null) { result = new NonResizableEditPolicy(); } return result; @@ -127,26 +127,25 @@ public class OutputPinInCreateLinkObjectActionEditPart extends AbstractPinEditPa } /** - *Papyrus codeGen - *@generated - **/ + * Papyrus codeGen + * + * @generated + **/ 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())) { + 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())) { + List<?> modelChildren = ((View)getModel()).getChildren(); + if(false == notifier instanceof Edge && false == notifier instanceof BasicCompartment) { + if(modelChildren.contains(event.getNotifier())) { return; } } } super.handleNotificationEvent(event); - } /** @@ -158,21 +157,21 @@ public class OutputPinInCreateLinkObjectActionEditPart extends AbstractPinEditPa /** * org.eclipse.papyrus.uml.diagram.activity.figures.OutputPinFigure + * * @generated */ public OutputPinFigure getPrimaryShape() { - return (OutputPinFigure) primaryShape; + return (OutputPinFigure)primaryShape; } /** * @generated */ protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) { - if (borderItemEditPart instanceof OutputPinInCreateLinkObjectActionLabelEditPart) { + if(borderItemEditPart instanceof OutputPinInCreateLinkObjectActionLabelEditPart) { IBorderItemLocator locator = new ExternalLabelPositionLocator(getMainFigure()); borderItemContainer.add(borderItemEditPart.getFigure(), locator); - } else - if (borderItemEditPart instanceof OutputPinInCreateLinkObjectActionAppliedStereotypeLabelEditPart) { + } else if(borderItemEditPart instanceof OutputPinInCreateLinkObjectActionAppliedStereotypeLabelEditPart) { IBorderItemLocator locator = new ExternalLabelPositionLocator(getMainFigure()); borderItemContainer.add(borderItemEditPart.getFigure(), locator); } else { @@ -203,13 +202,14 @@ public class OutputPinInCreateLinkObjectActionEditPart extends AbstractPinEditPa figure.add(shape); contentPane = setupContentPane(shape); return 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 + * + * @param nodeShape + * instance of generated figure class * @generated */ protected IFigure setupContentPane(IFigure nodeShape) { @@ -220,7 +220,7 @@ public class OutputPinInCreateLinkObjectActionEditPart extends AbstractPinEditPa * @generated */ public IFigure getContentPane() { - if (contentPane != null) { + if(contentPane != null) { return contentPane; } return super.getContentPane(); @@ -230,7 +230,7 @@ public class OutputPinInCreateLinkObjectActionEditPart extends AbstractPinEditPa * @generated */ protected void setForegroundColor(Color color) { - if (primaryShape != null) { + if(primaryShape != null) { primaryShape.setForegroundColor(color); } } @@ -246,8 +246,8 @@ public class OutputPinInCreateLinkObjectActionEditPart extends AbstractPinEditPa * @generated */ protected void setLineType(int style) { - if (primaryShape instanceof IPapyrusNodeFigure) { - ((IPapyrusNodeFigure) primaryShape).setLineStyle(style); + if(primaryShape instanceof IPapyrusNodeFigure) { + ((IPapyrusNodeFigure)primaryShape).setLineStyle(style); } } |