com.partnersoft.maps.nomenclature
Class GridSystem

java.lang.Object
  extended by com.partnersoft.maps.nomenclature.GridSystem
All Implemented Interfaces:
Coggable

public class GridSystem
extends java.lang.Object
implements Coggable

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.

Version:
1.0 9/24/97 Copyright 1997-2004 Partner Software, Inc.
Author:
Paul Reavis

Constructor Summary
GridSystem()
          Creates a new, blank GridSystem.
 
Method Summary
 Point centerOf(GridCoordinate coord)
          Returns the coordinate at the center of the GridCoordinate.
 Rectangle extentsOf(GridCoordinate coord)
          Returns the extents of the GridCoordinate's cell.
 Point 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.
 Point 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.
 Cog getState()
           
 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, Point 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.
 Point originOf(GridCoordinate coord)
          Returns the southwest corner of the given GridCoordinate's cell.
 void setHeight(double newHeight)
           
 void setLevels(java.util.ArrayList newLevels)
           
 void setOriginX(double newOriginX)
           
 void setOriginY(double newOriginY)
           
 void setState(Cog newState)
           
 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,
                                               Point point)
Returns the GridCoordinate containing the given point at the given level.


centerOf

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


extentsOf

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


originOf

public Point 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.


setState

public void setState(Cog newState)
Specified by:
setState in interface Coggable

getState

public Cog getState()
Specified by:
getState in interface Coggable

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 Point getDimensions()
Returns the dimensions of the GridSystem.


getOrigin

public Point 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)