@Test public void testProcessIcon() { ImageIcon original = MCTIcons.generateIcon(100, 14, Color.WHITE); ImageIcon processed = MCTIcons.processIcon(original); IconTester originalTester = new IconTester(original); IconTester processedTester = new IconTester(processed); Assert.assertFalse(originalTester.equals(processedTester)); Assert.assertTrue( processedTester.similarity(101, 131, 192) > originalTester.similarity(101, 131, 192)); }
public static ImageIcon processIcon(ImageIcon icon) { if (processedIcons.containsKey(icon)) { return processedIcons.get(icon); } else if (processedIcons.containsValue(icon)) { return icon; } ImageIcon newIcon = processIcon(icon, 0.775f, 0.85f, 0.95f, true); processedIcons.put(icon, newIcon); return newIcon; }
MCTIcons { public static ImageIcon processIcon(ImageIcon icon) { if (processedIcons.containsKey(icon)) { return processedIcons.get(icon); } else if (processedIcons.containsValue(icon)) { return icon; } ImageIcon newIcon = processIcon(icon, 0.775f, 0.85f, 0.95f, true); processedIcons.put(icon, newIcon); return newIcon; } }
MCTIcons { public static ImageIcon processIcon(ImageIcon icon) { if (processedIcons.containsKey(icon)) { return processedIcons.get(icon); } else if (processedIcons.containsValue(icon)) { return icon; } ImageIcon newIcon = processIcon(icon, 0.775f, 0.85f, 0.95f, true); processedIcons.put(icon, newIcon); return newIcon; } private  MCTIcons(); }
MCTIcons { public static ImageIcon processIcon(ImageIcon icon) { if (processedIcons.containsKey(icon)) { return processedIcons.get(icon); } else if (processedIcons.containsValue(icon)) { return icon; } ImageIcon newIcon = processIcon(icon, 0.775f, 0.85f, 0.95f, true); processedIcons.put(icon, newIcon); return newIcon; } private  MCTIcons(); static ImageIcon getWarningIcon(); static ImageIcon getErrorIcon(int width, int height); static ImageIcon getComponent(); static ImageIcon generateIcon(int hash, int sz, Color color); static ImageIcon processIcon(ImageIcon icon); static ImageIcon processIcon(ImageIcon icon, float r, float g, float b, boolean dropShadow); static ImageIcon processIcon(ImageIcon icon, Color c, boolean dropShadow); static ImageIcon processIcon(ImageIcon icon, Color top, Color bottom, boolean dropShadow); }
MCTIcons { public static ImageIcon processIcon(ImageIcon icon) { if (processedIcons.containsKey(icon)) { return processedIcons.get(icon); } else if (processedIcons.containsValue(icon)) { return icon; } ImageIcon newIcon = processIcon(icon, 0.775f, 0.85f, 0.95f, true); processedIcons.put(icon, newIcon); return newIcon; } private  MCTIcons(); static ImageIcon getWarningIcon(); static ImageIcon getErrorIcon(int width, int height); static ImageIcon getComponent(); static ImageIcon generateIcon(int hash, int sz, Color color); static ImageIcon processIcon(ImageIcon icon); static ImageIcon processIcon(ImageIcon icon, float r, float g, float b, boolean dropShadow); static ImageIcon processIcon(ImageIcon icon, Color c, boolean dropShadow); static ImageIcon processIcon(ImageIcon icon, Color top, Color bottom, boolean dropShadow);  }