|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.event.MouseAdapter
org.openstreetmap.josm.gui.MapMover
public class MapMover
Enables moving of the map by holding down the right mouse button and drag the mouse. Also, enables zooming by the mouse wheel.
Nested Class Summary | |
---|---|
private class |
MapMover.ZoomerAction
|
Field Summary | |
---|---|
private javax.swing.JPanel |
contentPane
|
private EastNorth |
mousePosMove
The point in the map that was the under the mouse point when moving around started. |
private boolean |
movementInPlace
|
private NavigatableComponent |
nc
The map to move around. |
Constructor Summary | |
---|---|
MapMover(NavigatableComponent navComp,
javax.swing.JPanel contentPane)
Create a new MapMover |
Method Summary | |
---|---|
void |
destroy()
Called when the object has been destroyed. |
private void |
endMovement()
End the movement. |
static boolean |
isPlatformOsx()
Replies true if we are currently running on OSX |
void |
mouseDragged(java.awt.event.MouseEvent e)
If the right (and only the right) mouse button is pressed, move the map |
void |
mouseMoved(java.awt.event.MouseEvent e)
Emulates dragging on Mac OSX |
void |
mousePressed(java.awt.event.MouseEvent e)
Start the movement, if it was the 3rd button (right button). |
void |
mouseReleased(java.awt.event.MouseEvent e)
Change the cursor back to it's pre-move cursor. |
void |
mouseWheelMoved(java.awt.event.MouseWheelEvent e)
Zoom the map by 1/5th of current zoom per wheel-delta. |
private void |
startMovement(java.awt.event.MouseEvent e)
Start movement by setting a new cursor and remember the current mouse position. |
Methods inherited from class java.awt.event.MouseAdapter |
---|
mouseClicked, mouseEntered, mouseExited |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private EastNorth mousePosMove
private final NavigatableComponent nc
private final javax.swing.JPanel contentPane
private boolean movementInPlace
Constructor Detail |
---|
public MapMover(NavigatableComponent navComp, javax.swing.JPanel contentPane)
Method Detail |
---|
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
mouseDragged
in class java.awt.event.MouseAdapter
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class java.awt.event.MouseAdapter
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class java.awt.event.MouseAdapter
private void startMovement(java.awt.event.MouseEvent e)
e
- The mouse event that leat to the movement from.private void endMovement()
public void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
mouseWheelMoved
in interface java.awt.event.MouseWheelListener
mouseWheelMoved
in class java.awt.event.MouseAdapter
e
- The wheel event.public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
mouseMoved
in class java.awt.event.MouseAdapter
public static boolean isPlatformOsx()
public void destroy()
Destroyable
destroy
in interface Destroyable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |