Package picasso.util

Class ThreadedCommand<T>

  • All Implemented Interfaces:
    Command<T>

    public class ThreadedCommand<T>
    extends 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.
    • Constructor Detail

      • ThreadedCommand

        public ThreadedCommand​(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>