Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2018-06-19 03:55:24 -0400
committerNicolas FAUVERGUE2018-07-03 09:01:49 -0400
commitbe1a108d62ac6f445de31d8b6df9488bf5921dda (patch)
treee382e3295c6ec700e64fd0a69e8f911ea53240a3 /plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse
parent2ce5bbfc0998d939ac28c57193be30d72557f2c7 (diff)
downloadorg.eclipse.papyrus-be1a108d62ac6f445de31d8b6df9488bf5921dda.tar.gz
org.eclipse.papyrus-be1a108d62ac6f445de31d8b6df9488bf5921dda.tar.xz
org.eclipse.papyrus-be1a108d62ac6f445de31d8b6df9488bf5921dda.zip
Bug 536030: [All Diagrams] Incorrect default value for LineWidth
https://bugs.eclipse.org/bugs/show_bug.cgi?id=536030 Change-Id: I6afc16426a359d17b6d0f9b32375bb11db8eecd0 Signed-off-by: Camille Letavernier <cletavernier@eclipsesource.com>
Diffstat (limited to 'plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse')
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ConnectionEditPart.java28
1 files changed, 15 insertions, 13 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 3b44a38176c..a3908a18437 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
@@ -66,21 +66,21 @@ public abstract class ConnectionEditPart extends LinkLFConnectionNodeEditPart im
/**
* CSS property for the source decoration
- *
+ *
* @since 3.1
*/
public static final String SOURCE_DECORATION = "sourceDecoration"; //$NON-NLS-1$
/**
* CSS property for the target decoration
- *
+ *
* @since 3.1
*/
public static final String TARGET_DECORATION = "targetDecoration"; //$NON-NLS-1$
/**
* Supported values of the CSS property targetDecoration
- *
+ *
* @since 3.1
*/
public static final String[] DECORATION_VALUES = { "default", "none" }; //$NON-NLS-1$ //$NON-NLS-2$
@@ -103,7 +103,7 @@ public abstract class ConnectionEditPart extends LinkLFConnectionNodeEditPart im
/**
* The namedStyle Listener. Refresh the edit part when handle a change.
- *
+ *
* @since 3.1
*/
private IChangeListener namedStyleListener = new IChangeListener() {
@@ -149,7 +149,7 @@ public abstract class ConnectionEditPart extends LinkLFConnectionNodeEditPart im
/**
* Refresh the connection arrow decoration.
- *
+ *
* @param connector
* The notation connector
* @param edge
@@ -213,31 +213,32 @@ public abstract class ConnectionEditPart extends LinkLFConnectionNodeEditPart im
* Length of the gap between dashes
*/
private void setupLineStyle(PapyrusEdgeFigure edge, String style, int originalWidth, int lineDashLength, int lineDashGap) {
+ int width = originalWidth < 0 ? 1 : originalWidth;
if ("hidden".equals(style)) {//$NON-NLS-1$
edge.setLineStyle(Graphics.LINE_SOLID);
edge.setLineWidth(0);
edge.setVisible(false);
} else if ("dotted".equals(style)) {//$NON-NLS-1$
edge.setLineStyle(Graphics.LINE_DOT);
- edge.setLineWidth(originalWidth);
+ edge.setLineWidth(width);
} else if ("dashed".equals(style)) {//$NON-NLS-1$
edge.setLineStyle(Graphics.LINE_CUSTOM);
- edge.setLineWidth(originalWidth);
+ edge.setLineWidth(width);
edge.setLineDash(new int[] { lineDashLength, lineDashGap });
} else if ("solid".equals(style)) {//$NON-NLS-1$
edge.setLineStyle(Graphics.LINE_SOLID);
- edge.setLineWidth(originalWidth);
+ edge.setLineWidth(width);
} else if ("double".equals(style)) {//$NON-NLS-1$
- edge.setLineWidth(originalWidth * 2);
+ edge.setLineWidth(width * 2);
} else if ("dash".equals(style)) {//$NON-NLS-1$
edge.setLineStyle(Graphics.LINE_DASH);
- edge.setLineWidth(originalWidth);
+ edge.setLineWidth(width);
}
}
/**
* Refresh the diagram when changing the label filters (Bug 491811: [CSS][Diagram] Connectors not refreshed after change of routing style (eg rectilinear->oblique))
- *
+ *
* @since 2.0
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart#handleNotificationEvent(org.eclipse.emf.common.notify.Notification)
*
@@ -265,7 +266,7 @@ public abstract class ConnectionEditPart extends LinkLFConnectionNodeEditPart im
/**
* Gets the connection decoration in {@link ConnectionDecorationRegistry} for a String.
- *
+ *
* @param arrowType
* the arrow type
* @return the {@link RotatableDecoration} use as connection decoration (null if not found)
@@ -333,7 +334,7 @@ public abstract class ConnectionEditPart extends LinkLFConnectionNodeEditPart im
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart#refreshVisuals()
*/
@Override
@@ -342,4 +343,5 @@ public abstract class ConnectionEditPart extends LinkLFConnectionNodeEditPart im
refreshLineWidth();
installRouter();
}
+
}

Back to the top