Changeset 16589 in osm for applications/editors/josm


Ignore:
Timestamp:
2009-07-19T19:30:14+02:00 (15 years ago)
Author:
jttt
Message:

Made plug-in work with JOSM new ProgressMonitor API

Location:
applications/editors/josm/plugins/remotecontrol
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/remotecontrol/build.xml

    r16290 r16589  
    2626                <attribute name="Plugin-Description" value="Let other applications send commands to JOSM."/>
    2727                <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/RemoteControl"/>
    28                 <attribute name="Plugin-Mainversion" value="1722"/>
     28                <attribute name="Plugin-Mainversion" value="1813"/>
    2929                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    3030            </manifest>
  • applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RemoteControlPlugin.java

    r13497 r16589  
    33import java.io.IOException;
    44
    5 import org.openstreetmap.josm.Main;
    65import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
    76import org.openstreetmap.josm.plugins.Plugin;
     
    109
    1110 */
    12 public class RemoteControlPlugin extends Plugin 
     11public class RemoteControlPlugin extends Plugin
    1312{
    1413    /** The HTTP server this plugin launches */
    1514    static HttpServer server;
    16    
     15
    1716    /**
    1817     * Creates the plugin, and starts the HTTP server
     
    2221        restartServer();
    2322    }
    24    
     23
    2524    @Override
    26     public PreferenceSetting getPreferenceSetting() 
     25    public PreferenceSetting getPreferenceSetting()
    2726    {
    2827        return new RemoteControlPreferences();
    2928    }
    30    
     29
    3130    /**
    3231     * Starts or restarts the HTTP server
     
    3938            if (server != null)
    4039                server.stopServer();
    41            
     40
    4241            int port = HttpServer.DEFAULT_PORT;
    4342            server = new HttpServer(port);
  • applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RemoteControlPreferences.java

    r14991 r16589  
    55import java.awt.Color;
    66import java.awt.GridBagLayout;
    7 import java.awt.event.*;
    87
    9 import javax.swing.*;
     8import javax.swing.BorderFactory;
     9import javax.swing.Box;
     10import javax.swing.JCheckBox;
     11import javax.swing.JLabel;
     12import javax.swing.JPanel;
    1013
    1114import org.openstreetmap.josm.Main;
     
    1316import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
    1417import org.openstreetmap.josm.tools.GBC;
    15 import org.openstreetmap.josm.tools.I18n;
    1618
    1719/**
  • applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestProcessor.java

    r16290 r16589  
    55import java.awt.geom.Area;
    66import java.awt.geom.Rectangle2D;
    7 import java.io.*;
     7import java.io.BufferedInputStream;
     8import java.io.BufferedOutputStream;
     9import java.io.IOException;
     10import java.io.InputStreamReader;
     11import java.io.OutputStream;
     12import java.io.OutputStreamWriter;
     13import java.io.Reader;
     14import java.io.Writer;
    815import java.net.Socket;
    916import java.net.URLDecoder;
     
    1926import org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask;
    2027import org.openstreetmap.josm.data.Bounds;
    21 import org.openstreetmap.josm.data.coor.EastNorth;
    2228import org.openstreetmap.josm.data.coor.LatLon;
    2329import org.openstreetmap.josm.data.osm.Node;
     
    2733import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
    2834import org.openstreetmap.josm.gui.download.DownloadDialog.DownloadTask;
     35import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor;
    2936
    3037/**
     
    3744
    3845    private class AlreadyLoadedException extends Exception {};
    39     private class DeniedException extends Exception {};
    4046    private class LoadDeniedException extends Exception {};
    4147
     
    154160                        maxlon = downloadBounds.getMaxX();
    155161                    }
    156                     osmTask.download(null, minlat,minlon,maxlat,maxlon);
     162                    osmTask.download(null, minlat,minlon,maxlat,maxlon, new PleaseWaitProgressMonitor());
    157163                } catch (AlreadyLoadedException ex) {
    158164                    System.out.println("RemoteControl: no download necessary");
Note: See TracChangeset for help on using the changeset viewer.