blob: 6da15ce29b3c88266cc871a8d851e2b2d48ab339 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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;
}
}
|