com.isti.quakewatch.omutil
Class RegionBoundariesLayer

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.isti.quakewatch.omutil.RegionBoundariesLayer
All Implemented Interfaces:
com.bbn.openmap.event.MapMouseListener, com.bbn.openmap.event.ProjectionListener, com.bbn.openmap.ProjectionPainter, com.bbn.openmap.PropertyConsumer, ToolTipInformation, 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 RegionBoundariesLayer
extends com.bbn.openmap.Layer
implements com.bbn.openmap.event.MapMouseListener, ToolTipInformation

Class RegionBoundariesLayer displays the Region Boundaries.

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 regionsXmlFNameProperty
          The regions XML File Name.
 
Fields inherited from class com.bbn.openmap.Layer
addAsBackground, AddAsBackgroundProperty, addToBeanContext, AddToBeanContextProperty, attributes, autoPalette, AutoPaletteProperty, beanContextChildSupport, DisplayPaletteCmd, DisplayPropertiesCmd, doHack, HidePaletteCmd, i18n, IDListeners, localHackList, lsListeners, maxScale, MaxScaleProperty, minScale, MinScaleProperty, palette, paletteListener, PrettyNameProperty, propertyPrefix, RedrawCmd, removable, RemovableProperty, SWING_PACKAGE, 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.PropertyConsumer
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
RegionBoundariesLayer()
          Creates the Region Boundaries Layer.
 
Method Summary
 java.lang.String clearErrorString()
          Clears the current error string.
protected  void clearToolTipText()
          Sets the tool tip text.
 java.lang.String getErrorString()
          Gets the error string or null if no error.
protected  com.bbn.openmap.omGraphics.OMGraphic getGraphic(java.awt.event.MouseEvent e)
          Gets the graphic that contains the event.
 com.bbn.openmap.event.MapMouseListener getMapMouseListener()
          Returns the MapMouseListener object that handles the mouse events.
 java.lang.String[] getMouseModeServiceList()
          Return a list of the modes that are interesting to the MapMouseListener.
 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.
protected  java.lang.String getToolTip(int index)
          Gets the tooltip for the specifed index.
protected  java.lang.String initLayer(java.lang.String prefix, java.util.Properties props)
          Initializes this layer from the given properties.
 boolean isToolTipEnabled()
          Determines if the tool tip is enabled or not.
 boolean mouseClicked(java.awt.event.MouseEvent e)
          Invoked when the mouse has been clicked this layer.
 boolean mouseDragged(java.awt.event.MouseEvent e)
          Invoked when a mouse button is pressed on this layer and then dragged.
 void mouseEntered(java.awt.event.MouseEvent e)
          Invoked when the mouse enters this layer.
 void mouseExited(java.awt.event.MouseEvent e)
          Invoked when the mouse exits this layer.
 void mouseMoved()
          Handle a mouse cursor moving without the button being pressed.
 boolean mouseMoved(java.awt.event.MouseEvent e)
          Invoked when the mouse button has been moved on this layer (with no buttons down).
 boolean mousePressed(java.awt.event.MouseEvent evtObj)
          Invoked when a mouse button is pressed on this layer.
 boolean mouseReleased(java.awt.event.MouseEvent e)
          Invoked when a mouse button is released on this layer.
 void paint(java.awt.Graphics g)
          Paints the layer.
 void projectionChanged(com.bbn.openmap.event.ProjectionEvent e)
          ProjectionListener interface method.
 void renderDataForProjection(com.bbn.openmap.proj.Projection proj, java.awt.Graphics g)
          Implementing the ProjectionPainter interface.
protected  void setErrorString(java.lang.String errorString)
          Sets the current error string.
 void setProperties(java.lang.String prefix, java.util.Properties props)
          Initializes this layer from the given properties.
 void setToolTipEnabled(boolean b)
          Enables or disables the tool tip.
protected  boolean setToolTipText(java.awt.event.MouseEvent e)
          Sets the tool tip text.
 
Methods inherited from class com.bbn.openmap.Layer
actionPerformed, addComponentListener, added, addInfoDisplayListener, addLayerStatusListener, addMouseListener, addVetoableChangeListener, childrenAdded, childrenRemoved, clearListeners, connectToBeanContext, createWindowSupport, 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, getGUI, getIcon, getMaxScale, getMinScale, getPackage, getPalette, getProjection, getPropertyPrefix, getWindowSupport, hasGUI, hidePalette, isAutoPalette, isProjectionOK, isRemovable, notifyHideHack, putAttribute, removeComponentListener, removeConfirmed, removed, removeInfoDisplayListener, removeLayerStatusListener, removeVetoableChangeListener, repaint, resetPalette, setAddAsBackground, setAddToBeanContext, setAutoPalette, setBeanContext, setIcon, setMaxScale, setMinScale, setName, setPaletteVisible, setProjection, setProjection, setProperties, setPropertyPrefix, 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 java.beans.beancontext.BeanContextChild
addPropertyChangeListener, removePropertyChangeListener
 

Field Detail

regionsXmlFNameProperty

public static final java.lang.String regionsXmlFNameProperty
The regions XML File Name.

See Also:
Constant Field Values
Constructor Detail

RegionBoundariesLayer

public RegionBoundariesLayer()
Creates the Region Boundaries Layer.

Method Detail

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 com.bbn.openmap.PropertyConsumer
Overrides:
getProperties in class com.bbn.openmap.Layer
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.).

Specified by:
getPropertyInfo in interface com.bbn.openmap.PropertyConsumer
Overrides:
getPropertyInfo in class com.bbn.openmap.Layer
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.

setProperties

public void setProperties(java.lang.String prefix,
                          java.util.Properties props)
Initializes this layer from the given properties.

Specified by:
setProperties in interface com.bbn.openmap.PropertyConsumer
Overrides:
setProperties in class com.bbn.openmap.Layer
Parameters:
prefix - the property prefix for this layer.
props - the Properties holding settings for this layer

initLayer

protected java.lang.String initLayer(java.lang.String prefix,
                                     java.util.Properties props)
Initializes this layer from the given properties.

Parameters:
prefix - the property prefix for this layer.
props - the Properties holding settings for this layer
Returns:
an error string or null if no error.

paint

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

Overrides:
paint in class javax.swing.JComponent
Parameters:
g - the Graphics context for painting

renderDataForProjection

public void renderDataForProjection(com.bbn.openmap.proj.Projection proj,
                                    java.awt.Graphics g)
Implementing the ProjectionPainter interface.

Specified by:
renderDataForProjection in interface com.bbn.openmap.ProjectionPainter
Overrides:
renderDataForProjection in class com.bbn.openmap.Layer
Parameters:
proj - projection
g - Graphics for projection.

projectionChanged

public void projectionChanged(com.bbn.openmap.event.ProjectionEvent e)
ProjectionListener interface method.

Specified by:
projectionChanged in interface com.bbn.openmap.event.ProjectionListener
Parameters:
e - ProjectionEvent

clearErrorString

public java.lang.String clearErrorString()
Clears the current error string.

Returns:
the current error string or null if no error.

getErrorString

public java.lang.String getErrorString()
Gets the error string or null if no error.

Returns:
the current error string or null if no error.

setErrorString

protected void setErrorString(java.lang.String errorString)
Sets the current error string.

Parameters:
errorString - the error string.

clearToolTipText

protected void clearToolTipText()
Sets the tool tip text.


getToolTip

protected java.lang.String getToolTip(int index)
Gets the tooltip for the specifed index.

Parameters:
index - for the tool tip.
Returns:
the tooltip.

getGraphic

protected com.bbn.openmap.omGraphics.OMGraphic getGraphic(java.awt.event.MouseEvent e)
Gets the graphic that contains the event.

Parameters:
e - the mouse event.
Returns:
the graphic that contains the event or null if none.

setToolTipText

protected boolean setToolTipText(java.awt.event.MouseEvent e)
Sets the tool tip text.

Parameters:
e - MouseEvent or null to clear.
Returns:
true if an object was found, false otherwise.

getMapMouseListener

public com.bbn.openmap.event.MapMouseListener getMapMouseListener()
Returns the MapMouseListener object that handles the mouse events.

Overrides:
getMapMouseListener in class com.bbn.openmap.Layer
Returns:
the MapMouseListener object that handles the mouse events.

isToolTipEnabled

public boolean isToolTipEnabled()
Determines if the tool tip is enabled or not.

Specified by:
isToolTipEnabled in interface ToolTipInformation
Returns:
true if the tool tip is enabled, false otherwise.

setToolTipEnabled

public void setToolTipEnabled(boolean b)
Enables or disables the tool tip.

Specified by:
setToolTipEnabled in interface ToolTipInformation
Parameters:
b - true if the tool tip is enabled, false otherwise.

getMouseModeServiceList

public java.lang.String[] getMouseModeServiceList()
Return a list of the modes that are interesting to the MapMouseListener. The source MouseEvents will only get sent to the MapMouseListener if the mode is set to one that the listener is interested in. Layers interested in receiving events should register for receiving events in "select" mode:
        return new String[] {
            SelectMouseMode.modeID
        };
 

Specified by:
getMouseModeServiceList in interface com.bbn.openmap.event.MapMouseListener
Returns:
String[] of modeID's
See Also:
NavMouseMode.modeID, SelectMouseMode.modeID, NullMouseMode.modeID

mousePressed

public boolean mousePressed(java.awt.event.MouseEvent evtObj)
Invoked when a mouse button is pressed on this layer.

Specified by:
mousePressed in interface com.bbn.openmap.event.MapMouseListener
Parameters:
evtObj - MouseEvent
Returns:
true if the listener was able to process the event.

mouseReleased

public boolean mouseReleased(java.awt.event.MouseEvent e)
Invoked when a mouse button is released on this layer. No action is performed.

Specified by:
mouseReleased in interface com.bbn.openmap.event.MapMouseListener
Parameters:
e - MouseEvent
Returns:
true if the listener was able to process the event.

mouseClicked

public boolean mouseClicked(java.awt.event.MouseEvent e)
Invoked when the mouse has been clicked this layer. The listener will receive this event if it successfully processed mousePressed(), or if no other listener processes the event. If the listener successfully processes mouseClicked(), then it will receive the next mouseClicked() notifications that have a click count greater than one. No action is performed.

Specified by:
mouseClicked in interface com.bbn.openmap.event.MapMouseListener
Parameters:
e - MouseEvent
Returns:
true if the listener was able to process the event.

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Invoked when the mouse enters this layer.

Specified by:
mouseEntered in interface com.bbn.openmap.event.MapMouseListener
Parameters:
e - MouseEvent

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Invoked when the mouse exits this layer.

Specified by:
mouseExited in interface com.bbn.openmap.event.MapMouseListener
Parameters:
e - MouseEvent

mouseDragged

public boolean mouseDragged(java.awt.event.MouseEvent e)
Invoked when a mouse button is pressed on this layer and then dragged. The listener will receive these events if it successfully processes mousePressed(), or if no other listener processes the event.

Specified by:
mouseDragged in interface com.bbn.openmap.event.MapMouseListener
Parameters:
e - MouseEvent
Returns:
true if the listener was able to process the event.

mouseMoved

public boolean mouseMoved(java.awt.event.MouseEvent e)
Invoked when the mouse button has been moved on this layer (with no buttons down).

Specified by:
mouseMoved in interface com.bbn.openmap.event.MapMouseListener
Parameters:
e - MouseEvent
Returns:
true if the listener was able to process the event.

mouseMoved

public void mouseMoved()
Handle a mouse cursor moving without the button being pressed. This event is intended to tell the listener that there was a mouse movement, but that the event was consumed by another layer. This will allow a mouse listener to clean up actions that might have happened because of another motion event response.

Specified by:
mouseMoved in interface com.bbn.openmap.event.MapMouseListener