Ignore:
Timestamp:
2017-11-28T00:56:29+01:00 (2 years ago)
Author:
Don-vip
Message:

see #15310 - remove most of deprecated APIs

Location:
trunk/src/org/openstreetmap/josm/gui/util
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/util/AdvancedKeyPressDetector.java

    r12620 r13173  
    3636
    3737    private final List<KeyPressReleaseListener> keyListeners = new CopyOnWriteArrayList<>();
    38     /** @deprecated replaced by {@link #modifierExListeners} */
    39     @Deprecated
    40     private final List<ModifierListener> modifierListeners = new CopyOnWriteArrayList<>();
    4138    private final ListenerList<ModifierExListener> modifierExListeners = ListenerList.create();
    42     /** @deprecated replaced by {@link #previousModifiersEx} */
    43     @Deprecated
    44     private int previousModifiers;
    4539    private int previousModifiersEx;
    4640
     
    5347    public void addKeyListener(KeyPressReleaseListener l) {
    5448        keyListeners.add(l);
    55     }
    56 
    57     /**
    58      * Adds an object that wants to receive key modifier changed events.
    59      * @param l listener to add
    60      * @deprecated use {@link #addModifierExListener} instead
    61      */
    62     @Deprecated
    63     public void addModifierListener(ModifierListener l) {
    64         modifierListeners.add(l);
    6549    }
    6650
     
    8064    public void removeKeyListener(KeyPressReleaseListener l) {
    8165        keyListeners.remove(l);
    82     }
    83 
    84     /**
    85      * Removes the key modifier listener.
    86      * @param l listener to remove
    87      * @deprecated use {@link #removeModifierExListener} instead
    88      */
    89     @Deprecated
    90     public void removeModifierListener(ModifierListener l) {
    91         modifierListeners.remove(l);
    9266    }
    9367
     
    131105        if (!keyListeners.isEmpty()) {
    132106            Logging.warn(tr("Some of the key listeners forgot to remove themselves: {0}"), keyListeners.toString());
    133         }
    134         if (!modifierListeners.isEmpty()) {
    135             Logging.warn(tr("Some of the key modifier listeners forgot to remove themselves: {0}"), modifierListeners.toString());
    136107        }
    137108        if (modifierExListeners.hasListeners()) {
     
    183154        KeyEvent ke = (KeyEvent) e;
    184155
    185         // check if ctrl, alt, shift modifiers are changed
    186         int modif = ke.getModifiers();
    187         if (previousModifiers != modif) {
    188             previousModifiers = modif;
    189             for (ModifierListener m: modifierListeners) {
    190                 m.modifiersChanged(modif);
    191             }
    192         }
    193 
    194156        // check if ctrl, alt, shift extended modifiers are changed
    195157        int modifEx = ke.getModifiersEx();
  • trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java

    r12748 r13173  
    2121import java.awt.Window;
    2222import java.awt.event.ActionListener;
    23 import java.awt.event.KeyEvent;
    2423import java.awt.event.MouseAdapter;
    2524import java.awt.event.MouseEvent;
     
    6665import org.openstreetmap.josm.tools.LanguageInfo;
    6766import org.openstreetmap.josm.tools.Logging;
    68 import org.openstreetmap.josm.tools.PlatformHook;
    6967import org.openstreetmap.josm.tools.bugreport.BugReport;
    7068import org.openstreetmap.josm.tools.bugreport.ReportedException;
     
    462460
    463461    /**
    464      * Returns extended modifier key used as the appropriate accelerator key for menu shortcuts.
    465      * It is advised everywhere to use {@link Toolkit#getMenuShortcutKeyMask()} to get the cross-platform modifier, but:
    466      * <ul>
    467      * <li>it returns KeyEvent.CTRL_MASK instead of KeyEvent.CTRL_DOWN_MASK. We used the extended
    468      *    modifier for years, and Oracle recommends to use it instead, so it's best to keep it</li>
    469      * <li>the method throws a HeadlessException ! So we would need to handle it for unit tests anyway</li>
    470      * </ul>
    471      * @return extended modifier key used as the appropriate accelerator key for menu shortcuts
    472      * @since 7539
    473      * @deprecated to be removed end of 2017. Use {@link PlatformHook#getMenuShortcutKeyMaskEx()} instead
    474      */
    475     @Deprecated
    476     public static int getMenuShortcutKeyMaskEx() {
    477         return Main.isPlatformOsx() ? KeyEvent.META_DOWN_MASK : KeyEvent.CTRL_DOWN_MASK;
    478     }
    479 
    480     /**
    481462     * Sets a global font for all UI, replacing default font of current look and feel.
    482463     * @param name Font name. It is up to the caller to make sure the font exists
Note: See TracChangeset for help on using the changeset viewer.