com.partnersoft.v3x.graphics
Class GridSystem

java.lang.Object
  extended by com.partnersoft.v3x.graphics.GridSystem
All Implemented Interfaces:
java.io.Serializable

public class GridSystem
extends java.lang.Object
implements java.io.Serializable

A multi-level gridded coordinate system. Defines the origin and bounds of the gridded space, * the levels of grid available and provides conversion to and from * map coordinates. These come in many varieties - grid levels use numbers or letters, come in ones or twos, start with different numbers, are variable numbers of cells wide and tall, etc. etc.

See Also:
Serialized Form

Constructor Summary
GridSystem()
          Creates a new, blank GridSystem.
 
Method Summary
 Coord2D centerOf(GridCoordinate coord)
          Returns the coordinate at the center of the GridCoordinate.
 DoubleRectangle extentsOf(GridCoordinate coord)
          Returns the extents of the GridCoordinate's cell.
 Coord2D getDimensions()
          Returns the dimensions of the GridSystem.
 double getHeight()
          Height of the entire grid system (often bigger than the extents of the client's actual map set) in map coordinates.
 java.util.ArrayList getLevels()
          A list of the GridLevel subgriddings of the system, ordered from coarsest to finest.
 java.lang.String getNameTransformScript()
           
 Coord2D getOrigin()
          Returns the origin of the GridSystem.
 double getOriginX()
          X coordinate of origin (SW corner) of the grid.
 double getOriginY()
          Y coordinate of origin (SW corner) of the grid.
 java.lang.String getTransformScript()
           
 double getWidth()
          Width of the entire grid system (often bigger than the extents of the client's actual map set) in map coordinates.
 GridCoordinate gridCoordinateContaining(int level, Coord2D point)
          Returns the GridCoordinate containing the given point at the given level.
 GridCoordinate gridCoordinateNamed(java.lang.String name)
          Returns the named GridCoordinate, or null if none matches.
 Coord2D originOf(GridCoordinate coord)
          Returns the southwest corner of the given GridCoordinate's cell.
 void setHeight(double newHeight)
           
 void setLevels(java.util.ArrayList newLevels)
           
 void setNameTransformScript(java.lang.String newScript)
           
 void setOriginX(double newOriginX)
           
 void setOriginY(double newOriginY)
           
 void setTransformScript(java.lang.String newScript)
           
 void setWidth(double newWidth)
           
 java.lang.String toString(GridCoordinate coord)
          Converts a grid coordinate to a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridSystem

public GridSystem()
Creates a new, blank GridSystem.

Method Detail

gridCoordinateNamed

public GridCoordinate gridCoordinateNamed(java.lang.String name)
Returns the named GridCoordinate, or null if none matches.


gridCoordinateContaining

public GridCoordinate gridCoordinateContaining(int level,
                                               Coord2D point)
Returns the GridCoordinate containing the given point at the given level.


centerOf

public Coord2D centerOf(GridCoordinate coord)
Returns the coordinate at the center of the GridCoordinate.


extentsOf

public DoubleRectangle extentsOf(GridCoordinate coord)
Returns the extents of the GridCoordinate's cell.


originOf

public Coord2D originOf(GridCoordinate coord)
Returns the southwest corner of the given GridCoordinate's cell.


toString

public java.lang.String toString(GridCoordinate coord)
Converts a grid coordinate to a String.


getLevels

public java.util.ArrayList getLevels()
A list of the GridLevel subgriddings of the system, ordered from coarsest to finest. Each successive level is a subdivision of the previous; the top level is a subdivision of the total extents rectangle.


setLevels

public void setLevels(java.util.ArrayList newLevels)

getDimensions

public Coord2D getDimensions()
Returns the dimensions of the GridSystem.


getOrigin

public Coord2D getOrigin()
Returns the origin of the GridSystem.


getHeight

public double getHeight()
Height of the entire grid system (often bigger than the extents of the client's actual map set) in map coordinates.


setHeight

public void setHeight(double newHeight)

getWidth

public double getWidth()
Width of the entire grid system (often bigger than the extents of the client's actual map set) in map coordinates.


setWidth

public void setWidth(double newWidth)

getOriginX

public double getOriginX()
X coordinate of origin (SW corner) of the grid.


setOriginX

public void setOriginX(double newOriginX)

getOriginY

public double getOriginY()
Y coordinate of origin (SW corner) of the grid.


setOriginY

public void setOriginY(double newOriginY)

getTransformScript

public java.lang.String getTransformScript()

setTransformScript

public void setTransformScript(java.lang.String newScript)

getNameTransformScript

public java.lang.String getNameTransformScript()

setNameTransformScript

public void setNameTransformScript(java.lang.String newScript)