blob: dc41e0ad889154cbf21cdbb6bfaaa5170a5a9551 (
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
40
|
/*******************************************************************************
* 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.Graphics;
import org.eclipse.draw2d.PolygonDecoration;
import org.eclipse.draw2d.RotatableDecoration;
import org.eclipse.draw2d.geometry.PointList;
import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
public class MessageDeleteFigure extends AbstractMessageFigure {
@Override
protected RotatableDecoration createTargetDecoration() {
final PolygonDecoration df = new PolygonDecoration() {
@Override
protected void outlineShape(final Graphics g) {
// no outline: this is a filled arrow
}
};
df.setFill(true);
df.setForegroundColor(getForegroundColor());
df.setBackgroundColor(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));
pl.addPoint(mapMode.DPtoLP(-2), mapMode.DPtoLP(2));
df.setTemplate(pl);
return df;
}
}
|