Changeset 3639 in osm for applications/editors/josm/plugins
- Timestamp:
- 2007-07-20T17:22:15+02:00 (17 years ago)
- Location:
- applications/editors/josm/plugins
- Files:
-
- 4 deleted
- 2 edited
- 10 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/AnnotationPresetAction.java
r3348 r3639 9 9 10 10 import org.openstreetmap.josm.data.coor.LatLon; 11 import org.openstreetmap.josm.gui. annotation.AnnotationPreset;12 import org.openstreetmap.josm.gui.preferences. AnnotationPresetPreference;11 import org.openstreetmap.josm.gui.tagging.TaggingPreset; 12 import org.openstreetmap.josm.gui.preferences.TaggingPresetPreference; 13 13 14 14 import at.dallermassl.josm.plugin.surveyor.GpsActionEvent; … … 21 21 public class AnnotationPresetAction implements SurveyorAction { 22 22 private String presetName; 23 private AnnotationPreset preset;23 private TaggingPreset preset; 24 24 25 25 … … 58 58 } 59 59 presetName = parameters.get(0); 60 preset = get AnnotationPreset(presetName);60 preset = getTaggingPreset(presetName); 61 61 if(preset == null) { 62 62 System.err.println("No valid preset '" + parameters.get(0) + "' found - disable action!"); … … 70 70 * @return the preset with the given name. 71 71 */ 72 protected AnnotationPreset getAnnotationPreset(String name) {73 for( AnnotationPreset preset : AnnotationPresetPreference.annotationPresets) {72 protected TaggingPreset getTaggingPreset(String name) { 73 for(TaggingPreset preset : TaggingPresetPreference.taggingPresets) { 74 74 if(name.equals(preset.getValue(Action.NAME))) { 75 75 return preset; -
applications/editors/josm/plugins/tagging-preset-tester/.project
r3638 r3639 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <projectDescription> 3 <name> annotation-tester</name>3 <name>tagging-preset-tester</name> 4 4 <comment></comment> 5 5 <projects> -
applications/editors/josm/plugins/tagging-preset-tester/src/org/openstreetmap/josm/plugins/taggingpresettester/MANIFEST.MF
r3638 r3639 1 1 Manifest-Version: 1.0 2 Main-Class: org.openstreetmap.josm.plugins. annotationtester.AnnotationTester3 Plugin-Class: org.openstreetmap.josm.plugins. annotationtester.AnnotationTesterAction4 Plugin-Description: Make the AnnotationPreset Tester tool available in5 the help menu.2 Main-Class: org.openstreetmap.josm.plugins.taggingpresettester.TaggingPresetTester 3 Plugin-Class: org.openstreetmap.josm.plugins.taggingpresettester.TaggingPresetTesterAction 4 Plugin-Description: Make the Tagging Preset Tester tool available in 5 the help menu. -
applications/editors/josm/plugins/tagging-preset-tester/src/org/openstreetmap/josm/plugins/taggingpresettester/TaggingPresetTester.java
r3542 r3639 1 package org.openstreetmap.josm.plugins. annotationtester;1 package org.openstreetmap.josm.plugins.taggingpresettester; 2 2 3 3 import java.awt.BorderLayout; … … 19 19 import javax.swing.JPanel; 20 20 21 import org.openstreetmap.josm.gui. annotation.AnnotationCellRenderer;22 import org.openstreetmap.josm.gui. annotation.AnnotationPreset;21 import org.openstreetmap.josm.gui.tagging.TaggingCellRenderer; 22 import org.openstreetmap.josm.gui.tagging.TaggingPreset; 23 23 import org.xml.sax.SAXException; 24 24 25 public class AnnotationTester extends JFrame {25 public class TaggingPresetTester extends JFrame { 26 26 27 private JComboBox annotationPresets;27 private JComboBox taggingPresets; 28 28 private final String[] args; 29 private JPanel annotationPanel = new JPanel(new BorderLayout());29 private JPanel taggingPresetPanel = new JPanel(new BorderLayout()); 30 30 private JPanel panel = new JPanel(new BorderLayout()); 31 31 32 32 public void reload() { 33 Vector< AnnotationPreset> allPresets = new Vector<AnnotationPreset>();33 Vector<TaggingPreset> allPresets = new Vector<TaggingPreset>(); 34 34 for (String source : args) { 35 35 InputStream in = null; … … 38 38 in = new URL(source).openStream(); 39 39 else if (source.startsWith("resource://")) 40 in = AnnotationTester.class.getResourceAsStream(source.substring("resource:/".length()));40 in = TaggingPresetTester.class.getResourceAsStream(source.substring("resource:/".length())); 41 41 else 42 42 in = new FileInputStream(source); 43 allPresets.addAll( AnnotationPreset.readAll(in));43 allPresets.addAll(TaggingPreset.readAll(in)); 44 44 } catch (IOException e) { 45 45 e.printStackTrace(); 46 JOptionPane.showMessageDialog(null, "Could not read annotationpreset source: "+source);46 JOptionPane.showMessageDialog(null, "Could not read tagging preset source: "+source); 47 47 } catch (SAXException e) { 48 48 e.printStackTrace(); … … 56 56 } 57 57 } 58 annotationPresets.setModel(new DefaultComboBoxModel(allPresets));58 taggingPresets.setModel(new DefaultComboBoxModel(allPresets)); 59 59 } 60 60 61 61 public void reselect() { 62 annotationPanel.removeAll();63 AnnotationPreset preset = (AnnotationPreset)annotationPresets.getSelectedItem();62 taggingPresetPanel.removeAll(); 63 TaggingPreset preset = (TaggingPreset)taggingPresets.getSelectedItem(); 64 64 if (preset == null) 65 65 return; … … 67 67 p.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); 68 68 if (p != null) 69 annotationPanel.add(p, BorderLayout.NORTH);69 taggingPresetPanel.add(p, BorderLayout.NORTH); 70 70 panel.validate(); 71 71 panel.repaint(); 72 72 } 73 73 74 public AnnotationTester(String[] args) {75 super(" AnnotationPreset Tester");74 public TaggingPresetTester(String[] args) { 75 super("Tagging Preset Tester"); 76 76 this.args = args; 77 annotationPresets = new JComboBox();78 annotationPresets.setRenderer(new AnnotationCellRenderer());77 taggingPresets = new JComboBox(); 78 taggingPresets.setRenderer(new TaggingCellRenderer()); 79 79 reload(); 80 80 81 panel.add( annotationPresets, BorderLayout.NORTH);82 panel.add( annotationPanel, BorderLayout.CENTER);83 annotationPresets.addActionListener(new ActionListener(){81 panel.add(taggingPresets, BorderLayout.NORTH); 82 panel.add(taggingPresetPanel, BorderLayout.CENTER); 83 taggingPresets.addActionListener(new ActionListener(){ 84 84 public void actionPerformed(ActionEvent e) { 85 85 reselect(); … … 91 91 b.addActionListener(new ActionListener(){ 92 92 public void actionPerformed(ActionEvent e) { 93 int i = annotationPresets.getSelectedIndex();93 int i = taggingPresets.getSelectedIndex(); 94 94 reload(); 95 annotationPresets.setSelectedIndex(i);95 taggingPresets.setSelectedIndex(i); 96 96 } 97 97 }); … … 110 110 args = new String[]{c.getSelectedFile().getPath()}; 111 111 } 112 JFrame f = new AnnotationTester(args);112 JFrame f = new TaggingPresetTester(args); 113 113 f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 114 114 } -
applications/editors/josm/plugins/tagging-preset-tester/src/org/openstreetmap/josm/plugins/taggingpresettester/TaggingPresetTesterAction.java
r3542 r3639 1 package org.openstreetmap.josm.plugins. annotationtester;1 package org.openstreetmap.josm.plugins.taggingpresettester; 2 2 3 3 import static org.openstreetmap.josm.tools.I18n.tr; … … 12 12 13 13 /** 14 * Fires up the annotationtester14 * Fires up the tagging preset tester 15 15 * @author Immanuel.Scholz 16 16 */ 17 public class AnnotationTesterAction extends JosmAction {17 public class TaggingPresetTesterAction extends JosmAction { 18 18 19 public AnnotationTesterAction() {20 super(tr(" Annotation Preset Tester"), "annotation-tester", tr("Open the annotation preset test tool for previewing annotationpreset dialogs."), KeyEvent.VK_A, KeyEvent.CTRL_DOWN_MASK | KeyEvent.ALT_DOWN_MASK, true);19 public TaggingPresetTesterAction() { 20 super(tr("Tagging Preset Tester"), "tagging-preset-tester", tr("Open the tagging preset test tool for previewing tagging preset dialogs."), KeyEvent.VK_A, KeyEvent.CTRL_DOWN_MASK | KeyEvent.ALT_DOWN_MASK, true); 21 21 Main.main.menu.helpMenu.addSeparator(); 22 22 Main.main.menu.helpMenu.add(this); … … 24 24 25 25 public void actionPerformed(ActionEvent e) { 26 String annotationSources = Main.pref.get("annotation.sources");27 if ( annotationSources.equals("")) {28 JOptionPane.showMessageDialog(Main.parent, tr("You have to specify annotationsources in the preferences first."));26 String taggingPresetSources = Main.pref.get("taggingpreset.sources"); 27 if (taggingPresetSources.equals("")) { 28 JOptionPane.showMessageDialog(Main.parent, tr("You have to specify tagging preset sources in the preferences first.")); 29 29 return; 30 30 } 31 String[] args = annotationSources.split(";");32 new AnnotationTester(args);31 String[] args = taggingPresetSources.split(";"); 32 new TaggingPresetTester(args); 33 33 } 34 34 } -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/SpellCheck.java
r3622 r3639 16 16 import org.openstreetmap.josm.command.*; 17 17 import org.openstreetmap.josm.data.osm.*; 18 import org.openstreetmap.josm.gui. annotation.AnnotationPreset;19 import org.openstreetmap.josm.gui. annotation.AnnotationPreset.*;20 import org.openstreetmap.josm.gui.preferences. AnnotationPresetPreference;18 import org.openstreetmap.josm.gui.tagging.TaggingPreset; 19 import org.openstreetmap.josm.gui.tagging.TaggingPreset.*; 20 import org.openstreetmap.josm.gui.preferences.TaggingPresetPreference; 21 21 import org.openstreetmap.josm.plugins.validator.*; 22 22 import org.openstreetmap.josm.plugins.validator.util.Bag; … … 191 191 return; 192 192 193 Collection< AnnotationPreset> presets = AnnotationPresetPreference.annotationPresets;193 Collection<TaggingPreset> presets = TaggingPresetPreference.taggingPresets; 194 194 if( presets == null || presets.isEmpty() ) 195 195 { … … 287 287 288 288 XmlObjectParser parser = new XmlObjectParser(); 289 parser.mapOnStart("item", AnnotationPreset.class);289 parser.mapOnStart("item", TaggingPreset.class); 290 290 parser.map("text", Text.class); 291 291 parser.map("check", Check.class); … … 307 307 308 308 /** 309 * Reads the annotationspresets309 * Reads the tagging presets 310 310 */ 311 311 public static void readPresetFromPreferences() 312 312 { 313 String allAnnotations = Main.pref.get(" annotation.sources");313 String allAnnotations = Main.pref.get("taggingpreset.sources"); 314 314 StringTokenizer st = new StringTokenizer(allAnnotations, ";"); 315 315 while (st.hasMoreTokens())
Note:
See TracChangeset
for help on using the changeset viewer.