org.stringer.thread
Class AbstractThreadListener

java.lang.Object
  |
  +--org.stringer.thread.AbstractThreadListener
All Implemented Interfaces:
IThreadListener
Direct Known Subclasses:
FeedListener, FeedWriter, TableViewThreadListener, TreeSelectionThreadListener, TreeViewThreadListener

public class AbstractThreadListener
extends java.lang.Object
implements IThreadListener

An implementation of IThreadListener that provides default implementations for some of its required methods. Progress is indicated by making method calls on a JProgressBar.

Author:
R. Kevin Cole kcole@users.sourceforge.net

Field Summary
protected  int count
           
(package private)  int max
           
(package private)  int min
           
protected  javax.swing.ProgressMonitor monitor
           
protected  javax.swing.JProgressBar progressBar
           
protected  java.util.Map subscriptionMap
           
 
Constructor Summary
AbstractThreadListener()
           
AbstractThreadListener(javax.swing.JProgressBar progressBar, int min, int max)
           
 
Method Summary
 void begin()
          Called at the begining of processing for a give item.
 void beginUnit(java.lang.Object o)
           
 void canceled()
          Called when the job has been canceled (interrupted).
 void complete(java.lang.Object o)
          Called when the job is complete.
 void endUnit(java.lang.Object o)
          Called at the end of processing for a give item.
 javax.swing.ProgressMonitor getProgressMonitor()
           
 java.util.Map getSubscriptionMap()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

progressBar

protected javax.swing.JProgressBar progressBar

max

int max

min

int min

count

protected int count

monitor

protected javax.swing.ProgressMonitor monitor

subscriptionMap

protected java.util.Map subscriptionMap
Constructor Detail

AbstractThreadListener

public AbstractThreadListener()

AbstractThreadListener

public AbstractThreadListener(javax.swing.JProgressBar progressBar,
                              int min,
                              int max)
Method Detail

getSubscriptionMap

public java.util.Map getSubscriptionMap()

getProgressMonitor

public javax.swing.ProgressMonitor getProgressMonitor()
Specified by:
getProgressMonitor in interface IThreadListener

begin

public void begin()
Description copied from interface: IThreadListener
Called at the begining of processing for a give item. This provides for fine-grained reporting of thread activity.

Specified by:
begin in interface IThreadListener

beginUnit

public void beginUnit(java.lang.Object o)
Specified by:
beginUnit in interface IThreadListener

endUnit

public void endUnit(java.lang.Object o)
Description copied from interface: IThreadListener
Called at the end of processing for a give item. This provides for fine-grained reporting of thread activity.

Specified by:
endUnit in interface IThreadListener

complete

public void complete(java.lang.Object o)
Called when the job is complete.

Specified by:
complete in interface IThreadListener

canceled

public void canceled()
Called when the job has been canceled (interrupted).

Specified by:
canceled in interface IThreadListener


Copyright © R. Kevin Cole. All Rights Reserved.