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 MessageFigure extends Shape {
31
32 boolean selected;
33
34 public MessageFigure() {
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
46 graphics.setLineWidth(getLineWidth());
47 graphics.drawOval(r.x + getLineWidth(), r.y + getLineWidth(),
48 r.width - 2 * getLineWidth(), r.height - 2 * getLineWidth());
49 graphics.drawOval(r.x + getLineWidth() + 2 , r.y + getLineWidth() + 2,
50 r.width - 2 * getLineWidth() - 4, r.height - 2 * getLineWidth() - 4);
51
52 graphics.setLineWidth(1);
53
54 int dimm = Math.min(r.width, r.height);
55
56 graphics.drawRectangle(centerX - dimm / 4, centerY - dimm / 6,
57 dimm / 2, dimm / 3);
58
59 graphics.drawLine(centerX - dimm / 4, centerY - dimm / 6 + 1, centerX, centerY);
60 graphics.drawLine(centerX + dimm / 4, centerY - dimm / 6 + 1, centerX, centerY);
61
62 }
63
64 protected void fillShape(Graphics g) {
65 Rectangle r = getBounds();
66 g.fillOval(r.x + getLineWidth(), r.y + getLineWidth(),
67 r.width - 2 * getLineWidth(), r.height - 2 * getLineWidth());
68 }
69
70 public void setSelected(boolean selected) {
71 if (this.selected == selected)
72 return;
73 this.selected = selected;
74 repaint();
75 }
76
77 }
78
79
80
81
82
83
84