com.nutiteq.ui
Class EventDrivenPanning

java.lang.Object
  extended by com.nutiteq.ui.EventDrivenPanning
All Implemented Interfaces:
PanningStrategy

public class EventDrivenPanning
extends java.lang.Object
implements PanningStrategy

Unthreaded panning implementation that uses key repeated events for panning. Map moving speed is progressive, based on panning action length. At first map is moved by one pixel, then by 2, 4 and 8 pixels. NOTE - because MapComponent has an unthreaded implementation, this panning strategy can't be used with default on screen controls for panning with stylus. With stylus there are no continuous events created and there is no way to know if panning is still active.


Constructor Summary
EventDrivenPanning()
           
 
Method Summary
 boolean isPanning()
          Is panning implementation still running
 void keyRepeated(int keyCode)
          Notify panning 'thread' about key repeated events
 void quit()
          Quit panning 'thread'
 void setMapComponent(com.nutiteq.ui.Pannable mapComponent)
          Will be called from library, after strategy has been entered into MapComponent or MapItem
 void start()
          Start panning 'thread'
 void startPanning(int xMove, int yMove, boolean panningWithKeys)
          Start panning with directions information.
 void stopPanning()
          Stop current pan action.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventDrivenPanning

public EventDrivenPanning()
Method Detail

isPanning

public boolean isPanning()
Description copied from interface: PanningStrategy
Is panning implementation still running

Specified by:
isPanning in interface PanningStrategy
Returns:
if panning 'thread' is still working

quit

public void quit()
Description copied from interface: PanningStrategy
Quit panning 'thread'

Specified by:
quit in interface PanningStrategy

start

public void start()
Description copied from interface: PanningStrategy
Start panning 'thread'

Specified by:
start in interface PanningStrategy

startPanning

public void startPanning(int xMove,
                         int yMove,
                         boolean panningWithKeys)
Description copied from interface: PanningStrategy
Start panning with directions information. Also notify if panning was started by key controls or some other event (for example on screen controls with stylus)

Specified by:
startPanning in interface PanningStrategy
Parameters:
xMove - change on x axis
yMove - change on y axis
panningWithKeys - has panning been started by key events

stopPanning

public void stopPanning()
Description copied from interface: PanningStrategy
Stop current pan action.

Specified by:
stopPanning in interface PanningStrategy

keyRepeated

public void keyRepeated(int keyCode)
Description copied from interface: PanningStrategy
Notify panning 'thread' about key repeated events

Specified by:
keyRepeated in interface PanningStrategy
Parameters:
keyCode - code for key repeated

setMapComponent

public void setMapComponent(com.nutiteq.ui.Pannable mapComponent)
Description copied from interface: PanningStrategy
Will be called from library, after strategy has been entered into MapComponent or MapItem

Specified by:
setMapComponent in interface PanningStrategy
Parameters:
mapComponent - map object on which to perform panning actions