Changeset 10369 in josm for trunk/src/org/openstreetmap/josm


Ignore:
Timestamp:
2016-06-14T17:23:20+02:00 (8 years ago)
Author:
stoecker
Message:

see #9995 - patch by strump - improve HIDPI

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

Legend:

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

    r10234 r10369  
    105105        JPanel panel = new JPanel(new GridBagLayout());
    106106        panel.setPreferredSize(new Dimension(890, 300));
    107         panel.add(new JLabel("", new ImageIcon(ImageProvider.get("logo.svg").getImage().getScaledInstance(256, 258, Image.SCALE_SMOOTH)),
     107        panel.add(new JLabel("", new ImageProvider("logo.svg").setSize(ImageProvider.ImageSizes.ABOUT_LOGO).get(),
    108108                JLabel.CENTER), GBC.std().insets(0, 5, 0, 0));
    109109        panel.add(about, GBC.std().fill());
  • trunk/src/org/openstreetmap/josm/actions/AbstractSelectAction.java

    r10356 r10369  
    2020        putValue(NAME, tr("Select"));
    2121        putValue(SHORT_DESCRIPTION,  tr("Set the selected elements on the map to the selected items in the list above."));
    22         new ImageProvider("dialogs", "select").getResource().getImageIcon(this, true);
     22        new ImageProvider("dialogs", "select").getResource().attachImageIcon(this, true);
    2323    }
    2424}
  • trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java

    r10318 r10369  
    6363                                    @Override
    6464                                    public void run() {
    65                                         result.getImageIcon(AddImageryLayerAction.this);
     65                                        result.attachImageIcon(AddImageryLayerAction.this);
    6666                                    }
    6767                                });
  • trunk/src/org/openstreetmap/josm/actions/JosmAction.java

    r10354 r10369  
    7373        super(name);
    7474        if (icon != null)
    75             icon.getResource().getImageIcon(this);
     75            icon.getResource().attachImageIcon(this);
    7676        setHelpId();
    7777        sc = shortcut;
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/CombinePrimitiveResolverDialog.java

    r10357 r10369  
    367367            putValue(Action.SHORT_DESCRIPTION, tr("Cancel conflict resolution"));
    368368            putValue(Action.NAME, tr("Cancel"));
    369             new ImageProvider("cancel").getResource().getImageIcon(this);
     369            new ImageProvider("cancel").getResource().attachImageIcon(this);
    370370            setEnabled(true);
    371371        }
     
    382382            putValue(Action.SHORT_DESCRIPTION, tr("Apply resolved conflicts"));
    383383            putValue(Action.NAME, tr("Apply"));
    384             new ImageProvider("ok").getResource().getImageIcon(this);
     384            new ImageProvider("ok").getResource().attachImageIcon(this);
    385385            updateEnabledState();
    386386        }
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/PasteTagsConflictResolverDialog.java

    r10357 r10369  
    265265            putValue(Action.SHORT_DESCRIPTION, tr("Cancel conflict resolution"));
    266266            putValue(Action.NAME, tr("Cancel"));
    267             new ImageProvider("cancel").getResource().getImageIcon(this);
     267            new ImageProvider("cancel").getResource().attachImageIcon(this);
    268268            setEnabled(true);
    269269        }
     
    281281            putValue(Action.SHORT_DESCRIPTION, tr("Apply resolved conflicts"));
    282282            putValue(Action.NAME, tr("Apply"));
    283             new ImageProvider("ok").getResource().getImageIcon(this);
     283            new ImageProvider("ok").getResource().attachImageIcon(this);
    284284            updateEnabledState();
    285285        }
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolver.java

    r10357 r10369  
    155155        ApplyRoleAction() {
    156156            putValue(NAME, tr("Apply"));
    157             new ImageProvider("ok").getResource().getImageIcon(this);
     157            new ImageProvider("ok").getResource().attachImageIcon(this);
    158158            putValue(SHORT_DESCRIPTION, tr("Apply this role to all members"));
    159159        }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/CommandStackDialog.java

    r10356 r10369  
    376376            putValue(NAME, tr("Select"));
    377377            putValue(SHORT_DESCRIPTION, tr("Selects the objects that take part in this command (unless currently deleted)"));
    378             new ImageProvider("dialogs", "select").getResource().getImageIcon(this, true);
     378            new ImageProvider("dialogs", "select").getResource().attachImageIcon(this, true);
    379379        }
    380380
     
    411411            putValue(SHORT_DESCRIPTION,
    412412                    tr("Selects the objects that take part in this command (unless currently deleted), then and zooms to it"));
    413             new ImageProvider("dialogs/autoscale", "selection").getResource().getImageIcon(this, true);
     413            new ImageProvider("dialogs/autoscale", "selection").getResource().attachImageIcon(this, true);
    414414        }
    415415
     
    447447                putValue(NAME, tr("Undo"));
    448448                putValue(SHORT_DESCRIPTION, tr("Undo the selected and all later commands"));
    449                 new ImageProvider("undo").getResource().getImageIcon(this, true);
     449                new ImageProvider("undo").getResource().attachImageIcon(this, true);
    450450            } else {
    451451                tree = redoTree;
    452452                putValue(NAME, tr("Redo"));
    453453                putValue(SHORT_DESCRIPTION, tr("Redo the selected and all earlier commands"));
    454                 new ImageProvider("redo").getResource().getImageIcon(this, true);
     454                new ImageProvider("redo").getResource().attachImageIcon(this, true);
    455455            }
    456456        }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java

    r10356 r10369  
    434434            putValue(NAME, tr("Resolve"));
    435435            putValue(SHORT_DESCRIPTION,  tr("Open a merge dialog of all selected items in the list above."));
    436             new ImageProvider("dialogs", "conflict").getResource().getImageIcon(this, true);
     436            new ImageProvider("dialogs", "conflict").getResource().attachImageIcon(this, true);
    437437            putValue("help", ht("/Dialog/ConflictList#ResolveAction"));
    438438        }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictResolutionDialog.java

    r10357 r10369  
    158158            putValue(Action.SHORT_DESCRIPTION, tr("Cancel conflict resolution and close the dialog"));
    159159            putValue(Action.NAME, tr("Cancel"));
    160             new ImageProvider("cancel").getResource().getImageIcon(this);
     160            new ImageProvider("cancel").getResource().attachImageIcon(this);
    161161            setEnabled(true);
    162162        }
     
    175175            putValue(Action.SHORT_DESCRIPTION, tr("Show help information"));
    176176            putValue(Action.NAME, tr("Help"));
    177             new ImageProvider("help").getResource().getImageIcon(this);
     177            new ImageProvider("help").getResource().attachImageIcon(this);
    178178            setEnabled(true);
    179179        }
     
    193193            putValue(Action.SHORT_DESCRIPTION, tr("Apply resolved conflicts and close the dialog"));
    194194            putValue(Action.NAME, tr("Apply Resolution"));
    195             new ImageProvider("dialogs", "conflict").getResource().getImageIcon(this);
     195            new ImageProvider("dialogs", "conflict").getResource().attachImageIcon(this);
    196196            updateEnabledState();
    197197        }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java

    r10356 r10369  
    141141                putValue(NAME, tr("Add"));
    142142                putValue(SHORT_DESCRIPTION,  tr("Add filter."));
    143                 new ImageProvider("dialogs", "add").getResource().getImageIcon(this, true);
     143                new ImageProvider("dialogs", "add").getResource().attachImageIcon(this, true);
    144144            }
    145145
     
    156156                putValue(NAME, tr("Edit"));
    157157                putValue(SHORT_DESCRIPTION, tr("Edit filter."));
    158                 new ImageProvider("dialogs", "edit").getResource().getImageIcon(this, true);
     158                new ImageProvider("dialogs", "edit").getResource().attachImageIcon(this, true);
    159159            }
    160160
     
    174174                putValue(NAME, tr("Delete"));
    175175                putValue(SHORT_DESCRIPTION, tr("Delete filter."));
    176                 new ImageProvider("dialogs", "delete").getResource().getImageIcon(this, true);
     176                new ImageProvider("dialogs", "delete").getResource().attachImageIcon(this, true);
    177177            }
    178178
     
    189189                putValue(NAME, tr("Up"));
    190190                putValue(SHORT_DESCRIPTION, tr("Move filter up."));
    191                 new ImageProvider("dialogs", "up").getResource().getImageIcon(this, true);
     191                new ImageProvider("dialogs", "up").getResource().attachImageIcon(this, true);
    192192            }
    193193
     
    205205                putValue(NAME, tr("Down"));
    206206                putValue(SHORT_DESCRIPTION, tr("Move filter down."));
    207                 new ImageProvider("dialogs", "down").getResource().getImageIcon(this, true);
     207                new ImageProvider("dialogs", "down").getResource().attachImageIcon(this, true);
    208208            }
    209209
  • trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java

    r10356 r10369  
    299299            putValue(NAME, tr("Search"));
    300300            putValue(SHORT_DESCRIPTION,   tr("Search for objects"));
    301             new ImageProvider("dialogs", "search").getResource().getImageIcon(this, true);
     301            new ImageProvider("dialogs", "search").getResource().attachImageIcon(this, true);
    302302            updateEnabledState();
    303303        }
     
    361361            putValue(NAME, tr("History"));
    362362            putValue(SHORT_DESCRIPTION, tr("Display the history of the selected objects."));
    363             new ImageProvider("dialogs", "history").getResource().getImageIcon(this, true);
     363            new ImageProvider("dialogs", "history").getResource().attachImageIcon(this, true);
    364364            updateEnabledState(model.getSize());
    365365        }
     
    401401            putValue(NAME, tr("Zoom to selection"));
    402402            putValue(SHORT_DESCRIPTION, tr("Zoom to selection"));
    403             new ImageProvider("dialogs/autoscale", "selection").getResource().getImageIcon(this, true);
     403            new ImageProvider("dialogs/autoscale", "selection").getResource().attachImageIcon(this, true);
    404404            updateEnabledState();
    405405        }
     
    442442            putValue(NAME, tr("Zoom to selected element(s)"));
    443443            putValue(SHORT_DESCRIPTION, tr("Zoom to selected element(s)"));
    444             new ImageProvider("dialogs/autoscale", "selection").getResource().getImageIcon(this, true);
     444            new ImageProvider("dialogs/autoscale", "selection").getResource().attachImageIcon(this, true);
    445445            updateEnabledState();
    446446        }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java

    r10356 r10369  
    158158            putValue(NAME, tr("Select"));
    159159            putValue(SHORT_DESCRIPTION, tr("Select objects submitted by this user"));
    160             new ImageProvider("dialogs", "select").getResource().getImageIcon(this, true);
     160            new ImageProvider("dialogs", "select").getResource().attachImageIcon(this, true);
    161161            updateEnabledState();
    162162        }
     
    193193            putValue(NAME, tr("Show info"));
    194194            putValue(SHORT_DESCRIPTION, tr("Launches a browser with information about the user"));
    195             new ImageProvider("help/internet").getResource().getImageIcon(this, true);
     195            new ImageProvider("help/internet").getResource().attachImageIcon(this, true);
    196196            updateEnabledState();
    197197        }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java

    r10356 r10369  
    120120                putValue(NAME, tr("Lookup"));
    121121                putValue(SHORT_DESCRIPTION, tr("Looks up the selected primitives in the error list."));
    122                 new ImageProvider("dialogs", "search").getResource().getImageIcon(this, true);
     122                new ImageProvider("dialogs", "search").getResource().attachImageIcon(this, true);
    123123            }
    124124
     
    141141                putValue(NAME, tr("Fix"));
    142142                putValue(SHORT_DESCRIPTION,  tr("Fix the selected issue."));
    143                 new ImageProvider("dialogs", "fix").getResource().getImageIcon(this, true);
     143                new ImageProvider("dialogs", "fix").getResource().attachImageIcon(this, true);
    144144            }
    145145            @Override
     
    156156                    putValue(NAME, tr("Ignore"));
    157157                    putValue(SHORT_DESCRIPTION,  tr("Ignore the selected issue next time."));
    158                     new ImageProvider("dialogs", "fix").getResource().getImageIcon(this, true);
     158                    new ImageProvider("dialogs", "fix").getResource().attachImageIcon(this, true);
    159159                }
    160160                @Override
  • trunk/src/org/openstreetmap/josm/gui/help/ContextSensitiveHelpAction.java

    r10356 r10369  
    4747        putValue(SHORT_DESCRIPTION, tr("Show help information"));
    4848        putValue(NAME, tr("Help"));
    49         new ImageProvider("help").getResource().getImageIcon(this);
     49        new ImageProvider("help").getResource().attachImageIcon(this);
    5050        this.helpTopic = helpTopic;
    5151        setEnabled(!Main.isOffline(OnlineResource.JOSM_WEBSITE));
  • trunk/src/org/openstreetmap/josm/gui/io/UploadSelectionDialog.java

    r10357 r10369  
    259259            putValue(Action.SHORT_DESCRIPTION, tr("Cancel uploading"));
    260260            putValue(Action.NAME, tr("Cancel"));
    261             new ImageProvider("cancel").getResource().getImageIcon(this);
     261            new ImageProvider("cancel").getResource().attachImageIcon(this);
    262262            getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)
    263263            .put(KeyStroke.getKeyStroke("ESCAPE"), "ESCAPE");
     
    277277            putValue(Action.SHORT_DESCRIPTION, tr("Continue uploading"));
    278278            putValue(Action.NAME, tr("Continue"));
    279             new ImageProvider("upload").getResource().getImageIcon(this);
     279            new ImageProvider("upload").getResource().attachImageIcon(this);
    280280            updateEnabledState();
    281281        }
  • trunk/src/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUI.java

    r10367 r10369  
    325325        RunAuthorisationAction() {
    326326            putValue(NAME, tr("Authorize now"));
    327             new ImageProvider("oauth", "oauth-small").getResource().getImageIcon(this);
     327            new ImageProvider("oauth", "oauth-small").getResource().attachImageIcon(this);
    328328            putValue(SHORT_DESCRIPTION, tr("Click to redirect you to the authorization form on the JOSM web site"));
    329329            updateEnabledState();
     
    362362            putValue(NAME, tr("Back"));
    363363            putValue(SHORT_DESCRIPTION, tr("Run the automatic authorization steps again"));
    364             new ImageProvider("dialogs", "previous").getResource().getImageIcon(this);
     364            new ImageProvider("dialogs", "previous").getResource().attachImageIcon(this);
    365365        }
    366366
     
    377377        TestAccessTokenAction() {
    378378            putValue(NAME, tr("Test Access Token"));
    379             new ImageProvider("logo").getResource().getImageIcon(this);
     379            new ImageProvider("logo").getResource().attachImageIcon(this);
    380380        }
    381381
  • trunk/src/org/openstreetmap/josm/gui/oauth/ManualAuthorizationUI.java

    r10367 r10369  
    223223        TestAccessTokenAction() {
    224224            putValue(NAME, tr("Test Access Token"));
    225             new ImageProvider("oauth", "oauth-small").getResource().getImageIcon(this);
     225            new ImageProvider("oauth", "oauth-small").getResource().attachImageIcon(this);
    226226            putValue(SHORT_DESCRIPTION, tr("Click to test the Access Token"));
    227227            updateEnabledState();
  • trunk/src/org/openstreetmap/josm/gui/oauth/OAuthAuthorizationWizard.java

    r10367 r10369  
    351351        CancelAction() {
    352352            putValue(NAME, tr("Cancel"));
    353             new ImageProvider("cancel").getResource().getImageIcon(this);
     353            new ImageProvider("cancel").getResource().attachImageIcon(this);
    354354            putValue(SHORT_DESCRIPTION, tr("Close the dialog and cancel authorization"));
    355355        }
     
    373373        AcceptAccessTokenAction() {
    374374            putValue(NAME, tr("Accept Access Token"));
    375             new ImageProvider("ok").getResource().getImageIcon(this);
     375            new ImageProvider("ok").getResource().attachImageIcon(this);
    376376            putValue(SHORT_DESCRIPTION, tr("Close the dialog and accept the Access Token"));
    377377            updateEnabledState(null);
  • trunk/src/org/openstreetmap/josm/gui/oauth/SemiAutomaticAuthorizationUI.java

    r10367 r10369  
    292292                putValue(NAME, tr("Back"));
    293293                putValue(SHORT_DESCRIPTION, tr("Go back to step 1/3"));
    294                 new ImageProvider("dialogs", "previous").getResource().getImageIcon(this);
     294                new ImageProvider("dialogs", "previous").getResource().attachImageIcon(this);
    295295            }
    296296
     
    368368                putValue(NAME, tr("Restart"));
    369369                putValue(SHORT_DESCRIPTION, tr("Go back to step 1/3"));
    370                 new ImageProvider("dialogs", "previous").getResource().getImageIcon(this);
     370                new ImageProvider("dialogs", "previous").getResource().attachImageIcon(this);
    371371            }
    372372
     
    389389        RetrieveRequestTokenAction() {
    390390            putValue(NAME, tr("Retrieve Request Token"));
    391             new ImageProvider("oauth", "oauth-small").getResource().getImageIcon(this);
     391            new ImageProvider("oauth", "oauth-small").getResource().attachImageIcon(this);
    392392            putValue(SHORT_DESCRIPTION, tr("Click to retrieve a Request Token"));
    393393        }
     
    425425        RetrieveAccessTokenAction() {
    426426            putValue(NAME, tr("Retrieve Access Token"));
    427             new ImageProvider("oauth", "oauth-small").getResource().getImageIcon(this);
     427            new ImageProvider("oauth", "oauth-small").getResource().attachImageIcon(this);
    428428            putValue(SHORT_DESCRIPTION, tr("Click to retrieve an Access Token"));
    429429        }
     
    462462        TestAccessTokenAction() {
    463463            putValue(NAME, tr("Test Access Token"));
    464             new ImageProvider("oauth", "oauth-small").getResource().getImageIcon(this);
     464            new ImageProvider("oauth", "oauth-small").getResource().attachImageIcon(this);
    465465            putValue(SHORT_DESCRIPTION, tr("Click to test the Access Token"));
    466466        }
  • trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java

    r10355 r10369  
    157157        CancelAction() {
    158158            putValue(NAME, tr("Cancel"));
    159             new ImageProvider("cancel").getResource().getImageIcon(this);
     159            new ImageProvider("cancel").getResource().attachImageIcon(this);
    160160            putValue(SHORT_DESCRIPTION, tr("Close the preferences dialog and discard preference updates"));
    161161        }
     
    176176        OKAction() {
    177177            putValue(NAME, tr("OK"));
    178             new ImageProvider("ok").getResource().getImageIcon(this);
     178            new ImageProvider("ok").getResource().attachImageIcon(this);
    179179            putValue(SHORT_DESCRIPTION, tr("Save the preferences and close the dialog"));
    180180        }
  • trunk/src/org/openstreetmap/josm/gui/tagging/TagTable.java

    r10357 r10369  
    164164
    165165        DeleteAction() {
    166             new ImageProvider("dialogs", "delete").getResource().getImageIcon(this);
     166            new ImageProvider("dialogs", "delete").getResource().attachImageIcon(this);
    167167            putValue(SHORT_DESCRIPTION, tr("Delete the selection in the tag table"));
    168168            getSelectionModel().addListSelectionListener(this);
     
    253253    class AddAction extends AbstractAction implements PropertyChangeListener {
    254254        AddAction() {
    255             new ImageProvider("dialogs", "add").getResource().getImageIcon(this);
     255            new ImageProvider("dialogs", "add").getResource().attachImageIcon(this);
    256256            putValue(SHORT_DESCRIPTION, tr("Add a new tag"));
    257257            TagTable.this.addPropertyChangeListener(this);
     
    287287    class PasteAction extends AbstractAction implements PropertyChangeListener {
    288288        PasteAction() {
    289             new ImageProvider("pastetags").getResource().getImageIcon(this);
     289            new ImageProvider("pastetags").getResource().attachImageIcon(this);
    290290            putValue(SHORT_DESCRIPTION, tr("Paste tags from buffer"));
    291291            TagTable.this.addPropertyChangeListener(this);
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java

    r10363 r10369  
    192192                        @Override
    193193                        public void run() {
    194                             result.getImageIcon(TaggingPreset.this);
     194                            result.attachImageIcon(TaggingPreset.this);
    195195                        }
    196196                    });
  • trunk/src/org/openstreetmap/josm/io/session/GenericSessionExporter.java

    r9753 r10369  
    7474         */
    7575        LayerSaveAction() {
    76             putValue(SMALL_ICON, new ImageProvider("save").setWidth(16).get());
     76            new ImageProvider("save").getResource().attachImageIcon(this);
    7777            putValue(SHORT_DESCRIPTION, ((AbstractModifiableLayer) layer).requiresSaveToFile() ?
    7878                    tr("Layer contains unsaved data - save to file.") :
  • trunk/src/org/openstreetmap/josm/tools/ImageResource.java

    r10358 r10369  
    108108     * Set both icons of an Action
    109109     * @param a The action for the icons
    110      * @since 7693
    111      */
    112     public void getImageIcon(AbstractAction a) {
     110     * @since 10368
     111     */
     112    public void attachImageIcon(AbstractAction a) {
    113113        Dimension iconDimension = ImageProvider.ImageSizes.SMALLICON.getImageDimension();
    114114        ImageIcon icon = getImageIconBounded(iconDimension);
     
    125125     * @param a The action for the icons
    126126     * @param addresource Adds an resource named "ImageResource" if <code>true</code>
    127      * @since 10356
    128      */
    129     public void getImageIcon(AbstractAction a, boolean addresource) {
    130         getImageIcon(a);
     127     * @since 10368
     128     */
     129    public void attachImageIcon(AbstractAction a, boolean addresource) {
     130        attachImageIcon(a);
    131131        if (addresource) {
    132132            a.putValue("ImageResource", this);
Note: See TracChangeset for help on using the changeset viewer.