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/tagging-preset-tester
Files:
4 deleted
10 copied
1 moved

Legend:

Unmodified
Added
Removed
  • 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}
Note: See TracChangeset for help on using the changeset viewer.