| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| FigRectangle |
|
| 1.0;1 |
| 1 | /* | |
| 2 | * Copyright (c) 2003-2008, by Henrik Arro and Contributors | |
| 3 | * | |
| 4 | * This file is part of JSeq, a tool to automatically create | |
| 5 | * sequence diagrams by tracing program execution. | |
| 6 | * | |
| 7 | * See <http://jseq.sourceforge.net> for more information. | |
| 8 | * | |
| 9 | * JSeq is free software: you can redistribute it and/or modify | |
| 10 | * it under the terms of the GNU Lesser General Public License as | |
| 11 | * published by the Free Software Foundation, either version 3 of | |
| 12 | * the License, or (at your option) any later version. | |
| 13 | * | |
| 14 | * JSeq is distributed in the hope that it will be useful, | |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 17 | * GNU Lesser General Public License for more details. | |
| 18 | * | |
| 19 | * You should have received a copy of the GNU Lesser General Public License | |
| 20 | * along with JSeq. If not, see <http://www.gnu.org/licenses/>. | |
| 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 | 37 | super(name, Fill.ON, fillColor, Stroke.ON, StrokeColor.BLACK); |
| 37 | 37 | this.x = x; |
| 38 | 37 | this.y = y; |
| 39 | 37 | this.width = width; |
| 40 | 37 | this.height = height; |
| 41 | 37 | } |
| 42 | ||
| 43 | public Element getXML(Document doc) { | |
| 44 | 37 | Element rectangle = createElement(doc, "rectangle"); |
| 45 | 37 | rectangle.setAttribute("x", Integer.toString(getX())); |
| 46 | 37 | rectangle.setAttribute("y", Integer.toString(getY())); |
| 47 | 37 | rectangle.setAttribute("width", Integer.toString(getWidth())); |
| 48 | 37 | rectangle.setAttribute("height", Integer.toString(getHeight())); |
| 49 | 37 | return rectangle; |
| 50 | } | |
| 51 | ||
| 52 | public int getX() { | |
| 53 | 37 | return x; |
| 54 | } | |
| 55 | ||
| 56 | public int getY() { | |
| 57 | 37 | return y; |
| 58 | } | |
| 59 | ||
| 60 | public int getWidth() { | |
| 61 | 37 | return width; |
| 62 | } | |
| 63 | ||
| 64 | public int getHeight() { | |
| 65 | 37 | return height; |
| 66 | } | |
| 67 | } |