public class CacheLayer extends Layer implements java.awt.event.ActionListener, MapMouseListener
# CacheLayer property:
# The layer should figure out
whether it's a file or URL.
cachelayer.cacheFile=
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CacheFileProperty |
protected java.net.URL |
cacheURL
URL to read data from.
|
protected OMGraphicList |
omgraphics
A list of graphics to be painted on the map.
|
addAsBackground, AddAsBackgroundProperty, addToBeanContext, AddToBeanContextProperty, attributes, autoPalette, AutoPaletteProperty, beanContextChildSupport, coordTransform, DataPathPrefixProperty, DisplayPaletteCmd, DisplayPropertiesCmd, doHack, HidePaletteCmd, i18n, localHackList, maxScale, MaxScaleProperty, minScale, MinScaleProperty, palette, paletteListener, PrettyNameProperty, propertyPrefix, RedrawCmd, removable, RemovableProperty, SWING_PACKAGE, TransformProperty, windowSupport
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty
Constructor and Description |
---|
CacheLayer()
Construct a default CacheLayer.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
The Action Listener method, that reacts to the palette widgets
actions.
|
java.awt.Component |
getGUI()
Provides the palette widgets to control the options of showing
maps, or attribute text.
|
MapMouseListener |
getMapMouseListener()
Returns self as the
MapMouseListener in order to
receive MapMouseEvent s. |
java.lang.String[] |
getMouseModeServiceList()
Indicates which mouse modes should send events to this
Layer . |
boolean |
mouseClicked(java.awt.event.MouseEvent e)
Called whenever the mouse is clicked by the user and one of the
requested mouse modes is active.
|
boolean |
mouseDragged(java.awt.event.MouseEvent e)
Called whenever the mouse is dragged on this layer and one of
the requested mouse modes is active.
|
void |
mouseEntered(java.awt.event.MouseEvent e)
Called whenever the mouse enters this layer and one of the
requested mouse modes is active.
|
void |
mouseExited(java.awt.event.MouseEvent e)
Called whenever the mouse exits this layer and one of the
requested mouse modes is active.
|
void |
mouseMoved()
Called whenever the mouse is moved on this layer and one of the
requested mouse modes is active, and the gesture is consumed by
another active layer.
|
boolean |
mouseMoved(java.awt.event.MouseEvent e)
Called whenever the mouse is moved on this layer and one of the
requested mouse modes is active.
|
boolean |
mousePressed(java.awt.event.MouseEvent e)
Called whenever the mouse is pressed by the user and one of the
requested mouse modes is active.
|
boolean |
mouseReleased(java.awt.event.MouseEvent e)
Called whenever the mouse is released by the user and one of
the requested mouse modes is active.
|
void |
paint(java.awt.Graphics g)
Renders the graphics list.
|
void |
projectionChanged(ProjectionEvent e)
Handler for
ProjectionEvent s. |
void |
readGraphics()
Read a cache of OMGraphics
|
void |
setProperties(java.lang.String prefix,
java.util.Properties props)
Initializes this layer from the given properties.
|
addComponentListener, added, addInfoDisplayListener, addLayerStatusListener, addMouseListener, addVetoableChangeListener, childrenAdded, childrenRemoved, clearListeners, connectToBeanContext, createWindowSupport, disconnectFromBeanContext, dispose, 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, getProperties, getPropertyInfo, getPropertyPrefix, getWindowSupport, hasGUI, hidePalette, isAutoPalette, isProjectionOK, isRemovable, notifyHideHack, prependDataPathPrefix, putAttribute, removeComponentListener, removeConfirmed, removed, removeInfoDisplayListener, removeLayerStatusListener, removeVetoableChangeListener, renderDataForProjection, repaint, resetPalette, setAddAsBackground, setAddToBeanContext, setAutoPalette, setBeanContext, setCoordTransform, setIcon, setLayerProperties, setMaxScale, setMinScale, setName, setPaletteVisible, setProjection, setProjection, setProperties, setPropertyPrefix, setRemovable, setVisible, setWindowSupport, showPalette
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, isPaintingOrigin, 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
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, transferFocusDownCycle, validate, validateTree
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, transferFocusBackward, transferFocusUpCycle
public static final java.lang.String CacheFileProperty
protected java.net.URL cacheURL
protected OMGraphicList omgraphics
public void readGraphics() throws java.io.IOException
java.io.IOException
public void setProperties(java.lang.String prefix, java.util.Properties props)
setProperties
in interface PropertyConsumer
setProperties
in class Layer
props
- the Properties
holding settings for
this layerprefix
- the token to prefix the property namespublic void paint(java.awt.Graphics g)
paint
in class javax.swing.JComponent
public void projectionChanged(ProjectionEvent e)
ProjectionEvent
s. This function is
invoked when the MapBean
projection changes. The
graphics are reprojected and then the Layer is repainted.
projectionChanged
in interface ProjectionListener
e
- the projection eventpublic java.awt.Component getGUI()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
actionPerformed
in class Layer
public java.lang.String[] getMouseModeServiceList()
Layer
.getMouseModeServiceList
in interface MapMouseListener
MapMouseListener
,
MouseDelegator
public boolean mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface MapMouseListener
e
- the press eventgetMouseModeServiceList()
public boolean mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface MapMouseListener
e
- the release eventgetMouseModeServiceList()
public boolean mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface MapMouseListener
e
- the click eventgetMouseModeServiceList()
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface MapMouseListener
e
- the enter eventgetMouseModeServiceList()
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface MapMouseListener
e
- the exit eventgetMouseModeServiceList()
public boolean mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface MapMouseListener
e
- the drag eventgetMouseModeServiceList()
public boolean mouseMoved(java.awt.event.MouseEvent e)
Tries to locate a graphic near the mouse, and if it is found, it is highlighted and the Layer is repainted to show the highlighting.
mouseMoved
in interface MapMouseListener
e
- the move eventgetMouseModeServiceList()
public void mouseMoved()
mouseMoved
in interface MapMouseListener
getMouseModeServiceList()
public MapMouseListener getMapMouseListener()
MapMouseListener
in order to
receive MapMouseEvent
s. If the implementation
would prefer to delegate MapMouseEvent
s, it
could return the delegate from this method instead.getMapMouseListener
in class Layer
MapMouseEvent
s or
null if this layer isn't interested in
MapMouseEvent
sCopyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details