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 import org.eclipse.swt.graphics.Color;
30
31 public class SendMessageFigure extends Shape {
32
33 boolean selected;
34
35 public SendMessageFigure() {
36 super();
37 setBorder(new MarginBorder(3,3,3,3));
38 setOpaque(false);
39 }
40
41 protected void outlineShape(Graphics graphics) {
42
43 Rectangle r = getBounds();
44 int centerX = r.x + r.width / 2;
45 int centerY = r.y + r.height / 2;
46
47 graphics.setLineWidth(getLineWidth());
48 graphics.drawOval(r.x + getLineWidth(), r.y + getLineWidth(),
49 r.width - 2 * getLineWidth(), r.height - 2 * getLineWidth());
50 graphics.drawOval(r.x + getLineWidth() + 2 , r.y + getLineWidth() + 2,
51 r.width - 2 * getLineWidth() - 4, r.height - 2 * getLineWidth() - 4);
52
53 graphics.setLineWidth(1);
54
55 int dimm = Math.min(r.width, r.height);
56
57 Color oldBackground = getBackgroundColor();
58
59 graphics.setBackgroundColor(getForegroundColor());
60 graphics.fillRectangle(centerX - dimm / 4, centerY - dimm / 6,
61 dimm / 2, dimm / 3);
62
63 graphics.setForegroundColor(oldBackground);
64 graphics.drawLine(centerX - dimm / 4, centerY - dimm / 6 + 1, centerX, centerY);
65 graphics.drawLine(centerX + dimm / 4, centerY - dimm / 6 + 1, centerX, centerY);
66
67 }
68
69 protected void fillShape(Graphics g) {
70 Rectangle r = getBounds();
71 g.fillOval(r.x + getLineWidth(), r.y + getLineWidth(),
72 r.width - 2 * getLineWidth(), r.height - 2 * getLineWidth());
73 }
74
75 public void setSelected(boolean selected) {
76 if (this.selected == selected)
77 return;
78 this.selected = selected;
79 repaint();
80 }
81
82 }
83
84
85
86
87
88
89