com.bbn.openmap.omGraphics.event
Interface GestureResponsePolicy

All Known Implementing Classes:
AmpLinkLayer, AOILayer, AreaShapeLayer, ASRPLayer, BasicLayer, BoundsTestLayer, BufferedLayer, BufferedLinkLayer, BufferedShapeLayer, DateLayer, DayNightLayer, DemoLayer, DrawingToolLayer, DrawLinkLayer, DTEDCoverageLayer, DTEDFrameCacheLayer, DTEDLayer, E00Layer, EarthquakeLayer, EditorLayer, EsriLayer, ETOPOJarLayer, ETOPOLayer, EventLayer, GeoCrossDemoLayer, GeoIntersectionLayer, GeoTestLayer, GraticuleLayer, ImageTileLayer, InteractionLayer, LabelLayer, LinkLayer, LocationLayer, MapTileLayer, MapTileUtilLayer, MIFLayer, MultiRoadLayer, MultiShapeLayer, MysqlGeometryLayer, NexradLayer, OMGraphicHandlerLayer, PlotLayer, PlugInLayer, ProjectionResponseLayer, RpfLayer, ScaleDisplayLayer, ShapeLayer, SimpleAnimationLayer, TerrainLayer, TestLayer, TestResponsePolicy, TimelineLayer, TimerLocationLayer, TimeSliderLayer, VPFFeatureLayer, VPFLayer, VPFRoadLayer

public interface GestureResponsePolicy

The GestureResponsePolicy interface describes an object that receives interpreted events from a MapMouseInterpreter. The interpreter receives the MouseEvents and does the work of deciding what has happened concerning the OMGraphics on an OMGraphicHandlerLayer, and notifies the GestureResponsePolicy what it thinks happened. The GRP is free to respond as it needs.

See Also:
MapMouseInterpreter, StandardMapMouseInterpreter, OMGraphicHandlerLayer

Method Summary
 OMGraphicList copy(OMGraphicList omgl)
          A notification that the OMGraphics on the list should be copied (duplicated and returned) and deselected.
 OMGraphicList cut(OMGraphicList omgl)
          A notification that the OMGraphics on the list should be cut (deleted and returned) from the list and deselected.
 void deselect(OMGraphicList omgl)
          A notification that the OMGraphics on the list should be considered to be deselected.
 java.lang.String getInfoText(OMGraphic omg)
          A request for a string to be provided to use in the information line of the InformationDelegator, for instance.
 java.util.List<java.awt.Component> getItemsForMapMenu(MapMouseEvent mme)
          Return a JMenu with contents applicable to a popup menu for a location over the map.
 java.util.List<java.awt.Component> getItemsForOMGraphicMenu(OMGraphic omg)
          Return a java.util.List containing input for a JMenu with contents applicable to a popup menu for a location over an OMGraphic.
 OMGraphicList getSelected()
          A query to get a list of all the OMGraphics that are current selected.
 java.lang.String getToolTipTextFor(OMGraphic omg)
          A request for a string to be provided to use as a tool tip for an OMGraphic.
 void highlight(OMGraphic omg)
          A notification that the OMGraphic should be highlighted in some way if the layer wants, to give the impression that something would happen to the OMGraphic if it were clicked upon or that a tooltip or information line information applies to this specific OMGraphic.
 boolean isHighlightable(OMGraphic omgr)
          A query from the MapMouseInterpreter wondering if it should ask any questions about the given OMGraphic concerning mouse movement and mouse dragged gestures.
 boolean isSelectable(OMGraphic omgr)
          A query from the MapMouseInterpreter wondering if the OMGraphic is selectable.
 boolean leftClick(MapMouseEvent mme)
          A notification that the mouse has been clicked with the left mouse button on the map, and not on any of the OMGraphics.
 boolean mouseOver(MapMouseEvent mme)
          A notification that the mouse cursor has been moved over the map, not over any of the OMGraphics on the GestureResponsePolicy.
 void paste(OMGraphicList omgl)
          A notification that the OMGraphics on the list should be added to the list and selected.
 boolean receivesMapEvents()
          A query from the MapMouseInterpreter wondering if the GestureResponsePolicy wants events pertaining to mouse movements over the map that are not over an OMGraphic.
 void select(OMGraphicList omgl)
          A notification that the OMGraphics on the list should be considered to be selected.
 void unhighlight(OMGraphic omg)
          A notification that the OMGraphic is no longer needed to be highlighted and that its appearance can go back to normal.
 

Method Detail

isHighlightable

boolean isHighlightable(OMGraphic omgr)
A query from the MapMouseInterpreter wondering if it should ask any questions about the given OMGraphic concerning mouse movement and mouse dragged gestures. Highlighting is usually means reactions in anticipation of selection.


isSelectable

boolean isSelectable(OMGraphic omgr)
A query from the MapMouseInterpreter wondering if the OMGraphic is selectable. Returns true if the OMGraphic is able to be selected for modification, deletion or movement. Selection may happen to an OMGraphic by itself or in a group of other OMGraphics.


receivesMapEvents

boolean receivesMapEvents()
A query from the MapMouseInterpreter wondering if the GestureResponsePolicy wants events pertaining to mouse movements over the map that are not over an OMGraphic. If the GestureResponsePolicy responds true, then the mouseOver and leftClick methods will be called on the GestureResponsePolicy by the interpreter. There is no rightClick method that is called, because a right click will always cause a getItemsForMapMenu() method to be called.


getSelected

OMGraphicList getSelected()
A query to get a list of all the OMGraphics that are current selected.


select

void select(OMGraphicList omgl)
A notification that the OMGraphics on the list should be considered to be selected.


deselect

void deselect(OMGraphicList omgl)
A notification that the OMGraphics on the list should be considered to be deselected.


cut

OMGraphicList cut(OMGraphicList omgl)
A notification that the OMGraphics on the list should be cut (deleted and returned) from the list and deselected. If the GRP doesn't want to provide that capability, it should return null.


copy

OMGraphicList copy(OMGraphicList omgl)
A notification that the OMGraphics on the list should be copied (duplicated and returned) and deselected. If the GRP doesn't want to provide that capability, it should return null.


paste

void paste(OMGraphicList omgl)
A notification that the OMGraphics on the list should be added to the list and selected.


highlight

void highlight(OMGraphic omg)
A notification that the OMGraphic should be highlighted in some way if the layer wants, to give the impression that something would happen to the OMGraphic if it were clicked upon or that a tooltip or information line information applies to this specific OMGraphic.


unhighlight

void unhighlight(OMGraphic omg)
A notification that the OMGraphic is no longer needed to be highlighted and that its appearance can go back to normal.


getToolTipTextFor

java.lang.String getToolTipTextFor(OMGraphic omg)
A request for a string to be provided to use as a tool tip for an OMGraphic. If a tool tip should not be displayed, null should be returned.


getInfoText

java.lang.String getInfoText(OMGraphic omg)
A request for a string to be provided to use in the information line of the InformationDelegator, for instance. If no information should be presented on behalf of this OMGraphic, null should be returned.


getItemsForMapMenu

java.util.List<java.awt.Component> getItemsForMapMenu(MapMouseEvent mme)
Return a JMenu with contents applicable to a popup menu for a location over the map. The popup doesn't concern any OMGraphics, and should be presented for a click on the map background.

Parameters:
mme - a MapMouseEvent describing the location over where the menu items should apply, in case different options are appropriate for different places.
Returns:
a List containing java.awt.Component options over the provided place on the map. Return null or empty List if no input required.

getItemsForOMGraphicMenu

java.util.List<java.awt.Component> getItemsForOMGraphicMenu(OMGraphic omg)
Return a java.util.List containing input for a JMenu with contents applicable to a popup menu for a location over an OMGraphic.

Returns:
a List containing java.awt.Component options for the given OMGraphic. Return null or empty list if there are no options.

mouseOver

boolean mouseOver(MapMouseEvent mme)
A notification that the mouse cursor has been moved over the map, not over any of the OMGraphics on the GestureResponsePolicy. This only gets called if the response to receivesMapEvents is true.

Parameters:
mme - MapMouseEvent describing the location of the mouse.
Returns:
true of this information is to be considered consumed and should not be passed to anybody else.

leftClick

boolean leftClick(MapMouseEvent mme)
A notification that the mouse has been clicked with the left mouse button on the map, and not on any of the OMGraphics. This only gets called if the response to receivesMapEvents is true. Right clicks on the map are always reported to the getItemsForMapMenu method.

Parameters:
mme - MapMouseEvent describing the location of the mouse.
Returns:
true of this information is to be considered consumed and should not be passed to anybody else.


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