Class StreetsideExportManager
- java.lang.Object
-
- org.openstreetmap.josm.gui.PleaseWaitRunnable
-
- org.openstreetmap.josm.plugins.streetside.io.export.StreetsideExportManager
-
- All Implemented Interfaces:
java.lang.Runnable,ProgressMonitor.CancelListener
public class StreetsideExportManager extends PleaseWaitRunnable
Export main thread. Exportation works by creating aStreetsideExportWriterThreadand severalStreetsideExportDownloadThread. The second ones download every single image that is going to be exported and stores them in anArrayBlockingQueue. Then it is picked by the first one and written on the selected folder. Each image will be named by its key.
-
-
Field Summary
Fields Modifier and Type Field Description private intamountprivate java.util.concurrent.ThreadPoolExecutorexprivate java.util.Set<StreetsideAbstractImage>images(package private) static org.apache.log4j.Loggerloggerprivate java.lang.Stringpathprivate java.util.concurrent.ArrayBlockingQueue<java.awt.image.BufferedImage>queueprivate java.util.concurrent.ArrayBlockingQueue<StreetsideAbstractImage>queueImagesprivate java.lang.Threadwriter-
Fields inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable
progressMonitor
-
-
Constructor Summary
Constructors Constructor Description StreetsideExportManager(java.util.Set<StreetsideAbstractImage> images, java.lang.String path)Main constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcancel()protected voidfinish()protected voidrealRun()-
Methods inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable
afterFinish, canRunInBackground, getProgressMonitor, operationCanceled, run
-
-
-
-
Field Detail
-
logger
static final org.apache.log4j.Logger logger
-
queue
private final java.util.concurrent.ArrayBlockingQueue<java.awt.image.BufferedImage> queue
-
queueImages
private final java.util.concurrent.ArrayBlockingQueue<StreetsideAbstractImage> queueImages
-
amount
private int amount
-
images
private java.util.Set<StreetsideAbstractImage> images
-
path
private java.lang.String path
-
writer
private java.lang.Thread writer
-
ex
private java.util.concurrent.ThreadPoolExecutor ex
-
-
Constructor Detail
-
StreetsideExportManager
public StreetsideExportManager(java.util.Set<StreetsideAbstractImage> images, java.lang.String path)
Main constructor.- Parameters:
images- Set ofStreetsideAbstractImageobjects to be exported.path- Export path.
-
-
Method Detail
-
cancel
protected void cancel()
- Specified by:
cancelin classPleaseWaitRunnable
-
realRun
protected void realRun() throws java.io.IOException
- Specified by:
realRunin classPleaseWaitRunnable- Throws:
java.io.IOException
-
finish
protected void finish()
- Specified by:
finishin classPleaseWaitRunnable
-
-