gistoolkit.server.mapclient
Class Converter

java.lang.Object
  extended bygistoolkit.server.mapclient.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(Extents inScreenExtents, Extents inWorldExtents)
          Create a converter to convert from the given screen extents to the given world extents, and vice versa.
Converter(Extents inScreenExtents, Extents inWorldExtents, boolean inSquare)
          Create a converter to convert from the given screen extents to the given world extents, and vice versa.
Converter(int inScreenWidth, int inScreenHeight, double inTopX, double inTopY, double inBottomX, double inBottomY)
          Create a converter to convert from the given screen coordinates to the given world coordinates, and vice versa.
 
Method Summary
 int convertX(double inX)
          Convert the given world x coordinate to a corrisponding screen coordinate.
 int convertY(double inY)
           
 Extents getScreenExtents()
          Returns a copy of the screen extents used to create this converter.
 double getScreenHeight()
          Return the height of the screen
 double getScreenWidth()
          Return the width of the screen
 Extents getWorldExtents()
          Returns a copy of the world extents 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(Extents inScreenExtents,
                 Extents inWorldExtents)
Create a converter to convert from the given screen extents to the given world extents, and vice versa.


Converter

public Converter(int inScreenWidth,
                 int inScreenHeight,
                 double inTopX,
                 double inTopY,
                 double inBottomX,
                 double inBottomY)
Create a converter to convert from the given screen coordinates to the given world coordinates, and vice versa.


Converter

public Converter(Extents inScreenExtents,
                 Extents inWorldExtents,
                 boolean inSquare)
Create a converter to convert from the given screen extents to the given world extents, and vice versa.

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)

getWorldExtents

public Extents getWorldExtents()
Returns a copy of the world extents used to create this converter.


getScreenExtents

public Extents getScreenExtents()
Returns a copy of the screen extents 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