Class ScrollThread

  • All Implemented Interfaces:
    java.lang.Runnable

    public class 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

      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.
      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • 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
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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 enclosing FreeColClient.
    • Method Detail

      • setDirection

        public void setDirection​(Direction d)
        Sets the direction in which this ScrollThread will scroll.
        Parameters:
        d - The Direction 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 interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread