Changeset 30693 in osm for applications/editors/josm/plugins/waydownloader/src/org
- Timestamp:
- 2014-09-24T21:10:45+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/waydownloader/src/org/openstreetmap/josm/plugins/waydownloader/WayDownloaderPlugin.java
r30664 r30693 21 21 import org.openstreetmap.josm.data.Bounds; 22 22 import org.openstreetmap.josm.data.DataSource; 23 import org.openstreetmap.josm.data.coor.LatLon; 23 24 import org.openstreetmap.josm.data.osm.DataSet; 24 25 import org.openstreetmap.josm.data.osm.Node; … … 27 28 import org.openstreetmap.josm.gui.DefaultNameFormatter; 28 29 import org.openstreetmap.josm.gui.MainMenu; 30 import org.openstreetmap.josm.gui.Notification; 29 31 import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor; 30 32 import org.openstreetmap.josm.gui.util.GuiHelper; … … 100 102 DownloadOsmTask downloadTask = new DownloadOsmTask(); 101 103 final PleaseWaitProgressMonitor monitor = new PleaseWaitProgressMonitor(); 104 LatLon ll = selectedNode.getCoor(); 102 105 final Future<?> future = downloadTask.download( 103 106 false /* no new layer */, 104 107 new Bounds( 105 selectedNode.getCoor().lat()- latbuffer,106 selectedNode.getCoor().lon()- lonbuffer,107 selectedNode.getCoor().lat()+ latbuffer,108 selectedNode.getCoor().lon()+ lonbuffer108 ll.lat()- latbuffer, 109 ll.lon()- lonbuffer, 110 ll.lat()+ latbuffer, 111 ll.lon()+ lonbuffer 109 112 ), 110 113 monitor … … 119 122 future.get(); 120 123 } catch(Exception e) { 121 e.printStackTrace();124 Main.error(e); 122 125 return; 123 126 } … … 143 146 priorConnectedWay.getDisplayName(DefaultNameFormatter.getInstance()) 144 147 ); 145 System.err.println(msg);146 148 showErrorMessage(msg); 147 149 return; … … 301 303 private static void showWarningMessage(final String msg) { 302 304 if (msg != null) { 303 GuiHelper.runInEDTAndWait(new Runnable() { 305 Main.warn(msg.replace("<html>", "").replace("</html>", "")); 306 GuiHelper.runInEDT(new Runnable() { 304 307 @Override 305 308 public void run() { 306 JOptionPane.showMessageDialog( 307 Main.parent, 308 msg, 309 tr("Warning"), 310 JOptionPane.WARNING_MESSAGE 311 ); 309 new Notification(msg) 310 .setIcon(JOptionPane.WARNING_MESSAGE) 311 .show(); 312 312 } 313 313 }); … … 317 317 private static void showErrorMessage(final String msg) { 318 318 if (msg != null) { 319 GuiHelper.runInEDTAndWait(new Runnable() { 319 Main.error(msg.replace("<html>", "").replace("</html>", "")); 320 GuiHelper.runInEDT(new Runnable() { 320 321 @Override 321 322 public void run() { 322 JOptionPane.showMessageDialog( 323 Main.parent, 324 msg, 325 tr("Error"), 326 JOptionPane.ERROR_MESSAGE 327 ); 323 new Notification(msg) 324 .setIcon(JOptionPane.ERROR_MESSAGE) 325 .show(); 328 326 } 329 327 }); … … 333 331 private static void showInfoMessage(final String msg) { 334 332 if (msg != null) { 335 GuiHelper.runInEDTAndWait(new Runnable() { 333 Main.info(msg.replace("<html>", "").replace("</html>", "")); 334 GuiHelper.runInEDT(new Runnable() { 336 335 @Override 337 336 public void run() { 338 JOptionPane.showMessageDialog( 339 Main.parent, 340 msg, 341 tr("Information"), 342 JOptionPane.INFORMATION_MESSAGE 343 ); 337 new Notification(msg) 338 .setIcon(JOptionPane.INFORMATION_MESSAGE) 339 .setDuration(Notification.TIME_SHORT) 340 .show(); 344 341 } 345 342 });
Note:
See TracChangeset
for help on using the changeset viewer.