org.opensha.sra.gui.portfolioeal
Class CalcProgressListener

java.lang.Object
  extended by java.lang.Thread
      extended by org.opensha.sra.gui.portfolioeal.CalcProgressListener
All Implemented Interfaces:
java.awt.event.ActionListener, java.lang.Runnable, java.util.EventListener

public class CalcProgressListener
extends java.lang.Thread
implements java.awt.event.ActionListener

This class is used to create a progress bar for calculations.

Author:
Jeremy Leakakos

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
CalcProgressListener(Asset asset)
          The constructor for the listener.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          The actionPerformed method for this listener.
 void run()
          The run method for this thread subclass.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CalcProgressListener

public CalcProgressListener(Asset asset)
The constructor for the listener. It creates and displays a progress bar.

Parameters:
asset - The asset that is having its EAL calculated
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
The actionPerformed method for this listener. It looks at the asset for the total and current ruptures, and updates the progress bar based on these numbers. It uses a timer to synchronize its firing.

Specified by:
actionPerformed in interface java.awt.event.ActionListener

run

public void run()
The run method for this thread subclass. It creates and starts a timer with the objects actionListener.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread