blob: 9b1219efc4454b63e6fd7a5cd68e2b0fcaa9bc2c (
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
39
|
/*******************************************************************************
* Copyright (c) 2012 CEA LIST.
*
* 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
*******************************************************************************/
package org.eclipse.papyrus.uml.diagram.timing.custom.figures;
import org.eclipse.draw2d.PolylineDecoration;
import org.eclipse.draw2d.RotatableDecoration;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.PointList;
import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
public class MessageFoundFigure extends AbstractMessageFigure {
@Override
protected RotatableDecoration createSourceDecoration() {
final EllipseDecoration df = new EllipseDecoration();
df.setPreferredSize(new Dimension(10, 10));
return df;
}
@Override
protected RotatableDecoration createTargetDecoration() {
final PolylineDecoration df = new PolylineDecoration();
df.setForegroundColor(getForegroundColor());
final PointList pl = new PointList();
final IMapMode mapMode = getMapMode();
pl.addPoint(mapMode.DPtoLP(-2), mapMode.DPtoLP(2));
pl.addPoint(mapMode.DPtoLP(0), mapMode.DPtoLP(0));
pl.addPoint(mapMode.DPtoLP(-2), mapMode.DPtoLP(-2));
df.setTemplate(pl);
return df;
}
}
|