com.partnersoft.modules.inspection.ephemera
Class GridSnappingEphemeron

java.lang.Object
  extended by com.partnersoft.modules.inspection.ephemera.AbstractEphemeronPointGeometry
      extended by com.partnersoft.modules.inspection.ephemera.GridSnappingEphemeron
All Implemented Interfaces:
com.partnersoft.maps.ephemera.Ephemeron

public class GridSnappingEphemeron
extends AbstractEphemeronPointGeometry

Copyright 2009 Partner Software, Inc.

Version:
$Id$
Author:
Rich Stepanski

Constructor Summary
GridSnappingEphemeron(com.partnersoft.maps.ephemera.Ephemeron ephemeron, com.partnersoft.geometry.xy.XyGrid grid)
          Creates a new GridSnappingEphemeron for the passed grid.
 
Method Summary
 com.partnersoft.geometry.xy.XyPoint findGeometry(com.partnersoft.maps.render.DrawingSurface surface, com.partnersoft.maps.model.MapViewFrame frame, com.partnersoft.geometry.xy.XyPoint mousePosition)
          Returns the nearest grid cell to the current mouse position.
 
Methods inherited from class com.partnersoft.modules.inspection.ephemera.AbstractEphemeronPointGeometry
draw
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridSnappingEphemeron

public GridSnappingEphemeron(com.partnersoft.maps.ephemera.Ephemeron ephemeron,
                             com.partnersoft.geometry.xy.XyGrid grid)
Creates a new GridSnappingEphemeron for the passed grid. If maxRow or maxColumn is < 0 they will not be used to clip allowed cells.

Parameters:
ephemeron - - ephemeron to draw at cell center.
grid - - grid to use.
Method Detail

findGeometry

public com.partnersoft.geometry.xy.XyPoint findGeometry(com.partnersoft.maps.render.DrawingSurface surface,
                                                        com.partnersoft.maps.model.MapViewFrame frame,
                                                        com.partnersoft.geometry.xy.XyPoint mousePosition)
Returns the nearest grid cell to the current mouse position. If max column and max row are set, the cell's column/row values are compared against the maximums. If they are >= the maximums, null is returned.

Specified by:
findGeometry in class AbstractEphemeronPointGeometry
Returns:
nearest grid cell center, or null if beyond row,column limits.