Class IncrementableProcess
java.lang.Object
org.gvsig.gui.beans.incrementabletask.IncrementableProcess
- All Implemented Interfaces:
Runnable,EventListener,IIncrementable,IncrementableListener
public abstract class IncrementableProcess
extends Object
implements IIncrementable, IncrementableListener, Runnable
Process to be executed by an
IncrementableTask.- Version:
- 20/08/2008
- Author:
- Pablo Piqueras Bartolomé (pablo.piqueras@iver.es)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Threadprotected static Cancellableprotected booleanprotected booleanprotected booleanprotected IncrementableTaskprotected Stringprotected LogControlprotected intprotected longprotected booleanprotected String -
Constructor Summary
ConstructorsConstructorDescriptionIncrementableProcess(String title) Creates a new process.IncrementableProcess(String title, String label) Creates a new process.IncrementableProcess(String title, String label, boolean cancellable, boolean pausable) Creates a new process. -
Method Summary
Modifier and TypeMethodDescriptionvoidInvocado cuando se aprieta el boton Cancelar de la ventanavoidInvocado cuando se aprieta el boton Resumir de la ventanavoidInvocado cuando se aprieta el boton Suspender de la ventanagetLabel()Devuelve la etiqueta de la ventana IncrementableTaskgetLog()Devuelve el contenido del log de la ventana IncrementableTaskintDevuelve el porcentaje de 0 a 100 de la ventana IncrementableTaskgetTitle()Devuelve el titulo de la ventana IncrementableTaskprotected voidinsertLineLog(String line) Adds a new line to the log.booleanisAlive()booleanDetermines if this process can be canceled.booleanDetermines if this process can be paused.booleanDetermines if this thread has been suspended.abstract voidprocess()protected voidEnds the thread that displays the progress dialog with the evolution of the loading process.voidrun()voidsetCancelable(boolean b) Sets if this process can be canceled.voidSets the object that will display the evolution of this loading process as a progress dialog.voidSets a brief of the current subprocess.voidsetPausable(boolean b) Sets if this process can be paused.voidstart()Creates and starts a new thread to execute this importation process.voidstop()
-
Field Details
-
iTask
-
log
-
percentage
protected int percentage -
ended
protected boolean ended -
threadSuspended
protected volatile boolean threadSuspended -
blinker
-
t0
protected long t0 -
cancelProcess
-
isCancellable
protected boolean isCancellable -
isPausable
protected boolean isPausable -
title
-
label
-
-
Constructor Details
-
IncrementableProcess
Creates a new process.- Parameters:
title- title for the dialog that displays the evolution of the process
-
IncrementableProcess
Creates a new process.- Parameters:
title- title for the dialog that displays the evolution of the processlabel- brief of this process, that will be displayed in the dialog
-
IncrementableProcess
Creates a new process.- Parameters:
title- title for the dialog that displays the evolution of the processlabel- brief of this process, that will be displayed in the dialogcancellable- determines if this process can be canceledpausable- determines if this process can be paused
-
-
Method Details
-
getTitle
Description copied from interface:IIncrementableDevuelve el titulo de la ventana IncrementableTask- Specified by:
getTitlein interfaceIIncrementable- Returns:
- String
-
insertLineLog
Adds a new line to the log.- Parameters:
line- the line to add
-
getLabel
Description copied from interface:IIncrementableDevuelve la etiqueta de la ventana IncrementableTask- Specified by:
getLabelin interfaceIIncrementable- Returns:
- String
-
setLabel
Sets a brief of the current subprocess.
- Parameters:
label- brief of the current subprocess
-
getLog
Description copied from interface:IIncrementableDevuelve el contenido del log de la ventana IncrementableTask- Specified by:
getLogin interfaceIIncrementable- Returns:
- String
-
getPercent
public int getPercent()Description copied from interface:IIncrementableDevuelve el porcentaje de 0 a 100 de la ventana IncrementableTask- Specified by:
getPercentin interfaceIIncrementable- Returns:
- int
-
start
public void start()Creates and starts a new thread to execute this importation process.- See Also:
-
stop
public void stop()- See Also:
-
isAlive
public boolean isAlive()- See Also:
-
processFinalize
protected void processFinalize()Ends the thread that displays the progress dialog with the evolution of the loading process.- See Also:
-
setIncrementableTask
Sets the object that will display the evolution of this loading process as a progress dialog.- Parameters:
iTask- the object that will display the evolution of this loading process
-
isSuspended
public boolean isSuspended()Determines if this thread has been suspended.- Returns:
trueif this thread has been suspended; otherwisefalse
-
run
public void run() -
actionCanceled
Description copied from interface:IncrementableListenerInvocado cuando se aprieta el boton Cancelar de la ventana- Specified by:
actionCanceledin interfaceIncrementableListener- Parameters:
e-
-
actionResumed
Description copied from interface:IncrementableListenerInvocado cuando se aprieta el boton Resumir de la ventana- Specified by:
actionResumedin interfaceIncrementableListener- Parameters:
e-
-
actionSuspended
Description copied from interface:IncrementableListenerInvocado cuando se aprieta el boton Suspender de la ventana- Specified by:
actionSuspendedin interfaceIncrementableListener- Parameters:
e-
-
isCancelable
public boolean isCancelable()Description copied from interface:IIncrementableDetermines if this process can be canceled.
- Specified by:
isCancelablein interfaceIIncrementable- Returns:
trueif this process can be canceled, otherwisefalse
-
setCancelable
public void setCancelable(boolean b) Sets if this process can be canceled.
- Parameters:
b-trueif this process can be canceled, otherwisefalse
-
isPausable
public boolean isPausable()Description copied from interface:IIncrementableDetermines if this process can be paused.
- Specified by:
isPausablein interfaceIIncrementable- Returns:
trueif this process can be paused, otherwisefalse
-
setPausable
public void setPausable(boolean b) Sets if this process can be paused.
- Parameters:
b-trueif this process can be paused, otherwisefalse
-
process
- Throws:
InterruptedExceptionException
-