You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Eirik Bakke (Jira)" <ji...@apache.org> on 2020/02/26 06:02:00 UTC

[jira] [Resolved] (NETBEANS-1583) Support MultiResolutionImage loading from ImageUtilities

     [ https://issues.apache.org/jira/browse/NETBEANS-1583?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eirik Bakke resolved NETBEANS-1583.
-----------------------------------
    Resolution: Won't Fix

See previous comment--closing as won't fix, since SVG loading now replaces this functionality.

> Support MultiResolutionImage loading from ImageUtilities 
> ---------------------------------------------------------
>
>                 Key: NETBEANS-1583
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-1583
>             Project: NetBeans
>          Issue Type: Improvement
>          Components: platform - Other
>    Affects Versions: 10.0
>         Environment: Windows, Linux, and MacOS
>            Reporter: Eirik Bakke
>            Priority: Minor
>              Labels: HiDPI
>
> 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 Swing, multi-resolution image assets are supported via the [MultiResolutionImage|https://docs.oracle.com/javase/10/docs/api/java/awt/image/MultiResolutionImage.html] class; such images are automatically loaded by methods such as Toolkit.getImage based on a standard naming convention. For instance, on MacOS, Toolkit.getImage("myicon.png") will also load the file "myicon@2x.png" if present, returning a MultiResolutionImage (implemented in [JDK-8011059|https://bugs.openjdk.java.net/browse/JDK-8011059]). NetBeans' ImageUtilities.loadImage and friends should do the same.
> The same naming convention for multi-resolution image assets should be used as in the JDK. See Philip Race's comment on [JDK-8151787|https://bugs.openjdk.java.net/browse/JDK-8151787] :
> {quote}The proposed name convention for splash screens *and* other multi-res images is @125pct @150pct @200pct @2x @250pct @300pct @3x 
> ie @2x and @3x are supported as synonyms for @200pct and @300pct respectively and also because we already supported @2x on retina Mac.
> {quote}
>  
> On the naming convention, see also [JDK-8090575|https://bugs.openjdk.java.net/browse/JDK-8090575]. Also make sure to retain the ability to add a "_dark" suffix for dark LAFs.
> As far as I know, only MacOS currently supports the automatic loading of such assets via Toolkit.getImage, but both Windows and MacOS (and Linux?) support the underlying MultiResolutionImage class. So it's already possible to implement this on the latest JDK. Note, however, that we should probably wait for [JDK-8212226|https://bugs.openjdk.java.net/browse/JDK-8212226] to be fixed before enabling this on Windows.
> As part of this patch, other ImageUtilities methods such as createDisabledIcon, createDisabledImage, and mergeImages should also be updated to support both MultiResolutionImage and the new org.openide.util.VectorIcon class (introduced at https://github.com/apache/incubator-netbeans/pull/859/files ). Emilian Bold has done some work on this in the past; see https://github.com/emilianbold/nextbeans/commit/0f99dba0c1b3e8e0bc4e7cec407b53d30e85ead1 . Eirik Bakke also has a [Pull Request|https://github.com/apache/incubator-netbeans/pull/998] for createDisabledIcon in particular, which works with the VectorIcon class and any other Icon instance.
> Last, note that there are two ways to create icons that look good on HiDPI displays: either by using MultiResolutionImage, or by hand-painting vector graphics in a custom implementation of the Icon class. This issue deals with the MultiResolutionImage approach; the vector painting approach is supported via the existing helper class org.openide.util.VectorIcon. Both approaches are valid and should be supported by the NetBeans Platform. (Update on 2019-05-27: There's a third approach, which is to supply each icon as an SVG file. That one is probably the better approach. See https://issues.apache.org/jira/browse/NETBEANS-2604 .)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists