Changeset 2875 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2010-01-18T20:03:38+01:00 (15 years ago)
Author:
mjulius
Message:

fix some more unescaped '

Location:
trunk/src/org/openstreetmap/josm
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java

    r2848 r2875  
    230230    protected void warnLayersWithIllegalFilesAndSaveRequest(List<SaveLayerInfo> infos) {
    231231        String msg = trn("<html>{0} layer needs saving but has an associated file<br>"
    232                 + "which can't be written.<br>"
     232                + "which cannot be written.<br>"
    233233                + "Either select another file for this layer or discard the changes.<br>"
    234234                + "Layer with a non-writable file:</html>",
    235235                "<html>{0} layers need saving but have associated files<br>"
    236                 + "which can't be written.<br>"
     236                + "which cannot be written.<br>"
    237237                + "Either select another file for each of them or discard the changes.<br>"
    238238                + "Layers with non-writable files:</html>",
  • trunk/src/org/openstreetmap/josm/gui/preferences/PrefJPanel.java

    r2849 r2875  
    2929public class PrefJPanel extends javax.swing.JPanel {
    3030
    31         // table of shortcuts
    32         private TableModel model;
    33         // comboboxes of modifier groups, mapping selectedIndex to real data
    34         private static int[] modifInts = new int[]{
    35             -1,
    36             0,
    37             KeyEvent.SHIFT_DOWN_MASK,
    38             KeyEvent.CTRL_DOWN_MASK,
    39             KeyEvent.ALT_DOWN_MASK,
    40             KeyEvent.META_DOWN_MASK,
    41             KeyEvent.CTRL_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK,
    42             KeyEvent.ALT_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK,
    43             KeyEvent.META_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK,
    44             KeyEvent.CTRL_DOWN_MASK | KeyEvent.ALT_DOWN_MASK,
    45             KeyEvent.CTRL_DOWN_MASK | KeyEvent.META_DOWN_MASK,
    46             KeyEvent.ALT_DOWN_MASK | KeyEvent.META_DOWN_MASK,
    47             KeyEvent.CTRL_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK | KeyEvent.ALT_DOWN_MASK,
    48             KeyEvent.META_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK | KeyEvent.ALT_DOWN_MASK
    49         };
    50         // and here are the texts fro the comboboxes
    51         private static String[] modifList = new String[] {
    52             tr("disabled"),
    53             tr("no modifier"),
    54             KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[2]).getModifiers()),
    55             KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[3]).getModifiers()),
    56             KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[4]).getModifiers()),
    57             KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[5]).getModifiers()),
    58             KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[6]).getModifiers()),
    59             KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[7]).getModifiers()),
    60             KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[8]).getModifiers()),
    61             KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[9]).getModifiers()),
    62             KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[10]).getModifiers()),
    63             KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[11]).getModifiers()),
    64             KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[12]).getModifiers()),
    65             KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[13]).getModifiers())
    66         };
    67         // this are the display(!) texts for the checkboxes. Let the JVM do the i18n for us <g>.
    68         // Ok, there's a real reason for this: The JVM should know best how the keys are labelled
    69         // on the physical keyboard. What language pack is installed in JOSM is completely
    70         // independent from the keyboard's labelling. But the operation system's locale
    71         // usually matches the keyboard. This even works with my English Windows and my German
    72         // keyboard.
    73         private static String SHIFT = KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.SHIFT_DOWN_MASK).getModifiers());
    74         private static String CTRL  = KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.CTRL_DOWN_MASK).getModifiers());
    75         private static String ALT   = KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.ALT_DOWN_MASK).getModifiers());
    76         private static String META  = KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.META_DOWN_MASK).getModifiers());
    77 
    78         // A list of keys to present the user. Sadly this really is a list of keys Java knows about,
    79         // not a list of real physical keys. If someone knows how to get that list?
    80         private static Map<Integer, String> keyList = setKeyList();
    81 
    82         private static Map<Integer, String> setKeyList() {
    83             Map<Integer, String> list = new LinkedHashMap<Integer, String>();
    84             // I hate this, but I found no alternative...
    85             for (int i = 0; i < 65534; i++) {
    86                 String s = KeyEvent.getKeyText(i);
    87                 if (s != null && s.length() > 0 && !s.contains("Unknown")) {
    88                     list.put(Integer.valueOf(i), s);
    89                     //System.out.println(i+": "+s);
    90                 }
     31    // table of shortcuts
     32    private TableModel model;
     33    // comboboxes of modifier groups, mapping selectedIndex to real data
     34    private static int[] modifInts = new int[]{
     35        -1,
     36        0,
     37        KeyEvent.SHIFT_DOWN_MASK,
     38        KeyEvent.CTRL_DOWN_MASK,
     39        KeyEvent.ALT_DOWN_MASK,
     40        KeyEvent.META_DOWN_MASK,
     41        KeyEvent.CTRL_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK,
     42        KeyEvent.ALT_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK,
     43        KeyEvent.META_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK,
     44        KeyEvent.CTRL_DOWN_MASK | KeyEvent.ALT_DOWN_MASK,
     45        KeyEvent.CTRL_DOWN_MASK | KeyEvent.META_DOWN_MASK,
     46        KeyEvent.ALT_DOWN_MASK | KeyEvent.META_DOWN_MASK,
     47        KeyEvent.CTRL_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK | KeyEvent.ALT_DOWN_MASK,
     48        KeyEvent.META_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK | KeyEvent.ALT_DOWN_MASK
     49    };
     50    // and here are the texts fro the comboboxes
     51    private static String[] modifList = new String[] {
     52        tr("disabled"),
     53        tr("no modifier"),
     54        KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[2]).getModifiers()),
     55        KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[3]).getModifiers()),
     56        KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[4]).getModifiers()),
     57        KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[5]).getModifiers()),
     58        KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[6]).getModifiers()),
     59        KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[7]).getModifiers()),
     60        KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[8]).getModifiers()),
     61        KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[9]).getModifiers()),
     62        KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[10]).getModifiers()),
     63        KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[11]).getModifiers()),
     64        KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[12]).getModifiers()),
     65        KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[13]).getModifiers())
     66    };
     67    // this are the display(!) texts for the checkboxes. Let the JVM do the i18n for us <g>.
     68    // Ok, there's a real reason for this: The JVM should know best how the keys are labelled
     69    // on the physical keyboard. What language pack is installed in JOSM is completely
     70    // independent from the keyboard's labelling. But the operation system's locale
     71    // usually matches the keyboard. This even works with my English Windows and my German
     72    // keyboard.
     73    private static String SHIFT = KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.SHIFT_DOWN_MASK).getModifiers());
     74    private static String CTRL  = KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.CTRL_DOWN_MASK).getModifiers());
     75    private static String ALT   = KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.ALT_DOWN_MASK).getModifiers());
     76    private static String META  = KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.META_DOWN_MASK).getModifiers());
     77
     78    // A list of keys to present the user. Sadly this really is a list of keys Java knows about,
     79    // not a list of real physical keys. If someone knows how to get that list?
     80    private static Map<Integer, String> keyList = setKeyList();
     81
     82    private static Map<Integer, String> setKeyList() {
     83        Map<Integer, String> list = new LinkedHashMap<Integer, String>();
     84        // I hate this, but I found no alternative...
     85        for (int i = 0; i < 65534; i++) {
     86            String s = KeyEvent.getKeyText(i);
     87            if (s != null && s.length() > 0 && !s.contains("Unknown")) {
     88                list.put(Integer.valueOf(i), s);
     89                //System.out.println(i+": "+s);
    9190            }
    92             list.put(Integer.valueOf(-1), "");
    93             return list;
    9491        }
     92        list.put(Integer.valueOf(-1), "");
     93        return list;
     94    }
    9595
    9696    /** Creates new form prefJPanel */
     
    156156        setLayout(new javax.swing.BoxLayout(this, javax.swing.BoxLayout.Y_AXIS));
    157157
    158                 // If someone wants to move this text into some resource, feel free.
    159                 infoTab.setLayout(new javax.swing.BoxLayout(shortcutTab, javax.swing.BoxLayout.Y_AXIS));
    160                 JEditorPane editor = new JEditorPane();
    161                 editor.setEditable(false);
    162                 editor.setContentType("text/html");
    163                 editor.setText(
    164                     tr("<h1><a name=\"top\">Keyboard Shortcuts</a></h1>")+
    165                     tr("<p>Please note that shortcuts keys are assigned to the actions when JOSM is started. So you need to <b>restart</b> "
    166                       +"JOSM to see your changes.</p>")+
    167                     tr("<p>Furthermore, the shortcuts are activated when the actions are assigned to a menu entry of button for the first "
    168                       +"time. So some of your changes may become active even without restart --- but also without collistion handling. "
    169                       +"This is another reason to <b>restart</b> JOSM after making any changes here.</p>")+
    170                     tr("<p>You may notice that the key selection list on the next page lists all keys that exist on all kinds of keyboards "
    171                       +"Java knows about, not just those keys that exist on your keyboard. Please use only those values that correspond to "
    172                       +"a real key on your keyboard. So if your keyboard has no 'Copy' key (PC keyboard don't have them, Sun keyboards do), "
    173                       +"the do not use it. Also there will be 'keys' listed that correspond to a shortcut on your keyboard (e.g. ':'/Colon). "
    174                       +"Please also do not use them, use the base key (';'/Semicolon on US keyboards, '.'/Period on German keyboards, ...) "
    175                       +"instead. Not doing so may result in conflicts, as there is no way for JOSM to know that Ctrl+Shift+; and Ctrl+: "
    176                       +"actually is the same thing on an US keyboard...</p>")+
    177                     tr("<p>Thank you for your understanding</p>")+
    178                     tr("<h1>Modifier Groups</h1>")+
    179                     tr("<p>The last page lists the modifier keys JOSM will automatically assign to shortcuts. For every of the four kinds "
    180                       +"of shortcuts there are three alternatives. JOSM will try those alternative in the listed order when managing a "
    181                       +"conflict. If all alternatives would result in shortcuts that are already taken, it will assign a random shortcut "
    182                       +"instead.</p>")+
    183                     tr("<p>The pseudo-modifier ''disabled'' will disable the shortcut when encountered.</p>")
    184                 );
    185                 editor.setCaretPosition(0); // scroll up
    186                 prefTabPane.addTab(tr("Read First"), new JScrollPane(editor));
     158        // If someone wants to move this text into some resource, feel free.
     159        infoTab.setLayout(new javax.swing.BoxLayout(shortcutTab, javax.swing.BoxLayout.Y_AXIS));
     160        JEditorPane editor = new JEditorPane();
     161        editor.setEditable(false);
     162        editor.setContentType("text/html");
     163        editor.setText(
     164                tr("<h1><a name=\"top\">Keyboard Shortcuts</a></h1>")+
     165                tr("<p>Please note that shortcuts keys are assigned to the actions when JOSM is started. So you need to <b>restart</b> "
     166                        +"JOSM to see your changes.</p>")+
     167                        tr("<p>Furthermore, the shortcuts are activated when the actions are assigned to a menu entry of button for the first "
     168                                +"time. So some of your changes may become active even without restart --- but also without collistion handling. "
     169                                +"This is another reason to <b>restart</b> JOSM after making any changes here.</p>")+
     170                                tr("<p>You may notice that the key selection list on the next page lists all keys that exist on all kinds of keyboards "
     171                                        +"Java knows about, not just those keys that exist on your keyboard. Please use only those values that correspond to "
     172                                        +"a real key on your keyboard. So if your keyboard has no ''Copy'' key (PC keyboard do not have them, Sun keyboards do), "
     173                                        +"the do not use it. Also there will be ''keys'' listed that correspond to a shortcut on your keyboard (e.g. '':''/Colon). "
     174                                        +"Please also do not use them, use the base key ('';''/Semicolon on US keyboards, ''.''/Period on German keyboards, ...) "
     175                                        +"instead. Not doing so may result in conflicts, as there is no way for JOSM to know that Ctrl+Shift+; and Ctrl+: "
     176                                        +"actually is the same thing on an US keyboard...</p>")+
     177                                        tr("<p>Thank you for your understanding</p>")+
     178                                        tr("<h1>Modifier Groups</h1>")+
     179                                        tr("<p>The last page lists the modifier keys JOSM will automatically assign to shortcuts. For every of the four kinds "
     180                                                +"of shortcuts there are three alternatives. JOSM will try those alternative in the listed order when managing a "
     181                                                +"conflict. If all alternatives would result in shortcuts that are already taken, it will assign a random shortcut "
     182                                                +"instead.</p>")+
     183                                                tr("<p>The pseudo-modifier ''disabled'' will disable the shortcut when encountered.</p>")
     184        );
     185        editor.setCaretPosition(0); // scroll up
     186        prefTabPane.addTab(tr("Read First"), new JScrollPane(editor));
    187187
    188188        shortcutTab.setLayout(new javax.swing.BoxLayout(shortcutTab, javax.swing.BoxLayout.Y_AXIS));
     
    342342        subwindowGroupPane.add(bxTer4);
    343343
    344                 initbx();
    345                 bxPrim1.setAction(action2);
    346                 bxSec1.setAction(action2);
    347                 bxTer1.setAction(action2);
    348                 bxPrim2.setAction(action2);
    349                 bxSec2.setAction(action2);
    350                 bxTer2.setAction(action2);
    351                 bxPrim3.setAction(action2);
    352                 bxSec3.setAction(action2);
    353                 bxTer3.setAction(action2);
    354                 bxPrim4.setAction(action2);
    355                 bxSec4.setAction(action2);
    356                 bxTer4.setAction(action2);
     344        initbx();
     345        bxPrim1.setAction(action2);
     346        bxSec1.setAction(action2);
     347        bxTer1.setAction(action2);
     348        bxPrim2.setAction(action2);
     349        bxSec2.setAction(action2);
     350        bxTer2.setAction(action2);
     351        bxPrim3.setAction(action2);
     352        bxSec3.setAction(action2);
     353        bxTer3.setAction(action2);
     354        bxPrim4.setAction(action2);
     355        bxSec4.setAction(action2);
     356        bxTer4.setAction(action2);
    357357
    358358        modifierTab.add(subwindowGroupPane);
     
    373373    private class cbAction extends javax.swing.AbstractAction implements ListSelectionListener {
    374374        private PrefJPanel panel;
    375             public cbAction (PrefJPanel panel) {
    376                 this.panel = panel;
     375        public cbAction (PrefJPanel panel) {
     376            this.panel = panel;
    377377        }
    378378        public void valueChanged(ListSelectionEvent e) {
     
    427427                    } else {
    428428                        sc.setAssignedModifier(
    429                             (panel.cbShift.isSelected() ? KeyEvent.SHIFT_DOWN_MASK : 0) |
    430                             (panel.cbCtrl.isSelected() ? KeyEvent.CTRL_DOWN_MASK : 0) |
    431                             (panel.cbAlt.isSelected() ? KeyEvent.ALT_DOWN_MASK : 0) |
    432                             (panel.cbMeta.isSelected() ? KeyEvent.META_DOWN_MASK : 0)
     429                                (panel.cbShift.isSelected() ? KeyEvent.SHIFT_DOWN_MASK : 0) |
     430                                (panel.cbCtrl.isSelected() ? KeyEvent.CTRL_DOWN_MASK : 0) |
     431                                (panel.cbAlt.isSelected() ? KeyEvent.ALT_DOWN_MASK : 0) |
     432                                (panel.cbMeta.isSelected() ? KeyEvent.META_DOWN_MASK : 0)
    433433                        );
    434434                        for (Map.Entry<Integer, String> entry : keyList.entrySet()) {
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/ProxyPreferencesPanel.java

    r2823 r2875  
    314314
    315315        if (pp.equals(ProxyPolicy.USE_SYSTEM_SETTINGS) && ! DefaultProxySelector.willJvmRetrieveSystemProxies()) {
    316             System.err.println(tr("Warning: JOSM is configured to use proxies from the system setting, but the JVM is not configured to retrieve them. Resetting preferences to 'No proxy'"));
     316            System.err.println(tr("Warning: JOSM is configured to use proxies from the system setting, but the JVM is not configured to retrieve them. Resetting preferences to ''No proxy''"));
    317317            pp = ProxyPolicy.NO_PROXY;
    318318            rbProxyPolicy.get(pp).setSelected(true);
  • trunk/src/org/openstreetmap/josm/io/Capabilities.java

    r2711 r2875  
    8686            int n = Integer.parseInt(v);
    8787            if (n <= 0) {
    88                 System.err.println(tr("Warning: illegal value of attribute '{0}'' of element ''{1}'' in server capabilities. Got ''{2}", "changesets", "maximum_elements", n ));
     88                System.err.println(tr("Warning: illegal value of attribute ''{0}'' of element ''{1}'' in server capabilities. Got ''{2}''", "changesets", "maximum_elements", n ));
    8989                return -1;
    9090            }
    9191            return n;
    9292        } catch(NumberFormatException e) {
    93             System.err.println(tr("Warning: illegal value of attribute '{0}'' of element ''{1}'' in server capabilities. Got ''{2}", "changesets", "maximum_elements", v ));
     93            System.err.println(tr("Warning: illegal value of attribute ''{0}'' of element ''{1}'' in server capabilities. Got ''{2}''", "changesets", "maximum_elements", v ));
    9494            return -1;
    9595        }
  • trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java

    r2852 r2875  
    112112        OsmPrimitive primitive = ds.getPrimitiveById(id, type);
    113113        if (primitive == null)
    114             throw new NoSuchElementException(tr("No primitive with id {0} in local dataset. Can't infer primitive type.", id));
     114            throw new NoSuchElementException(tr("No primitive with id {0} in local dataset. Cannot infer primitive type.", id));
    115115        remember(primitive.getPrimitiveId());
    116116        return;
Note: See TracChangeset for help on using the changeset viewer.