comparison java/src/uk/ac/qmul/eecs/ccmi/gui/GraphElement.java @ 0:9418ab7b7f3f

Initial import
author Fiore Martin <fiore@eecs.qmul.ac.uk>
date Fri, 16 Dec 2011 17:35:51 +0000
parents
children 9e67171477bc
comparison
equal deleted inserted replaced
-1:000000000000 0:9418ab7b7f3f
1 /*
2 CCmI Editor - A Collaborative Cross-Modal Diagram Editing Tool
3
4 Copyright (C) 2011 Queen Mary University of London (http://ccmi.eecs.qmul.ac.uk/)
5
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 package uk.ac.qmul.eecs.ccmi.gui;
20
21 import java.awt.Graphics2D;
22 import java.awt.geom.Point2D;
23 import java.awt.geom.Rectangle2D;
24
25
26 /**
27 * An interface implemented by {@link Node} and {@link Edge} and it defines methods that
28 * both the classes implements as they're object painted on a graph. The interface is used mainly
29 * for convenience in treating the two types of object in a unified way.
30 *
31 */
32 public interface GraphElement {
33 public void draw(Graphics2D g2);
34
35 public void translate(Point2D p, double dx, double dy);
36
37 public void stopMove();
38
39 public void startMove(Point2D p);
40
41 public Rectangle2D getBounds();
42
43 public Point2D getConnectionPoint(Direction d);
44
45 public boolean contains(Point2D p);
46
47 }