Changeset 15855 in osm for applications/editors/josm


Ignore:
Timestamp:
2009-06-12T01:16:52+02:00 (15 years ago)
Author:
pieren
Message:

rework on shortcut settings on cadastre-fr plugin (JOSM)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java

    r14120 r15855  
    7070 *                 - increase PNG picture size requested to WMS (800x1000)
    7171 *                 - set 4th grab scale fixed size configurable (from 25 to 1000 meters)
     72 * 1.1 11-Jun-2009 - fixed a null exception error when trying to displace a vectorized layer
     73 *                 - propose to use shortcut F11 for grabbing
    7274 */
    7375public class CadastrePlugin extends Plugin {
     
    188190            transparency = 1.0f;
    189191        }
     192        // overwrite F11 shortcut used from the beginning by this plugin and recently used
     193        // for full-screen switch in JOSM core
     194        int i = 0;
     195        String p = Main.pref.get("shortcut.shortcut."+i, null);
     196        boolean alreadyRedefined = false;
     197        while (p != null) {
     198            String[] s = p.split(";");
     199            alreadyRedefined = alreadyRedefined || s[0].equals("menu:view:fullscreen");
     200            i++;
     201            p = Main.pref.get("shortcut.shortcut."+i, null);
     202        }
     203        if (!alreadyRedefined) {
     204            int reply = JOptionPane.showConfirmDialog(null,
     205                    "Plugin cadastre-fr used traditionaly for grabbing the key shortcut F11\n"+
     206                    "which is currently allocated for full-screen switch by default\n"+
     207                    "Would you like to restore F11 for grab action ?",
     208                    "Restore grab shortcut F11",
     209                    JOptionPane.YES_NO_OPTION);
     210            if (reply == JOptionPane.OK_OPTION) {
     211                System.out.println("redefine fullscreen shortcut F11 to shift+F11");
     212                Main.pref.put("shortcut.shortcut."+i, "menu:view:fullscreen;Toggle Full Screen view;122;5;122;64;false;true");
     213                JOptionPane.showMessageDialog(Main.parent,tr("JOSM is stopped for the change to take effect."));
     214                System.exit(0);
     215            }
     216        } else
     217            System.out.println("shortcut F11 already redefined; do not change");
    190218    }
    191219
Note: See TracChangeset for help on using the changeset viewer.