com.bbn.openmap.layer.vpf
Class VPFAutoFeatureGraphicWarehouse

java.lang.Object
  extended by com.bbn.openmap.layer.vpf.VPFAutoFeatureGraphicWarehouse
All Implemented Interfaces:
VPFFeatureWarehouse, VPFWarehouse, PropertyConsumer

public class VPFAutoFeatureGraphicWarehouse
extends java.lang.Object
implements VPFFeatureWarehouse, PropertyConsumer

Implement a graphic factory that builds OMGraphics from VPF. Designed to work closely with the VPFFeatureLayer, using GeoSymAttExpression objects to figure out how features are rendered. Uses two files to help manage features. The first file is a symbol lookup file that ties FACC codes and attribute settings with a set of CGM files. This file should cover entries for a particular data set. The second file is a priority file, that lists the order that features should be rendered, by feature type, facc code and attribute settings. If you want to change which features are displayed, or the order in which they are displayed, this is the file to modify.

Both of these files are CSV files, and their fields are important. The lookup file is of the format:

 facc,type,symbol,conditions
 AK160,A,0804,
 AL005,A,0081 0734,
 AL015,P,0002,bfc=81ANDsta=0or2or3or6or11
 AL015,P,0010,bfc=7ANDhwt=0or2or3or4or7or22
 AL015,P,0011,bfc=7ANDhwt=11or14or15or16or20or21
 
Note that the conditions field can be empty.The first field is the 5 character FACC code, the second field is the type (P, A, L) and the third field is the CGM file name.

The priority file is similar:

 priority,type,facc,conditions,description
 0,Area,BA040,
 0,Area,BE010,cvl=99999
 0,Area,BE010,idsm=0 AND cvl>=msdcand<>99999
 0,Area,BE010,idsm=0 AND cvl>=ssdcand<msdc
 
The priority field really isn't important, the order of the overall file is.

See Also:
OMGraphic

Nested Class Summary
protected static class VPFAutoFeatureGraphicWarehouse.FeaturePriorityHolder
          A FeaturePriorityHolder represents a rendering order slot in a list of feature types to be rendered.
 
Field Summary
static java.lang.String CGM_DIR_PROPERTY
           
protected  java.lang.String[] compositeFeatureFaccs
           
protected  java.lang.String debugFacc
          If set, the warehouse will limit visibility to specified facc and print out decision making process.
static int DEFAULT_ICON_SIZE
           
static java.lang.String EV_IDSM
           
static java.lang.String EV_ISDM
           
static java.lang.String EV_MSDC
           
static java.lang.String EV_MSSC
           
static java.lang.String EV_SSDC
           
static java.lang.String FACC_DEBUG_PROPERTY
           
protected  java.util.Hashtable<java.lang.String,java.util.List<VPFAutoFeatureGraphicWarehouse.FeaturePriorityHolder>> faccLookup
           
protected  java.lang.String faccLookupFilePath
           
protected  VPFFeatureInfoHandler featInfoHandler
           
static java.lang.String FEATURE_INFO_HANDLER_PROPERTY
           
protected  java.lang.String geoSymDirectory
           
static java.lang.String ICON_SIZE_PROPERTY
           
protected  int iconSize
           
protected  double idsm
          Interactive Display Selection Mode:ECDIS defines the display of depth zones to be divided into two or four depth areas.
protected  java.lang.String info
           
protected  double isdm
          Interactive Shallow Display Mode:ECDIS defines the display mode of shallow water areas (shallow depth zones) to be one of two symbology scenarios.
protected static java.util.logging.Logger logger
           
protected  double msdc
          Mariner Specified Deep Contour: The four-zone display mode requires the establishment of a deep contour that must be specified by the mariner through application inquiry.
protected  double mssc
          Mariner Specified Shallow Contour - The four-zone display mode requires the establishment of a shallow contour that must be specified by the mariner through application inquiry.
protected  java.lang.String prefix
          The property prefix for scoping properties.
protected  java.util.List<VPFAutoFeatureGraphicWarehouse.FeaturePriorityHolder> priorities
           
static java.lang.String PRIORITY_FILE_PROPERTY
           
protected  java.lang.String priorityFilePath
           
protected  double ssdc
          Ship's Safety Depth Contour: The ships safety depth contour represents a safe contour based on the draft of the ship.
static java.lang.String SYMBOL_LOOKUP_FILE_PROPERTY
           
 
Fields inherited from interface com.bbn.openmap.PropertyConsumer
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty
 
Constructor Summary
VPFAutoFeatureGraphicWarehouse()
           
 
Method Summary
 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.
 OMGraphic createArea(CoverageTable covtable, AreaTable areatable, java.util.List<java.lang.Object> facevec, LatLonPoint ll1, LatLonPoint ll2, double dpplat, double dpplon, java.lang.String featureType, int primID)
          Create an OMPoly for an area described by the facevec.
 OMGraphic createEdge(CoverageTable c, EdgeTable edgetable, java.util.List<java.lang.Object> edgevec, LatLonPoint ll1, LatLonPoint ll2, double dpplat, double dpplon, CoordFloatString coords, java.lang.String featureType, int primID)
           
 OMGraphic createNode(CoverageTable c, NodeTable t, java.util.List<java.lang.Object> nodeprim, double latitude, double longitude, boolean isEntityNode, java.lang.String featureType, int primID)
          Method called by the VPF reader code to construct a node feature.
 OMGraphic createText(CoverageTable c, TextTable texttable, java.util.List<java.lang.Object> textvec, double latitude, double longitude, java.lang.String text, java.lang.String featureType, int primID)
           
 boolean drawAreaFeatures()
          Return true, this is a NOOP for this warehouse.
 boolean drawCPointFeatures()
          Return true, this is a NOOP for this warehouse.
 boolean drawEdgeFeatures()
          Return true, this is a NOOP for this warehouse.
 boolean drawEPointFeatures()
          Return true, this is a NOOP for this warehouse.
 boolean drawTextFeatures()
          Return true, this is a NOOP for this warehouse.
 double getExternalAttribute(java.lang.String rightSide)
           
 VPFFeatureInfoHandler getFeatInfoHandler()
          Set the object used to manage attribute formatting and display for features on the map.
 java.util.List<java.lang.String> getFeatures()
          Get a List of Strings listing all the feature types wanted.
 OMGraphicList getFeatures(LibrarySelectionTable lst, LatLonPoint ll1, LatLonPoint ll2, Projection proj, OMGraphicList omgList)
          This is where the magic happens.
 java.awt.Component getGUI(LibrarySelectionTable lst)
          Get the GUI to control different aspects of the warehouse.
 int getIconSize()
           
 java.util.Properties getProperties(java.util.Properties getList)
          Method to fill in a Properties object, reflecting the current values of the PropertyConsumer.
 java.util.Properties getPropertyInfo(java.util.Properties list)
          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.
static char getType(java.lang.String type)
           
 java.util.List<java.lang.String> getUseLibraries()
          Get a list of VPF library names that should be used, specified at configuration.
 void handleInformationForOMGraphic(OMGraphic omg, FeatureClassInfo fci, java.util.List<java.lang.Object> fcirow)
          Given an OMGraphic that is going to be added to the map, use the FeatureClassInfo to gather attribute information from the fcirow contents.
protected  void init()
          The warehouse is initialized the first time features are fetched.
 boolean needToFetchTileContents(java.lang.String libraryName, java.lang.String currentFeature, TileDirectory currentTile)
           
 void resetForCAT()
          To let the warehouse know that a new CoverageAttributeTable will be using the warehouse.
 void setFeatInfoHandler(VPFFeatureInfoHandler featInfoHandler)
           
 void setIconSize(int iconSize)
           
 void setProperties(java.util.Properties setList)
          Method to set the properties in the PropertyConsumer.
 void setProperties(java.lang.String prefix, java.util.Properties props)
          Set properties of the warehouse.
 void setPropertyPrefix(java.lang.String prefix)
          Set the property key prefix that should be used by the PropertyConsumer.
 void setUseLibraries(java.util.List<java.lang.String> libNames)
          Set the VPF libraries to use, by name.
 
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

CGM_DIR_PROPERTY

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

SYMBOL_LOOKUP_FILE_PROPERTY

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

PRIORITY_FILE_PROPERTY

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

FEATURE_INFO_HANDLER_PROPERTY

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

FACC_DEBUG_PROPERTY

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

ICON_SIZE_PROPERTY

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

DEFAULT_ICON_SIZE

public static final int DEFAULT_ICON_SIZE
See Also:
Constant Field Values

priorities

protected java.util.List<VPFAutoFeatureGraphicWarehouse.FeaturePriorityHolder> priorities

faccLookup

protected java.util.Hashtable<java.lang.String,java.util.List<VPFAutoFeatureGraphicWarehouse.FeaturePriorityHolder>> faccLookup

priorityFilePath

protected java.lang.String priorityFilePath

faccLookupFilePath

protected java.lang.String faccLookupFilePath

geoSymDirectory

protected java.lang.String geoSymDirectory

featInfoHandler

protected VPFFeatureInfoHandler featInfoHandler

iconSize

protected int iconSize

compositeFeatureFaccs

protected java.lang.String[] compositeFeatureFaccs

debugFacc

protected java.lang.String debugFacc
If set, the warehouse will limit visibility to specified facc and print out decision making process.


prefix

protected java.lang.String prefix
The property prefix for scoping properties.


EV_ISDM

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

EV_IDSM

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

EV_SSDC

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

EV_MSDC

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

EV_MSSC

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

isdm

protected double isdm
Interactive Shallow Display Mode:ECDIS defines the display mode of shallow water areas (shallow depth zones) to be one of two symbology scenarios. The attribute values are 1 and 0, which toggle the shallow display mode to be on or off respectively. When ISDM is set on (1), the display of all depth zones shallower than the defined values of the Ships Safety Depth Contour (SSDC) are overprinted with a lattice pattern. This mode can be initiated in the four- or two-depth zone display modes (not including the drying line), defined by the Interactive Display Selection Mode, (IDSM). The shallow display mode is made available due to viewing limitations of the shallow depth zones in night displays.


idsm

protected double idsm
Interactive Display Selection Mode:ECDIS defines the display of depth zones to be divided into two or four depth areas. This variable allows for the mariner to interactively set either display mode. The two-zone mode uses only the ships safety depth contour (SSDC) as a zone separator, whereas the four-zone mode further divides zones based on the mariner selected deep and shallow contours (MSDC, MSSC). Attribute values are 0 and 1 meaning four- and two-zone modes respectively.


ssdc

protected double ssdc
Ship's Safety Depth Contour: The ships safety depth contour represents a safe contour based on the draft of the ship. This value must be entered by the mariner using an application interface. This interface must ensure that if a contour value does not exist within the data, that a next deeper value is specified as the SSDC. This checking must be dynamic as one traverses tile boundaries within the data..


msdc

protected double msdc
Mariner Specified Deep Contour: The four-zone display mode requires the establishment of a deep contour that must be specified by the mariner through application inquiry. A default value may be implemented at 30m according to the ISO Color and Symbol Specification directives.


mssc

protected double mssc
Mariner Specified Shallow Contour - The four-zone display mode requires the establishment of a shallow contour that must be specified by the mariner through application inquiry. A default value may be implemented at 2m according to the ISO Color and Symbol Specification directives.


info

protected java.lang.String info
Constructor Detail

VPFAutoFeatureGraphicWarehouse

public VPFAutoFeatureGraphicWarehouse()
Method Detail

init

protected void init()
The warehouse is initialized the first time features are fetched.


getType

public static char getType(java.lang.String type)

setUseLibraries

public void setUseLibraries(java.util.List<java.lang.String> libNames)
Set the VPF libraries to use, by name. 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 a list of VPF library names that should be used, specified at configuration.

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 the specified string entry (Good for specifying sets of like-libraries).

createArea

public OMGraphic createArea(CoverageTable covtable,
                            AreaTable areatable,
                            java.util.List<java.lang.Object> facevec,
                            LatLonPoint ll1,
                            LatLonPoint ll2,
                            double dpplat,
                            double dpplon,
                            java.lang.String featureType,
                            int primID)
Create an OMPoly for an area described by the facevec.

Specified by:
createArea in interface VPFFeatureWarehouse

createEdge

public OMGraphic createEdge(CoverageTable c,
                            EdgeTable edgetable,
                            java.util.List<java.lang.Object> edgevec,
                            LatLonPoint ll1,
                            LatLonPoint ll2,
                            double dpplat,
                            double dpplon,
                            CoordFloatString coords,
                            java.lang.String featureType,
                            int primID)
Specified by:
createEdge in interface VPFFeatureWarehouse

createText

public OMGraphic createText(CoverageTable c,
                            TextTable texttable,
                            java.util.List<java.lang.Object> textvec,
                            double latitude,
                            double longitude,
                            java.lang.String text,
                            java.lang.String featureType,
                            int primID)
Specified by:
createText in interface VPFFeatureWarehouse

createNode

public OMGraphic createNode(CoverageTable c,
                            NodeTable t,
                            java.util.List<java.lang.Object> nodeprim,
                            double latitude,
                            double longitude,
                            boolean isEntityNode,
                            java.lang.String featureType,
                            int primID)
Method called by the VPF reader code to construct a node feature.

Specified by:
createNode in interface VPFFeatureWarehouse

needToFetchTileContents

public boolean needToFetchTileContents(java.lang.String libraryName,
                                       java.lang.String currentFeature,
                                       TileDirectory currentTile)
Specified by:
needToFetchTileContents in interface VPFFeatureWarehouse

getFeatures

public OMGraphicList getFeatures(LibrarySelectionTable lst,
                                 LatLonPoint ll1,
                                 LatLonPoint ll2,
                                 Projection proj,
                                 OMGraphicList omgList)
                          throws FormatException
This is where the magic happens.

Parameters:
lst - LibrarySelectionTable that lets the warehouse know where the data is and what's in it.
ll1 - upper left coordinate of the desired area.
ll2 - lower right coordinate of the desired area.
proj - the projection for the area, used to generate OMGraphics added to the list.
omgList - the list to add OMGraphics to. One will be created and returned if this is null.
Returns:
the OMGraphicList with OMGraphics for features over desired area.
Throws:
FormatException

drawEdgeFeatures

public boolean drawEdgeFeatures()
Return true, this is a NOOP for this warehouse.

Specified by:
drawEdgeFeatures in interface VPFWarehouse

drawTextFeatures

public boolean drawTextFeatures()
Return true, this is a NOOP for this warehouse.

Specified by:
drawTextFeatures in interface VPFWarehouse

drawAreaFeatures

public boolean drawAreaFeatures()
Return true, this is a NOOP for this warehouse.

Specified by:
drawAreaFeatures in interface VPFWarehouse

drawEPointFeatures

public boolean drawEPointFeatures()
Return true, this is a NOOP for this warehouse.

Specified by:
drawEPointFeatures in interface VPFWarehouse

drawCPointFeatures

public boolean drawCPointFeatures()
Return true, this is a NOOP for this warehouse.

Specified by:
drawCPointFeatures in interface VPFWarehouse

getExternalAttribute

public double getExternalAttribute(java.lang.String rightSide)
Parameters:
rightSide - the string pulled out of the VPF data for attribute comparisons.
Returns:
value greater than 0 for valid strings.

handleInformationForOMGraphic

public void handleInformationForOMGraphic(OMGraphic omg,
                                          FeatureClassInfo fci,
                                          java.util.List<java.lang.Object> fcirow)
Given an OMGraphic that is going to be added to the map, use the FeatureClassInfo to gather attribute information from the fcirow contents.

Parameters:
omg - The OMGraphic representing a feature.
fci - The Description of the columns of the fcirow.
fcirow - The attributes for the feature.

setProperties

public void setProperties(java.util.Properties setList)
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:
setList - 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)
Set properties of the warehouse.

Specified by:
setProperties in interface PropertyConsumer
Parameters:
prefix - the prefix to use for looking up properties.
props - the properties file to look at.

getProperties

public java.util.Properties getProperties(java.util.Properties getList)
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:
getList - 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 list)
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:
list - 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.

setPropertyPrefix

public void setPropertyPrefix(java.lang.String prefix)
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:
prefix - 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

resetForCAT

public void resetForCAT()
Description copied from interface: VPFWarehouse
To let the warehouse know that a new CoverageAttributeTable will be using the warehouse. Some warehouses need to reset some tables for this situation.

Specified by:
resetForCAT in interface VPFWarehouse

getIconSize

public int getIconSize()

setIconSize

public void setIconSize(int iconSize)

getGUI

public java.awt.Component getGUI(LibrarySelectionTable lst)
Description copied from interface: VPFWarehouse
Get the GUI to control different aspects of the warehouse.

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

getFeatures

public java.util.List<java.lang.String> getFeatures()
Description copied from interface: VPFWarehouse
Get a List of Strings listing all the feature types wanted. Returned with the area features first, then text features, then line features, then point features.

Specified by:
getFeatures in interface VPFWarehouse

getFeatInfoHandler

public VPFFeatureInfoHandler getFeatInfoHandler()
Set the object used to manage attribute formatting and display for features on the map.

Returns:
VPFFeatureInfoHandler being used.

setFeatInfoHandler

public void setFeatInfoHandler(VPFFeatureInfoHandler featInfoHandler)


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