Ignore:
Timestamp:
2006-07-03T00:31:24+02:00 (19 years ago)
Author:
imi
Message:
  • started i18n
  • started "download incomplete ways" action
  • added straight line selection mode
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java

    r103 r104  
    11package org.openstreetmap.josm.gui.dialogs;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.BorderLayout;
     
    5355 */
    5456public class SelectionListDialog extends ToggleDialog implements SelectionChangedListener {
    55 
    5657        public static enum SearchMode {replace, add, remove}
    5758
     
    6263                private OsmIdReader idReader = new OsmIdReader();
    6364                public SelectionWebsiteLoader(String urlStr, SearchMode mode) {
    64                 super("Load Selection");
     65                super(tr("Load Selection"));
    6566                this.mode = mode;
    6667                URL u = null;
     
    6970        }
    7071                @Override protected void realRun() {
    71                         currentAction.setText("Contact "+url.getHost()+"...");
     72                        currentAction.setText(tr("Contact {0}...", url.getHost()));
    7273                        sel = mode != SearchMode.remove ? new LinkedList<OsmPrimitive>() : Main.ds.allNonDeletedPrimitives();
    7374                        try {
    7475                        URLConnection con = url.openConnection();
    7576                        InputStream in = new ProgressReader(con, progress, currentAction);
    76                                 currentAction.setText("Downloading...");
     77                                currentAction.setText(tr("Downloading..."));
    7778                                Map<Long, String> ids = idReader.parseIds(in);
    7879                        for (OsmPrimitive osm : Main.ds.allNonDeletedPrimitives()) {
     
    8687                } catch (IOException e) {
    8788                        e.printStackTrace();
    88                         JOptionPane.showMessageDialog(Main.parent, "Could not read from url: '"+url+"'");
     89                        JOptionPane.showMessageDialog(Main.parent, tr("Could not read from url: '{0}'",url));
    8990                } catch (SAXException e) {
    9091                        e.printStackTrace();
    91                         JOptionPane.showMessageDialog(Main.parent, "Parsing error in url: '"+url+"'");
     92                        JOptionPane.showMessageDialog(Main.parent,tr("Parsing error in url: '{0}'",url));
    9293                }
    9394        }
     
    116117         */
    117118        public SelectionListDialog(MapFrame mapFrame) {
    118                 super("Current Selection", "selectionlist", "Open a selection list window.", KeyEvent.VK_E);
     119                super(tr("Current Selection"), "selectionlist", tr("Open a selection list window."), KeyEvent.VK_E);
    119120                setPreferredSize(new Dimension(320,150));
    120121                displaylist.setCellRenderer(new OsmPrimitivRenderer());
     
    132133                JPanel buttonPanel = new JPanel(new GridLayout(1,2));
    133134               
    134                 JButton button = new JButton("Select", ImageProvider.get("mapmode", "selection"));
    135                 button.setToolTipText("Set the selected elements on the map to the selected items in the list above.");
     135                JButton button = new JButton(tr("Select"), ImageProvider.get("mapmode/selection/select"));
     136                button.setToolTipText(tr("Set the selected elements on the map to the selected items in the list above."));
    136137                button.addActionListener(new ActionListener(){
    137138                        public void actionPerformed(ActionEvent e) {
     
    141142                buttonPanel.add(button);
    142143
    143                 button = new JButton("Reload", ImageProvider.get("dialogs", "refresh"));
    144                 button.setToolTipText("Refresh the selection list.");
     144                button = new JButton(tr("Reload"), ImageProvider.get("dialogs", "refresh"));
     145                button.setToolTipText(tr("Refresh the selection list."));
    145146                button.addActionListener(new ActionListener(){
    146147                        public void actionPerformed(ActionEvent e) {
     
    150151                buttonPanel.add(button);
    151152               
    152                 button = new JButton("Search", ImageProvider.get("dialogs", "search"));
    153                 button.setToolTipText("Search for objects.");
     153                button = new JButton(tr("Search"), ImageProvider.get("dialogs", "search"));
     154                button.setToolTipText(tr("Search for objects."));
    154155                button.addActionListener(new ActionListener(){
    155156                        private String lastSearch = "";
    156157                        public void actionPerformed(ActionEvent e) {
    157                                 JLabel label = new JLabel("Please enter a search string.");
     158                                JLabel label = new JLabel(tr("Please enter a search string."));
    158159                                final JTextField input = new JTextField(lastSearch);
    159                                 input.setToolTipText("<html>Fulltext search.<ul>" +
     160                                input.setToolTipText(tr("<html>Fulltext search.<ul>" +
    160161                                                "<li><code>Baker Street</code>  - 'Baker' and 'Street' in any key or name.</li>" +
    161162                                                "<li><code>\"Baker Street\"</code>  - 'Baker Street' in any key or name.</li>" +
     
    163164                                                "<li><code>-name:Bak</code>  - not 'Bak' in the name.</li>" +
    164165                                                "<li><code>foot:</code>  - key=foot set to any value." +
    165                                                 "</ul></html>");
    166 
    167                                 JRadioButton replace = new JRadioButton("replace selection", true);
    168                                 JRadioButton add = new JRadioButton("add to selection", false);
    169                                 JRadioButton remove = new JRadioButton("remove from selection", false);
     166                                                "</ul></html>"));
     167
     168                                JRadioButton replace = new JRadioButton(tr("replace selection"), true);
     169                                JRadioButton add = new JRadioButton(tr("add to selection"), false);
     170                                JRadioButton remove = new JRadioButton(tr("remove from selection"), false);
    170171                                ButtonGroup bg = new ButtonGroup();
    171172                                bg.add(replace);
     
    184185                    }
    185186                                };
    186                                 pane.createDialog(Main.parent, "Search").setVisible(true);
     187                                pane.createDialog(Main.parent,tr("Search")).setVisible(true);
    187188                                if (!Integer.valueOf(JOptionPane.OK_OPTION).equals(pane.getValue()))
    188189                                        return;
Note: See TracChangeset for help on using the changeset viewer.