- Timestamp:
- 2006-10-07T18:14:07+02:00 (17 years ago)
- Location:
- src/org/openstreetmap/josm
- Files:
-
- 5 added
- 3 deleted
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/Main.java
r149 r153 44 44 import org.openstreetmap.josm.actions.UndoAction; 45 45 import org.openstreetmap.josm.actions.UploadAction; 46 import org.openstreetmap.josm.actions.DownloadAction.DownloadTask; 46 47 import org.openstreetmap.josm.actions.mapmode.MapMode; 47 48 import org.openstreetmap.josm.data.Bounds; … … 51 52 import org.openstreetmap.josm.data.projection.Projection; 52 53 import org.openstreetmap.josm.gui.MapFrame; 54 import org.openstreetmap.josm.gui.PleaseWaitDialog; 53 55 import org.openstreetmap.josm.gui.MapView.LayerChangeListener; 54 56 import org.openstreetmap.josm.gui.annotation.AnnotationTester; … … 58 60 import org.openstreetmap.josm.gui.layer.OsmDataLayer.CommandQueueListener; 59 61 import org.openstreetmap.josm.plugins.PluginException; 60 import org.openstreetmap.josm.plugins.Plugin Loader;62 import org.openstreetmap.josm.plugins.PluginInformation; 61 63 import org.openstreetmap.josm.plugins.PluginProxy; 62 64 import org.openstreetmap.josm.tools.ImageProvider; … … 97 99 */ 98 100 public final static Collection<PluginProxy> plugins = new LinkedList<PluginProxy>(); 101 /** 102 * The dialog that gets displayed during background task execution. 103 */ 104 public static PleaseWaitDialog pleaseWaitDlg; 105 99 106 100 107 /** … … 130 137 131 138 for (PluginProxy plugin : plugins) 132 139 plugin.mapFrameInitialized(old, map); 133 140 } 134 141 … … 249 256 250 257 contentPane.updateUI(); 251 252 258 253 259 // Plugins 254 260 if (Main.pref.hasKey("plugins")) { 255 PluginLoader loader = new PluginLoader();256 261 for (String pluginName : Main.pref.get("plugins").split(",")) { 257 262 try { 258 263 File pluginFile = new File(pref.getPreferencesDir()+"plugins/"+pluginName+".jar"); 259 264 if (pluginFile.exists()) 260 plugins.add( loader.loadPlugin(loader.loadClassName(pluginFile), pluginFile));265 plugins.add(new PluginInformation(pluginFile).load()); 261 266 else 262 267 JOptionPane.showMessageDialog(Main.parent, tr("Plugin not found: {0}.", pluginName)); … … 268 273 } 269 274 } 275 270 276 /** 271 277 * Add a new layer to the map. If no map exist, create one. … … 304 310 305 311 306 p rivatestatic JPanel panel = new JPanel(new BorderLayout());312 public static JPanel panel = new JPanel(new BorderLayout()); 307 313 308 314 protected final JMenuBar mainMenu = new JMenuBar(); 309 315 protected static Rectangle bounds; 310 316 311 p rivatefinal UndoAction undoAction = new UndoAction();312 p rivatefinal RedoAction redoAction = new RedoAction();313 p rivatefinal OpenAction openAction = new OpenAction();314 p rivatefinal DownloadAction downloadAction = new DownloadAction();317 public final UndoAction undoAction = new UndoAction(); 318 public final RedoAction redoAction = new RedoAction(); 319 public final OpenAction openAction = new OpenAction(); 320 public final DownloadAction downloadAction = new DownloadAction(); 315 321 316 322 private final CommandQueueListener redoUndoListener = new CommandQueueListener(){ … … 374 380 if (bounds == null) 375 381 bounds = !args.containsKey("no-fullscreen") ? new Rectangle(0,0,screenDimension.width,screenDimension.height) : new Rectangle(1000,740); 382 383 pleaseWaitDlg = new PleaseWaitDialog(); 376 384 } 377 385 … … 393 401 if (b == null) 394 402 JOptionPane.showMessageDialog(Main.parent, tr("Ignoring malformed url: \"{0}\"", s)); 395 else 396 main.downloadAction.download(false, b.min.lat(), b.min.lon(), b.max.lat(), b.max.lon()); 403 else { 404 DownloadTask osmTask = main.downloadAction.downloadTasks.get(0); 405 osmTask.download(main.downloadAction, b.min.lat(), b.min.lon(), b.max.lat(), b.max.lon()); 406 } 397 407 return; 398 408 } … … 410 420 if (st.countTokens() == 4) { 411 421 try { 412 main.downloadAction.download(rawGps, Double.parseDouble(st.nextToken()), Double.parseDouble(st.nextToken()), Double.parseDouble(st.nextToken()), Double.parseDouble(st.nextToken())); 422 DownloadTask task = main.downloadAction.downloadTasks.get(rawGps ? 1 : 0); 423 task.download(main.downloadAction, Double.parseDouble(st.nextToken()), Double.parseDouble(st.nextToken()), Double.parseDouble(st.nextToken()), Double.parseDouble(st.nextToken())); 413 424 return; 414 425 } catch (final NumberFormatException e) { -
src/org/openstreetmap/josm/actions/DownloadAction.java
r138 r153 14 14 import java.awt.event.MouseAdapter; 15 15 import java.awt.event.MouseEvent; 16 import java.io.IOException; 17 import java.util.Collection; 16 import java.util.ArrayList; 18 17 import java.util.HashMap; 18 import java.util.List; 19 19 20 20 import javax.swing.DefaultListModel; … … 32 32 33 33 import org.openstreetmap.josm.Main; 34 import org.openstreetmap.josm.actions.downloadtasks.DownloadGpsTask; 35 import org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask; 34 36 import org.openstreetmap.josm.data.Bounds; 35 37 import org.openstreetmap.josm.data.coor.LatLon; 36 import org.openstreetmap.josm.data.osm.DataSet;37 38 import org.openstreetmap.josm.gui.BookmarkList; 38 39 import org.openstreetmap.josm.gui.MapView; 39 import org.openstreetmap.josm.gui.PleaseWaitRunnable;40 40 import org.openstreetmap.josm.gui.WorldChooser; 41 41 import org.openstreetmap.josm.gui.BookmarkList.Bookmark; 42 import org.openstreetmap.josm.gui.layer.OsmDataLayer;43 import org.openstreetmap.josm.gui.layer.RawGpsLayer;44 import org.openstreetmap.josm.gui.layer.RawGpsLayer.GpsPoint;45 import org.openstreetmap.josm.io.BoundingBoxDownloader;46 42 import org.openstreetmap.josm.tools.GBC; 47 import org.xml.sax.SAXException;48 43 49 44 /** 50 45 * Action that opens a connection to the osm server and download map data. 51 * 46 * 52 47 * An dialog is displayed asking the user to specify a rectangle to grab. 53 48 * The url and account settings from the preferences are used. 54 * 49 * 55 50 * @author imi 56 51 */ 57 52 public class DownloadAction extends JosmAction { 58 /** 59 * Open the download dialog and download the data. 60 * Run in the worker thread. 61 */ 62 private final class DownloadOsmTask extends PleaseWaitRunnable { 63 private final BoundingBoxDownloader reader; 64 private DataSet dataSet; 65 66 private DownloadOsmTask(BoundingBoxDownloader reader) { 67 super(tr("Downloading data")); 68 this.reader = reader; 69 reader.setProgressInformation(currentAction, progress); 70 } 71 72 @Override public void realRun() throws IOException, SAXException { 73 dataSet = reader.parseOsm(); 74 } 75 76 @Override protected void finish() { 77 if (dataSet == null) 78 return; // user cancelled download or error occoured 79 if (dataSet.allPrimitives().isEmpty()) 80 errorMessage = tr("No data imported."); 81 Main.main.addLayer(new OsmDataLayer(dataSet, tr("Data Layer"), null)); 82 } 83 84 @Override protected void cancel() { 85 reader.cancel(); 86 } 87 } 88 89 90 private final class DownloadGpsTask extends PleaseWaitRunnable { 91 private final BoundingBoxDownloader reader; 92 private Collection<Collection<GpsPoint>> rawData; 93 94 private DownloadGpsTask(BoundingBoxDownloader reader) { 95 super(tr("Downloading GPS data")); 96 this.reader = reader; 97 reader.setProgressInformation(currentAction, progress); 98 } 99 100 @Override public void realRun() throws IOException, SAXException { 101 rawData = reader.parseRawGps(); 102 } 103 104 @Override protected void finish() { 105 if (rawData == null) 106 return; 107 String name = latlon[0].getText() + " " + latlon[1].getText() + " x " + latlon[2].getText() + " " + latlon[3].getText(); 108 Main.main.addLayer(new RawGpsLayer(rawData, name, null)); 109 } 110 111 @Override protected void cancel() { 112 reader.cancel(); 113 } 114 } 115 53 54 public interface DownloadTask { 55 /** 56 * Execute the download. 57 */ 58 void download(DownloadAction action, double minlat, double minlon, double maxlat, double maxlon); 59 /** 60 * @return The checkbox presented to the user 61 */ 62 JCheckBox getCheckBox(); 63 /** 64 * @return The name of the preferences suffix to use for storing the 65 * selection state. 66 */ 67 String getPreferencesSuffix(); 68 } 69 70 /** 71 * The list of download tasks. First entry should be the osm data entry 72 * and the second the gps entry. After that, plugins can register additional 73 * download possibilities. 74 */ 75 public final List<DownloadTask> downloadTasks = new ArrayList<DownloadTask>(5); 116 76 117 77 /** 118 78 * minlat, minlon, maxlat, maxlon 119 79 */ 120 JTextField[] latlon = new JTextField[]{80 public JTextField[] latlon = new JTextField[]{ 121 81 new JTextField(9), 122 82 new JTextField(9), 123 83 new JTextField(9), 124 84 new JTextField(9)}; 125 JCheckBox rawGps = new JCheckBox(tr("Open as raw gps data"), false);126 85 127 86 public DownloadAction() { … … 130 89 for (JTextField f : latlon) 131 90 f.setMinimumSize(new Dimension(100,new JTextField().getMinimumSize().height)); 91 92 downloadTasks.add(new DownloadOsmTask()); 93 downloadTasks.add(new DownloadGpsTask()); 132 94 } 133 95 … … 155 117 mv.getLatLon(0, mv.getHeight()), 156 118 mv.getLatLon(mv.getWidth(), 0))); 157 rawGps.setSelected(mv.getActiveLayer() instanceof RawGpsLayer); 158 } 159 dlg.add(rawGps, GBC.eop()); 119 } 120 121 // adding the download tasks 122 dlg.add(new JLabel(tr("Download the following data:")), GBC.eol().insets(0,5,0,0)); 123 for (DownloadTask task : downloadTasks) { 124 dlg.add(task.getCheckBox(), GBC.eol().insets(20,0,0,0)); 125 task.getCheckBox().setSelected(Main.pref.getBoolean("download."+task.getPreferencesSuffix())); 126 } 160 127 161 128 // OSM url edit 162 dlg.add(new JLabel(tr("URL from www.openstreetmap.org")), GBC.eol() );129 dlg.add(new JLabel(tr("URL from www.openstreetmap.org")), GBC.eol().insets(0,5,0,0)); 163 130 final JTextField osmUrl = new JTextField(); 164 131 dlg.add(osmUrl, GBC.eop().fill(GBC.HORIZONTAL)); … … 204 171 if (b != null) 205 172 setEditBounds(b); 206 else 173 else 207 174 for (JTextField f : latlon) 208 175 f.setText(""); … … 222 189 latlon[i].setCaretPosition(0); 223 190 } 224 rawGps.setSelected(b == null ? false : b.rawgps);225 191 osmUrlRefresher.keyTyped(null); 226 192 } … … 267 233 // Finally: the dialog 268 234 Bookmark b; 235 boolean anySelected = false; 269 236 do { 270 237 final JOptionPane pane = new JOptionPane(dlg, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION); … … 283 250 return; 284 251 b = readBookmark(); 252 253 for (DownloadTask task : downloadTasks) { 254 if (task.getCheckBox().isSelected()) { 255 anySelected = true; 256 break; 257 } 258 } 259 285 260 if (b == null) 286 261 JOptionPane.showMessageDialog(Main.parent,tr("Please enter the desired coordinates or click on a bookmark.")); 287 } while (b == null); 262 else if (!anySelected) 263 JOptionPane.showMessageDialog(Main.parent,tr("Please select at least one download data type.")); 264 } while (b == null && anySelected); 288 265 289 266 double minlon = b.latlon[0]; … … 291 268 double maxlon = b.latlon[2]; 292 269 double maxlat = b.latlon[3]; 293 download( rawGps.isSelected(),minlon, minlat, maxlon, maxlat);270 download(minlon, minlat, maxlon, maxlat); 294 271 } 295 272 … … 309 286 b.latlon[i] = Double.parseDouble(latlon[i].getText()); 310 287 } 311 b.rawgps = rawGps.isSelected();312 288 return b; 313 289 } catch (NumberFormatException x) { … … 315 291 } 316 292 } 317 318 293 319 294 public static Bounds osmurl2bounds(String url) { … … 329 304 map.put(arg.substring(0, eq), Double.parseDouble(arg.substring(eq + 1))); 330 305 } catch (NumberFormatException e) { 331 } 306 } 332 307 } 333 308 } … … 363 338 * Do the download for the given area. 364 339 */ 365 public void download(boolean rawGps, double minlat, double minlon, double maxlat, double maxlon) { 366 BoundingBoxDownloader reader = new BoundingBoxDownloader(minlat, minlon, maxlat, maxlon); 367 PleaseWaitRunnable task = rawGps ? new DownloadGpsTask(reader) : new DownloadOsmTask(reader); 368 Main.worker.execute(task); 369 task.pleaseWaitDlg.setVisible(true); 340 public void download(double minlat, double minlon, double maxlat, double maxlon) { 341 for (DownloadTask task : downloadTasks) { 342 Main.pref.put("download."+task.getPreferencesSuffix(), task.getCheckBox().isSelected()); 343 if (task.getCheckBox().isSelected()) { 344 task.download(this, minlat, minlon, maxlat, maxlon); 345 } 346 } 370 347 } 371 348 } -
src/org/openstreetmap/josm/actions/DownloadIncompleteAction.java
r138 r153 26 26 /** 27 27 * Action that opens a connection to the osm server and download map data. 28 * 28 * 29 29 * An dialog is displayed asking the user to specify a rectangle to grab. 30 30 * The url and account settings from the preferences are used. 31 * 31 * 32 32 * @author imi 33 33 */ … … 46 46 super(trn("Downloading {0} segment", "Downloading {0} segments", toDownload.size(), toDownload.size())); 47 47 reader = new ObjectListDownloader(toDownload); 48 reader.setProgressInformation(currentAction, progress);49 48 } 50 49 … … 71 70 } 72 71 reader = new ObjectListDownloader(nodes); 73 reader.setProgressInformation(currentAction, progress);74 72 nodesLoaded = true; 75 73 Main.worker.execute(this); 76 pleaseWaitDlg.setVisible(true);77 74 } 78 75 … … 105 102 PleaseWaitRunnable task = new DownloadTask(toDownload); 106 103 Main.worker.execute(task); 107 task.pleaseWaitDlg.setVisible(true);108 104 } 109 105 } -
src/org/openstreetmap/josm/actions/ExternalToolsAction.java
r146 r153 66 66 super(msg); 67 67 this.p = p; 68 currentAction.setText(tr("Executing {0}",getValue(NAME)));69 68 } 70 69 71 70 @Override protected void realRun() throws SAXException, IOException { 71 Main.pleaseWaitDlg.currentAction.setText(tr("Executing {0}",getValue(NAME))); 72 72 if (!input.isEmpty()) { 73 73 fromDataSet = new DataSet(); … … 201 201 } 202 202 if (output != null) 203 dataSet = OsmReader.parseDataSet(p.getInputStream(), currentAction,progress);203 dataSet = OsmReader.parseDataSet(p.getInputStream(), Main.pleaseWaitDlg.currentAction, Main.pleaseWaitDlg.progress); 204 204 } 205 205 … … 302 302 PleaseWaitRunnable runner = new ExecuteToolRunner(tr("Executing {0}",getValue(NAME)), p); 303 303 Main.worker.execute(runner); 304 runner.pleaseWaitDlg.setVisible(true);305 304 } catch (IOException e1) { 306 305 e1.printStackTrace(); -
src/org/openstreetmap/josm/actions/UploadAction.java
r113 r153 26 26 /** 27 27 * Action that opens a connection to the osm server and upload all changes. 28 * 28 * 29 29 * An dialog is displayed asking the user to specify a rectangle to grab. 30 30 * The url and account settings from the preferences are used. 31 * 31 * 32 32 * @author imi 33 33 */ … … 75 75 PleaseWaitRunnable uploadTask = new PleaseWaitRunnable(tr("Uploading data")){ 76 76 @Override protected void realRun() throws SAXException { 77 server.setProgressInformation(currentAction, progress);78 77 server.uploadOsm(all); 79 78 } … … 86 85 }; 87 86 Main.worker.execute(uploadTask); 88 uploadTask.pleaseWaitDlg.setVisible(true);89 87 } 90 88 … … 129 127 } 130 128 131 return JOptionPane.showConfirmDialog(Main.parent, p, tr("Upload this changes?"), 129 return JOptionPane.showConfirmDialog(Main.parent, p, tr("Upload this changes?"), 132 130 JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION; 133 131 } -
src/org/openstreetmap/josm/gui/BookmarkList.java
r104 r153 3 3 import static org.openstreetmap.josm.tools.I18n.tr; 4 4 5 import java.awt.Component;6 5 import java.io.BufferedReader; 7 6 import java.io.File; … … 12 11 import java.util.StringTokenizer; 13 12 14 import javax.swing.DefaultListCellRenderer;15 13 import javax.swing.DefaultListModel; 16 import javax.swing.JLabel;17 14 import javax.swing.JList; 18 15 import javax.swing.JOptionPane; 19 16 20 17 import org.openstreetmap.josm.Main; 21 import org.openstreetmap.josm.tools.ImageProvider;22 18 23 19 /** … … 34 30 public String name; 35 31 public double[] latlon = new double[4]; // minlat, minlon, maxlat, maxlon 36 public boolean rawgps;37 32 @Override public String toString() { 38 33 return name; … … 47 42 load(); 48 43 setVisibleRowCount(7); 49 setCellRenderer(new DefaultListCellRenderer(){50 @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {51 Component c = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);52 if (c instanceof JLabel) {53 Bookmark b = (Bookmark)value;54 ((JLabel)c).setIcon(ImageProvider.get("layer/"+(b.rawgps?"rawgps_small":"osmdata_small")));55 }56 return c;57 }58 });59 44 } 60 45 … … 73 58 for (String line = in.readLine(); line != null; line = in.readLine()) { 74 59 StringTokenizer st = new StringTokenizer(line, ","); 75 if (st.countTokens() != 6)60 if (st.countTokens() != 5) 76 61 continue; 77 62 Bookmark b = new Bookmark(); … … 80 65 for (int i = 0; i < b.latlon.length; ++i) 81 66 b.latlon[i] = Double.parseDouble(st.nextToken()); 82 b.rawgps = Boolean.parseBoolean(st.nextToken());83 67 model.addElement(b); 84 68 } catch (NumberFormatException x) { … … 107 91 out.print(b.name+","); 108 92 for (int i = 0; i < b.latlon.length; ++i) 109 out.print(b.latlon[i]+ ",");110 out.println( b.rawgps);93 out.print(b.latlon[i]+(i<b.latlon.length-1?",":"")); 94 out.println(); 111 95 } 112 96 out.close(); -
src/org/openstreetmap/josm/gui/MainApplication.java
r138 r153 26 26 /** 27 27 * Main window class application. 28 * 28 * 29 29 * @author imi 30 30 */ 31 31 public class MainApplication extends Main { 32 32 /** 33 * Construct an main frame, ready sized and operating. Does not 33 * Construct an main frame, ready sized and operating. Does not 34 34 * display the frame. 35 35 */ … … 67 67 /** 68 68 * Main application Startup 69 * @param args No parameters accepted.70 69 */ 71 70 public static void main(final String[] argArray) { … … 74 73 ///////////////////////////////////////////////////////////////////////// 75 74 // Do not translate the early strings below until the locale is set up. 76 // The cannot be translated. That's live. Really. Sorry.75 // These strings cannot be translated. That's live. Really. Sorry. 77 76 // 78 // The next sending me a patch translating these strings owe me a beer!77 // The next one sending me a patch translating these strings owe me a beer! 79 78 // 80 79 // Imi. 81 80 ///////////////////////////////////////////////////////////////////////// 82 81 83 82 Thread.setDefaultUncaughtExceptionHandler(new BugReportExceptionHandler()); 84 83 … … 139 138 } 140 139 } 141 140 142 141 // Locale is set. From now on, tr(), trn() and trc() may be called. 143 142 -
src/org/openstreetmap/josm/gui/MapView.java
r116 r153 27 27 import org.openstreetmap.josm.gui.layer.Layer; 28 28 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 29 import org.openstreetmap.josm.gui.layer.WmsServerLayer;30 29 import org.openstreetmap.josm.gui.layer.OsmDataLayer.ModifiedChangedListener; 31 30 32 31 /** 33 32 * This is a component used in the MapFrame for browsing the map. It use is to 34 * provide the MapMode's enough capabilities to operate. 35 * 33 * provide the MapMode's enough capabilities to operate. 34 * 36 35 * MapView hold meta-data about the data set currently displayed, as scale level, 37 36 * center point viewed, what scrolling mode or editing mode is selected or with … … 99 98 add(zoomSlider); 100 99 zoomSlider.setBounds(3, 0, 114, 30); 101 100 102 101 MapScaler scaler = new MapScaler(this); 103 102 add(scaler); … … 128 127 129 128 // add as a new layer 130 if (layer instanceof WmsServerLayer) 129 if (layer instanceof OsmDataLayer) 130 layers.add(0, layer); 131 else 131 132 layers.add(layers.size(), layer); 132 else133 layers.add(0, layer);134 133 135 134 for (LayerChangeListener l : listeners) … … 219 218 } 220 219 /** 221 * Set the new dimension to the projection class. Also adjust the components 220 * Set the new dimension to the projection class. Also adjust the components 222 221 * scale, if in autoScale mode. 223 222 */ … … 239 238 240 239 if (v.min == null || v.max == null || v.min.equals(v.max)) { 241 // no bounds means whole world 240 // no bounds means whole world 242 241 center = getProjection().latlon2eastNorth(new LatLon(0,0)); 243 242 EastNorth world = getProjection().latlon2eastNorth(new LatLon(Projection.MAX_LAT,Projection.MAX_LON)); -
src/org/openstreetmap/josm/gui/PleaseWaitRunnable.java
r113 r153 4 4 5 5 import java.awt.EventQueue; 6 import java.awt.GridBagLayout;7 6 import java.awt.event.ActionEvent; 8 7 import java.awt.event.ActionListener; … … 11 10 import java.io.FileNotFoundException; 12 11 import java.io.IOException; 12 import java.lang.reflect.InvocationTargetException; 13 13 14 import javax.swing.BorderFactory;15 import javax.swing.BoundedRangeModel;16 import javax.swing.JButton;17 import javax.swing.JDialog;18 import javax.swing.JLabel;19 14 import javax.swing.JOptionPane; 20 import javax.swing.JPanel;21 import javax.swing.JProgressBar;22 15 23 16 import org.openstreetmap.josm.Main; 24 import org.openstreetmap.josm.tools.GBC;25 import org.openstreetmap.josm.tools.I18n;26 17 import org.xml.sax.SAXException; 27 18 … … 29 20 * Instanced of this thread will display a "Please Wait" message in middle of JOSM 30 21 * to indicate a progress beeing executed. 31 * 22 * 32 23 * @author Imi 33 24 */ 34 25 public abstract class PleaseWaitRunnable implements Runnable { 35 26 36 public final JDialog pleaseWaitDlg;37 27 public String errorMessage; 38 28 39 private final JProgressBar progressBar = new JProgressBar();40 29 private boolean closeDialogCalled = false; 30 private boolean cancelled = false; 41 31 42 protected final JLabel currentAction = new JLabel(I18n.tr("Contacting the OSM server...")); 43 protected final BoundedRangeModel progress = progressBar.getModel(); 32 private final String title; 44 33 45 34 /** 46 35 * Create the runnable object with a given message for the user. 47 36 */ 48 public PleaseWaitRunnable(String msg) { 49 pleaseWaitDlg = new JDialog(JOptionPane.getFrameForComponent(Main.parent), msg, true); 50 pleaseWaitDlg.setLayout(new GridBagLayout()); 51 JPanel pane = new JPanel(new GridBagLayout()); 52 pane.setBorder(BorderFactory.createEmptyBorder(10,10,10,10)); 53 pane.add(currentAction, GBC.eol().fill(GBC.HORIZONTAL)); 54 pane.add(progressBar, GBC.eop().fill(GBC.HORIZONTAL)); 55 JButton cancel = new JButton(tr("Cancel")); 56 pane.add(cancel, GBC.eol().anchor(GBC.CENTER)); 57 pleaseWaitDlg.setContentPane(pane); 58 pleaseWaitDlg.setSize(350,100); 59 pleaseWaitDlg.setLocationRelativeTo(Main.parent); 60 61 cancel.addActionListener(new ActionListener(){ 37 public PleaseWaitRunnable(String title) { 38 this.title = title; 39 Main.pleaseWaitDlg.cancel.addActionListener(new ActionListener(){ 62 40 public void actionPerformed(ActionEvent e) { 63 cancel(); 41 if (!cancelled) { 42 cancelled = true; 43 cancel(); 44 } 64 45 } 65 46 }); 66 pleaseWaitDlg.addWindowListener(new WindowAdapter(){47 Main.pleaseWaitDlg.addWindowListener(new WindowAdapter(){ 67 48 @Override public void windowClosing(WindowEvent e) { 68 49 if (!closeDialogCalled) { 69 cancel(); 50 if (!cancelled) { 51 cancelled = true; 52 cancel(); 53 } 70 54 closeDialog(); 71 55 } … … 76 60 public final void run() { 77 61 try { 62 if (cancelled) 63 return; // since realRun isn't executed, do not call to finish 64 Main.pleaseWaitDlg.setTitle(title); 65 66 // show the dialog 67 closeDialogCalled = false; 68 EventQueue.invokeLater(new Runnable() { 69 public void run() { 70 Main.pleaseWaitDlg.setVisible(true); 71 } 72 }); 73 78 74 realRun(); 79 75 } catch (SAXException x) { … … 116 112 return; 117 113 closeDialogCalled = true; 118 EventQueue.invokeLater(new Runnable(){ 119 public void run() { 120 finish(); 121 pleaseWaitDlg.setVisible(false); 122 pleaseWaitDlg.dispose(); 123 if (errorMessage != null) 124 JOptionPane.showMessageDialog(Main.parent, errorMessage); 125 } 126 }); 114 try { 115 Runnable runnable = new Runnable(){ 116 public void run() { 117 try { 118 finish(); 119 } finally { 120 Main.pleaseWaitDlg.setVisible(false); 121 } 122 if (errorMessage != null) 123 JOptionPane.showMessageDialog(Main.parent, errorMessage); 124 } 125 }; 126 127 // make sure, this is called in the dispatcher thread ASAP 128 if (EventQueue.isDispatchThread()) 129 runnable.run(); 130 else 131 EventQueue.invokeAndWait(runnable); 132 133 } catch (InterruptedException e) { 134 } catch (InvocationTargetException e) { 135 throw new RuntimeException(e); 136 } 127 137 } 128 138 } -
src/org/openstreetmap/josm/gui/PreferenceDialog.java
r150 r153 49 49 import org.openstreetmap.josm.Main; 50 50 import org.openstreetmap.josm.data.projection.Projection; 51 import org.openstreetmap.josm.plugins.Plugin Proxy;51 import org.openstreetmap.josm.plugins.PluginInformation; 52 52 import org.openstreetmap.josm.tools.ColorHelper; 53 53 import org.openstreetmap.josm.tools.GBC; … … 109 109 110 110 String plugins = ""; 111 for (Entry< String, Boolean> entry : pluginMap.entrySet())111 for (Entry<PluginInformation, Boolean> entry : pluginMap.entrySet()) 112 112 if (entry.getValue()) 113 plugins += entry.getKey() + ",";113 plugins += entry.getKey().name + ","; 114 114 if (plugins.endsWith(",")) 115 115 plugins = plugins.substring(0, plugins.length()-1); … … 135 135 private static final String CANCELBUTTON_PROP = "OptionPane.cancelButtonText"; 136 136 public CancelAction() { 137 super(UIManager.getString(CANCELBUTTON_PROP), 137 super(UIManager.getString(CANCELBUTTON_PROP), 138 138 UIManager.getIcon("OptionPane.cancelIcon")); 139 139 try { … … 157 157 private JComboBox lafCombo = new JComboBox(UIManager.getInstalledLookAndFeels()); 158 158 private JComboBox languages = new JComboBox(new Locale[]{ 159 new Locale("en", "US"), 160 new Locale("en", "GB"), 161 Locale.GERMAN, 159 new Locale("en", "US"), 160 new Locale("en", "GB"), 161 Locale.GERMAN, 162 162 Locale.FRENCH, 163 163 new Locale("ro", "RO")}); … … 168 168 169 169 /** 170 * Editfield for the Base url to the REST API from OSM. 170 * Editfield for the Base url to the REST API from OSM. 171 171 */ 172 172 private JTextField osmDataServer = new JTextField(20); … … 205 205 private JComboBox projectionCombo = new JComboBox(Projection.allProjections); 206 206 private JList annotationSources = new JList(new DefaultListModel()); 207 private Map< String, Boolean> pluginMap = new HashMap<String, Boolean>();207 private Map<PluginInformation, Boolean> pluginMap = new HashMap<PluginInformation, Boolean>(); 208 208 209 209 … … 285 285 286 286 Box pluginPanel = Box.createVerticalBox(); 287 Collection< String> availablePlugins = new HashSet<String>();287 Collection<PluginInformation> availablePlugins = new HashSet<PluginInformation>(); 288 288 File[] pluginFiles = new File(Main.pref.getPreferencesDir()+"plugins").listFiles(); 289 if (pluginFiles != null) { 290 for (File f : pluginFiles) { 291 if (!f.isFile() || !f.getName().endsWith(".jar")) 292 continue; 293 availablePlugins.add(f.getName().substring(0, f.getName().length()-4)); 294 } 295 } 289 if (pluginFiles != null) 290 for (File f : pluginFiles) 291 if (f.isFile() && f.getName().endsWith(".jar")) 292 availablePlugins.add(new PluginInformation(f)); 293 296 294 Collection<String> enabledPlugins = Arrays.asList(Main.pref.get("plugins").split(",")); 297 for (final String plugin : availablePlugins) { 298 boolean enabled = enabledPlugins.contains(plugin); 299 String desc = null; 300 for (PluginProxy p : Main.plugins) { 301 if (p.name.equals(plugin)) { 302 desc = p.getDescription(); 303 break; 304 } 305 } 306 307 final JCheckBox pluginCheck = new JCheckBox(plugin, enabled); 295 for (final PluginInformation plugin : availablePlugins) { 296 boolean enabled = enabledPlugins.contains(plugin.name); 297 final JCheckBox pluginCheck = new JCheckBox(plugin.name, enabled); 308 298 pluginPanel.add(pluginCheck); 309 if (desc != null) { 310 pluginCheck.setToolTipText(desc);311 JLabel label = new JLabel("<html><i>"+desc+"</i></html>");312 313 314 315 } 299 300 pluginCheck.setToolTipText(plugin.file.getAbsolutePath()); 301 JLabel label = new JLabel("<html><i>"+(plugin.description==null?"no description available":plugin.description)+"</i></html>"); 302 label.setBorder(BorderFactory.createEmptyBorder(0,20,0,0)); 303 pluginPanel.add(label); 304 pluginPanel.add(Box.createVerticalStrut(5)); 305 316 306 pluginMap.put(plugin, enabled); 317 307 pluginCheck.addActionListener(new ActionListener(){ -
src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r128 r153 49 49 * respects clicks into the selection list. Ctrl-click will remove entries from 50 50 * the list while single click will make the clicked entry the only selection. 51 * 51 * 52 52 * @author imi 53 53 */ … … 68 68 } 69 69 @Override protected void realRun() { 70 currentAction.setText(tr("Contact {0}...", url.getHost()));70 Main.pleaseWaitDlg.currentAction.setText(tr("Contact {0}...", url.getHost())); 71 71 sel = mode != SearchMode.remove ? new LinkedList<OsmPrimitive>() : Main.ds.allNonDeletedPrimitives(); 72 72 try { 73 73 URLConnection con = url.openConnection(); 74 InputStream in = new ProgressInputStream(con , progress, currentAction);75 currentAction.setText(tr("Downloading..."));74 InputStream in = new ProgressInputStream(con); 75 Main.pleaseWaitDlg.currentAction.setText(tr("Downloading...")); 76 76 Map<Long, String> ids = idReader.parseIds(in); 77 77 for (OsmPrimitive osm : Main.ds.allNonDeletedPrimitives()) { … … 236 236 if (loader.url != null) { 237 237 Main.worker.execute(loader); 238 loader.pleaseWaitDlg.setVisible(true);239 238 return; 240 239 } -
src/org/openstreetmap/josm/gui/layer/GeoImageLayer.java
r145 r153 79 79 public int compareTo(ImageEntry image) { 80 80 return time.compareTo(image.time); 81 } 81 } 82 82 } 83 83 … … 93 93 } 94 94 @Override protected void realRun() throws IOException { 95 currentAction.setText(tr("Read GPS..."));95 Main.pleaseWaitDlg.currentAction.setText(tr("Read GPS...")); 96 96 LinkedList<TimedPoint> gps = new LinkedList<TimedPoint>(); 97 97 … … 119 119 ArrayList<ImageEntry> data = new ArrayList<ImageEntry>(files.size()); 120 120 int i = 0; 121 progress.setMaximum(files.size());121 Main.pleaseWaitDlg.progress.setMaximum(files.size()); 122 122 for (File f : files) { 123 123 if (cancelled) 124 124 break; 125 currentAction.setText(tr("Reading {0}...",f.getName()));126 progress.setValue(i++);125 Main.pleaseWaitDlg.currentAction.setText(tr("Reading {0}...",f.getName())); 126 Main.pleaseWaitDlg.progress.setValue(i++); 127 127 128 128 ImageEntry e = new ImageEntry(); … … 153 153 154 154 /** 155 * The delta added to all timestamps in files from the camera 155 * The delta added to all timestamps in files from the camera 156 156 * to match to the timestamp from the gps receivers tracklog. 157 157 */ … … 185 185 public static void create(Collection<File> files, RawGpsLayer gpsLayer) { 186 186 Loader loader = new Loader(files, gpsLayer); 187 new Thread(loader).start(); 188 loader.pleaseWaitDlg.setVisible(true); 187 Main.worker.execute(loader); 189 188 } 190 189 … … 192 191 super(tr("Geotagged Images")); 193 192 Collections.sort(data); 194 Collections.sort(gps); 193 Collections.sort(gps); 195 194 this.data = data; 196 195 this.gps = gps; … … 367 366 new JSeparator(), 368 367 new JMenuItem(new RenameLayerAction(null, this)), 369 new JSeparator(), 368 new JSeparator(), 370 369 new JMenuItem(new LayerListPopup.InfoAction(this))}; 371 370 } -
src/org/openstreetmap/josm/io/BoundingBoxDownloader.java
r104 r153 8 8 import java.util.LinkedList; 9 9 10 import org.openstreetmap.josm.Main; 10 11 import org.openstreetmap.josm.data.osm.DataSet; 11 12 import org.openstreetmap.josm.gui.layer.RawGpsLayer.GpsPoint; … … 40 41 Collection<Collection<GpsPoint>> data = new LinkedList<Collection<GpsPoint>>(); 41 42 Collection<GpsPoint> list = new LinkedList<GpsPoint>(); 42 43 43 44 for (int i = 0;;++i) { 44 currentAction.setText(tr("Downloading points {0} to {1}...", i * 5000, ((i + 1) * 5000)));45 Main.pleaseWaitDlg.currentAction.setText(tr("Downloading points {0} to {1}...", i * 5000, ((i + 1) * 5000))); 45 46 InputStream in = getInputStream(url+i); 46 47 if (in == null) … … 59 60 activeConnection = null; 60 61 } 61 62 62 63 data.add(list); 63 64 return data; … … 86 87 if (in == null) 87 88 return null; 88 currentAction.setText(tr("Downloading OSM data..."));89 final DataSet data = OsmReader.parseDataSet(in, currentAction,progress);89 Main.pleaseWaitDlg.currentAction.setText(tr("Downloading OSM data...")); 90 final DataSet data = OsmReader.parseDataSet(in, Main.pleaseWaitDlg.currentAction, Main.pleaseWaitDlg.progress); 90 91 in.close(); 91 92 activeConnection = null; -
src/org/openstreetmap/josm/io/ObjectListDownloader.java
r113 r153 7 7 import java.util.Collection; 8 8 9 import org.openstreetmap.josm.Main; 9 10 import org.openstreetmap.josm.data.osm.DataSet; 10 11 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 27 28 28 29 public DataSet parse() throws SAXException, IOException { 29 progress.setMaximum(toDownload.size());30 progress.setValue(0);30 Main.pleaseWaitDlg.progress.setMaximum(toDownload.size()); 31 Main.pleaseWaitDlg.progress.setValue(0); 31 32 try { 32 33 final NameVisitor namer = new NameVisitor(); … … 56 57 57 58 private void download(String className, long id) throws IOException, SAXException { 58 currentAction.setText(tr("Downloading {0} {1}", className, id));59 Main.pleaseWaitDlg.currentAction.setText(tr("Downloading {0} {1}", className, id)); 59 60 InputStream in = getInputStream(className+"/"+id); 60 61 if (in == null) 61 62 return; 62 63 DataSet data = OsmReader.parseDataSet(in, null, null); 63 progress.setValue(progress.getValue()+1);64 Main.pleaseWaitDlg.progress.setValue(Main.pleaseWaitDlg.progress.getValue()+1); 64 65 if (data.allPrimitives().size() > 1) 65 66 throw new SAXException(tr("Got more than one object when expecting only one.")); -
src/org/openstreetmap/josm/io/OsmConnection.java
r104 r153 9 9 import java.net.PasswordAuthentication; 10 10 11 import javax.swing.BoundedRangeModel;12 11 import javax.swing.JCheckBox; 13 12 import javax.swing.JLabel; … … 23 22 * Base class that handles common things like authentication for the reader and writer 24 23 * to the osm server. 25 * 24 * 26 25 * @author imi 27 26 */ … … 34 33 public OsmParseException(Throwable cause) {super(cause);} 35 34 } 36 35 37 36 protected boolean cancel = false; 38 37 protected HttpURLConnection activeConnection; 39 protected JLabel currentAction;40 protected BoundedRangeModel progress;41 38 42 39 private static OsmAuth authentication; … … 116 113 } 117 114 118 public void setProgressInformation(JLabel currentAction, BoundedRangeModel progress) {119 this.currentAction = currentAction;120 this.progress = progress;121 }122 123 115 public void cancel() { 124 currentAction.setText(tr("Aborting..."));116 Main.pleaseWaitDlg.currentAction.setText(tr("Aborting...")); 125 117 cancel = true; 126 118 if (activeConnection != null) { -
src/org/openstreetmap/josm/io/OsmReader.java
r113 r153 32 32 /** 33 33 * Parser for the Osm Api. Read from an input stream and construct a dataset out of it. 34 * 34 * 35 35 * Reading process takes place in three phases. During the first phase (including xml parse), 36 36 * all nodes are read and stored. Other information than nodes are stored in a raw list 37 * 37 * 38 38 * The second phase reads from the raw list all segments and create Segment objects. 39 * 39 * 40 40 * The third phase read all ways out of the remaining objects in the raw list. 41 * 41 * 42 42 * @author Imi 43 43 */ -
src/org/openstreetmap/josm/io/OsmServerReader.java
r115 r153 10 10 /** 11 11 * This DataReader read directly from the REST API of the osm server. 12 * 12 * 13 13 * @author imi 14 14 */ … … 30 30 if (isAuthCancelled() && activeConnection.getResponseCode() == 401) 31 31 return null; 32 return new ProgressInputStream(activeConnection , progress, currentAction);32 return new ProgressInputStream(activeConnection); 33 33 } 34 34 } -
src/org/openstreetmap/josm/io/OsmServerWriter.java
r143 r153 26 26 /** 27 27 * Class that uploades all changes to the osm server. 28 * 28 * 29 29 * This is done like this: - All objects with id = 0 are uploaded as new, except 30 30 * those in deleted, which are ignored - All objects in deleted list are 31 31 * deleted. - All remaining objects with modified flag set are updated. 32 * 32 * 33 33 * This class implements visitor and will perform the correct upload action on 34 34 * the visited element. 35 * 35 * 36 36 * @author imi 37 37 */ … … 41 41 * This list contain all sucessfull processed objects. The caller of 42 42 * upload* has to check this after the call and update its dataset. 43 * 43 * 44 44 * If a server connection error occours, this may contain fewer entries 45 45 * than where passed in the list to upload*. … … 60 60 initAuthentication(); 61 61 62 progress.setMaximum(list.size());63 progress.setValue(0);62 Main.pleaseWaitDlg.progress.setMaximum(list.size()); 63 Main.pleaseWaitDlg.progress.setValue(0); 64 64 65 65 NameVisitor v = new NameVisitor(); … … 69 69 return; 70 70 osm.visit(v); 71 currentAction.setText(tr("Upload {0} {1} ({2})...", tr(v.className), v.name, osm.id));71 Main.pleaseWaitDlg.currentAction.setText(tr("Upload {0} {1} ({2})...", tr(v.className), v.name, osm.id)); 72 72 osm.visit(this); 73 progress.setValue(progress.getValue()+1);73 Main.pleaseWaitDlg.progress.setValue(Main.pleaseWaitDlg.progress.getValue()+1); 74 74 } 75 75 } catch (RuntimeException e) { … … 142 142 * Send the request. The objects id will be replaced if it was 0 before 143 143 * (on add requests). 144 * 144 * 145 145 * @param requestMethod The http method used when talking with the server. 146 146 * @param urlSuffix The suffix to add at the server url. 147 147 * @param osm The primitive to encode to the server. 148 * @param addBody <code>true</code>, if the whole primitive body should be added. 148 * @param addBody <code>true</code>, if the whole primitive body should be added. 149 149 * <code>false</code>, if only the id is encoded. 150 150 */ -
src/org/openstreetmap/josm/io/ProgressInputStream.java
r115 r153 5 5 import java.net.URLConnection; 6 6 7 import javax.swing.BoundedRangeModel; 8 import javax.swing.JLabel; 7 import org.openstreetmap.josm.Main; 9 8 10 9 /** … … 15 14 16 15 private final InputStream in; 17 private final BoundedRangeModel progress;18 private final JLabel currentAction;19 16 private int readSoFar = 0; 20 17 private int lastDialogUpdate = 0; 21 18 private final URLConnection connection; 22 19 23 public ProgressInputStream(URLConnection con , BoundedRangeModel progress, JLabel currentAction) throws IOException {20 public ProgressInputStream(URLConnection con) throws IOException { 24 21 this.connection = con; 25 22 this.in = con.getInputStream(); 26 this.progress = progress;27 this.currentAction = currentAction;28 23 int contentLength = con.getContentLength(); 29 24 if (contentLength > 0) 30 progress.setMaximum(contentLength);25 Main.pleaseWaitDlg.progress.setMaximum(contentLength); 31 26 else 32 progress.setMaximum(0);33 progress.setValue(0);27 Main.pleaseWaitDlg.progress.setMaximum(0); 28 Main.pleaseWaitDlg.progress.setValue(0); 34 29 } 35 30 … … 57 52 */ 58 53 private void advanceTicker(int amount) { 59 if ( progress.getMaximum() == 0 && connection.getContentLength() != -1)60 progress.setMaximum(connection.getContentLength());54 if (Main.pleaseWaitDlg.progress.getMaximum() == 0 && connection.getContentLength() != -1) 55 Main.pleaseWaitDlg.progress.setMaximum(connection.getContentLength()); 61 56 62 57 readSoFar += amount; … … 65 60 lastDialogUpdate++; 66 61 String progStr = " "+readSoFar/1024+"/"; 67 progStr += ( progress.getMaximum()==0) ? "??? KB" : (progress.getMaximum()/1024)+" KB";68 progress.setValue(readSoFar);62 progStr += (Main.pleaseWaitDlg.progress.getMaximum()==0) ? "??? KB" : (Main.pleaseWaitDlg.progress.getMaximum()/1024)+" KB"; 63 Main.pleaseWaitDlg.progress.setValue(readSoFar); 69 64 70 String cur = currentAction.getText();65 String cur = Main.pleaseWaitDlg.currentAction.getText(); 71 66 int i = cur.indexOf(' '); 72 67 if (i != -1) … … 74 69 else 75 70 cur += progStr; 76 currentAction.setText(cur);71 Main.pleaseWaitDlg.currentAction.setText(cur); 77 72 } 78 73 } -
src/org/openstreetmap/josm/plugins/Plugin.java
r149 r153 13 13 * (or else, the plugin jar will not be within the class path). 14 14 * 15 * All plugins should have at least one class subclassing this abstract base class. 16 * 15 * All plugins should have at least one class subclassing this abstract base class. 16 * 17 17 * The actual implementation of this interface is optional, as all functions will be called 18 18 * via reflection. This is to be able to change this interface without the need of recompiling … … 25 25 * 26 26 * 27 * The pluginname provided to the constructor is also the name of the directory to 27 * The pluginname provided to the constructor is also the name of the directory to 28 28 * store the plugin's own stuff (located under the josm preferences directory) 29 29 * … … 40 40 name = s.substring(lastSlash+1, s.length()-4); 41 41 } 42 42 43 43 /** 44 44 * @return The name of this plugin. This is the name of the .jar file. … … 54 54 } 55 55 56 56 57 57 58 58 /** … … 62 62 */ 63 63 public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {} 64 65 /**66 * Called to retrieve a one-liner description of what this plugin does for tooltips.67 * @return <code>null</code>, which means: "no description available".68 */69 public String getDescription() {return null;}70 71 64 } -
src/org/openstreetmap/josm/plugins/PluginProxy.java
r149 r153 6 6 /** 7 7 * Helper class for the JOSM system to communicate with the plugin. 8 * 8 * 9 9 * This class should be of no interest for sole plugin writer. 10 * 10 * 11 11 * @author Immanuel.Scholz 12 12 */ … … 14 14 15 15 public final Object plugin; 16 public final String name;16 public final PluginInformation info; 17 17 public boolean misbehaving = false; 18 18 19 public PluginProxy(Object plugin, String name) {19 public PluginProxy(Object plugin, PluginInformation info) { 20 20 this.plugin = plugin; 21 this. name = name;21 this.info = info; 22 22 } 23 23 24 25 26 24 @Override public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) { 27 25 try { 28 26 plugin.getClass().getMethod("mapFrameInitialized", MapFrame.class, MapFrame.class).invoke(plugin, oldFrame, newFrame); 29 27 } catch (Exception e) { 30 throw new PluginException(this, name, e); 31 } 32 } 33 34 @Override public String getDescription() { 35 try { 36 return (String)plugin.getClass().getMethod("getDescription").invoke(plugin); 37 } catch (NoSuchMethodException e) { 38 return super.getDescription(); 39 } catch (Exception e) { 40 throw new PluginException(this, name, e); 28 throw new PluginException(this, info.name, e); 41 29 } 42 30 } -
src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java
r149 r153 26 26 /** 27 27 * An exception handler, that ask the user to send a bug report. 28 * 28 * 29 29 * @author imi 30 30 */ 31 public final class BugReportExceptionHandler implements Thread.UncaughtExceptionHandler { 31 public final class BugReportExceptionHandler implements Thread.UncaughtExceptionHandler { 32 32 33 33 public void uncaughtException(Thread t, Throwable e) { … … 38 38 return; 39 39 } 40 40 41 41 if (e instanceof PluginException) { 42 42 PluginProxy plugin = ((PluginException)e).getPlugin(); 43 43 if (plugin != null && !plugin.misbehaving) { 44 JOptionPane.showMessageDialog(Main.parent, tr("The plugin {0} throwed an exception: {1}\nIt may be outdated. Please contact the plugin's autor.\nThis message will not shown again until JOSM is restarted.", plugin. name, e.getMessage()));44 JOptionPane.showMessageDialog(Main.parent, tr("The plugin {0} throwed an exception: {1}\nIt may be outdated. Please contact the plugin's autor.\nThis message will not shown again until JOSM is restarted.", plugin.info.name, e.getMessage())); 45 45 plugin.misbehaving = true; 46 46 return; 47 47 } 48 48 } 49 49 50 50 Object[] options = new String[]{tr("Do nothing"), tr("Report Bug")}; 51 51 int answer = JOptionPane.showOptionDialog(Main.parent, tr("An unexpected exception occoured.\n\n" +
Note:
See TracChangeset
for help on using the changeset viewer.