Class DownloadPrimitivesWithReferrersTask

    • Field Detail

      • newLayer

        private final boolean newLayer
        If true download into a new layer
      • ids

        private final java.util.List<PrimitiveId> ids
        List of primitives id to download
      • full

        private final boolean full
        If true, download members for relation
      • downloadReferrers

        private final boolean downloadReferrers
        If true, download also referrers
      • canceled

        private boolean canceled
        Flag indicated that user ask for cancel this task
      • missingPrimitives

        private java.util.Set<PrimitiveId> missingPrimitives
        set of missing ids, with overpass API these are also deleted objects
    • Constructor Detail

      • DownloadPrimitivesWithReferrersTask

        public DownloadPrimitivesWithReferrersTask​(boolean newLayer,
                                                   java.util.List<PrimitiveId> ids,
                                                   boolean downloadReferrers,
                                                   boolean full,
                                                   java.lang.String newLayerName,
                                                   ProgressMonitor monitor)
        Constructor
        Parameters:
        newLayer - if the data should be downloaded into a new layer
        ids - List of primitive id to download
        downloadReferrers - if the referrers of the object should be downloaded as well, i.e., parent relations, and for nodes, additionally, parent ways
        full - if the members of a relation should be downloaded as well
        newLayerName - the name to use for the new layer, can be null.
        monitor - ProgressMonitor to use, or null to create a new one
    • Method Detail

      • realRun

        protected void realRun()
                        throws org.xml.sax.SAXException,
                               java.io.IOException,
                               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:
        org.xml.sax.SAXException - if a SAX error occurs
        java.io.IOException - if an I/O error occurs
        OsmTransferException - if a communication error with the OSM server occurs
      • 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
      • getDownloadedId

        public java.util.List<PrimitiveIdgetDownloadedId()
        Return ids of really downloaded primitives.
        Returns:
        List of primitives id or null if no primitives were downloaded
      • reportProblemDialog

        public static ExtendedDialog reportProblemDialog​(java.util.Set<PrimitiveId> errs,
                                                         java.lang.String title,
                                                         java.lang.String text,
                                                         java.lang.String listLabel,
                                                         int msgType)
        Dialog for report a problem during download.
        Parameters:
        errs - Primitives involved
        title - Title of dialog
        text - Detail message
        listLabel - List of primitives description
        msgType - Type of message, see JOptionPane
        Returns:
        The Dialog object