BioLegato 0.7.5 Core API

org.biolegato.menu
Class CommandThread

java.lang.Object
  extended by org.biolegato.menu.CommandThread
All Implemented Interfaces:
java.awt.event.ActionListener, java.lang.Runnable, java.util.EventListener

public class CommandThread
extends java.lang.Object
implements java.awt.event.ActionListener, java.lang.Runnable

Class used for making abstract actions which launch threads.

Author:
Graham Alvare, Brian Fristensky

Constructor Summary
CommandThread(java.lang.String command)
          Creates a new instance of CommandThread.
CommandThread(java.lang.String command, java.util.Map<java.lang.String,Widget> widgets)
          Creates a new instance of CommandThread.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Runs the command.
protected  java.lang.String replaceArguments(java.lang.String run)
          Replaces the variables in the command string with their corresponding values.
 void run()
          Used for running the command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandThread

public CommandThread(java.lang.String command)
Creates a new instance of CommandThread.

Parameters:
command - the command for the thread to run

CommandThread

public CommandThread(java.lang.String command,
                     java.util.Map<java.lang.String,Widget> widgets)
Creates a new instance of CommandThread.

Parameters:
command - the command for the thread to run
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Runs the command.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - ignored by this function

run

public void run()
Used for running the command.

This function gathers all of the parameter settings from the widgets, then generates and executes the corresponding command string.

Specified by:
run in interface java.lang.Runnable

replaceArguments

protected java.lang.String replaceArguments(java.lang.String run)
Replaces the variables in the command string with their corresponding values.

Parameters:
run - the command to do the replacements on.
widgets - the widget variables to use for string replacement.
files - the file variables to use for string replacement.
Returns:
the altered command string.

BioLegato 0.7.5 Core API

Copyright © 2008-2011 University of Manitoba.