Ignore:
Timestamp:
2017-08-25T01:37:31+02:00 (2 years ago)
Author:
Don-vip
Message:

see #15182 - deprecate shortcut handling and mapframe listener methods in Main. Replacement: same methods in gui.MainApplication

Location:
trunk/src/org/openstreetmap/josm/actions
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java

    r12636 r12639  
    394394        //
    395395        MapView.addZoomChangeListener(new ZoomChangeAdapter());
    396         Main.addMapFrameListener(new MapFrameAdapter());
     396        MainApplication.addMapFrameListener(new MapFrameAdapter());
    397397        initEnabledState();
    398398    }
  • trunk/src/org/openstreetmap/josm/actions/CopyAction.java

    r10605 r12639  
    1616import org.openstreetmap.josm.data.osm.DataSet;
    1717import org.openstreetmap.josm.data.osm.OsmPrimitive;
     18import org.openstreetmap.josm.gui.MainApplication;
    1819import org.openstreetmap.josm.gui.datatransfer.ClipboardUtils;
    1920import org.openstreetmap.josm.gui.datatransfer.PrimitiveTransferable;
     
    3637        putValue("help", ht("/Action/Copy"));
    3738        // CUA shortcut for copy (https://en.wikipedia.org/wiki/IBM_Common_User_Access#Description)
    38         Main.registerActionShortcut(this,
     39        MainApplication.registerActionShortcut(this,
    3940                Shortcut.registerShortcut("system:copy:cua", tr("Edit: {0}", tr("Copy")), KeyEvent.VK_INSERT, Shortcut.CTRL));
    4041    }
  • trunk/src/org/openstreetmap/josm/actions/JosmAction.java

    r12637 r12639  
    7979        sc = shortcut;
    8080        if (sc != null && !sc.isAutomatic()) {
    81             Main.registerActionShortcut(this, sc);
     81            MainApplication.registerActionShortcut(this, sc);
    8282        }
    8383        setTooltip(tooltip);
     
    218218    public void destroy() {
    219219        if (sc != null && !sc.isAutomatic()) {
    220             Main.unregisterActionShortcut(this);
     220            MainApplication.unregisterActionShortcut(this);
    221221        }
    222222        if (layerChangeAdapter != null) {
  • trunk/src/org/openstreetmap/josm/actions/JumpToAction.java

    r12630 r12639  
    216216        super.installAdapters();
    217217        // make this action listen to mapframe change events
    218         Main.addMapFrameListener((o, n) -> updateEnabledState());
     218        MainApplication.addMapFrameListener((o, n) -> updateEnabledState());
    219219    }
    220220}
  • trunk/src/org/openstreetmap/josm/actions/PasteAction.java

    r10766 r12639  
    88import java.awt.event.KeyEvent;
    99
    10 import org.openstreetmap.josm.Main;
     10import org.openstreetmap.josm.gui.MainApplication;
    1111import org.openstreetmap.josm.tools.Shortcut;
    1212
     
    2525        putValue("help", ht("/Action/Paste"));
    2626        // CUA shortcut for paste (https://en.wikipedia.org/wiki/IBM_Common_User_Access#Description)
    27         Main.registerActionShortcut(this,
     27        MainApplication.registerActionShortcut(this,
    2828                Shortcut.registerShortcut("system:paste:cua", tr("Edit: {0}", tr("Paste")), KeyEvent.VK_INSERT, Shortcut.SHIFT));
    2929    }
  • trunk/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java

    r12636 r12639  
    7575                null, toolbar, "save_as-session", installAdapters);
    7676        putValue("help", ht("/Action/SessionSaveAs"));
    77         Main.addMapFrameListener(this);
     77        MainApplication.addMapFrameListener(this);
    7878    }
    7979
  • trunk/src/org/openstreetmap/josm/actions/ZoomInAction.java

    r12636 r12639  
    88import java.awt.event.KeyEvent;
    99
    10 import org.openstreetmap.josm.Main;
    1110import org.openstreetmap.josm.gui.MainApplication;
    1211import org.openstreetmap.josm.tools.Shortcut;
     
    3231        putValue("help", ht("/Action/ZoomIn"));
    3332        // On standard QWERTY, AZERTY and other common layouts the '+' key is obtained with Shift+EQUALS
    34         Main.registerActionShortcut(this,
     33        MainApplication.registerActionShortcut(this,
    3534                Shortcut.registerShortcut("view:zoominbis", tr("View: {0}", tr("Zoom In")),
    3635                    KeyEvent.VK_EQUALS, Shortcut.SHIFT));
    3736        // But on some systems (Belgian keyboard under Ubuntu) it seems not to work, so use also EQUALS
    38         Main.registerActionShortcut(this,
     37        MainApplication.registerActionShortcut(this,
    3938                Shortcut.registerShortcut("view:zoominter", tr("View: {0}", tr("Zoom In")),
    4039                    KeyEvent.VK_EQUALS, Shortcut.DIRECT));
    4140        // make numpad + behave like +
    42         Main.registerActionShortcut(this,
     41        MainApplication.registerActionShortcut(this,
    4342            Shortcut.registerShortcut("view:zoominkeypad", tr("View: {0}", tr("Zoom In (Keypad)")),
    4443                KeyEvent.VK_ADD, Shortcut.DIRECT));
  • trunk/src/org/openstreetmap/josm/actions/ZoomOutAction.java

    r12636 r12639  
    88import java.awt.event.KeyEvent;
    99
    10 import org.openstreetmap.josm.Main;
    1110import org.openstreetmap.josm.gui.MainApplication;
    1211import org.openstreetmap.josm.tools.Shortcut;
     
    2625        putValue("help", ht("/Action/ZoomOut"));
    2726        // make numpad - behave like -
    28         Main.registerActionShortcut(this,
     27        MainApplication.registerActionShortcut(this,
    2928            Shortcut.registerShortcut("view:zoomoutkeypad", tr("View: {0}", tr("Zoom Out (Keypad)")),
    3029                KeyEvent.VK_SUBTRACT, Shortcut.DIRECT));
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

    r12636 r12639  
    274274        MapFrame map = MainApplication.getMap();
    275275        map.statusLine.getAnglePanel().addMouseListener(snapHelper.anglePopupListener);
    276         Main.registerActionShortcut(backspaceAction, backspaceShortcut);
     276        MainApplication.registerActionShortcut(backspaceAction, backspaceShortcut);
    277277
    278278        map.mapView.addMouseListener(this);
     
    294294        map.mapView.removeTemporaryLayer(this);
    295295        SelectionEventManager.getInstance().removeSelectionListener(this);
    296         Main.unregisterActionShortcut(backspaceAction, backspaceShortcut);
     296        MainApplication.unregisterActionShortcut(backspaceAction, backspaceShortcut);
    297297        snapHelper.unsetFixedMode();
    298298        snapCheckboxMenuItem.getAction().setEnabled(false);
  • trunk/src/org/openstreetmap/josm/actions/relation/RecentRelationsAction.java

    r12636 r12639  
    5959        );
    6060        launchAction = new LaunchEditorAction();
    61         Main.registerActionShortcut(launchAction, shortcut);
     61        MainApplication.registerActionShortcut(launchAction, shortcut);
    6262    }
    6363
     
    115115    @Override
    116116    public void destroy() {
    117         Main.unregisterActionShortcut(launchAction, shortcut);
     117        MainApplication.unregisterActionShortcut(launchAction, shortcut);
    118118        super.destroy();
    119119    }
Note: See TracChangeset for help on using the changeset viewer.