Class SampThread

  • All Implemented Interfaces:
    java.lang.Runnable

    abstract class SampThread
    extends java.lang.Thread
    Helper class for performing a SAMP operation from within the Event Dispatch Thread. You must implement the #runSamp method to do the work; any resulting SampException will be suitably displayed to the user.
    Since:
    27 Jul 2011
    Author:
    Mark Taylor
    • 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 java.lang.String errText_  
      private java.lang.String errTitle_  
      private java.awt.Component parent_  
      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Constructor Summary

      Constructors 
      Constructor Description
      SampThread​(java.awt.Component parent, java.lang.String errTitle, java.lang.String errText)
      Constructs a SampThread given a parent component.
      SampThread​(java.util.EventObject evt, java.lang.String errTitle, java.lang.String errText)
      Constructs a SampThread given an event object with a source which presumably corresponds to a parent component.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void run()  
      protected abstract void sampRun()
      Called from the run() method.
      • 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

      • parent_

        private final java.awt.Component parent_
      • errTitle_

        private final java.lang.String errTitle_
      • errText_

        private final java.lang.String errText_
    • Constructor Detail

      • SampThread

        public SampThread​(java.awt.Component parent,
                          java.lang.String errTitle,
                          java.lang.String errText)
        Constructs a SampThread given a parent component. Arguments are required for posting an error if one occurs.
        Parameters:
        parent - parent component
        errTitle - title of error window if one is needed
        errText - text of error messsage if one is needed
      • SampThread

        public SampThread​(java.util.EventObject evt,
                          java.lang.String errTitle,
                          java.lang.String errText)
        Constructs a SampThread given an event object with a source which presumably corresponds to a parent component.
        Parameters:
        evt - triggering event
        errTitle - title of error window if one is needed
        errText - text of error messsage if one is needed
    • Method Detail

      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread