Package org.openstreetmap.josm.actions
Class SessionLoadAction.Loader
- java.lang.Object
-
- org.openstreetmap.josm.gui.PleaseWaitRunnable
-
- org.openstreetmap.josm.actions.SessionLoadAction.Loader
-
- All Implemented Interfaces:
java.lang.Runnable,ProgressMonitor.CancelListener
- Enclosing class:
- SessionLoadAction
public static class SessionLoadAction.Loader extends PleaseWaitRunnable
JOSM session loader
-
-
Field Summary
Fields Modifier and Type Field Description private Layeractiveprivate booleancanceledprivate java.io.Filefileprivate java.io.InputStreamisprivate java.util.List<Layer>layersprivate java.util.List<java.lang.Runnable>postLoadTasksprivate SessionReader.SessionProjectionChoiceDataprojectionChoiceprivate java.net.URIuriprivate SessionReader.SessionViewportDataviewportprivate booleanzip-
Fields inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable
progressMonitor
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static booleanaddLayer(Layer l)Tries to add a new layer.private voidaddLayers()voidcancel()User pressed cancel button.protected voidfinish()Finish up the data work.private voidhandleException(java.lang.String dialogTitle, java.lang.Exception e)protected voidrealRun()Called in the worker thread to do the actual work.private voidrunPostLoadTasks()-
Methods inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable
afterFinish, canRunInBackground, getProgressMonitor, operationCanceled, run
-
-
-
-
Field Detail
-
canceled
private boolean canceled
-
file
private java.io.File file
-
uri
private final java.net.URI uri
-
is
private final java.io.InputStream is
-
zip
private final boolean zip
-
postLoadTasks
private java.util.List<java.lang.Runnable> postLoadTasks
-
viewport
private SessionReader.SessionViewportData viewport
-
projectionChoice
private SessionReader.SessionProjectionChoiceData projectionChoice
-
-
Constructor Detail
-
Loader
public Loader(java.io.File file, boolean zip)
Constructs a newLoaderfor local session file.- Parameters:
file- The JOSM session filezip-trueif the file is a session archive file (*.joz)
-
Loader
public Loader(java.io.InputStream is, java.net.URI uri, boolean zip)
Constructs a newLoaderfor session file input stream (may be a remote file).- Parameters:
is- The input stream to session fileuri- The file URIzip-trueif the file is a session archive file (*.joz)- Since:
- 6245
-
-
Method Detail
-
cancel
public void cancel()
Description copied from class:PleaseWaitRunnableUser pressed cancel button.- Specified by:
cancelin classPleaseWaitRunnable
-
finish
protected void 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
-
addLayers
private void addLayers()
-
addLayer
static boolean addLayer(Layer l)
Tries to add a new layer.- Parameters:
l- layer to add- Returns:
trueif layer has been added,falseif it wasn't needed or if an error occurred
-
runPostLoadTasks
private void runPostLoadTasks()
-
realRun
protected void 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
-
handleException
private void handleException(java.lang.String dialogTitle, java.lang.Exception e)
-
-