com.bbn.openmap.layer.rpf
Class RpfCoverage

java.lang.Object
  |
  +--com.bbn.openmap.layer.rpf.RpfCoverage
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, PropertyConsumer, RpfConstants

public class RpfCoverage
extends java.lang.Object
implements java.awt.event.ActionListener, RpfConstants, PropertyConsumer

This is a tool that provides coverage information on the Rpf data. It is supposed to be a simple tool that lets you see the general location of data, to guide you to the right place and scale of coverage. The layer really uses the properties passed in to it to determine which RPF/A.TOC should be scanned for the data. There is a palette for this layer, that lets you turn off the coverage for different levels of Rpf. Right now, only City Graphics, TLM, JOG, TPC, ONC, JNC, GNC and 5/10 meter CIB scales are are handled. All other scales are tossed together under the misc setting. The City Graphics setting shows all charts for scales greater than than 1:15k.

 
  
   
    
     
      
       The properties for this file are:
        # Java Rpf properties
        # Number between 0-255: 0 is transparent, 255 is opaque
        jrpf.coverageOpaque=255
        #Default is true, don't need this entry if you like it...
        jrpf.CG.showcov=true
        #Default colors don't need this entry
        jrpf.CG.color=CE4F3F
        # Other types can be substituted for CG (TLM, JOG, TPC, ONC, JNC, GNC, CIB10, CIB5, MISC)
        # Fill the rectangle, default is true
        jrpf.coverageFill=true
       
       
      
     
    
   
  
 


Field Summary
protected  boolean cancelled
          Set when the projection has changed while a swing worker is gathering graphics, and we want him to stop early.
protected  java.awt.Color CGColor
          The color to outline the shapes.
protected  java.awt.Color CIB10Color
          The color to outline the shapes.
protected  java.awt.Color CIB5Color
          The color to outline the shapes.
protected  java.awt.Color[] colors
           
protected  RpfCoverageManager coverageManager
           
static java.lang.String CoverageOpaquenessProperty
          Property to use for filled rectangles (when java supports it).
static int defaultCGColorInt
          The default color int value.
static int defaultCIB10ColorInt
          The default color int value.
static int defaultCIB5ColorInt
          The default color int value.
static int defaultGNCColorInt
          The default color int value.
static int defaultJNCColorInt
          The default color int value.
static int defaultJOGColorInt
          The default color int value.
static int defaultMISCColorInt
          The default color int value.
static int defaultONCColorInt
          The default color int value.
static int defaultTLMColorInt
          The default color int value.
static int defaultTPCColorInt
          The default color int value.
static java.lang.String FillProperty
          Property to use to fill rectangles.
protected  boolean fillRects
          Flag to fill the coverage rectangles.
protected  java.awt.Color GNCColor
          The color to outline the shapes.
protected  I18n i18n
           
protected  boolean inUse
          Flag to track when the RpfCoverage is active.
protected  java.awt.Color JNCColor
          The color to outline the shapes.
protected  java.awt.Color JOGColor
          The color to outline the shapes.
protected  Layer layer
          The parent layer.
protected  java.awt.Color MISCColor
          The color to outline the shapes.
protected  java.util.Vector omGraphics
          The graphic list of objects to draw.
protected  java.awt.Color ONCColor
          The color to outline the shapes.
protected  int opaqueness
          A setting for how transparent to make the images.
protected  javax.swing.JFrame paletteWindow
           
protected  java.lang.String propertyPrefix
           
protected  boolean showCG
          Flag to tell the cache to return the coverage for city graphics.
protected  boolean showCIB10
          Flag to tell the cache to return the coverage for 10M CIB.
protected  boolean showCIB5
          Flag to tell the cache to return the coverage for 5M CIB.
protected  boolean showGNC
          Flag to tell the cache to return the coverage for jog.
protected  boolean showJNC
          Flag to tell the cache to return the coverage for jog.
protected  boolean showJOG
          Flag to tell the cache to return the coverage for jog.
protected  boolean showMISC
          Flag to tell the cache to return the coverage for others.
protected  boolean showONC
          Flag to tell the cache to return the coverage for jog.
protected  boolean showPalette
          Show the palette when showing coverage.
protected  boolean showTLM
          Flag to tell the cache to return the coverage for tlm.
protected  boolean showTPC
          Flag to tell the cache to return the coverage for jog.
protected  java.awt.Color TLMColor
          The color to outline the shapes.
protected  java.awt.Color TPCColor
          The color to outline the shapes.
 
Fields inherited from interface com.bbn.openmap.layer.rpf.RpfConstants
A1, A2, A3, A4, AT, AutoFetchAttributeProperty, AuxCacheSizeProperty, BLANK, C1, C2, C3, C4, C5, C6, C7, C8, C9, CA, CacheSizeProperty, CADRG, CB, CC, CD, CDTED, CE, CF, CG, CGColorProperty, CH, ChartSeriesProperty, CIB, CIB10ColorProperty, CIB5ColorProperty, CITYGRAPHICS, CJ, CK, CL, CM, CN, CO, ColormodelProperty, CoverageProperty, CP, CQ, CR, CS, CT, D1, D2, DefaultRPFCoveragePrefix, DT, GN, GNCColorProperty, HA, I1, I2, I3, I4, IM, ImageScaleFactorProperty, JA, JG, JN, JNCColorProperty, JOGColorProperty, JR, KillCacheProperty, LF, LG, lockedButtonTitle, lockSeriesCommand, MISCColorProperty, MM, NumColorsProperty, OA, OI, ON, ONCColorProperty, OpaquenessProperty, OV, RpfPathsProperty, ScaleImagesProperty, showCGCommand, ShowCGProperty, showCIB10Command, ShowCIB10Property, showCIB5Command, ShowCIB5Property, showCoverageCommand, showGNCCommand, ShowGNCProperty, showInfoCommand, ShowInfoProperty, showJNCCommand, ShowJNCProperty, showJOGCommand, ShowJOGProperty, showMapsCommand, ShowMapsProperty, showMISCCommand, ShowMISCProperty, showONCCommand, ShowONCProperty, showTLMCommand, ShowTLMProperty, showTPCCommand, ShowTPCProperty, TC, TF, TL, TLMColorProperty, TOPOLINEMAP, TP, TPCColorProperty, TQ, TT, UK, unlockedButtonTitle, Various, VARIOUS
 
Fields inherited from interface com.bbn.openmap.PropertyConsumer
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty
 
Constructor Summary
RpfCoverage(Layer l)
          The default constructor for the Layer.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          The Action Listener method, that reacts to the palette widgets actions.
 void allCoveragesOn()
           
 void generate(Projection proj)
          Reproject the graphics you have.
protected  java.awt.Color[] getColors()
           
 java.util.Vector getGraphicLists()
           
 java.awt.Component getGUI()
          Provides the palette widgets to control the options of showing maps, or attribute text.
 java.lang.String getInitPropertiesOrder()
          Specify what order properties should be presented in an editor.
protected  java.awt.Color getModifiedColor(java.awt.Color color)
           
 int getOpaqueness()
           
 javax.swing.JFrame getPaletteWindow()
          Get RpfCoverage's associated palette as a top-level window
 java.util.Properties getProperties(java.util.Properties props)
          PropertyConsumer method, to fill in a Properties object, reflecting the current values of the layer.
 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.
 boolean isInUse()
           
 boolean isShowPalette()
           
 void paint(java.awt.Graphics g)
          Paints the layer.
 void prepare(RpfFrameProvider frameProvider, Projection projection, java.lang.String chartSeries)
          Prepares the graphics for the layer.
protected  void resetColors()
           
protected  void setDefaultValues()
          Method that sets all the variables to the default values.
 void setGraphicLists(java.util.Vector lists)
           
 void setInUse(boolean iu)
           
 void setOpaqueness(int opaqueness)
           
 void setProperties(java.util.Properties props)
          Method to set the properties in the PropertyConsumer.
 void setProperties(java.lang.String prefix, java.util.Properties properties)
          Set all the Rpf properties from a properties object.
 void setPropertyPrefix(java.lang.String prefix)
          Set the property key prefix that should be used by the PropertyConsumer.
 void setShowPalette(boolean sp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

omGraphics

protected java.util.Vector omGraphics
The graphic list of objects to draw.


cancelled

protected boolean cancelled
Set when the projection has changed while a swing worker is gathering graphics, and we want him to stop early.


coverageManager

protected RpfCoverageManager coverageManager

propertyPrefix

protected java.lang.String propertyPrefix

showCG

protected boolean showCG
Flag to tell the cache to return the coverage for city graphics.


showTLM

protected boolean showTLM
Flag to tell the cache to return the coverage for tlm.


showJOG

protected boolean showJOG
Flag to tell the cache to return the coverage for jog.


showTPC

protected boolean showTPC
Flag to tell the cache to return the coverage for jog.


showONC

protected boolean showONC
Flag to tell the cache to return the coverage for jog.


showJNC

protected boolean showJNC
Flag to tell the cache to return the coverage for jog.


showGNC

protected boolean showGNC
Flag to tell the cache to return the coverage for jog.


showCIB10

protected boolean showCIB10
Flag to tell the cache to return the coverage for 10M CIB.


showCIB5

protected boolean showCIB5
Flag to tell the cache to return the coverage for 5M CIB.


showMISC

protected boolean showMISC
Flag to tell the cache to return the coverage for others.


defaultCGColorInt

public static final int defaultCGColorInt
The default color int value.

See Also:
Constant Field Values

defaultTLMColorInt

public static final int defaultTLMColorInt
The default color int value.

See Also:
Constant Field Values

defaultJOGColorInt

public static final int defaultJOGColorInt
The default color int value.

See Also:
Constant Field Values

defaultTPCColorInt

public static final int defaultTPCColorInt
The default color int value.

See Also:
Constant Field Values

defaultONCColorInt

public static final int defaultONCColorInt
The default color int value.

See Also:
Constant Field Values

defaultJNCColorInt

public static final int defaultJNCColorInt
The default color int value.

See Also:
Constant Field Values

defaultGNCColorInt

public static final int defaultGNCColorInt
The default color int value.

See Also:
Constant Field Values

defaultCIB10ColorInt

public static final int defaultCIB10ColorInt
The default color int value.

See Also:
Constant Field Values

defaultCIB5ColorInt

public static final int defaultCIB5ColorInt
The default color int value.

See Also:
Constant Field Values

defaultMISCColorInt

public static final int defaultMISCColorInt
The default color int value.

See Also:
Constant Field Values

CGColor

protected java.awt.Color CGColor
The color to outline the shapes.


TLMColor

protected java.awt.Color TLMColor
The color to outline the shapes.


JOGColor

protected java.awt.Color JOGColor
The color to outline the shapes.


TPCColor

protected java.awt.Color TPCColor
The color to outline the shapes.


ONCColor

protected java.awt.Color ONCColor
The color to outline the shapes.


JNCColor

protected java.awt.Color JNCColor
The color to outline the shapes.


GNCColor

protected java.awt.Color GNCColor
The color to outline the shapes.


CIB10Color

protected java.awt.Color CIB10Color
The color to outline the shapes.


CIB5Color

protected java.awt.Color CIB5Color
The color to outline the shapes.


MISCColor

protected java.awt.Color MISCColor
The color to outline the shapes.


opaqueness

protected int opaqueness
A setting for how transparent to make the images. The default is 255, which is totally opaque. Not used right now.


fillRects

protected boolean fillRects
Flag to fill the coverage rectangles.


CoverageOpaquenessProperty

public static final java.lang.String CoverageOpaquenessProperty
Property to use for filled rectangles (when java supports it).

See Also:
Constant Field Values

FillProperty

public static final java.lang.String FillProperty
Property to use to fill rectangles.

See Also:
Constant Field Values

layer

protected Layer layer
The parent layer.


inUse

protected boolean inUse
Flag to track when the RpfCoverage is active.


showPalette

protected boolean showPalette
Show the palette when showing coverage. Probably not needed for layers limiting chart seriestypes for display.


i18n

protected I18n i18n

colors

protected java.awt.Color[] colors

paletteWindow

protected javax.swing.JFrame paletteWindow
Constructor Detail

RpfCoverage

public RpfCoverage(Layer l)
The default constructor for the Layer. All of the attributes are set to their default values.

Method Detail

setDefaultValues

protected void setDefaultValues()
Method that sets all the variables to the default values.


isInUse

public boolean isInUse()

setInUse

public void setInUse(boolean iu)

isShowPalette

public boolean isShowPalette()

setShowPalette

public void setShowPalette(boolean sp)

allCoveragesOn

public void allCoveragesOn()

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 properties)
Set all the Rpf properties from a properties object.

Specified by:
setProperties in interface PropertyConsumer
Parameters:
prefix - string prefix used in the properties file for this layer.
properties - the properties set in the properties file.

getProperties

public java.util.Properties getProperties(java.util.Properties props)
PropertyConsumer method, to fill in a Properties object, reflecting the current values of the layer. If the layer has a propertyPrefix set, the property keys should have that prefix plus a separating '.' prepended to each propery key it uses for configuration.

Specified by:
getProperties in interface PropertyConsumer
Parameters:
props - a Properties object to load the PropertyConsumer properties into. If props 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)
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.). For Layer, this method should at least return the 'prettyName' property.

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.

getInitPropertiesOrder

public java.lang.String getInitPropertiesOrder()
Specify what order properties should be presented in an editor.


setPropertyPrefix

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

prepare

public void prepare(RpfFrameProvider frameProvider,
                    Projection projection,
                    java.lang.String chartSeries)
Prepares the graphics for the layer. This is where the getRectangle() method call is made on the rpfcov.

Occasionally it is necessary to abort a prepare call. When this happens, the map will set the cancel bit in the LayerThread, (the thread that is running the prepare). If this Layer needs to do any cleanups during the abort, it should do so, but return out of the prepare asap.

Returns:
OMGraphicList of rectangles showing coverages.

resetColors

protected void resetColors()

getColors

protected java.awt.Color[] getColors()

getOpaqueness

public int getOpaqueness()
Returns:
Returns the opaqueness.

setOpaqueness

public void setOpaqueness(int opaqueness)
Parameters:
opaqueness - The opaqueness to set.

getModifiedColor

protected java.awt.Color getModifiedColor(java.awt.Color color)

setGraphicLists

public void setGraphicLists(java.util.Vector lists)

getGraphicLists

public java.util.Vector getGraphicLists()

paint

public void paint(java.awt.Graphics g)
Paints the layer.

Parameters:
g - the Graphics context for painting

generate

public void generate(Projection proj)
Reproject the graphics you have.

Parameters:
proj - the projection to use

getGUI

public java.awt.Component getGUI()
Provides the palette widgets to control the options of showing maps, or attribute text.

Returns:
Component object representing the palette widgets.

getPaletteWindow

public javax.swing.JFrame getPaletteWindow()
Get RpfCoverage's associated palette as a top-level window

Returns:
the frame that the palette is in

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
The Action Listener method, that reacts to the palette widgets actions.

Specified by:
actionPerformed in interface java.awt.event.ActionListener


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