Changeset 35260 in osm for applications/editors
- Timestamp:
- 2019-12-26T15:00:45+01:00 (5 years ago)
- Location:
- applications/editors/josm/plugins/roadsigns
- Files:
-
- 430 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/ParametrizedString.java
r32673 r35260 9 9 import org.openstreetmap.josm.plugins.roadsigns.javacc.ParseException; 10 10 import org.openstreetmap.josm.plugins.roadsigns.javacc.TokenMgrError; 11 import org.openstreetmap.josm.tools.Logging; 11 12 12 13 /** … … 76 77 List<StringOrParameter> tmp = null; 77 78 tmp = ParamStringScanner.parseIt(input); 78 StringBu ffer curString = new StringBuffer();79 StringBuilder curString = new StringBuilder(); 79 80 for (StringOrParameter sp : tmp) { 80 81 if (sp instanceof Prm) { 81 82 if (curString.length() > 0) { 82 83 token.add(new Str(curString.toString())); 83 curString = new StringBu ffer();84 curString = new StringBuilder(); 84 85 } 85 86 token.add(sp); … … 105 106 String val = env.get(((Prm) t).ident); 106 107 if (val == null) { 107 System.err.println("Warning:Parameter not in environment: "+((Prm) t).ident+" ("+this.toString()+")");108 Logging.warn("Parameter not in environment: "+((Prm) t).ident+" ("+this.toString()+")"); 108 109 Thread.dumpStack(); 109 110 val = "<?>"; -
applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/RoadSignInputDialog.java
r34553 r35260 11 11 import java.awt.Rectangle; 12 12 import java.awt.event.ActionEvent; 13 import java.awt.event.ActionListener;14 13 import java.awt.event.MouseAdapter; 15 14 import java.awt.event.MouseEvent; … … 59 58 import javax.swing.event.DocumentListener; 60 59 import javax.swing.event.HyperlinkEvent; 61 import javax.swing.event.HyperlinkListener;62 60 import javax.swing.table.AbstractTableModel; 63 61 … … 119 117 this.signs = RoadSignsPlugin.signs; 120 118 sel = new SignSelection(); 121 setButtonIcons( new String[] {"ok.png", "cancel.png"});119 setButtonIcons("ok.png", "cancel.png"); 122 120 final JTabbedPane tabs = new JTabbedPane(); 123 121 tabs.add(tr("signs"), buildSignsPanel()); … … 247 245 info.setText(" "); 248 246 info.setBackground(this.getBackground()); 249 info.addHyperlinkListener(new HyperlinkListener() { 250 @Override 251 public void hyperlinkUpdate(HyperlinkEvent e) { 252 if (e == null || e.getURL() == null) 253 return; 254 if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { 255 OpenBrowser.displayUrl(e.getURL().toString()); 256 } 247 info.addHyperlinkListener(e -> { 248 if (e == null || e.getURL() == null) 249 return; 250 if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { 251 OpenBrowser.displayUrl(e.getURL().toString()); 257 252 } 258 253 }); … … 594 589 addTrafficSignTag = new JCheckBox(tr("{0} tag", "traffic_sign")); 595 590 addTrafficSignTag.setSelected(Config.getPref().getBoolean("plugin.roadsigns.addTrafficSignTag")); 596 addTrafficSignTag.addActionListener(new ActionListener() { 597 @Override 598 public void actionPerformed(ActionEvent e) { 599 previewModel.update(); 600 } 601 }); 591 addTrafficSignTag.addActionListener(e -> previewModel.update()); 602 592 603 593 previewPanel.add(scroll, GBC.eol().fill()); … … 720 710 TagEvaluater te = tags.get(t.tag_ref); 721 711 if (te == null) { 722 System.err.println(String.format("warning:referenced tag with ident '%s' not found for appending tag %s.",712 Logging.warn(String.format("referenced tag with ident '%s' not found for appending tag %s.", 723 713 t.tag_ref, t.toString())); 724 714 } else { … … 728 718 TagEvaluater te = tags.get(t.tag_ref); 729 719 if (te == null) { 730 System.err.println(String.format("warning:referenced tag with ident '%s' not found for condition tag %s.",720 Logging.warn(String.format("referenced tag with ident '%s' not found for condition tag %s.", 731 721 t.tag_ref, t.toString())); 732 722 } else { … … 734 724 } 735 725 } else { 736 System.err.println(String.format("warning:found tag_ref but neither append_value nor condition for tag %s.",726 Logging.warn(String.format("found tag_ref but neither append_value nor condition for tag %s.", 737 727 t.toString())); 738 728 } … … 742 732 743 733 if (tags.get(t.ident) != null) { 744 System.err.println(String.format("warning:tag identifier %s for %s already in use. ", t.ident, t.toString()));734 Logging.warn(String.format("tag identifier %s for %s already in use. ", t.ident, t.toString())); 745 735 } 746 736 tags.put(t.ident, new TagEvaluater(t)); … … 793 783 info.setText(longText()); 794 784 /* scroll up again */ 795 SwingUtilities.invokeLater(new Runnable() { 796 @Override 797 public void run() { 798 scrollInfo.getVerticalScrollBar().setValue(0); 799 } 800 }); 785 SwingUtilities.invokeLater(() -> scrollInfo.getVerticalScrollBar().setValue(0)); 801 786 sel.add(sign); 802 787 } -
applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/RoadSignsPlugin.java
r34553 r35260 35 35 import org.openstreetmap.josm.plugins.roadsigns.RoadSignInputDialog.SettingsPanel; 36 36 import org.openstreetmap.josm.spi.preferences.Config; 37 import org.openstreetmap.josm.tools.Logging; 37 38 import org.openstreetmap.josm.tools.Shortcut; 38 39 import org.openstreetmap.josm.tools.Utils; … … 48 49 public static final PresetMetaData PRESET_BE = new PresetMetaData( 49 50 "BE", tr("Belgium"), "resource://data/roadsignpresetBE.xml", "resource://images/BE/"); 51 public static final PresetMetaData PRESET_CZ = new PresetMetaData( 52 "CZ", tr("Czech Republic"), "resource://data/roadsignpresetCZ.xml", "resource://images/CZ/"); 50 53 public static final PresetMetaData PRESET_ES = new PresetMetaData( 51 54 "ES", tr("Spain"), "resource://data/roadsignpresetES.xml", "resource://images/ES/"); … … 56 59 public static final PresetMetaData PRESET_SK = new PresetMetaData( 57 60 "SK", tr("Slovakia"), "resource://data/roadsignpresetSK.xml", "resource://images/SK/"); 58 public static final Collection<PresetMetaData> DEFAULT_PRESETS = Arrays.asList(PRESET_BE, PRESET_ES, PRESET_DE, PRESET_PL, PRESET_SK); 61 public static final Collection<PresetMetaData> DEFAULT_PRESETS = Arrays.asList( 62 PRESET_BE, PRESET_CZ, PRESET_ES, PRESET_DE, PRESET_PL, PRESET_SK); 59 63 60 64 public RoadSignsPlugin(PluginInformation info) { … … 93 97 String code = Config.getPref().get("plugin.roadsigns.preset.selection", null); 94 98 if (code == null) { 95 ExtendedDialog ed = new ExtendedDialog(MainApplication.getMainFrame(), tr("Settings"), new String[] {tr("Ok"), tr("Cancel")});96 ed.setButtonIcons( new String[] {"ok", "cancel"});99 ExtendedDialog ed = new ExtendedDialog(MainApplication.getMainFrame(), tr("Settings"), tr("Ok"), tr("Cancel")); 100 ed.setButtonIcons("ok", "cancel"); 97 101 SettingsPanel settings = new SettingsPanel(true, null); 98 102 ed.setContent(settings); … … 195 199 customIconDirs.add("resource://images/"); 196 200 } 197 PresetMetaData custom = new PresetMetaData("custom", tr("custom"), customFile, Utils.join(",", customIconDirs)); 198 presetsData.add(custom); 201 presetsData.add(new PresetMetaData("custom", tr("custom"), customFile, Utils.join(",", customIconDirs))); 199 202 } else { 200 203 Config.getPref().put("plugin.roadsigns.sources.last", null); … … 230 233 231 234 } catch (IOException ex) { 232 ex.printStackTrace();235 Logging.error(ex); 233 236 JOptionPane.showMessageDialog( 234 237 MainApplication.getMainFrame(), … … 239 242 throw ex; 240 243 } catch (SAXException ex) { 241 ex.printStackTrace();244 Logging.error(ex); 242 245 JOptionPane.showMessageDialog( 243 246 MainApplication.getMainFrame(),
Note:
See TracChangeset
for help on using the changeset viewer.