Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2018-06-19 07:55:24 +0000
committerNicolas FAUVERGUE2018-07-03 13:01:49 +0000
commitbe1a108d62ac6f445de31d8b6df9488bf5921dda (patch)
treee382e3295c6ec700e64fd0a69e8f911ea53240a3
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>
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ConnectionEditPart.java28
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AbstractMessageEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AnnotatedLinkEditPart.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomGeneralOrderingEditPart.java2
4 files changed, 18 insertions, 17 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();
}
+
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AbstractMessageEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AbstractMessageEditPart.java
index f12b3109e11..a9d8b626e3a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AbstractMessageEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AbstractMessageEditPart.java
@@ -29,7 +29,6 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.SequenceReferenceE
import org.eclipse.papyrus.uml.diagram.sequence.figures.MessageFigure;
import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
import org.eclipse.papyrus.uml.diagram.sequence.referencialgrilling.ConnectMessageToGridEditPolicy;
-import org.eclipse.papyrus.uml.diagram.sequence.referencialgrilling.ConnectPointToGridEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.referencialgrilling.ConnectRectangleToGridEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.referencialgrilling.LifeLineGraphicalNodeEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.util.SelectMessagesEditPartTracker;
@@ -252,7 +251,7 @@ public abstract class AbstractMessageEditPart extends UMLConnectionNodeEditPart
public void setLineWidth(int width) {
if (getPrimaryShape() instanceof MessageFigure) {
MessageFigure edge = getPrimaryShape();
- edge.setLineWidth(width);
+ edge.setLineWidth(width < 0 ? 1 : width);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AnnotatedLinkEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AnnotatedLinkEditPart.java
index b1981a883d1..bcb6f3247e5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AnnotatedLinkEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/AnnotatedLinkEditPart.java
@@ -155,7 +155,7 @@ public abstract class AnnotatedLinkEditPart extends org.eclipse.papyrus.infra.gm
@Override
protected void setLineWidth(int width) {
- getPrimaryShape().setLineWidth(width);
+ getPrimaryShape().setLineWidth(width < 0 ? 1 : width);
}
@Override
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomGeneralOrderingEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomGeneralOrderingEditPart.java
index 71d74542dcd..8b51a9795f4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomGeneralOrderingEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomGeneralOrderingEditPart.java
@@ -63,7 +63,7 @@ public class CustomGeneralOrderingEditPart extends GeneralOrderingEditPart imple
@Override
protected void setLineWidth(int width) {
- getPrimaryShape().setLineWidth(width);
+ getPrimaryShape().setLineWidth(width < 0 ? 1 : 0);
}
@Override

Back to the top