Package org.openstreetmap.josm.gui.bbox
Class SlippyMapController
java.lang.Object
java.awt.event.MouseAdapter
org.openstreetmap.josm.gui.bbox.SlippyMapController
- All Implemented Interfaces:
MouseListener,MouseMotionListener,MouseWheelListener,EventListener
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
Nested ClassesModifier and TypeClassDescriptionprivate final classMoves the map depending on which cursor keys are pressed (or not)private classprivate classprivate final classprivate final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final doubleThe speed increase per timer interval when a cursor button is clickedprivate Pointprivate final SlippyMapBBoxChooserprivate booleanprivate Pointprivate static final int[]private static final intprivate static final doubleThe maximum speed (pixels per timer interval)private SlippyMapController.MoveTaskDoes the movingprivate static final String[]private static final TimerA Timer for smoothly moving the map areaprivate static final longHow often to do the moving (milliseconds) -
Constructor Summary
ConstructorsConstructorDescriptionSlippyMapController(SlippyMapBBoxChooser navComp, JPanel contentPane) Constructs a newSlippyMapController. -
Method Summary
Modifier and TypeMethodDescription(package private) static booleanisTyping()voidvoidvoidStart drawing the selection rectangle if it was the 1st button (left button)voidWhen 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
-
Field Details
-
TIMER
A Timer for smoothly moving the map area -
moveTask
Does the moving -
timerInterval
How often to do the moving (milliseconds)- See Also:
-
MAX_SPEED
The maximum speed (pixels per timer interval)- See Also:
-
ACCELERATION
The speed increase per timer interval when a cursor button is clicked- See Also:
-
MAC_MOUSE_BUTTON3_MASK
- See Also:
-
N
-
K
-
iStartSelectionPoint
-
iEndSelectionPoint
-
iSlippyMapChooser
-
isSelecting
-
-
Constructor Details
-
SlippyMapController
Constructs a newSlippyMapController.- Parameters:
navComp- navigable componentcontentPane- content pane
-
-
Method Details
-
mousePressed
Start drawing the selection rectangle if it was the 1st button (left button)- Specified by:
mousePressedin interfaceMouseListener- Overrides:
mousePressedin classMouseAdapter
-
mouseDragged
- Specified by:
mouseDraggedin interfaceMouseMotionListener- Overrides:
mouseDraggedin classMouseAdapter
-
mouseReleased
When dragging the map change the cursor back to it's pre-move cursor. If a double-click occurs center and zoom the map on the clicked location.- Specified by:
mouseReleasedin interfaceMouseListener- Overrides:
mouseReleasedin classMouseAdapter
-
mouseMoved
- Specified by:
mouseMovedin interfaceMouseMotionListener- Overrides:
mouseMovedin classMouseAdapter
-
isTyping
-