Changeset 25127 in osm for applications/editors/josm
- Timestamp:
- 2011-01-24T09:07:41+01:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust
- Files:
-
- 1 deleted
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/MapdustLayer.java
r24514 r25127 60 60 /** 61 61 * Defines the MapDust JOSM layer main functionality. 62 * 62 * 63 63 * @author Bea 64 64 */ 65 65 public class MapdustLayer extends Layer { 66 66 67 67 /** The <code>MapdustGUI</code> object */ 68 68 private MapdustGUI mapdustGUI; 69 69 70 70 /** The list of <code>MapdustBugList</code> objects */ 71 71 private List<MapdustBug> mapdustBugList; 72 72 73 73 /** The selected <code>MapdustBug</code> object */ 74 74 private MapdustBug bugSelected; 75 75 76 76 /** 77 77 * Builds a <code>MapdustLayer</code> object based on the given parameters. 78 * 78 * 79 79 * @param name The name of the layer 80 80 * @param mapdustGUI The <code>MapdustGUI</code> object … … 88 88 this.bugSelected = null; 89 89 } 90 90 91 91 /** 92 92 * Returns the icon of the MapDust layer. 93 * 93 * 94 94 * @return icon 95 95 */ … … 99 99 return layerIcon; 100 100 } 101 101 102 102 /** 103 103 * Returns the info components of the MapDust layer. 104 * 104 * 105 105 * @return object 106 106 */ … … 110 110 return tr(infoComponent); 111 111 } 112 112 113 113 /** 114 114 * Returns the menu entries of the MapDust layer. 115 * 115 * 116 116 * @return an array of <code>Action</code> objects. 117 117 */ … … 129 129 return menuEntries; 130 130 } 131 131 132 132 /** 133 133 * Returns the text of the tool tip of the MapDust layer. 134 * 134 * 135 135 * @return the tooltip text 136 136 */ … … 140 140 return tr(toolTipText); 141 141 } 142 142 143 143 /** 144 144 * Returns the image icon based on the given status and type. 145 * 145 * 146 146 * @param iconType The type of the bug 147 147 * @param status The status of the bug … … 158 158 return icon; 159 159 } 160 160 161 161 /** 162 162 * Draw the objects to the given map view. Also draws the MapDust bugs to 163 163 * the map, and the tooltip for the selected MapDust bug. 164 * 164 * 165 165 * @param g The <code>Graphics2D</code> object 166 166 * @param mv The <code>MapView</code> object … … 181 181 int width = icon.getIconWidth(); 182 182 int height = icon.getIconHeight(); 183 /* draw the bug icon */ 184 /* 185 * need to do 2 times, because in some areas the bug image is 186 * invisible 187 */ 183 /* need to do drawing 2 times, because in some areas the bug 184 * image is invisible */ 188 185 for (int i = 0; i < 2; i++) { 189 186 g.drawImage(icon.getImage(), p.x - (width / 2), p.y 190 187 - (height / 2), new ImageObserver() { 191 192 188 @Override 193 189 public boolean imageUpdate(Image img, int infoflags, … … 198 194 } 199 195 } 196 200 197 /* draw the selected bug description */ 201 198 /* selected by clicking */ … … 220 217 g.drawImage(icon.getImage(), p.x - (width / 2), p.y 221 218 - (height / 2), new ImageObserver() { 222 223 219 @Override 224 220 public boolean imageUpdate(Image img, int infoflags, int x, … … 246 242 } 247 243 } 248 244 245 /** 246 * No need to implement this. 247 */ 249 248 @Override 250 249 public boolean isMergable(Layer layer) { 251 250 return false; 252 251 } 253 252 253 /** 254 * No need to implement this. 255 */ 254 256 @Override 255 257 public void mergeFrom(Layer layer) {} 256 258 257 259 /** 258 260 * Builds the text of the tooltip containing a short description of the 259 261 * given <code>MapdustBug</code> object. 260 * 262 * 261 263 * @param bug The <code>MapdustBug</code> object 262 264 * @return A string containing the description text … … 277 279 return text; 278 280 } 279 281 282 /** 283 * No need to implement this. 284 */ 280 285 @Override 281 286 public void visitBoundingBox(BoundingXYVisitor arg0) {} 282 287 283 288 /** 284 289 * Returns the <code>MapdustGUI</code> object 285 * 290 * 286 291 * @return the mapdustGUI 287 292 */ … … 289 294 return mapdustGUI; 290 295 } 291 296 292 297 /** 293 298 * Sets the <code>MapdustGUI</code> object 294 * 299 * 295 300 * @param mapdustGUI the mapdustGUI to set 296 301 */ … … 298 303 this.mapdustGUI = mapdustGUI; 299 304 } 300 305 301 306 /** 302 307 * Returns the list of <code>MapdustBug</code> objects 303 * 308 * 304 309 * @return the mapdustBugList 305 310 */ … … 307 312 return mapdustBugList; 308 313 } 309 314 310 315 /** 311 316 * Returns the selected bug 312 * 317 * 313 318 * @return the bugSelected 314 319 */ … … 316 321 return bugSelected; 317 322 } 318 323 319 324 /** 320 325 * Sets the selected bug 321 * 326 * 322 327 * @param bugSelected the bugSelected to set 323 328 */ … … 325 330 this.bugSelected = bugSelected; 326 331 } 327 332 328 333 /** 329 334 * Sets the list of <code>MapdustBug</code> objects 335 * 330 336 * @param mapdustBugList the mapdustBugList to set 331 337 */ -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/MapdustPlugin.java
r24821 r25127 42 42 import org.openstreetmap.josm.gui.MapView; 43 43 import org.openstreetmap.josm.gui.MapView.LayerChangeListener; 44 import org.openstreetmap.josm.gui.NavigatableComponent; 44 45 import org.openstreetmap.josm.gui.NavigatableComponent.ZoomChangeListener; 45 46 import org.openstreetmap.josm.gui.layer.Layer; … … 60 61 61 62 /** 62 * This is the main class of the MapDust plug in. Defines the MapDust plugin main63 * functionality.63 * This is the main class of the MapDust plug-in. Defines the MapDust plug-in 64 * main functionality. 64 65 * 65 66 * @author Bea … … 69 70 ZoomChangeListener, MouseListener, MapdustRefreshObserver, 70 71 MapdustBugObserver, MapdustInitialUpdateObserver { 71 72 /** The graphical user interface of the plug in */72 73 /** The graphical user interface of the plug-in */ 73 74 private MapdustGUI mapdustGUI; 74 75 /** The layer of the MapDust plug in */75 76 /** The layer of the MapDust plug-in */ 76 77 private MapdustLayer mapdustLayer; 77 78 78 79 /** The list of <code>MapdustBug</code> objects */ 79 80 private List<MapdustBug> mapdustBugList; 80 81 /** Flag indicating if the list of bugs was empty or not */ 82 private boolean wasEmpty; 83 81 82 /** The <code>CreateIssueDialog</code> object */ 83 private CreateIssueDialog dialog; 84 85 /** Specifies if there was or not an error downloading the data */ 86 private boolean wasError = false; 87 84 88 /** 85 89 * Builds a new <code>MapDustPlugin</code> object based on the given 86 90 * arguments. 87 * 91 * 88 92 * @param info The <code>MapDustPlugin</code> object 89 93 */ 90 94 public MapdustPlugin(PluginInformation info) { 91 95 super(info); 92 Main.pref.put("mapdust.pluginState", 93 MapdustPluginState.ONLINE.getValue()); 96 initializePlugin(); 97 } 98 99 /** 100 * Initialize the <code>MapdustPlugin</code> object. Creates the 101 * <code>MapdustGUI</code> and initializes the following variables with 102 * default values: 'mapdust.pluginState', 'mapdust.nickname', 103 * 'mapdust.showError'. 104 */ 105 private void initializePlugin() { 106 /* create MapDust GUI */ 107 Shortcut shortcut = Shortcut.registerShortcut("mapdust", 108 tr("Toggle: {0}", tr("Open MapDust")), KeyEvent.VK_0, 109 Shortcut.GROUP_MENU, Shortcut.SHIFT_DEFAULT); 110 String name = "MapDust bug reports"; 111 String tooltip = "Activates the MapDust bug reporter plugin"; 112 mapdustGUI = new MapdustGUI(tr(name), "mapdust_icon.png", tr(tooltip), 113 shortcut, 150, this); 114 /* add default values for static variables */ 115 Main.pref.put("mapdust.pluginState", MapdustPluginState.ONLINE.getValue()); 94 116 Main.pref.put("mapdust.nickname", null); 95 Main.pref.put("mapdust.modify", false); 96 } 97 98 /** 99 * Initializes the new view with the MapDust Bugs from that area. 100 * 117 Main.pref.put("mapdust.showError", true); 118 } 119 120 /** 121 * Initializes the new <code>MapFrame</code>. Adds the 122 * <code>MapdustGUI</code> to the new <code>MapFrame</code> and sets the 123 * observers/listeners. 124 * 101 125 * @param oldMapFrame The old <code>MapFrame</code> object 102 126 * @param newMapFrame The new <code>MapFrame</code> object … … 107 131 /* if new MapFrame is null, remove listener */ 108 132 MapView.removeLayerChangeListener(this); 133 NavigatableComponent.removeZoomChangeListener(this); 109 134 } else { 110 135 /* add MapDust dialog window */ 111 Shortcut shortcut = Shortcut.registerShortcut("mapdust", 112 tr("Toggle: {0}", tr("Open MapDust")), KeyEvent.VK_0, 113 Shortcut.GROUP_MENU, Shortcut.SHIFT_DEFAULT); 114 String name = "MapDust bug reports"; 115 String tooltip = "Activates the MapDust bug reporter plugin"; 116 mapdustGUI = new MapdustGUI(tr(name), "mapdust_icon.png", tr(tooltip), 117 shortcut, 150, this); 118 mapdustGUI.setBounds(newMapFrame.getBounds()); 119 mapdustGUI.addObserver(this); 120 newMapFrame.addToggleDialog(mapdustGUI); 121 MapView.addZoomChangeListener(this); 122 MapView.addLayerChangeListener(this); 123 Main.map.mapView.addMouseListener(this); 124 } 125 } 126 127 /** 128 * Updates the MapDust plugin data. Downloads the list of 129 * <code>MapdustBug</code> objects for the given area, and updates the map 130 * and the Mapdust layer with the new data. 131 */ 132 @Override 133 public synchronized void updateData() { 134 if (Main.map != null && Main.map.mapView != null) { 135 try { 136 /* downloads the MapDust bugs */ 137 this.mapdustBugList = getMapdustBugs(); 138 if (getMapdustGUI().isDialogShowing()) { 139 /* updates the views */ 140 if ((this.mapdustBugList == null || this.mapdustBugList 141 .size() == 0) && !wasEmpty) { 142 updateView(); 143 String waringMessage = "There is no MapDust bug in "; 144 waringMessage += "your visible area."; 145 JOptionPane.showMessageDialog(Main.parent, 146 tr(waringMessage), tr("Warning"), 147 JOptionPane.WARNING_MESSAGE); 148 wasEmpty = true; 149 } else { 150 updateView(); 151 wasEmpty = false; 152 } 153 } 154 } catch (MapdustServiceHandlerException e) { 155 /* show errprMessage, and remove the layer */ 156 String errorMessage = "There was a Mapdust service error."; 157 errorMessage += " Please try later."; 158 JOptionPane.showMessageDialog(Main.parent, tr(errorMessage), 159 tr("Error"), JOptionPane.ERROR_MESSAGE); 160 MapView.removeLayerChangeListener(this); 161 Main.map.mapView.removeLayer(mapdustLayer); 162 Main.map.remove(mapdustGUI); 163 } 164 } 165 } 166 136 if (Main.map != null && Main.map.mapView != null) { 137 /* set bounds for MapdustGUI */ 138 mapdustGUI.setBounds(newMapFrame.getBounds()); 139 /* add observer */ 140 mapdustGUI.addObserver(this); 141 /* add dialog to new MapFrame */ 142 newMapFrame.addToggleDialog(mapdustGUI); 143 /* add ZoomChangeListener */ 144 NavigatableComponent.addZoomChangeListener(this); 145 /* add LayerChangeListener */ 146 MapView.addLayerChangeListener(this); 147 /* add MouseListener */ 148 Main.map.mapView.addMouseListener(this); 149 } 150 } 151 } 152 153 /** 154 * Refreshes the MapDust data. Downloads the data from the given area and 155 * updates the map and the MapDust list with this new data. This method is 156 * called whenever the 'Refresh' button is pressed by the user. 157 */ 158 @Override 159 public void refreshData() { 160 if (containsOsmDataLayer() && mapdustGUI.isShowing()) { 161 updatePluginData(); 162 } 163 } 164 165 /** 166 * Downloads the MapDust bugs from the current map view, and updates the 167 * plugin data with the new downloaded data. This method is called only 168 * once, before first showing the MapDust bugs. 169 */ 170 @Override 171 public void initialUpdate() { 172 if (containsOsmDataLayer()) { 173 updatePluginData(); 174 } 175 } 176 167 177 /** 168 178 * Updates the given <code>MapdustBug</code> object from the map and from 169 179 * the MapDust bugs list. 170 * 180 * 171 181 * @param mapdustBug The <code>MapdustBug</code> object 172 182 */ 173 183 @Override 174 184 public synchronized void changedData(MapdustBug mapdustBug) { 175 if ( this.mapdustBugList == null) {176 this.mapdustBugList = new ArrayList<MapdustBug>();185 if (mapdustBugList == null) { 186 mapdustBugList = new ArrayList<MapdustBug>(); 177 187 } 178 188 if (getMapdustGUI().isDialogShowing()) { … … 197 207 } 198 208 } 199 209 210 /** 211 * If the zoom was changed, download the bugs from the current map view. 212 * This method is called whenever the zoom was changed. 213 */ 214 @Override 215 public void zoomChanged() { 216 if (containsOsmDataLayer() && this.mapdustGUI.isShowing() && !wasError) { 217 updatePluginData(); 218 } 219 } 220 221 /** 222 * No need to implement this. 223 */ 200 224 @Override 201 225 public void activeLayerChange(Layer arg0, Layer arg1) {} 202 226 227 /** 228 * Adds the <code>MapdustLayer</code> to the JOSM editor. If the list of 229 * <code>MapdustBug</code>s is null then downloads the data from the MapDust 230 * Service and updates the editor with this new data. 231 * 232 * @param layer The <code>Layer</code> which will be added to the JOSM 233 * editor 234 */ 203 235 @Override 204 236 public void layerAdded(Layer layer) { 205 237 if (layer instanceof MapdustLayer) { 206 238 /* download the MapDust bugs and update the plugin */ 207 updateData(); 208 } 209 } 210 239 if (mapdustBugList == null) { 240 updateMapdustData(); 241 } 242 } 243 } 244 245 /** 246 * Removes the <code>MapdustLayer</code> from the JOSM editor. Also closes 247 * the MapDust plugin window. 248 * 249 * @param layer The <code>Layer</code> which will be removed from the JOSM 250 * editor 251 */ 211 252 @Override 212 253 public void layerRemoved(Layer layer) { … … 214 255 /* remove the layer */ 215 256 MapView.removeLayerChangeListener(this); 216 MapView.removeZoomChangeListener(this);257 NavigatableComponent.removeZoomChangeListener(this); 217 258 Main.map.mapView.removeLayer(layer); 218 259 Main.map.remove(mapdustGUI); 219 260 if (mapdustGUI != null) { 220 mapdustGUI.update(null, this); 261 mapdustGUI.update(new ArrayList<MapdustBug>(), this); 262 mapdustGUI.setVisible(false); 221 263 } 222 264 mapdustLayer = null; 223 wasEmpty = false; 224 } 225 } 226 265 } 266 } 267 268 /** 269 * No need to implement this. 270 */ 271 @Override 272 public void mouseEntered(MouseEvent event) {} 273 274 /** 275 * No need to implement this. 276 */ 277 @Override 278 public void mouseExited(MouseEvent arg0) {} 279 280 /** 281 * No need to implement this. 282 */ 283 @Override 284 public void mousePressed(MouseEvent event) {} 285 286 /** 287 * No need to implement this. 288 */ 289 @Override 290 public void mouseReleased(MouseEvent arg0) {} 291 292 /** 293 * At mouse click the following two actions can be done: adding a new bug, 294 * and selecting a bug from the map. A bug can be added if the plugin is the 295 * only active plugin and you double click on the map. You can select a bug 296 * from the map by clicking on it. 297 * 298 * @event The <code>MouseEvent</code> object 299 */ 227 300 @Override 228 301 public void mouseClicked(MouseEvent event) { 229 if (mapdustLayer != null && mapdustLayer.isVisible() 230 && Main.map.mapView.getActiveLayer() == getMapdustLayer()) { 231 /* show add bug dialog */ 232 if (event.getButton() == MouseEvent.BUTTON3 233 && event.getClickCount() == 2) { 234 String mapdustAddBug = Main.pref.get("mapdust.addBug"); 235 boolean addBug = Boolean.parseBoolean(mapdustAddBug); 236 if (!addBug) { 237 mapdustGUI.getPanel().getBtnPanel().getBtnWorkOffline() 238 .setEnabled(false); 239 mapdustGUI.getPanel().getBtnPanel().getBtnRefresh() 240 .setEnabled(false); 241 mapdustGUI.getPanel().getBtnPanel().getBtnAddComment() 242 .setEnabled(false); 243 mapdustGUI.getPanel().getBtnPanel().getBtnFixBugReport() 244 .setEnabled(false); 245 mapdustGUI.getPanel().getBtnPanel() 246 .getBtnInvalidateBugReport().setEnabled(false); 247 mapdustGUI.getPanel().getBtnPanel().getBtnReOpenBugReport() 248 .setEnabled(false); 249 Main.pref.put("mapdust.modify", true); 250 MapdustBug selectedBug = 251 mapdustGUI.getPanel().getSelectedBug(); 252 if (selectedBug != null) { 253 Main.pref.put("selectedBug.status", selectedBug 254 .getStatus().getValue()); 255 } else { 256 Main.pref.put("selectedBug.status", "create"); 302 if (mapdustLayer != null && mapdustLayer.isVisible()) { 303 if (event.getButton() == MouseEvent.BUTTON1) { 304 if (event.getClickCount() == 2 && !event.isConsumed()) { 305 if (Main.map.mapView.getActiveLayer() == getMapdustLayer()) { 306 /* show add bug dialog */ 307 MapdustBug bug = mapdustGUI.getPanel().getSelectedBug(); 308 if (bug != null) { 309 Main.pref.put("selectedBug.status", bug.getStatus() 310 .getValue()); 311 } else { 312 Main.pref.put("selectedBug.status", "create"); 313 } 314 /* disable MapdustButtonPanel */ 315 mapdustGUI.disableBtnPanel(); 316 /* create and show dialog */ 317 dialog = new CreateIssueDialog(event.getPoint(), this); 318 dialog.showDialog(); 319 event.consume(); 320 return; 257 321 } 258 String title = "Create bug report";259 String iconName = "dialogs/open.png";260 String messageText =261 "In order to create a new bug report you";262 messageText += " need to provide your nickname and a brief";263 messageText += " description for the bug.";264 Point point = event.getPoint();265 CreateIssueDialog dialog =266 new CreateIssueDialog(tr(title), iconName,267 tr(messageText), point, this);268 dialog.setLocationRelativeTo(null);269 dialog.getContentPane().setPreferredSize(dialog.getSize());270 dialog.pack();271 dialog.setVisible(true);272 } else {273 Main.pref.put("mapdust.addBug", false);274 322 } 275 } 276 if (event.getButton() == MouseEvent.BUTTON1) { 277 /* allow click on the bug icon on the map */ 278 Point p = event.getPoint(); 279 MapdustBug nearestBug = getNearestBug(p); 280 if (nearestBug != null) { 281 mapdustLayer.setBugSelected(nearestBug); 282 /* set also in the list of bugs the element */ 283 mapdustGUI.getPanel().setSelectedBug(nearestBug); 284 Main.map.mapView.repaint(); 323 if (event.getClickCount() == 1 && !event.isConsumed()) { 324 /* allow click on the bug icon on the map */ 325 Point p = event.getPoint(); 326 MapdustBug nearestBug = getNearestBug(p); 327 if (nearestBug != null) { 328 mapdustLayer.setBugSelected(nearestBug); 329 /* set also in the list of bugs the element */ 330 mapdustGUI.getPanel().setSelectedBug(nearestBug); 331 Main.map.mapView.repaint(); 332 } 333 return; 285 334 } 286 335 } 287 336 } 288 337 } 289 290 /** 291 * Updates the current view, with the given list of <code>MapdustBug</code> 292 * objects. 338 339 340 /** 341 * Updates the <code>MapdustPlugin</code> data. Downloads the 342 * <code>MapdustBug</code> objects from the current view, and updates the 343 * <code>MapdustGUI</code> and the map with the new data. 344 */ 345 private void updatePluginData() { 346 Main.worker.execute(new Runnable() { 347 @Override 348 public void run() { 349 updateMapdustData(); 350 } 351 }); 352 } 353 354 /** 355 * Returns the bounds of the current <code>MapView</code>. 356 * 357 * @return bounds 358 */ 359 private Bounds getBounds() { 360 MapView mapView = Main.map.mapView; 361 Bounds bounds = new Bounds(mapView.getLatLon(0, mapView.getHeight()), 362 mapView.getLatLon(mapView.getWidth(), 0)); 363 return bounds; 364 } 365 366 /** 367 * Updates the MapDust plugin data. Downloads the list of 368 * <code>MapdustBug</code> objects for the given area, and updates the map 369 * and the MapDust layer with the new data. 370 */ 371 private synchronized void updateMapdustData() { 372 if (Main.map != null && Main.map.mapView != null) { 373 /* download the MapDust data */ 374 try { 375 Bounds bounds = getBounds(); 376 MapdustServiceHandler handler = new MapdustServiceHandler(); 377 mapdustBugList = handler.getBugs(bounds.getMin().lon(), 378 bounds.getMin().lat(), bounds.getMax().lon(), 379 bounds.getMax().lat()); 380 wasError = false; 381 } catch (MapdustServiceHandlerException e) { 382 wasError = true; 383 mapdustBugList = new ArrayList<MapdustBug>(); 384 updateView(); 385 handleError(); 386 } 387 /* update the view */ 388 if (!wasError) { 389 updateView(); 390 } 391 } 392 } 393 394 /** 395 * Updates the current view ( map and MapDust bug list), with the given list 396 * of <code>MapdustBug</code> objects. 293 397 */ 294 398 private void updateView() { 295 399 /* update the dialog with the new data */ 296 400 mapdustGUI.update(mapdustBugList, this); 401 mapdustGUI.setVisible(true); 297 402 mapdustGUI.revalidate(); 403 /* update the MapdustLayer */ 298 404 if (mapdustLayer == null) { 299 405 /* create and add the layer */ 300 mapdustLayer = 301 new MapdustLayer("MapDust", mapdustGUI, mapdustBugList); 302 Main.main.addLayer(mapdustLayer); 303 Main.map.mapView.moveLayer(mapdustLayer, 0); 304 ; 406 mapdustLayer = new MapdustLayer("MapDust", mapdustGUI, mapdustBugList); 407 Main.main.addLayer(this.mapdustLayer); 408 Main.map.mapView.moveLayer(this.mapdustLayer, 0); 305 409 Main.map.mapView.addMouseListener(this); 306 410 MapView.addLayerChangeListener(this); 307 MapView.addZoomChangeListener(this);411 NavigatableComponent.addZoomChangeListener(this); 308 412 } else { 309 413 /* re-set the properties */ … … 317 421 Main.map.repaint(); 318 422 } 319 320 /** 321 * Downloads the MapDust bugs from the current map view, and updates the 322 * plugin data with the new downloaded data. 323 */ 324 @Override 325 public void initialUpdate() { 326 if (containsOsmDataLayer()) { 327 updateData(); 328 } 329 } 330 331 /** 332 * If the zoom was changed, download the bugs from the current map view. 333 */ 334 @Override 335 public void zoomChanged() { 336 updateData(); 337 } 338 339 /** 340 * Verifies if the <code>OsmDataLayer</code> layer has been added to the 341 * list of layers. 342 * 343 * @return true if the <code>OsmDataLayer</code> layer has been added false 344 * otherwise 345 */ 346 private boolean containsOsmDataLayer() { 347 boolean contains = false; 348 List<Layer> l = Main.map.mapView.getAllLayersAsList(); 349 for (Layer ll : l) { 350 if (ll instanceof OsmDataLayer) { 351 contains = true; 352 } 353 } 354 return contains; 355 } 356 423 357 424 /** 358 425 * Updates the MapDust bugs list with the given <code>MapdustBug</code> 359 426 * object. 360 * 427 * 361 428 * @param mapdustBug The <code>MapdustBug</code> object 362 429 */ 363 430 private void updateMapdustBugList(MapdustBug mapdustBug) { 364 431 MapdustBug oldBug = null; 365 for (MapdustBug bug : mapdustBugList) {432 for (MapdustBug bug : this.mapdustBugList) { 366 433 if (bug.getId().equals(mapdustBug.getId())) { 367 434 oldBug = bug; … … 370 437 if (oldBug != null) { 371 438 /* remove, add */ 372 mapdustBugList.remove(oldBug);373 mapdustBugList.add(0, mapdustBug);439 this.mapdustBugList.remove(oldBug); 440 this.mapdustBugList.add(0, mapdustBug); 374 441 } else { 375 442 /* new add */ 376 mapdustBugList.add(0, mapdustBug); 377 } 378 } 379 380 /** 381 * Returns the list of <code>MapdustBug</code> objects from the current 382 * area. 383 * 384 * @return A list of <code>MapdustBug</code> objects 385 * @throws MapdustServiceHandlerException In the case of a MapDust service 386 * error 387 */ 388 private List<MapdustBug> getMapdustBugs() 389 throws MapdustServiceHandlerException { 390 /* get the bounding box */ 391 MapView mapView = Main.map.mapView; 392 Bounds bounds = 393 new Bounds(mapView.getLatLon(0, mapView.getHeight()), 394 mapView.getLatLon(mapView.getWidth(), 0)); 395 Double minLon = bounds.getMin().lon(); 396 Double minLat = bounds.getMin().lat(); 397 Double maxLon = bounds.getMax().lon(); 398 Double maxLat = bounds.getMax().lat(); 399 400 /* get the bugs from the bounding box */ 401 MapdustServiceHandler handler = new MapdustServiceHandler(); 402 List<MapdustBug> list = handler.getBugs(minLon, minLat, maxLon, maxLat); 403 return list; 404 } 405 443 this.mapdustBugList.add(0, mapdustBug); 444 } 445 } 446 406 447 /** 407 448 * Returns the nearest <code>MapdustBug</code> object to the given point on 408 449 * the map. 409 * 450 * 410 451 * @param p A <code>Point</code> object 411 452 * @return A <code>MapdustBug</code> object … … 427 468 return nearestBug; 428 469 } 429 430 @Override 431 public void mouseEntered(MouseEvent event) { 432 433 } 434 435 @Override 436 public void mouseExited(MouseEvent arg0) {} 437 438 @Override 439 public void mousePressed(MouseEvent event) { 440 441 } 442 443 @Override 444 public void mouseReleased(MouseEvent arg0) {} 445 470 471 /** 472 * Verifies if the <code>OsmDataLayer</code> layer has been added to the 473 * list of layers. 474 * 475 * @return true if the <code>OsmDataLayer</code> layer has been added false 476 * otherwise 477 */ 478 private boolean containsOsmDataLayer() { 479 boolean contains = false; 480 List<Layer> l = Main.map.mapView.getAllLayersAsList(); 481 for (Layer ll : l) { 482 if (ll instanceof OsmDataLayer) { 483 contains = true; 484 } 485 } 486 return contains; 487 } 488 489 /** 490 * Handles the <code>MapdustServiceHandlerException</code> error. 491 * 492 */ 493 private void handleError() { 494 String showMessage = Main.pref.get("mapdust.showError"); 495 Boolean showErrorMessage = Boolean.parseBoolean(showMessage); 496 if (showErrorMessage) { 497 /* show errprMessage, and remove the layer */ 498 Main.pref.put("mapdust.showError", false); 499 String errorMessage = "There was a Mapdust service error."; 500 errorMessage += " Please try later."; 501 JOptionPane.showMessageDialog(Main.parent, tr(errorMessage)); 502 } 503 } 504 446 505 /** 447 506 * Returns the <code>MapdustGUI</code> object 448 * 507 * 449 508 * @return the mapdustGUI 450 509 */ … … 452 511 return mapdustGUI; 453 512 } 454 513 455 514 /** 456 515 * Sets the <code>MapdustGUI</code> object. 457 * 516 * 458 517 * @param mapdustGUI the mapdustGUI to set 459 518 */ … … 461 520 this.mapdustGUI = mapdustGUI; 462 521 } 463 522 464 523 /** 465 524 * Returns the <code>MapdustLayer</code> object. 466 * 525 * 467 526 * @return the mapdustLayer 468 527 */ … … 470 529 return mapdustLayer; 471 530 } 472 531 473 532 /** 474 533 * Sets the <code>MapdustLayer</code> object. 475 * 534 * 476 535 * @param mapdustLayer the mapdustLayer to set 477 536 */ … … 479 538 this.mapdustLayer = mapdustLayer; 480 539 } 481 540 482 541 /** 483 542 * Returns the list of <code>MapdustBug</code> objects 484 * 543 * 485 544 * @return the mapdustBugList 486 545 */ … … 488 547 return mapdustBugList; 489 548 } 490 549 491 550 /** 492 551 * Sets the list of <code>MapdustBug</code> objects 493 * 552 * 494 553 * @param mapdustBugList the mapdustBugList to set 495 554 */ … … 497 556 this.mapdustBugList = mapdustBugList; 498 557 } 499 558 500 559 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/MapdustGUI.java
r24821 r25127 33 33 import java.util.ArrayList; 34 34 import java.util.Iterator; 35 import java.util.LinkedList;36 35 import java.util.List; 37 36 import javax.swing.JPanel; … … 87 86 88 87 /** The <code>MapdustBugPropertiesPanel</code> */ 89 private finalMapdustBugPropertiesPanel detailsPanel;88 private MapdustBugPropertiesPanel detailsPanel; 90 89 91 90 /** The <code>JPanel</code> */ 92 91 private JPanel mainPanel; 93 92 94 /** 95 * Flag indicating if the MapDust data was downloaded and the view was 96 * updated 97 */ 98 private boolean initialUpdate = false; 93 /** Specifies if the MapDust data was or not downloaded */ 94 private boolean downloaded = false; 99 95 100 96 /** … … 112 108 super(tr(name), iconName, tr(tooltip), shortcut, preferredHeight); 113 109 this.mapdustPlugin = mapdustPlugin; 114 panel = new MapdustPanel(mapdustPlugin.getMapdustBugList(),115 "Bug reports", mapdustPlugin);116 MapdustBug bug = null;117 if (mapdustPlugin.getMapdustBugList() != null118 && mapdustPlugin.getMapdustBugList().size() > 0) {119 bug = mapdustPlugin.getMapdustBugList().get(0);120 }121 detailsPanel = new MapdustBugPropertiesPanel(bug);122 panel.addObserver(detailsPanel);123 addObserver(detailsPanel);124 String pluginState = Main.pref.get("mapdust.pluginState");125 if (pluginState.equals(MapdustPluginState.OFFLINE.getValue())) {126 /* offline mode, need to add also queue panel */127 tabbedPane = new JTabbedPane();128 List<MapdustAction> list = new LinkedList<MapdustAction>();129 mainPanel = new JPanel();130 mainPanel.setAutoscrolls(true);131 mainPanel.setLayout(new BorderLayout(5, 10));132 mainPanel.add(detailsPanel, BorderLayout.NORTH);133 mainPanel.add(panel, BorderLayout.CENTER);134 queuePanel = new MapdustActionPanel(list, "Work offline", mapdustPlugin);135 tabbedPane.add(mainPanel, 0);136 tabbedPane.add(queuePanel);137 add(tabbedPane, BorderLayout.CENTER);138 } else {139 /* online mode */140 mainPanel = new JPanel();141 mainPanel.setIgnoreRepaint(true);142 mainPanel.setAutoscrolls(true);143 mainPanel.setLayout(new BorderLayout(5, 10));144 mainPanel.add(detailsPanel, BorderLayout.NORTH);145 mainPanel.add(panel, BorderLayout.CENTER);146 add(mainPanel, BorderLayout.CENTER);147 tabbedPane = null;148 queuePanel = null;149 }150 110 } 151 111 … … 165 125 if (tabbedPane != null) { 166 126 /* offline to online */ 167 tabbedPane.remove(panel);168 tabbedPane.remove(queuePanel);169 mainPanel.remove(tabbedPane);170 127 remove(mainPanel); 171 128 queuePanel = null; 172 129 } else { 173 130 /* online to online */ 174 mainPanel.remove(detailsPanel);175 mainPanel.remove(panel);176 remove(mainPanel);131 if (mainPanel != null) { 132 remove(mainPanel); 133 } 177 134 } 178 135 /* add panels with updated data */ 179 136 panel = new MapdustPanel(mapdustBugs, "Bug reports", mapdustPlugin); 180 MapdustBug selectedBug = 181 (mapdustBugs != null && mapdustBugs.size() > 0) ? mapdustBugs 182 .get(0) : null; 137 MapdustBug selectedBug = (mapdustBugs != null && mapdustBugs.size() 138 > 0) ? mapdustBugs.get(0) : null; 139 if (detailsPanel == null) { 140 detailsPanel = new MapdustBugPropertiesPanel(selectedBug); 141 panel.addObserver(detailsPanel); 142 addObserver(detailsPanel); 143 } 183 144 notifyObservers(selectedBug); 184 145 panel.addObserver(detailsPanel); … … 196 157 if (queuePanel == null) { 197 158 /* from online to offline */ 198 mainPanel.remove(detailsPanel);199 mainPanel.remove(panel);200 159 remove(mainPanel); 201 160 } else { 202 161 list = queuePanel.getActionList(); 203 mainPanel.remove(detailsPanel);204 tabbedPane.remove(panel);205 tabbedPane.remove(queuePanel);206 mainPanel.remove(tabbedPane);207 162 remove(mainPanel); 208 163 } … … 213 168 panel = new MapdustPanel(mapdustBugs, "Bug reports (offline)", 214 169 mapdustPlugin); 170 MapdustBug selectedBug = (mapdustBugs != null && mapdustBugs.size() 171 > 0) ? mapdustBugs.get(0) : null; 172 if (detailsPanel == null) { 173 detailsPanel = new MapdustBugPropertiesPanel(selectedBug); 174 panel.addObserver(detailsPanel); 175 addObserver(detailsPanel); 176 } 177 notifyObservers(selectedBug); 178 panel.addObserver(detailsPanel); 215 179 mainPanel = new JPanel(); 216 180 mainPanel.setAutoscrolls(true); 217 181 mainPanel.setLayout(new BorderLayout()); 218 if (mapdustBugs != null && mapdustBugs.size() > 0) {182 if (mapdustBugs != null) { 219 183 mainPanel.add(detailsPanel, BorderLayout.NORTH); 220 184 } … … 239 203 240 204 /* remove panels */ 241 mainPanel.remove(detailsPanel); 242 tabbedPane.remove(panel); 243 tabbedPane.remove(queuePanel); 244 mainPanel.remove(tabbedPane); 245 remove(mainPanel); 205 if (mainPanel != null) { 206 remove(mainPanel); 207 } 246 208 /* create new tabbed pane */ 247 209 tabbedPane = new JTabbedPane(); … … 263 225 264 226 /** 265 * Shows the MapDust main dialog. In the case if the plugin was not updated 266 * with the new MapDust data, or the data was not downloaded; it will also 267 * download the MapDust data from the current view, and update the plugin 268 * with the new data. 269 * 270 */ 271 @Override 272 public void showDialog() { 273 super.showDialog(); 274 /* was not updated */ 275 if (!initialUpdate && isShowing) { 276 notifyObservers(); 277 initialUpdate = true; 278 } 279 } 227 * Disables the buttons from the <code>MapdustButtonPanel</code> buttons. 228 * 229 */ 230 public void disableBtnPanel() { 231 panel.getBtnPanel().getBtnWorkOffline().setEnabled(false); 232 panel.getBtnPanel().getBtnRefresh().setEnabled(false); 233 panel.getBtnPanel().getBtnAddComment().setEnabled(false); 234 panel.getBtnPanel().getBtnFixBugReport().setEnabled(false); 235 panel.getBtnPanel().getBtnInvalidateBugReport().setEnabled(false); 236 panel.getBtnPanel().getBtnReOpenBugReport().setEnabled(false); 237 } 238 280 239 281 240 /** … … 307 266 308 267 /** 268 * Displays the <code>MapdustGUI</code> dialog window in the JOSM editor. If 269 * the MapDust data was not downloaded yet, it will donwload the data and 270 * also update the MapDust plugin with the data. If the MapDust data was 271 * already downloaded, then the <code>MapdustGUI</code> will be displayed. 272 */ 273 @Override 274 public void showDialog() { 275 if (!downloaded) { 276 notifyObservers(); 277 downloaded = true; 278 } 279 super.showDialog(); 280 } 281 282 /** 309 283 * Adds a new MapDust bug details observer to the list of observers. 310 284 * -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/adapter/WindowClose.java
r24821 r25127 41 41 /** 42 42 * Closes the given dialog window. 43 * 43 * 44 44 * @author Bea 45 45 * @version $Revision$ 46 46 */ 47 47 public class WindowClose extends WindowAdapter { 48 48 49 49 /** Serial version UID */ 50 50 private static final long serialVersionUID = 1L; 51 51 52 52 /** A <code>AbstractDialog</code> object */ 53 53 private AbstractDialog dialog; 54 54 55 55 /** The <code>MapdustButtonPanel</code> object */ 56 56 private MapdustButtonPanel btnPanel; 57 57 58 58 /** The <code>JToggleButton</code> which had fired the dialog */ 59 59 private JToggleButton btnFired; 60 60 61 61 /** 62 62 * Builds a <code>WindowClose</code> object 63 63 */ 64 64 public WindowClose() {} 65 65 66 66 /** 67 67 * Builds a <code>WindowClose</code> object based on the given arguments 68 * 68 * 69 69 * @param dialog The dialog which will be closed 70 70 * @param btnPanel The button panel … … 77 77 this.btnFired = btnFired; 78 78 } 79 79 80 80 @Override 81 81 public void windowClosing(WindowEvent event) { … … 128 128 } 129 129 /* dispose dialog */ 130 Main.pref.put("mapdust.addBug", true);131 Main.pref.put("mapdust.modify", false);132 130 dialog.setVisible(false); 133 131 dialog.dispose(); 134 return;135 132 } 133 136 134 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteActionList.java
r24514 r25127 71 71 } 72 72 73 /** 74 * Uploads the content of the action list to the MapDust service. 75 * 76 * @param event The event which fires this action 77 */ 73 78 @Override 74 79 public void actionPerformed(ActionEvent event) { 75 80 if (event.getSource() instanceof JToggleButton) { 76 // upload actions77 81 try { 78 82 MapdustActionUploader.getInstance().uploadData( … … 84 88 tr("Error"), JOptionPane.ERROR_MESSAGE); 85 89 } 86 Main.pref.put("mapdust.pluginState", 87 MapdustPluginState.ONLINE.getValue()); 88 getMapdustGUI().getPanel().getBtnPanel().getBtnRefresh() 89 .setEnabled(true); 90 Main.pref.put("mapdust.pluginState", MapdustPluginState.ONLINE.getValue()); 91 getMapdustGUI().getPanel().getBtnPanel().getBtnRefresh().setEnabled(true); 90 92 notifyObservers(); 91 93 } … … 121 123 Iterator<MapdustRefreshObserver> elements = this.observers.iterator(); 122 124 while (elements.hasNext()) { 123 (elements.next()). updateData();125 (elements.next()).refreshData(); 124 126 } 125 127 } 128 126 129 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteAddBug.java
r24514 r25127 82 82 public ExecuteAddBug() {} 83 83 84 /** *84 /** 85 85 * Builds a <code>ExecuteAddBug</code> object based on the given arguments. 86 86 * … … 93 93 } 94 94 95 /** 96 * Creates a new <code>MapdustBug</code> object if the entered informations 97 * are valid. Otherwise a corresponding warning message will be shown to the 98 * user. 99 * 100 * @param event The action event which fires this action 101 */ 95 102 @Override 96 103 public void actionPerformed(ActionEvent event) { … … 115 122 latlon = Main.map.mapView.getLatLon(p.x, p.y); 116 123 } 117 MapdustBug bug = 118 new MapdustBug(latlon, type, commentText, nickname); 124 MapdustBug bug = new MapdustBug(latlon, type, commentText, nickname); 119 125 String pluginState = Main.pref.get("mapdust.pluginState"); 120 126 if (pluginState.equals(MapdustPluginState.OFFLINE.getValue())) { … … 123 129 bug.setStatus(Status.OPEN); 124 130 String iconPath = getIconPath(bug); 125 MapdustAction mapdustAction = 126 new MapdustAction(MapdustServiceCommand.ADD_BUG, 127 iconPath, bug); 131 MapdustAction mapdustAction = new MapdustAction( 132 MapdustServiceCommand.ADD_BUG, iconPath, bug); 128 133 if (getMapdustGUI().getQueuePanel() != null) { 129 134 notifyObservers(mapdustAction); … … 138 143 } catch (MapdustServiceHandlerException e) { 139 144 errorMessage = "There was a Mapdust service error."; 140 JOptionPane.showMessageDialog(Main.parent, 141 tr(errorMessage), tr("Error"), 142 JOptionPane.ERROR_MESSAGE); 145 JOptionPane.showMessageDialog(Main.parent, tr(errorMessage), 146 tr("Error"), JOptionPane.ERROR_MESSAGE); 143 147 } 144 148 if (id != null) { … … 149 153 } catch (MapdustServiceHandlerException e) { 150 154 errorMessage = "There was a Mapdust service error."; 151 JOptionPane.showMessageDialog(Main.parent, 152 tr(errorMessage), tr("Error"), 153 JOptionPane.ERROR_MESSAGE); 155 JOptionPane.showMessageDialog(Main.parent, tr(errorMessage), 156 tr("Error"), JOptionPane.ERROR_MESSAGE); 154 157 } 155 158 if (newMapdustBug != null) { … … 159 162 resetSelectedBug(0); 160 163 } 161 Main.pref.put("mapdust.modify", false);162 164 /* destroy dialog */ 163 165 getDialog().dispose(); 166 return; 164 167 } 165 168 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteCancel.java
r24821 r25127 65 65 } 66 66 67 67 /** 68 * Cancels the executed action, and closes the visible dialog window. 69 * 70 * @param event The action event which fires this action 71 */ 68 72 @Override 69 73 public void actionPerformed(ActionEvent event) { … … 72 76 String status = Main.pref.get("selectedBug.status"); 73 77 /* enable buttons */ 74 MapdustButtonPanel btnPanel = 75 getMapdustGUI().getPanel().getBtnPanel(); 78 MapdustButtonPanel btnPanel = getMapdustGUI().getPanel().getBtnPanel(); 76 79 if (btnPanel != null) { 77 80 btnPanel.getBtnWorkOffline().setEnabled(true); … … 119 122 } 120 123 121 Main.pref.put("mapdust.addBug", true);122 Main.pref.put("mapdust.modify", false);123 124 /* dispose dialog */ 124 getDialog().setVisible(false);125 125 getDialog().dispose(); 126 126 } 127 127 128 128 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteCloseBug.java
r24514 r25127 55 55 * Fixes the given <code>MapdustBug</code> object. Validates the input data, and 56 56 * based on the plugin state executes the corresponding action. If the plugin is 57 * in the "ONLINE" state then executes the Map dust Service 'changeBugStatus'57 * in the "ONLINE" state then executes the MapDust Service 'changeBugStatus' 58 58 * action with statusId=2 and the given input parameters. If the plugin is in 59 59 * the "OFFLINE" state then adds the given action to the queue list. … … 92 92 } 93 93 94 /** 95 * Closes the given MapDust bug. If the entered informations are invalid a 96 * corresponding warning message will be displayed. 97 * 98 * @param event The action event which fires this action 99 */ 94 100 @Override 95 101 public void actionPerformed(ActionEvent event) { … … 107 113 /* invalid input data */ 108 114 JOptionPane.showMessageDialog(Main.parent, tr(errorMessage), 109 tr("Missing input data"), JOptionPane.WARNING_MESSAGE);115 tr("Missing input data"), JOptionPane.WARNING_MESSAGE); 110 116 return; 111 117 } … … 155 161 enableFiredButton(issueDialog.getFiredButton()); 156 162 resetSelectedBug(0); 157 Main.pref.put("mapdust.modify", false);158 163 /* destroy dialog */ 159 164 issueDialog.dispose(); -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteCommentBug.java
r24514 r25127 91 91 } 92 92 93 /** 94 * Creates a comment for the given MapDust bug. If the entered informations 95 * are invalid a corresponding warning message will be displayed. 96 * 97 * @param event The action event which fires this action 98 */ 93 99 @Override 94 100 public void actionPerformed(ActionEvent event) { … … 154 160 enableFiredButton(issueDialog.getFiredButton()); 155 161 resetSelectedBug(0); 156 Main.pref.put("mapdust.modify", false);157 162 /* destroy dialog */ 158 163 issueDialog.dispose(); … … 228 233 } 229 234 } 235 230 236 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteInvalidateBug.java
r24514 r25127 95 95 } 96 96 97 /** 98 * Invalidates the given MapDust bug. If the entered informations are 99 * invalid a corresponding warning message will be displayed. 100 * 101 * @param event The action event which fires this action 102 */ 97 103 @Override 98 104 public void actionPerformed(ActionEvent event) { … … 101 107 if (btn.getText().equals("OK")) { 102 108 /* ok button was pressed */ 103 ChangeIssueStatusDialog issueDialog = (ChangeIssueStatusDialog) getDialog(); 109 ChangeIssueStatusDialog issueDialog = 110 (ChangeIssueStatusDialog) getDialog(); 104 111 String nickname = issueDialog.getTxtNickname().getText(); 105 112 String commentText = issueDialog.getTxtDescription().getText(); … … 108 115 if (errorMessage != null) { 109 116 /* invalid input */ 110 JOptionPane.showMessageDialog(Main.parent, tr(errorMessage), 117 JOptionPane.showMessageDialog(Main.parent, tr(errorMessage), 111 118 tr("Missing input data"), JOptionPane.WARNING_MESSAGE); 112 119 return; … … 115 122 Main.pref.put("mapdust.nickname", nickname); 116 123 MapdustBug selectedBug = getSelectedBug(); 117 MapdustComment comment = new MapdustComment(selectedBug.getId(), 124 MapdustComment comment = new MapdustComment(selectedBug.getId(), 118 125 commentText, nickname); 119 126 String pluginState = Main.pref.get("mapdust.pluginState"); … … 123 130 String iconPath = getIconPath(selectedBug); 124 131 MapdustAction mapdustAction = new MapdustAction( 125 MapdustServiceCommand.CHANGE_BUG_STATUS, iconPath, 132 MapdustServiceCommand.CHANGE_BUG_STATUS, iconPath, 126 133 selectedBug, comment, 3); 127 134 if (getMapdustGUI().getQueuePanel() != null) { … … 136 143 } catch (MapdustServiceHandlerException e) { 137 144 errorMessage = "There was a Mapdust service error."; 138 JOptionPane.showMessageDialog(Main.parent, tr(errorMessage), 139 tr("Error"), JOptionPane.ERROR_MESSAGE); 145 JOptionPane.showMessageDialog(Main.parent, 146 tr(errorMessage), tr("Error"), 147 JOptionPane.ERROR_MESSAGE); 140 148 } 141 149 if (id != null) { … … 143 151 MapdustBug newMapdustBug = null; 144 152 try { 145 newMapdustBug = handler.getBug(selectedBug.getId(), null); 153 newMapdustBug = handler.getBug(selectedBug.getId(), 154 null); 146 155 } catch (MapdustServiceHandlerException e) { 147 156 errorMessage = "There was a Mapdust service error."; 148 157 errorMessage += "Mapdust bug report."; 149 JOptionPane.showMessageDialog(Main.parent, tr(errorMessage), 150 tr("Error"), JOptionPane.ERROR_MESSAGE); 158 JOptionPane.showMessageDialog(Main.parent, 159 tr(errorMessage), tr("Error"), 160 JOptionPane.ERROR_MESSAGE); 151 161 } 152 162 if (newMapdustBug != null) { … … 158 168 enableFiredButton(issueDialog.getFiredButton()); 159 169 resetSelectedBug(0); 160 Main.pref.put("mapdust.modify", false);161 170 /* destroy dialog */ 162 171 issueDialog.dispose(); -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteReOpenBug.java
r24514 r25127 94 94 } 95 95 96 /** 97 * 98 * @param event The event which fires this action 99 */ 96 100 @Override 97 101 public void actionPerformed(ActionEvent event) { … … 165 169 enableFiredButton(issueDialog.getFiredButton()); 166 170 resetSelectedBug(0); 167 Main.pref.put("mapdust.modify", false);168 171 /* destroy dialog */ 169 172 issueDialog.dispose(); … … 240 243 } 241 244 } 245 242 246 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteRefresh.java
r24514 r25127 34 34 import javax.swing.AbstractAction; 35 35 import javax.swing.JToggleButton; 36 import org.openstreetmap.josm.Main; 36 37 import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustRefreshObservable; 37 38 import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustRefreshObserver; … … 60 61 public ExecuteRefresh() {} 61 62 63 /** 64 * Updates the Mapdust data. 65 * 66 * @param event The event which fires this action 67 */ 62 68 @Override 63 69 public void actionPerformed(ActionEvent event) { … … 65 71 JToggleButton btn = (JToggleButton) event.getSource(); 66 72 /* update the bugs */ 73 Main.pref.put("mapdust.showError", true); 67 74 notifyObservers(); 68 75 btn.setSelected(false); … … 99 106 Iterator<MapdustRefreshObserver> elements = this.observers.iterator(); 100 107 while (elements.hasNext()) { 101 (elements.next()). updateData();108 (elements.next()).refreshData(); 102 109 } 103 110 } 111 104 112 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteWorkOffline.java
r24514 r25127 46 46 /** 47 47 * Executes the work offline action. In the offline mode the user actions will 48 * not be uploaded immediately to the Map dust service. The user can perform the48 * not be uploaded immediately to the MapDust service. The user can perform the 49 49 * following actions in offline mode: add bug, comment bug and change bug 50 * status. After de activating the offline mode the user's modifications will be51 * uploaded to the Map dust service.50 * status. After de-activating the offline mode the user's modifications will be 51 * uploaded to the MapDust service. 52 52 * 53 53 * @author Bea … … 79 79 } 80 80 81 /** 82 * Sets the 'offline' mode for the plugin. 83 * 84 * @param event The event which fires this action 85 */ 81 86 @Override 82 87 public void actionPerformed(ActionEvent event) { … … 94 99 String message = "Do you want to submit your changes "; 95 100 message += "to Mapdust?"; 96 int result = 97 JOptionPane.showConfirmDialog(Main.parent, 98 tr(message), tr(title), 99 JOptionPane.YES_NO_OPTION); 101 int result = JOptionPane.showConfirmDialog(Main.parent, 102 tr(message), tr(title), JOptionPane.YES_NO_OPTION); 100 103 if (result == JOptionPane.YES_OPTION) { 101 104 // process data 102 105 try { 103 106 MapdustActionUploader.getInstance().uploadData( 104 getMapdustGUI().getQueuePanel() 105 .getActionList()); 107 getMapdustGUI().getQueuePanel().getActionList()); 106 108 } catch (MapdustActionUploaderException e) { 107 String errorMessage = 108 "There was a Mapdust service error."; 109 String errorMessage = "There was a Mapdust service error."; 109 110 JOptionPane.showMessageDialog(Main.parent, 110 111 tr(errorMessage), tr("Error"), … … 150 151 Iterator<MapdustRefreshObserver> elements = this.observers.iterator(); 151 152 while (elements.hasNext()) { 152 (elements.next()). updateData();153 (elements.next()).refreshData(); 153 154 } 154 155 } 156 155 157 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/show/MapdustShowAction.java
r24514 r25127 141 141 } 142 142 143 144 143 /** 145 144 * Disables the buttons from the given button panel. -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/show/ShowCloseBugAction.java
r24514 r25127 31 31 import java.awt.event.ActionEvent; 32 32 import javax.swing.JToggleButton; 33 import org.openstreetmap.josm.Main;34 33 import org.openstreetmap.josm.plugins.mapdust.MapdustPlugin; 35 34 import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.ChangeIssueStatusDialog; … … 76 75 } 77 76 disableButtons(getButtonPanel()); 78 Main.pref.put("mapdust.modify", true);79 77 ChangeIssueStatusDialog dialog = new ChangeIssueStatusDialog( 80 78 getTitle(), getIconName(), getMessageText(), "close", btn, -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/show/ShowCommentBugAction.java
r24514 r25127 31 31 import java.awt.event.ActionEvent; 32 32 import javax.swing.JToggleButton; 33 import org.openstreetmap.josm.Main;34 33 import org.openstreetmap.josm.plugins.mapdust.MapdustPlugin; 35 34 import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.CommentIssueDialog; … … 77 76 } 78 77 disableButtons(getButtonPanel()); 79 Main.pref.put("mapdust.modify", true);80 78 CommentIssueDialog dialog = new CommentIssueDialog(getTitle(), 81 79 getIconName(), getMessageText(), btn, getMapdustPlugin()); -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/show/ShowInvalidateBugAction.java
r24514 r25127 31 31 import java.awt.event.ActionEvent; 32 32 import javax.swing.JToggleButton; 33 import org.openstreetmap.josm.Main;34 33 import org.openstreetmap.josm.plugins.mapdust.MapdustPlugin; 35 34 import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.ChangeIssueStatusDialog; … … 77 76 } 78 77 disableButtons(getButtonPanel()); 79 Main.pref.put("mapdust.modify", true);80 78 ChangeIssueStatusDialog dialog = new ChangeIssueStatusDialog( 81 79 getTitle(), getIconName(), getMessageText(), "invalidate", -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/show/ShowReOpenBugAction.java
r24514 r25127 31 31 import java.awt.event.ActionEvent; 32 32 import javax.swing.JToggleButton; 33 import org.openstreetmap.josm.Main;34 33 import org.openstreetmap.josm.plugins.mapdust.MapdustPlugin; 35 34 import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.ChangeIssueStatusDialog; … … 76 75 } 77 76 disableButtons(getButtonPanel()); 78 Main.pref.put("mapdust.modify", true);79 77 ChangeIssueStatusDialog dialog = new ChangeIssueStatusDialog( 80 78 getTitle(), getIconName(), getMessageText(), "reopen", btn, -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/dialog/ChangeIssueStatusDialog.java
r24514 r25127 126 126 setLayout(null); 127 127 addComponents(mapdustPlugin); 128 MapdustButtonPanel btnPanel = 129 mapdustPlugin.getMapdustGUI().getPanel().getBtnPanel(); 128 MapdustButtonPanel btnPanel = mapdustPlugin.getMapdustGUI().getPanel().getBtnPanel(); 130 129 addWindowListener(new WindowClose(this, btnPanel, getFiredButton())); 131 130 } … … 201 200 /* creates the cancel button */ 202 201 if (btnCancel == null) { 203 Rectangle bounds = new Rectangle(2 50, 170, 80, 25);202 Rectangle bounds = new Rectangle(240, 170, 90, 25); 204 203 btnCancel = ComponentUtil.createJButton("Cancel", bounds, cancelAction); 205 204 } 206 205 /* creates the ok button */ 207 206 if (btnOk == null) { 208 Rectangle bounds = new Rectangle(1 80, 170, 60, 25);207 Rectangle bounds = new Rectangle(170, 170, 60, 25); 209 208 btnOk = ComponentUtil.createJButton("OK", bounds, okAction); 210 209 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/dialog/CommentIssueDialog.java
r24514 r25127 166 166 /* creates the cancel button */ 167 167 if (btnCancel == null) { 168 Rectangle bounds = new Rectangle(2 50, 170, 80, 25);168 Rectangle bounds = new Rectangle(240, 170, 90, 25); 169 169 ExecuteCancel cancelAction = new ExecuteCancel(this, 170 170 mapdustPlugin.getMapdustGUI()); … … 174 174 /* creates the ok button */ 175 175 if (btnOk == null) { 176 Rectangle bounds = new Rectangle(1 80, 170, 60, 25);176 Rectangle bounds = new Rectangle(170, 170, 60, 25); 177 177 ExecuteCommentBug okAction = 178 178 new ExecuteCommentBug(this, mapdustPlugin.getMapdustGUI()); … … 272 272 return messageText; 273 273 } 274 274 275 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/dialog/CreateIssueDialog.java
r24514 r25127 66 66 67 67 /** The create issue text */ 68 private finalString createIssueText;68 private String createIssueText; 69 69 70 70 /** Text message */ … … 111 111 * @param mapdustPlugin The <code>MapdustPlugin</code> object 112 112 */ 113 public CreateIssueDialog(String title, String iconName, String messageText, 114 Point point, MapdustPlugin mapdustPlugin) { 115 this.createIssueText = messageText; 113 public CreateIssueDialog(Point point, MapdustPlugin mapdustPlugin) { 114 this.createIssueText= "In order to create a new bug report you"; 115 this.createIssueText += " need to provide your nickname and a brief"; 116 this.createIssueText+= " description for the bug."; 116 117 this.point = point; 117 setTitle(title); 118 setDefaultLookAndFeelDecorated(true); 119 Image image = ImageProvider.get(iconName).getImage(); 118 /* set JDialog settings */ 119 initializeDialog(); 120 /* add components to the dialog */ 121 addComponents(mapdustPlugin); 122 /* add window listenet */ 123 MapdustButtonPanel btnPanel = mapdustPlugin.getMapdustGUI().getPanel().getBtnPanel(); 124 addWindowListener(new WindowClose(this, btnPanel, null)); 125 } 126 127 /** 128 * Initializes the dialog default fields. 129 */ 130 private void initializeDialog(){ 131 /* set JDialog settings */ 132 setTitle("Create bug report"); 133 setModal(true); 134 Image image = ImageProvider.get("dialogs/open.png").getImage(); 120 135 setIconImage(image); 121 setDefaultCloseOperation(WindowConstants. DISPOSE_ON_CLOSE);136 setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE); 122 137 getContentPane().setFont(new Font("Times New Roman", Font.BOLD, 14)); 123 138 setResizable(false); 124 139 setForeground(Color.black); 125 140 setLayout(null); 126 setModal(true); 127 addComponents(mapdustPlugin); 128 MapdustButtonPanel btnPanel = mapdustPlugin.getMapdustGUI().getPanel().getBtnPanel(); 129 addWindowListener(new WindowClose(this, btnPanel, getFiredButton())); 141 142 } 143 144 /** 145 * Displays the dialog. 146 */ 147 public void showDialog(){ 148 setLocationRelativeTo(null); 149 getContentPane().setPreferredSize(getSize()); 150 pack(); 151 setVisible(true); 130 152 } 131 153 … … 167 189 if (lblDescription == null) { 168 190 lblDescription = ComponentUtil.createJLabel("Description", font, 169 new Rectangle(10, 150, 85, 25));191 new Rectangle(10, 150, 95, 25)); 170 192 } 171 193 if (cmpDescription == null) { … … 178 200 /* creates the cancel button */ 179 201 if (btnCancel == null) { 180 Rectangle bounds = new Rectangle(2 60, 210, 80, 25);202 Rectangle bounds = new Rectangle(250, 210, 90, 25); 181 203 ExecuteCancel cancelAction = new ExecuteCancel(this, 182 204 mapdustPlugin.getMapdustGUI()); … … 186 208 /* creates the ok button */ 187 209 if (btnOk == null) { 188 Rectangle bounds = new Rectangle(1 90, 210, 60, 25);210 Rectangle bounds = new Rectangle(180, 210, 60, 25); 189 211 ExecuteAddBug okAction = new ExecuteAddBug(this, 190 212 mapdustPlugin.getMapdustGUI()); … … 286 308 return point; 287 309 } 310 288 311 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustBugPropertiesPanel.java
r24514 r25127 29 29 30 30 31 import static org.openstreetmap.josm.tools.I18n.tr; 31 32 import java.awt.BorderLayout; 32 33 import java.awt.Dimension; 34 import javax.swing.JOptionPane; 33 35 import javax.swing.JPanel; 34 36 import javax.swing.JScrollPane; 35 37 import javax.swing.JTabbedPane; 38 import org.openstreetmap.josm.Main; 36 39 import org.openstreetmap.josm.data.coor.LatLon; 37 40 import org.openstreetmap.josm.plugins.mapdust.gui.component.util.ComponentUtil; … … 91 94 } 92 95 96 /** 97 * Displays the details of the given MapDust bug. 98 * 99 * @param mapdustBug The <code>MapdustBug</code> object 100 */ 93 101 @Override 94 102 public void showDetails(MapdustBug mapdustBug) { 95 MapdustBug selectedBug =mapdustBug;103 MapdustBug selectedBug = mapdustBug; 96 104 if (mapdustBug != null) { 97 105 if (mapdustBug.getNumberOfComments() > 0) { … … 104 112 if (mainPanel != null) { 105 113 index = mainPanel.getSelectedIndex(); 106 cmpDetails.remove(detailsPanel); 107 mainPanel.remove(cmpDetails); 108 mainPanel.remove(cmpAddress); 109 mainPanel.remove(descriptionPanel); 110 mainPanel.remove(commentsPanel); 111 mainPanel.remove(helpPanel); 114 if (mainPanel.getComponentCount() > 0) { 115 mainPanel.remove(cmpDetails); 116 mainPanel.remove(cmpAddress); 117 mainPanel.remove(descriptionPanel); 118 mainPanel.remove(commentsPanel); 119 mainPanel.remove(helpPanel); 120 } 112 121 remove(mainPanel); 113 122 } … … 143 152 /* create details panel */ 144 153 detailsPanel = new MapdustBugDetailsPanel(mapdustBug); 145 cmpDetails = 146 ComponentUtil.createJScrollPane(detailsPanel, getBounds(), 147 getBackground(), true, true); 154 cmpDetails = ComponentUtil.createJScrollPane(detailsPanel, getBounds(), 155 getBackground(), true, true); 148 156 cmpDetails.setPreferredSize(new Dimension(100, 100)); 149 157 cmpDetails.setName("Bug Details"); … … 153 161 LatLon coordinates = mapdustBug != null ? mapdustBug.getLatLon() : null; 154 162 addressPanel = new MapdustAddressPanel(address, coordinates); 155 cmpAddress = 156 ComponentUtil.createJScrollPane(addressPanel, getBounds(), 157 getBackground(), true, true); 163 cmpAddress = ComponentUtil.createJScrollPane(addressPanel, getBounds(), 164 getBackground(), true, true); 158 165 cmpAddress.setName("Address"); 159 166 cmpAddress.setPreferredSize(new Dimension(100, 100)); 160 167 161 168 /* create description panel */ 162 String description = 163 mapdustBug != null ? mapdustBug.getDescription() : ""; 169 String description = mapdustBug != null ? mapdustBug.getDescription() : ""; 164 170 descriptionPanel = new MapdustDescriptionPanel(description); 165 171 166 172 /* create comments panel */ 167 MapdustComment[] comments = 168 mapdustBug != null ? mapdustBug.getComments() 169 : new MapdustComment[0]; 173 MapdustComment[] comments = mapdustBug != null ? mapdustBug.getComments() 174 : new MapdustComment[0]; 170 175 commentsPanel = new MapdustCommentsPanel(comments); 171 176 … … 195 200 bug = new MapdustServiceHandler().getBug(id, null); 196 201 } catch (MapdustServiceHandlerException e) { 197 202 String errorMessage = "There was a MapDust service error durring "; 203 errorMessage+=" the MapDust bug retrieve process."; 204 JOptionPane.showMessageDialog(Main.parent, tr(errorMessage), 205 tr("Error"), JOptionPane.ERROR_MESSAGE); 198 206 } 199 207 return bug; -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustCommentsPanel.java
r24514 r25127 100 100 add(sp); 101 101 } 102 102 103 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustPanel.java
r24514 r25127 29 29 30 30 31 import static org.openstreetmap.josm.tools.I18n.tr;32 31 import java.awt.BorderLayout; 32 import java.awt.Color; 33 33 import java.util.ArrayList; 34 34 import java.util.Iterator; … … 39 39 import javax.swing.JPopupMenu; 40 40 import javax.swing.JScrollPane; 41 import javax.swing.border.LineBorder; 41 42 import javax.swing.event.ListSelectionEvent; 42 43 import javax.swing.event.ListSelectionListener; … … 50 51 import org.openstreetmap.josm.plugins.mapdust.gui.action.show.ShowInvalidateBugAction; 51 52 import org.openstreetmap.josm.plugins.mapdust.gui.action.show.ShowReOpenBugAction; 53 import org.openstreetmap.josm.plugins.mapdust.gui.component.renderer.BugListCellRenderer; 52 54 import org.openstreetmap.josm.plugins.mapdust.gui.component.util.ComponentUtil; 53 55 import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustBugDetailsObservable; … … 102 104 * Builds a <code>MapdustPlugin</code> object 103 105 */ 104 public MapdustPanel() { 105 106 } 106 public MapdustPanel() {} 107 107 108 108 /** … … 119 119 setLayout(new BorderLayout(5, 10)); 120 120 addComponents(mapdustPlugin); 121 setName( tr(name));121 setName(name); 122 122 } 123 123 … … 134 134 /* add comment item */ 135 135 MapdustShowAction action = new ShowCommentBugAction(mapdustPlugin); 136 menuAddComment = 137 ComponentUtil.createJMenuItem(action, tr("Add comment"), 138 "dialogs/comment.png"); 136 menuAddComment = ComponentUtil.createJMenuItem(action, "Add comment", 137 "dialogs/comment.png"); 139 138 menu.add(menuAddComment); 140 139 /* fix bug item */ 141 140 action = new ShowCloseBugAction(mapdustPlugin); 142 menuFixed = 143 ComponentUtil.createJMenuItem(action, tr("Close bug"), 144 "dialogs/fixed.png"); 141 menuFixed = ComponentUtil.createJMenuItem(action, "Close bug", 142 "dialogs/fixed.png"); 145 143 menu.add(menuFixed); 146 144 /* invalidate bug item */ 147 145 action = new ShowInvalidateBugAction(mapdustPlugin); 148 menuInvalidate = 149 ComponentUtil.createJMenuItem(action, tr("Invalidate bug"), 150 "dialogs/invalid.png"); 146 menuInvalidate = ComponentUtil.createJMenuItem(action, 147 "Invalidate bug", "dialogs/invalid.png"); 151 148 menu.add(menuInvalidate); 152 149 /* re-open bug item */ 153 150 action = new ShowReOpenBugAction(mapdustPlugin); 154 menuReopen = 155 ComponentUtil.createJMenuItem(action, tr("Re-open bug"), 156 "dialogs/reopen.png"); 151 menuReopen = ComponentUtil.createJMenuItem(action, "Re-open bug", 152 "dialogs/reopen.png"); 157 153 menu.add(menuReopen); 158 154 } 159 155 /* create bugs list */ 160 listBugs = ComponentUtil.createJList(mapdustBugsList, menu); 161 listBugs.addListSelectionListener(this); 162 DisplayMenu adapter = new DisplayMenu(listBugs, menu); 163 listBugs.addMouseListener(adapter); 164 JScrollPane cmpBugs = ComponentUtil.createJScrollPane(listBugs); 165 /* add components */ 166 add(cmpBugs, BorderLayout.CENTER); 156 JScrollPane cmpBugs; 157 if (mapdustBugsList != null && mapdustBugsList.size() == 0) { 158 String text = " No bugs in the current view!"; 159 JList l=new JList(new String[]{text}); 160 l.setBorder(new LineBorder(Color.black, 1, false)); 161 l.setCellRenderer(new BugListCellRenderer()); 162 cmpBugs=ComponentUtil.createJScrollPane(l); 163 add(cmpBugs, BorderLayout.CENTER); 164 } else { 165 listBugs = ComponentUtil.createJList(mapdustBugsList, menu); 166 listBugs.addListSelectionListener(this); 167 DisplayMenu adapter = new DisplayMenu(listBugs, menu); 168 listBugs.addMouseListener(adapter); 169 cmpBugs = ComponentUtil.createJScrollPane(getListBugs()); 170 add(cmpBugs, BorderLayout.CENTER); 171 } 172 /* add button panel */ 167 173 add(btnPanel, BorderLayout.SOUTH); 168 174 } … … 203 209 getMenuFixed().setEnabled(false); 204 210 } 211 /* re-paint */ 205 212 Main.map.mapView.repaint(); 206 213 mapdustGUI.repaint(); … … 213 220 */ 214 221 public MapdustBug getSelectedBug() { 215 MapdustBug selectedBug = (MapdustBug) getListBugs().getSelectedValue(); 222 MapdustBug selectedBug=null; 223 if (getListBugs()!=null) { 224 selectedBug = (MapdustBug) getListBugs().getSelectedValue(); 225 } 216 226 return selectedBug; 217 227 } … … 348 358 } 349 359 } 360 350 361 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/renderer/BugListCellRenderer.java
r24514 r25127 63 63 public Component getListCellRendererComponent(JList list, Object value, 64 64 int index, boolean isSelected, boolean hasFocus) { 65 JLabel label = 66 (JLabel) super.getListCellRendererComponent(list, value, index, 67 isSelected, hasFocus); 65 JLabel label =(JLabel) super.getListCellRendererComponent(list, value, 66 index,isSelected, hasFocus); 68 67 if (value instanceof MapdustBug) { 68 /* show the MapdustBug in the list */ 69 69 MapdustBug mapdustBug = (MapdustBug) value; 70 70 String iconPath = "bugs/normal/"; … … 87 87 label.setFont(new Font("Times New Roman", Font.BOLD, 12)); 88 88 } 89 if (value instanceof String){ 90 /* show default text in the list */ 91 String text=(String)value; 92 label.setText(text); 93 label.setFont(new Font("Times New Roman", Font.BOLD, 12)); 94 } 89 95 return (label); 90 96 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustInitialUpdateObserver.java
r24514 r25127 42 42 */ 43 43 public void initialUpdate(); 44 44 45 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustRefreshObserver.java
r24514 r25127 39 39 40 40 /** 41 * Updates the data of the MapDust plugin data. 41 * Refreshes the MapDust data. Downloads the bugs from the current view, and 42 * updates the plugin with the new data. 42 43 */ 43 public void updateData();44 public void refreshData(); 44 45 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/retry/RetrySetup.java
r24514 r25127 38 38 /** A default configuration for the {@link RetryAgent} */ 39 39 public static final RetrySetup DEFAULT = new RetrySetup(RetryMode.COUNTED, 40 3, 500);40 1, 500); 41 41 42 42 /** The retry mode */
Note:
See TracChangeset
for help on using the changeset viewer.