<Swing Dev> RFR: 8182043: Access to Windows Large Icons [v11]

Phil Race prr at openjdk.java.net
Fri May 21 21:27:07 UTC 2021


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

>> Fix updated after first round of review.
>
> Alexander Zuev has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Specification of getSystemIcon reworded to get rid of the non-public
>   class reference and to better describe some cornor cases

I was reviewing the CSR so comments in the CSR are the obvious place for that.
We can continue it here if you like
1) Will you be updating to explain how we map to (theoretical) non-square icons ?
> As for the square icons - yes, we imply that the greater dimension is specified so in case of 256x128 icon 
> the 256x256 icon will be returned with the 256x128 bitmap inside and the 256x256 reported size.

FWIW I think now I understand that you mean we will always return a square icon, that may be an issue.
Imagine if the OS has icons that are 256x128 or 128x256 and we need to display a bunch of them side by side 
and tow by row you will find it impossible to layout well. Surely we should return the same if we can
It is *theoretically* possible that the platform will do something bananas like return 128x256 then 256x256 then
384x256 alternative images in which case we'd need logic to handle that as sensibly as possible, acc.
to the way MRI handles cuch cases, but if the aspect ratio is consistent as I expect is typical we should support that

2) I can't agree that IAE is wrong for a negative size. The argument that a developer may make a mistake
is not sufficient. Virtually every Image related API we have throws an exception (usually IAE) if you pass <= 0
and folks get that right all the time. Allowing it here would be anomalous.

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

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


More information about the swing-dev mailing list