com.bbn.openmap.layer.asrp
Class ASRPLayer

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by com.bbn.openmap.Layer
                  extended by com.bbn.openmap.layer.OMGraphicHandlerLayer
                      extended by com.bbn.openmap.layer.asrp.ASRPLayer
All Implemented Interfaces:
ASRPConstants, ProjectionListener, GestureResponsePolicy, OMGraphicHandler, ProjectionPainter, PropertyConsumer, DataBoundsProvider, java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.beancontext.BeanContextChild, java.beans.beancontext.BeanContextMembershipListener, java.io.Serializable, java.util.EventListener

public class ASRPLayer
extends OMGraphicHandlerLayer
implements DataBoundsProvider, ASRPConstants

The ASRPLayer displays ASRP data, which is an international, seamless imagery format, kind of like CADRG. This data must be displayed on either LLYX or CADRG projections, although the layer will display coverage rectangles over areas with imagery for projections that are not the right type, or if the user should zoom in or out to view the images. The properties for this layer are:

  
   
   
    # Paths to TRANSH01.THF files that organize sets of ASRP image directories.
    asrpLayer.thf=thf1;thf2
    # Alternatively, paths to ASRP directories can be used if the thf property is undefined.
    asrpLayer.asrpDirs=dir1;dir2
    # Flag to show coverages when images can't be displayed.
    asrpLayer.showCoverage
    # Lastly, the suite of DrawingAttributes properties can be provided to set 
    # the parameters for the coverage rectangles. See DrawingAttributes for more options.
    asrpLayer.lineColor=FFFF0000
    asrpLayer.fillColor=FFFF0000
   
    
   
 

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static java.lang.String ASRPDirectoryProperty
          The ASRPDirectory can be used to view the images from ASRP directories containing GEN, GER, SOU, QAL and IMG files.
protected  java.lang.String[] asrpDirs
           
protected  ASRPDirectoryHandler asrpHandler
           
protected  DrawingAttributes coverageDrawingAttributes
           
protected  javax.swing.JPanel guiPanel
           
protected  boolean showCoverage
           
static java.lang.String ShowCoverageProperty
          Property describing a flag that can be set to show where image files are when they cannot be displayed or aren't showing up.
protected  java.lang.String[] thfPaths
           
static java.lang.String THFProperty
          A semi-colon separated set of paths to TRANSH01.THF files containing information about ASRP images stored in directories next to the TRANSH01.THF file.
 
Fields inherited from class com.bbn.openmap.layer.OMGraphicHandlerLayer
consumeEvents, ConsumeEventsProperty, filter, interruptable, InterruptableProperty, layerWorker, LAYERWORKER_LOCK, layerWorkerQueue, logger, mouseEventInterpreter, mouseModeIDs, MouseModesProperty, projectionChangePolicy, ProjectionChangePolicyProperty, renderPolicy, RenderPolicyProperty, selectedList, TransparencyProperty
 
Fields inherited from class com.bbn.openmap.Layer
addAsBackground, AddAsBackgroundProperty, addToBeanContext, AddToBeanContextProperty, attributes, autoPalette, AutoPaletteProperty, beanContextChildSupport, coordTransform, DataPathPrefixProperty, DisplayPaletteCmd, DisplayPropertiesCmd, doHack, HidePaletteCmd, i18n, localHackList, maxScale, MaxScaleProperty, minScale, MinScaleProperty, palette, paletteListener, PrettyNameProperty, propertyPrefix, readyToPaint, RedrawCmd, removable, RemovableProperty, SWING_PACKAGE, TransformProperty, windowSupport
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface com.bbn.openmap.dataAccess.asrp.ASRPConstants
GEN_NAME, GER_NAME, IMAGE_NAME, QAL_NAME, SOURCE_NAME, TRANS
 
Fields inherited from interface com.bbn.openmap.PropertyConsumer
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ASRPLayer()
           
 
Method Summary
 ASRPDirectoryHandler getASRPHandler()
           
 DataBounds getDataBounds()
          DataBoundsInformer interface.
 java.awt.Component getGUI()
          Gets the gui controls associated with the layer.
 java.lang.String[] getPaths()
          Returns THF paths if they are set, otherwise returns ASRP directory paths.
 java.util.Properties getProperties(java.util.Properties props)
          Overrides Layer getProperties method., also calls that method on Layer.
 java.util.Properties getPropertyInfo(java.util.Properties props)
          Overrides Layer getProperties method., also calls that method on Layer.
 boolean getShowCoverage()
           
protected  ASRPDirectoryHandler initialize()
           
 OMGraphicList prepare()
          This is the main method you should be concerned with when overriding this class.
 void setASRPHandler(ASRPDirectoryHandler asrpHandlerIn)
           
 void setPaths(java.lang.String[] pathsIn)
          Set the paths used by the layer.
 void setProperties(java.lang.String prefix, java.util.Properties props)
          Overrides the Layer setProperties method.
 void setShowCoverage(boolean showCoverageIn)
           
 
Methods inherited from class com.bbn.openmap.layer.OMGraphicHandlerLayer
actionPerformed, canSetList, copy, createLayerWorker, cut, deselect, dispose, doAction, doPrepare, filter, filter, filter, getConsumeEvents, getDefaultSettingsPanel, getFilter, getInfoText, getItemsForMapMenu, getItemsForOMGraphicMenu, getLayerWorker, getList, getMapMouseListener, getMouseEventInterpreter, getMouseModeIDsForEvents, getProjectionChangePolicy, getRedrawButton, getRenderPolicy, getSelected, getSettingsButton, getToolTipTextFor, getTransparency, getTransparencyAdjustmentPanel, highlight, isCancelled, isHighlightable, isInterruptable, isSelectable, isWorking, leftClick, mouseOver, paint, paste, projectionChanged, receivesMapEvents, renderDataForProjection, resetFiltering, select, setConsumeEvents, setFilter, setInterruptable, setLayerWorker, setList, setMouseEventInterpreter, setMouseModeIDsForEvents, setProjectionChangePolicy, setRenderPolicy, setTransparency, supportsSQL, unhighlight, workerComplete
 
Methods inherited from class com.bbn.openmap.Layer
addComponentListener, added, addInfoDisplayListener, addLayerStatusListener, addMouseListener, addVetoableChangeListener, childrenAdded, childrenRemoved, clearListeners, connectToBeanContext, createWindowSupport, disconnectFromBeanContext, finalize, findAndInit, findAndInit, findAndUndo, fireHideToolTip, firePaletteEvent, fireRequestBrowserContent, fireRequestBrowserContent, fireRequestCursor, fireRequestInfoLine, fireRequestInfoLine, fireRequestInfoLine, fireRequestMessage, fireRequestMessage, fireRequestToolTip, fireRequestToolTip, fireRequestURL, fireRequestURL, fireStatusUpdate, fireStatusUpdate, fireVetoableChange, getAddAsBackground, getAddToBeanContext, getAttribute, getBeanContext, getCoordTransform, getIcon, getMaxScale, getMinScale, getPackage, getPalette, getProjection, getPropertyPrefix, getWindowSupport, hasGUI, hidePalette, isAutoPalette, isProjectionOK, isReadyToPaint, isRemovable, notifyHideHack, prependDataPathPrefix, putAttribute, removeComponentListener, removeConfirmed, removed, removeInfoDisplayListener, removeLayerStatusListener, removeVetoableChangeListener, repaint, resetPalette, setAddAsBackground, setAddToBeanContext, setAutoPalette, setBeanContext, setCoordTransform, setIcon, setLayerProperties, setMaxScale, setMinScale, setName, setPaletteVisible, setProjection, setProjection, setProperties, setPropertyPrefix, setReadyToPaint, setRemovable, setVisible, setWindowSupport, showPalette
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.bbn.openmap.util.DataBoundsProvider
getName
 
Methods inherited from interface java.beans.beancontext.BeanContextChild
addPropertyChangeListener, removePropertyChangeListener
 

Field Detail

asrpHandler

protected ASRPDirectoryHandler asrpHandler

thfPaths

protected java.lang.String[] thfPaths

asrpDirs

protected java.lang.String[] asrpDirs

showCoverage

protected boolean showCoverage

coverageDrawingAttributes

protected DrawingAttributes coverageDrawingAttributes

ShowCoverageProperty

public static final java.lang.String ShowCoverageProperty
Property describing a flag that can be set to show where image files are when they cannot be displayed or aren't showing up.

See Also:
Constant Field Values

ASRPDirectoryProperty

public static final java.lang.String ASRPDirectoryProperty
The ASRPDirectory can be used to view the images from ASRP directories containing GEN, GER, SOU, QAL and IMG files. This property is only checked if the THFProperty is not set (asrpDir). Should contain a list of semi-colon separated paths to ASRP directories containing the files specified above.

See Also:
Constant Field Values

THFProperty

public static final java.lang.String THFProperty
A semi-colon separated set of paths to TRANSH01.THF files containing information about ASRP images stored in directories next to the TRANSH01.THF file.

See Also:
Constant Field Values

guiPanel

protected javax.swing.JPanel guiPanel
Constructor Detail

ASRPLayer

public ASRPLayer()
Method Detail

prepare

public OMGraphicList prepare()
Description copied from class: OMGraphicHandlerLayer
This is the main method you should be concerned with when overriding this class. You have to make sure that this method returns an OMGraphicList that is ready to be rendered. That means they need to be generated with the current projection, which can be retrieved by calling getProjection().

This method will be called in a separate thread if doPrepare() is called on the layer. This will automatically cause repaint() to be called, which lets java know to call paint() on this class.

Note that the default action of this method is to get the OMGraphicList as it is currently set in the layer, re-projects the list with the current projection (calls generate() on them), and then returns the current list.

If your layer needs to change what is on the list based on what the current projection is, you can either clear() the list yourself and add new OMGraphics to it (remember to call generate(Projection) on them), and return the list. You also have the option of setting a ListResetPCPolicy, which will automatically set the list to null when the projection changes before calling this method. The OMGraphicHandlerList will ignore a null OMGraphicList.

NOTE: If you call prepare directly, you may need to call repaint(), too. With all invocations of this method that are cause by a projection change, repaint() will be called for you. The method is synchronized in case renderDataForProjection() gets called while in the middle of this method. For a different projection, that would be bad.

Overrides:
prepare in class OMGraphicHandlerLayer

initialize

protected ASRPDirectoryHandler initialize()

getASRPHandler

public ASRPDirectoryHandler getASRPHandler()

setASRPHandler

public void setASRPHandler(ASRPDirectoryHandler asrpHandlerIn)

setPaths

public void setPaths(java.lang.String[] pathsIn)
Set the paths used by the layer. Clears out the ASRP List currently set. The contents of the provided paths will be checked to see if they are paths to TRANSH01.THF files, and will be set to the ASRP directory files if they aren't. Call doPrepare() on this layer if you want the changes to take effect immediately.


getPaths

public java.lang.String[] getPaths()
Returns THF paths if they are set, otherwise returns ASRP directory paths.


setProperties

public void setProperties(java.lang.String prefix,
                          java.util.Properties props)
Description copied from class: OMGraphicHandlerLayer
Overrides the Layer setProperties method. Also calls Layer's version. If the ProjectionChangePolicy and RenderPolicy objects are set programmatically, are PropertyConsumers and the .class property is not set, they will still have access to properties if this method is called. Their property prefix will be scoped as if the OMGraphicHandlerLayer had them created, with their prefix being prefix + . + PropertyChangePolicyProperty and prefix + . + RenderPolicyProperty. If the .class property is set, then a new policy object will be created and replace the one set before this method is called.

Specified by:
setProperties in interface PropertyConsumer
Overrides:
setProperties in class OMGraphicHandlerLayer
Parameters:
prefix - the token to prefix the property names
props - the Properties object

getProperties

public java.util.Properties getProperties(java.util.Properties props)
Description copied from class: OMGraphicHandlerLayer
Overrides Layer getProperties method., also calls that method on Layer. Sets the properties from the policy objects used by this OMGraphicHandler layer.

Specified by:
getProperties in interface PropertyConsumer
Overrides:
getProperties in class OMGraphicHandlerLayer
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 props)
Description copied from class: OMGraphicHandlerLayer
Overrides Layer getProperties method., also calls that method on Layer. Sets the properties from the policy objects used by this OMGraphicHandler layer.

Specified by:
getPropertyInfo in interface PropertyConsumer
Overrides:
getPropertyInfo in class OMGraphicHandlerLayer
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.

getDataBounds

public DataBounds getDataBounds()
DataBoundsInformer interface.

Specified by:
getDataBounds in interface DataBoundsProvider
Returns:
a DataBounds object describing the area of coverage, may be null if the data hasn't been evaluated yet.

setShowCoverage

public void setShowCoverage(boolean showCoverageIn)

getShowCoverage

public boolean getShowCoverage()

getGUI

public java.awt.Component getGUI()
Description copied from class: Layer
Gets the gui controls associated with the layer. This default implementation returns null indicating that the layer has no gui controls.

Overrides:
getGUI in class Layer
Returns:
java.awt.Component or null, null by default.


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