Class ImagesLoader
java.lang.Object
org.openstreetmap.josm.gui.PleaseWaitRunnable
org.openstreetmap.josm.gui.layer.geoimage.ImagesLoader
- All Implemented Interfaces:
Runnable,ProgressMonitor.CancelListener
Loads a set of images, while displaying a dialog that indicates what the plugin is currently doing.
In facts, this object is instantiated with a list of files. These files may be JPEG files or
directories. In case of directories, they are scanned to find all the images they contain.
Then all the images that have be found are loaded as ImageEntry instances.
- Since:
- 18035 (extracted from GeoImageLayer)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate final GpxLayerprivate final List<GeoImageLayer>private static final BooleanPropertyprivate final Collection<File>Fields inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable
progressMonitor -
Constructor Summary
ConstructorsConstructorDescriptionImagesLoader(Collection<File> selection, GpxLayer gpxLayer) Constructs a newImagesLoader. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddRecursiveFiles(Collection<File> files, Collection<File> sel) protected voidcancel()User pressed cancel button.protected voidfinish()Finish up the data work.private Stringprotected voidrealRun()Called in the worker thread to do the actual work.private voidrememberError(String message) Methods inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable
afterFinish, canRunInBackground, getProgressMonitor, operationCanceled, run
-
Field Details
-
canceled
-
layers
-
selection
-
loadedDirectories
-
errorMessages
-
gpxLayer
-
PROP_ONE_LAYER_PER_FOLDER
-
-
Constructor Details
-
ImagesLoader
ImagesLoader(Collection<File> selection, GpxLayer gpxLayer) Constructs a newImagesLoader.- Parameters:
selection- image files to loadgpxLayer- associated GPX layer
-
-
Method Details
-
rememberError
-
realRun
Description copied from class:PleaseWaitRunnableCalled in the worker thread to do the actual work. When any of the exception is thrown, a message box will be displayed and closeDialog is called. finish() is called in any case.- Specified by:
realRunin classPleaseWaitRunnable- Throws:
IOException- if an I/O error occurs
-
addRecursiveFiles
-
formatErrorMessages
-
finish
Description copied from class:PleaseWaitRunnableFinish up the data work. Is guaranteed to be called if realRun is called. Finish is called in the gui thread just after the dialog disappeared.- Specified by:
finishin classPleaseWaitRunnable
-
cancel
Description copied from class:PleaseWaitRunnableUser pressed cancel button.- Specified by:
cancelin classPleaseWaitRunnable
-