com.bbn.openmap.dataAccess.mapTile
Class SimpleEmptyTileHandler

java.lang.Object
  extended by com.bbn.openmap.dataAccess.mapTile.SimpleEmptyTileHandler
All Implemented Interfaces:
EmptyTileHandler, PropertyConsumer
Direct Known Subclasses:
ShpFileEmptyTileHandler

public class SimpleEmptyTileHandler
extends java.lang.Object
implements EmptyTileHandler, PropertyConsumer

An EmptyTileHandler that uses DrawingAttributes to create a rectangle to fill in for empty tiles. You can set one of these up using the properties for a MapTileLayer, and those properties will trickle down through the MapTileServer, which will in turn create one of these.

 emptyTileHandler=com.bbn.openmap.dataAccess.mapTile.SimpleEmptyTileHandler
 # clear with black edges by default if not specified
 background.fillColor=hex RGB color
 background.lineColor=hex RGB color
 # if not specified for levels with no tiles at all, background will look blocky
 noCoverageZoom=zoom level when you don't want empty tiles, you want no coverage tiles
 # optional, will be clear otherwise
 noCoverage.fillColor=hex RGB color
 noCoverage.lineColor=hex RGB color
 noCoverage.fillPattern=path to resource, file or URL of pattern to use for tile fill.
 

Author:
ddietrick

Field Summary
static java.lang.String BACKGROUND_PROPERTY
           
protected  DrawingAttributes backgroundAtts
           
protected static java.util.logging.Logger logger
           
static java.lang.String NO_COVERAGE_ZOOM_PROPERTY
           
protected  DrawingAttributes noCoverageAtts
           
protected  int noCoverageZoom
          The zoom level at which point the EmptyTileHandler will create no-coverage tiles, if defined.
protected  java.lang.String prefix
           
static int TILE_SIZE
           
 
Fields inherited from interface com.bbn.openmap.PropertyConsumer
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty
 
Constructor Summary
SimpleEmptyTileHandler()
           
 
Method Summary
 DrawingAttributes getBackgroundAtts()
           
 java.awt.image.BufferedImage getImageForEmptyTile(java.lang.String imagePath, int x, int y, int zoomLevel, MapTileCoordinateTransform mtcTransform, Projection proj)
          The main call from the MapTileFactory to return something for the given missing tile.
 DrawingAttributes getNoCoverageAtts()
           
 int getNoCoverageZoom()
           
 java.util.Properties getProperties(java.util.Properties props)
          Method to fill in a Properties object, reflecting the current values of the PropertyConsumer.
 java.util.Properties getPropertyInfo(java.util.Properties props)
          Method to fill in a Properties object with values reflecting the properties able to be set on this PropertyConsumer.
 java.lang.String getPropertyPrefix()
          Get the property key prefix that is being used to prepend to the property keys for Properties lookups.
 void setBackgroundAtts(DrawingAttributes backgroundAtts)
           
 void setNoCoverageAtts(DrawingAttributes noCoverageAtts)
          Set to null to have nothing returned for tiles outside of the coverage zone.
 void setNoCoverageZoom(int noCoverageZoom)
           
 void setProperties(java.util.Properties props)
          Method to set the properties in the PropertyConsumer.
 void setProperties(java.lang.String prefix, java.util.Properties props)
          Method to set the properties in the PropertyConsumer.
 void setPropertyPrefix(java.lang.String pref)
          Set the property key prefix that should be used by the PropertyConsumer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static java.util.logging.Logger logger

BACKGROUND_PROPERTY

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

NO_COVERAGE_ZOOM_PROPERTY

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

TILE_SIZE

public static final int TILE_SIZE
See Also:
Constant Field Values

backgroundAtts

protected DrawingAttributes backgroundAtts

noCoverageAtts

protected DrawingAttributes noCoverageAtts

prefix

protected java.lang.String prefix

noCoverageZoom

protected int noCoverageZoom
The zoom level at which point the EmptyTileHandler will create no-coverage tiles, if defined.

Constructor Detail

SimpleEmptyTileHandler

public SimpleEmptyTileHandler()
Method Detail

getImageForEmptyTile

public java.awt.image.BufferedImage getImageForEmptyTile(java.lang.String imagePath,
                                                         int x,
                                                         int y,
                                                         int zoomLevel,
                                                         MapTileCoordinateTransform mtcTransform,
                                                         Projection proj)
Description copied from interface: EmptyTileHandler
The main call from the MapTileFactory to return something for the given missing tile.

Specified by:
getImageForEmptyTile in interface EmptyTileHandler
Parameters:
imagePath - the path of the missing tile that is going to be used as cache lookup later.
x - the uv x coordinate of the tile.
y - the uv y coordinate of the tile.
zoomLevel - the zoom level of the tile.
mtcTransform - the transform that converts x,y coordinates to lat/lon and describes the layout of the uv tile coordinates.
proj - the map projection, in case that matters what should be returned for the empty tile.
Returns:
BufferedImage for image tile

setPropertyPrefix

public void setPropertyPrefix(java.lang.String pref)
Description copied from interface: PropertyConsumer
Set the property key prefix that should be used by the PropertyConsumer. The prefix, along with a '.', should be prepended to the property keys known by the PropertyConsumer.

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

getPropertyPrefix

public java.lang.String getPropertyPrefix()
Description copied from interface: PropertyConsumer
Get the property key prefix that is being used to prepend to the property keys for Properties lookups.

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

setProperties

public void setProperties(java.util.Properties props)
Description copied from interface: PropertyConsumer
Method to set the properties in the PropertyConsumer. It is assumed that the properties do not have a prefix associated with them, or that the prefix has already been set.

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)
Description copied from interface: PropertyConsumer
Method to set the properties in the PropertyConsumer. The prefix is a string that should be prepended to each property key (in addition to a separating '.') in order for the PropertyConsumer to uniquely identify properties meant for it, in the midst of of Properties meant for several objects.

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)
Description copied from interface: PropertyConsumer
Method to fill in a Properties object, reflecting the current values of the PropertyConsumer. If the PropertyConsumer has a prefix set, the property keys should have that prefix plus a separating '.' prepended to each property key it uses for configuration.

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)
Description copied from interface: PropertyConsumer
Method to fill in a Properties object with values reflecting the properties able to be set on this PropertyConsumer. The key for each property should be the raw property name (without a prefix) with a value that is a String that describes what the property key represents, along with any other information about the property that would be helpful (range, default value, etc.).

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.

getBackgroundAtts

public DrawingAttributes getBackgroundAtts()
Returns:
the backgroundAtts

setBackgroundAtts

public void setBackgroundAtts(DrawingAttributes backgroundAtts)
Parameters:
backgroundAtts - the backgroundAtts to set

getNoCoverageAtts

public DrawingAttributes getNoCoverageAtts()
Returns:
the noCoverageAtts

setNoCoverageAtts

public void setNoCoverageAtts(DrawingAttributes noCoverageAtts)
Set to null to have nothing returned for tiles outside of the coverage zone.

Parameters:
noCoverageAtts - the noCoverageAtts to set

getNoCoverageZoom

public int getNoCoverageZoom()
Returns:
the noCoverageZoom

setNoCoverageZoom

public void setNoCoverageZoom(int noCoverageZoom)
Parameters:
noCoverageZoom - the noCoverageZoom to set


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