- 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.StateValue
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State
-
Constructor Summary
ConstructorDescriptionConsolidateGroupWorker
(File targetDirectory, SortableDefaultMutableTreeNode startNode, boolean recurseGroups, ProgressGui progGui) Creates a Thread which runs the consolidation. -
Method Summary
Modifier and TypeMethodDescriptionprotected String
The run method is fired by starting the thread.protected void
done()
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.static boolean
needToMovePicture
(@NonNull PictureInfo pictureInfo, @NonNull File targetDirectory) Returns true if the picture needs to be moved, false if notprotected void
Methods inherited from class javax.swing.SwingWorker
addPropertyChangeListener, cancel, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, publish, removePropertyChangeListener, run, setProgress
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
doInBackground
in classSwingWorker<String,
String> - Returns:
- Integer.MAX_VALUE
-
process
- Overrides:
process
in classSwingWorker<String,
String>
-
done
protected void done()- Overrides:
done
in 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.
-