com.bbn.openmap.layer.vpf
Class LayerGraphicWarehouseSupport

java.lang.Object
  extended by com.bbn.openmap.layer.vpf.LayerGraphicWarehouseSupport
All Implemented Interfaces:
VPFGraphicWarehouse, VPFWarehouse
Direct Known Subclasses:
VPFLayerDCWWarehouse, VPFLayerGraphicWarehouse

public abstract class LayerGraphicWarehouseSupport
extends java.lang.Object
implements VPFGraphicWarehouse

Implement a graphic factory that builds OMGraphics.

See Also:
OMGraphic

Field Summary
protected static float antarcticaThreshold
          HACK around antarctica display problem.
protected  OMGraphicList areaSubList
           
protected  DrawingAttributes drawingAttributes
           
protected  OMGraphicList edgeSubList
           
protected  OMGraphicList graphics
          hang on to the graphics that we build
static java.util.logging.Logger logger
           
protected  OMGraphicList pointSubList
           
protected  OMGraphicList textSubList
           
 
Constructor Summary
LayerGraphicWarehouseSupport()
          Construct an object, initializes graphiclist
 
Method Summary
protected  void addArea(OMGraphic area)
           
protected  void addEdge(OMGraphic edge)
           
protected  void addPoint(OMGraphic point)
           
protected  void addText(OMGraphic text)
           
 boolean checkLibraryForUsage(java.lang.String libName)
          Utility method to check if the specified library name has been set by the configuration as one to use.
 void clear()
          Clears the contained list of graphics.
static OMPoly createAreaOMPoly(java.util.List<CoordFloatString> ipts, int totalSize, LatLonPoint ll1, LatLonPoint ll2, double dpplat, double dpplon, boolean doAntarcticaWorkaround)
          create a filled polygon
static OMPoly createEdgeOMPoly(CoordFloatString coords, LatLonPoint ll1, LatLonPoint ll2, double dpplat, double dpplon)
          Create an OMPoly corresponding to a VPF edge feature
static OMPoint createOMPoint(double latitude, double longitude)
          Create an OMPoint object corresponding to a VPF node feature
static OMText createOMText(java.lang.String text, double latitude, double longitude)
          Create an OMText object corresponding to a VPF text feature
protected static int doThinning(java.util.List<java.lang.Object> ipts)
          do fan compression of raw edge points
 boolean drawAreaFeatures()
          Return true if we may draw some area features.
 boolean drawCPointFeatures()
          Return true if we may draw some connected point features.
 boolean drawEdgeFeatures()
          Return true if we may draw some edge features.
 boolean drawEPointFeatures()
          Return true if we may draw some entity point features.
 boolean drawTextFeatures()
          Return true if we may draw some text features.
 DrawingAttributes getDrawingAttributes()
          Get the DrawingAttributes used for the coverage type.
static double getFanEpsilon()
          Get fan compression epsilon.
 java.lang.String getFeatureString()
           
 OMGraphicList getGraphics()
          Get the current graphics list.
protected  OMGraphicList getGraphics(OMGraphicList addToList)
          Add the area, edge, text and point sublists to the provided list.
 java.awt.Component getGUI(LibrarySelectionTable lst)
          Return the GUI for certain warehouse attributes.
 java.util.Properties getProperties(java.util.Properties props)
          set drawing attribute properties
 java.util.List<java.lang.String> getUseLibraries()
          Get the VPF library names to use.
protected  void initDrawingAttributes()
          Called from super class constructor.
static boolean isDoThinning()
          Are we thinning?.
 void resetForCAT()
          Lets the warehouse know that a different CoverageAttributeTable will be using it.
 void setAreaFeatures(boolean newvalue)
          set if we draw area features
 void setCPointFeatures(boolean newvalue)
          set if we draw connected point features
static void setDoThinning(boolean value)
          Set doThinning.
 void setDrawingAttributes(DrawingAttributes da)
          Set the drawing attributes for the coverage type.
 void setEdgeFeatures(boolean newvalue)
          set if we draw edge features
 void setEPointFeatures(boolean newvalue)
          set if we draw entity point features
static void setFanEpsilon(double value)
          Set fan compression epsilon.
 void setFeatures(java.lang.String features)
          Sets the features (lines, areas, text, points) that get displayed
 void setProperties(java.lang.String prefix, java.util.Properties props)
          set drawing attribute properties
 void setTextFeatures(boolean newvalue)
          set if we draw text features
 void setUseLibraries(java.util.List<java.lang.String> lib)
          Set the VPF library names to use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.bbn.openmap.layer.vpf.VPFGraphicWarehouse
createArea, createEdge, createNode, createText
 
Methods inherited from interface com.bbn.openmap.layer.vpf.VPFWarehouse
getFeatures
 

Field Detail

logger

public static java.util.logging.Logger logger

drawingAttributes

protected DrawingAttributes drawingAttributes

antarcticaThreshold

protected static final transient float antarcticaThreshold
HACK around antarctica display problem.


graphics

protected OMGraphicList graphics
hang on to the graphics that we build


areaSubList

protected OMGraphicList areaSubList

edgeSubList

protected OMGraphicList edgeSubList

textSubList

protected OMGraphicList textSubList

pointSubList

protected OMGraphicList pointSubList
Constructor Detail

LayerGraphicWarehouseSupport

public LayerGraphicWarehouseSupport()
Construct an object, initializes graphiclist

Method Detail

initDrawingAttributes

protected void initDrawingAttributes()
Called from super class constructor.


getGraphics

public OMGraphicList getGraphics()
Get the current graphics list.

Returns:
the OMGraphicList.

getGraphics

protected OMGraphicList getGraphics(OMGraphicList addToList)
Add the area, edge, text and point sublists to the provided list.


getDrawingAttributes

public DrawingAttributes getDrawingAttributes()
Get the DrawingAttributes used for the coverage type.


setDrawingAttributes

public void setDrawingAttributes(DrawingAttributes da)
Set the drawing attributes for the coverage type.


resetForCAT

public void resetForCAT()
Lets the warehouse know that a different CoverageAttributeTable will be using it. Default action is to do nothing.

Specified by:
resetForCAT in interface VPFWarehouse

setUseLibraries

public void setUseLibraries(java.util.List<java.lang.String> lib)
Set the VPF library names to use. If null, all libraries will be searched. Null is default.

Specified by:
setUseLibraries in interface VPFWarehouse

getUseLibraries

public java.util.List<java.lang.String> getUseLibraries()
Get the VPF library names to use.

Specified by:
getUseLibraries in interface VPFWarehouse

checkLibraryForUsage

public boolean checkLibraryForUsage(java.lang.String libName)
Utility method to check if the specified library name has been set by the configuration as one to use.

Specified by:
checkLibraryForUsage in interface VPFWarehouse
Parameters:
libName - the library name to test
Returns:
true if the useLibrary list has not been set, is empty, or if the provided name starts with a useList entry on it (good for sets of libraries).

getGUI

public java.awt.Component getGUI(LibrarySelectionTable lst)
Return the GUI for certain warehouse attributes. By default, return the GUI for the DrawingAttributes object being used for rendering attributes of the graphics.

Specified by:
getGUI in interface VPFWarehouse
Parameters:
lst - LibrarySelectionTable to use to get information about the data, if needed. Not needed here.

clear

public void clear()
Clears the contained list of graphics.


addArea

protected void addArea(OMGraphic area)

addEdge

protected void addEdge(OMGraphic edge)

addText

protected void addText(OMGraphic text)

addPoint

protected void addPoint(OMGraphic point)

setEdgeFeatures

public void setEdgeFeatures(boolean newvalue)
set if we draw edge features

Parameters:
newvalue - true for drawing, false otherwise

drawEdgeFeatures

public boolean drawEdgeFeatures()
Return true if we may draw some edge features.

Specified by:
drawEdgeFeatures in interface VPFWarehouse

setTextFeatures

public void setTextFeatures(boolean newvalue)
set if we draw text features

Parameters:
newvalue - true for drawing, false otherwise

drawTextFeatures

public boolean drawTextFeatures()
Return true if we may draw some text features.

Specified by:
drawTextFeatures in interface VPFWarehouse

setAreaFeatures

public void setAreaFeatures(boolean newvalue)
set if we draw area features

Parameters:
newvalue - true for drawing, false otherwise

drawAreaFeatures

public boolean drawAreaFeatures()
Return true if we may draw some area features.

Specified by:
drawAreaFeatures in interface VPFWarehouse

setEPointFeatures

public void setEPointFeatures(boolean newvalue)
set if we draw entity point features

Parameters:
newvalue - true for drawing, false otherwise

drawEPointFeatures

public boolean drawEPointFeatures()
Return true if we may draw some entity point features.

Specified by:
drawEPointFeatures in interface VPFWarehouse

setCPointFeatures

public void setCPointFeatures(boolean newvalue)
set if we draw connected point features

Parameters:
newvalue - true for drawing, false otherwise

drawCPointFeatures

public boolean drawCPointFeatures()
Return true if we may draw some connected point features.

Specified by:
drawCPointFeatures in interface VPFWarehouse

setFeatures

public void setFeatures(java.lang.String features)
Sets the features (lines, areas, text, points) that get displayed

Parameters:
features - a whitespace-separated list of features to display

getFeatureString

public java.lang.String getFeatureString()

setProperties

public void setProperties(java.lang.String prefix,
                          java.util.Properties props)
set drawing attribute properties

Parameters:
prefix - the prefix for our properties
props - the Properties object we use to look up values

getProperties

public java.util.Properties getProperties(java.util.Properties props)
set drawing attribute properties

Parameters:
props - the Properties object.

createAreaOMPoly

public static OMPoly createAreaOMPoly(java.util.List<CoordFloatString> ipts,
                                      int totalSize,
                                      LatLonPoint ll1,
                                      LatLonPoint ll2,
                                      double dpplat,
                                      double dpplon,
                                      boolean doAntarcticaWorkaround)
create a filled polygon

Parameters:
ipts - a list of CoordFloatString objects
totalSize - the total number of points
dpplat - threshold for latitude thinning (passed to warehouse)
dpplon - threshold for longitude thinngin (passed to warehouse)
ll1 - upperleft of selection region (passed to warehouse)
ll2 - lowerright of selection region (passed to warehouse)
doAntarcticaWorkaround - hack for funny DCW antarctica data (passed to warehouse)

createEdgeOMPoly

public static OMPoly createEdgeOMPoly(CoordFloatString coords,
                                      LatLonPoint ll1,
                                      LatLonPoint ll2,
                                      double dpplat,
                                      double dpplon)
Create an OMPoly corresponding to a VPF edge feature

Parameters:
coords - the coordinates to use for the poly
ll1 - upper left, used for clipping
ll2 - lower right, used for clipping
dpplat - used for latitude thinning
dpplon - used for longitude thinning

setDoThinning

public static void setDoThinning(boolean value)
Set doThinning.

Parameters:
value - boolean

isDoThinning

public static boolean isDoThinning()
Are we thinning?.

Returns:
boolean

setFanEpsilon

public static void setFanEpsilon(double value)
Set fan compression epsilon.

Parameters:
value - double

getFanEpsilon

public static double getFanEpsilon()
Get fan compression epsilon.

Returns:
double

doThinning

protected static int doThinning(java.util.List<java.lang.Object> ipts)
do fan compression of raw edge points


createOMText

public static OMText createOMText(java.lang.String text,
                                  double latitude,
                                  double longitude)
Create an OMText object corresponding to a VPF text feature

Parameters:
text - the text
latitude - the latitude of where to place the text
longitude - the longitude of where to place the text

createOMPoint

public static OMPoint createOMPoint(double latitude,
                                    double longitude)
Create an OMPoint object corresponding to a VPF node feature

Parameters:
latitude - the latitude of where to place the text
longitude - the longitude of where to place the text


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