|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent com.bbn.openmap.Layer com.bbn.openmap.layer.OMGraphicHandlerLayer com.bbn.openmap.layer.learn.BasicLayer com.bbn.openmap.layer.learn.InteractionLayer
public class InteractionLayer
This layer demonstrates how to interact with your OMGraphics on the map, getting them to change appearance with mouse events and provide additional information about themselves. This layer builds on the example demonstrated in the BasicDisplayLayer, which involved creating OMGraphics for the map. For any of the methods listed below that are designed to assist with responding to mouse events, simply return null from them if you want a no-op, which is the default implementation in the OMGraphicHandlerLayer (so don't even override them).
OMGraphicHandlerLayer.isHighlightable(com.bbn.openmap.omGraphics.OMGraphic)
,
OMGraphicHandlerLayer.highlight(com.bbn.openmap.omGraphics.OMGraphic)
,
OMGraphicHandlerLayer.unhighlight(com.bbn.openmap.omGraphics.OMGraphic)
,
OMGraphicHandlerLayer.getInfoText(com.bbn.openmap.omGraphics.OMGraphic)
,
JComponent.getToolTipText()
,
OMGraphicHandlerLayer.isSelectable(com.bbn.openmap.omGraphics.OMGraphic)
,
OMGraphicHandlerLayer.select(com.bbn.openmap.omGraphics.OMGraphicList)
,
OMGraphicHandlerLayer.deselect(com.bbn.openmap.omGraphics.OMGraphicList)
,
OMGraphicHandlerLayer.getItemsForMapMenu(com.bbn.openmap.event.MapMouseEvent)
,
OMGraphicHandlerLayer.getItemsForOMGraphicMenu(com.bbn.openmap.omGraphics.OMGraphic)
,
OMGraphicHandlerLayer.receivesMapEvents()
,
OMGraphicHandlerLayer.mouseOver(MapMouseEvent)
,
OMGraphicHandlerLayer.leftClick(com.bbn.openmap.event.MapMouseEvent)
,
Serialized FormNested 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 |
---|
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 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 | |
---|---|
InteractionLayer()
|
Method Summary | |
---|---|
void |
deselect(OMGraphicList list)
Designate a list of OMGraphics as deselected. |
java.lang.String |
getInfoText(OMGraphic omg)
Query for what text should be placed over the information bar when the mouse is over a particular OMGraphic. |
java.util.List<java.awt.Component> |
getItemsForMapMenu(MapMouseEvent me)
This method is called when a right mouse click is detected over the map and not over an OMGraphic. |
java.util.List<java.awt.Component> |
getItemsForOMGraphicMenu(OMGraphic omg)
This method is called when a right mouse click is detected over an OMGraphic. |
java.lang.String |
getToolTipTextFor(OMGraphic omg)
Query for what tooltip to display for an OMGraphic when the mouse is over it. |
OMGraphicList |
init()
Called from the prepare() method if the layer discovers that its OMGraphicList is null. |
boolean |
isHighlightable(OMGraphic omg)
Query that an OMGraphic can be highlighted when the mouse moves over it. |
boolean |
isSelectable(OMGraphic omg)
Query that an OMGraphic is selectable. |
void |
select(OMGraphicList list)
Designate a list of OMGraphics as selected. |
Methods inherited from class com.bbn.openmap.layer.learn.BasicLayer |
---|
prepare |
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 |
Constructor Detail |
---|
public InteractionLayer()
Method Detail |
---|
public OMGraphicList init()
init
in class BasicLayer
BasicLayer.prepare()
public boolean isHighlightable(OMGraphic omg)
isHighlightable
in interface GestureResponsePolicy
isHighlightable
in class OMGraphicHandlerLayer
OMGraphicHandlerLayer.highlight(com.bbn.openmap.omGraphics.OMGraphic)
,
OMGraphicHandlerLayer.unhighlight(com.bbn.openmap.omGraphics.OMGraphic)
public boolean isSelectable(OMGraphic omg)
isSelectable
in interface GestureResponsePolicy
isSelectable
in class OMGraphicHandlerLayer
OMGraphicHandlerLayer.select(com.bbn.openmap.omGraphics.OMGraphicList)
,
OMGraphicHandlerLayer.deselect(com.bbn.openmap.omGraphics.OMGraphicList)
public void select(OMGraphicList list)
select
in interface GestureResponsePolicy
select
in class OMGraphicHandlerLayer
OMGraphicHandlerLayer.select(com.bbn.openmap.omGraphics.OMGraphicList)
public void deselect(OMGraphicList list)
deselect
in interface GestureResponsePolicy
deselect
in class OMGraphicHandlerLayer
OMGraphicHandlerLayer.deselect(com.bbn.openmap.omGraphics.OMGraphicList)
public java.lang.String getInfoText(OMGraphic omg)
getInfoText
in interface GestureResponsePolicy
getInfoText
in class OMGraphicHandlerLayer
public java.lang.String getToolTipTextFor(OMGraphic omg)
getToolTipTextFor
in interface GestureResponsePolicy
getToolTipTextFor
in class OMGraphicHandlerLayer
public java.util.List<java.awt.Component> getItemsForMapMenu(MapMouseEvent me)
getItemsForMapMenu
in interface GestureResponsePolicy
getItemsForMapMenu
in class OMGraphicHandlerLayer
me
- a MapMouseEvent describing the location over where the menu
items should apply, in case different options are appropriate for
different places.
public java.util.List<java.awt.Component> getItemsForOMGraphicMenu(OMGraphic omg)
getItemsForOMGraphicMenu
in interface GestureResponsePolicy
getItemsForOMGraphicMenu
in class OMGraphicHandlerLayer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |