Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/NodeEditPart.java')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/NodeEditPart.java51
1 files changed, 30 insertions, 21 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/NodeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/NodeEditPart.java
index 9b8f3765ddd..79bf6263923 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/NodeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/NodeEditPart.java
@@ -51,7 +51,7 @@ public class NodeEditPart extends NamedElementEditPart {
/**
* @generated
*/
- public static final String VISUAL_ID = "2008";
+ public static final String VISUAL_ID = "Node_Shape";
/**
* @generated
@@ -77,13 +77,18 @@ public class NodeEditPart extends NamedElementEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy("REMOVE_ORPHAN_VIEW", new RemoveOrphanViewPolicy()); //$NON-NLS-1$
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
- installEditPolicy(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY, new ShowHideCompartmentEditPolicy());
- installEditPolicy(ShowHideClassifierContentsEditPolicy.SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY, new ShowHideClassifierContentsEditPolicy());
+ installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY,
+ new AppliedStereotypeNodeLabelDisplayEditPolicy());
+ installEditPolicy(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY,
+ new ShowHideCompartmentEditPolicy());
+ installEditPolicy(ShowHideClassifierContentsEditPolicy.SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY,
+ new ShowHideClassifierContentsEditPolicy());
installEditPolicy("RESIZE_BORDER_ITEMS", new ConstrainedItemBorderLayoutEditPolicy()); //$NON-NLS-1$
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CustomGraphicalNodeEditPolicy());
@@ -100,7 +105,7 @@ public class NodeEditPart extends NamedElementEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -127,6 +132,7 @@ public class NodeEditPart extends NamedElementEditPart {
@Override
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
+
}
/**
@@ -144,23 +150,25 @@ public class NodeEditPart extends NamedElementEditPart {
*/
@Override
public NodeFigure getPrimaryShape() {
- return (NodeFigure)primaryShape;
+ return (NodeFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof NodeNameEditPart) {
- ((NodeNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof NodeNameEditPart) {
+ ((NodeNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof NodeCompositeCompartmentEditPart) {
+
+ if (childEditPart instanceof NodeCompositeCompartmentEditPart) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((NodeCompositeCompartmentEditPart)childEditPart).getFigure());
+ pane.add(((NodeCompositeCompartmentEditPart) childEditPart).getFigure());
return true;
}
+
return false;
}
@@ -168,12 +176,12 @@ public class NodeEditPart extends NamedElementEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof NodeNameEditPart) {
+ if (childEditPart instanceof NodeNameEditPart) {
return true;
}
- if(childEditPart instanceof NodeCompositeCompartmentEditPart) {
+ if (childEditPart instanceof NodeCompositeCompartmentEditPart) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- pane.remove(((NodeCompositeCompartmentEditPart)childEditPart).getFigure());
+ pane.remove(((NodeCompositeCompartmentEditPart) childEditPart).getFigure());
return true;
}
return false;
@@ -184,7 +192,7 @@ public class NodeEditPart extends NamedElementEditPart {
*/
@Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -195,7 +203,7 @@ public class NodeEditPart extends NamedElementEditPart {
*/
@Override
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -206,7 +214,7 @@ public class NodeEditPart extends NamedElementEditPart {
*/
@Override
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof NodeCompositeCompartmentEditPart) {
+ if (editPart instanceof NodeCompositeCompartmentEditPart) {
return getPrimaryShape().getCompositeCompartmentFigure();
}
return getContentPane();
@@ -232,6 +240,7 @@ public class NodeEditPart extends NamedElementEditPart {
@Override
protected org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure createNodeFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
@@ -244,7 +253,7 @@ public class NodeEditPart extends NamedElementEditPart {
*/
@Override
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -257,7 +266,7 @@ public class NodeEditPart extends NamedElementEditPart {
*/
@Override
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -268,7 +277,7 @@ public class NodeEditPart extends NamedElementEditPart {
*/
@Override
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -286,8 +295,8 @@ public class NodeEditPart extends NamedElementEditPart {
*/
@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