1 /*
2 * Copyright (c) 2005, the JUNG Project and the Regents of the University of
3 * California All rights reserved.
4 *
5 * This software is open-source under the BSD license; see either "license.txt"
6 * or http://jung.sourceforge.net/license.txt for a description.
7 *
8 * Created on Apr 16, 2005
9 */
10
11 package edu.uci.ics.jung.visualization.transform;
12
13 import java.awt.Shape;
14 import java.awt.geom.Point2D;
15
16 /**
17 * Provides methods to map points from one coordinate system to
18 * another: graph to screen and screen to graph.
19 *
20 * @author Tom Nelson
21 */
22 public interface BidirectionalTransformer {
23
24 /**
25 * convert the supplied graph coordinate to the
26 * screen coordinate
27 * @param p graph point to convert
28 * @return screen point
29 */
30 Point2D transform(Point2D p);
31
32 /**
33 * convert the supplied screen coordinate to the
34 * graph coordinate.
35 * @param p screen point to convert
36 * @return the graph point
37 */
38 Point2D inverseTransform(Point2D p);
39
40 /**
41 *
42 * @param shape
43 * @return
44 */
45 Shape transform(Shape shape);
46
47 /**
48 *
49 * @param shape
50 * @return
51 */
52 Shape inverseTransform(Shape shape);
53
54 }