org.openstreetmap.josm.actions.downloadtasks
Class DownloadGpsTask.DownloadTask

java.lang.Object
  extended by org.openstreetmap.josm.gui.PleaseWaitRunnable
      extended by org.openstreetmap.josm.actions.downloadtasks.DownloadGpsTask.DownloadTask
All Implemented Interfaces:
java.lang.Runnable, ProgressMonitor.CancelListener
Enclosing class:
DownloadGpsTask

 class DownloadGpsTask.DownloadTask
extends PleaseWaitRunnable


Field Summary
private  boolean newLayer
           
private  GpxData rawData
           
private  OsmServerReader reader
           
 
Fields inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable
progressMonitor
 
Constructor Summary
DownloadGpsTask.DownloadTask(boolean newLayer, OsmServerReader reader, ProgressMonitor progressMonitor)
           
 
Method Summary
protected  void cancel()
          User pressed cancel button.
 ProgressTaskId canRunInBackground()
          Task can run in background if returned value <> null.
private  Layer findMergeLayer()
           
protected  void finish()
          Finish up the data work.
 void realRun()
          Called in the worker thread to do the actual work.
 
Methods inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable
afterFinish, getProgressMonitor, operationCanceled, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

reader

private OsmServerReader reader

rawData

private GpxData rawData

newLayer

private final boolean newLayer
Constructor Detail

DownloadGpsTask.DownloadTask

public DownloadGpsTask.DownloadTask(boolean newLayer,
                                    OsmServerReader reader,
                                    ProgressMonitor progressMonitor)
Method Detail

realRun

public void realRun()
             throws java.io.IOException,
                    org.xml.sax.SAXException,
                    OsmTransferException
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 class PleaseWaitRunnable
Throws:
java.io.IOException
org.xml.sax.SAXException
OsmTransferException

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 class PleaseWaitRunnable

findMergeLayer

private Layer findMergeLayer()

cancel

protected void cancel()
Description copied from class: PleaseWaitRunnable
User pressed cancel button.

Specified by:
cancel in class PleaseWaitRunnable

canRunInBackground

public ProgressTaskId canRunInBackground()
Description copied from class: PleaseWaitRunnable
Task can run in background if returned value <> null. Note that it's tasks responsibility to ensure proper synchronization, PleaseWaitRunnable doesn't with it.

Overrides:
canRunInBackground in class PleaseWaitRunnable
Returns:
If returned value is <> null then task can run in background. TaskId could be used in future for "Always run in background" checkbox


JOSM