com.bbn.openmap.layer.shape
Class SpatialIndexHandler

java.lang.Object
  extended by com.bbn.openmap.layer.shape.SpatialIndexHandler
All Implemented Interfaces:
PropertyConsumer

public class SpatialIndexHandler
extends java.lang.Object
implements PropertyConsumer

The SpatialIndexHandler keeps track of all the stuff dealing with a particular shape file - file names, colors, etc. You can ask it to create OMGraphics based on a bounding box, and make adjustments to it through its GUI. This is the object to use if you just want to deal with the contents of a shape file but not display them.


Field Summary
protected  boolean buffered
           
protected  OMGraphicList bufferedList
          Master list for buffering.
static java.lang.String BufferedProperty
           
protected  GeoCoordTransformation coordTranslator
           
protected  DrawingAttributes drawingAttributes
           
protected  boolean enabled
           
static java.lang.String EnabledProperty
           
protected  I18n i18n
           
protected  java.lang.String imageURLString
           
protected  java.lang.String prettyName
           
protected  java.lang.String propertyPrefix
           
protected  java.lang.String shapeFileName
           
protected  SpatialIndex spatialIndex
           
 
Fields inherited from interface com.bbn.openmap.PropertyConsumer
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty
 
Constructor Summary
SpatialIndexHandler()
           
SpatialIndexHandler(java.lang.String prefix, java.util.Properties props)
           
 
Method Summary
protected  void checkSpatialIndexEntries(double xmin, double ymin, double xmax, double ymax, OMGraphicList retList, Projection proj)
          Checks the buffered list of OMGraphics from the shp file and figures out of they intersect the provided bounds.
 boolean close(boolean done)
           
static SpatialIndex create(java.lang.String prefix, java.util.Properties props)
           
 boolean getBuffered()
           
 GeoCoordTransformation getCoordTranslator()
           
 DrawingAttributes getDrawingAttributes()
           
 boolean getEnabled()
           
 OMGraphicList getGraphics(double xmin, double ymin, double xmax, double ymax)
          Create the OMGraphics out of the records that fall inside the bounding box.
 OMGraphicList getGraphics(double xmin, double ymin, double xmax, double ymax, OMGraphicList list)
          Given a bounding box, create OMGraphics from the ESRI records in the shape file.
 OMGraphicList getGraphics(double xmin, double ymin, double xmax, double ymax, OMGraphicList list, Projection proj)
          Given a bounding box, create OMGraphics from the ESRI records in the shape file.
 javax.swing.JComponent getGUI()
          Get the GUI that controls the attributes of the handler.
 java.lang.String getImageURLString()
           
 java.lang.String getPrettyName()
           
 java.util.Properties getProperties(java.util.Properties props)
          Property Consumer method.
 java.util.Properties getPropertyInfo(java.util.Properties props)
          Property Consumer method.
 java.lang.String getPropertyPrefix()
          Property Consumer method.
 java.lang.String getShapeFileName()
           
 SpatialIndex getSpatialIndex()
           
protected  OMGraphicList getWholePlanet()
          Get the graphics for the entire planet.
protected  OMGraphicList getWholePlanet(GeoCoordTransformation dataTransform)
          Get the graphics for the entire planet.
 void setBuffered(boolean set)
           
 void setCoordTranslator(GeoCoordTransformation coordTranslator)
           
 void setDrawingAttributes(DrawingAttributes set)
           
 void setEnabled(boolean set)
           
 void setImageURLString(java.lang.String imageURLString)
           
 void setPrettyName(java.lang.String set)
           
 void setProperties(java.util.Properties props)
          Property Consumer method.
 void setProperties(java.lang.String prefix, java.util.Properties props)
          Property Consumer method.
 void setPropertyPrefix(java.lang.String prefix)
          Property Consumer method.
 void setShapeFileName(java.lang.String shapeFileName)
           
 void setSpatialIndex(SpatialIndex spatialIndex)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

spatialIndex

protected SpatialIndex spatialIndex

shapeFileName

protected java.lang.String shapeFileName

imageURLString

protected java.lang.String imageURLString

coordTranslator

protected GeoCoordTransformation coordTranslator

prettyName

protected java.lang.String prettyName

drawingAttributes

protected DrawingAttributes drawingAttributes

enabled

protected boolean enabled

buffered

protected boolean buffered

propertyPrefix

protected java.lang.String propertyPrefix

EnabledProperty

public static final java.lang.String EnabledProperty
See Also:
Constant Field Values

BufferedProperty

public static final java.lang.String BufferedProperty
See Also:
Constant Field Values

i18n

protected I18n i18n

bufferedList

protected OMGraphicList bufferedList
Master list for buffering. Only used if buffering is enabled.

Constructor Detail

SpatialIndexHandler

public SpatialIndexHandler()

SpatialIndexHandler

public SpatialIndexHandler(java.lang.String prefix,
                           java.util.Properties props)
Method Detail

create

public static SpatialIndex create(java.lang.String prefix,
                                  java.util.Properties props)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getGUI

public javax.swing.JComponent getGUI()
Get the GUI that controls the attributes of the handler.


setPropertyPrefix

public void setPropertyPrefix(java.lang.String prefix)
Property Consumer method.

Specified by:
setPropertyPrefix in interface PropertyConsumer
Parameters:
prefix - the prefix String.

getPropertyPrefix

public java.lang.String getPropertyPrefix()
Property Consumer method.

Specified by:
getPropertyPrefix in interface PropertyConsumer
Returns:
the prefix string

setProperties

public void setProperties(java.util.Properties props)
Property Consumer method.

Specified by:
setProperties in interface PropertyConsumer
Parameters:
props - a properties object that the PropertyConsumer can use to retrieve expected properties it can use for configuration.

setProperties

public void setProperties(java.lang.String prefix,
                          java.util.Properties props)
Property Consumer method.

Specified by:
setProperties in interface PropertyConsumer
Parameters:
prefix - a String used by the PropertyConsumer to prepend to each property value it wants to look up - setList.getProperty(prefix.propertyKey). If the prefix had already been set, then the prefix passed in should replace that previous value.
props - a Properties object that the PropertyConsumer can use to retrieve expected properties it can use for configuration.

getProperties

public java.util.Properties getProperties(java.util.Properties props)
Property Consumer method.

Specified by:
getProperties in interface PropertyConsumer
Parameters:
props - a Properties object to load the PropertyConsumer properties into. If getList equals null, then a new Properties object should be created.
Returns:
Properties object containing PropertyConsumer property values. If getList was not null, this should equal getList. Otherwise, it should be the Properties object created by the PropertyConsumer.

getPropertyInfo

public java.util.Properties getPropertyInfo(java.util.Properties props)
Property Consumer method.

Specified by:
getPropertyInfo in interface PropertyConsumer
Parameters:
props - a Properties object to load the PropertyConsumer properties into. If getList equals null, then a new Properties object should be created.
Returns:
Properties object containing PropertyConsumer property values. If getList was not null, this should equal getList. Otherwise, it should be the Properties object created by the PropertyConsumer.

getCoordTranslator

public GeoCoordTransformation getCoordTranslator()

setCoordTranslator

public void setCoordTranslator(GeoCoordTransformation coordTranslator)

getGraphics

public OMGraphicList getGraphics(double xmin,
                                 double ymin,
                                 double xmax,
                                 double ymax)
                          throws java.io.IOException,
                                 FormatException
Create the OMGraphics out of the records that fall inside the bounding box.

Parameters:
xmin - double for the min horizontal limit of the bounding box.
ymin - double for the min vertical limit of the bounding box.
xmax - double for the max horizontal limit of the bounding box.
ymax - double for the max vertical limit of the bounding box.
Throws:
java.io.IOException
FormatException

getGraphics

public OMGraphicList getGraphics(double xmin,
                                 double ymin,
                                 double xmax,
                                 double ymax,
                                 OMGraphicList list)
                          throws java.io.IOException,
                                 FormatException
Given a bounding box, create OMGraphics from the ESRI records in the shape file.

Parameters:
xmin - double for the min horizontal limit of the bounding box.
ymin - double for the min vertical limit of the bounding box.
xmax - double for the max horizontal limit of the bounding box.
ymax - double for the max vertical limit of the bounding box.
list - OMGraphic list to add the new OMGraphics too. If null, a new OMGraphicList will be created.
Returns:
OMGraphicList containing the new OMGraphics.
Throws:
java.io.IOException
FormatException

getGraphics

public OMGraphicList getGraphics(double xmin,
                                 double ymin,
                                 double xmax,
                                 double ymax,
                                 OMGraphicList list,
                                 Projection proj)
                          throws java.io.IOException,
                                 FormatException
Given a bounding box, create OMGraphics from the ESRI records in the shape file.

Parameters:
xmin - double for the min horizontal limit of the bounding box.
ymin - double for the min vertical limit of the bounding box.
xmax - double for the max horizontal limit of the bounding box.
ymax - double for the max vertical limit of the bounding box.
list - OMGraphic list to add the new OMGraphics too. If null, a new OMGraphicList will be created.
proj - the projection to use to generate the OMGraphics.
Returns:
OMGraphicList containing the new OMGraphics.
Throws:
java.io.IOException
FormatException

checkSpatialIndexEntries

protected void checkSpatialIndexEntries(double xmin,
                                        double ymin,
                                        double xmax,
                                        double ymax,
                                        OMGraphicList retList,
                                        Projection proj)
                                 throws java.io.IOException,
                                        FormatException
Checks the buffered list of OMGraphics from the shp file and figures out of they intersect the provided bounds.

Parameters:
xmin - minimum longitude, decimal degrees.
ymin - minimum latitude, decimal degrees.
xmax - maximum longitude, decimal degrees.
ymax - maximum latitude, decimal degrees.
retList - the list that passing OMGraphics will be added to.
proj - the current map projection.
Throws:
java.io.IOException
FormatException

getWholePlanet

protected OMGraphicList getWholePlanet()
                                throws java.io.IOException,
                                       FormatException
Get the graphics for the entire planet.

Throws:
java.io.IOException
FormatException

getWholePlanet

protected OMGraphicList getWholePlanet(GeoCoordTransformation dataTransform)
                                throws java.io.IOException,
                                       FormatException
Get the graphics for the entire planet.

Throws:
java.io.IOException
FormatException

setPrettyName

public void setPrettyName(java.lang.String set)

getPrettyName

public java.lang.String getPrettyName()

setBuffered

public void setBuffered(boolean set)

getBuffered

public boolean getBuffered()

setDrawingAttributes

public void setDrawingAttributes(DrawingAttributes set)

getDrawingAttributes

public DrawingAttributes getDrawingAttributes()

getSpatialIndex

public SpatialIndex getSpatialIndex()

setSpatialIndex

public void setSpatialIndex(SpatialIndex spatialIndex)

getShapeFileName

public java.lang.String getShapeFileName()

setShapeFileName

public void setShapeFileName(java.lang.String shapeFileName)

getImageURLString

public java.lang.String getImageURLString()

setImageURLString

public void setImageURLString(java.lang.String imageURLString)

setEnabled

public void setEnabled(boolean set)

getEnabled

public boolean getEnabled()

close

public boolean close(boolean done)


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details