Ignore:
Timestamp:
2009-07-19T18:01:42+02:00 (15 years ago)
Author:
jttt
Message:

Made work with JOSM new ProgressMonitor

Location:
applications/editors/josm/plugins/cadastre-fr
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/build.xml

    r16007 r16581  
    2626                <attribute name="Plugin-Description" value="A special handler for the French land registry WMS server."/>
    2727                <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/FR:JOSM/Fr:Plugin/Cadastre"/>
    28                 <attribute name="Plugin-Mainversion" value="1646"/>
     28                <attribute name="Plugin-Mainversion" value="1811"/>
    2929                <attribute name="Plugin-Stage" value="60"/>
    3030                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreGrabber.java

    r15961 r16581  
    1212import javax.imageio.ImageIO;
    1313
    14 import org.openstreetmap.josm.Main;
    1514import org.openstreetmap.josm.data.coor.EastNorth;
     15import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    1616import org.openstreetmap.josm.io.OsmTransferException;
    1717import org.openstreetmap.josm.io.ProgressInputStream;
     
    8484        wmsInterface.urlConn.setRequestMethod("GET");
    8585        wmsInterface.setCookie();
    86         InputStream is = new ProgressInputStream(wmsInterface.urlConn, Main.pleaseWaitDlg);
     86        InputStream is = new ProgressInputStream(wmsInterface.urlConn, NullProgressMonitor.INSTANCE);
    8787        BufferedImage img = ImageIO.read(is);
    8888        is.close();
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java

    r16007 r16581  
    7878            urlConn.connect();
    7979            if (urlConn.getResponseCode() != HttpURLConnection.HTTP_OK) {
    80                 throw (IOException) new IOException("Cannot get Cadastre cookie.");
     80                throw new IOException("Cannot get Cadastre cookie.");
    8181            }
    8282            BufferedReader in = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
     
    148148            urlConn.connect();
    149149            if (urlConn.getResponseCode() != HttpURLConnection.HTTP_OK) {
    150                 throw (IOException) new IOException("Cannot open Cadastre interface. GET response:"+urlConn.getResponseCode());
     150                throw new IOException("Cannot open Cadastre interface. GET response:"+urlConn.getResponseCode());
    151151            }
    152152            BufferedReader in = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
     
    330330        urlConn.connect();
    331331        if (urlConn.getResponseCode() != HttpURLConnection.HTTP_OK) {
    332             throw (IOException) new IOException("Cannot get Cadastre response.");
     332            throw new IOException("Cannot get Cadastre response.");
    333333        }
    334334        BufferedReader in = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
     
    371371
    372372    public void cancel() {
    373         Main.pleaseWaitDlg.currentAction.setText(tr("Aborting..."));
    374373        if (urlConn != null) {
    375374            urlConn.setConnectTimeout(1);
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGBuilding.java

    r16160 r16581  
    2929import org.openstreetmap.josm.gui.MapView;
    3030import org.openstreetmap.josm.gui.PleaseWaitRunnable;
     31import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    3132import org.openstreetmap.josm.io.OsmTransferException;
    3233import org.openstreetmap.josm.io.ProgressInputStream;
     
    5051    @Override
    5152    public void realRun() throws IOException, OsmTransferException {
    52         Main.pleaseWaitDlg.currentAction.setText(tr("Contacting WMS Server..."));
     53        progressMonitor.indeterminateSubTask(tr("Contacting WMS Server..."));
    5354        try {
    5455            if (wmsInterface.retrieveInterface(wmsLayer)) {
     
    232233        wmsInterface.urlConn.setRequestMethod("GET");
    233234        wmsInterface.setCookie();
    234         InputStream is = new ProgressInputStream(wmsInterface.urlConn, Main.pleaseWaitDlg);
     235        InputStream is = new ProgressInputStream(wmsInterface.urlConn, NullProgressMonitor.INSTANCE);
    235236        File file = new File(CadastrePlugin.cacheDir + "building.svg");
    236237        String svg = new String();
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGTask.java

    r15961 r16581  
    2929import org.openstreetmap.josm.data.osm.Way;
    3030import org.openstreetmap.josm.gui.PleaseWaitRunnable;
     31import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    3132import org.openstreetmap.josm.io.OsmTransferException;
    3233import org.openstreetmap.josm.io.ProgressInputStream;
     
    5455    @Override
    5556    public void realRun() throws IOException, OsmTransferException {
    56         Main.pleaseWaitDlg.currentAction.setText(tr("Contacting WMS Server..."));
     57        progressMonitor.indeterminateSubTask(tr("Contacting WMS Server..."));
    5758        try {
    5859            if (wmsInterface.retrieveInterface(wmsLayer)) {
     
    6061                if (svg == null)
    6162                    return;
    62                 Main.pleaseWaitDlg.currentAction.setText(tr("Extract SVG ViewBox..."));
     63                progressMonitor.indeterminateSubTask(tr("Extract SVG ViewBox..."));
    6364                getViewBox(svg);
    6465                if (viewBox == null)
    6566                    return;
    66                 Main.pleaseWaitDlg.currentAction.setText(tr("Extract best fitting boundary..."));
     67                progressMonitor.indeterminateSubTask(tr("Extract best fitting boundary..."));
    6768                createWay(svg);
    6869            }
     
    187188        wmsInterface.urlConn.setRequestMethod("GET");
    188189        wmsInterface.setCookie();
    189         InputStream is = new ProgressInputStream(wmsInterface.urlConn, Main.pleaseWaitDlg);
     190        InputStream is = new ProgressInputStream(wmsInterface.urlConn, NullProgressMonitor.INSTANCE);
    190191        File file = new File(CadastrePlugin.cacheDir + "boundary.svg");
    191192        String svg = new String();
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSTask.java

    r15961 r16581  
    44
    55import java.io.IOException;
     6
    67import org.openstreetmap.josm.Main;
     8import org.openstreetmap.josm.data.Bounds;
     9import org.openstreetmap.josm.gui.MapView;
    710import org.openstreetmap.josm.gui.PleaseWaitRunnable;
    8 import org.openstreetmap.josm.gui.MapView;
    9 import org.openstreetmap.josm.data.Bounds;
    1011
    1112public class DownloadWMSTask extends PleaseWaitRunnable {
     
    2627    @Override
    2728    public void realRun() throws IOException {
    28         Main.pleaseWaitDlg.currentAction.setText(tr("Contacting WMS Server..."));
     29        progressMonitor.indeterminateSubTask(tr("Contacting WMS Server..."));
    2930        try {
    3031            if (grabber.getWmsInterface().retrieveInterface(wmsLayer)) {
Note: See TracChangeset for help on using the changeset viewer.