org.openstreetmap.josm.io.session
Class SessionReader

java.lang.Object
  extended by org.openstreetmap.josm.io.session.SessionReader

public class SessionReader
extends java.lang.Object

Reads a .jos session file and loads the layers in the process.


Nested Class Summary
private static class SessionReader.CancelOrContinueDialog
          Show Dialog when there is an error for one layer.
 class SessionReader.ImportSupport
           
 
Field Summary
private  java.util.List<Layer> layers
           
private  java.util.List<java.lang.Runnable> postLoadTasks
           
private  java.io.File sessionFile
           
private static java.util.Map<java.lang.String,java.lang.Class<? extends SessionLayerImporter>> sessionLayerImporters
           
private  boolean zip
           
private  java.util.zip.ZipFile zipFile
           
 
Constructor Summary
SessionReader()
           
 
Method Summary
private  void error(java.lang.String msg)
           
 java.util.List<Layer> getLayers()
           
 java.util.List<java.lang.Runnable> getPostLoadTasks()
           
static SessionLayerImporter getSessionLayerImporter(java.lang.String layerType)
           
 void loadSession(java.io.File sessionFile, boolean zip, ProgressMonitor progressMonitor)
           
private  void parseJos(org.w3c.dom.Document doc, ProgressMonitor progressMonitor)
           
static void registerSessionLayerImporter(java.lang.String layerType, java.lang.Class<? extends SessionLayerImporter> importer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sessionLayerImporters

private static java.util.Map<java.lang.String,java.lang.Class<? extends SessionLayerImporter>> sessionLayerImporters

sessionFile

private java.io.File sessionFile

zip

private boolean zip

zipFile

private java.util.zip.ZipFile zipFile

layers

private java.util.List<Layer> layers

postLoadTasks

private java.util.List<java.lang.Runnable> postLoadTasks
Constructor Detail

SessionReader

public SessionReader()
Method Detail

registerSessionLayerImporter

public static void registerSessionLayerImporter(java.lang.String layerType,
                                                java.lang.Class<? extends SessionLayerImporter> importer)

getSessionLayerImporter

public static SessionLayerImporter getSessionLayerImporter(java.lang.String layerType)

getLayers

public java.util.List<Layer> getLayers()
Returns:
list of layers that are later added to the mapview

getPostLoadTasks

public java.util.List<java.lang.Runnable> getPostLoadTasks()
Returns:
actions executed in EDT after layers have been added (message dialog, etc.)

error

private void error(java.lang.String msg)
            throws IllegalDataException
Throws:
IllegalDataException

parseJos

private void parseJos(org.w3c.dom.Document doc,
                      ProgressMonitor progressMonitor)
               throws IllegalDataException
Throws:
IllegalDataException

loadSession

public void loadSession(java.io.File sessionFile,
                        boolean zip,
                        ProgressMonitor progressMonitor)
                 throws IllegalDataException,
                        java.io.IOException
Throws:
IllegalDataException
java.io.IOException


JOSM