Ignore:
Timestamp:
2014-11-25T22:14:29+01:00 (9 years ago)
Author:
Don-vip
Message:

see #10684 - fix deprecation warning

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

Legend:

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

    r6327 r7746  
    88import java.awt.event.KeyEvent;
    99
    10 import javax.swing.Icon;
    11 
    1210import org.openstreetmap.josm.Main;
     11import org.openstreetmap.josm.tools.ImageProvider;
    1312import org.openstreetmap.josm.tools.Shortcut;
    1413
     
    2524    public DialogsToggleAction() {
    2625        super(tr("Toggle dialogs panel"),
    27               (Icon) null, /* no icon */
     26              (ImageProvider) null, /* no icon */
    2827              tr("Toggle dialogs panel, maximize mapview"),
    2928              Shortcut.registerShortcut("menu:view:dialogspanel", tr("Toggle dialogs panel"),KeyEvent.VK_TAB, Shortcut.DIRECT),
  • trunk/src/org/openstreetmap/josm/actions/ToggleAction.java

    r7005 r7746  
    77
    88import javax.swing.ButtonModel;
    9 import javax.swing.Icon;
    109import javax.swing.JCheckBox;
    1110import javax.swing.JCheckBoxMenuItem;
     
    1514
    1615import org.openstreetmap.josm.Main;
     16import org.openstreetmap.josm.tools.ImageProvider;
    1717import org.openstreetmap.josm.tools.Shortcut;
    1818
     
    4040     * @param installAdapters false, if you don't want to install layer changed and selection changed adapters
    4141     */
    42     public ToggleAction(String name, Icon icon, String tooltip, Shortcut shortcut, boolean registerInToolbar, String toolbarId, boolean installAdapters) {
     42    public ToggleAction(String name, ImageProvider icon, String tooltip, Shortcut shortcut, boolean registerInToolbar, String toolbarId, boolean installAdapters) {
    4343        super(name, icon, tooltip, shortcut, registerInToolbar, toolbarId, installAdapters);
    4444        // It is required to set the SELECTED_KEY to a non-null value in order to let Swing components update it
     
    8282        }
    8383    }
    84    
     84
    8585    /**
    8686     * Adds a button model
     
    103103        }
    104104    }
    105    
     105
    106106    protected void notifySelectedState() {
    107107        boolean selected = isSelected();
     
    121121     */
    122122    protected final void toggleSelectedState(ActionEvent e) {
    123         if (e == null || !(e.getSource() instanceof JToggleButton || 
    124                            e.getSource() instanceof JCheckBox || 
    125                            e.getSource() instanceof JRadioButton || 
    126                            e.getSource() instanceof JCheckBoxMenuItem || 
    127                            e.getSource() instanceof JRadioButtonMenuItem 
     123        if (e == null || !(e.getSource() instanceof JToggleButton ||
     124                           e.getSource() instanceof JCheckBox ||
     125                           e.getSource() instanceof JRadioButton ||
     126                           e.getSource() instanceof JCheckBoxMenuItem ||
     127                           e.getSource() instanceof JRadioButtonMenuItem
    128128                           )) {
    129129            setSelected(!isSelected());
Note: See TracChangeset for help on using the changeset viewer.