Module org.jpo
Package org.jpo.gui

Class PictureAdder

All Implemented Interfaces:
Runnable, Future<Integer>, RunnableFuture<Integer>

public class PictureAdder extends SwingWorker<Integer,Integer>
A Class which brings up a progress bar and adds pictures to the specified node.
  • Constructor Details

    • PictureAdder

      public PictureAdder(PictureAdderRequest request)
      Constructor
      Parameters:
      request - The request to fulfill
  • Method Details

    • doInBackground

      public Integer doInBackground()
      Adds the indicated files to the current node if they are valid pictures. If the newOnly Flag is on then the collection is checked to see if the picture is already present. It also opens a progress Gui to provide feedback to the user.
      Specified by:
      doInBackground in class SwingWorker<Integer,Integer>
      Returns:
      A string
    • process

      protected void process(List<Integer> chunks)
      The Swing Worker sends the publish() events here on the EDT when it feels like it.
      Overrides:
      process in class SwingWorker<Integer,Integer>
      Parameters:
      chunks - Send 1 to increment the count of pictures processed, -1 to decrement the total
    • done

      protected void done()
      Sends a model notification about the change and updates the cancel button to an OK button
      Overrides:
      done in class SwingWorker<Integer,Integer>