Changeset 25828 in osm for applications/editors/josm/plugins/mapdust
- Timestamp:
- 2011-04-12T13:55:53+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/mapdust
- Files:
-
- 13 added
- 3 deleted
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/MapdustLayer.java
r25754 r25828 173 173 /** 174 174 * Draw the objects to the given map view. Also draws the MapDust bugs to 175 * the map, and the tool tip for the selected MapDust bug.175 * the map, and the tool-tip for the selected MapDust bug. 176 176 * 177 177 * @param g The <code>Graphics2D</code> object … … 200 200 g.drawImage(icon.getImage(), p.x - (width / 2), p.y 201 201 - (height / 2), new ImageObserver() { 202 203 202 @Override 204 203 public boolean imageUpdate(Image img, int infoflags, … … 230 229 g.drawImage(icon.getImage(), p.x - (width / 2), p.y 231 230 - (height / 2), new ImageObserver() { 232 233 231 @Override 234 232 public boolean imageUpdate(Image img, int infoflags, int x, … … 240 238 String text = buildTooltipText(bugSelected); 241 239 tooltip.setTipText(text); 242 tooltip.setFont(new Font("Times New Roman", Font. BOLD, 12));240 tooltip.setFont(new Font("Times New Roman", Font.PLAIN, 13)); 243 241 tooltip.setBackground(Color.WHITE); 244 242 tooltip.setForeground(Color.BLUE); … … 272 270 273 271 /** 274 * Builds the text of the tool tip containing a short description of the272 * Builds the text of the tool-tip containing a short description of the 275 273 * given <code>MapdustBug</code> object. 276 274 * … … 279 277 */ 280 278 private String buildTooltipText(MapdustBug bug) { 281 DateFormat df = 282 DateFormat.getDateInstance(DateFormat.DEFAULT, 283 Locale.getDefault()); 284 String text = "<html>Type: " + bug.getType().getValue() + "<br/>"; 285 text += "Status: " + bug.getStatus().getValue() + "<br/>"; 286 text += "Address: " + bug.getAddress() + " <br/>"; 287 text += "Created by: " + bug.getNickname() + "<br/>"; 288 text += "Created on: " + df.format(bug.getDateCreated()) + "<br/>"; 289 text += "Last modified on: "; 290 text += df.format(bug.getDateUpdated()) + "<br/>"; 291 text += "Comments: " + bug.getNumberOfComments(); 279 DateFormat df = DateFormat.getDateInstance(DateFormat.DEFAULT, 280 Locale.getDefault()); 281 String text = "<html><b>Type:</b> " + bug.getType().getValue() ; 282 text += "<br/>"; 283 text += "<b>Status:</b> " + bug.getStatus().getValue() + "<br/>"; 284 text += "<b>Relevance:</b> " + bug.getRelevance().getName() + "<br/>"; 285 text += "<b>Address:</b> " + bug.getAddress() + " <br/>"; 286 text += "<b>Created by:</b> " + bug.getNickname() + "<br/>"; 287 text += "<b>Created on:</b> " + df.format(bug.getDateCreated()); 288 text += "<br/>"; 289 text += "<b>Last modified on:</b> "+ df.format(bug.getDateUpdated()) ; 290 text += "<br/>"; 291 text += "<b>Comments:</b> " + bug.getNumberOfComments(); 292 292 text += "</html>"; 293 293 return text; -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/MapdustPlugin.java
r25754 r25828 52 52 import org.openstreetmap.josm.plugins.PluginInformation; 53 53 import org.openstreetmap.josm.plugins.mapdust.gui.MapdustGUI; 54 import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.Create IssueDialog;54 import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.CreateBugDialog; 55 55 import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustBugObserver; 56 56 import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustUpdateObserver; … … 61 61 import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug; 62 62 import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBugFilter; 63 import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustRelevance; 63 64 import org.openstreetmap.josm.tools.Shortcut; 64 65 … … 81 82 82 83 /** The <code>CreateIssueDialog</code> object */ 83 private Create IssueDialog dialog;84 85 /** The JOSM user identity manager, it is used for obtaining the user name */84 private CreateBugDialog dialog; 85 86 /** The JOSM user identity manager, it is used for obtaining the user name */ 86 87 private final JosmUserIdentityManager userIdentityManager; 87 88 … … 89 90 private List<MapdustBug> mapdustBugList; 90 91 91 /** The bounding box from where the MapDust bugs are down loaded */92 /** The bounding box from where the MapDust bugs are down-loaded */ 92 93 private BoundingBox bBox; 93 94 … … 98 99 private MapdustBugFilter filter; 99 100 100 /** Specifies if there was or not an error down loading the data */101 pr ivateboolean wasError = false;101 /** Specifies if there was or not an error down-loading the data */ 102 protected boolean wasError = false; 102 103 103 104 /** … … 132 133 shortcut, 150, this); 133 134 /* add default values for static variables */ 134 Main.pref.put("mapdust.pluginState", 135 MapdustPluginState.ONLINE.getValue()); 135 Main.pref.put("mapdust.pluginState", MapdustPluginState.ONLINE.getValue()); 136 136 Main.pref.put("mapdust.nickname", ""); 137 137 Main.pref.put("mapdust.showError", true); 138 138 Main.pref.put("mapdust.version", getPluginInformation().version); 139 Main.pref.put("mapdust.localVersion", 140 getPluginInformation().localversion); 139 Main.pref.put("mapdust.localVersion",getPluginInformation().localversion); 141 140 } 142 141 … … 176 175 /** 177 176 * Listens for the events of type <code>PreferenceChangeEvent</code> . If 178 * the event key is 'osm-server.username' then if the user name was changed177 * the event key is 'osm-server.username' then if the user name was changed 179 178 * in Preferences and it was used as 'nickname'( the user did not changed 180 * this completed nickname to somet ing else ) for submitting changes to179 * this completed nickname to something else ) for submitting changes to 181 180 * MapDust , re-set the 'mapdust.josmUserName' and 'mapdust.nickname' 182 181 * properties. 183 182 * 184 * @param event The <code>PreferenceChangeEvent</code> ob ejct183 * @param event The <code>PreferenceChangeEvent</code> object 185 184 */ 186 185 @Override … … 198 197 } else { 199 198 if (nickname.equals(oldUserName)) { 200 /* user name was used for nickname, and was not changed */199 /* user name was used for nickname, and was not changed */ 201 200 Main.pref.put("mapdust.josmUserName", newUserName); 202 201 Main.pref.put("mapdust.nickname", newUserName); 203 202 } else { 204 /* user name was used for nickname, and was changed */203 /* user name was used for nickname, and was changed */ 205 204 Main.pref.put("mapdust.josmUserName", newUserName); 206 205 } … … 268 267 * on the map and on the bugs list. A <code>MapdustBug</code> will be 269 268 * displayed on the map only if it is permitted by the selected filter 270 * settings .269 * settings (statuses, types, description and relevance filter). 271 270 * 272 271 * @param mapdustBug The <code>MapdustBug</code> object … … 304 303 result = containsStatus && containsType; 305 304 } 305 /* check relevance filter settings */ 306 boolean containsMinRelevance = false; 307 if (filter.getMinRelevance() != null) { 308 MapdustRelevance minRel = filter.getMinRelevance(); 309 MapdustRelevance bugRel = mapdustBug.getRelevance(); 310 if (minRel.equals(bugRel)) { 311 containsMinRelevance = true; 312 } else { 313 if (bugRel.compareTo(minRel) == 1) { 314 containsMinRelevance = true; 315 } 316 } 317 } 318 boolean containsMaxRelevance = false; 319 if (filter.getMaxRelevance() != null) { 320 MapdustRelevance maxRel = filter.getMaxRelevance(); 321 MapdustRelevance bugRel = mapdustBug.getRelevance(); 322 if (maxRel.equals(bugRel)) { 323 containsMaxRelevance = true; 324 } else { 325 if (bugRel.compareTo(maxRel) == -1) { 326 containsMaxRelevance = true; 327 } 328 } 329 result = result && (containsMinRelevance && containsMaxRelevance); 330 } 306 331 } 307 332 return result; … … 334 359 /** 335 360 * At mouse click the following two actions can be done: adding a new bug, 336 * and selecting a bug from the map. A bug can be added if the plug in is the337 * only active plugin and you double click on the map. You can select a bug338 * from the map by clicking on it.361 * and selecting a bug from the map. A bug can be added if the plug-in is 362 * the only active plug-in and you double click on the map. You can select 363 * a bug from the map by clicking on it. 339 364 * 340 365 * @param event The <code>MouseEvent</code> object … … 357 382 mapdustGUI.getPanel().disableBtnPanel(); 358 383 /* create and show dialog */ 359 dialog = new Create IssueDialog(event.getPoint(), this);384 dialog = new CreateBugDialog(event.getPoint(), this); 360 385 dialog.showDialog(); 361 386 event.consume(); … … 411 436 /** 412 437 * Adds the <code>MapdustLayer</code> to the JOSM editor. If the list of 413 * <code>MapdustBug</code>s is null then down loads the data from the MapDust414 * Service and updates the editor with this new data.438 * <code>MapdustBug</code>s is null then down-loads the data from the 439 * MapDust Service and updates the editor with this new data. 415 440 * 416 441 * @param layer The <code>Layer</code> which will be added to the JOSM … … 422 447 /** 423 448 * Removes the <code>MapdustLayer</code> from the JOSM editor. Also closes 424 * the MapDust plug in window.449 * the MapDust plug-in window. 425 450 * 426 451 * @param layer The <code>Layer</code> which will be removed from the JOSM … … 447 472 /** 448 473 * Listens for the zoom change event. If the zoom was changed, then it will 449 * down load the MapDust bugs data from the current view. The new data will450 * be down loaded only if the current bounding box is different from the474 * down-load the MapDust bugs data from the current view. The new data will 475 * be down-loaded only if the current bounding box is different from the 451 476 * previous one. 452 477 */ … … 469 494 470 495 /** 471 * Updates the plug in with a new MapDust bugs data. If the filters are set496 * Updates the plug-in with a new MapDust bugs data. If the filters are set 472 497 * then the MapDust data will be filtered. If initialUpdate flag is true 473 * then the plug in is updated for the first time with the MapDust data. By498 * then the plug-in is updated for the first time with the MapDust data. By 474 499 * default the first time there is no filter applied to the MapDust data. 475 500 * … … 508 533 509 534 /** 510 * Updates the <code>MapdustPlugin</code> data. Down loads the535 * Updates the <code>MapdustPlugin</code> data. Down-loads the 511 536 * <code>MapdustBug</code> objects from the current view, and updates the 512 537 * <code>MapdustGUI</code> and the map with the new data. … … 523 548 524 549 /** 525 * Updates the MapDust plug in data. Downloads the list of550 * Updates the MapDust plug-in data. Down-loads the list of 526 551 * <code>MapdustBug</code> objects for the given area, and updates the map 527 552 * and the MapDust layer with the new data. … … 529 554 protected synchronized void updateMapdustData() { 530 555 if (Main.map != null && Main.map.mapView != null) { 531 /* downloadthe MapDust data */556 /* Down-loads the MapDust data */ 532 557 try { 533 558 MapdustServiceHandler handler = new MapdustServiceHandler(); … … 542 567 @Override 543 568 public void run() { 544 updateView(); 545 if (wasError) { 546 handleError(); 569 synchronized (this) { 570 updateView(); 571 if (wasError) { 572 handleError(); 573 } 547 574 } 548 575 } … … 610 637 /** 611 638 * Handles the <code>MapdustServiceHandlerException</code> error. 612 * 613 */ 614 private void handleError() { 639 */ 640 protected void handleError() { 615 641 String showMessage = Main.pref.get("mapdust.showError"); 616 642 Boolean showErrorMessage = Boolean.parseBoolean(showMessage); -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/MapdustGUI.java
r25754 r25828 75 75 new ArrayList<MapdustUpdateObserver>(); 76 76 77 /** The <code>MapdustPlugin</code> plug in */77 /** The <code>MapdustPlugin</code> plug-in */ 78 78 private MapdustPlugin mapdustPlugin; 79 79 … … 93 93 private JPanel mainPanel; 94 94 95 /** Specifies if the MapDust data was or not down loaded */95 /** Specifies if the MapDust data was or not down-loaded */ 96 96 private boolean downloaded = false; 97 97 … … 114 114 /** 115 115 * Displays the <code>MapdustGUI</code> dialog window in the JOSM editor. If 116 * the MapDust data was not down loaded yet or the MapDust layer was added116 * the MapDust data was not down-loaded yet or the MapDust layer was added 117 117 * after a previous deletion, then the bug reports data will be deleted. 118 118 */ … … 134 134 /* remove panels */ 135 135 if (tabbedPane != null) { 136 /* from off line to online */136 /* from off-line to online */ 137 137 remove(mainPanel); 138 138 tabbedPane = null; … … 142 142 actionPanel = null; 143 143 } else { 144 /* from online to off line */144 /* from online to off-line */ 145 145 if (mainPanel != null) { 146 146 remove(mainPanel); … … 229 229 if (pluginState.equals(MapdustPluginState.ONLINE.getValue())) { 230 230 if (tabbedPane != null) { 231 /* from off line to online */231 /* from off-line to online */ 232 232 remove(mainPanel); 233 233 tabbedPane = null; … … 242 242 } else { 243 243 if (tabbedPane == null) { 244 /* from online to off line */244 /* from online to off-line */ 245 245 remove(mainPanel); 246 246 mainPanel = null; 247 247 panel = null; 248 248 } 249 List<MapdustAction> actionList = 250 actionPanel != null ? actionPanel.getActionList() 251 : new ArrayList<MapdustAction>(); 249 List<MapdustAction> actionList = actionPanel != null ? 250 actionPanel.getActionList() : new ArrayList<MapdustAction>(); 252 251 253 252 /* update panels */ 254 253 List<MapdustBug> bugs = filterMapdustBugList(mapdustBugs, 255 actionList, mapdustPlugin.getFilter());254 actionList, mapdustPlugin.getFilter()); 256 255 updateMapdustPanel(bugs); 257 256 updateMapdustActionPanel(actionList); … … 268 267 */ 269 268 private void updateMapdustPanel(List<MapdustBug> mapdustBugs) { 270 MapdustBug selectedBug = 271 (mapdustBugs != null && mapdustBugs.size() > 0) ? mapdustBugs 272 .get(0) : null; 269 MapdustBug selectedBug = (mapdustBugs != null && mapdustBugs.size() 270 > 0) ? mapdustBugs.get(0) : null; 273 271 if (detailsPanel == null) { 274 272 detailsPanel = new MapdustBugPropertiesPanel(selectedBug); … … 300 298 301 299 /** 302 * Creates the main panel of the plug in and adds to the content pane.300 * Creates the main panel of the plug-in and adds to the content pane. 303 301 */ 304 302 private void createMainPanel() { … … 427 425 /** 428 426 * Enables the basic components from the <code>MapdustButtonPanel</code>. 429 * Basic components are considered the following buttons: work off line,427 * Basic components are considered the following buttons: work off-line, 430 428 * filter bug report, and refresh.If the onlyBasic flag is true then the 431 429 * other buttons will be disabled. … … 447 445 return getActionPanel().getActionList(); 448 446 } 449 450 447 451 448 /** … … 512 509 /** 513 510 * Notifies the <code>MapdustInitialUpdateObserver</code> objects waiting 514 * for the initial down load, and update of plugin.511 * for the initial down-load, and update of plug-in. 515 512 */ 516 513 @Override … … 542 539 543 540 /** 541 * Returns the <code>MapdustPlugin</code> object 542 * 544 543 * @return the mapdustPlugin 545 544 */ … … 549 548 550 549 /** 550 * Sets the <code>MapdustPlugin</code> object 551 * 551 552 * @param mapdustPlugin the mapdustPlugin to set 552 553 */ … … 556 557 557 558 /** 558 * Returns the down loaded flag559 * 560 * @return the down loaded559 * Returns the down-loaded flag 560 * 561 * @return the down-loaded 561 562 */ 562 563 public boolean isDownloaded() { -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteAddBug.java
r25591 r25828 38 38 import org.openstreetmap.josm.data.coor.LatLon; 39 39 import org.openstreetmap.josm.plugins.mapdust.gui.MapdustGUI; 40 import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.Create IssueDialog;40 import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.CreateBugDialog; 41 41 import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustActionObservable; 42 42 import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustActionObserver; … … 88 88 * @param mapdustGUI The <code>MapdustGUI</code> object 89 89 */ 90 public ExecuteAddBug(Create IssueDialog dialog, MapdustGUI mapdustGUI) {90 public ExecuteAddBug(CreateBugDialog dialog, MapdustGUI mapdustGUI) { 91 91 setDialog(dialog); 92 92 setMapdustGUI(mapdustGUI); … … 103 103 public void actionPerformed(ActionEvent event) { 104 104 if (event != null) { 105 Create IssueDialog createDialog = (CreateIssueDialog) getDialog();105 CreateBugDialog createDialog = (CreateBugDialog) getDialog(); 106 106 Type type = (Type) (createDialog).getCbbType().getSelectedItem(); 107 107 String nickname = createDialog.getTxtNickname().getText(); -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteCloseBug.java
r25591 r25828 37 37 import org.openstreetmap.josm.Main; 38 38 import org.openstreetmap.josm.plugins.mapdust.gui.MapdustGUI; 39 import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.Change IssueStatusDialog;39 import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.ChangeBugStatusDialog; 40 40 import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustActionObservable; 41 41 import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustActionObserver; … … 87 87 * @param mapdustGUI The <code>MapdustGUI</code> object 88 88 */ 89 public ExecuteCloseBug(Change IssueStatusDialog dialog, MapdustGUI mapdustGUI) {89 public ExecuteCloseBug(ChangeBugStatusDialog dialog, MapdustGUI mapdustGUI) { 90 90 setDialog(dialog); 91 91 setMapdustGUI(mapdustGUI); … … 104 104 if (btn.getText().equals("OK")) { 105 105 /* the OK button was pressed */ 106 Change IssueStatusDialog issueDialog =107 (Change IssueStatusDialog) getDialog();106 ChangeBugStatusDialog issueDialog = 107 (ChangeBugStatusDialog) getDialog(); 108 108 String nickname = issueDialog.getTxtNickname().getText(); 109 109 String commentText = issueDialog.getTxtDescription().getText(); … … 131 131 /* destroy dialog */ 132 132 enableFiredButton(issueDialog.getFiredButton()); 133 mapdustGUI.enableBtnPanel( false);133 mapdustGUI.enableBtnPanel(true); 134 134 issueDialog.dispose(); 135 135 if (getMapdustGUI().getActionPanel()!= null) { -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteCommentBug.java
r25591 r25828 37 37 import org.openstreetmap.josm.Main; 38 38 import org.openstreetmap.josm.plugins.mapdust.gui.MapdustGUI; 39 import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.Comment IssueDialog;39 import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.CommentBugDialog; 40 40 import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustActionObservable; 41 41 import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustActionObserver; … … 86 86 * @param mapdustGUI The <code>MapdustGUI</code> object 87 87 */ 88 public ExecuteCommentBug(Comment IssueDialog dialog, MapdustGUI mapdustGUI) {88 public ExecuteCommentBug(CommentBugDialog dialog, MapdustGUI mapdustGUI) { 89 89 setDialog(dialog); 90 90 setMapdustGUI(mapdustGUI); … … 103 103 if (btn.getText().equals("OK")) { 104 104 /* ok button was pressed */ 105 Comment IssueDialog issueDialog =106 (Comment IssueDialog) getDialog();105 CommentBugDialog issueDialog = 106 (CommentBugDialog) getDialog(); 107 107 String nickname = issueDialog.getTxtNickname().getText(); 108 108 String commentText = issueDialog.getTxtComment().getText(); … … 127 127 MapdustServiceCommand.COMMENT_BUG, iconPath, 128 128 selectedBug, comment); 129 /* destroy dialog */ 130 enableFiredButton(issueDialog.getFiredButton()); 131 mapdustGUI.enableBtnPanel(true); 132 mapdustGUI.getPanel().resetSelectedBug(0); 133 issueDialog.dispose(); 129 134 if (getMapdustGUI().getActionPanel() != null) { 130 135 issueDialog.dispose(); … … 155 160 JOptionPane.ERROR_MESSAGE); 156 161 } 162 /* enable buttons */ 163 enableFiredButton(issueDialog.getFiredButton()); 164 mapdustGUI.enableBtnPanel(false); 165 mapdustGUI.getPanel().resetSelectedBug(0); 166 /* destroy dialog */ 167 issueDialog.dispose(); 157 168 if (newMapdustBug != null) { 158 169 notifyObservers(newMapdustBug); … … 160 171 } 161 172 } 162 /* enable buttons */ 163 enableFiredButton(issueDialog.getFiredButton()); 164 mapdustGUI.enableBtnPanel(false); 165 mapdustGUI.getPanel().resetSelectedBug(0); 166 /* destroy dialog */ 167 issueDialog.dispose(); 173 168 174 } 169 175 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteFilterBug.java
r25591 r25828 43 43 import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustUpdateObserver; 44 44 import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBugFilter; 45 import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustRelevance; 45 46 46 47 … … 96 97 /* get the selected description filter */ 97 98 boolean descr = dialog.isDescrFilterChecked(); 99 MapdustRelevance minValue = dialog.getSelectedMinRelevance(); 100 MapdustRelevance maxValue= dialog.getSelectedMaxRelevance(); 98 101 /* notifies the observers about the filters */ 99 notifyObservers(new MapdustBugFilter(statuses, types, descr ),100 false);102 notifyObservers(new MapdustBugFilter(statuses, types, descr, 103 minValue, maxValue), false); 101 104 enableFiredButton(dialog.getFiredButton()); 102 105 mapdustGUI.enableBtnPanel(false); -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteInvalidateBug.java
r25591 r25828 37 37 import org.openstreetmap.josm.Main; 38 38 import org.openstreetmap.josm.plugins.mapdust.gui.MapdustGUI; 39 import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.Change IssueStatusDialog;39 import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.ChangeBugStatusDialog; 40 40 import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustActionObservable; 41 41 import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustActionObserver; … … 89 89 * @param mapdustGUI The <code>MapdustGUI</code> object 90 90 */ 91 public ExecuteInvalidateBug(Change IssueStatusDialog dialog,91 public ExecuteInvalidateBug(ChangeBugStatusDialog dialog, 92 92 MapdustGUI mapdustGUI) { 93 93 setDialog(dialog); … … 107 107 if (btn.getText().equals("OK")) { 108 108 /* ok button was pressed */ 109 Change IssueStatusDialog issueDialog =110 (Change IssueStatusDialog) getDialog();109 ChangeBugStatusDialog issueDialog = 110 (ChangeBugStatusDialog) getDialog(); 111 111 String nickname = issueDialog.getTxtNickname().getText(); 112 112 String commentText = issueDialog.getTxtDescription().getText(); … … 135 135 136 136 /* enable buttons */ 137 mapdustGUI.enableBtnPanel( false);137 mapdustGUI.enableBtnPanel(true); 138 138 enableFiredButton(issueDialog.getFiredButton()); 139 139 issueDialog.dispose(); -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteReOpenBug.java
r25591 r25828 37 37 import org.openstreetmap.josm.Main; 38 38 import org.openstreetmap.josm.plugins.mapdust.gui.MapdustGUI; 39 import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.Change IssueStatusDialog;39 import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.ChangeBugStatusDialog; 40 40 import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustActionObservable; 41 41 import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustActionObserver; … … 88 88 * @param mapdustGUI The <code>MapdustGUI</code> object 89 89 */ 90 public ExecuteReOpenBug(Change IssueStatusDialog dialog,90 public ExecuteReOpenBug(ChangeBugStatusDialog dialog, 91 91 MapdustGUI mapdustGUI) { 92 92 setDialog(dialog); … … 104 104 if (btn.getText().equals("OK")) { 105 105 /* pressed ok */ 106 Change IssueStatusDialog issueDialog =107 (Change IssueStatusDialog) getDialog();106 ChangeBugStatusDialog issueDialog = 107 (ChangeBugStatusDialog) getDialog(); 108 108 String nickname = issueDialog.getTxtNickname().getText(); 109 109 String commentText = issueDialog.getTxtDescription().getText(); … … 130 130 selectedBug, comment, 1); 131 131 /* destroy dialog */ 132 mapdustGUI.enableBtnPanel( false);132 mapdustGUI.enableBtnPanel(true); 133 133 enableFiredButton(issueDialog.getFiredButton()); 134 134 issueDialog.dispose(); -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteWorkOffline.java
r25591 r25828 95 95 MapdustPluginState.OFFLINE.getValue()); 96 96 btn.setSelected(false); 97 btn.setFocusable(false); 97 98 } else { 98 99 // was offline, becomes online … … 117 118 MapdustPluginState.ONLINE.getValue()); 118 119 btn.setSelected(false); 120 btn.setFocusable(false); 119 121 } 120 122 notifyObservers(null, false); -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/MapdustExecuteAction.java
r25591 r25828 66 66 String errorMessage = null; 67 67 String invalidNickname = " Your nickname length has to be between 3"; 68 invalidNickname += " and 16 characters. Please use letters,numbers, ";68 invalidNickname += " and 16 characters. Please use letters,numbers, "; 69 69 invalidNickname += " '-', '.' or '_' '.'"; 70 70 if (emptyValue(nickname) && emptyValue(commentText)) { -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/show/MapdustShowAction.java
r25591 r25828 51 51 /** The icon name of the dialog window */ 52 52 protected String iconName; 53 54 /** The message to display on the dialog */55 protected String messageText;56 53 57 54 /** The <code>MapdustPlugin</code> */ … … 124 121 125 122 /** 126 * Returns the message text127 *128 * @return the messageText129 */130 public String getMessageText() {131 return this.messageText;132 }133 134 /**135 * Returns the message text136 *137 * @param messageText the messageText to set138 */139 public void setMessageText(String messageText) {140 this.messageText = messageText;141 }142 143 /**144 123 * Disables the buttons from the given button panel. 145 124 * -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/show/ShowCloseBugAction.java
r25591 r25828 33 33 import javax.swing.JToggleButton; 34 34 import org.openstreetmap.josm.plugins.mapdust.MapdustPlugin; 35 import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.Change IssueStatusDialog;35 import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.ChangeBugStatusDialog; 36 36 import org.openstreetmap.josm.plugins.mapdust.gui.component.panel.MapdustButtonPanel; 37 37 … … 64 64 public ShowCloseBugAction(MapdustPlugin mapdustPlugin) { 65 65 setMapdustPlugin(mapdustPlugin); 66 setTitle(" Close bug report");66 setTitle("Mark bug report as fixed"); 67 67 setIconName("dialogs/fixed.png"); 68 String text = "In order to close a bug report, please provide your";69 text += " nickname and your reason of closing the bug report.";70 setMessageText(text);71 68 } 72 69 … … 89 86 } 90 87 disableButtons(getButtonPanel()); 91 Change IssueStatusDialog dialog = new ChangeIssueStatusDialog(92 getTitle(), getIconName(), getMessageText(),"close", btn,88 ChangeBugStatusDialog dialog = new ChangeBugStatusDialog( 89 getTitle(), getIconName(), "close", btn, 93 90 getMapdustPlugin()); 94 91 dialog.setLocationRelativeTo(null); -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/show/ShowCommentBugAction.java
r25591 r25828 33 33 import javax.swing.JToggleButton; 34 34 import org.openstreetmap.josm.plugins.mapdust.MapdustPlugin; 35 import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.Comment IssueDialog;35 import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.CommentBugDialog; 36 36 import org.openstreetmap.josm.plugins.mapdust.gui.component.panel.MapdustButtonPanel; 37 37 … … 63 63 public ShowCommentBugAction(MapdustPlugin mapdustPlugin) { 64 64 setMapdustPlugin(mapdustPlugin); 65 setTitle(" Create bug report comment");65 setTitle("Add comment/additional info"); 66 66 setIconName("dialogs/comment.png"); 67 String text = "In order to comment a bug report, you need to ";68 text += "provide your nickname and a brief comment for the bug.";69 setMessageText(text);70 67 } 71 68 … … 88 85 } 89 86 disableButtons(getButtonPanel()); 90 Comment IssueDialog dialog = new CommentIssueDialog(getTitle(),91 getIconName(), getMessageText(),btn, getMapdustPlugin());87 CommentBugDialog dialog = new CommentBugDialog(getTitle(), 88 getIconName(), btn, getMapdustPlugin()); 92 89 dialog.setLocationRelativeTo(null); 93 90 dialog.getContentPane().setPreferredSize(dialog.getSize()); -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/show/ShowInvalidateBugAction.java
r25591 r25828 33 33 import javax.swing.JToggleButton; 34 34 import org.openstreetmap.josm.plugins.mapdust.MapdustPlugin; 35 import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.Change IssueStatusDialog;35 import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.ChangeBugStatusDialog; 36 36 import org.openstreetmap.josm.plugins.mapdust.gui.component.panel.MapdustButtonPanel; 37 37 … … 64 64 public ShowInvalidateBugAction(MapdustPlugin mapdustPlugin) { 65 65 setMapdustPlugin(mapdustPlugin); 66 setTitle(" Invalidate bug report");66 setTitle("Mark bug report as non-reproducible/software bug"); 67 67 setIconName("dialogs/invalid.png"); 68 String text = "In order to invalidate the bug report, please provide ";69 text += "your nickname and your reason of invalidating the bug report.";70 setMessageText(text);71 68 } 72 69 … … 90 87 } 91 88 disableButtons(getButtonPanel()); 92 Change IssueStatusDialog dialog = new ChangeIssueStatusDialog(93 getTitle(), getIconName(), getMessageText(),"invalidate",89 ChangeBugStatusDialog dialog = new ChangeBugStatusDialog( 90 getTitle(), getIconName(), "invalidate", 94 91 btn, getMapdustPlugin()); 95 92 dialog.setLocationRelativeTo(null); -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/show/ShowReOpenBugAction.java
r25591 r25828 33 33 import javax.swing.JToggleButton; 34 34 import org.openstreetmap.josm.plugins.mapdust.MapdustPlugin; 35 import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.Change IssueStatusDialog;35 import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.ChangeBugStatusDialog; 36 36 import org.openstreetmap.josm.plugins.mapdust.gui.component.panel.MapdustButtonPanel; 37 37 … … 63 63 public ShowReOpenBugAction(MapdustPlugin mapdustPlugin) { 64 64 setMapdustPlugin(mapdustPlugin); 65 setTitle("Re -open bug report");65 setTitle("Reopen bug report"); 66 66 setIconName("dialogs/reopen.png"); 67 String text = "In order to re-open the bug report, please provide ";68 text += "your nickname and your reason of re-opening the bug report.";69 setMessageText(text);70 67 } 71 68 … … 87 84 } 88 85 disableButtons(getButtonPanel()); 89 Change IssueStatusDialog dialog = new ChangeIssueStatusDialog(90 getTitle(), getIconName(), getMessageText(),"reopen", btn,86 ChangeBugStatusDialog dialog = new ChangeBugStatusDialog( 87 getTitle(), getIconName(), "reopen", btn, 91 88 getMapdustPlugin()); 92 89 dialog.setLocationRelativeTo(null); -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/dialog/FilterBugDialog.java
r25591 r25828 48 48 import org.openstreetmap.josm.plugins.mapdust.gui.action.execute.ExecuteFilterBug; 49 49 import org.openstreetmap.josm.plugins.mapdust.gui.component.panel.MapdustButtonPanel; 50 import org.openstreetmap.josm.plugins.mapdust.gui.component.slider.RelevanceSlider; 50 51 import org.openstreetmap.josm.plugins.mapdust.gui.component.util.ComponentUtil; 51 52 import org.openstreetmap.josm.plugins.mapdust.gui.component.util.FilterCheckBox; 53 import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustRelevanceValue; 52 54 import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBugFilter; 55 import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustRelevance; 53 56 import org.openstreetmap.josm.plugins.mapdust.service.value.Status; 54 57 import org.openstreetmap.josm.plugins.mapdust.service.value.Type; … … 84 87 /** The <code>FilterCheckBox</code> containing the description filter */ 85 88 private FilterCheckBox filterDescr; 89 90 /** The <code>JLabel</code> for the relevance filter */ 91 private JLabel lblRelevance; 92 93 /** The <code>RelevanceSlider</code> representing the relevance values */ 94 private RelevanceSlider sliderRelevance; 86 95 87 96 /** The apply button */ … … 131 140 if (lblStatus == null) { 132 141 Rectangle bounds = new Rectangle(10, 10, 95, 25); 133 lblStatus = ComponentUtil.createJLabel("Status", font, bounds); 142 lblStatus = ComponentUtil.createJLabel("Status", font, bounds, 143 null); 134 144 } 135 145 if (filterStatuses == null) { … … 143 153 if (lblType == null) { 144 154 Rectangle bounds = new Rectangle(10, 90, 95, 25); 145 lblType = ComponentUtil.createJLabel("Type", font, bounds );155 lblType = ComponentUtil.createJLabel("Type", font, bounds, null); 146 156 } 147 157 … … 150 160 Rectangle bounds = new Rectangle(10, 230, 95, 25); 151 161 lblDescription = ComponentUtil.createJLabel("Description", font, 152 bounds );162 bounds, null); 153 163 } 154 164 if (filterDescr == null) { … … 157 167 String text = "Hide bugs with default description"; 158 168 String iconName = "dialogs/default_description.png"; 159 filterDescr = new FilterCheckBox("descr", chbBounds, iconName, text,160 lblBounds);169 filterDescr = new FilterCheckBox("descr", chbBounds, iconName, 170 text, lblBounds); 161 171 if (prevFilter != null && prevFilter.getDescr() != null 162 172 && prevFilter.getDescr()) { … … 164 174 } 165 175 } 176 /* relevance filter */ 177 if (lblRelevance == null) { 178 Rectangle bounds = new Rectangle(10, 265, 95, 25); 179 lblRelevance = ComponentUtil.createJLabel("Relevance", font, 180 bounds, null); 181 } 182 if (sliderRelevance == null) { 183 Rectangle bounds = new Rectangle(110, 265, 300, 50); 184 sliderRelevance = new RelevanceSlider(); 185 sliderRelevance.setBounds(bounds); 186 if (prevFilter != null) { 187 MapdustRelevance min = prevFilter.getMinRelevance(); 188 MapdustRelevance max = prevFilter.getMaxRelevance(); 189 if (min != null) { 190 Integer value = MapdustRelevanceValue.getSliderValue(min); 191 if (value == null) { 192 value = MapdustRelevanceValue.LOW.getSliderValue(); 193 } 194 sliderRelevance.setLowerValue(value); 195 } 196 if (max != null) { 197 Integer value = MapdustRelevanceValue.getSliderValue(max); 198 if (value == null) { 199 value = MapdustRelevanceValue.HIGH.getSliderValue(); 200 } 201 sliderRelevance.setUpperValue(value); 202 } 203 if (max != null && max.equals(min) 204 && max.equals(MapdustRelevance.LOW)) { 205 sliderRelevance.getUI().setIsUpperSelected(true); 206 } 207 } 208 } 166 209 167 210 /* creates the cancel button */ 168 211 if (btnCancel == null) { 169 Rectangle bounds = new Rectangle(360, 265, 90, 25);212 Rectangle bounds = new Rectangle(360, 330, 90, 25); 170 213 ExecuteCancel cancelAction = new ExecuteCancel(this, 171 214 mapdustPlugin.getMapdustGUI()); … … 173 216 cancelAction); 174 217 } 175 /* creates the okbutton */218 /* creates the OK button */ 176 219 if (btnApply == null) { 177 Rectangle bounds = new Rectangle(260, 265, 90, 25);220 Rectangle bounds = new Rectangle(260, 330, 90, 25); 178 221 ExecuteFilterBug applyAction = new ExecuteFilterBug(this, 179 222 mapdustPlugin.getMapdustGUI()); 180 223 applyAction.addObserver(mapdustPlugin); 181 btnApply = ComponentUtil.createJButton("Apply", bounds, applyAction);182 }183 224 btnApply = ComponentUtil.createJButton("Apply", bounds, 225 applyAction); 226 } 184 227 /* add components */ 185 228 add(lblStatus); … … 189 232 add(lblDescription); 190 233 add(filterDescr); 234 add(lblRelevance); 235 add(sliderRelevance); 191 236 add(btnCancel); 192 237 add(btnApply); 193 setSize(460, 3 00);238 setSize(460, 360); 194 239 } 195 240 … … 238 283 /* wrong_turn type */ 239 284 filterTypes[0] = new FilterCheckBox(Type.WRONG_TURN.getKey(), 240 new Rectangle(110, 90, 20, 25), "dialogs/wrong_turn.png",241 Type.WRONG_TURN.getValue(), new Rectangle(130, 90, 120, 25));285 new Rectangle(110, 90, 20, 25), "dialogs/wrong_turn.png", 286 Type.WRONG_TURN.getValue(), new Rectangle(130, 90, 120, 25)); 242 287 /* bad_routing type */ 243 288 filterTypes[1] = new FilterCheckBox(Type.WRONG_ROUNDABOUT.getKey(), 244 289 new Rectangle(270, 90, 20, 25), "dialogs/wrong_roundabout.png", 245 Type.WRONG_ROUNDABOUT.getValue(), 246 new Rectangle(290, 90, 180,25));290 Type.WRONG_ROUNDABOUT.getValue(), new Rectangle(290, 90, 180, 291 25)); 247 292 /* oneway_road type */ 248 filterTypes[2] = new FilterCheckBox(Type.MISSING_STREET.getKey(),293 filterTypes[2] = new FilterCheckBox(Type.MISSING_STREET.getKey(), 249 294 new Rectangle(110, 125, 20, 25), "dialogs/missing_street.png", 250 Type.MISSING_STREET.getValue(), 251 new Rectangle(130, 125, 150,25));295 Type.MISSING_STREET.getValue(), new Rectangle(130, 125, 150, 296 25)); 252 297 /* blocked_street type */ 253 298 filterTypes[3] = new FilterCheckBox(Type.BLOCKED_STREET.getKey(), 254 299 new Rectangle(270, 125, 20, 25), "dialogs/blocked_street.png", 255 Type.BLOCKED_STREET.getValue(), 256 new Rectangle(290, 125, 180,25));300 Type.BLOCKED_STREET.getValue(), new Rectangle(290, 125, 180, 301 25)); 257 302 /* missing_street type */ 258 303 filterTypes[4] = new FilterCheckBox(Type.BAD_ROUTING.getKey(), … … 262 307 filterTypes[5] = new FilterCheckBox(Type.MISSING_SPEEDLIMIT.getKey(), 263 308 new Rectangle(270, 160, 20, 25), "dialogs/missing_speedlimit.png", 264 Type.MISSING_SPEEDLIMIT.getValue(), 265 new Rectangle(290, 160,180, 25));309 Type.MISSING_SPEEDLIMIT.getValue(), new Rectangle(290, 160, 310 180, 25)); 266 311 /* missing_speedlimit type */ 267 312 filterTypes[6] = new FilterCheckBox(Type.OTHER.getKey(), … … 328 373 329 374 /** 375 * Returns the selected minimum relevance value from the relevance slider. 376 * 377 * @return A <code>MapdustRelevance</code> object 378 */ 379 public MapdustRelevance getSelectedMinRelevance() { 380 int value = sliderRelevance.getLowerValue(); 381 MapdustRelevance minRelevance = 382 MapdustRelevance.getMapdustRelevance(value); 383 return minRelevance; 384 } 385 386 /** 387 * Returns the selected maximum relevance value from the relevance slider. 388 * 389 * @return A <code>MapdustRelevance</code> object 390 */ 391 public MapdustRelevance getSelectedMaxRelevance() { 392 int value = sliderRelevance.getUpperValue(); 393 MapdustRelevance maxRelevance = 394 MapdustRelevance.getMapdustRelevance(value); 395 return maxRelevance; 396 } 397 398 /** 330 399 * Add the given filter to the current dialog window. 331 400 * -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustAddressPanel.java
r25591 r25828 63 63 64 64 /** 65 * Updates the components of the <code>MapdustAddressPanel</code> based 66 * onthe given parameters.65 * Updates the components of the <code>MapdustAddressPanel</code> based on 66 * the given parameters. 67 67 * 68 68 * @param address The <code>Address</code> of a MapDust bug 69 69 * @param coordinates The <code>LatLon</code> of a MapDust bug 70 70 */ 71 public void updateComponents(Address address, LatLon coordinates){72 73 71 public void updateComponents(Address address, LatLon coordinates) { 72 removeAll(); 73 addComponents(address, coordinates); 74 74 } 75 75 … … 86 86 87 87 /* country */ 88 add(ComponentUtil.createJLabel("Country: ", fontLabel, null ));88 add(ComponentUtil.createJLabel("Country: ", fontLabel, null, null)); 89 89 String country = address != null ? address.getCountryCode() : ""; 90 add(ComponentUtil.createJLabel(country, fontLabelVal, null ));90 add(ComponentUtil.createJLabel(country, fontLabelVal, null, null)); 91 91 92 92 /* label */ 93 add(ComponentUtil.createJLabel("City: ", fontLabel, null ));93 add(ComponentUtil.createJLabel("City: ", fontLabel, null, null)); 94 94 String city = address != null ? address.getCity() : ""; 95 add(ComponentUtil.createJLabel(city, fontLabelVal, null ));95 add(ComponentUtil.createJLabel(city, fontLabelVal, null, null)); 96 96 97 97 /* statecode */ 98 add(ComponentUtil.createJLabel("State code: ", fontLabel, null ));98 add(ComponentUtil.createJLabel("State code: ", fontLabel, null, null)); 99 99 String state = address != null ? address.getStateCode() : ""; 100 add(ComponentUtil.createJLabel(state, fontLabelVal, null ));100 add(ComponentUtil.createJLabel(state, fontLabelVal, null, null)); 101 101 102 102 /* label */ 103 add(ComponentUtil.createJLabel("Zip code: ", fontLabel, null ));103 add(ComponentUtil.createJLabel("Zip code: ", fontLabel, null, null)); 104 104 String zip = address != null ? address.getZipCode() : ""; 105 add(ComponentUtil.createJLabel(zip, fontLabelVal, null ));105 add(ComponentUtil.createJLabel(zip, fontLabelVal, null, null)); 106 106 107 107 /* street name */ 108 add(ComponentUtil.createJLabel("Street: ", fontLabel, null ));108 add(ComponentUtil.createJLabel("Street: ", fontLabel, null, null)); 109 109 String street = address != null ? address.getStreetName() : ""; 110 add(ComponentUtil.createJLabel(street, fontLabelVal, null ));110 add(ComponentUtil.createJLabel(street, fontLabelVal, null, null)); 111 111 112 112 /* house number */ 113 add(ComponentUtil.createJLabel("House number: ", fontLabel, null ));113 add(ComponentUtil.createJLabel("House number: ", fontLabel, null, null)); 114 114 String houseNr = address != null ? address.getHouseNumber() : ""; 115 add(ComponentUtil.createJLabel(houseNr, fontLabelVal, null ));115 add(ComponentUtil.createJLabel(houseNr, fontLabelVal, null, null)); 116 116 117 /* lat */118 add(ComponentUtil.createJLabel("Latitude: ", fontLabel, null ));117 /* latitude */ 118 add(ComponentUtil.createJLabel("Latitude: ", fontLabel, null, null)); 119 119 String lat = coordinates != null ? ("" + coordinates.lat()) : ""; 120 add(ComponentUtil.createJLabel(lat, fontLabelVal, null ));120 add(ComponentUtil.createJLabel(lat, fontLabelVal, null, null)); 121 121 122 /* lon*/123 add(ComponentUtil.createJLabel("Longitude: ", fontLabel, null ));122 /* longitude */ 123 add(ComponentUtil.createJLabel("Longitude: ", fontLabel, null, null)); 124 124 String lon = coordinates != null ? ("" + coordinates.lon()) : ""; 125 add(ComponentUtil.createJLabel(lon, fontLabelVal, null ));125 add(ComponentUtil.createJLabel(lon, fontLabelVal, null, null)); 126 126 } 127 127 -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustBugDetailsPanel.java
r25591 r25828 46 46 import org.openstreetmap.josm.plugins.mapdust.gui.component.util.ComponentUtil; 47 47 import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug; 48 import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustRelevance; 48 49 import org.openstreetmap.josm.plugins.mapdust.util.Configuration; 49 50 import org.openstreetmap.josm.tools.OpenBrowser; … … 70 71 public MapdustBugDetailsPanel(MapdustBug bug) { 71 72 this.bug = bug; 72 setLayout(new GridLayout( 7, 2));73 setLayout(new GridLayout(8, 2)); 73 74 addComponents(); 74 75 setBackground(Color.white); … … 99 100 100 101 /* the id */ 101 add(ComponentUtil.createJLabel("Id: ", fontLabel, null ));102 add(ComponentUtil.createJLabel("Id: ", fontLabel, null, null)); 102 103 String idStr = bug != null ? bug.getId().toString() : ""; 103 104 String txt = "<html>"; … … 114 115 115 116 /* the type */ 116 add(ComponentUtil.createJLabel("Type: ", fontLabel, null ));117 add(ComponentUtil.createJLabel("Type: ", fontLabel, null, null)); 117 118 String typeStr = bug != null ? bug.getType().getValue() : ""; 118 add(ComponentUtil.createJLabel(typeStr, fontLabelVal, null ));119 add(ComponentUtil.createJLabel(typeStr, fontLabelVal, null, null)); 119 120 120 121 /* the status */ 121 add(ComponentUtil.createJLabel("Status: ", fontLabel, null ));122 add(ComponentUtil.createJLabel("Status: ", fontLabel, null, null)); 122 123 String statusStr = bug != null ? bug.getStatus().getValue() : ""; 123 add(ComponentUtil.createJLabel(statusStr, fontLabelVal, null)); 124 add(ComponentUtil.createJLabel(statusStr, fontLabelVal, null, null)); 125 126 /* the relevance */ 127 add(ComponentUtil.createJLabel("Relevance: ", fontLabel, null, null)); 128 Color color = getRelevanceValueColor(bug); 129 String relevanceStr = bug != null ? bug.getRelevance().getName() : ""; 130 add(ComponentUtil.createJLabel(relevanceStr, fontLabel, null, color)); 124 131 125 132 /* the source */ 126 add(ComponentUtil.createJLabel("Source: ", fontLabel, null ));133 add(ComponentUtil.createJLabel("Source: ", fontLabel, null, null)); 127 134 String sourceStr = bug != null ? bug.getSource() : ""; 128 add(ComponentUtil.createJLabel(sourceStr, fontLabelVal, null ));135 add(ComponentUtil.createJLabel(sourceStr, fontLabelVal, null, null)); 129 136 130 137 /* the nickname */ 131 add(ComponentUtil.createJLabel("Created by: ", fontLabel, null ));138 add(ComponentUtil.createJLabel("Created by: ", fontLabel, null, null)); 132 139 String nicknameStr = bug != null ? bug.getNickname() : ""; 133 add(ComponentUtil.createJLabel(nicknameStr, fontLabelVal, null ));140 add(ComponentUtil.createJLabel(nicknameStr, fontLabelVal, null, null)); 134 141 135 142 /* the date created */ 136 add(ComponentUtil.createJLabel("Date created: ", fontLabel, null)); 137 String dateCreatedStr = 138 bug != null ? df.format(bug.getDateCreated()) : ""; 139 add(ComponentUtil.createJLabel(dateCreatedStr, fontLabelVal, null)); 143 add(ComponentUtil.createJLabel("Date created: ", fontLabel, null, null)); 144 String dateCreatedStr = bug != null ? df.format(bug.getDateCreated()) 145 : ""; 146 add(ComponentUtil.createJLabel(dateCreatedStr, fontLabelVal, null, 147 null)); 140 148 141 149 /* the date updated */ 142 add(ComponentUtil.createJLabel("Date updated: ", fontLabel, null)); 143 String dateUpdatedStr = 144 bug != null ? df.format(bug.getDateUpdated()) : ""; 145 add(ComponentUtil.createJLabel(dateUpdatedStr, fontLabelVal, null)); 150 add(ComponentUtil.createJLabel("Date updated: ", fontLabel, null, null)); 151 String dateUpdatedStr = bug != null ? df.format(bug.getDateUpdated()) 152 : ""; 153 add(ComponentUtil.createJLabel(dateUpdatedStr, fontLabelVal, null, 154 null)); 146 155 } 147 156 … … 151 160 String bugDetailsUrl = null; 152 161 if (bug != null) { 153 String mapdustSite = 154 Configuration.getInstance().getMapdustBugDetailsUrl(); 162 String mapdustSite = Configuration.getInstance().getMapdustBugDetailsUrl(); 155 163 bugDetailsUrl = mapdustSite + bug.getId().toString(); 156 164 } … … 161 169 String errorMessage = "Error opening the MapDust bug "; 162 170 errorMessage += "details page"; 163 JOptionPane.showMessageDialog(Main.parent, tr(errorMessage), 164 tr("Error"), JOptionPane.ERROR_MESSAGE); 171 JOptionPane.showMessageDialog(Main.parent, 172 tr(errorMessage), tr("Error"), 173 JOptionPane.ERROR_MESSAGE); 165 174 } 166 175 } … … 169 178 } 170 179 180 /** 181 * Returns a <code>Color</code> object based on the <code>MapdustBug</code> 182 * relevance level. If the <code>MapdustBug</code> is null, then the 183 * returned color will be black. 184 * 185 * @param bug The <code>MapdustBug</code> object 186 * @return The corresponding <code>Color</code> 187 */ 188 private Color getRelevanceValueColor(MapdustBug bug) { 189 Color color = Color.BLACK; 190 if (bug != null) { 191 if (bug.getRelevance().equals(MapdustRelevance.LOW)) { 192 color = Color.RED.brighter(); 193 } 194 if (bug.getRelevance().equals(MapdustRelevance.MID_LOW)) { 195 color = Color.RED.darker(); 196 } 197 if (bug.getRelevance().equals(MapdustRelevance.MEDIUM)) { 198 color = Color.ORANGE; 199 } 200 if (bug.getRelevance().equals(MapdustRelevance.MID_HIGH)) { 201 color = Color.GREEN; 202 } 203 if (bug.getRelevance().equals(MapdustRelevance.HIGH)) { 204 color = (Color.GREEN.darker()).darker(); 205 } 206 } 207 return color; 208 } 209 171 210 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustBugListPanel.java
r25656 r25828 65 65 * @version $Revision$ 66 66 */ 67 public class MapdustBugListPanel extends JPanel implements ListSelectionListener,68 MapdustBugDetailsObservable {67 public class MapdustBugListPanel extends JPanel implements 68 ListSelectionListener, MapdustBugDetailsObservable { 69 69 70 70 /** The serial version UID */ … … 140 140 /* add comment item */ 141 141 MapdustShowAction action = new ShowCommentBugAction(mapdustPlugin); 142 menuAddComment = ComponentUtil.createJMenuItem(action, "Add comment",143 " dialogs/comment.png");142 menuAddComment = ComponentUtil.createJMenuItem(action, 143 "Add comment/additional info", "dialogs/comment.png"); 144 144 menu.add(menuAddComment); 145 145 /* fix bug item */ 146 146 action = new ShowCloseBugAction(mapdustPlugin); 147 menuFixed = ComponentUtil.createJMenuItem(action, " Close bug",147 menuFixed = ComponentUtil.createJMenuItem(action, "Mark as fixed", 148 148 "dialogs/fixed.png"); 149 149 menu.add(menuFixed); … … 151 151 action = new ShowInvalidateBugAction(mapdustPlugin); 152 152 menuInvalidate = ComponentUtil.createJMenuItem(action, 153 " Invalidate bug", "dialogs/invalid.png");153 "Non-reproducible/Software bug", "dialogs/invalid.png"); 154 154 menu.add(menuInvalidate); 155 155 /* re-open bug item */ 156 156 action = new ShowReOpenBugAction(mapdustPlugin); 157 menuReopen = ComponentUtil.createJMenuItem(action, "Re -open bug",157 menuReopen = ComponentUtil.createJMenuItem(action, "Reopen bug", 158 158 "dialogs/reopen.png"); 159 159 menu.add(menuReopen); … … 197 197 cmpMapdustBugs.getViewport().setView(textJList); 198 198 } else { 199 if (mapdustBugsJList == null) { 200 mapdustBugsJList = ComponentUtil.createJList(mapdustBugsList, 201 menu); 202 mapdustBugsJList.addListSelectionListener(this); 203 DisplayMenu adapter = new DisplayMenu(mapdustBugsJList, menu); 204 mapdustBugsJList.addMouseListener(adapter); 205 } else { 206 mapdustBugsJList.setModel(new BugsListModel(mapdustBugsList)); 199 synchronized (mapdustBugsJList) { 200 if (mapdustBugsJList == null) { 201 mapdustBugsJList = ComponentUtil.createJList( 202 mapdustBugsList, menu); 203 mapdustBugsJList.addListSelectionListener(this); 204 DisplayMenu adapter = new DisplayMenu(mapdustBugsJList, 205 menu); 206 mapdustBugsJList.addMouseListener(adapter); 207 } else { 208 mapdustBugsJList.setModel(new BugsListModel(mapdustBugsList)); 209 } 210 cmpMapdustBugs.getViewport().setView(mapdustBugsJList); 207 211 } 208 cmpMapdustBugs.getViewport().setView(mapdustBugsJList); 209 } 210 } 211 212 /** 213 * 212 } 213 } 214 215 /** 216 * Listens to the <code>ListSelectionEvent</code>s and modifies the buttons 217 * and menu items depending on the status of the <code>MapdustBug</code> 218 * object. 219 * 220 * @param event The <code>ListSelectionEvent</code> object 214 221 */ 215 222 @Override 216 public void valueChanged(ListSelectionEvent event) {223 public synchronized void valueChanged(ListSelectionEvent event) { 217 224 if (!event.getValueIsAdjusting()) { 218 MapdustBug selectedBug = (MapdustBug) mapdustBugsJList.getSelectedValue(); 225 MapdustBug selectedBug = 226 (MapdustBug) mapdustBugsJList.getSelectedValue(); 219 227 if (selectedBug != null) { 220 228 Main.pref.put("selectedBug.status", selectedBug.getStatus() … … 250 258 getMenuFixed().setEnabled(false); 251 259 } 252 253 260 btnPanel.getBtnAddComment().setSelected(false); 254 261 btnPanel.getBtnReOpenBugReport().setSelected(false); … … 271 278 Main.map.mapView.repaint(); 272 279 mapdustGUI.repaint(); 280 } else { 281 return; 273 282 } 274 283 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustBugPropertiesPanel.java
r25591 r25828 48 48 49 49 /** 50 * Defines the JPanel for the <code>MapdustBug</code> object properties. 51 * The MapDust bug properties panel displays detailed information about a52 * given<code>MapdustBug</code> and it is composed by the following panels:50 * Defines the JPanel for the <code>MapdustBug</code> object properties. The 51 * MapDust bug properties panel displays detailed information about a given 52 * <code>MapdustBug</code> and it is composed by the following panels: 53 53 * <code>MapdustBugDetailsPanel</code>, <code>MapdustAddressPanel</code>, 54 54 * <code>MapdustDescriptionPanel</code>, <code>MapdustCommentsPanel</code> and … … 119 119 index = mainPanel.getSelectedIndex(); 120 120 } 121 122 121 /* create the panels */ 123 122 createPanels(selectedBug); … … 159 158 detailsPanel.updateComponents(mapdustBug); 160 159 } 161 162 160 /* address panel */ 163 161 Address address = mapdustBug != null ? mapdustBug.getAddress() : null; … … 172 170 addressPanel.updateComponents(address, coordinates); 173 171 } 174 175 172 /* description panel */ 176 String description = mapdustBug != null ? mapdustBug.getDescription() : ""; 173 String description = mapdustBug != null ? mapdustBug.getDescription() 174 : ""; 177 175 if (descriptionPanel == null) { 178 176 descriptionPanel = new MapdustDescriptionPanel(description); … … 180 178 descriptionPanel.updateComponents(description); 181 179 } 182 183 180 /* comments panel */ 184 MapdustComment[] comments = mapdustBug != null ? mapdustBug.getComments()185 : new MapdustComment[0];181 MapdustComment[] comments = mapdustBug != null ? 182 mapdustBug.getComments() : new MapdustComment[0]; 186 183 if (commentsPanel == null) { 187 184 commentsPanel = new MapdustCommentsPanel(comments); 188 185 } else { 189 commentsPanel.updateComponents(comments); 190 mainPanel.setTitleAt(3, commentsPanel.getName()); 191 } 192 186 commentsPanel.updateComponents(comments); 187 mainPanel.setTitleAt(3, commentsPanel.getName()); 188 } 193 189 /* the help panel */ 194 190 if (helpPanel == null) { 195 191 helpPanel = new MapdustHelpPanel(); 196 192 } 197 198 193 /* creates the main panel */ 199 194 if (mainPanel == null) { -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustButtonPanel.java
r25754 r25828 57 57 private static final long serialVersionUID = -4234650664854226973L; 58 58 59 /** The work off line button */59 /** The work off-line button */ 60 60 private JToggleButton btnWorkOffline; 61 61 … … 100 100 */ 101 101 private void addComponents(MapdustPlugin mapdustPlugin) { 102 /* 'Work offline' button */ 102 /* 'Work off-line' button */ 103 String text = ""; 104 String imagePath = ""; 103 105 if (btnWorkOffline == null) { 104 106 String pluginState = Main.pref.get("mapdust.pluginState"); 105 String tooltipText = "";106 String imagePath = "";107 107 if (pluginState.equals(MapdustPluginState.ONLINE.getValue())) { 108 t ooltipText = "Work offline mode";108 text = "Work offline mode"; 109 109 imagePath = "dialogs/workoffline.png"; 110 110 } else { 111 t ooltipText = "Work online mode";111 text = "Work online mode"; 112 112 imagePath = "dialogs/online.png"; 113 113 } … … 115 115 mapdustPlugin.getMapdustGUI()); 116 116 ((ExecuteWorkOffline) action).addObserver(mapdustPlugin); 117 btnWorkOffline = ComponentUtil.createJButton("Work offline", 118 tooltipText,imagePath, action);117 btnWorkOffline = ComponentUtil.createJButton("Work offline", text, 118 imagePath, action); 119 119 btnWorkOffline.setSelected(false); 120 120 btnWorkOffline.setFocusTraversalKeysEnabled(false); … … 122 122 /* 'Filter' button */ 123 123 if (btnFilter == null) { 124 text = "Filter bug reports"; 125 imagePath = "dialogs/mapdust_bug_filter.png"; 124 126 AbstractAction action = new ShowFilterBugAction(mapdustPlugin); 125 btnFilter = ComponentUtil.createJButton("Filter bug reports", 126 "Filter bug reports", "dialogs/mapdust_bug_filter.png", 127 btnFilter = ComponentUtil.createJButton(text, text, imagePath, 127 128 action); 128 129 btnFilter.setEnabled(true); … … 131 132 /* 'Add Comment' button */ 132 133 if (btnAddComment == null) { 134 text = "Add comment/additional info"; 135 imagePath = "dialogs/comment.png"; 133 136 AbstractAction action = new ShowCommentBugAction(mapdustPlugin); 134 btnAddComment = ComponentUtil.createJButton( "Comment bug report",135 "Comment bug report", "dialogs/comment.png",action);137 btnAddComment = ComponentUtil.createJButton(text, text, imagePath, 138 action); 136 139 btnAddComment.setEnabled(false); 137 140 btnAddComment.setFocusTraversalKeysEnabled(false); … … 139 142 /* 'Fix bug report' button */ 140 143 if (btnFixBugReport == null) { 144 text = "Mark as fixed"; 145 imagePath = "dialogs/fixed.png"; 141 146 AbstractAction action = new ShowCloseBugAction(mapdustPlugin); 142 btnFixBugReport = ComponentUtil.createJButton( "Close bug report",143 "Close bug report", "dialogs/fixed.png",action);147 btnFixBugReport = ComponentUtil.createJButton(text, text, imagePath, 148 action); 144 149 btnFixBugReport.setEnabled(false); 145 150 btnFixBugReport.setFocusTraversalKeysEnabled(false); … … 147 152 /* 'Invalidate bug report' button */ 148 153 if (btnInvalidateBugReport == null) { 154 text = "Non-reproducible/Software bug"; 155 imagePath = "dialogs/invalid.png"; 149 156 AbstractAction action = new ShowInvalidateBugAction(mapdustPlugin); 150 btnInvalidateBugReport = ComponentUtil.createJButton( 151 "Invalidate bug report", "Invalidate bug report", 152 "dialogs/invalid.png", action); 157 btnInvalidateBugReport = ComponentUtil.createJButton(text, text, 158 imagePath, action); 153 159 btnInvalidateBugReport.setEnabled(false); 154 160 btnInvalidateBugReport.setFocusTraversalKeysEnabled(false); … … 156 162 /* 'Re-open bug report' button */ 157 163 if (btnReOpenBugReport == null) { 164 text = "Reopen bug"; 165 imagePath = "dialogs/reopen.png"; 158 166 AbstractAction action = new ShowReOpenBugAction(mapdustPlugin); 159 btnReOpenBugReport = ComponentUtil.createJButton( 160 "Re-open bug report", "Re-open bug report", 161 "dialogs/reopen.png", action); 167 btnReOpenBugReport = ComponentUtil.createJButton(text, text, 168 imagePath, action); 162 169 btnReOpenBugReport.setEnabled(false); 163 170 btnReOpenBugReport.setFocusTraversalKeysEnabled(false); … … 165 172 /* 'Refresh' button */ 166 173 if (btnRefresh == null) { 174 text = "Refresh"; 175 imagePath = "dialogs/mapdust_refresh.png"; 167 176 String pluginState = Main.pref.get("mapdust.pluginState"); 168 177 AbstractAction action = new ExecuteRefresh(); 169 178 ((ExecuteRefresh) action).addObserver(mapdustPlugin); 170 btnRefresh = ComponentUtil.createJButton( "Refresh", "Refresh",171 "dialogs/mapdust_refresh.png",action);179 btnRefresh = ComponentUtil.createJButton(text, text, imagePath, 180 action); 172 181 if (pluginState.equals(MapdustPluginState.OFFLINE.getValue())) { 173 182 btnRefresh.setEnabled(false); … … 242 251 btnFilter.setSelected(false); 243 252 btnFilter.setFocusable(false); 244 btnRefresh.setEnabled(true); 253 String pluginState = Main.pref.get("mapdust.pluginState"); 254 if (pluginState.equals(MapdustPluginState.ONLINE.getValue())) { 255 btnRefresh.setEnabled(true); 256 } else { 257 btnRefresh.setEnabled(false); 258 } 259 245 260 btnRefresh.setSelected(false); 246 261 btnRefresh.setFocusable(false); … … 258 273 btnReOpenBugReport.setEnabled(false); 259 274 btnReOpenBugReport.setEnabled(false); 260 261 } 262 } 263 264 /** 265 * Returns the work offline button 275 } 276 } 277 278 /** 279 * Returns the work off-line button 266 280 * 267 281 * @return the btnWorkOffline -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/util/ComponentUtil.java
r25591 r25828 76 76 * @param font The font of the label 77 77 * @param bounds The bounds of the element 78 * @param color The color of the element 78 79 * @return A <code>JLabel</code> object 79 80 */ 80 public static JLabel createJLabel(String text, Font font, Rectangle bounds) { 81 public static JLabel createJLabel(String text, Font font, Rectangle bounds, 82 Color color) { 81 83 JLabel jLabel = new JLabel(); 82 84 if (bounds != null) { … … 85 87 jLabel.setText(text); 86 88 jLabel.setFont(font); 89 if (color != null) { 90 jLabel.setForeground(color); 91 } 92 jLabel.setVerticalTextPosition(SwingConstants.TOP); 87 93 return jLabel; 88 94 } 95 89 96 90 97 /** -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/MapdustConnector.java
r25591 r25828 122 122 handleStatusCode(httpResponse); 123 123 result = (MapdustGetBugsResponse) getParser().parseResponse( 124 httpResponse.getContent(), 125 MapdustGetBugsResponse.class); 124 httpResponse.getContent(),MapdustGetBugsResponse.class); 126 125 } catch (MapdustConnectorException e) { 127 126 throw new MapdustConnectorException(e.getMessage(), e); … … 333 332 urlString += "&idd=" + "0"; 334 333 } 334 if (filter.getMinRelevance() != null) { 335 int min=filter.getMinRelevance().getRange().getLowerValue(); 336 urlString += "&minr=" + min; 337 } 338 if (filter.getMaxRelevance() != null) { 339 int max= filter.getMaxRelevance().getRange().getUpperValue(); 340 urlString += "&maxr=" + max; 341 } 335 342 } 336 343 } … … 521 528 private void handleStatusCode(HttpResponse httpResponse) 522 529 throws MapdustConnectorException { 523 String error Message= "";530 String error = ""; 524 531 Integer statusCode = httpResponse.getStatusCode(); 525 532 String statusMessage = httpResponse.getStatusMessage(); … … 535 542 switch (statusCode) { 536 543 case 400: 537 error Message= statusMessage + " ";538 error Message+= MapdustResponseStatusCode.Status400.getDescription();539 throw new MapdustConnectorException(error Message);544 error = statusMessage + " "; 545 error += MapdustResponseStatusCode.Status400.getDescription(); 546 throw new MapdustConnectorException(error); 540 547 case 401: 541 error Message= statusMessage + " ";542 error Message+= MapdustResponseStatusCode.Status401.getDescription();543 throw new MapdustConnectorException(error Message);548 error = statusMessage + " "; 549 error += MapdustResponseStatusCode.Status401.getDescription(); 550 throw new MapdustConnectorException(error); 544 551 case 403: 545 error Message= statusMessage + " ";546 error Message+= MapdustResponseStatusCode.Status403.getDescription();547 throw new MapdustConnectorException(error Message);552 error = statusMessage + " "; 553 error += MapdustResponseStatusCode.Status403.getDescription(); 554 throw new MapdustConnectorException(error); 548 555 case 404: 549 error Message= statusMessage + " ";550 error Message+= MapdustResponseStatusCode.Status404.getDescription();551 throw new MapdustConnectorException(error Message);556 error = statusMessage + " "; 557 error += MapdustResponseStatusCode.Status404.getDescription(); 558 throw new MapdustConnectorException(error); 552 559 case 405: 553 error Message= statusMessage + " ";554 error Message+= MapdustResponseStatusCode.Status405.getDescription();555 throw new MapdustConnectorException(error Message);560 error = statusMessage + " "; 561 error += MapdustResponseStatusCode.Status405.getDescription(); 562 throw new MapdustConnectorException(error); 556 563 case 500: 557 error Message= statusMessage + " ";558 error Message+= MapdustResponseStatusCode.Status500.getDescription();559 throw new MapdustConnectorException(error Message);564 error = statusMessage + " "; 565 error += MapdustResponseStatusCode.Status500.getDescription(); 566 throw new MapdustConnectorException(error); 560 567 case 601: 561 error Message= statusMessage + " ";562 error Message+= MapdustResponseStatusCode.Status601.getDescription();563 throw new MapdustConnectorException(error Message);568 error = statusMessage + " "; 569 error += MapdustResponseStatusCode.Status601.getDescription(); 570 throw new MapdustConnectorException(error); 564 571 case 602: 565 error Message= statusMessage + " ";566 error Message+= MapdustResponseStatusCode.Status602.getDescription();567 throw new MapdustConnectorException(error Message);572 error = statusMessage + " "; 573 error += MapdustResponseStatusCode.Status602.getDescription(); 574 throw new MapdustConnectorException(error); 568 575 default: 569 576 throw new MapdustConnectorException( -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/MapdustBugProperties.java
r25591 r25828 53 53 private String type; 54 54 55 /** The relevance value */ 56 private Integer relevance; 57 55 58 /** The description of the bug */ 56 59 private String description; … … 95 98 * @param status The status of the bug 96 99 * @param type The type of the bug 100 * @param relevance The relevance of the bug 97 101 * @param description The description of the bug 98 102 * @param isDefaultDescription Flag indicating if the description is default … … 108 112 */ 109 113 public MapdustBugProperties(Date dateCreated, Date dateUpdated, 110 Integer status, String type, String description,114 Integer status, String type, Integer relevance, String description, 111 115 boolean isDefaultDescription, String nickname, String skoUid, 112 116 String extUid, String source, String kmlUrl, Address address, … … 116 120 this.status = status; 117 121 this.type = type; 122 this.relevance = relevance; 118 123 this.description = description; 119 124 this.isDefaultDescription = isDefaultDescription; … … 201 206 202 207 /** 208 * Returns the relevance 209 * 210 * @return the relevance 211 */ 212 public Integer getRelevance() { 213 return relevance; 214 } 215 216 /** 217 * Sets the relevance 218 * 219 * @param relevance the relevance to set 220 */ 221 public void setRelevance(Integer relevance) { 222 this.relevance = relevance; 223 } 224 225 /** 226 * @param isDefaultDescription the isDefaultDescription to set 227 */ 228 public void setDefaultDescription(boolean isDefaultDescription) { 229 this.isDefaultDescription = isDefaultDescription; 230 } 231 232 /** 203 233 * Returns the description 204 234 * -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/converter/MapdustConverter.java
r25591 r25828 40 40 import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug; 41 41 import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustComment; 42 import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustRelevance; 42 43 import org.openstreetmap.josm.plugins.mapdust.service.value.Status; 43 44 import org.openstreetmap.josm.plugins.mapdust.service.value.Type; … … 86 87 Type type = Type.getType(bugProperties.getType()); 87 88 bug.setType(type); 89 /* sets the relevance */ 90 MapdustRelevance relevance = 91 MapdustRelevance.getMapdustRelevance(bugProperties 92 .getRelevance()); 93 bug.setRelevance(relevance); 88 94 /* sets the creation date */ 89 95 bug.setDateCreated(bugProperties.getDateCreated()); … … 173 179 Type type = Type.getType(bugProperties.getType()); 174 180 bug.setType(type); 181 /* sets the relevance */ 182 MapdustRelevance relevance = 183 MapdustRelevance.getMapdustRelevance(bugProperties 184 .getRelevance()); 185 bug.setRelevance(relevance); 175 186 /* sets the creation date */ 176 187 bug.setDateCreated(bugProperties.getDateCreated()); -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/value/MapdustBug.java
r25591 r25828 62 62 private Type type; 63 63 64 /** The relevance of the object */ 65 private MapdustRelevance relevance; 66 64 67 /** The description of the bug */ 65 68 private String description; … … 92 95 * Builds a <code>MapdustBug</code> object. 93 96 */ 94 public MapdustBug() { 95 96 } 97 public MapdustBug() {} 97 98 98 99 /** … … 122 123 * @param status The status of the bug 123 124 * @param type The type of the bug 125 * @param relevance The relevance of the bug 124 126 * @param description The description of the bug 125 127 * @param isDefaultDescription Flag indicating if the description is default … … 135 137 public MapdustBug(Long id, LatLon latLon, Address address, 136 138 Date dateCreated, Date dateUpdated, Status status, Type type, 137 String description, boolean isDefaultDescription, String nickname, 138 String skoUid, String extUid, String source, String kmlUrl, 139 MapdustRelevance relevance, String description, 140 boolean isDefaultDescription, String nickname, String skoUid, 141 String extUid, String source, String kmlUrl, 139 142 Integer numberOfComments, MapdustComment[] comments) { 140 143 this.id = id; … … 145 148 this.status = status; 146 149 this.type = type; 150 this.relevance = relevance; 147 151 this.description = description; 148 152 this.isDefaultDescription = isDefaultDescription; … … 265 269 266 270 /** 271 * Returns the relevance 272 * 273 * @return the relevance 274 */ 275 public MapdustRelevance getRelevance() { 276 return relevance; 277 } 278 279 /** 280 * Sets the relevance 281 * 282 * @param relevance the relevance to set 283 */ 284 public void setRelevance(MapdustRelevance relevance) { 285 this.relevance = relevance; 286 } 287 288 /** 267 289 * Returns the description 268 290 * … … 443 465 } 444 466 445 /* (non-Javadoc) 467 /* 468 * (non-Javadoc) 469 * 446 470 * @see java.lang.Object#hashCode() 447 471 */ … … 454 478 } 455 479 456 /* (non-Javadoc) 480 /* 481 * (non-Javadoc) 482 * 457 483 * @see java.lang.Object#equals(java.lang.Object) 458 484 */ … … 474 500 } 475 501 476 477 502 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/value/MapdustBugFilter.java
r25591 r25828 53 53 private Boolean descr; 54 54 55 /** The minimum relevance */ 56 private MapdustRelevance minRelevance; 57 58 /** The maximum relevance */ 59 private MapdustRelevance maxRelevance; 60 55 61 /** 56 62 * Build a <code>MapdustBugFilter</code> object … … 65 71 * @param types The list of type filter values 66 72 * @param descr The description filter value 73 * @param minRelevance The minimum relevance 74 * @param maxRelevance The maximum relevance 67 75 */ 68 76 public MapdustBugFilter(List<Integer> statuses, List<String> types, 69 Boolean descr) { 77 Boolean descr, MapdustRelevance minRelevance, 78 MapdustRelevance maxRelevance) { 70 79 this.statuses = statuses; 71 80 this.types = types; 72 81 this.descr = descr; 82 this.minRelevance = minRelevance; 83 this.maxRelevance = maxRelevance; 73 84 } 74 85 … … 127 138 } 128 139 140 /** 141 * Returns the minimum relevance 142 * 143 * @return the minRelevance 144 */ 145 public MapdustRelevance getMinRelevance() { 146 return minRelevance; 147 } 148 149 /** 150 * Sets the minimum relevance 151 * 152 * @param minRelevance the minRelevance to set 153 */ 154 public void setMinRelevance(MapdustRelevance minRelevance) { 155 this.minRelevance = minRelevance; 156 } 157 158 /** 159 * Returns the maximum relevance 160 * 161 * @return the maxRelevance 162 */ 163 public MapdustRelevance getMaxRelevance() { 164 return maxRelevance; 165 } 166 167 /** 168 * Sets the maximum relevance 169 * 170 * @param maxRelevance the maxRelevance to set 171 */ 172 public void setMaxRelevance(MapdustRelevance maxRelevance) { 173 this.maxRelevance = maxRelevance; 174 } 175 129 176 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/value/Type.java
r25591 r25828 87 87 /** The blocked street <code>Type</code> */ 88 88 public static final Type BLOCKED_STREET = new Type("blocked_street", 89 "Blocked stree et");89 "Blocked street"); 90 90 91 91 /** The missing street <code>Type</code> */
Note:
See TracChangeset
for help on using the changeset viewer.