+1 to the concept of using enums. I've been doing so in my platform application as well as non platform ones. I created a code generator from the material icon set file names. Then I can request an icon of a specific size and color. MaterialIcon._Action.ACCESSIBILITY.getImageIcon(24, Color.RED);
https://github.com/trixon/almond3/blob/develop/util/src/main/java/se/trixon/almond/util/icons/material/swing/MaterialIcon.java There is also a java fx version returning ImageViews. It's without the fancy platform, cache and svg stuff but perhaps it can inspire some. /Patrik Den tis 22 sep. 2020 kl 08:16 skrev Laszlo Kishalmi < [email protected]>: > Dear all, > > We have about 4200 icons/images in the repository. most probably many of > them are duplicates, triplicates, multiplicates copied to different > locations. > > Just in a recent PR, Eirik added 34 new svg icons to 192 places. > (https://github.com/apache/netbeans/pull/2387) > > We have 28 instances of wait.gif (and 4 wait.png). > > I think before jumping into the svg era, we need to stop, look around > and think. Could we do better? > > I think, yes, there is a demand for a common icon catalog. Or more icon > catalogs (per cluster?) > > I've done a very raw sketch to get the base of a discussion. It is a raw > Idea I have in my mind: https://github.com/apache/netbeans/pull/2388 > > My two main goals: > > - Move reusable icons to a centralized place catalog. I'd imagine > these catalogs as public java Enums > - Provide backward compatibility based on icon resource names > > Feedbacks/requirements/insights are welcome! > > BTW, I'm completely Ok if we do not do anything about this. I just > wanted to draw some attention on this issue. > > -- > > Laszlo Kishalmi > > > > --------------------------------------------------------------------- > 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 > > > >
