gistoolkit.display
Class Converter

java.lang.Object
  extended bygistoolkit.display.Converter

public class Converter
extends java.lang.Object

Class to convert from world coordinates to screen coordinates. The individual layers will have data in their respective projections. Typically, this will all be one projection. The converter will then convertfrom that projection to screen coordinates.


Constructor Summary
Converter(Envelope inScreenEnvelope, Envelope inWorldEnvelope)
          Create a converter to convert from the given screen Envelope to the given world Envelope, and vice versa.
Converter(Envelope inScreenEnvelope, Envelope inWorldEnvelope, boolean inSquare)
          Create a converter to convert from the given screen Envelope to the given world Envelope, and vice versa.
 
Method Summary
 int convertX(double inX)
          Convert the given world x coordinate to a corrisponding screen coordinate.
 int convertY(double inY)
           
 Envelope getScreenEnvelope()
          Returns a copy of the screen Envelope used to create this converter.
 double getScreenHeight()
          Return the height of the screen
 double getScreenWidth()
          Return the width of the screen
 Envelope getWorldEnvelope()
          Returns a copy of the world Envelope used to create this converter.
 double getWorldHeight()
          Retrieve the height of the world
 double getWorldWidth()
          Return the width of the world
 int toScreenX(double inX)
          Converts the given world coordinate in X to a screen pixel coordinate in X.
 int toScreenY(double inY)
          Converts the given world coordinate in Y to a screen pixel coordinate in Y.
 double toWorldX(int inX)
          Converts the given screen X pixel coordinate to a world X coordinate.
 double toWorldY(int inY)
          Converts the given screen Y pixel coordinate to a world Y coordinate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Converter

public Converter(Envelope inScreenEnvelope,
                 Envelope inWorldEnvelope)
Create a converter to convert from the given screen Envelope to the given world Envelope, and vice versa.


Converter

public Converter(Envelope inScreenEnvelope,
                 Envelope inWorldEnvelope,
                 boolean inSquare)
Create a converter to convert from the given screen Envelope to the given world Envelope, and vice versa. The Square parameter indicates if the converter needs to maintain The aspect ratio of the image. If true is sent in, then the converter will modify the bounds of the world to create an image at the correct aspect ratio. If a false is sent in, then the converter will not change the screen dimensions, or change the world dimensions. In this case, the resulting map may be compressed some what.

Method Detail

convertX

public int convertX(double inX)
Convert the given world x coordinate to a corrisponding screen coordinate.


convertY

public int convertY(double inY)

getWorldEnvelope

public Envelope getWorldEnvelope()
Returns a copy of the world Envelope used to create this converter.


getScreenEnvelope

public Envelope getScreenEnvelope()
Returns a copy of the screen Envelope used to create this converter.


toScreenX

public int toScreenX(double inX)
Converts the given world coordinate in X to a screen pixel coordinate in X.


toScreenY

public int toScreenY(double inY)
Converts the given world coordinate in Y to a screen pixel coordinate in Y.


toWorldX

public double toWorldX(int inX)
Converts the given screen X pixel coordinate to a world X coordinate.


toWorldY

public double toWorldY(int inY)
Converts the given screen Y pixel coordinate to a world Y coordinate.


getWorldWidth

public double getWorldWidth()
Return the width of the world


getWorldHeight

public double getWorldHeight()
Retrieve the height of the world


getScreenWidth

public double getScreenWidth()
Return the width of the screen


getScreenHeight

public double getScreenHeight()
Return the height of the screen