|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
com.bbn.openmap.Layer
com.bbn.openmap.layer.CacheLayer
public class CacheLayer
A Layer that gets it's graphics from a URL containing a serialized OMGraphicList. This layer does respond to gesturing on the graphics, but doesn't do anything. You can extend this class to be more useful to you. It has one property that needs to be set in the properties file:
# CacheLayer property, the layer should figure out whether it's a file or URL. cachelayer.cacheFile=<url of cachefile>
| 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 |
CacheFileProperty
|
protected java.net.URL |
cacheURL
URL to read data from. |
protected OMGraphicList |
omgraphics
A list of graphics to be painted on the map. |
| 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 | |
|---|---|
CacheLayer()
Construct a default CacheLayer. |
|
| Method Summary | |
|---|---|
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 MapMouseEvents. |
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 ProjectionEvents. |
void |
readGraphics()
Read a cache of OMGraphics |
void |
setProperties(java.lang.String prefix,
java.util.Properties props)
Initializes this layer from the given properties. |
| 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 |
|---|
public static final java.lang.String CacheFileProperty
protected java.net.URL cacheURL
protected OMGraphicList omgraphics
| Constructor Detail |
|---|
public CacheLayer()
| Method Detail |
|---|
public void readGraphics()
throws java.io.IOException
java.io.IOException
public void setProperties(java.lang.String prefix,
java.util.Properties props)
setProperties in interface PropertyConsumersetProperties in class Layerprops - 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.JComponentpublic void projectionChanged(ProjectionEvent e)
ProjectionEvents. This function is
invoked when the MapBean projection changes. The
graphics are reprojected and then the Layer is repainted.
projectionChanged in interface ProjectionListenere - the projection eventpublic java.awt.Component getGUI()
getGUI in class Layerpublic void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListeneractionPerformed in class Layerpublic java.lang.String[] getMouseModeServiceList()
Layer.
getMouseModeServiceList in interface MapMouseListenerMapMouseListener,
MouseDelegatorpublic boolean mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface MapMouseListenere - the press event
getMouseModeServiceList()public boolean mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface MapMouseListenere - the release event
getMouseModeServiceList()public boolean mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface MapMouseListenere - the click event
getMouseModeServiceList()public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface MapMouseListenere - the enter eventgetMouseModeServiceList()public void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface MapMouseListenere - the exit eventgetMouseModeServiceList()public boolean mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface MapMouseListenere - the drag event
getMouseModeServiceList()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 MapMouseListenere - the move event
getMouseModeServiceList()public void mouseMoved()
mouseMoved in interface MapMouseListenergetMouseModeServiceList()public MapMouseListener getMapMouseListener()
MapMouseListener in order to
receive MapMouseEvents. If the implementation
would prefer to delegate MapMouseEvents, it
could return the delegate from this method instead.
getMapMouseListener in class LayerMapMouseEvent s or
null if this layer isn't interested in
MapMouseEvent s
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||