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.Thread
Scrolls the view of the Map by moving its focus.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
aborted
private Direction
direction
The direction to scroll in.private FreeColClient
freeColClient
The enclosing client.private static java.util.logging.Logger
logger
private static int
SCROLL_DELAY
Delay 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 void
abort()
boolean
isAborted()
void
run()
Performs the actual scrolling.void
setDirection(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
- TheDirection
in 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:
run
in interfacejava.lang.Runnable
- Overrides:
run
in classjava.lang.Thread
-
-