Image2icon alternative
This is a major task, see separate discussion below! Redraw or replace several hundred (or thousands) of NetBeans' most used bitmap icons with scalable equivalents (preferably SVG).Alternatively, we could switch to FlatLAF (light or dark) as the default theme on Linux.
Support scalable window system icons in the default LAF on Linux.Probably a matter of just enabling the right JDK/LAF options somehow. Make DPI scaling happen automatically on Linux.(now fixed, and avoided in any case by the approach taken in SurfaceManager throws "Invalid Image variant" for MultiResolutionImage.JCheckBox HiDPI scaling fails when main display is external non-HiDPI monitor.Window positioning bugs due to overlapping GraphicsDevice bounds.(This was largely solved by making ImageUtilities.image2icon/icon2Image reversible the Image-based APIs will work without modification.) For instance, .getIcon returns an "Image" rather than an "Icon" if the Image was actually an SVG file loaded via ImageUtilities (see above) rather than a bitmap image, it should be rendered as such. Support HiDPI icons in various NetBeans Platform APIs and their implementations, including icons loaded via action layer registrations.The memory gauge indicator in the toolbar is rendered in low resolution.Emilian Bold did work on this for the MultiResolutionImage case, but it also needs to be made to work with SVG icons (for which it's not yet clear what kind of Image instance icon2image should return). Make other ImageUtilities functions work with HiDPI icons/images (e.g.For instance, the Icon could be an SVG icon (see above), or an instance of the new class (which was created to support hand-painted LAF icons). Make ImageUtilities.image2icon(ImageUtilities.icon2Image(icon)) reversible so that the original Icon instance is returned, even when the Icon is not an ImageIcon.Make ImageUtilities.createDisabledIcon work with HiDPI icons (including custom Icon implementations).150%, probably making the SVG approach preferable.)
#Image2icon alternative windows#
Also note that Windows and Linux users can use scaling factors other than 200%, e.g. It doesn't work on Windows in any case, due to JDK-8212226, see above. loading "icon.png" loads both "icon.png" and the larger-size (Meh, didn't end up taking this approach.
#Image2icon alternative code#
There are also various cases in which the JDK's automatic scaling of Graphics2D operations can lead to bugs or visual artifacts (in code written before HiDPI screens existed), which would ideally be fixed either in NetBeans or in the JDK itself. This makes text sharp on HiDPI screens, but leaves bitmap icons blurry.
Since Java 9, this scaling is done automatically by AWT by means of a scaling default transform in each Component's Graphics2D instances. 150% or 200% (depending on OS and OS-level user settings), in order to remain readable. These screens have about twice the physical pixel density of traditional screens, making it necessary to scale GUI graphics up by some amount, e.g. It is now increasingly common for NetBeans to run on Windows, Linux, or MacOS machines with so-called "HiDPI" screens, aka.