diff options
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DeviceCompositeCompartmentEditPartCN.java')
-rw-r--r-- | plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DeviceCompositeCompartmentEditPartCN.java | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DeviceCompositeCompartmentEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DeviceCompositeCompartmentEditPartCN.java index c574021eda6..f323b2c2da3 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DeviceCompositeCompartmentEditPartCN.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/DeviceCompositeCompartmentEditPartCN.java @@ -41,7 +41,7 @@ public class DeviceCompositeCompartmentEditPartCN extends LinkLFShapeCompartment /** * @generated */ - public static final String VISUAL_ID = "30"; + public static final String VISUAL_ID = "Device_NestedNodeCompartment_CN"; /** * @generated @@ -71,6 +71,7 @@ public class DeviceCompositeCompartmentEditPartCN extends LinkLFShapeCompartment installEditPolicy(PasteEditPolicy.PASTE_ROLE, new PasteEditPolicy()); //in Papyrus diagrams are not strongly synchronised //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.deployment.edit.policies.DeviceCompositeCompartmentCanonicalEditPolicyCN()); + installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CustomContainerEditPolicy()); installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy()); } @@ -80,7 +81,7 @@ public class DeviceCompositeCompartmentEditPartCN extends LinkLFShapeCompartment */ @Override protected void setRatio(Double ratio) { - if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) { + if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) { super.setRatio(ratio); } } @@ -90,6 +91,7 @@ public class DeviceCompositeCompartmentEditPartCN extends LinkLFShapeCompartment */ @Override public EditPart getTargetEditPart(Request request) { + return super.getTargetEditPart(request); } @@ -99,7 +101,10 @@ public class DeviceCompositeCompartmentEditPartCN extends LinkLFShapeCompartment @Override protected void handleNotificationEvent(Notification notification) { Object feature = notification.getFeature(); - if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) { + if (NotationPackage.eINSTANCE.getSize_Width().equals(feature) + || NotationPackage.eINSTANCE.getSize_Height().equals(feature) + || NotationPackage.eINSTANCE.getLocation_X().equals(feature) + || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) { refreshBounds(); } super.handleNotificationEvent(notification); @@ -109,13 +114,13 @@ public class DeviceCompositeCompartmentEditPartCN extends LinkLFShapeCompartment * @generated */ protected void refreshBounds() { - int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue(); - int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue(); + int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue(); + int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue(); Dimension size = new Dimension(width, height); - int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue(); - int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue(); + int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue(); + int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue(); Point loc = new Point(x, y); - ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size)); + ((GraphicalEditPart) getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size)); } /** |