Class SwingRunner<T>

All Implemented Interfaces:
RMPropertyChanger, PropertyChangeListener, Cloneable, EventListener

public abstract class SwingRunner<T> extends SPRunner<T> implements PropertyChangeListener
A runner than invokes success/failure methods in Swing EventDispatch thread.
  • Constructor Details

    • SwingRunner

      public SwingRunner()
      Creates a SwingRunner.
    • SwingRunner

      public SwingRunner(JComponent aComponent, String aTitle)
      Creates a SwingRunner for component and with title - will show a panel if activity takes too long.
  • Method Details

    • getComponent

      public JComponent getComponent()
      Returns the parent component.
    • getTitle

      public String getTitle()
      Returns the title.
    • start

      public SwingRunner<T> start()
      Override to start timer/panel.
      Overrides:
      start in class SPRunner<T>
    • getEstimatedTime

      public int getEstimatedTime()
      Returns the estimated time.
    • setEstimatedTime

      public SwingRunner<T> setEstimatedTime(int aValue)
      Sets the estimated time.
    • propertyChange

      public void propertyChange(PropertyChangeEvent anEvent)
      Watch runner property changes to update monitor.
      Specified by:
      propertyChange in interface PropertyChangeListener
    • invokeFinished

      protected void invokeFinished()
      Runs the success method.
      Overrides:
      invokeFinished in class SPRunner<T>