1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package th.co.edge.jseq.argouml.pgml;
24
25 import org.w3c.dom.Document;
26 import org.w3c.dom.Element;
27
28 public class FigRectangle extends Fig {
29 int x;
30 int y;
31 int width;
32 int height;
33
34 public FigRectangle(String name, int x, int y, int width, int height,
35 FillColor fillColor) {
36 super(name, Fill.ON, fillColor, Stroke.ON, StrokeColor.BLACK);
37 this.x = x;
38 this.y = y;
39 this.width = width;
40 this.height = height;
41 }
42
43 public Element getXML(Document doc) {
44 Element rectangle = createElement(doc, "rectangle");
45 rectangle.setAttribute("x", Integer.toString(getX()));
46 rectangle.setAttribute("y", Integer.toString(getY()));
47 rectangle.setAttribute("width", Integer.toString(getWidth()));
48 rectangle.setAttribute("height", Integer.toString(getHeight()));
49 return rectangle;
50 }
51
52 public int getX() {
53 return x;
54 }
55
56 public int getY() {
57 return y;
58 }
59
60 public int getWidth() {
61 return width;
62 }
63
64 public int getHeight() {
65 return height;
66 }
67 }