|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.util.cacheHandler.CacheHandler com.bbn.openmap.dataAccess.dted.DTEDFrameCacheHandler
public class DTEDFrameCacheHandler
The DTEDFrameCacheHandler is a cache for objects being rendered on the map as a result of reading in DTED data. It communicates with a DTEDFrameCache to get OMGrid data from the actual DTED data files, and then sets OMGridGenerators on those OMGrids to create representations of the DTED.
The DTEDFrameCacheHandler uses GeneratorLoaders to create OMGridGenerators for its OMGrids. The GeneratorLoaders provide a GUI for controlling those OMGridGenerator parameters. The list of GeneratorLoaders can be set via Properties. In general, properties being set for a DTEDFrameCacheHandler:
markerName.generators=greys colors markerName.greys.class=com.bbn.openmap.omGraphics.grid.SlopeGeneratorLoader markerName.greys.prettyName=Slope Shading markerName.greys.colorsClass=com.bbn.openmap.omGraphics.grid.GreyscaleSlopeColors markerName.colors.class=com.bbn.openmap.omGraphics.grid.SlopeGeneratorLoader markerName.colors.prettyName=Elevation Shading markerName.colors.colorsClass=com.bbn.openmap.omGraphics.grid.ColoredShadingColorsThe only properties that are required for the DTEDFrameCacheHandler are the generators property, and then the .class properties for the generator loader class names. All of the other generator loader properties are sent to the generator loader for interpretation.
The markerName is generally provided by the parent component of the DTEDFrameCacheHandler, like the DTEDFrameCacheLayer.
Field Summary | |
---|---|
protected GeneratorLoader |
activeGeneratorLoader
The active GeneratorLoader providing OMGridGenerators to the OMGrids. |
protected int |
dtedLevel
|
protected boolean |
firstImageReturned
|
protected DTEDFrameCache |
frameCache
The real frame cache. |
protected double |
frameDown
|
protected double |
frameLat
|
protected double |
frameLeft
|
protected double |
frameLon
|
protected double |
frameRight
|
protected double |
frameUp
|
protected java.util.List<GeneratorLoader> |
generatorLoaders
The list of GeneratorLoaders. |
static java.lang.String |
GeneratorLoadersProperty
|
protected boolean |
newframe
|
protected java.lang.String |
propertyPrefix
Token uniquely identifying this component in the application properties. |
Fields inherited from class com.bbn.openmap.util.cacheHandler.CacheHandler |
---|
DEFAULT_MAX_CACHE_SIZE, logger, logicalClock, objs |
Fields inherited from interface com.bbn.openmap.dataAccess.dted.DTEDConstants |
---|
BANDSHADING, BOUNDARYSHADING, COLOREDSHADING, DEFAULT_BANDHEIGHT, DEFAULT_SLOPE_ADJUST, LEVEL_0, LEVEL_1, LEVEL_2, NOSHADING, SLOPESHADING |
Fields inherited from interface com.bbn.openmap.PropertyConsumer |
---|
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty |
Constructor Summary | |
---|---|
protected |
DTEDFrameCacheHandler()
The DTEDFrameCache must be set at some point. |
|
DTEDFrameCacheHandler(DTEDFrameCache dfc)
Create a handler for the DTEDFrameCache. |
Method Summary | |
---|---|
void |
addGeneratorLoader(GeneratorLoader gl)
|
void |
clearGeneratorLoaders()
|
OMGraphic |
get(double lat,
double lon,
int level)
Return an OMGraphic for the Dted Frame, given A lat, lon and dted level. |
int |
getDtedLevel()
Get the DTED level being retrieved from the DTEDFrameCache. |
int |
getElevation(float lat,
float lon)
Get an elevation at a point. |
DTEDFrameCache |
getFrameCache()
Get the DTEDFrameCache. |
OMGridGenerator |
getGenerator()
Get a new OMGridGenerator from the active GeneratorLoader. |
java.util.List<GeneratorLoader> |
getGeneratorLoaders()
|
java.awt.Component |
getGUI()
Get the GUI for the GeneratorLoaders. |
OMGraphic |
getNextImage()
Returns the next OMGraphic image. |
java.util.Properties |
getProperties(java.util.Properties props)
PropertyConsumer method, to fill in a Properties object, reflecting the current values of the OMComponent. |
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. |
OMGraphicList |
getRectangle(Projection proj)
The call to the cache that lets you choose what kind of information is returned. |
CacheObject |
load(java.lang.Object key)
Called from get if the key doesn't exist, to "load" the new object into the cache before returning it. |
CacheObject |
load(java.lang.String key,
double lat,
double lon,
int level)
Load a dted frame into the cache, based on the path of the frame as a key. |
protected OMGraphicList |
loadListFromHandler(OMGraphicList graphics)
Method that pings the cache for images based on the projection that has been set on it. |
void |
propertyChange(java.beans.PropertyChangeEvent pce)
The DTEDFrameCacheHandler needs to sign up as a PropertyChangeListener so if anything on the GeneratorLoader GUI changes, it knows to dump the current representations so they can be rebuild with the current GUI settings. |
boolean |
removeGeneratorLoader(GeneratorLoader gl)
|
void |
setActiveGeneratorLoader(java.lang.String active)
Set the active GeneratorLoader based on a pretty name from one of the loaders. |
void |
setDtedLevel(int level)
Set the DTED level to get from the DTEDFrameCache. |
void |
setFrameCache(DTEDFrameCache dfc)
Set the DTEDFrameCache. |
void |
setGeneratorLoaders(java.util.List<GeneratorLoader> generatorLoaders)
|
void |
setProjection(Projection proj)
The method to call to let the cache handler know what the projection looks like so it can figure out which frames (and subframes) will be needed. |
void |
setProjection(Projection proj,
double lat1,
double lon1,
double lat2,
double lon2)
The method to call to let the cache handler know what the projection looks like so it can figure out which frames (and subframes) will be needed. |
void |
setProperties(java.util.Properties props)
Sets the properties for the OMComponent. |
void |
setProperties(java.lang.String prefix,
java.util.Properties props)
Sets the properties for the OMComponent. |
void |
setPropertyPrefix(java.lang.String prefix)
Set the property key prefix that should be used by the PropertyConsumer. |
Methods inherited from class com.bbn.openmap.util.cacheHandler.CacheHandler |
---|
clear, get, getCacheSize, listIterator, replaceLeastUsed, resetCache, resetCache, searchCache |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String GeneratorLoadersProperty
protected DTEDFrameCache frameCache
protected double frameUp
protected double frameDown
protected double frameLeft
protected double frameRight
protected boolean firstImageReturned
protected double frameLon
protected double frameLat
protected boolean newframe
protected int dtedLevel
protected GeneratorLoader activeGeneratorLoader
protected java.util.List<GeneratorLoader> generatorLoaders
protected java.lang.String propertyPrefix
Constructor Detail |
---|
protected DTEDFrameCacheHandler()
public DTEDFrameCacheHandler(DTEDFrameCache dfc)
Method Detail |
---|
public void setFrameCache(DTEDFrameCache dfc)
public DTEDFrameCache getFrameCache()
public int getElevation(float lat, float lon)
public void setDtedLevel(int level)
public int getDtedLevel()
public void setActiveGeneratorLoader(java.lang.String active)
public OMGridGenerator getGenerator()
public java.awt.Component getGUI()
public OMGraphicList getRectangle(Projection proj)
proj
- The projection of the screen (CADRG).
protected OMGraphicList loadListFromHandler(OMGraphicList graphics)
public void setProjection(Projection proj)
proj
- the projection of the screen.public void setProjection(Projection proj, double lat1, double lon1, double lat2, double lon2)
proj
- the projection of the screen.lat1
- latitude of the upper left corner of the window, in decimal
degrees.lon1
- longitude of the upper left corner of the window, in decimal
degrees.lat2
- latitude of the lower right corner of the window, in decimal
degrees.lon2
- longitude of the lower right corner of the window, in decimal
degrees.public OMGraphic getNextImage()
public OMGraphic get(double lat, double lon, int level)
lat
- latitude of pointlon
- longitude of pointlevel
- the dted level wanted (0, 1, 2)
public CacheObject load(java.lang.String key, double lat, double lon, int level)
key
- key to remember raster created for DTED frame.
public CacheObject load(java.lang.Object key)
CacheHandler
load
in class CacheHandler
public void setProperties(java.util.Properties props)
setProperties
in interface PropertyConsumer
props
- the Properties
object.public void setProperties(java.lang.String prefix, java.util.Properties props)
setProperties
in interface PropertyConsumer
prefix
- the token to prefix the property namesprops
- the Properties
objectpublic java.util.Properties getProperties(java.util.Properties props)
getProperties
in interface PropertyConsumer
props
- a Properties object to load the PropertyConsumer properties
into. If props equals null, then a new Properties object should be
created.
public java.util.Properties getPropertyInfo(java.util.Properties list)
getPropertyInfo
in interface PropertyConsumer
list
- a Properties object to load the PropertyConsumer properties
into. If getList equals null, then a new Properties object should
be created.
public void setPropertyPrefix(java.lang.String prefix)
setPropertyPrefix
in interface PropertyConsumer
prefix
- the prefix String.public java.lang.String getPropertyPrefix()
getPropertyPrefix
in interface PropertyConsumer
public void propertyChange(java.beans.PropertyChangeEvent pce)
propertyChange
in interface java.beans.PropertyChangeListener
public java.util.List<GeneratorLoader> getGeneratorLoaders()
public void setGeneratorLoaders(java.util.List<GeneratorLoader> generatorLoaders)
public void clearGeneratorLoaders()
public void addGeneratorLoader(GeneratorLoader gl)
public boolean removeGeneratorLoader(GeneratorLoader gl)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |