Package net.sf.freecol.client.gui
Class ScrollThread
- java.lang.Object
-
- java.lang.Thread
-
- net.sf.freecol.client.gui.ScrollThread
-
- All Implemented Interfaces:
java.lang.Runnable
public class ScrollThread extends java.lang.ThreadScrolls the view of the Map by moving its focus.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanabortedprivate DirectiondirectionThe direction to scroll in.private FreeColClientfreeColClientThe enclosing client.private static java.util.logging.Loggerloggerprivate static intSCROLL_DELAYDelay between scroll steps.
-
Constructor Summary
Constructors Constructor Description ScrollThread(FreeColClient freeColClient)The constructor to use.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabort()booleanisAborted()voidrun()Performs the actual scrolling.voidsetDirection(Direction d)Sets the direction in which this ScrollThread will scroll.-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Field Detail
-
logger
private static final java.util.logging.Logger logger
-
SCROLL_DELAY
private static final int SCROLL_DELAY
Delay between scroll steps.- See Also:
- Constant Field Values
-
freeColClient
private final FreeColClient freeColClient
The enclosing client.
-
direction
private volatile Direction direction
The direction to scroll in.
-
aborted
private volatile boolean aborted
-
-
Constructor Detail
-
ScrollThread
public ScrollThread(FreeColClient freeColClient)
The constructor to use.- Parameters:
freeColClient- The enclosingFreeColClient.
-
-
Method Detail
-
setDirection
public void setDirection(Direction d)
Sets the direction in which this ScrollThread will scroll.- Parameters:
d- TheDirectionin which this ScrollThread will scroll.
-
isAborted
public boolean isAborted()
-
abort
public void abort()
-
run
public void run()
Performs the actual scrolling. Run until interrupted or scrolling fails.- Specified by:
runin interfacejava.lang.Runnable- Overrides:
runin classjava.lang.Thread
-
-