com.bbn.openmap.dataAccess.dted
Class DTEDDirectoryHandler

java.lang.Object
  extended by com.bbn.openmap.dataAccess.dted.DTEDDirectoryHandler
All Implemented Interfaces:
PropertyConsumer

public class DTEDDirectoryHandler
extends java.lang.Object
implements PropertyConsumer

DTEDDirectoryHandler is a wrapper for a DTEDNameTranslator used for a DTED directory. The DTEDNameTranslator has the intelligence to know how file names and paths are represented for different lat/lon/level combinations for DTED files within a directory.


Field Summary
static java.lang.String PathProperty
          The property for the path to the DTED directory.
protected  java.lang.String prefix
          Property prefix for properties, used as a scoping mechanism.
protected  DTEDNameTranslator translator
          The DTEDNameTranslator for this handler, which knows how to match up lat/lons with a DTED file name.
static java.lang.String TranslatorClassProperty
          The class name for the DTEDNameTranslator to be used for this path.
 
Fields inherited from interface com.bbn.openmap.PropertyConsumer
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty
 
Constructor Summary
DTEDDirectoryHandler()
           
DTEDDirectoryHandler(java.lang.String dtedDirectory)
          Create a DTEDDirectoryHandler with a StandardDTEDNameTranslator, looking at the provided dted directory.
 
Method Summary
 java.lang.String getDirectoryPath()
          Gets the directory path from the translator.
 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.
 DTEDNameTranslator getTranslator()
          Get the translator for this DTEDDirectoryHandler.
 void setDirectoryPath(java.lang.String path)
          Sets the DTED directory path on the translator if it isn't null.
 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 propertyPrefix)
          Set the property key prefix that should be used by the PropertyConsumer.
 void setTranslator(DTEDNameTranslator dnt)
          Set the DTEDNameTranslator for this DTEDDirectoryHandler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PathProperty

public static final java.lang.String PathProperty
The property for the path to the DTED directory.

See Also:
Constant Field Values

TranslatorClassProperty

public static final java.lang.String TranslatorClassProperty
The class name for the DTEDNameTranslator to be used for this path. If none is provided, the StandardDTEDNameTranslator will be used, which follows the DTED specification.

See Also:
Constant Field Values

prefix

protected java.lang.String prefix
Property prefix for properties, used as a scoping mechanism.


translator

protected DTEDNameTranslator translator
The DTEDNameTranslator for this handler, which knows how to match up lat/lons with a DTED file name. A StandardDTEDNameTranslator is set initially, but the actual object can be reset programmatically or with properties.

Constructor Detail

DTEDDirectoryHandler

public DTEDDirectoryHandler()

DTEDDirectoryHandler

public DTEDDirectoryHandler(java.lang.String dtedDirectory)
Create a DTEDDirectoryHandler with a StandardDTEDNameTranslator, looking at the provided dted directory.

Parameters:
dtedDirectory -
Method Detail

setTranslator

public void setTranslator(DTEDNameTranslator dnt)
Set the DTEDNameTranslator for this DTEDDirectoryHandler.


getTranslator

public DTEDNameTranslator getTranslator()
Get the translator for this DTEDDirectoryHandler.


setDirectoryPath

public void setDirectoryPath(java.lang.String path)
Sets the DTED directory path on the translator if it isn't null. If the translator is null, this method does nothing.


getDirectoryPath

public java.lang.String getDirectoryPath()
Gets the directory path from the translator. Will return null if the translator is null.


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.

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.

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.

setPropertyPrefix

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


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