com.partnersoft.modules.inspection.app
Class CreationProgressBar

java.lang.Object
  extended by javax.swing.SwingWorker
      extended by com.partnersoft.gui.ProgressBar
          extended by com.partnersoft.modules.inspection.app.CreationProgressBar
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.lang.Runnable, java.util.concurrent.Future, java.util.concurrent.RunnableFuture, java.util.EventListener

public class CreationProgressBar
extends com.partnersoft.gui.ProgressBar

ProgressBar for mass creations of Inspections. Generates an Inspection

Author:
Rich Stepanski

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.SwingWorker
javax.swing.SwingWorker.StateValue
 
Constructor Summary
CreationProgressBar(com.partnersoft.maps.app.MapApp app, InspectionKit kit, java.util.List<java.lang.Integer> dataIds, java.util.List<java.lang.String> dataTypes, com.partnersoft.data.Naming initialData)
          Creates a new CreationProgressBar.
CreationProgressBar(com.partnersoft.maps.app.MapApp app, InspectionKit kit, java.util.List<java.lang.Integer> dataIds, java.util.List<java.lang.String> dataTypes, com.partnersoft.data.Naming initialData, long delay)
          Creates a new CreationProgressBar.
 
Method Summary
 void addCompletionListener(CompletionListener ear)
           
 void cancelCreation()
          Used to alert thread to stop task.
protected  java.lang.Object doInBackground()
           
 void removeCompletionListener(CompletionListener ear)
           
 boolean stopRunning()
          Checks if cancelCreation() has been called.
 
Methods inherited from class com.partnersoft.gui.ProgressBar
getBarDialog, getGui, hideBar, propertyChange, runTask, showBar, showBar, showBar, showBar, showBar
 
Methods inherited from class javax.swing.SwingWorker
addPropertyChangeListener, cancel, done, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, process, publish, removePropertyChangeListener, run, setProgress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CreationProgressBar

public CreationProgressBar(com.partnersoft.maps.app.MapApp app,
                           InspectionKit kit,
                           java.util.List<java.lang.Integer> dataIds,
                           java.util.List<java.lang.String> dataTypes,
                           com.partnersoft.data.Naming initialData,
                           long delay)
Creates a new CreationProgressBar. Attempts to create an inspection on each object associated with the passed data ID of the data types passed with the passed Inspection kit.

Has optional arguments for closing the parent window on task completion and pausing between each creation.

Parameters:
app - - Valid MapApp. Used to center map.
kit - - InspectionKit to generate Inspections for.
dataIds - - List of object IDs to generate Inspections on.
dataTypes - - Acceptable data types to inspect.
initialData - - Initial data to set each Inspection to.
delay - - Delay in milliseconds between each inspection.

CreationProgressBar

public CreationProgressBar(com.partnersoft.maps.app.MapApp app,
                           InspectionKit kit,
                           java.util.List<java.lang.Integer> dataIds,
                           java.util.List<java.lang.String> dataTypes,
                           com.partnersoft.data.Naming initialData)
Creates a new CreationProgressBar. Attempts to create an inspection on each object associated with the passed data ID of the data types passed with the passed Inspection kit.

Parameters:
app - - Valid MapApp. Used to center map.
kit - - InspectionKit to generate Inspections for.
dataIds - - List of object IDs to generate Inspections on.
dataTypes - - Acceptable data types to inspect.
initialData - - Initial data to set each Inspection to.
Method Detail

addCompletionListener

public void addCompletionListener(CompletionListener ear)

removeCompletionListener

public void removeCompletionListener(CompletionListener ear)

doInBackground

protected java.lang.Object doInBackground()
                                   throws java.lang.Exception
Specified by:
doInBackground in class com.partnersoft.gui.ProgressBar
Throws:
java.lang.Exception

cancelCreation

public void cancelCreation()
Used to alert thread to stop task. NOTE: this is different than SwingWorker.cancel() which has the ability to actually interrupt the thread. This is the correct method to use to stop Inspections from being created. The thread will stop on its own.


stopRunning

public boolean stopRunning()
Checks if cancelCreation() has been called.

Returns: