/** * Gets a disabled version of ImageIcon by passing class and a relative image file path. * * @param clazz the Class<?> * @param fileName relative file name * @return the ImageIcon */ public static ImageIcon getDisabledImageIcon(Class<?> clazz, String fileName) { String id = clazz.getName() + ":" + fileName; ImageIcon saved = _disableIcons.get(id); if (saved != null) return saved; else { ImageIcon icon = createGrayImage(getImageIcon(clazz, fileName)); _disableIcons.put(id, icon); return icon; } }
protected void paintIcon(JMenuItem b, Graphics g) { if (b.getIcon() != null) { Icon icon = getIcon(b); ButtonModel model = b.getModel(); if (icon != null) { if (isFloatingIcon()) { if (model.isArmed() || (b instanceof JMenu && model.isSelected())) { if (icon instanceof ImageIcon) { ImageIcon shadow = IconsFactory.createGrayImage(((ImageIcon) icon).getImage()); shadow.paintIcon(b, g, iconRect.x + 1, iconRect.y + 1); } else { ImageIcon shadow = IconsFactory.createGrayImage(b, icon); shadow.paintIcon(b, g, iconRect.x + 1, iconRect.y + 1); } icon.paintIcon(b, g, iconRect.x - 1, iconRect.y - 1); } else { icon.paintIcon(b, g, iconRect.x, iconRect.y); } } else { icon.paintIcon(b, g, iconRect.x, iconRect.y); } } } }
if (!"true".equals(SecurityUtils.getProperty("shadingtheme", "false")) && b instanceof JideButton && ((JideButton) b).getButtonStyle() == JideButton.TOOLBAR_STYLE) { if (icon instanceof ImageIcon) { ImageIcon shadow = IconsFactory.createGrayImage(((ImageIcon) icon).getImage()); shadow.paintIcon(b, g, iconRect.x + 1, iconRect.y + 1); ImageIcon shadow = IconsFactory.createGrayImage(b, icon); shadow.paintIcon(b, g, iconRect.x + 1, iconRect.y + 1);
icon = b.getIcon(); if (icon instanceof ImageIcon) { icon = IconsFactory.createGrayImage(((ImageIcon) icon).getImage()); icon = IconsFactory.createGrayImage(b, icon);
icon = b.getIcon(); if (icon instanceof ImageIcon) { icon = IconsFactory.createGrayImage(((ImageIcon) icon).getImage()); icon = IconsFactory.createGrayImage(b, icon);
icon = b.getIcon(); if (icon instanceof ImageIcon) { icon = IconsFactory.createGrayImage(((ImageIcon) icon).getImage()); icon = IconsFactory.createGrayImage(b, icon);
if (!"true".equals(SecurityUtils.getProperty("shadingtheme", "false"))) { if (icon instanceof ImageIcon) { ImageIcon shadow = IconsFactory.createGrayImage(((ImageIcon) icon).getImage()); shadow.paintIcon(b, g, iconRect.x + 1, iconRect.y + 1); ImageIcon shadow = IconsFactory.createGrayImage(b, icon); shadow.paintIcon(b, g, iconRect.x + 1, iconRect.y + 1);
icon = IconsFactory.createGrayImage(((ImageIcon) icon).getImage()); icon = IconsFactory.createGrayImage(b, icon);
icon = IconsFactory.createGrayImage(((ImageIcon) icon).getImage()); icon = IconsFactory.createGrayImage(b, icon);
icon = IconsFactory.createGrayImage(((ImageIcon) icon).getImage()); icon = IconsFactory.createGrayImage(b, icon);