Ignore:
Timestamp:
2009-06-07T02:56:33+02:00 (15 years ago)
Author:
stoecker
Message:

fixed plugin handling a bit

Location:
trunk/src/org/openstreetmap/josm/actions
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/PreferencesAction.java

    r1212 r1647  
    2323 * @author imi
    2424 */
    25 public class PreferencesAction extends JosmAction {
     25public class PreferencesAction extends JosmAction implements Runnable {
    2626
    2727    /**
     
    3737     */
    3838    public void actionPerformed(ActionEvent e) {
     39        new Thread(this).start();
     40    }
     41
     42    public void run() {
    3943        PreferenceDialog prefDlg = new PreferenceDialog();
    4044        prefDlg.setMinimumSize(new Dimension(400,300));
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java

    r1465 r1647  
    3939        private int num = 1;
    4040        private String msg = "";
    41        
     41
    4242        public Task(boolean newLayer, OsmServerReader reader, boolean silent,
    4343                int numLayers, String msg) {
     
    6565                dataSet.dataSources.add(new DataSource(currentBounds, "OpenStreetMap server"));
    6666            }
    67            
     67
    6868            OsmDataLayer layer = new OsmDataLayer(dataSet, tr("Data Layer {0}", num), null);
    6969            if (newLayer)
     
    7171            else
    7272                Main.main.editLayer().mergeFrom(layer);
    73            
     73
    7474            Main.pleaseWaitDlg.setCustomText("");
    7575        }
     
    9494            double t = minlon; minlon = maxlon; maxlon = t;
    9595        }
    96        
     96
    9797        boolean newLayer = action != null
    9898                                && (action.dialog == null || action.dialog.newLayer.isSelected());
     
    104104                message);
    105105        currentBounds = new Bounds(new LatLon(minlat, minlon), new LatLon(maxlat, maxlon));
    106         // We need submit instead of execute so we can wait for it to finish and get the error 
     106        // We need submit instead of execute so we can wait for it to finish and get the error
    107107        // message if necessary. If no one calls getErrorMessage() it just behaves like execute.
    108         task = Main.worker.submit(t, t);       
     108        task = Main.worker.submit(t, t);
    109109    }
    110    
     110
    111111    public void download(DownloadAction action, double minlat, double minlon,
    112112            double maxlat, double maxlon) {
     
    135135        return "osm";
    136136    }
    137    
     137
    138138    /**
    139139     * Finds the number of data layers currently opened
     
    149149        return num;
    150150    }
    151    
     151
    152152   /*
    153153    * (non-Javadoc)
     
    156156    public String getErrorMessage() {
    157157        if(task == null)
    158             return "";       
     158            return "";
    159159
    160160        try {
Note: See TracChangeset for help on using the changeset viewer.