Changeset 33714 in osm for applications/editors/josm
- Timestamp:
- 2017-10-09T00:27:00+02:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/HouseNumberTaggingTool
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/HouseNumberTaggingTool
- Property svn:ignore
-
old new 4 4 REVISION.XML 5 5 findbugs-josm-HouseNumberTaggingTool.xml 6 spotbugs-josm-HouseNumberTaggingTool.xml
-
- Property svn:ignore
-
applications/editors/josm/plugins/HouseNumberTaggingTool/build.xml
r32680 r33714 4 4 <property name="commit.message" value="Initial version."/> 5 5 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 6 <property name="plugin.main.version" value="1 0580"/>6 <property name="plugin.main.version" value="12859"/> 7 7 <!-- Configure these properties (replace "..." accordingly). 8 8 See https://josm.openstreetmap.de/wiki/DevelopersGuide/DevelopingPlugins -
applications/editors/josm/plugins/HouseNumberTaggingTool/src/org/openstreetmap/josm/plugins/housenumbertool/HouseNumberTaggingToolPlugin.java
r30775 r33714 1 1 package org.openstreetmap.josm.plugins.housenumbertool; 2 2 3 import org.openstreetmap.josm. Main;3 import org.openstreetmap.josm.gui.MainApplication; 4 4 import org.openstreetmap.josm.gui.MainMenu; 5 5 import org.openstreetmap.josm.plugins.Plugin; … … 19 19 super(info); 20 20 action = new LaunchAction(getPluginDir()); 21 MainMenu.add(Main .main.menu.dataMenu, action, false,0);21 MainMenu.add(MainApplication.getMenu().dataMenu, action, false,0); 22 22 } 23 23 } -
applications/editors/josm/plugins/HouseNumberTaggingTool/src/org/openstreetmap/josm/plugins/housenumbertool/LaunchAction.java
r30775 r33714 16 16 17 17 private String pluginDir; 18 18 19 /** 20 * Constructs a new {@code LaunchAction}. 21 * @param pluginDir plugin directory 22 */ 19 23 public LaunchAction(String pluginDir) { 20 24 super("HouseNumberTaggingTool", -
applications/editors/josm/plugins/HouseNumberTaggingTool/src/org/openstreetmap/josm/plugins/housenumbertool/TagDialog.java
r32446 r33714 39 39 import org.openstreetmap.josm.command.SequenceCommand; 40 40 import org.openstreetmap.josm.data.osm.OsmPrimitive; 41 import org.openstreetmap.josm.data.tagging.ac.AutoCompletionItem; 41 42 import org.openstreetmap.josm.gui.ExtendedDialog; 43 import org.openstreetmap.josm.gui.MainApplication; 42 44 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingComboBox; 43 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionListItem;44 45 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager; 45 46 … … 96 97 private JRadioButton placeRadio; 97 98 99 /** 100 * Constructs a new {@code TagDialog}. 101 * @param pluginDir plugin directory 102 * @param selection selected primitive 103 */ 98 104 public TagDialog(String pluginDir, OsmPrimitive selection) { 99 105 super(Main.parent, tr("House Number Editor"), new String[] { tr("OK"), tr("Cancel") }, true); … … 104 110 105 111 setContent(editPanel); 106 setButtonIcons( new String[] { "ok.png", "cancel.png" });112 setButtonIcons("ok", "cancel"); 107 113 setDefaultButton(1); 108 114 setupDialog(); … … 112 118 setLocationRelativeTo(null); 113 119 114 SwingUtilities.invokeLater(new Runnable() { 115 @Override 116 public void run() { 117 housnumber.requestFocus(); 118 housnumber.selectAll(); 119 } 120 SwingUtilities.invokeLater(() -> { 121 housnumber.requestFocus(); 122 housnumber.selectAll(); 120 123 }); 121 124 } 122 125 123 126 private JPanel createContentPane() { 124 acm = selection.getDataSet() .getAutoCompletionManager();127 acm = AutoCompletionManager.of(selection.getDataSet()); 125 128 126 129 Dto dto = loadDto(); … … 164 167 165 168 country = new AutoCompletingComboBox(); 166 country.setPossibleA CItems(acm.getValues(TAG_ADDR_COUNTRY));169 country.setPossibleAcItems(acm.getTagValues(TAG_ADDR_COUNTRY)); 167 170 country.setPreferredSize(new Dimension(200, 24)); 168 171 country.setEditable(true); … … 189 192 190 193 state = new AutoCompletingComboBox(); 191 state.setPossibleA CItems(acm.getValues(TAG_ADDR_STATE));194 state.setPossibleAcItems(acm.getTagValues(TAG_ADDR_STATE)); 192 195 state.setPreferredSize(new Dimension(200, 24)); 193 196 state.setEditable(true); … … 213 216 214 217 city = new AutoCompletingComboBox(); 215 city.setPossibleA CItems(acm.getValues(TAG_ADDR_CITY));218 city.setPossibleAcItems(acm.getTagValues(TAG_ADDR_CITY)); 216 219 city.setPreferredSize(new Dimension(200, 24)); 217 220 city.setEditable(true); … … 237 240 238 241 postcode = new AutoCompletingComboBox(); 239 postcode.setPossibleA CItems(acm.getValues(TAG_ADDR_POSTCODE));242 postcode.setPossibleAcItems(acm.getTagValues(TAG_ADDR_POSTCODE)); 240 243 postcode.setPreferredSize(new Dimension(200, 24)); 241 244 postcode.setEditable(true); … … 290 293 street.setPossibleItems(getPossibleStreets()); 291 294 } else { 292 street.setPossibleA CItems(acm.getValues(TAG_ADDR_PLACE));295 street.setPossibleAcItems(acm.getTagValues(TAG_ADDR_PLACE)); 293 296 } 294 297 street.setPreferredSize(new Dimension(200, 24)); … … 391 394 return (String) item; 392 395 } 393 if (item instanceof AutoCompletion ListItem) {394 return ((AutoCompletion ListItem) item).getValue();396 if (item instanceof AutoCompletionItem) { 397 return ((AutoCompletionItem) item).getValue(); 395 398 } 396 399 return item.toString(); … … 512 515 */ 513 516 Set<String> names = new TreeSet<>(); 514 for (OsmPrimitive osm : Main.getLayerManager().getEditDataSet().allNonDeletedPrimitives()) { 517 for (OsmPrimitive osm : MainApplication.getLayerManager().getEditDataSet().allNonDeletedPrimitives()) { 515 518 if (osm.getKeys() != null && osm.keySet().contains("highway") && osm.keySet().contains("name")) { 516 519 names.add(osm.get("name")); … … 554 557 street.setPossibleItems(getPossibleStreets()); 555 558 } else { 556 street.setPossibleA CItems(acm.getValues(TAG_ADDR_PLACE));559 street.setPossibleAcItems(acm.getTagValues(TAG_ADDR_PLACE)); 557 560 } 558 561 }
Note:
See TracChangeset
for help on using the changeset viewer.