All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class edu.cmu.owl.ui.twoD.PointConverter

edu.cmu.owl.ui.twoD.PointConverter

public class PointConverter
Utility class for converting points and shapes from one unit system to another. Used by OWL to go from physical coordinates (in the map) to screen coordinates for the 2D view.


Constructor Index

 o PointConverter(float)

Method Index

 o getScale()
 o setScale(float)
 o toPixel(Point)
Convert this point in physical units to pixels.
 o toPixels(Dimension)
 o toPixels(Polygon)
 o toPixels(Rectangle)
 o toUnits(Point)
Convert this point in pixels to physical units.

Constructors

 o PointConverter
 public PointConverter(float scale)
Parameters:
scale - The larger the scale, the larger the map.

Methods

 o setScale
 public void setScale(float scale)
 o getScale
 public float getScale()
 o toPixel
 public Point toPixel(Point pt)
Convert this point in physical units to pixels.

 o toPixels
 public Dimension toPixels(Dimension d)
 o toPixels
 public Rectangle toPixels(Rectangle r)
 o toPixels
 public Polygon toPixels(Polygon p)
 o toUnits
 public Point toUnits(Point pt)
Convert this point in pixels to physical units.


All Packages  Class Hierarchy  This Package  Previous  Next  Index