Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInSendObjActAsReqEditPart.java')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInSendObjActAsReqEditPart.java67
1 files changed, 31 insertions, 36 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInSendObjActAsReqEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInSendObjActAsReqEditPart.java
index dce1bd7a9b5..901cca281db 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInSendObjActAsReqEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInSendObjActAsReqEditPart.java
@@ -57,7 +57,7 @@ public class ValuePinInSendObjActAsReqEditPart extends AbstractPinEditPart {
/**
* @generated
*/
- public static final int VISUAL_ID = 3046;
+ public static final String VISUAL_ID = "3046";
/**
* @generated
@@ -84,12 +84,9 @@ public class ValuePinInSendObjActAsReqEditPart extends AbstractPinEditPart {
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());
// 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);
@@ -106,18 +103,16 @@ public class ValuePinInSendObjActAsReqEditPart extends AbstractPinEditPart {
* 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);
-
}
/**
@@ -128,23 +123,26 @@ public class ValuePinInSendObjActAsReqEditPart extends AbstractPinEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View) child.getModel();
- switch (UMLVisualIDRegistry.getVisualID(childView)) {
- case ValuePinInSendObjActAsReqLabelEditPart.VISUAL_ID:
- case ValuePinInSendObjActAsReqValueEditPart.VISUAL_ID:
- case ValuePinInSendObjActAsReqAppliedStereotypeEditPart.VISUAL_ID:
- return new BorderItemSelectionEditPolicy() {
+ View childView = (View)child.getModel();
+ String vid = UMLVisualIDRegistry.getVisualID(childView);
+ if(vid != null) {
+ switch(vid) {
+ case ValuePinInSendObjActAsReqLabelEditPart.VISUAL_ID:
+ case ValuePinInSendObjActAsReqValueEditPart.VISUAL_ID:
+ case ValuePinInSendObjActAsReqAppliedStereotypeEditPart.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;
@@ -175,7 +173,7 @@ public class ValuePinInSendObjActAsReqEditPart extends AbstractPinEditPart {
*/
@Override
public PinFigure getPrimaryShape() {
- return (PinFigure) primaryShape;
+ return (PinFigure)primaryShape;
}
/**
@@ -183,15 +181,13 @@ public class ValuePinInSendObjActAsReqEditPart extends AbstractPinEditPart {
*/
@Override
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if (borderItemEditPart instanceof ValuePinInSendObjActAsReqLabelEditPart) {
+ if(borderItemEditPart instanceof ValuePinInSendObjActAsReqLabelEditPart) {
IBorderItemLocator locator = new ExternalLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
- } else
- if (borderItemEditPart instanceof ValuePinInSendObjActAsReqValueEditPart) {
+ } else if(borderItemEditPart instanceof ValuePinInSendObjActAsReqValueEditPart) {
IBorderItemLocator locator = new ExternalLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
- } else
- if (borderItemEditPart instanceof ValuePinInSendObjActAsReqAppliedStereotypeEditPart) {
+ } else if(borderItemEditPart instanceof ValuePinInSendObjActAsReqAppliedStereotypeEditPart) {
IBorderItemLocator locator = new ExternalLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -223,7 +219,6 @@ public class ValuePinInSendObjActAsReqEditPart extends AbstractPinEditPart {
figure.add(shape);
contentPane = setupContentPane(shape);
return figure;
-
}
/**
@@ -243,7 +238,7 @@ public class ValuePinInSendObjActAsReqEditPart extends AbstractPinEditPart {
*/
@Override
public IFigure getContentPane() {
- if (contentPane != null) {
+ if(contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -254,7 +249,7 @@ public class ValuePinInSendObjActAsReqEditPart extends AbstractPinEditPart {
*/
@Override
protected void setForegroundColor(Color color) {
- if (primaryShape != null) {
+ if(primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -272,8 +267,8 @@ public class ValuePinInSendObjActAsReqEditPart extends AbstractPinEditPart {
*/
@Override
protected void setLineType(int style) {
- if (primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
+ if(primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
}
}

Back to the top