<AWT Dev> RFR: 8182043: Access to Windows Large Icons [v10]

Sergey Bylokhov serb at openjdk.java.net
Fri May 21 01:25:36 UTC 2021


On Thu, 20 May 2021 22:59:43 GMT, Alexander Zuev <kizune at openjdk.org> wrote:

>> I did not get how you will be able to force use MRI later since this method is implemented as a return icon. So this choice should be made before integration.
>
>> I did not get how you will be able to force use MRI later since this method is implemented as a return icon. So this choice should be made before integration.
> 
> I am not going to force MRI usage - i am assuming that there might be an implementation that does not do it hence i am going to go to the lowest common denominator - Icon.

But in the code above you do not use the icon, you use an ImageIcon. So to get the resolution variant the user need to do something like:

    Icon icon = fsv.getSystemIcon(file, size);
    if (icon instanceof ImageIcon) {
        ImageIcon imageIcon = (ImageIcon) icon;
        if (icon.getImage() instanceof MultiResolutionImage) {
            MultiResolutionImage mri = (MultiResolutionImage) icon.getImage();
            .... = mri.getResolutionVariant(size, size);
        }
    }

Probably some other variants were discussed already and we cannot do something better?

-------------

PR: https://git.openjdk.java.net/jdk/pull/2875


More information about the awt-dev mailing list