public class SlippyMapControler extends java.awt.event.MouseAdapter
| Modifier and Type | Class and Description |
|---|---|
private class |
SlippyMapControler.MoveTask
Moves the map depending on which cursor keys are pressed (or not)
|
private class |
SlippyMapControler.MoveXAction |
private class |
SlippyMapControler.MoveYAction |
private class |
SlippyMapControler.ZoomInAction |
private class |
SlippyMapControler.ZoomOutAction |
| Modifier and Type | Field and Description |
|---|---|
private static double |
ACCELERATION
The speed increase per timer interval when a cursor button is clicked
|
private java.awt.Point |
iEndSelectionPoint |
private SlippyMapBBoxChooser |
iSlippyMapChooser |
private boolean |
isSelecting |
private java.awt.Point |
iStartSelectionPoint |
private static int[] |
K |
private static int |
MAC_MOUSE_BUTTON3_MASK |
private static double |
MAX_SPEED
The maximum speed (pixels per timer interval)
|
private SlippyMapControler.MoveTask |
moveTask
Does the moving
|
private static java.lang.String[] |
N |
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 and Description |
|---|
SlippyMapControler(SlippyMapBBoxChooser navComp,
javax.swing.JPanel contentPane)
Constructs a new
SlippyMapControler. |
| Modifier and Type | Method and Description |
|---|---|
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.
|
private static final java.util.Timer TIMER
private SlippyMapControler.MoveTask moveTask
private static long timerInterval
private static final double MAX_SPEED
private static final double ACCELERATION
private static final int MAC_MOUSE_BUTTON3_MASK
private static final java.lang.String[] N
private static final int[] K
private java.awt.Point iStartSelectionPoint
private java.awt.Point iEndSelectionPoint
private final SlippyMapBBoxChooser iSlippyMapChooser
private boolean isSelecting
public SlippyMapControler(SlippyMapBBoxChooser navComp, javax.swing.JPanel contentPane)
SlippyMapControler.navComp - navigatable componentcontentPane - content panepublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenermousePressed in class java.awt.event.MouseAdapterpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenermouseDragged in class java.awt.event.MouseAdapterpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenermouseReleased in class java.awt.event.MouseAdapterpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenermouseMoved in class java.awt.event.MouseAdapter