diff options
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/anchors/ConnectionTargetAnchor.java')
-rw-r--r-- | plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/anchors/ConnectionTargetAnchor.java | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/anchors/ConnectionTargetAnchor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/anchors/ConnectionTargetAnchor.java new file mode 100644 index 00000000000..eeea63e49b6 --- /dev/null +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/anchors/ConnectionTargetAnchor.java @@ -0,0 +1,39 @@ +/***************************************************************************** + * 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 target of a {@link PolylineConnection} (Typically the receiveEvent of a Message) + */ +public class ConnectionTargetAnchor extends AbstractConnectionAnchor { + + private final PolylineConnection anchorage; + + public ConnectionTargetAnchor(PolylineConnection anchorage) { + super(anchorage); + this.anchorage = anchorage; + } + + @Override + public Point getLocation(Point reference) { + Point target = anchorage.getEnd().getCopy(); + anchorage.translateToAbsolute(target); + return target; + } + +} |