Changeset 3639 in osm


Ignore:
Timestamp:
2007-07-20T17:22:15+02:00 (17 years ago)
Author:
imi
Message:

renamed annotataion presets to tagging presets

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  
    99
    1010import org.openstreetmap.josm.data.coor.LatLon;
    11 import org.openstreetmap.josm.gui.annotation.AnnotationPreset;
    12 import org.openstreetmap.josm.gui.preferences.AnnotationPresetPreference;
     11import org.openstreetmap.josm.gui.tagging.TaggingPreset;
     12import org.openstreetmap.josm.gui.preferences.TaggingPresetPreference;
    1313
    1414import at.dallermassl.josm.plugin.surveyor.GpsActionEvent;
     
    2121public class AnnotationPresetAction implements SurveyorAction {
    2222    private String presetName;
    23     private AnnotationPreset preset;
     23    private TaggingPreset preset;
    2424   
    2525
     
    5858        }
    5959        presetName = parameters.get(0);
    60         preset = getAnnotationPreset(presetName);
     60        preset = getTaggingPreset(presetName);
    6161        if(preset == null) {
    6262            System.err.println("No valid preset '" + parameters.get(0) + "' found - disable action!");
     
    7070     * @return  the preset with the given name.
    7171     */
    72     protected AnnotationPreset getAnnotationPreset(String name) {
    73         for(AnnotationPreset preset : AnnotationPresetPreference.annotationPresets) {
     72    protected TaggingPreset getTaggingPreset(String name) {
     73        for(TaggingPreset preset : TaggingPresetPreference.taggingPresets) {
    7474            if(name.equals(preset.getValue(Action.NAME))) {
    7575                return preset;
  • applications/editors/josm/plugins/tagging-preset-tester/.project

    r3638 r3639  
    11<?xml version="1.0" encoding="UTF-8"?>
    22<projectDescription>
    3         <name>annotation-tester</name>
     3        <name>tagging-preset-tester</name>
    44        <comment></comment>
    55        <projects>
  • applications/editors/josm/plugins/tagging-preset-tester/src/org/openstreetmap/josm/plugins/taggingpresettester/MANIFEST.MF

    r3638 r3639  
    11Manifest-Version: 1.0
    2 Main-Class: org.openstreetmap.josm.plugins.annotationtester.AnnotationTester
    3 Plugin-Class: org.openstreetmap.josm.plugins.annotationtester.AnnotationTesterAction
    4 Plugin-Description: Make the Annotation Preset Tester tool available in
    5  the help menu.
     2Main-Class: org.openstreetmap.josm.plugins.taggingpresettester.TaggingPresetTester
     3Plugin-Class: org.openstreetmap.josm.plugins.taggingpresettester.TaggingPresetTesterAction
     4Plugin-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;
     1package org.openstreetmap.josm.plugins.taggingpresettester;
    22
    33import java.awt.BorderLayout;
     
    1919import javax.swing.JPanel;
    2020
    21 import org.openstreetmap.josm.gui.annotation.AnnotationCellRenderer;
    22 import org.openstreetmap.josm.gui.annotation.AnnotationPreset;
     21import org.openstreetmap.josm.gui.tagging.TaggingCellRenderer;
     22import org.openstreetmap.josm.gui.tagging.TaggingPreset;
    2323import org.xml.sax.SAXException;
    2424
    25 public class AnnotationTester extends JFrame {
     25public class TaggingPresetTester extends JFrame {
    2626
    27         private JComboBox annotationPresets;
     27        private JComboBox taggingPresets;
    2828        private final String[] args;
    29         private JPanel annotationPanel = new JPanel(new BorderLayout());
     29        private JPanel taggingPresetPanel = new JPanel(new BorderLayout());
    3030        private JPanel panel = new JPanel(new BorderLayout());
    3131
    3232        public void reload() {
    33                 Vector<AnnotationPreset> allPresets = new Vector<AnnotationPreset>();
     33                Vector<TaggingPreset> allPresets = new Vector<TaggingPreset>();
    3434                for (String source : args) {
    3535                        InputStream in = null;
     
    3838                                        in = new URL(source).openStream();
    3939                                else if (source.startsWith("resource://"))
    40                                         in = AnnotationTester.class.getResourceAsStream(source.substring("resource:/".length()));
     40                                        in = TaggingPresetTester.class.getResourceAsStream(source.substring("resource:/".length()));
    4141                                else
    4242                                        in = new FileInputStream(source);
    43                                 allPresets.addAll(AnnotationPreset.readAll(in));
     43                                allPresets.addAll(TaggingPreset.readAll(in));
    4444                        } catch (IOException e) {
    4545                                e.printStackTrace();
    46                                 JOptionPane.showMessageDialog(null, "Could not read annotation preset source: "+source);
     46                                JOptionPane.showMessageDialog(null, "Could not read tagging preset source: "+source);
    4747                        } catch (SAXException e) {
    4848                                e.printStackTrace();
     
    5656                        }
    5757                }
    58                 annotationPresets.setModel(new DefaultComboBoxModel(allPresets));
     58                taggingPresets.setModel(new DefaultComboBoxModel(allPresets));
    5959        }
    6060
    6161        public void reselect() {
    62                 annotationPanel.removeAll();
    63                 AnnotationPreset preset = (AnnotationPreset)annotationPresets.getSelectedItem();
     62                taggingPresetPanel.removeAll();
     63                TaggingPreset preset = (TaggingPreset)taggingPresets.getSelectedItem();
    6464                if (preset == null)
    6565                        return;
     
    6767                p.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
    6868                if (p != null)
    69                         annotationPanel.add(p, BorderLayout.NORTH);
     69                        taggingPresetPanel.add(p, BorderLayout.NORTH);
    7070                panel.validate();
    7171                panel.repaint();
    7272        }
    7373
    74         public AnnotationTester(String[] args) {
    75                 super("Annotation Preset Tester");
     74        public TaggingPresetTester(String[] args) {
     75                super("Tagging Preset Tester");
    7676                this.args = args;
    77                 annotationPresets = new JComboBox();
    78                 annotationPresets.setRenderer(new AnnotationCellRenderer());
     77                taggingPresets = new JComboBox();
     78                taggingPresets.setRenderer(new TaggingCellRenderer());
    7979                reload();
    8080
    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(){
    8484                        public void actionPerformed(ActionEvent e) {
    8585                                reselect();
     
    9191                b.addActionListener(new ActionListener(){
    9292                        public void actionPerformed(ActionEvent e) {
    93                                 int i = annotationPresets.getSelectedIndex();
     93                                int i = taggingPresets.getSelectedIndex();
    9494                                reload();
    95                                 annotationPresets.setSelectedIndex(i);
     95                                taggingPresets.setSelectedIndex(i);
    9696                        }
    9797                });
     
    110110                        args = new String[]{c.getSelectedFile().getPath()};
    111111                }
    112                 JFrame f = new AnnotationTester(args);
     112                JFrame f = new TaggingPresetTester(args);
    113113                f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    114114        }
  • applications/editors/josm/plugins/tagging-preset-tester/src/org/openstreetmap/josm/plugins/taggingpresettester/TaggingPresetTesterAction.java

    r3542 r3639  
    1 package org.openstreetmap.josm.plugins.annotationtester;
     1package org.openstreetmap.josm.plugins.taggingpresettester;
    22
    33import static org.openstreetmap.josm.tools.I18n.tr;
     
    1212
    1313/**
    14  * Fires up the annotation tester
     14 * Fires up the tagging preset tester
    1515 * @author Immanuel.Scholz
    1616 */
    17 public class AnnotationTesterAction extends JosmAction {
     17public class TaggingPresetTesterAction extends JosmAction {
    1818
    19         public AnnotationTesterAction() {
    20                 super(tr("Annotation Preset Tester"), "annotation-tester", tr("Open the annotation preset test tool for previewing annotation preset 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);
    2121                Main.main.menu.helpMenu.addSeparator();
    2222                Main.main.menu.helpMenu.add(this);
     
    2424
    2525        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 annotation sources 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."));
    2929                        return;
    3030                }
    31                 String[] args = annotationSources.split(";");
    32                 new AnnotationTester(args);
     31                String[] args = taggingPresetSources.split(";");
     32                new TaggingPresetTester(args);
    3333        }
    3434}
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/SpellCheck.java

    r3622 r3639  
    1616import org.openstreetmap.josm.command.*;
    1717import 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;
     18import org.openstreetmap.josm.gui.tagging.TaggingPreset;
     19import org.openstreetmap.josm.gui.tagging.TaggingPreset.*;
     20import org.openstreetmap.josm.gui.preferences.TaggingPresetPreference;
    2121import org.openstreetmap.josm.plugins.validator.*;
    2222import org.openstreetmap.josm.plugins.validator.util.Bag;
     
    191191                        return;
    192192               
    193                 Collection<AnnotationPreset> presets = AnnotationPresetPreference.annotationPresets;
     193                Collection<TaggingPreset> presets = TaggingPresetPreference.taggingPresets;
    194194                if( presets == null || presets.isEmpty() )
    195195                {
     
    287287               
    288288                XmlObjectParser parser = new XmlObjectParser();
    289                 parser.mapOnStart("item", AnnotationPreset.class);
     289                parser.mapOnStart("item", TaggingPreset.class);
    290290                parser.map("text", Text.class);
    291291                parser.map("check", Check.class);
     
    307307
    308308        /**
    309          * Reads the annotations presets
     309         * Reads the tagging presets
    310310         */
    311311        public static void readPresetFromPreferences()
    312312        {
    313                 String allAnnotations = Main.pref.get("annotation.sources");
     313                String allAnnotations = Main.pref.get("taggingpreset.sources");
    314314                StringTokenizer st = new StringTokenizer(allAnnotations, ";");
    315315                while (st.hasMoreTokens())
Note: See TracChangeset for help on using the changeset viewer.