The StandardMapMouseInterpreter uses highlighing to indicate that mouse movement is occurring over an OMGraphic, and gives the layer three ways to react to that movement. After finding out if the OMGraphic is highlightable, the SMMI will tell the layer to highlight the OMGraphic (which usually means to call select() on it), provide a tool tip string for the OMGraphic, and provide a string to use on the InformationDelegator info line. The layer can reply or ignore any and all of these notifications, depending on how it's supposed to act.
For left mouse clicks, the SMMI uses selection as a notification that the user is choosing an OMGraphic, and that the OMGraphic should be prepared to be moved, modified or deleted. For a single OMGraphic, this is usually handled by handing the OMGraphic off to the OMDrawingTool. However the GestureResponsPolicy handles the situation where the selection is of multiple OMGraphics, and the layer should prepare to handle those situations as movement or deletion notifications. This usually means to change the OMGraphic's display to indicate that the OMGraphics have been selected. Selection notifications can come in series, and the GestureResponsePolicy is expected to keep track of which OMGraphics it has been told are selected. Deselection notifications may come as well, or other action notifications such as cut or copy may arrive. For cut and copy notifications, the OMGraphics should be removed from any selection list. For pastings, the OMGraphics should be added to the selection list.
For right mouse clicks, the layer will be provided with a JPopupMenu to use to populate with options for actions over a OMGraphic or over the map.
The StandardMapMouseInterpreter uses a timer to pace how mouse movement actions are responded to. Highlight reactions only occur after the mouse has paused over the map for the timer interval, so the application doesn't try to respond to constantly changing mouse locations. You can disable this delay by setting the timer interval to zero.
|
|