Revision: 5892 http://sourceforge.net/p/jump-pilot/code/5892 Author: ma15569 Date: 2018-06-22 12:28:22 +0000 (Fri, 22 Jun 2018) Log Message: ----------- adapted from Ede's suggest
Modified Paths: -------------- core/trunk/src/com/vividsolutions/jump/workbench/ui/images/IconLoader.java Modified: core/trunk/src/com/vividsolutions/jump/workbench/ui/images/IconLoader.java =================================================================== --- core/trunk/src/com/vividsolutions/jump/workbench/ui/images/IconLoader.java 2018-06-22 11:57:38 UTC (rev 5891) +++ core/trunk/src/com/vividsolutions/jump/workbench/ui/images/IconLoader.java 2018-06-22 12:28:22 UTC (rev 5892) @@ -51,25 +51,15 @@ // start private static HashMap<String, ImageIcon> iconCache = new HashMap<>(); - // default icon if the choosen one doesn't exist // + // default icon if the choosen one doesn't exist // Adapted from Kosmo SAIG public final static ImageIcon DEFAULT_UNKNOW_ICON = new ImageIcon( IconLoader.class.getResource("default_icon.png")); public static ImageIcon icon(String filename) { - ImageIcon icon = null; - try { - icon = getIcon(IconLoader.class.getResource(resolveFile(filename))); - } catch (final Exception e) { - icon = DEFAULT_UNKNOW_ICON; - } - return icon; + return getIcon(IconLoader.class.getResource(resolveFile(filename))); } - // public static ImageIcon icon(String filename) { - // return getIcon(IconLoader.class.getResource(resolveFile(filename))); - // } - public static BufferedImage image(String filename) { final ImageIcon icon = getIcon(IconLoader.class .getResource(resolveFile(filename))); @@ -115,6 +105,7 @@ Logger.error(e); } if (icon == null) { + icon = DEFAULT_UNKNOW_ICON; Logger.error("icon '" + key + "' is null!"); } ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel