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 Layer
active
private boolean
canceled
private java.io.File
file
private java.io.InputStream
is
private java.util.List<Layer>
layers
private java.util.List<java.lang.Runnable>
postLoadTasks
private SessionReader.SessionProjectionChoiceData
projectionChoice
private java.net.URI
uri
private SessionReader.SessionViewportData
viewport
private boolean
zip
-
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 boolean
addLayer(Layer l)
Tries to add a new layer.private void
addLayers()
void
cancel()
User pressed cancel button.protected void
finish()
Finish up the data work.private void
handleException(java.lang.String dialogTitle, java.lang.Exception e)
protected void
realRun()
Called in the worker thread to do the actual work.private void
runPostLoadTasks()
-
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 newLoader
for local session file.- Parameters:
file
- The JOSM session filezip
-true
if the file is a session archive file (*.joz)
-
Loader
public Loader(java.io.InputStream is, java.net.URI uri, boolean zip)
Constructs a newLoader
for session file input stream (may be a remote file).- Parameters:
is
- The input stream to session fileuri
- The file URIzip
-true
if the file is a session archive file (*.joz)- Since:
- 6245
-
-
Method Detail
-
cancel
public void cancel()
Description copied from class:PleaseWaitRunnable
User pressed cancel button.- Specified by:
cancel
in classPleaseWaitRunnable
-
finish
protected void finish()
Description copied from class:PleaseWaitRunnable
Finish 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:
finish
in classPleaseWaitRunnable
-
addLayers
private void addLayers()
-
addLayer
static boolean addLayer(Layer l)
Tries to add a new layer.- Parameters:
l
- layer to add- Returns:
true
if layer has been added,false
if it wasn't needed or if an error occurred
-
runPostLoadTasks
private void runPostLoadTasks()
-
realRun
protected void realRun()
Description copied from class:PleaseWaitRunnable
Called 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:
realRun
in classPleaseWaitRunnable
-
handleException
private void handleException(java.lang.String dialogTitle, java.lang.Exception e)
-
-