public class SlippyMapControler extends java.awt.event.MouseAdapter implements java.awt.event.MouseMotionListener, java.awt.event.MouseListener
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.
|
mouseClicked, mouseEntered, mouseExited, mouseWheelMoved
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.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