KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jac > ide > GenericFigure


1 /*
2   Copyright (C) 2002 Laurent Martelli <laurent@aopsys.com>
3   Renaud Pawlak <renaud@aopsys.com>
4
5   This program is free software; you can redistribute it and/or modify
6   it under the terms of the GNU Lesser General Public License as
7   published by the Free Software Foundation; either version 2 of the
8   License, or (at your option) any later version.
9
10   This program is distributed in the hope that it will be useful,
11   but WITHOUT ANY WARRANTY; without even the implied warranty of
12   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13   GNU Lesser General Public License for more details.
14
15   You should have received a copy of the GNU Lesser General Public
16   License along with this program; if not, write to the Free Software
17   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18   USA */

19
20 package org.objectweb.jac.ide;
21
22 import java.awt.Point JavaDoc;
23
24 /**
25  * A genric figure of a diagram.
26  * @see Diagram
27  */

28
29 public class GenericFigure extends Figure {
30
31     public GenericFigure() {
32     }
33    
34     /**
35      * @param element the model element represented by this figure
36      * @param corner the upperleft corner of the figure
37      */

38     public GenericFigure(ModelElement element, Point JavaDoc corner) {
39         super(element);
40         this.corner = corner;
41     }
42
43     public GenericFigure(ModelElement element) {
44         super(element);
45         this.corner = new Point JavaDoc();
46     }
47
48     Point JavaDoc corner;
49    
50     /**
51      * Get the value of corner.
52      * @return value of corner.
53      */

54     public Point JavaDoc getCorner() {
55         return corner;
56     }
57    
58     /**
59      * Set the value of corner.
60      * @param v Value to assign to corner.
61      */

62     public void setCorner(Point JavaDoc v) {
63         this.corner = v;
64     }
65    
66     public void translate(int dx, int dy) {
67         corner.translate(dx,dy);
68     }
69 }
70
Popular Tags