public class SlippyMapControler extends MouseAdapter implements MouseMotionListener, 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 Point |
iEndSelectionPoint |
private SizeButton |
iSizeButton |
private SlippyMapBBoxChooser |
iSlippyMapChooser |
private SourceButton |
iSourceButton |
private boolean |
isSelecting |
private Point |
iStartSelectionPoint |
private static double |
MAX_SPEED
The maximum speed (pixels per timer interval)
|
private SlippyMapControler.MoveTask |
moveTask
Does the moving
|
private static 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,
JPanel contentPane,
SizeButton sizeButton,
SourceButton sourceButton)
Constructs a new
SlippyMapControler . |
Modifier and Type | Method and Description |
---|---|
void |
mouseDragged(MouseEvent e) |
void |
mouseMoved(MouseEvent e) |
void |
mousePressed(MouseEvent e)
Start drawing the selection rectangle if it was the 1st button (left
button)
|
void |
mouseReleased(MouseEvent e)
When dragging the map change the cursor back to it's pre-move cursor.
|
mouseClicked, mouseEntered, mouseExited, mouseWheelMoved
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
mouseClicked, mouseEntered, mouseExited
private SlippyMapControler.MoveTask moveTask
private static long timerInterval
private static final double MAX_SPEED
private static final double ACCELERATION
private Point iStartSelectionPoint
private Point iEndSelectionPoint
private final SlippyMapBBoxChooser iSlippyMapChooser
private SizeButton iSizeButton
private SourceButton iSourceButton
private boolean isSelecting
public SlippyMapControler(SlippyMapBBoxChooser navComp, JPanel contentPane, SizeButton sizeButton, SourceButton sourceButton)
SlippyMapControler
.public void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
mousePressed
in class MouseAdapter
public void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
mouseDragged
in class MouseAdapter
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
mouseReleased
in class MouseAdapter
public void mouseMoved(MouseEvent e)
mouseMoved
in interface MouseMotionListener
mouseMoved
in class MouseAdapter