net.sf.freecol.client.gui
Class CanvasMouseMotionListener.ScrollThread

java.lang.Object
  extended by java.lang.Thread
      extended by net.sf.freecol.client.gui.CanvasMouseMotionListener.ScrollThread
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
CanvasMouseMotionListener

private class CanvasMouseMotionListener.ScrollThread
extends java.lang.Thread

Scrolls the view of the Map by moving its focus.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
private  boolean cont
           
private  Map.Direction direction
           
private  Map map
           
private  MapViewer mapViewer
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
CanvasMouseMotionListener.ScrollThread(Map m, MapViewer mapViewer)
          The constructor to use.
 
Method Summary
 void run()
          Performs the actual scrolling.
 void setDirection(Map.Direction d)
          Sets the direction in which this ScrollThread will scroll.
 void stopScrolling()
          Makes this ScrollThread stop doing what it is supposed to do.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

map

private final Map map

mapViewer

private final MapViewer mapViewer

direction

private Map.Direction direction

cont

private boolean cont
Constructor Detail

CanvasMouseMotionListener.ScrollThread

public CanvasMouseMotionListener.ScrollThread(Map m,
                                              MapViewer mapViewer)
The constructor to use.

Parameters:
m - The Map that needs to be scrolled.
mapViewer - The GUI that holds information such as screen resolution.
Method Detail

setDirection

public void setDirection(Map.Direction d)
Sets the direction in which this ScrollThread will scroll.

Parameters:
d - The direction in which this ScrollThread will scroll.

stopScrolling

public void stopScrolling()
Makes this ScrollThread stop doing what it is supposed to do.


run

public void run()
Performs the actual scrolling.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread