1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 /***
19 * <p>Title: WSMO Studio</p>
20 * <p>Description: Semantic Web Service Editor</p>
21 * <p>Copyright: Copyright (c) 2004-2007</p>
22 * <p>Company: Ontotext Lab. / SIRMA </p>
23 */
24
25 package org.wsmostudio.bpmo.figures;
26
27 import org.eclipse.draw2d.*;
28 import org.eclipse.draw2d.geometry.Rectangle;
29
30 public class MultipleMergeSynchFigure extends Shape {
31
32 boolean selected;
33
34 public MultipleMergeSynchFigure() {
35 super();
36 setBorder(new MarginBorder(3,3,3,3));
37 setOpaque(false);
38 }
39
40 protected void outlineShape(Graphics graphics) {
41
42 Rectangle r = getBounds();
43 int centerX = r.x + r.width / 2;
44 int centerY = r.y + r.height / 2;
45 graphics.setLineWidth(3);
46
47 graphics.drawPolygon(new int[] {centerX - r.width / 2 + 2, centerY,
48 centerX, centerY - r.height / 2 + 2,
49 centerX + r.width / 2 - 2, centerY,
50 centerX, centerY + r.height / 2 - 2});
51
52 int step = Math.min(Math.round(((float)r.width) / 6),
53 Math.round(((float)r.height) / 6)) - 1;
54 int step2 = (int)Math.round(step * 1.41);
55
56 graphics.drawLine(centerX - step, centerY - step, centerX + step, centerY + step);
57 graphics.drawLine(centerX + step, centerY - step, centerX - step, centerY + step);
58
59 graphics.drawLine(centerX - step2, centerY, centerX + step2, centerY);
60 graphics.drawLine(centerX, centerY - step2, centerX, centerY + step2);
61
62
63 }
64
65 protected void fillShape(Graphics g) {
66 Rectangle r = getBounds();
67 g.fillPolygon(new int[] {r.x + 2, r.y + r.height / 2,
68 r.x + r.width / 2, r.y + 2,
69 r.x + r.width - 2, r.y + r.height / 2,
70 r.x + r.width / 2, r.y + r.height - 2});
71 }
72
73 public void setSelected(boolean selected) {
74 if (this.selected == selected)
75 return;
76 this.selected = selected;
77 repaint();
78 }
79
80
81 }
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98