summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Wouters2014-03-11 06:26:04 (EDT)
committerLaurent Wouters2014-03-11 06:26:04 (EDT)
commitfcba042613d85123a02972df2f19874ab1eacbab (patch)
treeb2a0e1457e49c01c84fec40abb9de2295f2b4f74
parent9af541ce3c243a283cb32f0fe33e4effbb0b7ec4 (diff)
downloadorg.eclipse.papyrus-fcba042613d85123a02972df2f19874ab1eacbab.zip
org.eclipse.papyrus-fcba042613d85123a02972df2f19874ab1eacbab.tar.gz
org.eclipse.papyrus-fcba042613d85123a02972df2f19874ab1eacbab.tar.bz2
Added support for CSS properties controlling the display of connectors' source and target decorations
Signed-off-by: Laurent Wouters <laurent.wouters@cea.fr>
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ConnectionEditPart.java73
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/ActivityEdgeFigure.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/ExceptionHandlerFigure.java10
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ControlFlowEditPart.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ObjectFlowEditPart.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/figure/AssociationFigure.java15
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/figure/TemplateBindingFigure.java10
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/GeneralizationFigure.java10
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/InterfaceRealizationFigure.java10
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/figure/edges/UsageDecoration.java9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/custom-src/org/eclipse/papyrus/uml/diagram/profile/custom/figure/AssociationFigure.java16
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/custom-src/org/eclipse/papyrus/uml/diagram/profile/custom/figure/ExtensionFigure.java10
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageFigure.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GeneralOrderingEditPart.java10
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/AbstractMessageFigure.java7
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/custom-src/org/eclipse/papyrus/uml/diagram/usecase/figure/AssociationFigure.java15
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/ExtendEditPart.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/IncludeEditPart.java6
18 files changed, 202 insertions, 29 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 4b51871..885f38a 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
@@ -35,6 +35,11 @@ public abstract class ConnectionEditPart extends ConnectionNodeEditPart implemen
protected static final String LINE_STYLE = "lineStyle";
/**
+ * Supported values of the CSS property lineStyle
+ */
+ protected static final String[] LINE_STYLE_VALUES = { "none", "hidden", "dotted", "dashed", "solid", "double" };
+
+ /**
* CSS property for the line dashes' length
*/
protected static final String LINE_DASH_LENGTH = "lineDashLength";
@@ -45,15 +50,32 @@ public abstract class ConnectionEditPart extends ConnectionNodeEditPart implemen
protected static final String LINE_DASH_GAP = "lineDashGap";
/**
+ * CSS property for the source decoration
+ */
+ protected static final String SOURCE_DECORATION = "sourceDecoration";
+
+ /**
+ * CSS property for the target decoration
+ */
+ protected static final String TARGET_DECORATION = "targetDecoration";
+
+ /**
+ * Supported values of the CSS property targetDecoration
+ */
+ protected static final String[] DECORATION_VALUES = { "default", "none" };
+
+ /**
* Minimum length of dashes for dashed connectors
*/
protected static final int LINE_DASH_MIN_LENGTH = 2;
/**
- * Minimum length of the gapas between dashes
+ * Minimum length of the gaps between dashes
*/
protected static final int LINE_GAP_MIN_LENGTH = 2;
+
+
public ConnectionEditPart(View view) {
super(view);
}
@@ -69,13 +91,22 @@ public abstract class ConnectionEditPart extends ConnectionNodeEditPart implemen
if(figure instanceof PapyrusEdgeFigure && model instanceof Connector) {
Connector connector = (Connector)model;
PapyrusEdgeFigure edge = (PapyrusEdgeFigure)figure;
+ // Reset the style
+ edge.resetStyle();
+ // Re-apply the CSS-defined style if any
String lineStyle = extract((StringValueStyle)connector.getNamedStyle(NotationPackage.eINSTANCE.getStringValueStyle(), LINE_STYLE));
int lineDashLength = extract((IntValueStyle)connector.getNamedStyle(NotationPackage.eINSTANCE.getIntValueStyle(), LINE_DASH_LENGTH));
int lineDashGap = extract((IntValueStyle)connector.getNamedStyle(NotationPackage.eINSTANCE.getIntValueStyle(), LINE_DASH_GAP));
if(lineStyle != null) {
setupLineStyle(edge, lineStyle, connector.getLineWidth(), lineDashLength < LINE_DASH_MIN_LENGTH ? LINE_DASH_MIN_LENGTH : lineDashLength, lineDashGap < LINE_GAP_MIN_LENGTH ? LINE_GAP_MIN_LENGTH : lineDashGap);
- } else {
- edge.resetStyle();
+ }
+ String decoration = extract((StringValueStyle) connector.getNamedStyle(NotationPackage.eINSTANCE.getStringValueStyle(), TARGET_DECORATION));
+ if ("none".equals(decoration)) {
+ edge.setTargetDecoration(null);
+ }
+ decoration = extract((StringValueStyle) connector.getNamedStyle(NotationPackage.eINSTANCE.getStringValueStyle(), SOURCE_DECORATION));
+ if ("none".equals(decoration)) {
+ edge.setSourceDecoration(null);
}
}
}
@@ -123,26 +154,22 @@ public abstract class ConnectionEditPart extends ConnectionNodeEditPart implemen
* Length of the gap between dashes
*/
private void setupLineStyle(PapyrusEdgeFigure edge, String style, int originalWidth, int lineDashLength, int lineDashGap) {
- if("none".equals(style)) {
- edge.resetStyle();
- } else {
- if("hidden".equals(style)) {
- edge.setLineStyle(Graphics.LINE_SOLID);
- edge.setLineWidth(0);
- edge.setVisible(false);
- } else if("dotted".equals(style)) {
- edge.setLineStyle(Graphics.LINE_DOT);
- edge.setLineWidth(originalWidth);
- } else if("dashed".equals(style)) {
- edge.setLineStyle(Graphics.LINE_CUSTOM);
- edge.setLineWidth(originalWidth);
- edge.setLineDash(new int[]{ lineDashLength, lineDashGap });
- } else if("solid".equals(style)) {
- edge.setLineStyle(Graphics.LINE_SOLID);
- edge.setLineWidth(originalWidth);
- } else if("double".equals(style)) {
- edge.setLineWidth(originalWidth * 2);
- }
+ if ("hidden".equals(style)) {
+ edge.setLineStyle(Graphics.LINE_SOLID);
+ edge.setLineWidth(0);
+ edge.setVisible(false);
+ } else if ("dotted".equals(style)) {
+ edge.setLineStyle(Graphics.LINE_DOT);
+ edge.setLineWidth(originalWidth);
+ } else if ("dashed".equals(style)) {
+ edge.setLineStyle(Graphics.LINE_CUSTOM);
+ edge.setLineWidth(originalWidth);
+ edge.setLineDash(new int[] { lineDashLength, lineDashGap });
+ } else if ("solid".equals(style)) {
+ edge.setLineStyle(Graphics.LINE_SOLID);
+ edge.setLineWidth(originalWidth);
+ } else if ("double".equals(style)) {
+ edge.setLineWidth(originalWidth * 2);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/ActivityEdgeFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/ActivityEdgeFigure.java
index 65e3857..a14c08e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/ActivityEdgeFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/ActivityEdgeFigure.java
@@ -62,6 +62,12 @@ public class ActivityEdgeFigure extends UMLEdgeFigure {
super.createContents();
}
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ setTargetDecoration(createTargetDecoration());
+ }
+
/**
* Scale changed from default 7:3 to 5:2 to make a
* smaller arrow
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/ExceptionHandlerFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/ExceptionHandlerFigure.java
index 71ec746..b5e26ce 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/ExceptionHandlerFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/ExceptionHandlerFigure.java
@@ -18,9 +18,9 @@ import org.eclipse.draw2d.PolylineDecoration;
import org.eclipse.draw2d.RotatableDecoration;
import org.eclipse.draw2d.geometry.PointList;
import org.eclipse.gmf.runtime.diagram.ui.util.MeasurementUnitHelper;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
import org.eclipse.gmf.runtime.notation.MeasurementUnit;
+import org.eclipse.papyrus.infra.gmfdiag.common.figure.edge.PapyrusEdgeFigure;
import org.eclipse.swt.graphics.LineAttributes;
import org.eclipse.uml2.uml.ExceptionHandler;
@@ -30,7 +30,7 @@ import org.eclipse.uml2.uml.ExceptionHandler;
* @author arthur daussy
*
*/
-public class ExceptionHandlerFigure extends PolylineConnectionEx {
+public class ExceptionHandlerFigure extends PapyrusEdgeFigure {
/**
* Since the Activity diagram is using Pixel unit we can use this as constant
@@ -45,6 +45,12 @@ public class ExceptionHandlerFigure extends PolylineConnectionEx {
setLineAttributes(new LineAttributes(2));
}
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ setTargetDecoration(createTargetDecoration());
+ }
+
/**
* @generated
*/
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ControlFlowEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ControlFlowEditPart.java
index 9722e84..041f46b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ControlFlowEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ControlFlowEditPart.java
@@ -140,6 +140,12 @@ public class ControlFlowEditPart extends UMLConnectionNodeEditPart implements IT
//this.add(fAppliedStereotypeLabel);
}
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ setTargetDecoration(createTargetDecoration());
+ }
+
/**
* @generated NOT scale changed from default 7:3 to 5:2 to make a smaller arrow
*/
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ObjectFlowEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ObjectFlowEditPart.java
index 823a5ba..5db996a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ObjectFlowEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ObjectFlowEditPart.java
@@ -140,6 +140,12 @@ public class ObjectFlowEditPart extends UMLConnectionNodeEditPart implements ITr
//this.add(fAppliedStereotypeLabel);
}
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ setTargetDecoration(createTargetDecoration());
+ }
+
/**
* @generated NOT scale changed from default 7:3 to 5:2 to make a smaller arrow
*/
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/figure/AssociationFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/figure/AssociationFigure.java
index 9aa4a5e..67c420f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/figure/AssociationFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/figure/AssociationFigure.java
@@ -54,6 +54,12 @@ public class AssociationFigure extends UMLEdgeFigure {
/** The role target label. */
private WrappingLabel fRoleTargetLabel;
+ /** Source decoration type */
+ private int sourceType;
+
+ /** Target decoration type */
+ private int targetType;
+
/**
* Instantiates a new association figure.
*/
@@ -536,7 +542,16 @@ public class AssociationFigure extends UMLEdgeFigure {
* the type of end of the association {@link AssociationFigure#navigable}
*/
public void setEnd(int sourceType, int targetType) {
+ this.sourceType = sourceType;
+ this.targetType = targetType;
this.setSourceDecoration(getDecoration(sourceType));
this.setTargetDecoration(getDecoration(targetType));
}
+
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ setSourceDecoration(getDecoration(sourceType));
+ setTargetDecoration(getDecoration(targetType));
+ }
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/figure/TemplateBindingFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/figure/TemplateBindingFigure.java
index c00703b..923d2ca 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/figure/TemplateBindingFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/figure/TemplateBindingFigure.java
@@ -50,6 +50,16 @@ public class TemplateBindingFigure extends UMLEdgeFigure {
this.add(bindingSubstitutionFigure);
}
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ PolygonDecoration dec = new PolygonDecoration();
+ dec.setScale(15, 5);
+ dec.setBackgroundColor(ColorConstants.white);
+ dec.setLineWidth(1);
+ setTargetDecoration(dec); // arrow at target endpoint
+ }
+
/**
*
* @return the label multiline
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/GeneralizationFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/GeneralizationFigure.java
index ad794e5..81e30e8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/GeneralizationFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/GeneralizationFigure.java
@@ -37,4 +37,14 @@ public class GeneralizationFigure extends UMLEdgeFigure {
setForegroundColor(ColorConstants.black);
}
+
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ PolygonDecoration dec = new PolygonDecoration();
+ dec.setScale(10, 8);
+ dec.setBackgroundColor(ColorConstants.white);
+ dec.setLineWidth(1);
+ setTargetDecoration(dec); // arrow at target endpoint
+ }
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/InterfaceRealizationFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/InterfaceRealizationFigure.java
index 491ce22..58afa4f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/InterfaceRealizationFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/InterfaceRealizationFigure.java
@@ -34,4 +34,14 @@ public class InterfaceRealizationFigure extends DashedEdgeFigure {
this.setLineStyle(Graphics.LINE_CUSTOM); // line drawing style
}
+
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ PolygonDecoration dec = new PolygonDecoration();
+ dec.setScale(15, 5);
+ dec.setBackgroundColor(ColorConstants.white);
+ dec.setLineWidth(1);
+ setTargetDecoration(dec); // arrow at target endpoint
+ }
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/figure/edges/UsageDecoration.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/figure/edges/UsageDecoration.java
index 77665e0..cfc744c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/figure/edges/UsageDecoration.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/figure/edges/UsageDecoration.java
@@ -12,12 +12,14 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.component.custom.figure.edges;
+import org.eclipse.papyrus.infra.gmfdiag.common.figure.edge.PapyrusEdgeFigure;
+
// TODO: Auto-generated Javadoc
/**
* The Class UsageDecoration.
*/
-public class UsageDecoration extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {
+public class UsageDecoration extends PapyrusEdgeFigure {
/**
@@ -28,6 +30,11 @@ public class UsageDecoration extends org.eclipse.gmf.runtime.draw2d.ui.figures.P
setTargetDecoration(createTargetDecoration());
}
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ setTargetDecoration(createTargetDecoration());
+ }
/**
* Creates the target decoration.
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/custom-src/org/eclipse/papyrus/uml/diagram/profile/custom/figure/AssociationFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/custom-src/org/eclipse/papyrus/uml/diagram/profile/custom/figure/AssociationFigure.java
index 35f64a8..cdc42f8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/custom-src/org/eclipse/papyrus/uml/diagram/profile/custom/figure/AssociationFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/custom-src/org/eclipse/papyrus/uml/diagram/profile/custom/figure/AssociationFigure.java
@@ -55,6 +55,12 @@ public class AssociationFigure extends UMLEdgeFigure {
/** The role target label. */
private WrappingLabel fRoleTargetLabel;
+ /** Source decoration type */
+ private int sourceType;
+
+ /** Target decoration type */
+ private int targetType;
+
/**
* Instantiates a new association figure.
*/
@@ -562,8 +568,16 @@ public class AssociationFigure extends UMLEdgeFigure {
* the type of end of the association {@link AssociationFigure#navigable}
*/
public void setEnd(int sourceType, int targetType) {
-
+ this.sourceType = sourceType;
+ this.targetType = targetType;
this.setSourceDecoration(getDecoration(sourceType));
this.setTargetDecoration(getDecoration(targetType));
}
+
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ setSourceDecoration(getDecoration(sourceType));
+ setTargetDecoration(getDecoration(targetType));
+ }
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/custom-src/org/eclipse/papyrus/uml/diagram/profile/custom/figure/ExtensionFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/custom-src/org/eclipse/papyrus/uml/diagram/profile/custom/figure/ExtensionFigure.java
index bdba98c..5237e61 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/custom-src/org/eclipse/papyrus/uml/diagram/profile/custom/figure/ExtensionFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/custom-src/org/eclipse/papyrus/uml/diagram/profile/custom/figure/ExtensionFigure.java
@@ -41,4 +41,14 @@ public class ExtensionFigure extends UMLEdgeFigure {
setForegroundColor(ColorConstants.black);
}
+
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ PolygonDecoration dec = new PolygonDecoration();
+ dec.setScale(15, 5);
+ dec.setBackgroundColor(ColorConstants.black);
+ dec.setLineWidth(1);
+ setTargetDecoration(dec); // arrow at target endpoint
+ }
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageFigure.java
index 10318a2..b9d2066 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageFigure.java
@@ -55,6 +55,12 @@ public abstract class MessageFigure extends UMLEdgeFigure {
setTargetDecoration(createTargetDecoration());
}
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ setTargetDecoration(createTargetDecoration());
+ }
+
public void setLineWidth(int w) {
super.setLineWidth(w);
if(getSourceDecoration() instanceof Shape) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GeneralOrderingEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GeneralOrderingEditPart.java
index f1766c3..9566ef6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GeneralOrderingEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GeneralOrderingEditPart.java
@@ -10,9 +10,9 @@ import org.eclipse.gef.EditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.figure.edge.PapyrusEdgeFigure;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.GeneralOrderingItemSemanticEditPolicy;
@@ -105,7 +105,7 @@ public class GeneralOrderingEditPart extends ConnectionNodeEditPart implements I
/**
* @generated
*/
- public class GeneralOrderingDescriptor extends PolylineConnectionEx {
+ public class GeneralOrderingDescriptor extends PapyrusEdgeFigure {
/**
* @generated
@@ -121,6 +121,12 @@ public class GeneralOrderingEditPart extends ConnectionNodeEditPart implements I
setTargetDecoration(createTargetDecoration());
}
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ setTargetDecoration(createTargetDecoration());
+ }
+
/**
* @generated
*/
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/AbstractMessageFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/AbstractMessageFigure.java
index ef5c18b..5d3b80c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/AbstractMessageFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/AbstractMessageFigure.java
@@ -88,6 +88,13 @@ public abstract class AbstractMessageFigure extends UMLEdgeFigure {
}
}
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ setSourceDecoration(createSourceDecoration());
+ setTargetDecoration(createTargetDecoration());
+ }
+
protected static IMapMode getMapMode() {
return MapModeTypes.IDENTITY_MM;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/custom-src/org/eclipse/papyrus/uml/diagram/usecase/figure/AssociationFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/custom-src/org/eclipse/papyrus/uml/diagram/usecase/figure/AssociationFigure.java
index 1dd83aa..536dd69 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/custom-src/org/eclipse/papyrus/uml/diagram/usecase/figure/AssociationFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/custom-src/org/eclipse/papyrus/uml/diagram/usecase/figure/AssociationFigure.java
@@ -47,6 +47,12 @@ public class AssociationFigure extends UMLEdgeFigure {
/** The f role target label. */
private WrappingLabel fRoleTargetLabel;
+ /** Source decoration type */
+ private int sourceType;
+
+ /** Target decoration type */
+ private int targetType;
+
public AssociationFigure() {
super();
setAntialias(SWT.ON);
@@ -135,10 +141,19 @@ public class AssociationFigure extends UMLEdgeFigure {
* the type of end of the association {@link AssociationFigure#navigable}
*/
public void setEnd(int sourceType, int targetType) {
+ this.sourceType = sourceType;
+ this.targetType = targetType;
this.setSourceDecoration(getDecoration(sourceType));
this.setTargetDecoration(getDecoration(targetType));
}
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ setSourceDecoration(getDecoration(sourceType));
+ setTargetDecoration(getDecoration(targetType));
+ }
+
/**
* @generated
*/
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/ExtendEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/ExtendEditPart.java
index 43985c6..178d06f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/ExtendEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/ExtendEditPart.java
@@ -129,6 +129,12 @@ public class ExtendEditPart extends UMLConnectionNodeEditPart implements ITreeBr
setTargetDecoration(createTargetDecoration());
}
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ setTargetDecoration(createTargetDecoration());
+ }
+
/**
* @generated
*/
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/IncludeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/IncludeEditPart.java
index 79129b8..70e17e1 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/IncludeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/IncludeEditPart.java
@@ -129,6 +129,12 @@ public class IncludeEditPart extends UMLConnectionNodeEditPart implements ITreeB
setTargetDecoration(createTargetDecoration());
}
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ setTargetDecoration(createTargetDecoration());
+ }
+
/**
* @generated
*/