Module org.jpo
Package org.jpo.gui

Class ConsolidateGroupWorker

java.lang.Object
javax.swing.SwingWorker<String,String>
org.jpo.gui.ConsolidateGroupWorker
All Implemented Interfaces:
Runnable, Future<String>, RunnableFuture<String>

public class ConsolidateGroupWorker extends SwingWorker<String,String>
This class moves all pictures of a group node to a target directory.
  • Constructor Details

    • ConsolidateGroupWorker

      public ConsolidateGroupWorker(File targetDirectory, SortableDefaultMutableTreeNode startNode, boolean recurseGroups, ProgressGui progGui)
      Creates a Thread which runs the consolidation.
      Parameters:
      targetDirectory - Where we want the files moved to
      startNode - The node from which this is all to be built.
      recurseGroups - Flag indicating subgroups should be included
      progGui - A Progress Gui
  • Method Details

    • doInBackground

      protected String doInBackground()
      The run method is fired by starting the thread. It creates a ProgressGui and does the work.
      Specified by:
      doInBackground in class SwingWorker<String,String>
      Returns:
      Integer.MAX_VALUE
    • process

      protected void process(List<String> messages)
      Overrides:
      process in class SwingWorker<String,String>
    • done

      protected void done()
      Overrides:
      done in class SwingWorker<String,String>
    • needToMovePicture

      public static boolean needToMovePicture(@NonNull PictureInfo pictureInfo, @NonNull File targetDirectory)
      Returns true if the picture needs to be moved, false if not
      Parameters:
      pictureInfo - the PictureInfo pointing to the image to move
      targetDirectory - the target directory to move it to
      Returns:
      True if a move is needed False if not.
    • movePicture

      public static boolean movePicture(@NonNull PictureInfo pictureInfo, @NonNull File targetDirectory)
      This method moves a PictureInfo's file to the target directory if it exists and can be moved necessary.
      Parameters:
      pictureInfo - the PictureInfo pointing to the highres file to move
      targetDirectory - the target directory
      Returns:
      True if a real move was done False if not.