public interface MapMouseListener
NOTE: It is very important that if a MapMouseListener is being implemented for a Layer object, the Layer.getMapMouseListener() method be modified for the layer to return the MapMouseListener. The layer returns null by default, and this will result in the MapMouseListener NEVER receiving events.
SelectMouseMode
,
NavMouseMode
Modifier and Type | Method and Description |
---|---|
java.lang.String[] |
getMouseModeServiceList()
Return a list of the modes that are interesting to the
MapMouseListener.
|
boolean |
mouseClicked(java.awt.event.MouseEvent e)
Invoked when the mouse has been clicked on a component.
|
boolean |
mouseDragged(java.awt.event.MouseEvent e)
Invoked when a mouse button is pressed on a component and then
dragged.
|
void |
mouseEntered(java.awt.event.MouseEvent e)
Invoked when the mouse enters a component.
|
void |
mouseExited(java.awt.event.MouseEvent e)
Invoked when the mouse exits a component.
|
void |
mouseMoved()
Handle a mouse cursor moving without the button being pressed.
|
boolean |
mouseMoved(java.awt.event.MouseEvent e)
Invoked when the mouse button has been moved on a component
(with no buttons down).
|
boolean |
mousePressed(java.awt.event.MouseEvent e)
Invoked when a mouse button has been pressed on a component.
|
boolean |
mouseReleased(java.awt.event.MouseEvent e)
Invoked when a mouse button has been released on a component.
|
java.lang.String[] getMouseModeServiceList()
return new String[] { SelectMouseMode.modeID };
NavMouseMode.modeID
,
SelectMouseMode.modeID
,
NullMouseMode.modeID
boolean mousePressed(java.awt.event.MouseEvent e)
e
- MouseEventboolean mouseReleased(java.awt.event.MouseEvent e)
e
- MouseEventboolean mouseClicked(java.awt.event.MouseEvent e)
mousePressed()
, or if no other listener
processes the event. If the listener successfully processes
mouseClicked()
, then it will receive the next
mouseClicked()
notifications that have a click
count greater than one.
NOTE: We have noticed that this method can sometimes be
erroneously invoked. It seems to occur when a light-weight AWT
component (like an internal window or menu) closes (removes
itself from the window hierarchy). A specific OpenMap example
is when you make a menu selection when the MenuItem you select
is above the MapBean canvas. After making the selection, the
mouseClicked() gets invoked on the MouseDelegator, which passes
it to the appropriate listeners depending on the MouseMode. The
best way to avoid this problem is to not implement anything
crucial in this method. Use a combination of
mousePressed()
and mouseReleased()
instead.
e
- MouseEventvoid mouseEntered(java.awt.event.MouseEvent e)
e
- MouseEventvoid mouseExited(java.awt.event.MouseEvent e)
e
- MouseEventboolean mouseDragged(java.awt.event.MouseEvent e)
e
- MouseEventboolean mouseMoved(java.awt.event.MouseEvent e)
e
- MouseEventvoid mouseMoved()
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details