01: package org.openwfe.gpe.figures;
02:
03: import org.eclipse.draw2d.Border;
04: import org.eclipse.draw2d.Graphics;
05: import org.eclipse.draw2d.Label;
06: import org.eclipse.draw2d.MarginBorder;
07: import org.eclipse.draw2d.geometry.Rectangle;
08: import org.eclipse.swt.graphics.Image;
09:
10: /**
11: * @author hudsonr
12: * Created on Jul 21, 2003
13: */
14:
15: /**
16: * @author Helena
17: *
18: *changed by Helena
19: */
20: public class StartTag extends Label {
21:
22: static final Border BORDER = new MarginBorder(2, 0, 2, 9);
23:
24: /**
25: * Creates a new StartTag
26: * @param name the text to display in this StartTag
27: */
28: public StartTag(Image image) {
29: setIconTextGap(10);
30: setIcon(image);
31: setBorder(new MarginBorder(2, 0, 2, 9));
32:
33: }
34:
35: protected void paintFigure(Graphics g) {
36: super .paintFigure(g);
37: Rectangle r = getTextBounds();
38:
39: r.resize(-1, -1);
40: r.expand(1, 1);
41: r.width -= 1;
42: r.x -= 2;
43: g.drawLine(r.x, r.y, r.right(), r.y); //Top line
44: g.drawLine(r.x, r.bottom(), r.right(), r.bottom()); //Bottom line
45: g.drawLine(r.x, r.bottom(), r.x, r.y); //left line
46:
47: g.drawLine(r.right() + 7, r.y + r.height / 2, r.right(), r.y);
48: g.drawLine(r.right() + 7, r.y + r.height / 2, r.right(), r
49: .bottom());
50: }
51:
52: }
|