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
Files:
4 deleted
18 edited

Legend:

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

    r13025 r13173  
    476476        if (mainFrame != null) {
    477477            mainPanel = mainFrame.getPanel();
    478             panel = mainPanel;
    479478            mainFrame.initialize();
    480479            menu = mainFrame.getMenu();
    481             super.menu = menu;
    482480        } else {
    483481            // required for running some tests.
    484482            mainPanel = new MainPanel(layerManager);
    485             panel = mainPanel;
    486483            menu = new MainMenu();
    487             super.menu = menu;
    488484        }
    489485        mainPanel.addMapFrameListener((o, n) -> redoUndoListener.commandChanged(0, 0));
     
    10261022        setupUIManager();
    10271023        toolbar = new ToolbarPreferences();
    1028         Main.toolbar = toolbar;
    10291024        ProjectionPreference.setProjection();
    10301025        setupNadGridSources();
     
    10511046            mainFrame.setMaximized(true);
    10521047        }
    1053         if (main.menu.fullscreenToggleAction != null) {
    1054             main.menu.fullscreenToggleAction.initial();
     1048        if (menu.fullscreenToggleAction != null) {
     1049            menu.fullscreenToggleAction.initial();
    10551050        }
    10561051
  • trunk/src/org/openstreetmap/josm/gui/MainPanel.java

    r12675 r13173  
    88import javax.swing.JPanel;
    99
    10 import org.openstreetmap.josm.Main;
    1110import org.openstreetmap.josm.actions.mapmode.MapMode;
    1211import org.openstreetmap.josm.gui.layer.Layer;
     
    6665        } else {
    6766            map = null;
    68             Main.map = map;
    6967            MainApplication.map = map;
    7068            add(getGettingStarted(), BorderLayout.CENTER);
     
    9088        MapFrame mapFrame = new MapFrame(null);
    9189        // Required by many components.
    92         Main.map = mapFrame;
    9390        MainApplication.map = mapFrame;
    9491
  • trunk/src/org/openstreetmap/josm/gui/MapView.java

    r13154 r13173  
    3535import javax.swing.AbstractButton;
    3636import javax.swing.JComponent;
    37 import javax.swing.JPanel;
    3837import javax.swing.SwingUtilities;
    3938
     
    255254     * Constructs a new {@code MapView}.
    256255     * @param layerManager The layers to display.
    257      * @param contentPane Ignored. Main content pane is used.
    258      * @param viewportData the initial viewport of the map. Can be null, then
    259      * the viewport is derived from the layer data.
    260      * @since 10279
    261      * @deprecated use {@link #MapView(MainLayerManager, ViewportData)} instead
    262      */
    263     @Deprecated
    264     public MapView(MainLayerManager layerManager, final JPanel contentPane, final ViewportData viewportData) {
    265         this(layerManager, viewportData);
    266     }
    267 
    268     /**
    269      * Constructs a new {@code MapView}.
    270      * @param layerManager The layers to display.
    271256     * @param viewportData the initial viewport of the map. Can be null, then
    272257     * the viewport is derived from the layer data.
  • trunk/src/org/openstreetmap/josm/gui/io/CustomConfigurator.java

    r12881 r13173  
    4545import org.openstreetmap.josm.data.PreferencesUtils;
    4646import org.openstreetmap.josm.data.Version;
    47 import org.openstreetmap.josm.spi.preferences.Setting;
    4847import org.openstreetmap.josm.gui.MainApplication;
    4948import org.openstreetmap.josm.plugins.PluginDownloadTask;
     
    5150import org.openstreetmap.josm.plugins.ReadLocalPluginInformationTask;
    5251import org.openstreetmap.josm.spi.preferences.Config;
     52import org.openstreetmap.josm.spi.preferences.Setting;
    5353import org.openstreetmap.josm.tools.LanguageInfo;
    5454import org.openstreetmap.josm.tools.Logging;
     
    6969    private CustomConfigurator() {
    7070        // Hide default constructor for utils classes
    71     }
    72 
    73     /**
    74      * Log a formatted message.
    75      * @param fmt format
    76      * @param vars arguments
    77      * @see String#format
    78      * @deprecated to be removed end of 2017. Use {@link PreferencesUtils#log(String, Object...)} instead
    79      */
    80     @Deprecated
    81     public static void log(String fmt, Object... vars) {
    82         PreferencesUtils.log(fmt, vars);
    83     }
    84 
    85     /**
    86      * Log a message.
    87      * @param s message to log
    88      * @deprecated to be removed end of 2017. Use {@link PreferencesUtils#log(String)} instead
    89      */
    90     @Deprecated
    91     public static void log(String s) {
    92         PreferencesUtils.log(s);
    93     }
    94 
    95     /**
    96      * Log an exception.
    97      * @param e exception to log
    98      * @param s message prefix
    99      * @since 10469
    100      * @deprecated to be removed end of 2017. Use {@link PreferencesUtils#log(Exception, String)} instead
    101      */
    102     @Deprecated
    103     public static void log(Exception e, String s) {
    104         PreferencesUtils.log(e, s);
    105     }
    106 
    107     /**
    108      * Returns the log.
    109      * @return the log
    110      * @deprecated to be removed end of 2017. Use {@link PreferencesUtils#getLog()} instead
    111      */
    112     @Deprecated
    113     public static String getLog() {
    114         return PreferencesUtils.getLog();
    115     }
    116 
    117     /**
    118      * Resets the log.
    119      * @deprecated to be removed end of 2017. Use {@link PreferencesUtils#resetLog()} instead
    120      */
    121     @Deprecated
    122     public static void resetLog() {
    123         PreferencesUtils.resetLog();
    12471    }
    12572
  • trunk/src/org/openstreetmap/josm/gui/layer/Layer.java

    r13130 r13173  
    502502
    503503    /**
    504      * Check changed status of layer
    505      *
    506      * @return True if layer was changed since last paint
    507      * @deprecated This is not supported by multiple map views.
    508      * Fire an {@link #invalidate()} to trigger a repaint.
    509      */
    510     @Deprecated
    511     public boolean isChanged() {
    512         return false;
    513     }
    514 
    515     /**
    516504     * allows to check whether a projection is supported or not
    517505     * @param proj projection
  • trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/Marker.java

    r12881 r13173  
    2323import javax.swing.ImageIcon;
    2424
    25 import org.openstreetmap.josm.Main;
    26 import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent;
    2725import org.openstreetmap.josm.data.coor.CachedLatLon;
    2826import org.openstreetmap.josm.data.coor.EastNorth;
     
    3533import org.openstreetmap.josm.data.preferences.IntegerProperty;
    3634import org.openstreetmap.josm.gui.MapView;
     35import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent;
    3736import org.openstreetmap.josm.tools.ImageProvider;
    3837import org.openstreetmap.josm.tools.Logging;
     
    336335
    337336    /**
    338      * Returns the marker's projected coordinates.
    339      * @return The marker's projected coordinates (easting/northing)
    340      * @deprecated use {@link #getEastNorth(org.openstreetmap.josm.data.projection.Projecting)}
    341      */
    342     @Deprecated
    343     public final EastNorth getEastNorth() {
    344         return coor.getEastNorth(Main.getProjection());
    345     }
    346 
    347     /**
    348337     * Checks whether the marker display area contains the given point.
    349338     * Markers not interested in mouse clicks may always return false.
  • trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/AreaElement.java

    r12846 r13173  
    4848     * <p>
    4949     * Public access is discouraged.
    50      * @see StyledMapRenderer#drawArea(Way, Color, MapImage, Float, Float, boolean, TextLabel)
     50     * @see StyledMapRenderer#drawArea
    5151     */
    5252    public Float extent;
     
    5656     * <p>
    5757     * Public access is discouraged.
    58      * @see StyledMapRenderer#drawArea(Way, Color, MapImage, Float, Float, boolean, TextLabel)
     58     * @see StyledMapRenderer#drawArea
    5959     */
    6060    public Float extentThreshold;
  • trunk/src/org/openstreetmap/josm/gui/oauth/AbstractAuthorizationUI.java

    r12928 r13173  
    44import java.util.Objects;
    55
    6 import org.openstreetmap.josm.data.Preferences;
    76import org.openstreetmap.josm.data.oauth.OAuthParameters;
    87import org.openstreetmap.josm.data.oauth.OAuthToken;
     
    139138        pnlAdvancedProperties.initialize(paramApiUrl);
    140139    }
    141 
    142     /**
    143      * Initializes the authorisation UI with preference values in <code>pref</code>.
    144      *
    145      * @param pref the preferences. Must not be null.
    146      * @throws IllegalArgumentException if pref is null
    147      * @deprecated (since 12928) replaced by {@link #initialize(java.lang.String)}
    148      */
    149     @Deprecated
    150     public void initFromPreferences(Preferences pref) {
    151         CheckParameterUtil.ensureParameterNotNull(pref, "pref");
    152         pnlAdvancedProperties.initFromPreferences(pref);
    153     }
    154140}
  • trunk/src/org/openstreetmap/josm/gui/oauth/AdvancedOAuthPropertiesPanel.java

    r12928 r13173  
    1616import javax.swing.JOptionPane;
    1717
    18 import org.openstreetmap.josm.data.Preferences;
    1918import org.openstreetmap.josm.data.oauth.OAuthParameters;
    2019import org.openstreetmap.josm.gui.HelpAwareOptionPane;
     
    275274
    276275    /**
    277      * Initializes the panel from the values in the preferences <code>preferences</code>.
    278      *
    279      * @param pref the preferences. Must not be null.
    280      * @throws IllegalArgumentException if pref is null
    281      * @deprecated (since 12928) replaced by {@link #initialize(java.lang.String)}
    282      */
    283     @Deprecated
    284     public void initFromPreferences(Preferences pref) {
    285         CheckParameterUtil.ensureParameterNotNull(pref, "pref");
    286         setApiUrl(pref.get("osm-server.url"));
    287         boolean useDefault = pref.getBoolean("oauth.settings.use-default", true);
    288         ilUseDefault.setEnabled(false);
    289         if (useDefault) {
    290             resetToDefaultSettings();
    291         } else {
    292             setAdvancedParameters(OAuthParameters.createFromPreferences(pref));
    293         }
    294         ilUseDefault.setEnabled(true);
    295     }
    296 
    297     /**
    298276     * Remembers the current values in the preferences <code>pref</code>.
    299277     */
     
    304282        } else {
    305283            getAdvancedParameters().rememberPreferences();
    306         }
    307     }
    308 
    309     /**
    310      * Remembers the current values in the preferences <code>pref</code>.
    311      *
    312      * @param pref the preferences. Must not be null.
    313      * @throws IllegalArgumentException if pref is null.
    314      * @deprecated (since 12928) replaced by {@link #rememberPreferences()}
    315      */
    316     @Deprecated
    317     public void rememberPreferences(Preferences pref) {
    318         CheckParameterUtil.ensureParameterNotNull(pref, "pref");
    319         pref.putBoolean("oauth.settings.use-default", cbUseDefaults.isSelected());
    320         if (cbUseDefaults.isSelected()) {
    321             new OAuthParameters(null, null, null, null, null, null, null).rememberPreferences(pref);
    322         } else {
    323             getAdvancedParameters().rememberPreferences(pref);
    324284        }
    325285    }
  • trunk/src/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUI.java

    r12928 r13173  
    2929import javax.swing.text.html.HTMLEditorKit;
    3030
    31 import org.openstreetmap.josm.data.Preferences;
    3231import org.openstreetmap.josm.data.oauth.OAuthToken;
    3332import org.openstreetmap.josm.gui.HelpAwareOptionPane;
     
    174173    public void initialize(String paramApiUrl) {
    175174        super.initialize(paramApiUrl);
    176         CredentialsAgent cm = CredentialsManager.getInstance();
    177         try {
    178             PasswordAuthentication pa = cm.lookup(RequestorType.SERVER, OsmApi.getOsmApi().getHost());
    179             if (pa == null) {
    180                 tfUserName.setText("");
    181                 tfPassword.setText("");
    182             } else {
    183                 tfUserName.setText(pa.getUserName() == null ? "" : pa.getUserName());
    184                 tfPassword.setText(pa.getPassword() == null ? "" : String.valueOf(pa.getPassword()));
    185             }
    186         } catch (CredentialsAgentException e) {
    187             Logging.error(e);
    188             tfUserName.setText("");
    189             tfPassword.setText("");
    190         }
    191     }
    192 
    193     /**
    194      * Initializes the panel with values from the preferences
    195      * @param pref Preferences structure
    196      * @deprecated (since 12928) replaced by {@link #initialize(java.lang.String)}
    197      */
    198     @Deprecated
    199     @Override
    200     public void initFromPreferences(Preferences pref) {
    201         super.initFromPreferences(pref);
    202175        CredentialsAgent cm = CredentialsManager.getInstance();
    203176        try {
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/AbstractProjectionChoice.java

    r12293 r13173  
    5151    }
    5252
    53     /**
    54     * Get the cache directory name.
    55     * @return the cache directory name (base name)
    56     * @deprecated unused - remove in 2017-09
    57     */
    58     @Deprecated
    59     public String getCacheDir() {
    60         return cacheDir;
    61     }
    62 
    6353    @Override
    6454    public String toString() {
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/OverpassServerPreference.java

    r12816 r13173  
    7676        return true;
    7777    }
    78 
    79     /**
    80      * Returns the URL of the currently selected Overpass server.
    81      * @return the URL of the currently selected Overpass server.
    82      * @deprecated To be removed end of 2017. Use {@code OverpassDownloadReader.OVERPASS_SERVER.get()} instead
    83      */
    84     @Deprecated
    85     public static String getOverpassServer() {
    86         return OverpassDownloadReader.OVERPASS_SERVER.get();
    87     }
    88 
    89     /**
    90      * Returns true if objects should be fetched from an Overpass server instead of the OSM API.
    91      * @return true if objects should be fetched from an Overpass server instead of the OSM API.
    92      * @deprecated To be removed end of 2017. Use {@code OverpassDownloadReader.FOR_MULTI_FETCH.get()} instead
    93      */
    94     @Deprecated
    95     public static boolean useForMultiFetch() {
    96         return OverpassDownloadReader.FOR_MULTI_FETCH.get();
    97     }
    9878}
  • trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingComboBox.java

    r13139 r13173  
    1010import java.util.Collection;
    1111import java.util.Locale;
    12 import java.util.stream.Collectors;
    1312
    1413import javax.swing.ComboBoxEditor;
     
    254253        } else if (item instanceof AutoCompletionItem) {
    255254            cbEditor.setItem(((AutoCompletionItem) item).getValue());
    256         } else if (item instanceof AutoCompletionListItem) {
    257             cbEditor.setItem(((AutoCompletionListItem) item).getItem().getValue());
    258255        } else
    259256            throw new IllegalArgumentException("Unsupported item: "+item);
     
    271268        } else if (item instanceof AutoCompletionItem) {
    272269            super.setSelectedItem(item);
    273         } else if (item instanceof AutoCompletionListItem) {
    274             super.setSelectedItem(((AutoCompletionListItem) item).getItem());
    275270        } else if (item instanceof String) {
    276271            String s = (String) item;
     
    304299        this.getEditor().setItem(oldValue); // Do not use setSelectedItem(oldValue); (fix #8013)
    305300        autocompleteEnabled = true;
    306     }
    307 
    308     /**
    309      * Sets the items of the combobox to the given {@code AutoCompletionListItem}s.
    310      * @param elems AutoCompletionListItem items
    311      * @deprecated to be removed end of 2017. Use {@link #setPossibleAcItems(Collection)} instead
    312      */
    313     @Deprecated
    314     public void setPossibleACItems(Collection<AutoCompletionListItem> elems) {
    315         setPossibleAcItems(elems.stream().map(AutoCompletionListItem::getItem).collect(Collectors.toList()));
    316301    }
    317302
  • trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingTextField.java

    r13170 r13173  
    2020import javax.swing.text.StyleConstants;
    2121
     22import org.openstreetmap.josm.data.tagging.ac.AutoCompletionItem;
    2223import org.openstreetmap.josm.gui.util.CellEditorSupport;
    2324import org.openstreetmap.josm.gui.widgets.JosmTextField;
     
    2930 * can be used as table cell editor in {@link JTable}s.
    3031 *
    31  * Autocompletion is controlled by a list of {@link AutoCompletionListItem}s
     32 * Autocompletion is controlled by a list of {@link AutoCompletionItem}s
    3233 * managed in a {@link AutoCompletionList}.
    3334 *
  • trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionList.java

    r12859 r13173  
    55import java.util.Collection;
    66import java.util.Collections;
    7 import java.util.List;
    87import java.util.Set;
    9 import java.util.stream.Collectors;
    108
    119import javax.swing.JTable;
     
    5149
    5250    /**
    53      * applies a filter expression to the list of {@link AutoCompletionListItem}s.
     51     * applies a filter expression to the list of {@link AutoCompletionItem}s.
    5452     *
    5553     * The matching criterion is a case insensitive substring match.
     
    8179
    8280    /**
    83      * adds an {@link AutoCompletionListItem} to the list. Only adds the item if it
    84      * is not null and if not in the list yet.
    85      *
    86      * @param item the item
    87      * @deprecated To be removed end of 2017. Use {@link #add(AutoCompletionItem)} instead
    88      */
    89     @Deprecated
    90     public void add(AutoCompletionListItem item) {
    91         if (item == null)
    92             return;
    93         add(item.getItem());
    94     }
    95 
    96     /**
    9781     * adds an {@link AutoCompletionItem} to the list. Only adds the item if it
    9882     * is not null and if not in the list yet.
     
    135119
    136120    /**
    137      * adds a list of {@link AutoCompletionListItem} to this list. Only items which
    138      * are not null and which do not exist yet in the list are added.
    139      *
    140      * @param other a list of AutoCompletionListItem; must not be null
    141      * @throws IllegalArgumentException if other is null
    142      * @deprecated to be removed end of 2017. Use {@link #add(Collection)} instead
    143      */
    144     @Deprecated
    145     public void add(List<AutoCompletionListItem> other) {
    146         CheckParameterUtil.ensureParameterNotNull(other, "other");
    147         add(other.stream().map(AutoCompletionListItem::getItem).collect(Collectors.toList()));
    148     }
    149 
    150     /**
    151121     * adds a list of strings to this list. Only strings which
    152122     * are not null and which do not exist yet in the list are added.
     
    154124     * @param values a list of strings to add
    155125     * @param priority the priority to use
    156      * @deprecated to be removed end of 2017. Use {@link #add(Collection, AutoCompletionPriority)} instead
    157      */
    158     @Deprecated
    159     public void add(Collection<String> values, AutoCompletionItemPriority priority) {
    160         add(values, priority.getPriority());
    161     }
    162 
    163     /**
    164      * adds a list of strings to this list. Only strings which
    165      * are not null and which do not exist yet in the list are added.
    166      *
    167      * @param values a list of strings to add
    168      * @param priority the priority to use
    169126     * @since 12859
    170127     */
     
    183140            filter();
    184141        }
    185     }
    186 
    187     /**
    188      * checks whether a specific item is already in the list. Matches for the
    189      * the value <strong>and</strong> the priority of the item
    190      *
    191      * @param item the item to check
    192      * @return true, if item is in the list; false, otherwise
    193      * @deprecated to be removed end of 2017. Use {@link #contains(AutoCompletionItem)} instead
    194      */
    195     @Deprecated
    196     public boolean contains(AutoCompletionListItem item) {
    197         if (item == null)
    198             return false;
    199         return contains(item.getItem());
    200142    }
    201143
     
    264206     *
    265207     * @throws IndexOutOfBoundsException if idx is out of bounds
    266      * @deprecated to be removed end of 2017. Use {@link #getFilteredItemAt(int)} instead
    267      */
    268     @Deprecated
    269     public AutoCompletionListItem getFilteredItem(int idx) {
    270         return new AutoCompletionListItem(getFilteredItemAt(idx));
    271     }
    272 
    273     /**
    274      * replies the idx-th item from the list of filtered items
    275      * @param idx the index; must be in the range 0 &lt;= idx &lt; {@link #getFilteredSize()}
    276      * @return the item
    277      *
    278      * @throws IndexOutOfBoundsException if idx is out of bounds
    279208     * @since 12859
    280209     */
  • trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManager.java

    r13121 r13173  
    245245    /**
    246246     * replies the auto completion values allowed for a specific key. Replies
    247      * an empty list if key is null or if key is not in {@link #getKeys()}.
     247     * an empty list if key is null or if key is not in {@link #getTagKeys()}.
    248248     *
    249249     * @param key OSM key
     
    343343            list.addUserInput(getUserInputValues(key));
    344344        }
    345     }
    346 
    347     /**
    348      * Returns the currently cached tag keys.
    349      * @return a list of tag keys
    350      * @deprecated to be removed end of 2017. Use {@link #getTagKeys()} instead
    351      */
    352     @Deprecated
    353     public List<AutoCompletionListItem> getKeys() {
    354         return getTagKeys().stream().map(AutoCompletionListItem::new).collect(Collectors.toList());
    355     }
    356 
    357     /**
    358      * Returns the currently cached tag values for a given tag key.
    359      * @param key the tag key
    360      * @return a list of tag values
    361      * @deprecated to be removed end of 2017. Use {@link #getTagValues(String)} instead
    362      */
    363     @Deprecated
    364     public List<AutoCompletionListItem> getValues(String key) {
    365         return getTagValues(key).stream().map(AutoCompletionListItem::new).collect(Collectors.toList());
    366     }
    367 
    368     /**
    369      * Returns the currently cached tag values for a given list of tag keys.
    370      * @param keys the tag keys
    371      * @return a list of tag values
    372      * @deprecated to be removed end of 2017. Use {@link #getTagValues(List)} instead
    373      */
    374     @Deprecated
    375     public List<AutoCompletionListItem> getValues(List<String> keys) {
    376         return getTagValues(keys).stream().map(AutoCompletionListItem::new).collect(Collectors.toList());
    377345    }
    378346
  • 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.