matthiasblaesing commented on code in PR #8194:
URL: https://github.com/apache/netbeans/pull/8194#discussion_r1932481818


##########
enterprise/web.monitor/src/org/netbeans/modules/web/monitor/client/TransactionView.java:
##########
@@ -310,8 +310,8 @@ public void actionPerformed(ActionEvent e) {
                    }
                }});
 
-       timeDButton = new JToggleButton(new ImageIcon(
-                
TransactionView.class.getResource("/org/netbeans/modules/web/monitor/client/icons/timesortB.gif")),
 true);
+       timeDButton = new JToggleButton(ImageUtilities.loadIcon(
+                
"org/netbeans/modules/web/monitor/client/icons/timesortB.gif"), true);

Review Comment:
   > There's a lot of [duplicate 
icons](https://people.csail.mit.edu/ebakke/misc/netbeans-icons-250104.html).
   > 
   > I remember we discussed a potential API that would allow icons to be 
replaced in a centralized manner. E.g. you could put all the SVGs in a single 
module, along with the list of mappings from GIF/PNG icon paths to SVG files, 
and then ImageUtilities would take the icon from that module instead when 
available.
   
   Alternative approach:
   
   - at build time create an hash (SHA1/MD5, it does not need to be 
cryptographically secure) for the target file
   - at runtime when an icon is requested, grab the hash, check if it is 
present in a cache
   - if entry is not present -> load as usual and cache result (weakly 
referenced)
   - if entry is present, return that
   
   We get the speedup and retain the modularity.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
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

Reply via email to