Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ConnectionEditPart.java19
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/uml/diagram/common/edit/part/ConnectorEditPart.java17
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/UMLConnectionNodeEditPart.java11
3 files changed, 40 insertions, 7 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ConnectionEditPart.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ConnectionEditPart.java
index 2db9f103e16..591336c70cb 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ConnectionEditPart.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ConnectionEditPart.java
@@ -13,6 +13,7 @@ package org.eclipse.papyrus.infra.gmfdiag.common.editpart;
import org.eclipse.gef.EditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.PapyrusConnectionEndEditPolicy;
@@ -37,4 +38,22 @@ public abstract class ConnectionEditPart extends ConnectionNodeEditPart implemen
installEditPolicy(EditPolicy.CONNECTION_ENDPOINTS_ROLE, new PapyrusConnectionEndEditPolicy());
}
+ @Override
+ protected void setLineWidth(int width) {
+ if(width < 0) {
+ width = 1;
+ }
+
+ if(getFigure() instanceof PolylineConnectionEx) {
+ PolylineConnectionEx conn = (PolylineConnectionEx)getFigure();
+ conn.setLineWidth(getMapMode().DPtoLP(width));
+ }
+ }
+
+ @Override
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLineWidth();
+ }
+
}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/uml/diagram/common/edit/part/ConnectorEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/uml/diagram/common/edit/part/ConnectorEditPart.java
index 78884083e9f..90763608a57 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/uml/diagram/common/edit/part/ConnectorEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/uml/diagram/common/edit/part/ConnectorEditPart.java
@@ -19,10 +19,7 @@ import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy;
import org.eclipse.papyrus.sysml.blocks.BindingConnector;
-import org.eclipse.papyrus.sysml.blocks.BlocksPackage;
import org.eclipse.papyrus.uml.diagram.common.figure.ConnectorEdgeFigure;
-import org.eclipse.papyrus.uml.tools.utils.UMLUtil;
-import org.eclipse.uml2.uml.Connector;
import org.eclipse.uml2.uml.Element;
public class ConnectorEditPart extends AbstractElementLinkEditPart {
@@ -85,6 +82,7 @@ public class ConnectorEditPart extends AbstractElementLinkEditPart {
/**
* Creates figure for this edit part.
*/
+ @Override
protected Connection createConnectionFigure() {
return new ConnectorEdgeFigure();
}
@@ -92,17 +90,22 @@ public class ConnectorEditPart extends AbstractElementLinkEditPart {
/**
* Creates primary shape for this edit part.
*/
+ @Override
public ConnectorEdgeFigure getPrimaryShape() {
return (ConnectorEdgeFigure)getFigure();
}
@Override
protected void refreshLineWidth() {
- if (org.eclipse.uml2.uml.util.UMLUtil.getStereotypeApplication((Element)resolveSemanticElement(), BindingConnector.class) != null) {
- setLineWidth(2);
+ int width = getLineWidth();
+ if(width < 1) {
+ width = 1;
}
- else {
- setLineWidth(1);
+
+ if(org.eclipse.uml2.uml.util.UMLUtil.getStereotypeApplication((Element)resolveSemanticElement(), BindingConnector.class) != null) {
+ setLineWidth(width * 2);
+ } else {
+ setLineWidth(width);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/UMLConnectionNodeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/UMLConnectionNodeEditPart.java
index db0db81e772..b85fe5f0f3d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/UMLConnectionNodeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/UMLConnectionNodeEditPart.java
@@ -309,4 +309,15 @@ public abstract class UMLConnectionNodeEditPart extends ConnectionEditPart imple
return out;
}
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void setLineWidth(int width) {
+ if(width < 0) {
+ width = 1;
+ }
+ getPrimaryShape().setLineWidth(width);
+ }
+
}

Back to the top