se.datadosen.jalbum
Class SlowOperation

java.lang.Object
  extended by java.lang.Thread
      extended by se.datadosen.jalbum.SlowOperation
All Implemented Interfaces:
java.lang.Runnable

public abstract class SlowOperation
extends java.lang.Thread


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  javax.swing.Action abortAction
           
protected  JSmartDialog dialog
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SlowOperation()
           
 
Method Summary
abstract  void abort()
          A call to abort should make the run method to exit
 javax.swing.JLabel getMessageLabel()
           
 java.lang.Object getResult()
           
 java.lang.Throwable getThrowable()
           
 boolean launch(java.awt.Dialog parent, javax.swing.JLabel messageLabel, javax.swing.Icon altIcon, java.lang.String title)
           
 boolean launch(java.awt.Dialog parent, javax.swing.JLabel messageLabel, java.lang.String title)
          Launch slow process and pop up dialog window during the process
 boolean launch(java.awt.Frame parent, javax.swing.JLabel messageLabel, javax.swing.Icon altIcon, java.lang.String title)
           
abstract  void operation()
           
 void run()
           
 void setResult(java.lang.Object result)
           
 
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
 

Field Detail

dialog

protected JSmartDialog dialog

abortAction

protected javax.swing.Action abortAction
Constructor Detail

SlowOperation

public SlowOperation()
Method Detail

launch

public boolean launch(java.awt.Dialog parent,
                      javax.swing.JLabel messageLabel,
                      java.lang.String title)
               throws java.lang.Throwable
Launch slow process and pop up dialog window during the process

Returns:
boolean true if process finished normally (was not aborted)
Throws:
java.lang.Throwable

launch

public boolean launch(java.awt.Dialog parent,
                      javax.swing.JLabel messageLabel,
                      javax.swing.Icon altIcon,
                      java.lang.String title)
               throws java.lang.Throwable
Throws:
java.lang.Throwable

launch

public boolean launch(java.awt.Frame parent,
                      javax.swing.JLabel messageLabel,
                      javax.swing.Icon altIcon,
                      java.lang.String title)
               throws java.lang.Throwable
Throws:
java.lang.Throwable

getMessageLabel

public javax.swing.JLabel getMessageLabel()

getThrowable

public java.lang.Throwable getThrowable()

setResult

public void setResult(java.lang.Object result)

getResult

public java.lang.Object getResult()

run

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

operation

public abstract void operation()
                        throws java.lang.Throwable
Throws:
java.lang.Throwable

abort

public abstract void abort()
A call to abort should make the run method to exit