|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.faceless.pdf2.viewer2.LongRunningTask
public abstract class LongRunningTask
The superclass for Importer and Exporter, this general class represents
a task which takes some time to run, may optionally be cancelled and which displays
some sort of progress dialog.
This code is copyright the Big Faceless Organization. You're welcome to use, modify and distribute it in any form in your own projects, provided those projects continue to make use of the Big Faceless PDF library.
| Constructor Summary | |
|---|---|
LongRunningTask()
|
|
| Method Summary | |
|---|---|
void |
cancel()
Cancel the current task. |
abstract float |
getProgress()
Return the progress of this task - a value from 0 (just started) to 1 (complete). |
abstract boolean |
isCancellable()
Return true if this task can be cancelled before completion by the user. |
boolean |
isCancelled()
Return true if this task was cancelled before completion by the user. |
boolean |
isRunning()
Return true if this task is currently running. |
abstract void |
run()
Run the current task. |
Thread |
start(JComponent parent,
String title)
Start the task. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LongRunningTask()
| Method Detail |
|---|
public abstract float getProgress()
public abstract boolean isCancellable()
public boolean isCancelled()
public boolean isRunning()
public void cancel()
public abstract void run()
throws Exception
start(javax.swing.JComponent, java.lang.String), this method
should typically not be called directly.
Exception
public Thread start(JComponent parent,
String title)
run() method is called, and a dialog displayed
which will show the tasks progress as determined by the getProgress() method.
If the task is cancellable, a "Cancel" button is displayed
as well, which will call the cancel() method when clicked on.
parent - the JComponent that the dialog should be displayed relative totitle - the title of the dialog window - typically something like "Loading".
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||