View Javadoc
1   /*
2    * Copyright (c) 2005, The JUNG Authors
3    * All rights reserved.
4    *
5    * This software is open-source under the BSD license; see either "license.txt"
6    * or https://github.com/jrtom/jung/blob/master/LICENSE 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.geom.Point2D;
14  
15  /**
16   * Provides methods to map points from one coordinate system to
17   * another: graph to screen and screen to graph.
18   * 
19   * @author Tom Nelson 
20   */
21  public interface BidirectionalTransformer {
22      
23      /**
24       * convert the supplied graph coordinate to the screen coordinate
25       * @param p graph point to convert
26       * @return screen point
27       */
28      Point2D transform(Point2D p);
29      
30      /**
31       * convert the supplied screen coordinate to the graph coordinate.
32       * @param p screen point to convert
33       * @return the graph point
34       */
35      Point2D inverseTransform(Point2D p);
36  }