|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
com.nutiteq.ui.ThreadDrivenPanning
public class ThreadDrivenPanning
Thread driven panning implementation, that will pan map at 35 ms intervals.
Based on panning time, the panning speed will increase. At the beginning map
will be moved by one pixel, the by two pixels and at the end by four pixels.
This implementation has additional checks using keyRepeated events to check,
if panning is still active. If no keyRepeat events have been received for two
seconds, then panning is considered abandoned and is stopped. Current panning
action will be stopped, not the thread.
Abandoned panning actions can be created, when key is pressed for moving and
then some system interruption (incoming call, etc.) happens. Then the key
released event is never received by MapComponent and
panning is never stopped.
NOTE - for this implementation to work correctly,
MapComponent needs to receive keyRepeated events.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary |
|---|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
ThreadDrivenPanning()
|
|
| 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 |
run()
|
void |
setMapComponent(com.nutiteq.ui.Pannable mapComponent)
Will be called from library, after strategy has been entered into MapComponent or MapItem |
void |
startPanning(int directionX,
int directionY,
boolean panningWithKeys)
Start panning with directions information. |
void |
stopPanning()
Stop current pan action. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.nutiteq.ui.PanningStrategy |
|---|
start |
| Constructor Detail |
|---|
public ThreadDrivenPanning()
| Method Detail |
|---|
public void run()
run in interface java.lang.Runnablerun in class java.lang.Thread
public void startPanning(int directionX,
int directionY,
boolean panningWithKeys)
PanningStrategy
startPanning in interface PanningStrategydirectionX - change on x axisdirectionY - change on y axispanningWithKeys - has panning been started by key eventspublic boolean isPanning()
PanningStrategy
isPanning in interface PanningStrategypublic void stopPanning()
PanningStrategy
stopPanning in interface PanningStrategypublic void quit()
PanningStrategy
quit in interface PanningStrategypublic void keyRepeated(int keyCode)
PanningStrategy
keyRepeated in interface PanningStrategykeyCode - code for key repeatedpublic void setMapComponent(com.nutiteq.ui.Pannable mapComponent)
PanningStrategyMapComponent or MapItem
setMapComponent in interface PanningStrategymapComponent - map object on which to perform panning actions
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||