[ https://issues.apache.org/jira/browse/NETBEANS-3468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17062106#comment-17062106 ]
Eirik Bakke edited comment on NETBEANS-3468 at 3/18/20, 10:51 PM: ------------------------------------------------------------------ >From mailing list discussions, it seems that NetBeans will continue to be >built on Java 8 for the forseeable future. The java.lang.reflect.Proxy >interface could be used to implement MultiResolutionImage by reflection, but >it does not seem possible to simultaneously have the proxy object extend from >Image (or BufferedImage), which is required here. A better approach, for backwards-compatibility with Java 8, is to implement NETBEANS-3469, having ImageUtilities write out pre-rendered PNG files at 1x and 2x resolution into the NetBeans cache directory, following the prescribed MacOS naming convention (e.g. "icon.png" and "i...@2x.png"), and then using Toolkit.getImage(URL) to produce the actual Image object (on MacOS only). This will produce retina-capable images on both Java 8 and Java 9 and above. (Note that MacOS uses only 1x and 2x scaling, unlike Windows, where arbitrary HiDPI scalings can occur.) was (Author: ebakke): >From mailing list discussions, it seems that NetBeans will continue to be >built on Java 8 for the forseeable future. The java.lang.reflect.Proxy >interface could be used to implement MultiResolutionImage by reflection, but >it does not seem possible to simultaneously have the Proxy object extend from >Image (or BufferedImage), which is required here. A better approach, for backwards-compatibility with Java 8, is to implement NETBEANS-3469, having ImageUtilities write out pre-rendered PNG files at 1x and 2x resolution into the NetBeans cache directory, following the prescribed MacOS naming convention (e.g. "icon.png" and "i...@2x.png"), and then using Toolkit.getImage(URL) to produce the actual Image object (on MacOS only). This will produce retina-capable images on both Java 8 and Java 9 and above. (Note that MacOS uses only 1x and 2x scaling, unlike Windows, where arbitrary HiDPI scalings can occur.) > Make HiDPI (Retina) icons work in MacOS menu bar > ------------------------------------------------ > > Key: NETBEANS-3468 > URL: https://issues.apache.org/jira/browse/NETBEANS-3468 > Project: NetBeans > Issue Type: Improvement > Components: platform - Other > Affects Versions: 11.3 > Environment: MacOS with retina display > Reporter: Eirik Bakke > Priority: Minor > Labels: HiDPI > Attachments: menuicon_retina.png > > > HiDPI icons, introduced in NETBEANS-2614 and NETBEANS-2604, do not yet show > up in the correct resolution when used in the menu bar on MacOS. See the > attached screenshot (from a NetBeans Platform application). This should be > fixed. > Note that we have only so far introduced HiDPI icons for the "Undo" and > "Redo" actions. > Emilian Bold probably figured this out in his earlier experimental Retina > support branch; see RetinaMultiResolutionImage in > https://github.com/emilianbold/nextbeans/commit/0f99dba0c1b3e8e0bc4e7cec407b53d30e85ead1 > . If the solution involves implementing MultiResolutionImage, then make sure > not to do this on Windows (to avoid > https://bugs.openjdk.java.net/browse/JDK-8212226 ). -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists