Class HMExecutor

java.lang.Object
javax.swing.SwingWorker<java.lang.Void,​org.hortonmachine.gears.ui.progress.ProgressUpdate>
org.hortonmachine.gui.utils.executor.HMExecutor
All Implemented Interfaces:
java.lang.Runnable, java.util.concurrent.Future<java.lang.Void>, java.util.concurrent.RunnableFuture<java.lang.Void>, org.hortonmachine.gears.ui.progress.IProgressPrinter
Direct Known Subclasses:
ExecutorIndeterminateGui, ExecutorProgressGui, ExecutorProgressPrintStream

public abstract class HMExecutor
extends javax.swing.SwingWorker<java.lang.Void,​org.hortonmachine.gears.ui.progress.ProgressUpdate>
implements org.hortonmachine.gears.ui.progress.IProgressPrinter
An swingworker executor helper to work with a progress printer.
Author:
Andrea Antonello (www.hydrologis.com)
  • Nested Class Summary

    Nested classes/interfaces inherited from class javax.swing.SwingWorker

    javax.swing.SwingWorker.StateValue
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected int h  
    protected org.hortonmachine.gears.ui.progress.IProgressPrinter progress  
    protected int w  
  • Constructor Summary

    Constructors 
    Constructor Description
    HMExecutor()  
  • Method Summary

    Modifier and Type Method Description
    abstract void backGroundWork()  
    protected java.lang.Void doInBackground()  
    void done()  
    protected void process​(java.util.List<org.hortonmachine.gears.ui.progress.ProgressUpdate> chunks)  
    void publish​(org.hortonmachine.gears.ui.progress.ProgressUpdate update)  
    void setProgressPrinter​(org.hortonmachine.gears.ui.progress.IProgressPrinter progress)  

    Methods inherited from class javax.swing.SwingWorker

    addPropertyChangeListener, cancel, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, publish, removePropertyChangeListener, run, setProgress

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • w

      protected int w
    • h

      protected int h
    • progress

      protected org.hortonmachine.gears.ui.progress.IProgressPrinter progress
  • Constructor Details

  • Method Details

    • setProgressPrinter

      public void setProgressPrinter​(org.hortonmachine.gears.ui.progress.IProgressPrinter progress)
    • process

      protected void process​(java.util.List<org.hortonmachine.gears.ui.progress.ProgressUpdate> chunks)
      Overrides:
      process in class javax.swing.SwingWorker<java.lang.Void,​org.hortonmachine.gears.ui.progress.ProgressUpdate>
    • doInBackground

      protected java.lang.Void doInBackground()
      Specified by:
      doInBackground in class javax.swing.SwingWorker<java.lang.Void,​org.hortonmachine.gears.ui.progress.ProgressUpdate>
    • backGroundWork

      public abstract void backGroundWork() throws java.lang.Exception
      Throws:
      java.lang.Exception
    • publish

      public void publish​(org.hortonmachine.gears.ui.progress.ProgressUpdate update)
      Specified by:
      publish in interface org.hortonmachine.gears.ui.progress.IProgressPrinter
    • done

      public void done()
      Specified by:
      done in interface org.hortonmachine.gears.ui.progress.IProgressPrinter
      Overrides:
      done in class javax.swing.SwingWorker<java.lang.Void,​org.hortonmachine.gears.ui.progress.ProgressUpdate>