picasso.util
Class ThreadedCommand<T>

java.lang.Object
  extended by picasso.util.ThreadedCommand<T>
All Implemented Interfaces:
Command<T>

public class ThreadedCommand<T>
extends java.lang.Object
implements Command<T>

Execute a long running command in a separate thread and display the results in a component while the command is running.

Author:
Robert C Duvall, Sara Sprenkle - fixed bug with initial isDone parameter

Constructor Summary
ThreadedCommand(javax.swing.JComponent view, Command<T> command)
          Create a command that runs the given command and updates the given view over time.
 
Method Summary
 void execute(T target)
          Run the command on the target or cancel it if is already running.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadedCommand

public ThreadedCommand(javax.swing.JComponent view,
                       Command<T> command)
Create a command that runs the given command and updates the given view over time.

Method Detail

execute

public void execute(T target)
Run the command on the target or cancel it if is already running.

Specified by:
execute in interface Command<T>