[
https://issues.apache.org/jira/browse/NETBEANS-2614?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eirik Bakke updated NETBEANS-2614:
----------------------------------
Description:
To look good on HiDPI/Retina displays, the NetBeans IDE, and NetBeans Platform
(RCP) applications, will eventually need to provide high-resolution versions of
various image asset (typically icons). In the shorter term, there are also a
few tricks that can be applied to make the existing low-resolution icons render
better on HiDPI monitors, such as setting
RenderingHints.VALUE_INTERPOLATION_BICUBIC before painting each icon. See the
attached before/after screenshots to see the difference (be sure to view the
screenshots at 100% scaling).
Throughout the NetBeans codebase, two different APIs are used interchangeably
to represent icon: javax.swing.Icon and java.awt.Image. The NetBeans
ImageUtilities class provides methods for loading either, and for converting
instances of one to instances the other.
Having now implementing scalable window system icons (NETBEANS-1238,
NETBEANS-1260), prototype SVG icon loading (NETBEANS-2604), and a HiDPI-enabled
splash screen ( https://github.com/apache/netbeans/pull/1246 ), the following
design seems the most feasible:
# Scalable icon implementations (such as VectorIcon or a future SVGIcon) should
be implemented as custom implementations of the javax.swing.Icon interface.
# The various methods in ImageUtilities should be updated to preserve custom
Icon instances even as an Icon is converted to an Image and back (i.e. make
image2Icon(icon2image(icon)) reversible).
# Other parts of the codebase should be updated as necessary to use
ImageUtilities.image2Icon(image) instead of "new ImageIcon(image)", and to use
"Icon.paintIcon" instead of "Graphics.drawImage". (Most of the IDE code already
does the right thing.)
This issue tracks the required changes to ImageUtilities, as well as the
previously mentioned icon rendering improvements, which will serve as a visual
demonstration that the right painting code is being invoked.
was:
To look good on HiDPI/Retina displays, the NetBeans IDE, and NetBeans Platform
(RCP) applications, will eventually need to provide high-resolution versions of
various image asset (typically icons). In the shorter term, there are also a
few tricks that can be applied to make the existing low-resolution icons render
better on HiDPI monitors, such as setting
RenderingHints.VALUE_INTERPOLATION_BICUBIC before painting each icon.
Throughout the NetBeans codebase, two different APIs are used interchangeably
to represent icon: javax.swing.Icon and java.awt.Image. The NetBeans
ImageUtilities class provides methods for loading either, and for converting
instances of one to instances the other.
Having now implementing scalable window system icons (NETBEANS-1238,
NETBEANS-1260), prototype SVG icon loading (NETBEANS-2604), and a HiDPI-enabled
splash screen ( https://github.com/apache/netbeans/pull/1246 ), the following
design seems the most feasible:
# Scalable icon implementations (such as VectorIcon or a future SVGIcon) should
be implemented as custom implementations of the javax.swing.Icon interface.
# The various methods in ImageUtilities should be updated to preserve custom
Icon instances even as an Icon is converted to an Image and back (i.e. make
image2Icon(icon2image(icon)) reversible).
# Other parts of the codebase should be updated as necessary to use
ImageUtilities.image2Icon(image) instead of "new ImageIcon(image)", and to use
"Icon.paintIcon" instead of "Graphics.drawImage". (Most of the IDE code already
does the right thing.)
This issue tracks the required changes to ImageUtilities, as well as the
previously mentioned icon rendering improvements, which will serve as a visual
demonstration that the right painting code is being invoked.
> Improve icon scaling on HiDPI displays, and prepare ImageUtilities for HiDPI
> icons.
> -----------------------------------------------------------------------------------
>
> Key: NETBEANS-2614
> URL: https://issues.apache.org/jira/browse/NETBEANS-2614
> Project: NetBeans
> Issue Type: Improvement
> Components: platform - Other
> Affects Versions: 11.0
> Environment: Windows, Linux, and MacOS.
> Reporter: Eirik Bakke
> Assignee: Eirik Bakke
> Priority: Major
> Labels: HiDPI
> Attachments: Windows 150pct HiDPI Scaling, After Patch.png, Windows
> 150pct HiDPI Scaling, Before Patch.png, Windows 200pct HiDPI Scaling, After
> Patch.png, Windows 200pct HiDPI Scaling, Before Patch.png
>
>
> To look good on HiDPI/Retina displays, the NetBeans IDE, and NetBeans
> Platform (RCP) applications, will eventually need to provide high-resolution
> versions of various image asset (typically icons). In the shorter term, there
> are also a few tricks that can be applied to make the existing low-resolution
> icons render better on HiDPI monitors, such as setting
> RenderingHints.VALUE_INTERPOLATION_BICUBIC before painting each icon. See the
> attached before/after screenshots to see the difference (be sure to view the
> screenshots at 100% scaling).
> Throughout the NetBeans codebase, two different APIs are used interchangeably
> to represent icon: javax.swing.Icon and java.awt.Image. The NetBeans
> ImageUtilities class provides methods for loading either, and for converting
> instances of one to instances the other.
> Having now implementing scalable window system icons (NETBEANS-1238,
> NETBEANS-1260), prototype SVG icon loading (NETBEANS-2604), and a
> HiDPI-enabled splash screen ( https://github.com/apache/netbeans/pull/1246 ),
> the following design seems the most feasible:
> # Scalable icon implementations (such as VectorIcon or a future SVGIcon)
> should be implemented as custom implementations of the javax.swing.Icon
> interface.
> # The various methods in ImageUtilities should be updated to preserve custom
> Icon instances even as an Icon is converted to an Image and back (i.e. make
> image2Icon(icon2image(icon)) reversible).
> # Other parts of the codebase should be updated as necessary to use
> ImageUtilities.image2Icon(image) instead of "new ImageIcon(image)", and to
> use "Icon.paintIcon" instead of "Graphics.drawImage". (Most of the IDE code
> already does the right thing.)
> This issue tracks the required changes to ImageUtilities, as well as the
> previously mentioned icon rendering improvements, which will serve as a
> visual demonstration that the right painting code is being invoked.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists