001    /*
002      Copyright (C) 2002 Laurent Martelli <laurent@aopsys.com>
003      Renaud Pawlak <renaud@aopsys.com>
004    
005      This program is free software; you can redistribute it and/or modify
006      it under the terms of the GNU Lesser General Public License as
007      published by the Free Software Foundation; either version 2 of the
008      License, or (at your option) any later version.
009    
010      This program is distributed in the hope that it will be useful,
011      but WITHOUT ANY WARRANTY; without even the implied warranty of
012      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
013      GNU Lesser General Public License for more details.
014    
015      You should have received a copy of the GNU Lesser General Public
016      License along with this program; if not, write to the Free Software
017      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
018      USA */
019    
020    package org.objectweb.jac.ide;
021    
022    import java.awt.Point;
023    
024    /**
025     * A genric figure of a diagram.
026     * @see Diagram
027     */
028    
029    public class GenericFigure extends Figure {
030    
031        public GenericFigure() {
032        }
033       
034        /**
035         * @param element the model element represented by this figure
036         * @param corner the upperleft corner of the figure
037         */
038        public GenericFigure(ModelElement element, Point corner) {
039            super(element);
040            this.corner = corner;
041        }
042    
043        public GenericFigure(ModelElement element) {
044            super(element);
045            this.corner = new Point();
046        }
047    
048        Point corner;
049       
050        /**
051         * Get the value of corner.
052         * @return value of corner.
053         */
054        public Point getCorner() {
055            return corner;
056        }
057       
058        /**
059         * Set the value of corner.
060         * @param v  Value to assign to corner.
061         */
062        public void setCorner(Point  v) {
063            this.corner = v;
064        }
065       
066        public void translate(int dx, int dy) {
067            corner.translate(dx,dy);
068        }
069    }