|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.event.MouseAdapter
org.openstreetmap.fma.jtiledownloader.views.main.slippymap.OsmMapControl
public class OsmMapControl
This class controls the user input by listening to mouse and key events. Currently implemented is: - zooming in and out with scrollwheel - zooming in and centering by double clicking - selecting an area by clicking and dragging the mouse
Nested Class Summary | |
---|---|
private class |
OsmMapControl.MoveTask
Moves the map depending on which cursor keys are pressed (or not) |
private class |
OsmMapControl.MoveXAction
|
private class |
OsmMapControl.MoveYAction
|
private class |
OsmMapControl.ZoomInAction
|
private class |
OsmMapControl.ZoomOutAction
|
Field Summary | |
---|---|
private static double |
ACCELERATION
The speed increase per timer interval when a cursor button is clicked |
private java.awt.Point |
iEndSelectionPoint
|
private SlippyMapChooser |
iSlippyMapChooser
|
private java.awt.Point |
iStartSelectionPoint
|
private static double |
MAX_SPEED
The maximum speed (pixels per timer interval) |
private OsmMapControl.MoveTask |
moveTask
Does the moving |
private static java.util.Timer |
timer
A Timer for smoothly moving the map area |
private static long |
timerInterval
How often to do the moving (milliseconds) |
Constructor Summary | |
---|---|
OsmMapControl(SlippyMapChooser navComp)
Create a new OsmMapControl |
Method Summary | |
---|---|
void |
initialize(javax.swing.JPanel contentPane)
|
void |
mouseDragged(java.awt.event.MouseEvent e)
|
void |
mouseMoved(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
Start drawing the selection rectangle if it was the 1st button (left button) |
void |
mouseReleased(java.awt.event.MouseEvent e)
When dragging the map change the cursor back to it's pre-move cursor. |
Methods inherited from class java.awt.event.MouseAdapter |
---|
mouseClicked, mouseEntered, mouseExited, mouseWheelMoved |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.awt.event.MouseListener |
---|
mouseClicked, mouseEntered, mouseExited |
Field Detail |
---|
private static final java.util.Timer timer
private OsmMapControl.MoveTask moveTask
private static long timerInterval
private static final double MAX_SPEED
private static final double ACCELERATION
private java.awt.Point iStartSelectionPoint
private java.awt.Point iEndSelectionPoint
private final SlippyMapChooser iSlippyMapChooser
Constructor Detail |
---|
public OsmMapControl(SlippyMapChooser navComp)
Method Detail |
---|
public void initialize(javax.swing.JPanel contentPane)
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class java.awt.event.MouseAdapter
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
mouseDragged
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
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
mouseMoved
in class java.awt.event.MouseAdapter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |