/** * Returns a colorized version of the specified color scheme. * * @param component * Component. * @param scheme * Color scheme. * @param isEnabled * Indicates whether the component is enabled. * @return Colorized version of the specified color scheme. */ private static SubstanceColorScheme getColorizedScheme(Component component, SubstanceColorScheme scheme, boolean isEnabled) { Component forQuerying = component; if ((component != null) && (component.getParent() != null) && ((component instanceof SubstanceInternalArrowButton) || (component instanceof SubstanceTitleButton))) { forQuerying = component.getParent(); } return getColorizedScheme(component, scheme, (forQuerying == null) ? null : forQuerying.getForeground(), (forQuerying == null) ? null : forQuerying.getBackground(), isEnabled); }
/** * Returns a colorized version of the specified color scheme. * * @param component * Component. * @param scheme * Color scheme. * @param isEnabled * Indicates whether the component is enabled. * @return Colorized version of the specified color scheme. */ private static SubstanceColorScheme getColorizedScheme(Component component, SubstanceColorScheme scheme, boolean isEnabled) { Component forQuerying = component; if ((component != null) && (component.getParent() != null) && ((component instanceof SubstanceInternalArrowButton) || (component instanceof SubstanceTitleButton))) { forQuerying = component.getParent(); } return getColorizedScheme(component, scheme, (forQuerying == null) ? null : forQuerying.getForeground(), (forQuerying == null) ? null : forQuerying.getBackground(), isEnabled); }
/** * Returns the color scheme of the component. * * @param component * Component. * @param associationKind * Association kind. * @param componentState * Component state. * @return Component color scheme. */ public static SubstanceColorScheme getColorScheme(Component component, ColorSchemeAssociationKind associationKind, ComponentState componentState) { // special case - if the component is marked as flat and // it is in the default state, get the color scheme of the parent. // However, flat toolbars should be ignored, since they are // the "top" level decoration area. if (!(component instanceof JToolBar) && SubstanceCoreUtilities.hasFlatAppearance(component, false) && (componentState == ComponentState.ENABLED)) { component = component.getParent(); } SubstanceColorScheme nonColorized = SubstanceCoreUtilities.getSkin( component).getColorScheme(component, associationKind, componentState); return getColorizedScheme(component, nonColorized, !componentState .isDisabled()); }
/** * Returns the color scheme of the component. * * @param component * Component. * @param associationKind * Association kind. * @param componentState * Component state. * @return Component color scheme. */ public static SubstanceColorScheme getColorScheme(Component component, ColorSchemeAssociationKind associationKind, ComponentState componentState) { // special case - if the component is marked as flat and // it is in the default state, get the color scheme of the parent. // However, flat toolbars should be ignored, since they are // the "top" level decoration area. if (!(component instanceof JToolBar) && SubstanceCoreUtilities.hasFlatAppearance(component, false) && (componentState == ComponentState.ENABLED)) { component = component.getParent(); } SubstanceColorScheme nonColorized = SubstanceCoreUtilities.getSkin( component).getColorScheme(component, associationKind, componentState); return getColorizedScheme(component, nonColorized, !componentState .isDisabled()); }
/** * Returns the color scheme of the component. * * @param component * Component. * @param componentState * Component state. * @return Component color scheme. */ public static SubstanceColorScheme getActiveColorScheme( Component component, ComponentState componentState) { // special case - if the component is marked as flat and // it is in the default state, get the color scheme of the parent. // However, flat toolbars should be ignored, since they are // the "top" level decoration area. if (!(component instanceof JToolBar) && SubstanceCoreUtilities.hasFlatAppearance(component, false) && (componentState == ComponentState.ENABLED)) { component = component.getParent(); } SubstanceColorScheme nonColorized = SubstanceCoreUtilities.getSkin( component).getActiveColorScheme( SubstanceLookAndFeel.getDecorationType(component)); return getColorizedScheme(component, nonColorized, !componentState .isDisabled()); }
/** * Returns the color scheme of the component. * * @param component * Component. * @param associationKind * Association kind. * @param componentState * Component state. * @return Component color scheme. */ public static SubstanceColorScheme getActiveColorScheme( Component component, ComponentState componentState) { // special case - if the component is marked as flat and // it is in the default state, get the color scheme of the parent. // However, flat toolbars should be ignored, since they are // the "top" level decoration area. if (!(component instanceof JToolBar) && SubstanceCoreUtilities.hasFlatAppearance(component, false) && (componentState == ComponentState.ENABLED)) { component = component.getParent(); } SubstanceColorScheme nonColorized = SubstanceCoreUtilities.getSkin( component).getActiveColorScheme( SubstanceLookAndFeel.getDecorationType(component)); return getColorizedScheme(component, nonColorized, !componentState .isDisabled()); }
if (tabIndex >= 0) { Component component = jtp.getComponentAt(tabIndex); SubstanceColorScheme colorized = getColorizedScheme(component, nonColorized, jtp.getForegroundAt(tabIndex), jtp .getBackgroundAt(tabIndex), !componentState return colorized; } else { return getColorizedScheme(jtp, nonColorized, !componentState .isDisabled());
if (tabIndex >= 0) { Component component = jtp.getComponentAt(tabIndex); SubstanceColorScheme colorized = getColorizedScheme(component, nonColorized, jtp.getForegroundAt(tabIndex), jtp .getBackgroundAt(tabIndex), !componentState return colorized; } else { return getColorizedScheme(jtp, nonColorized, !componentState .isDisabled());
componentState); return getColorizedScheme(orig, nonColorized, !componentState .isDisabled());
componentState); return getColorizedScheme(orig, nonColorized, !componentState .isDisabled());