Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/anchors/ConnectionSourceAnchor.java')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/anchors/ConnectionSourceAnchor.java38
1 files changed, 38 insertions, 0 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/anchors/ConnectionSourceAnchor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/anchors/ConnectionSourceAnchor.java
new file mode 100644
index 00000000000..6da15ce29b3
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/anchors/ConnectionSourceAnchor.java
@@ -0,0 +1,38 @@
+/*****************************************************************************
+ * Copyright (c) 2018 CEA LIST, EclipseSource and others.
+ *
+ * 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:
+ * EclipseSource - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.sequence.anchors;
+
+import org.eclipse.draw2d.AbstractConnectionAnchor;
+import org.eclipse.draw2d.PolylineConnection;
+import org.eclipse.draw2d.geometry.Point;
+
+/**
+ * Anchors a Connection to the source of a {@link PolylineConnection} (Typically the sendEvent of a Message)
+ */
+public class ConnectionSourceAnchor extends AbstractConnectionAnchor {
+
+ private final PolylineConnection anchorage;
+
+ public ConnectionSourceAnchor(PolylineConnection anchorage) {
+ super(anchorage);
+ this.anchorage = anchorage;
+ }
+
+ @Override
+ public Point getLocation(Point reference) {
+ Point source = anchorage.getStart().getCopy();
+ anchorage.translateToAbsolute(source);
+ return source;
+ }
+
+}

Back to the top