DecorationAreaType.GENERAL); Icon infoIcon = SubstanceLookAndFeel.isToUseConstantThemesOnDialogs() ? SubstanceCoreUtilities .getIcon("resource/22/dialog-information.png") : SubstanceCoreUtilities.getThemedIcon(this.tipPane,
/** * Returns the color scheme for the icon of option panes with the specified * message type. * * @param messageType * Option pane message type. * @param mainScheme * Main color scheme. * @return Color scheme for the icon of option panes with the specified * message type. */ public static SubstanceColorScheme getOptionPaneColorScheme( int messageType, SubstanceColorScheme mainScheme) { if (!SubstanceLookAndFeel.isToUseConstantThemesOnDialogs()) return mainScheme; switch (messageType) { case JOptionPane.INFORMATION_MESSAGE: return new BottleGreenColorScheme(); case JOptionPane.QUESTION_MESSAGE: return new LightAquaColorScheme(); case JOptionPane.WARNING_MESSAGE: return new SunsetColorScheme(); case JOptionPane.ERROR_MESSAGE: return new SunfireRedColorScheme(); } return null; }
/** * Returns the color scheme for the icon of option panes with the specified * message type. * * @param messageType * Option pane message type. * @param mainScheme * Main color scheme. * @return Color scheme for the icon of option panes with the specified * message type. */ public static SubstanceColorScheme getOptionPaneColorScheme( int messageType, SubstanceColorScheme mainScheme) { if (!SubstanceLookAndFeel.isToUseConstantThemesOnDialogs()) return mainScheme; switch (messageType) { case JOptionPane.INFORMATION_MESSAGE: return new BottleGreenColorScheme(); case JOptionPane.QUESTION_MESSAGE: return new LightAquaColorScheme(); case JOptionPane.WARNING_MESSAGE: return new SunsetColorScheme(); case JOptionPane.ERROR_MESSAGE: return new SunfireRedColorScheme(); } return null; }
@Override protected void addIcon(Container top) { Icon sideIcon = (optionPane == null ? null : optionPane.getIcon()); if (sideIcon == null && optionPane != null) sideIcon = super.getIconForType(optionPane.getMessageType()); if (sideIcon != null) { if (!SubstanceLookAndFeel.isToUseConstantThemesOnDialogs()) { sideIcon = SubstanceCoreUtilities.getThemedIcon(null, sideIcon); } this.substanceIconLabel = new OptionPaneLabel(); this.iconGlowTracker = new IconGlowTracker(substanceIconLabel); this.substanceIconLabel.setIcon(new GlowingIcon(sideIcon, this.iconGlowTracker)); this.substanceIconLabel.setName("OptionPane.iconLabel"); this.substanceIconLabel.setVerticalAlignment(SwingConstants.TOP); top.add(this.substanceIconLabel, BorderLayout.BEFORE_LINE_BEGINS); } }
@Override protected void addIcon(Container top) { Icon sideIcon = (optionPane == null ? null : optionPane.getIcon()); if (sideIcon == null && optionPane != null) sideIcon = super.getIconForType(optionPane.getMessageType()); if (sideIcon != null) { if (!SubstanceLookAndFeel.isToUseConstantThemesOnDialogs()) { sideIcon = SubstanceCoreUtilities.getThemedIcon(null, sideIcon); } this.substanceIconLabel = new OptionPaneLabel(); this.iconGlowTracker = new IconGlowTracker(substanceIconLabel); this.substanceIconLabel.setIcon(new GlowingIcon(sideIcon, this.iconGlowTracker)); this.substanceIconLabel.setName("OptionPane.iconLabel"); this.substanceIconLabel.setVerticalAlignment(SwingConstants.TOP); top.add(this.substanceIconLabel, BorderLayout.BEFORE_LINE_BEGINS); } }