Changeset 13130 in josm


Ignore:
Timestamp:
2017-11-19T20:12:24+01:00 (6 months ago)
Author:
Don-vip
Message:

fix #15572 - use ImageProvider attach API for all JOSM actions to ensure proper icon size everywhere

Location:
trunk/src/org/openstreetmap/josm
Files:
68 edited

Legend:

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

    r12846 r13130  
    160160                {
    161161                    putValue(SHORT_DESCRIPTION, tr("Add to selection"));
    162                     putValue(SMALL_ICON, ImageProvider.get("dialogs", "select"));
     162                    new ImageProvider("dialogs", "select").getResource().attachImageIcon(this, true);
    163163                }
    164164
  • trunk/src/org/openstreetmap/josm/actions/RenameLayerAction.java

    r12846 r13130  
    3939     */
    4040    public RenameLayerAction(File file, Layer layer) {
    41         super(tr("Rename layer"), ImageProvider.get("dialogs", "edit"));
     41        super(tr("Rename layer"));
     42        new ImageProvider("dialogs", "edit").getResource().attachImageIcon(this, true);
    4243        this.file = file;
    4344        this.layer = layer;
  • trunk/src/org/openstreetmap/josm/actions/ToggleUploadDiscouragedLayerAction.java

    r13072 r13130  
    3131     */
    3232    public ToggleUploadDiscouragedLayerAction(OsmDataLayer layer) {
    33         super(tr("Discourage upload"), ImageProvider.get("no_upload"));
     33        super(tr("Discourage upload"));
     34        new ImageProvider("no_upload").getResource().attachImageIcon(this, true);
    3435        this.layer = layer;
    3536        setEnabled(layer.isUploadable());
  • trunk/src/org/openstreetmap/josm/actions/relation/AddSelectionToRelations.java

    r12641 r13130  
    3131    */
    3232    public AddSelectionToRelations() {
    33         putValue(SMALL_ICON, ImageProvider.get("dialogs/conflict", "copyendright"));
     33        new ImageProvider("dialogs/conflict", "copyendright").getResource().attachImageIcon(this, true);
    3434        putValue(SHORT_DESCRIPTION, tr("Add all objects selected in the current dataset after the last member"));
    3535    }
  • trunk/src/org/openstreetmap/josm/actions/relation/DownloadMembersAction.java

    r12636 r13130  
    2828        putValue(SHORT_DESCRIPTION, tr("Download all members of the selected relations"));
    2929        putValue(NAME, tr("Download members"));
    30         putValue(SMALL_ICON, ImageProvider.get("dialogs", "downloadincomplete"));
     30        new ImageProvider("dialogs", "downloadincomplete").getResource().attachImageIcon(this, true);
    3131        putValue("help", ht("/Dialog/RelationList#DownloadMembers"));
    3232    }
  • trunk/src/org/openstreetmap/josm/actions/relation/DownloadSelectedIncompleteMembersAction.java

    r12636 r13130  
    3131    public DownloadSelectedIncompleteMembersAction() {
    3232        putValue(SHORT_DESCRIPTION, tr("Download incomplete members of selected relations"));
    33         putValue(SMALL_ICON, ImageProvider.get("dialogs/relation", "downloadincompleteselected"));
     33        new ImageProvider("dialogs/relation", "downloadincompleteselected").getResource().attachImageIcon(this, true);
    3434        putValue(NAME, tr("Download incomplete members"));
    3535    }
  • trunk/src/org/openstreetmap/josm/actions/relation/SelectInRelationListAction.java

    r12630 r13130  
    2222        putValue(NAME, tr("Select in relation list"));
    2323        putValue(SHORT_DESCRIPTION, tr("Select relation in relation list."));
    24         putValue(SMALL_ICON, ImageProvider.get("dialogs", "selectionlist"));
     24        new ImageProvider("dialogs", "selectionlist").getResource().attachImageIcon(this, true);
    2525    }
    2626
  • trunk/src/org/openstreetmap/josm/actions/relation/SelectMembersAction.java

    r12636 r13130  
    2929        putValue(SHORT_DESCRIPTION, add ? tr("Add the members of all selected relations to current selection")
    3030                : tr("Select the members of all selected relations"));
    31         putValue(SMALL_ICON, ImageProvider.get("selectall"));
     31        new ImageProvider("selectall").getResource().attachImageIcon(this, true);
    3232        putValue(NAME, add ? tr("Select members (add)") : tr("Select members"));
    3333        this.add = add;
  • trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java

    r12678 r13130  
    552552            putValue(SHORT_DESCRIPTION, tr("Show help information"));
    553553            putValue(NAME, tr("Help"));
    554             putValue(SMALL_ICON, ImageProvider.get("help"));
     554            new ImageProvider("help").getResource().attachImageIcon(this, true);
    555555            setEnabled(!Main.isOffline(OnlineResource.JOSM_WEBSITE));
    556556        }
  • trunk/src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java

    r12620 r13130  
    506506        class ApplyTileAddressAction extends AbstractAction {
    507507            ApplyTileAddressAction() {
    508                 putValue(SMALL_ICON, ImageProvider.get("apply"));
     508                new ImageProvider("apply").getResource().attachImageIcon(this, true);
    509509                putValue(SHORT_DESCRIPTION, tr("Apply the tile address"));
    510510            }
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/AbstractListMerger.java

    r12636 r13130  
    1818import javax.swing.AbstractAction;
    1919import javax.swing.Action;
    20 import javax.swing.ImageIcon;
    2120import javax.swing.JButton;
    2221import javax.swing.JCheckBox;
     
    4241import org.openstreetmap.josm.gui.widgets.OsmPrimitivesTable;
    4342import org.openstreetmap.josm.tools.ImageProvider;
     43import org.openstreetmap.josm.tools.ImageResource;
    4444
    4545/**
     
    422422
    423423        protected CopyAction(String iconName, String actionName, String shortDescription) {
    424             ImageIcon icon = ImageProvider.get("dialogs/conflict", iconName);
    425             putValue(Action.SMALL_ICON, icon);
     424            ImageResource icon = new ImageProvider("dialogs/conflict", iconName).getResource();
    426425            if (icon == null) {
    427426                putValue(Action.NAME, actionName);
     427            } else {
     428                icon.attachImageIcon(this, true);
    428429            }
    429430            putValue(Action.SHORT_DESCRIPTION, shortDescription);
     
    627628
    628629        CopyAllLeft() {
    629             ImageIcon icon = ImageProvider.get("dialogs/conflict", "useallleft");
    630             putValue(Action.SMALL_ICON, icon);
     630            new ImageProvider("dialogs/conflict", "useallleft").getResource().attachImageIcon(this, true);
    631631            putValue(Action.SHORT_DESCRIPTION, tr("Copy all my elements to the target"));
    632632        }
     
    656656
    657657        CopyAllRight() {
    658             ImageIcon icon = ImageProvider.get("dialogs/conflict", "useallright");
    659             putValue(Action.SMALL_ICON, icon);
     658            new ImageProvider("dialogs/conflict", "useallright").getResource().attachImageIcon(this, true);
    660659            putValue(Action.SHORT_DESCRIPTION, tr("Copy all their elements to the target"));
    661660        }
     
    685684
    686685        MoveUpMergedAction() {
    687             ImageIcon icon = ImageProvider.get("dialogs/conflict", "moveup");
    688             putValue(Action.SMALL_ICON, icon);
     686            ImageResource icon = new ImageProvider("dialogs/conflict", "moveup").getResource();
    689687            if (icon == null) {
    690688                putValue(Action.NAME, tr("Up"));
     689            } else {
     690                icon.attachImageIcon(this, true);
    691691            }
    692692            putValue(Action.SHORT_DESCRIPTION, tr("Move up the selected entries by one position."));
     
    717717
    718718        MoveDownMergedAction() {
    719             ImageIcon icon = ImageProvider.get("dialogs/conflict", "movedown");
    720             putValue(Action.SMALL_ICON, icon);
     719            ImageResource icon = new ImageProvider("dialogs/conflict", "movedown").getResource();
    721720            if (icon == null) {
    722721                putValue(Action.NAME, tr("Down"));
     722            } else {
     723                icon.attachImageIcon(this, true);
    723724            }
    724725            putValue(Action.SHORT_DESCRIPTION, tr("Move down the selected entries by one position."));
     
    749750
    750751        RemoveMergedAction() {
    751             ImageIcon icon = ImageProvider.get("dialogs/conflict", "remove");
    752             putValue(Action.SMALL_ICON, icon);
     752            ImageResource icon = new ImageProvider("dialogs/conflict", "remove").getResource();
    753753            if (icon == null) {
    754754                putValue(Action.NAME, tr("Remove"));
     755            } else {
     756                icon.attachImageIcon(this, true);
    755757            }
    756758            putValue(Action.SHORT_DESCRIPTION, tr("Remove the selected entries from the list of merged elements."));
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMerger.java

    r12663 r13130  
    346346    class KeepMyCoordinatesAction extends AbstractAction implements ChangeListener {
    347347        KeepMyCoordinatesAction() {
    348             putValue(Action.SMALL_ICON, ImageProvider.get("dialogs/conflict", "tagkeepmine"));
     348            new ImageProvider("dialogs/conflict", "tagkeepmine").getResource().attachImageIcon(this, true);
    349349            putValue(Action.SHORT_DESCRIPTION, tr("Keep my coordinates"));
    350350        }
     
    363363    class KeepTheirCoordinatesAction extends AbstractAction implements ChangeListener {
    364364        KeepTheirCoordinatesAction() {
    365             putValue(Action.SMALL_ICON, ImageProvider.get("dialogs/conflict", "tagkeeptheir"));
     365            new ImageProvider("dialogs/conflict", "tagkeeptheir").getResource().attachImageIcon(this, true);
    366366            putValue(Action.SHORT_DESCRIPTION, tr("Keep their coordinates"));
    367367        }
     
    380380    class UndecideCoordinateConflictAction extends AbstractAction implements ChangeListener {
    381381        UndecideCoordinateConflictAction() {
    382             putValue(Action.SMALL_ICON, ImageProvider.get("dialogs/conflict", "tagundecide"));
     382            new ImageProvider("dialogs/conflict", "tagundecide").getResource().attachImageIcon(this, true);
    383383            putValue(Action.SHORT_DESCRIPTION, tr("Undecide conflict between different coordinates"));
    384384        }
     
    397397    class KeepMyDeletedStateAction extends AbstractAction implements ChangeListener {
    398398        KeepMyDeletedStateAction() {
    399             putValue(Action.SMALL_ICON, ImageProvider.get("dialogs/conflict", "tagkeepmine"));
     399            new ImageProvider("dialogs/conflict", "tagkeepmine").getResource().attachImageIcon(this, true);
    400400            putValue(Action.SHORT_DESCRIPTION, tr("Keep my deleted state"));
    401401        }
     
    414414    class KeepTheirDeletedStateAction extends AbstractAction implements ChangeListener {
    415415        KeepTheirDeletedStateAction() {
    416             putValue(Action.SMALL_ICON, ImageProvider.get("dialogs/conflict", "tagkeeptheir"));
     416            new ImageProvider("dialogs/conflict", "tagkeeptheir").getResource().attachImageIcon(this, true);
    417417            putValue(Action.SHORT_DESCRIPTION, tr("Keep their deleted state"));
    418418        }
     
    431431    class UndecideDeletedStateConflictAction extends AbstractAction implements ChangeListener {
    432432        UndecideDeletedStateConflictAction() {
    433             putValue(Action.SMALL_ICON, ImageProvider.get("dialogs/conflict", "tagundecide"));
     433            new ImageProvider("dialogs/conflict", "tagundecide").getResource().attachImageIcon(this, true);
    434434            putValue(Action.SHORT_DESCRIPTION, tr("Undecide conflict between deleted state"));
    435435        }
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/tags/TagMerger.java

    r12050 r13130  
    1717import javax.swing.AbstractAction;
    1818import javax.swing.Action;
    19 import javax.swing.ImageIcon;
    2019import javax.swing.JButton;
    2120import javax.swing.JComponent;
     
    3332import org.openstreetmap.josm.tools.GBC;
    3433import org.openstreetmap.josm.tools.ImageProvider;
     34import org.openstreetmap.josm.tools.ImageResource;
    3535
    3636/**
     
    180180    class KeepMineAction extends AbstractAction implements ListSelectionListener {
    181181        KeepMineAction() {
    182             ImageIcon icon = ImageProvider.get("dialogs/conflict", "tagkeepmine");
     182            ImageResource icon = new ImageProvider("dialogs/conflict", "tagkeepmine").getResource();
    183183            if (icon != null) {
    184                 putValue(Action.SMALL_ICON, icon);
     184                icon.attachImageIcon(this, true);
    185185                putValue(Action.NAME, "");
    186186            } else {
     
    212212    class KeepTheirAction extends AbstractAction implements ListSelectionListener {
    213213        KeepTheirAction() {
    214             ImageIcon icon = ImageProvider.get("dialogs/conflict", "tagkeeptheir");
     214            ImageResource icon = new ImageProvider("dialogs/conflict", "tagkeeptheir").getResource();
    215215            if (icon != null) {
    216                 putValue(Action.SMALL_ICON, icon);
     216                icon.attachImageIcon(this, true);
    217217                putValue(Action.NAME, "");
    218218            } else {
     
    310310
    311311        UndecideAction() {
    312             ImageIcon icon = ImageProvider.get("dialogs/conflict", "tagundecide");
     312            ImageResource icon = new ImageProvider("dialogs/conflict", "tagundecide").getResource();
    313313            if (icon != null) {
    314                 putValue(Action.SMALL_ICON, icon);
     314                icon.attachImageIcon(this, true);
    315315                putValue(Action.NAME, "");
    316316            } else {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListPopup.java

    r12301 r13130  
    4444         */
    4545        public InfoAction(Layer layer) {
    46             super(tr("Info"), ImageProvider.get("info"));
     46            super(tr("Info"));
     47            new ImageProvider("info").getResource().attachImageIcon(this, true);
    4748            putValue("help", ht("/Action/LayerInfo"));
    4849            this.layer = layer;
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanel.java

    r12636 r13130  
    295295        DownloadObjectAction() {
    296296            putValue(NAME, tr("Download objects"));
    297             putValue(SMALL_ICON, ImageProvider.get("downloadprimitive"));
     297            new ImageProvider("downloadprimitive").getResource().attachImageIcon(this, true);
    298298            putValue(SHORT_DESCRIPTION, tr("Download the current version of the selected objects"));
    299299            updateEnabledState();
  • trunk/src/org/openstreetmap/josm/gui/dialogs/layer/DuplicateAction.java

    r12636 r13130  
    4545        this.model = model;
    4646        putValue(NAME, tr("Duplicate"));
    47         putValue(SMALL_ICON, ImageProvider.get("dialogs", "duplicatelayer"));
     47        new ImageProvider("dialogs", "duplicatelayer").getResource().attachImageIcon(this, true);
    4848        putValue(SHORT_DESCRIPTION, tr("Duplicate this layer"));
    4949        putValue("help", HelpUtil.ht("/Dialog/LayerList#DuplicateLayer"));
  • trunk/src/org/openstreetmap/josm/gui/dialogs/layer/ShowHideLayerAction.java

    r12799 r13130  
    3939        this.model = model;
    4040        putValue(NAME, tr("Show/hide"));
    41         putValue(SMALL_ICON, ImageProvider.get("dialogs", "showhide"));
     41        new ImageProvider("dialogs", "showhide").getResource().attachImageIcon(this, true);
    4242        putValue(SHORT_DESCRIPTION, tr("Toggle visible state of the selected layer."));
    4343        putValue("help", HelpUtil.ht("/Dialog/LayerList#ShowHideLayer"));
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

    r12881 r13130  
    6363import org.openstreetmap.josm.command.ChangePropertyCommand;
    6464import org.openstreetmap.josm.command.Command;
    65 import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;
    6665import org.openstreetmap.josm.data.SelectionChangedListener;
    6766import org.openstreetmap.josm.data.osm.DefaultNameFormatter;
     
    101100import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher;
    102101import org.openstreetmap.josm.spi.preferences.Config;
     102import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;
    103103import org.openstreetmap.josm.tools.AlphanumComparator;
    104104import org.openstreetmap.josm.tools.GBC;
     
    11261126            putValue(NAME, tr("Go to OSM wiki for tag help"));
    11271127            putValue(SHORT_DESCRIPTION, tr("Launch browser with wiki help for selected object"));
    1128             putValue(SMALL_ICON, ImageProvider.get("dialogs", "search"));
     1128            new ImageProvider("dialogs", "search").getResource().attachImageIcon(this, true);
    11291129            putValue(ACCELERATOR_KEY, getKeyStroke());
    11301130        }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java

    r12675 r13130  
    177177        EditAction() {
    178178            putValue(SHORT_DESCRIPTION, tr("Edit the relation the currently selected relation member refers to."));
    179             putValue(SMALL_ICON, ImageProvider.get("dialogs", "edit"));
     179            new ImageProvider("dialogs", "edit").getResource().attachImageIcon(this, true);
    180180            putValue(NAME, tr("Edit"));
    181181            refreshEnabled();
     
    222222        DownloadAllChildRelationsAction() {
    223223            putValue(SHORT_DESCRIPTION, tr("Download all child relations (recursively)"));
    224             putValue(SMALL_ICON, ImageProvider.get("download"));
     224            new ImageProvider("download").getResource().attachImageIcon(this, true);
    225225            putValue(NAME, tr("Download All Children"));
    226226        }
     
    245245            putValue(SHORT_DESCRIPTION, tr("Download selected relations"));
    246246            // FIXME: replace with better icon
    247             //
    248             putValue(SMALL_ICON, ImageProvider.get("download"));
     247            new ImageProvider("download").getResource().attachImageIcon(this, true);
    249248            putValue(NAME, tr("Download Selected Children"));
    250249            updateEnabledState();
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/AddSelectedAfterSelection.java

    r12620 r13130  
    2828        super(null, memberTableModel, null, selectionTableModel, null, null, editor);
    2929        putValue(SHORT_DESCRIPTION, tr("Add all objects selected in the current dataset after the last selected member"));
    30         putValue(SMALL_ICON, ImageProvider.get("dialogs/conflict", "copyaftercurrentright"));
     30        new ImageProvider("dialogs/conflict", "copyaftercurrentright").getResource().attachImageIcon(this, true);
    3131        updateEnabledState();
    3232    }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/AddSelectedAtEndAction.java

    r12620 r13130  
    2828        super(null, memberTableModel, null, selectionTableModel, null, null, editor);
    2929        putValue(SHORT_DESCRIPTION, tr("Add all objects selected in the current dataset after the last member"));
    30         putValue(SMALL_ICON, ImageProvider.get("dialogs/conflict", "copyendright"));
     30        new ImageProvider("dialogs/conflict", "copyendright").getResource().attachImageIcon(this, true);
    3131        updateEnabledState();
    3232    }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/AddSelectedAtStartAction.java

    r12620 r13130  
    2828        super(null, memberTableModel, null, selectionTableModel, null, null, editor);
    2929        putValue(SHORT_DESCRIPTION, tr("Add all objects selected in the current dataset before the first member"));
    30         putValue(SMALL_ICON, ImageProvider.get("dialogs/conflict", "copystartright"));
     30        new ImageProvider("dialogs/conflict", "copystartright").getResource().attachImageIcon(this, true);
    3131        updateEnabledState();
    3232    }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/AddSelectedBeforeSelection.java

    r12620 r13130  
    2828        super(null, memberTableModel, null, selectionTableModel, null, null, editor);
    2929        putValue(SHORT_DESCRIPTION, tr("Add all objects selected in the current dataset before the first selected member"));
    30         putValue(SMALL_ICON, ImageProvider.get("dialogs/conflict", "copybeforecurrentright"));
     30        new ImageProvider("dialogs/conflict", "copybeforecurrentright").getResource().attachImageIcon(this, true);
    3131        updateEnabledState();
    3232    }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/ApplyAction.java

    r10152 r13130  
    3535        super(memberTable, memberTableModel, tagModel, layer, editor, null);
    3636        putValue(SHORT_DESCRIPTION, tr("Apply the current updates"));
    37         putValue(SMALL_ICON, ImageProvider.get("save"));
     37        new ImageProvider("save").getResource().attachImageIcon(this, true);
    3838        putValue(NAME, tr("Apply"));
    3939        updateEnabledState();
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/DeleteCurrentRelationAction.java

    r9665 r13130  
    2929        super(null, null, null, layer, editor);
    3030        putValue(SHORT_DESCRIPTION, tr("Delete the currently edited relation"));
    31         putValue(SMALL_ICON, ImageProvider.get("dialogs", "delete"));
     31        new ImageProvider("dialogs", "delete").getResource().attachImageIcon(this, true);
    3232        putValue(NAME, tr("Delete"));
    3333        updateEnabledState();
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/DownloadIncompleteMembersAction.java

    r12634 r13130  
    4040        sc.setAccelerator(this);
    4141        putValue(SHORT_DESCRIPTION, Main.platform.makeTooltip(tr("Download all incomplete members"), sc));
    42         putValue(SMALL_ICON, ImageProvider.get("dialogs/relation", "downloadincomplete"));
     42        new ImageProvider("dialogs/relation", "downloadincomplete").getResource().attachImageIcon(this, true);
    4343        putValue(NAME, tr("Download Members"));
    4444        updateEnabledState();
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/DownloadSelectedIncompleteMembersAction.java

    r12634 r13130  
    3535        super(memberTable, memberTableModel, actionMapKey, layer, editor);
    3636        putValue(SHORT_DESCRIPTION, tr("Download selected incomplete members"));
    37         putValue(SMALL_ICON, ImageProvider.get("dialogs/relation", "downloadincompleteselected"));
     37        new ImageProvider("dialogs/relation", "downloadincompleteselected").getResource().attachImageIcon(this, true);
    3838        putValue(NAME, tr("Download Members"));
    3939        updateEnabledState();
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/DuplicateRelationAction.java

    r9665 r13130  
    3333        putValue(SHORT_DESCRIPTION, tr("Create a copy of this relation and open it in another editor window"));
    3434        // FIXME provide an icon
    35         putValue(SMALL_ICON, ImageProvider.get("duplicate"));
     35        new ImageProvider("duplicate").getResource().attachImageIcon(this, true);
    3636        putValue(NAME, tr("Duplicate"));
    3737        setEnabled(true);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/EditAction.java

    r9665 r13130  
    3232        super(memberTable, memberTableModel, null, layer, null);
    3333        putValue(SHORT_DESCRIPTION, tr("Edit the relation the currently selected relation member refers to"));
    34         putValue(SMALL_ICON, ImageProvider.get("dialogs", "edit"));
     34        new ImageProvider("dialogs", "edit").getResource().attachImageIcon(this, true);
    3535        updateEnabledState();
    3636    }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/MoveDownAction.java

    r9665 r13130  
    2727    public MoveDownAction(MemberTable memberTable, MemberTableModel memberTableModel, String actionMapKey) {
    2828        super(memberTable, memberTableModel, actionMapKey);
    29         putValue(SMALL_ICON, ImageProvider.get("dialogs", "movedown"));
     29        new ImageProvider("dialogs", "movedown").getResource().attachImageIcon(this, true);
    3030        Shortcut sc = Shortcut.registerShortcut("relationeditor:movedown", tr("Relation Editor: Move Down"), KeyEvent.VK_DOWN, Shortcut.ALT);
    3131        sc.setAccelerator(this);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/MoveUpAction.java

    r9665 r13130  
    2727    public MoveUpAction(MemberTable memberTable, MemberTableModel memberTableModel, String actionMapKey) {
    2828        super(memberTable, memberTableModel, actionMapKey);
    29         putValue(SMALL_ICON, ImageProvider.get("dialogs", "moveup"));
     29        new ImageProvider("dialogs", "moveup").getResource().attachImageIcon(this, true);
    3030        Shortcut sc = Shortcut.registerShortcut("relationeditor:moveup", tr("Relation Editor: Move Up"), KeyEvent.VK_UP, Shortcut.ALT);
    3131        sc.setAccelerator(this);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/RefreshAction.java

    r12718 r13130  
    4545        // CHECKSTYLE.ON: LineLength
    4646        putValue(SHORT_DESCRIPTION, Main.platform.makeTooltip(tr("Refresh relation from data layer"), sc));
    47         putValue(SMALL_ICON, ImageProvider.get("dialogs/refresh"));
     47        new ImageProvider("dialogs/refresh").getResource().attachImageIcon(this, true);
    4848        putValue(NAME, tr("Refresh"));
    4949        if (editor instanceof JComponent) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/RemoveAction.java

    r9665 r13130  
    2727    public RemoveAction(MemberTable memberTable, MemberTableModel memberTableModel, String actionMapKey) {
    2828        super(memberTable, memberTableModel, actionMapKey);
    29         putValue(SMALL_ICON, ImageProvider.get("dialogs", "delete"));
     29        new ImageProvider("dialogs", "delete").getResource().attachImageIcon(this, true);
    3030        putValue(NAME, tr("Remove"));
    3131        Shortcut sc = Shortcut.registerShortcut("relationeditor:remove", tr("Relation Editor: Remove"), KeyEvent.VK_DELETE, Shortcut.ALT);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/RemoveSelectedAction.java

    r10383 r13130  
    2727        super(null, memberTableModel, null, selectionTableModel, null, layer, null);
    2828        putValue(SHORT_DESCRIPTION, tr("Remove all members referring to one of the selected objects"));
    29         putValue(SMALL_ICON, ImageProvider.get("dialogs/relation", "deletemembers"));
     29        new ImageProvider("dialogs/relation", "deletemembers").getResource().attachImageIcon(this, true);
    3030        updateEnabledState();
    3131    }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/ReverseAction.java

    r9991 r13130  
    2424        super(memberTable, memberTableModel, null);
    2525        putValue(SHORT_DESCRIPTION, tr("Reverse the order of the relation members"));
    26         putValue(SMALL_ICON, ImageProvider.get("dialogs/relation", "reverse"));
     26        new ImageProvider("dialogs/relation", "reverse").getResource().attachImageIcon(this, true);
    2727        putValue(NAME, tr("Reverse"));
    2828        updateEnabledState();
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SelectPrimitivesForSelectedMembersAction.java

    r9665 r13130  
    2727        super(memberTable, memberTableModel, null, layer, null);
    2828        putValue(SHORT_DESCRIPTION, tr("Select objects for selected relation members"));
    29         putValue(SMALL_ICON, ImageProvider.get("dialogs/relation", "selectprimitives"));
     29        new ImageProvider("dialogs/relation", "selectprimitives").getResource().attachImageIcon(this, true);
    3030        updateEnabledState();
    3131    }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SelectedMembersForSelectionAction.java

    r9665 r13130  
    2626        super(null, memberTableModel, null, selectionTableModel, null, layer, null);
    2727        putValue(SHORT_DESCRIPTION, tr("Select relation members which refer to objects in the current selection"));
    28         putValue(SMALL_ICON, ImageProvider.get("dialogs/relation", "selectmembers"));
     28        new ImageProvider("dialogs/relation", "selectmembers").getResource().attachImageIcon(this, true);
    2929        updateEnabledState();
    3030    }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SortAction.java

    r9665 r13130  
    2626    public SortAction(MemberTable memberTable, MemberTableModel memberTableModel) {
    2727        super(memberTable, memberTableModel, null);
    28         putValue(SMALL_ICON, ImageProvider.get("dialogs", "sort"));
     28        new ImageProvider("dialogs", "sort").getResource().attachImageIcon(this, true);
    2929        putValue(NAME, tr("Sort"));
    3030        Shortcut sc = Shortcut.registerShortcut("relationeditor:sort", tr("Relation Editor: Sort"), KeyEvent.VK_END, Shortcut.ALT);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SortBelowAction.java

    r9665 r13130  
    2323    public SortBelowAction(MemberTable memberTable, MemberTableModel memberTableModel) {
    2424        super(memberTable, memberTableModel, null);
    25         putValue(SMALL_ICON, ImageProvider.get("dialogs", "sort_below"));
     25        new ImageProvider("dialogs", "sort_below").getResource().attachImageIcon(this, true);
    2626        putValue(NAME, tr("Sort below"));
    2727        putValue(SHORT_DESCRIPTION, tr("Sort the selected relation members and all members below"));
  • trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java

    r12743 r13130  
    180180        AddAction() {
    181181            putValue(NAME, tr("Create bookmark"));
    182             putValue(SMALL_ICON, ImageProvider.get("dialogs", "bookmark-new"));
     182            new ImageProvider("dialogs", "bookmark-new").getResource().attachImageIcon(this, true);
    183183            putValue(SHORT_DESCRIPTION, tr("Add a bookmark for the currently selected download area"));
    184184        }
     
    215215         */
    216216        RemoveAction() {
    217             putValue(SMALL_ICON, ImageProvider.get("dialogs", "delete"));
     217            new ImageProvider("dialogs", "delete").getResource().attachImageIcon(this, true);
    218218            putValue(SHORT_DESCRIPTION, tr("Remove the currently selected bookmarks"));
    219219            updateEnabledState();
     
    246246         */
    247247        RenameAction() {
    248             putValue(SMALL_ICON, ImageProvider.get("dialogs", "edit"));
     248            new ImageProvider("dialogs", "edit").getResource().attachImageIcon(this, true);
    249249            putValue(SHORT_DESCRIPTION, tr("Rename the currently selected bookmark"));
    250250            updateEnabledState();
     
    288288         */
    289289        RefreshAction() {
    290             putValue(SMALL_ICON, ImageProvider.get("dialogs/changeset", "downloadchangeset"));
     290            new ImageProvider("dialogs/changeset", "downloadchangeset").getResource().attachImageIcon(this, true);
    291291            putValue(SHORT_DESCRIPTION, tr("Download bookmarks for my {0} last changesets", BookmarkList.MAX_CHANGESET_BOOKMARKS.get()));
    292292            setEnabled(!UserIdentityManager.getInstance().isAnonymous());
  • trunk/src/org/openstreetmap/josm/gui/download/OverpassDownloadSource.java

    r13051 r13130  
    286286             */
    287287            AddSnippetAction() {
    288                 super();
    289                 putValue(SMALL_ICON, ImageProvider.get(ACTION_IMG_SUBDIR, "add"));
     288                new ImageProvider(ACTION_IMG_SUBDIR, "add").getResource().attachImageIcon(this, true);
    290289                putValue(SHORT_DESCRIPTION, tr("Add new snippet"));
    291290            }
     
    306305             */
    307306            RemoveSnippetAction() {
    308                 super();
    309                 putValue(SMALL_ICON, ImageProvider.get(ACTION_IMG_SUBDIR, "delete"));
     307                new ImageProvider(ACTION_IMG_SUBDIR, "delete").getResource().attachImageIcon(this, true);
    310308                putValue(SHORT_DESCRIPTION, tr("Delete selected snippet"));
    311309                checkEnabled();
     
    340338            EditSnippetAction() {
    341339                super();
    342                 putValue(SMALL_ICON, ImageProvider.get(ACTION_IMG_SUBDIR, "edit"));
     340                new ImageProvider(ACTION_IMG_SUBDIR, "edit").getResource().attachImageIcon(this, true);
    343341                putValue(SHORT_DESCRIPTION, tr("Edit selected snippet"));
    344342                checkEnabled();
  • trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java

    r12846 r13130  
    180180        SearchAction() {
    181181            putValue(NAME, tr("Search ..."));
    182             putValue(SMALL_ICON, ImageProvider.get("dialogs", "search"));
     182            new ImageProvider("dialogs", "search").getResource().attachImageIcon(this, true);
    183183            putValue(SHORT_DESCRIPTION, tr("Click to start searching for places"));
    184184            updateEnabledState();
  • trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java

    r12678 r13130  
    431431            super(browser);
    432432            putValue(SHORT_DESCRIPTION, tr("Open the current help page in an external browser"));
    433             putValue(SMALL_ICON, ImageProvider.get("help", "internet"));
     433            new ImageProvider("help", "internet").getResource().attachImageIcon(this, true);
    434434        }
    435435
     
    449449            super(browser);
    450450            putValue(SHORT_DESCRIPTION, tr("Edit the current help page"));
    451             putValue(SMALL_ICON, ImageProvider.get("dialogs", "edit"));
     451            new ImageProvider("dialogs", "edit").getResource().attachImageIcon(this, true);
    452452        }
    453453
     
    489489            super(browser);
    490490            putValue(SHORT_DESCRIPTION, tr("Reload the current help page"));
    491             putValue(SMALL_ICON, ImageProvider.get("dialogs", "refresh"));
     491            new ImageProvider("dialogs", "refresh").getResource().attachImageIcon(this, true);
    492492        }
    493493
     
    508508            browser.getHistory().addChangeListener(this);
    509509            putValue(SHORT_DESCRIPTION, tr("Go to the previous page"));
    510             putValue(SMALL_ICON, ImageProvider.get("help", "previous"));
     510            new ImageProvider("help", "previous").getResource().attachImageIcon(this, true);
    511511            setEnabled(browser.getHistory().canGoBack());
    512512        }
     
    533533            browser.getHistory().addChangeListener(this);
    534534            putValue(SHORT_DESCRIPTION, tr("Go to the next page"));
    535             putValue(SMALL_ICON, ImageProvider.get("help", "next"));
     535            new ImageProvider("help", "next").getResource().attachImageIcon(this, true);
    536536            setEnabled(browser.getHistory().canGoForward());
    537537        }
     
    557557            super(browser);
    558558            putValue(SHORT_DESCRIPTION, tr("Go to the JOSM help home page"));
    559             putValue(SMALL_ICON, ImageProvider.get("help", "home"));
     559            new ImageProvider("help", "home").getResource().attachImageIcon(this, true);
    560560        }
    561561
  • trunk/src/org/openstreetmap/josm/gui/history/NodeListViewer.java

    r12636 r13130  
    240240            putValue(NAME, tr("Zoom to node"));
    241241            putValue(SHORT_DESCRIPTION, tr("Zoom to this node in the current data layer"));
    242             putValue(SMALL_ICON, ImageProvider.get("dialogs", "zoomin"));
     242            new ImageProvider("dialogs", "zoomin").getResource().attachImageIcon(this, true);
    243243        }
    244244
     
    285285            putValue(NAME, tr("Show history"));
    286286            putValue(SHORT_DESCRIPTION, tr("Open a history browser with the history of this node"));
    287             putValue(SMALL_ICON, ImageProvider.get("dialogs", "history"));
     287            new ImageProvider("dialogs", "history").getResource().attachImageIcon(this, true);
    288288        }
    289289
  • trunk/src/org/openstreetmap/josm/gui/history/VersionInfoPanel.java

    r13014 r13130  
    307307
    308308        OpenChangesetDialogAction(Class<? extends JComponent> componentToSelect) {
    309             super(tr("Changeset"), new ImageProvider("dialogs/changeset", "changesetmanager").resetMaxSize(new Dimension(16, 16)).get());
     309            super(tr("Changeset"));
     310            new ImageProvider("dialogs/changeset", "changesetmanager").resetMaxSize(new Dimension(16, 16))
     311                .getResource().attachImageIcon(this, true);
    310312            putValue(SHORT_DESCRIPTION, tr("Opens the Changeset Manager window for the selected changesets"));
    311313            this.componentToSelect = componentToSelect;
  • trunk/src/org/openstreetmap/josm/gui/history/VersionTable.java

    r12846 r13130  
    155155            putValue(NAME, tr("Changeset info"));
    156156            putValue(SHORT_DESCRIPTION, tr("Launch browser with information about the changeset"));
    157             putValue(SMALL_ICON, ImageProvider.get("data/changeset"));
     157            new ImageProvider("data/changeset").getResource().attachImageIcon(this, true);
    158158        }
    159159
     
    192192            putValue(NAME, tr("User info"));
    193193            putValue(SHORT_DESCRIPTION, tr("Launch browser with information about the user"));
    194             putValue(SMALL_ICON, ImageProvider.get("data/user"));
     194            new ImageProvider("data/user").getResource().attachImageIcon(this, true);
    195195        }
    196196
  • trunk/src/org/openstreetmap/josm/gui/io/ChangesetManagementPanel.java

    r12846 r13130  
    295295        RefreshAction() {
    296296            putValue(SHORT_DESCRIPTION, tr("Load the list of your open changesets from the server"));
    297             putValue(SMALL_ICON, ImageProvider.get("dialogs", "refresh"));
     297            new ImageProvider("dialogs", "refresh").getResource().attachImageIcon(this, true);
    298298        }
    299299
     
    310310    class CloseChangesetAction extends AbstractAction implements ItemListener {
    311311        CloseChangesetAction() {
    312             putValue(SMALL_ICON, ImageProvider.get("closechangeset"));
     312            new ImageProvider("closechangeset").getResource().attachImageIcon(this, true);
    313313            putValue(SHORT_DESCRIPTION, tr("Close the currently selected open changeset"));
    314314            refreshEnabledState();
  • trunk/src/org/openstreetmap/josm/gui/io/CloseChangesetDialog.java

    r12678 r13130  
    116116        CloseAction() {
    117117            putValue(NAME, tr("Close changesets"));
    118             putValue(SMALL_ICON, ImageProvider.get("closechangeset"));
     118            new ImageProvider("closechangeset").getResource().attachImageIcon(this, true);
    119119            putValue(SHORT_DESCRIPTION, tr("Close the selected open changesets"));
    120120            refreshEnabledState();
     
    142142        CancelAction() {
    143143            putValue(NAME, tr("Cancel"));
    144             putValue(SMALL_ICON, ImageProvider.get("cancel"));
     144            new ImageProvider("cancel").getResource().attachImageIcon(this, true);
    145145            putValue(SHORT_DESCRIPTION, tr("Cancel closing of changesets"));
    146146        }
  • trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java

    r13069 r13130  
    364364            putValue(NAME, tr("Cancel"));
    365365            putValue(SHORT_DESCRIPTION, tr("Close this dialog and resume editing in JOSM"));
    366             putValue(SMALL_ICON, ImageProvider.get("cancel"));
     366            new ImageProvider("cancel").getResource().attachImageIcon(this, true);
    367367            InputMapUtils.addEscapeAction(getRootPane(), this);
    368368        }
     
    398398                    putValue(NAME, tr("Exit now!"));
    399399                    putValue(SHORT_DESCRIPTION, tr("Exit JOSM without saving. Unsaved changes are lost."));
    400                     putValue(SMALL_ICON, ImageProvider.get("exit"));
     400                    new ImageProvider("exit").getResource().attachImageIcon(this, true);
    401401                    break;
    402402                case RESTART:
    403403                    putValue(NAME, tr("Restart now!"));
    404404                    putValue(SHORT_DESCRIPTION, tr("Restart JOSM without saving. Unsaved changes are lost."));
    405                     putValue(SMALL_ICON, ImageProvider.get("restart"));
     405                    new ImageProvider("restart").getResource().attachImageIcon(this, true);
    406406                    break;
    407407                case DELETE:
    408408                    putValue(NAME, tr("Delete now!"));
    409409                    putValue(SHORT_DESCRIPTION, tr("Delete layers without saving. Unsaved changes are lost."));
    410                     putValue(SMALL_ICON, ImageProvider.get("dialogs", "delete"));
     410                    new ImageProvider("dialogs", "delete").getResource().attachImageIcon(this, true);
    411411                    break;
    412412            }
  • trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java

    r12881 r13130  
    4343import org.openstreetmap.josm.Main;
    4444import org.openstreetmap.josm.data.APIDataSet;
    45 import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent;
    46 import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;
    4745import org.openstreetmap.josm.data.Version;
    4846import org.openstreetmap.josm.data.osm.Changeset;
    4947import org.openstreetmap.josm.data.osm.DataSet;
    5048import org.openstreetmap.josm.data.osm.OsmPrimitive;
    51 import org.openstreetmap.josm.spi.preferences.Setting;
    5249import org.openstreetmap.josm.gui.ExtendedDialog;
    5350import org.openstreetmap.josm.gui.HelpAwareOptionPane;
     
    6158import org.openstreetmap.josm.io.UploadStrategySpecification;
    6259import org.openstreetmap.josm.spi.preferences.Config;
     60import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent;
     61import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;
     62import org.openstreetmap.josm.spi.preferences.Setting;
    6363import org.openstreetmap.josm.tools.GBC;
    6464import org.openstreetmap.josm.tools.ImageOverlay;
     
    433433            this.dialog = dialog;
    434434            putValue(NAME, tr("Upload Changes"));
    435             putValue(SMALL_ICON, ImageProvider.get("upload"));
     435            new ImageProvider("upload").getResource().attachImageIcon(this, true);
    436436            putValue(SHORT_DESCRIPTION, tr("Upload the changed primitives"));
    437437        }
     
    588588            this.dialog = dialog;
    589589            putValue(NAME, tr("Cancel"));
    590             putValue(SMALL_ICON, ImageProvider.get("cancel"));
     590            new ImageProvider("cancel").getResource().attachImageIcon(this, true);
    591591            putValue(SHORT_DESCRIPTION, tr("Cancel the upload and resume editing"));
    592592        }
  • trunk/src/org/openstreetmap/josm/gui/layer/CustomizeColor.java

    r12460 r13130  
    4141     */
    4242    public CustomizeColor(List<Layer> l) {
    43         super(tr("Customize Color"), ImageProvider.get("colorchooser"));
     43        super(tr("Customize Color"));
     44        new ImageProvider("colorchooser").getResource().attachImageIcon(this, true);
    4445        colors = l.stream().map(Layer::getColorProperty).collect(Collectors.toList());
    4546        CheckParameterUtil.ensureThat(colors.stream().allMatch(Objects::nonNull), "All layers must have colors.");
  • trunk/src/org/openstreetmap/josm/gui/layer/Layer.java

    r12987 r13130  
    543543         */
    544544        public LayerSaveAction(Layer layer) {
    545             putValue(SMALL_ICON, ImageProvider.get("save"));
     545            new ImageProvider("save").getResource().attachImageIcon(this, true);
    546546            putValue(SHORT_DESCRIPTION, tr("Save the current data."));
    547547            putValue(NAME, tr("Save"));
     
    567567         */
    568568        public LayerSaveAsAction(Layer layer) {
    569             putValue(SMALL_ICON, ImageProvider.get("save_as"));
     569            new ImageProvider("save_as").getResource().attachImageIcon(this, true);
    570570            putValue(SHORT_DESCRIPTION, tr("Save the current data to a new file."));
    571571            putValue(NAME, tr("Save As..."));
     
    591591         */
    592592        public LayerGpxExportAction(Layer layer) {
    593             putValue(SMALL_ICON, ImageProvider.get("exportgpx"));
     593            new ImageProvider("exportgpx").getResource().attachImageIcon(this, true);
    594594            putValue(SHORT_DESCRIPTION, tr("Export the data to GPX file."));
    595595            putValue(NAME, tr("Export to GPX..."));
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r12987 r13130  
    860860         */
    861861        public ConvertToGpxLayerAction() {
    862             super(tr("Convert to GPX layer"), ImageProvider.get("converttogpx"));
     862            super(tr("Convert to GPX layer"));
     863            new ImageProvider("converttogpx").getResource().attachImageIcon(this, true);
    863864            putValue("help", ht("/Action/ConvertToGpxLayer"));
    864865        }
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java

    r13093 r13130  
    107107     */
    108108    public CorrelateGpxWithImages(GeoImageLayer layer) {
    109         super(tr("Correlate to GPX"), ImageProvider.get("dialogs/geoimage/gpx2img"));
     109        super(tr("Correlate to GPX"));
     110        new ImageProvider("dialogs/geoimage/gpx2img").getResource().attachImageIcon(this, true);
    110111        this.yLayer = layer;
    111112    }
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java

    r13042 r13130  
    1717import javax.swing.AbstractAction;
    1818import javax.swing.Box;
    19 import javax.swing.ImageIcon;
    2019import javax.swing.JButton;
    2120import javax.swing.JComponent;
     
    9594        Dimension buttonDim = new Dimension(26, 26);
    9695
    97         ImageAction prevAction = new ImageAction(COMMAND_PREVIOUS, ImageProvider.get("dialogs", "previous"), tr("Previous"));
     96        ImageAction prevAction = new ImageAction(COMMAND_PREVIOUS, new ImageProvider("dialogs", "previous"), tr("Previous"));
    9897        btnPrevious = new JButton(prevAction);
    9998        btnPrevious.setPreferredSize(buttonDim);
     
    107106
    108107        final String removePhoto = tr("Remove photo from layer");
    109         ImageAction delAction = new ImageAction(COMMAND_REMOVE, ImageProvider.get("dialogs", "delete"), removePhoto);
     108        ImageAction delAction = new ImageAction(COMMAND_REMOVE, new ImageProvider("dialogs", "delete"), removePhoto);
    110109        JButton btnDelete = new JButton(delAction);
    111110        btnDelete.setPreferredSize(buttonDim);
     
    117116
    118117        ImageAction delFromDiskAction = new ImageAction(COMMAND_REMOVE_FROM_DISK,
    119                 ImageProvider.get("dialogs", "geoimage/deletefromdisk"), tr("Delete image file from disk"));
     118                new ImageProvider("dialogs", "geoimage/deletefromdisk"), tr("Delete image file from disk"));
    120119        JButton btnDeleteFromDisk = new JButton(delFromDiskAction);
    121120        btnDeleteFromDisk.setPreferredSize(buttonDim);
     
    127126        btnDeleteFromDisk.getActionMap().put(deleteImage, delFromDiskAction);
    128127
    129         ImageAction copyPathAction = new ImageAction(COMMAND_COPY_PATH, ImageProvider.get("copy"), tr("Copy image path"));
     128        ImageAction copyPathAction = new ImageAction(COMMAND_COPY_PATH, new ImageProvider("copy"), tr("Copy image path"));
    130129        JButton btnCopyPath = new JButton(copyPathAction);
    131130        btnCopyPath.setPreferredSize(buttonDim);
     
    137136        btnCopyPath.getActionMap().put(copyImage, copyPathAction);
    138137
    139         ImageAction nextAction = new ImageAction(COMMAND_NEXT, ImageProvider.get("dialogs", "next"), tr("Next"));
     138        ImageAction nextAction = new ImageAction(COMMAND_NEXT, new ImageProvider("dialogs", "next"), tr("Next"));
    140139        btnNext = new JButton(nextAction);
    141140        btnNext.setPreferredSize(buttonDim);
     
    160159
    161160        tbCentre = new JToggleButton(new ImageAction(COMMAND_CENTERVIEW,
    162                 ImageProvider.get("dialogs", "centreview"), tr("Center view")));
     161                new ImageProvider("dialogs", "centreview"), tr("Center view")));
    163162        tbCentre.setPreferredSize(buttonDim);
    164163
    165164        JButton btnZoomBestFit = new JButton(new ImageAction(COMMAND_ZOOM,
    166                 ImageProvider.get("dialogs", "zoom-best-fit"), tr("Zoom best fit and 1:1")));
     165                new ImageProvider("dialogs", "zoom-best-fit"), tr("Zoom best fit and 1:1")));
    167166        btnZoomBestFit.setPreferredSize(buttonDim);
    168167
    169168        btnCollapse = new JButton(new ImageAction(COMMAND_COLLAPSE,
    170                 ImageProvider.get("dialogs", "collapse"), tr("Move dialog to the side pane")));
     169                new ImageProvider("dialogs", "collapse"), tr("Move dialog to the side pane")));
    171170        btnCollapse.setPreferredSize(new Dimension(20, 20));
    172171        btnCollapse.setAlignmentY(Component.TOP_ALIGNMENT);
     
    213212        private final String action;
    214213
    215         ImageAction(String action, ImageIcon icon, String toolTipText) {
     214        ImageAction(String action, ImageProvider provider, String toolTipText) {
    216215            this.action = action;
    217216            putValue(SHORT_DESCRIPTION, toolTipText);
    218             putValue(SMALL_ICON, icon);
     217            if (provider != null) {
     218                provider.getResource().attachImageIcon(this, true);
     219            }
    219220        }
    220221
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ShowThumbnailAction.java

    r12340 r13130  
    2828     */
    2929    public ShowThumbnailAction(GeoImageLayer layer) {
    30         super(tr("Show thumbnails"), ImageProvider.get("dialogs/geoimage/togglegit"));
     30        super(tr("Show thumbnails"));
     31        new ImageProvider("dialogs/geoimage/togglegit").getResource().attachImageIcon(this, true);
    3132        putValue(SHORT_DESCRIPTION, tr("Show image thumbnails instead of icons."));
    3233        this.layer = layer;
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityAction.java

    r12678 r13130  
    5858     */
    5959    public ChooseTrackVisibilityAction(final GpxLayer layer) {
    60         super(tr("Choose visible tracks"), ImageProvider.get("dialogs/filter"));
     60        super(tr("Choose visible tracks"));
     61        new ImageProvider("dialogs/filter").getResource().attachImageIcon(this, true);
    6162        this.layer = layer;
    6263        putValue("help", ht("/Action/ChooseTrackVisibility"));
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/ConvertToDataLayerAction.java

    r12846 r13130  
    5656     */
    5757    protected ConvertToDataLayerAction(final T layer) {
    58         super(tr("Convert to data layer"), ImageProvider.get("converttoosm"));
     58        super(tr("Convert to data layer"));
     59        new ImageProvider("converttoosm").getResource().attachImageIcon(this, true);
    5960        this.layer = layer;
    6061        putValue("help", ht("/Action/ConvertToDataLayer"));
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/CustomizeDrawingAction.java

    r12630 r13130  
    5454
    5555    private CustomizeDrawingAction() {
    56         super(tr("Customize track drawing"), ImageProvider.get("mapmode/addsegment"));
     56        super(tr("Customize track drawing"));
     57        new ImageProvider("mapmode/addsegment").getResource().attachImageIcon(this, true);
    5758        putValue("help", ht("/Action/GPXLayerCustomizeLineDrawing"));
    5859    }
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackAction.java

    r12636 r13130  
    4343     */
    4444    public DownloadWmsAlongTrackAction(final GpxData data) {
    45         super(tr("Precache imagery tiles along this track"), ImageProvider.get("downloadalongtrack"));
     45        super(tr("Precache imagery tiles along this track"));
     46        new ImageProvider("downloadalongtrack").getResource().attachImageIcon(this, true);
    4647        this.data = data;
    4748    }
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java

    r12846 r13130  
    6969     */
    7070    public ImportAudioAction(final GpxLayer layer) {
    71         super(tr("Import Audio"), ImageProvider.get("importaudio"));
     71        super(tr("Import Audio"));
     72        new ImageProvider("importaudio").getResource().attachImageIcon(this, true);
    7273        this.layer = layer;
    7374        putValue("help", ht("/Action/ImportAudio"));
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportImagesAction.java

    r12846 r13130  
    3636     */
    3737    public ImportImagesAction(final GpxLayer layer) {
    38         super(tr("Import images"), ImageProvider.get("dialogs/geoimage"));
     38        super(tr("Import images"));
     39        new ImageProvider("dialogs/geoimage").getResource().attachImageIcon(this, true);
    3940        this.layer = layer;
    4041        putValue("help", ht("/Action/ImportImages"));
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/MarkersFromNamedPointsAction.java

    r12636 r13130  
    2626     */
    2727    public MarkersFromNamedPointsAction(final GpxLayer layer) {
    28         super(tr("Markers From Named Points"), ImageProvider.get("addmarkers"));
     28        super(tr("Markers From Named Points"));
     29        new ImageProvider("addmarkers").getResource().attachImageIcon(this, true);
    2930        this.layer = layer;
    3031        putValue("help", ht("/Action/MarkersFromNamedPoints"));
  • trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java

    r12987 r13130  
    484484
    485485        public ShowHideMarkerText(MarkerLayer layer) {
    486             super(tr("Show Text/Icons"), ImageProvider.get("dialogs", "showhide"));
     486            super(tr("Show Text/Icons"));
     487            new ImageProvider("dialogs", "showhide").getResource().attachImageIcon(this, true);
    487488            putValue(SHORT_DESCRIPTION, tr("Toggle visible state of the marker text and icons."));
    488489            putValue("help", ht("/Action/ShowHideTextIcons"));
     
    515516         */
    516517        SynchronizeAudio() {
    517             super(tr("Synchronize Audio"), ImageProvider.get("audio-sync"));
     518            super(tr("Synchronize Audio"));
     519            new ImageProvider("audio-sync").getResource().attachImageIcon(this, true);
    518520            putValue("help", ht("/Action/SynchronizeAudio"));
    519521        }
     
    552554
    553555        MoveAudio() {
    554             super(tr("Make Audio Marker at Play Head"), ImageProvider.get("addmarkers"));
     556            super(tr("Make Audio Marker at Play Head"));
     557            new ImageProvider("addmarkers").getResource().attachImageIcon(this, true);
    555558            putValue("help", ht("/Action/MakeAudioMarkerAtPlayHead"));
    556559        }
  • trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java

    r12846 r13130  
    10541054        MoveUpDownAction(boolean isDown) {
    10551055            increment = isDown ? 1 : -1;
    1056             putValue(SMALL_ICON, isDown ? ImageProvider.get("dialogs", "down") : ImageProvider.get("dialogs", "up"));
     1056            new ImageProvider("dialogs", isDown ? "down" : "up").getResource().attachImageIcon(this, true);
    10571057            putValue(SHORT_DESCRIPTION, isDown ? tr("Move the selected entry one row down.") : tr("Move the selected entry one row up."));
    10581058            updateEnabledState();
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AbstractTableListEditor.java

    r10763 r13130  
    6969            putValue(NAME, tr("New"));
    7070            putValue(SHORT_DESCRIPTION, tr("add entry"));
    71             putValue(SMALL_ICON, ImageProvider.get("dialogs", "add"));
     71            new ImageProvider("dialogs", "add").getResource().attachImageIcon(this, true);
    7272        }
    7373
     
    8282            putValue(NAME, tr("Remove"));
    8383            putValue(SHORT_DESCRIPTION, tr("Remove the selected entry"));
    84             putValue(SMALL_ICON, ImageProvider.get("dialogs", "delete"));
     84            new ImageProvider("dialogs", "delete").getResource().attachImageIcon(this, true);
    8585            updateEnabledState();
    8686        }
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java

    r13111 r13130  
    503503                    break;
    504504                }
    505                 putValue(SMALL_ICON, ImageProvider.get("dialogs", icon));
     505                new ImageProvider("dialogs", icon).getResource().attachImageIcon(this, true);
    506506                this.type = type;
    507507            }
     
    551551                putValue(NAME, tr("Remove"));
    552552                putValue(SHORT_DESCRIPTION, tr("Remove entry"));
    553                 putValue(SMALL_ICON, ImageProvider.get("dialogs", "delete"));
     553                new ImageProvider("dialogs", "delete").getResource().attachImageIcon(this, true);
    554554                updateEnabledState();
    555555            }
     
    581581                putValue(NAME, tr("Activate"));
    582582                putValue(SHORT_DESCRIPTION, tr("copy selected defaults"));
    583                 putValue(SMALL_ICON, ImageProvider.get("preferences", "activate-down"));
     583                new ImageProvider("preferences", "activate-down").getResource().attachImageIcon(this, true);
    584584            }
    585585
     
    647647            ReloadAction() {
    648648                putValue(SHORT_DESCRIPTION, tr("Update default entries"));
    649                 putValue(SMALL_ICON, ImageProvider.get("dialogs", "refresh"));
     649                new ImageProvider("dialogs", "refresh").getResource().attachImageIcon(this, true);
    650650            }
    651651
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java

    r12926 r13130  
    617617         */
    618618        public ToolbarButtonAction() {
    619             super("", ImageProvider.get("dialogs", "pin"));
     619            super("");
     620            new ImageProvider("dialogs", "pin").getResource().attachImageIcon(this, true);
    620621            putValue(SHORT_DESCRIPTION, tr("Add or remove toolbar button"));
    621622            List<String> t = new LinkedList<>(ToolbarPreferences.getToolString());
Note: See TracChangeset for help on using the changeset viewer.