skrueger.geotools
Class XMapPaneAction_Pan

java.lang.Object
  extended by skrueger.geotools.XMapPaneAction_Pan
All Implemented Interfaces:
XMapPaneAction

public class XMapPaneAction_Pan
extends Object
implements XMapPaneAction


Nested Class Summary
static class XMapPaneAction_Pan.Direction
           
 
Field Summary
 Cursor backupCursor
          This variable can be used to backup the active cursor of the mapPane, if the actions changes the cursor during dragging
 
Fields inherited from interface skrueger.geotools.XMapPaneAction
PAN, SELECT_ALL, SELECT_ONE_FROM_TOP, SELECT_TOP, ZOOM_IN, ZOOM_OUT
 
Constructor Summary
XMapPaneAction_Pan()
           
 
Method Summary
 void performClick(XMapPane mapPane, MouseEvent ev, DirectPosition coord)
          Defines the action in case of a single click on the map.
 void performDragged(XMapPane mapPane, MouseEvent ev, Point dragStartPos, Point dragLastPos, DirectPosition startCoord, DirectPosition endCoord)
          Performs a pan action.
 void performDragging(XMapPane mapPane, MouseEvent ev, Point dragStartPos, Point dragLastPos, DirectPosition startCoord, DirectPosition endCoord)
          TODO: Stop dragging if the expected map area would not be valid.
 void performKeyboard(XMapPane mapPane, Object param)
          Defines what happens if this action has been triggered by a keyboard-key.
 void performWheel(XMapPane mapPane, MouseWheelEvent ev, DirectPosition coord)
          Defines the action in case of a mouse wheel action on the map (the moment a drag ends).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

backupCursor

public Cursor backupCursor
This variable can be used to backup the active cursor of the mapPane, if the actions changes the cursor during dragging

Constructor Detail

XMapPaneAction_Pan

public XMapPaneAction_Pan()
Method Detail

performDragged

public void performDragged(XMapPane mapPane,
                           MouseEvent ev,
                           Point dragStartPos,
                           Point dragLastPos,
                           DirectPosition startCoord,
                           DirectPosition endCoord)
Performs a pan action. During panning, the displacement is stored in #imageOrigin object. Calling #performPan() will reset the offset and call #setMapArea(Envelope).

Specified by:
performDragged in interface XMapPaneAction
Parameters:
mapPane - map pane the action should be performed on
ev - mouse event of the action
dragStartPos - window position the window starts (the end position can be determined from the mouse event)
startCoord - geo coordinate the window starts
endCoord - geo coordinate the window ends

performDragging

public void performDragging(XMapPane mapPane,
                            MouseEvent ev,
                            Point dragStartPos,
                            Point dragLastPos,
                            DirectPosition startCoord,
                            DirectPosition endCoord)
TODO: Stop dragging if the expected map area would not be valid.

Specified by:
performDragging in interface XMapPaneAction
Parameters:
mapPane - map pane the action should be performed on
ev - mouse event of the action
dragStartPos - window position the drag was started (the current position can be determined from the mouse event)
startCoord - geo coordinate the drag was started
endCoord - geo coordinate the drag is currently moved over

performWheel

public void performWheel(XMapPane mapPane,
                         MouseWheelEvent ev,
                         DirectPosition coord)
Description copied from interface: XMapPaneAction
Defines the action in case of a mouse wheel action on the map (the moment a drag ends).

Specified by:
performWheel in interface XMapPaneAction
Parameters:
mapPane - map pane the action should be performed on
ev - mouse event of the action
coord - geo coordinate the wheel is turned on

performClick

public void performClick(XMapPane mapPane,
                         MouseEvent ev,
                         DirectPosition coord)
Description copied from interface: XMapPaneAction
Defines the action in case of a single click on the map. Called by ### XMapPaneMouseAdapter ### on MouseInputType.LClick and MouseInputType.RClick.

Specified by:
performClick in interface XMapPaneAction
Parameters:
mapPane - map pane the action should be performed on
ev - mouse event of the action
coord - geo coordinate the click is performed on

performKeyboard

public void performKeyboard(XMapPane mapPane,
                            Object param)
Description copied from interface: XMapPaneAction
Defines what happens if this action has been triggered by a keyboard-key.

Specified by:
performKeyboard in interface XMapPaneAction
Parameters:
mapPane - map pane the action should be performed on
param - An optinal paramter that can be defined.