Package org.pushingpixels.substance.api
Class SubstanceColorSchemeBundle
- java.lang.Object
-
- org.pushingpixels.substance.api.SubstanceColorSchemeBundle
-
public class SubstanceColorSchemeBundle extends java.lang.ObjectColor scheme bundle. Defines the visual appearance of a single decoration area of a skin.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceSubstanceColorSchemeBundle.Overlay
-
Constructor Summary
Constructors Constructor Description SubstanceColorSchemeBundle(SubstanceColorScheme activeColorScheme, SubstanceColorScheme enabledColorScheme, SubstanceColorScheme disabledColorScheme)Creates a new color scheme bundle.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SubstanceColorSchemegetActiveColorScheme()Returns the active color scheme of this bundle.floatgetAlpha(ComponentState componentState)Returns the alpha channel of color schemes for the specified component state.SubstanceColorSchemegetColorScheme(ComponentState componentState)Returns the color scheme of the specified component in the specified component state.SubstanceColorSchemegetColorScheme(SubstanceSlices.ColorSchemeAssociationKind associationKind, ComponentState componentState, boolean allowFallback)Returns the color scheme to be used for painting the specified visual area of the component under the specified component state.SubstanceColorSchemegetDisabledColorScheme()Returns the disabled color scheme of this bundle.SubstanceColorSchemegetEnabledColorScheme()Returns the enabled color scheme of this bundle.floatgetHighlightAlpha(ComponentState componentState)Returns the alpha channel of the highlight color schemes for the specified component state.voidregisterAlpha(float alpha, ComponentState... states)Registers an alpha channel value for the specific component states.voidregisterColorScheme(SubstanceColorScheme stateColorScheme, ComponentState... states)Registers a color scheme for the specific component state.voidregisterColorScheme(SubstanceColorScheme scheme, SubstanceSlices.ColorSchemeAssociationKind associationKind, ComponentState... states)Registers the color scheme to be used for the specified visual area of controls under the specified states.voidregisterHighlightAlpha(float alpha, ComponentState... states)Registers a highlight alpha channel value for the specific component states.voidregisterHighlightColorScheme(SubstanceColorScheme stateHighlightScheme, ComponentState... states)Registers a highlight color scheme for the specific component state if the component state is notnull, or a global highlight color scheme otherwise.
-
-
-
Constructor Detail
-
SubstanceColorSchemeBundle
public SubstanceColorSchemeBundle(SubstanceColorScheme activeColorScheme, SubstanceColorScheme enabledColorScheme, SubstanceColorScheme disabledColorScheme)
Creates a new color scheme bundle.- Parameters:
activeColorScheme- The active color scheme of this bundle.enabledColorScheme- The enabled color scheme of this bundle.disabledColorScheme- The disabled color scheme of this bundle.
-
-
Method Detail
-
registerAlpha
public void registerAlpha(float alpha, ComponentState... states)Registers an alpha channel value for the specific component states.- Parameters:
alpha- Alpha channel value.states- Component states.
-
registerColorScheme
public void registerColorScheme(SubstanceColorScheme stateColorScheme, ComponentState... states)
Registers a color scheme for the specific component state.- Parameters:
stateColorScheme- Color scheme for the specified component state.states- Component states.
-
registerHighlightColorScheme
public void registerHighlightColorScheme(SubstanceColorScheme stateHighlightScheme, ComponentState... states)
Registers a highlight color scheme for the specific component state if the component state is notnull, or a global highlight color scheme otherwise.- Parameters:
stateHighlightScheme- Highlight color scheme for the specified component state.states- Component states. Ifnull, the specified color scheme will be applied for all states left unspecified.
-
registerHighlightAlpha
public void registerHighlightAlpha(float alpha, ComponentState... states)Registers a highlight alpha channel value for the specific component states.- Parameters:
alpha- Highlight alpha channel value.states- Component states.
-
getColorScheme
public SubstanceColorScheme getColorScheme(ComponentState componentState)
Returns the color scheme of the specified component in the specified component state.- Parameters:
componentState- Component state.- Returns:
- The color scheme of the component in the specified component state.
-
getHighlightAlpha
public float getHighlightAlpha(ComponentState componentState)
Returns the alpha channel of the highlight color schemes for the specified component state.- Parameters:
componentState- Component state.- Returns:
- Highlight color scheme alpha channel.
-
getAlpha
public float getAlpha(ComponentState componentState)
Returns the alpha channel of color schemes for the specified component state.- Parameters:
componentState- Component state.- Returns:
- Color scheme alpha channel.
-
getActiveColorScheme
public SubstanceColorScheme getActiveColorScheme()
Returns the active color scheme of this bundle.- Returns:
- The active color scheme of this bundle.
-
getEnabledColorScheme
public SubstanceColorScheme getEnabledColorScheme()
Returns the enabled color scheme of this bundle.- Returns:
- The enabled color scheme of this bundle.
-
getDisabledColorScheme
public SubstanceColorScheme getDisabledColorScheme()
Returns the disabled color scheme of this bundle.- Returns:
- The disabled color scheme of this bundle.
-
registerColorScheme
public void registerColorScheme(SubstanceColorScheme scheme, SubstanceSlices.ColorSchemeAssociationKind associationKind, ComponentState... states)
Registers the color scheme to be used for the specified visual area of controls under the specified states. For example, if the light orange scheme has to be used for gradient fill for rollover selected and rollover controls, the parameters would be:scheme=light orange scheme-
associationKind=SubstanceSlices.ColorSchemeAssociationKind.FILL -
states=ComponentState.ROLLOVER_SELECTED,ComponentState.ROLLOVER_UNSELECTED
- Parameters:
scheme- Color scheme.associationKind- Color scheme association kind that specifies the visual areas of controls to be painted with this color scheme.states- Component states that further restrict the usage of the specified color scheme.
-
getColorScheme
public SubstanceColorScheme getColorScheme(SubstanceSlices.ColorSchemeAssociationKind associationKind, ComponentState componentState, boolean allowFallback)
Returns the color scheme to be used for painting the specified visual area of the component under the specified component state.- Parameters:
associationKind- Color scheme association kind.componentState- Component state.allowFallback- If true, this method will return a color scheme for the fallback association kind.- Returns:
- Color scheme to be used for painting the specified visual area of the component under the specified component state.
- See Also:
registerColorScheme(SubstanceColorScheme, ComponentState...)
-
-