IMPACT
Class PhyMLTask

java.lang.Object
  extended by javax.swing.SwingWorker<java.lang.String,java.lang.Void>
      extended by IMPACT.PhyMLTask
All Implemented Interfaces:
java.lang.Runnable, java.util.concurrent.Future<java.lang.String>, java.util.concurrent.RunnableFuture<java.lang.String>

public class PhyMLTask
extends javax.swing.SwingWorker<java.lang.String,java.lang.Void>

Implementation of a background task for PhyML execution.

Author:
Emanuel Maldonado

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.SwingWorker
javax.swing.SwingWorker.StateValue
 
Constructor Summary
PhyMLTask(java.lang.String location, java.lang.String seqfile, java.lang.String[] options, int pmlen)
          Initialize PhyML Task.
 
Method Summary
protected  java.lang.String doInBackground()
           
protected  void done()
           
 int getCurrent()
          Get current value for display progress bar and/or monitor.
It returns only the value that is greater than the previous one.
 java.lang.String getMessage()
          Get formated message of elapsed time since beginning of execution.
 java.lang.String getOutput()
          Get output resulting from terminated execution.
 boolean gotError()
          Verify if execution terminated with an error.
 boolean isdone()
          Verify if task has terminated.
 void stop()
          Stop PhyML execution.
 
Methods inherited from class javax.swing.SwingWorker
addPropertyChangeListener, cancel, 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

PhyMLTask

public PhyMLTask(java.lang.String location,
                 java.lang.String seqfile,
                 java.lang.String[] options,
                 int pmlen)
Initialize PhyML Task. Build execution command using following parameters.

Parameters:
location - PhyML executable absolute path location.
seqfile - sequence absolute path file location.
options - user phyml options.
pmlen - maximum value of progress bar and/or monitor.
Method Detail

doInBackground

protected java.lang.String doInBackground()
Specified by:
doInBackground in class javax.swing.SwingWorker<java.lang.String,java.lang.Void>

done

protected void done()
Overrides:
done in class javax.swing.SwingWorker<java.lang.String,java.lang.Void>

isdone

public boolean isdone()
Verify if task has terminated. While task not terminated performs operations on several values.

Returns:
true if task is done. false otherwise.

gotError

public boolean gotError()
Verify if execution terminated with an error.

Returns:
true if error ocurred; false otherwise.

getCurrent

public int getCurrent()
Get current value for display progress bar and/or monitor.
It returns only the value that is greater than the previous one.

Returns:
display value.

getMessage

public java.lang.String getMessage()
Get formated message of elapsed time since beginning of execution.

Returns:
message.

getOutput

public java.lang.String getOutput()
Get output resulting from terminated execution.

Returns:
program output; null execution while not terminated.

stop

public void stop()
Stop PhyML execution.