Class LoaderPane.LocalReader

  • All Implemented Interfaces:
    java.lang.Runnable
    Enclosing class:
    LoaderPane

    class LoaderPane.LocalReader
    extends java.lang.Thread
    Internal class to handle the separate character-receive thread
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      (package private) class  LoaderPane.LocalReader.Notify  
      • 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
      (package private) byte[] inBuffer  
      (package private) boolean init  
      (package private) static int maxMsg  
      (package private) int msgCount  
      (package private) int msgSize  
      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Constructor Summary

      Constructors 
      Constructor Description
      LocalReader()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void enableGUI()
      Signal GUI that it's the end of the download
      (package private) void handleIncomingData()  
      (package private) void nextMessage​(byte[] buffer, int length)
      Send the next message of the download.
      (package private) void nibbleIncomingData()  
      void run()
      Handle incoming characters.
      (package private) void updateGUI()
      Update the GUI for progress
      • 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
    • Method Detail

      • run

        public void run()
        Handle incoming characters. This is a permanent loop, looking for input messages in character form on the stream connected to the PortController via connectPort. Terminates with the input stream breaking out of the try block.
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread
      • nibbleIncomingData

        void nibbleIncomingData()
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • handleIncomingData

        void handleIncomingData()
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • nextMessage

        void nextMessage​(byte[] buffer,
                         int length)
        Send the next message of the download.
        Parameters:
        buffer - holds message to be sent
        length - length of message within buffer
      • updateGUI

        void updateGUI()
        Update the GUI for progress

        Should be invoked on the Swing thread

      • enableGUI

        void enableGUI()
        Signal GUI that it's the end of the download

        Should be invoked on the Swing thread