- All Implemented Interfaces:
Runnable,Future<String>,RunnableFuture<String>
This class moves all pictures of a group node to a target directory.
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.SwingWorker
SwingWorker.StateValueNested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State -
Constructor Summary
ConstructorsConstructorDescriptionConsolidateGroupWorker(File targetDirectory, SortableDefaultMutableTreeNode startNode, boolean recurseGroups, ProgressGui progGui) Creates a Thread which runs the consolidation. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringThe run method is fired by starting the thread.protected voiddone()static booleanmovePicture(@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.static booleanneedToMovePicture(@NonNull PictureInfo pictureInfo, @NonNull File targetDirectory) Returns true if the picture needs to be moved, false if notprotected voidMethods inherited from class javax.swing.SwingWorker
addPropertyChangeListener, cancel, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, publish, removePropertyChangeListener, run, setProgressMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.concurrent.Future
exceptionNow, resultNow, state
-
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 tostartNode- The node from which this is all to be built.recurseGroups- Flag indicating subgroups should be includedprogGui- A Progress Gui
-
-
Method Details
-
doInBackground
The run method is fired by starting the thread. It creates a ProgressGui and does the work.- Specified by:
doInBackgroundin classSwingWorker<String,String> - Returns:
- Integer.MAX_VALUE
-
process
- Overrides:
processin classSwingWorker<String,String>
-
done
protected void done()- Overrides:
donein classSwingWorker<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 movetargetDirectory- the target directory to move it to- Returns:
- True if a move is needed False if not.
-
movePicture
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 movetargetDirectory- the target directory- Returns:
- True if a real move was done False if not.
-