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 Details

    • iTask

      protected IncrementableTask iTask
    • log

      protected LogControl log
    • percentage

      protected int percentage
    • ended

      protected boolean ended
    • threadSuspended

      protected volatile boolean threadSuspended
    • blinker

      protected volatile Thread blinker
    • t0

      protected long t0
    • cancelProcess

      protected static Cancellable cancelProcess
    • isCancellable

      protected boolean isCancellable
    • isPausable

      protected boolean isPausable
    • title

      protected String title
    • label

      protected String label
  • Constructor Details

    • IncrementableProcess

      public IncrementableProcess(String title)
      Creates a new process.
      Parameters:
      title - title for the dialog that displays the evolution of the process
    • IncrementableProcess

      public IncrementableProcess(String title, String label)
      Creates a new process.
      Parameters:
      title - title for the dialog that displays the evolution of the process
      label - brief of this process, that will be displayed in the dialog
    • IncrementableProcess

      public IncrementableProcess(String title, String label, boolean cancellable, boolean pausable)
      Creates a new process.
      Parameters:
      title - title for the dialog that displays the evolution of the process
      label - brief of this process, that will be displayed in the dialog
      cancellable - determines if this process can be canceled
      pausable - determines if this process can be paused
  • Method Details

    • getTitle

      public String getTitle()
      Description copied from interface: IIncrementable
      Devuelve el titulo de la ventana IncrementableTask
      Specified by:
      getTitle in interface IIncrementable
      Returns:
      String
    • insertLineLog

      protected void insertLineLog(String line)
      Adds a new line to the log.
      Parameters:
      line - the line to add
    • getLabel

      public String getLabel()
      Description copied from interface: IIncrementable
      Devuelve la etiqueta de la ventana IncrementableTask
      Specified by:
      getLabel in interface IIncrementable
      Returns:
      String
    • setLabel

      public void setLabel(String label)

      Sets a brief of the current subprocess.

      Parameters:
      label - brief of the current subprocess
    • getLog

      public String getLog()
      Description copied from interface: IIncrementable
      Devuelve el contenido del log de la ventana IncrementableTask
      Specified by:
      getLog in interface IIncrementable
      Returns:
      String
    • getPercent

      public int getPercent()
      Description copied from interface: IIncrementable
      Devuelve el porcentaje de 0 a 100 de la ventana IncrementableTask
      Specified by:
      getPercent in interface IIncrementable
      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

      public void setIncrementableTask(IncrementableTask iTask)
      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:
      true if this thread has been suspended; otherwise false
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • actionCanceled

      public void actionCanceled(IncrementableEvent e)
      Description copied from interface: IncrementableListener
      Invocado cuando se aprieta el boton Cancelar de la ventana
      Specified by:
      actionCanceled in interface IncrementableListener
      Parameters:
      e -
    • actionResumed

      public void actionResumed(IncrementableEvent e)
      Description copied from interface: IncrementableListener
      Invocado cuando se aprieta el boton Resumir de la ventana
      Specified by:
      actionResumed in interface IncrementableListener
      Parameters:
      e -
    • actionSuspended

      public void actionSuspended(IncrementableEvent e)
      Description copied from interface: IncrementableListener
      Invocado cuando se aprieta el boton Suspender de la ventana
      Specified by:
      actionSuspended in interface IncrementableListener
      Parameters:
      e -
    • isCancelable

      public boolean isCancelable()
      Description copied from interface: IIncrementable

      Determines if this process can be canceled.

      Specified by:
      isCancelable in interface IIncrementable
      Returns:
      true if this process can be canceled, otherwise false
    • setCancelable

      public void setCancelable(boolean b)

      Sets if this process can be canceled.

      Parameters:
      b - true if this process can be canceled, otherwise false
    • isPausable

      public boolean isPausable()
      Description copied from interface: IIncrementable

      Determines if this process can be paused.

      Specified by:
      isPausable in interface IIncrementable
      Returns:
      true if this process can be paused, otherwise false
    • setPausable

      public void setPausable(boolean b)

      Sets if this process can be paused.

      Parameters:
      b - true if this process can be paused, otherwise false
    • process

      public abstract void process() throws InterruptedException, Exception
      Throws:
      InterruptedException
      Exception