Changeset 34309 in osm for applications/editors/josm/plugins/indoorhelper/src/controller
- Timestamp:
- 2018-06-17T17:51:18+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/indoorhelper/src/controller/IndoorHelperController.java
r34179 r34309 57 57 58 58 import model.IndoorHelperModel; 59 import model.IndoorLevel; 59 60 import model.TagCatalog.IndoorObject; 60 61 import views.LevelSelectorView; … … 264 265 static class ToolHelpButtonListener implements ActionListener { 265 266 266 267 268 269 270 271 267 @Override 268 public void actionPerformed(ActionEvent e) { 269 String topic = "Plugin/IndoorHelper"; 270 //Open HelpBrowser for short description about the plugin 271 HelpBrowser.setUrlForHelpTopic(Optional.ofNullable(topic).orElse("/")); 272 } 272 273 } 273 274 … … 565 566 * specific tag (key). Just unsets the disabled state if object has a tag-value which is part of the 566 567 * current working level. 567 * 568 * 568 569 * @author rebsc 569 570 * @param key sepcific key to unset hidden objects which contains it … … 572 573 573 574 Collection<OsmPrimitive> p = Main.main.getEditDataSet().allPrimitives(); 574 Map<String, String> tags = new HashMap<>(); 575 Integer level = Integer.parseInt(levelValue); 576 Integer firstVal, secVal; 575 int level = Integer.parseInt(levelValue); 577 576 578 577 //Find all primitives with the specific tag and check if value is part of the current … … 580 579 for (OsmPrimitive osm: p) { 581 580 if ((osm.isDisabledAndHidden() || osm.isDisabled()) && osm.hasKey(key)) { 582 583 tags = osm.getInterestingTags(); 584 585 for (Map.Entry<String, String> e: tags.entrySet()) { 581 for (Map.Entry<String, String> e: osm.getInterestingTags().entrySet()) { 586 582 if (e.getKey().equals(key)) { 587 String val = e.getValue();588 589 //Extract values590 if (val.indexOf("-") == 0) {591 firstVal = (Integer.parseInt(val.split("-", 2)[1].split("-", 2)[0]))*-1;592 secVal = Integer.parseInt(val.split("-", 2)[1].split("-", 2)[1]);593 } else {594 firstVal = Integer.parseInt(val.split("-")[0]);595 secVal = Integer.parseInt(val.split("-")[1]);596 }597 598 583 //Compare values to current working level 599 if ( level >= ((firstVal)-1) && level <= secVal) {584 if (IndoorLevel.isPartOfWorkingLevel(e.getValue(), level)) { 600 585 osm.unsetDisabledState(); 601 586 } else {
Note:
See TracChangeset
for help on using the changeset viewer.