Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentEditPart.java')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentEditPart.java70
1 files changed, 23 insertions, 47 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentEditPart.java
index 55c99314009..146d28169a3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentEditPart.java
@@ -1,11 +1,11 @@
/**
* 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
*/
@@ -25,6 +25,8 @@ import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
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.PapyrusReflowableShapeEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure;
import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.RoundedRectangleNodePlateFigure;
@@ -33,7 +35,6 @@ import org.eclipse.papyrus.uml.diagram.common.editparts.AbstractCommentEditPart;
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.figure.node.HTMLCornerBentFigure;
-import org.eclipse.papyrus.uml.diagram.composite.edit.policies.CommentItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.composite.part.UMLVisualIDRegistry;
import org.eclipse.swt.graphics.Color;
@@ -67,10 +68,10 @@ public class CommentEditPart extends AbstractCommentEditPart {
/**
* @generated
*/
- @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CommentItemSemanticEditPolicy());
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+ installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PapyrusReflowableShapeEditPolicy());
@@ -87,7 +88,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
@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;
@@ -107,44 +108,36 @@ public class CommentEditPart extends AbstractCommentEditPart {
}
/**
- * Papyrus codeGen
- *
- * @generated
+ *Papyrus codeGen
+ *@generated
**/
- @Override
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
-
}
/**
* @generated
*/
- @Override
protected IFigure createNodeShape() {
return primaryShape = new HTMLCornerBentFigure();
}
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.HTMLCornerBentFigure
- *
* @generated
*/
- @Override
public HTMLCornerBentFigure getPrimaryShape() {
- return (HTMLCornerBentFigure) primaryShape;
+ return (HTMLCornerBentFigure)primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if (childEditPart instanceof CommentBodyEditPart) {
- ((CommentBodyEditPart) childEditPart).setLabel(getPrimaryShape().getCornerBentFigure());
+ if(childEditPart instanceof CommentBodyEditPart) {
+ ((CommentBodyEditPart)childEditPart).setLabel(getPrimaryShape().getCornerBentFigure());
return true;
}
-
-
return false;
}
@@ -152,7 +145,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if (childEditPart instanceof CommentBodyEditPart) {
+ if(childEditPart instanceof CommentBodyEditPart) {
return true;
}
return false;
@@ -161,9 +154,8 @@ public class CommentEditPart extends AbstractCommentEditPart {
/**
* @generated
*/
- @Override
protected void addChildVisual(EditPart childEditPart, int index) {
- if (addFixedChild(childEditPart)) {
+ if(addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -172,9 +164,8 @@ public class CommentEditPart extends AbstractCommentEditPart {
/**
* @generated
*/
- @Override
protected void removeChildVisual(EditPart childEditPart) {
- if (removeFixedChild(childEditPart)) {
+ if(removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -183,15 +174,10 @@ public class CommentEditPart extends AbstractCommentEditPart {
/**
* @generated
*/
- @Override
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
return getContentPane();
}
- /**
- * @generated
- */
- @Override
protected NodeFigure createNodePlate() {
RoundedRectangleNodePlateFigure result = new RoundedRectangleNodePlateFigure(40, 40);
return result;
@@ -199,29 +185,24 @@ public class CommentEditPart extends AbstractCommentEditPart {
/**
* 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 createNodeFigure() {
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
+ * @param nodeShape instance of generated figure class
* @generated
*/
- @Override
protected IFigure setupContentPane(IFigure nodeShape) {
- if (nodeShape.getLayoutManager() == null) {
+ if(nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -232,9 +213,8 @@ public class CommentEditPart extends AbstractCommentEditPart {
/**
* @generated
*/
- @Override
public IFigure getContentPane() {
- if (contentPane != null) {
+ if(contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -243,9 +223,8 @@ public class CommentEditPart extends AbstractCommentEditPart {
/**
* @generated
*/
- @Override
protected void setForegroundColor(Color color) {
- if (primaryShape != null) {
+ if(primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -253,7 +232,6 @@ public class CommentEditPart extends AbstractCommentEditPart {
/**
* @generated
*/
- @Override
protected void setLineWidth(int width) {
super.setLineWidth(width);
}
@@ -261,17 +239,15 @@ public class CommentEditPart extends AbstractCommentEditPart {
/**
* @generated
*/
- @Override
protected void setLineType(int style) {
- if (primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
+ if(primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
}
}
/**
* @generated
*/
- @Override
public EditPart getPrimaryChildEditPart() {
return getChildBySemanticHint(UMLVisualIDRegistry.getType(CommentBodyEditPart.VISUAL_ID));
}

Back to the top