Class RadianceSkin
- java.lang.Object
-
- org.pushingpixels.radiance.theming.api.RadianceSkin
-
- All Implemented Interfaces:
RadianceTrait
- Direct Known Subclasses:
AutumnSkin,CeruleanSkin,GeminiSkin,GreenMagicSkin,MagellanSkin,MarinerSkin,ModerateSkin,NightShadeSkin,RadianceSkin.Accented,RavenSkin,SaharaSkin,SentinelSkin,TwilightSkin
public abstract class RadianceSkin extends java.lang.Object implements RadianceTrait
Base abstract class for Radiance skins.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRadianceSkin.AccentedBase class for skins that can be configured with accent color schemes.static interfaceRadianceSkin.ColorSchemes
-
Field Summary
Fields Modifier and Type Field Description protected RadianceBorderPainterborderPainterThe border painter ofthisskin.protected RadianceButtonShaperbuttonShaperThe button shaper ofthisskin.protected RadianceDecorationPainterdecorationPainterThe decoration painter ofthisskin.protected RadianceFillPainterfillPainterThe fill painter ofthisskin.protected RadianceBorderPainterhighlightBorderPainterThe highlight border painter ofthisskin.protected RadianceFillPainterhighlightFillPainterThe highlight fill painter ofthisskin.
-
Constructor Summary
Constructors Modifier Constructor Description protectedRadianceSkin()Constructs the basic data structures for a skin.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddOverlayPainter(RadianceOverlayPainter overlayPainter, RadianceThemingSlices.DecorationAreaType... areaTypes)Adds the specified overlay painter to the end of the list of overlay painters associated with the specified decoration area types.voidclearOverlayPainters(RadianceThemingSlices.DecorationAreaType... areaTypes)Removes all overlay painters associated with the specified decoration area types.RadianceColorSchemegetActiveColorScheme(RadianceThemingSlices.DecorationAreaType decorationAreaType)Returns the main active color scheme for the specific decoration area type.floatgetAlpha(java.awt.Component comp, ComponentState componentState)Returns the alpha channel of the color scheme of the component.RadianceColorSchemegetBackgroundColorScheme(RadianceThemingSlices.DecorationAreaType decorationAreaType)Returns the background color scheme for the specified decoration area type.RadianceBorderPaintergetBorderPainter()Returns the border painter of this skin.RadianceButtonShapergetButtonShaper()Returns the button shaper of this skin.RadianceColorSchemegetColorScheme(java.awt.Component comp, ComponentState componentState)Returns the color scheme of the specified component in the specified component state.RadianceColorSchemegetColorScheme(java.awt.Component comp, RadianceThemingSlices.ColorSchemeAssociationKind associationKind, ComponentState componentState)Returns the color scheme to be used for painting the specified visual area of the component under the specified component state.RadianceColorSchemegetColorScheme(RadianceThemingSlices.DecorationAreaType decorationAreaType, RadianceThemingSlices.ColorSchemeAssociationKind associationKind, ComponentState componentState)Returns the color scheme to be used for painting the specified visual area of components in the specified decoration area.static RadianceSkin.ColorSchemesgetColorSchemes(java.io.InputStream inputStream)Returns the collection of color schemes in the specified input stream.RadianceDecorationPaintergetDecorationPainter()Returns the decoration painter of this skin.RadianceColorSchemegetDirectColorScheme(java.awt.Component comp, RadianceThemingSlices.ColorSchemeAssociationKind associationKind, ComponentState componentState)Returns the color scheme to be used for painting the specified visual area of the component under the specified component state.RadianceColorSchemegetDisabledColorScheme(RadianceThemingSlices.DecorationAreaType decorationAreaType)Returns the main disabled color scheme for the specific decoration area type.RadianceColorSchemegetEnabledColorScheme(RadianceThemingSlices.DecorationAreaType decorationAreaType)Returns the main enabled color scheme for the specific decoration area type.RadianceFillPaintergetFillPainter()Returns the fill painter of this skin.floatgetHighlightAlpha(java.awt.Component comp, ComponentState componentState)Returns the alpha channel of the highlight color scheme of the component.RadianceBorderPaintergetHighlightBorderPainter()Returns the highlight border painter of this skin.RadianceFillPaintergetHighlightFillPainter()Returns the highlight painter of this skin.RadianceColorSchemegetOptionPaneIconColorScheme(int optionPaneMessageType)java.awt.ColorgetOverlayColor(RadianceThemingSlices.ColorOverlayType colorOverlayType, RadianceThemingSlices.DecorationAreaType decorationAreaType, ComponentState componentState)java.util.List<RadianceOverlayPainter>getOverlayPainters(RadianceThemingSlices.DecorationAreaType decorationAreaType)Returns a non-null, non-modifiable list of overlay painters associated with the specified decoration area type.booleanisRegisteredAsDecorationArea(RadianceThemingSlices.DecorationAreaType decorationType)Returns indication whether the specified decoration area type should have their background painted byRadianceDecorationPainter.paintDecorationArea(Graphics2D, Component, RadianceThemingSlices.DecorationAreaType, int, int, RadianceSkin)instead of a simple background fill.booleanisValid()Checks whether this skin is valid.voidregisterAsDecorationArea(RadianceColorScheme backgroundColorScheme, RadianceColorSchemeBundle.Overlay noneTransformationOverlay, RadianceThemingSlices.DecorationAreaType... areaTypes)Registers the specified background color scheme and a color scheme bundle overlay to be used on controls in decoration areas.voidregisterAsDecorationArea(RadianceColorScheme backgroundColorScheme, RadianceThemingSlices.DecorationAreaType... areaTypes)Registers the specified background color scheme to be used on controls in decoration areas.voidregisterDecorationAreaSchemeBundle(RadianceColorSchemeBundle bundle, RadianceColorScheme backgroundColorScheme, RadianceThemingSlices.DecorationAreaType... areaTypes)Registers the specified color scheme bundle and background color scheme to be used on controls in decoration areas.voidregisterDecorationAreaSchemeBundle(RadianceColorSchemeBundle bundle, RadianceThemingSlices.DecorationAreaType... areaTypes)Registers the specified color scheme bundle to be used on controls in decoration areas.voidremoveOverlayPainter(RadianceOverlayPainter overlayPainter, RadianceThemingSlices.DecorationAreaType... areaTypes)Removes the specified overlay painter from the list of overlay painters associated with the specified decoration area types.voidsetOptionPaneIconColorScheme(RadianceColorScheme colorScheme, int... optionPaneMessageTypes)voidsetOverlayColor(java.awt.Color color, RadianceThemingSlices.ColorOverlayType colorOverlayType, RadianceThemingSlices.DecorationAreaType decorationAreaType, ComponentState... componentStates)RadianceSkintransform(ColorSchemeTransform transform, java.lang.String name)Creates a new skin that has the same settings as this skin with the addition of applying the specified color scheme transformation on all the relevant color schemes.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pushingpixels.radiance.theming.api.trait.RadianceTrait
getDisplayName
-
-
-
-
Field Detail
-
buttonShaper
protected RadianceButtonShaper buttonShaper
The button shaper ofthisskin. Must be non-null.
-
fillPainter
protected RadianceFillPainter fillPainter
The fill painter ofthisskin. Must be non-null.
-
highlightFillPainter
protected RadianceFillPainter highlightFillPainter
The highlight fill painter ofthisskin. Must be non-null.
-
borderPainter
protected RadianceBorderPainter borderPainter
The border painter ofthisskin. Must be non-null.
-
highlightBorderPainter
protected RadianceBorderPainter highlightBorderPainter
The highlight border painter ofthisskin. Can benull.
-
decorationPainter
protected RadianceDecorationPainter decorationPainter
The decoration painter ofthisskin. Must be non-null.
-
-
Method Detail
-
getBorderPainter
public final RadianceBorderPainter getBorderPainter()
Returns the border painter of this skin.
-
getHighlightBorderPainter
public final RadianceBorderPainter getHighlightBorderPainter()
Returns the highlight border painter of this skin.- Returns:
- The highlight border painter of this skin. The return value of
this method may be
null. In this case, callgetBorderPainter().
-
getButtonShaper
public final RadianceButtonShaper getButtonShaper()
Returns the button shaper of this skin.
-
getFillPainter
public final RadianceFillPainter getFillPainter()
Returns the fill painter of this skin.
-
getHighlightFillPainter
public final RadianceFillPainter getHighlightFillPainter()
Returns the highlight painter of this skin.
-
getDecorationPainter
public final RadianceDecorationPainter getDecorationPainter()
Returns the decoration painter of this skin.
-
getColorScheme
public final RadianceColorScheme getColorScheme(java.awt.Component comp, ComponentState componentState)
Returns the color scheme of the specified component in the specified component state.- Parameters:
comp- Component.componentState- Component state.- Returns:
- The color scheme of the component in the specified component state.
-
getHighlightAlpha
public final float getHighlightAlpha(java.awt.Component comp, ComponentState componentState)Returns the alpha channel of the highlight color scheme of the component.- Parameters:
comp- Component.componentState- Component state.- Returns:
- Highlight color scheme alpha channel.
-
getAlpha
public final float getAlpha(java.awt.Component comp, ComponentState componentState)Returns the alpha channel of the color scheme of the component.- Parameters:
comp- Component.componentState- Component state.- Returns:
- Color scheme alpha channel.
-
registerDecorationAreaSchemeBundle
public void registerDecorationAreaSchemeBundle(RadianceColorSchemeBundle bundle, RadianceColorScheme backgroundColorScheme, RadianceThemingSlices.DecorationAreaType... areaTypes)
Registers the specified color scheme bundle and background color scheme to be used on controls in decoration areas.- Parameters:
bundle- The color scheme bundle to use on controls in decoration areas.backgroundColorScheme- The color scheme to use for background of controls in decoration areas.areaTypes- Enumerates the area types that are affected by the parameters.
-
registerDecorationAreaSchemeBundle
public void registerDecorationAreaSchemeBundle(RadianceColorSchemeBundle bundle, RadianceThemingSlices.DecorationAreaType... areaTypes)
Registers the specified color scheme bundle to be used on controls in decoration areas.- Parameters:
bundle- The color scheme bundle to use on controls in decoration areas.areaTypes- Enumerates the area types that are affected by the parameters.
-
registerAsDecorationArea
public void registerAsDecorationArea(RadianceColorScheme backgroundColorScheme, RadianceThemingSlices.DecorationAreaType... areaTypes)
Registers the specified background color scheme to be used on controls in decoration areas.- Parameters:
backgroundColorScheme- The color scheme to use for background of controls in decoration areas.areaTypes- Enumerates the area types that are affected by the parameters. Each decoration area type will be painted byRadianceDecorationPainter.paintDecorationArea(Graphics2D, Component, RadianceThemingSlices.DecorationAreaType, int, int, RadianceSkin)
-
registerAsDecorationArea
public void registerAsDecorationArea(RadianceColorScheme backgroundColorScheme, RadianceColorSchemeBundle.Overlay noneTransformationOverlay, RadianceThemingSlices.DecorationAreaType... areaTypes)
Registers the specified background color scheme and a color scheme bundle overlay to be used on controls in decoration areas.- Parameters:
backgroundColorScheme- The color scheme to use for background of controls in decoration areas.noneTransformationOverlay- Overlay to be applied to theRadianceColorSchemeBundleregistered on theRadianceThemingSlices.DecorationAreaType.NONE, with the resulting color scheme bundle to be used on #areaTypes.areaTypes- Enumerates the area types that are affected by the parameters. Each decoration area type will be painted byRadianceDecorationPainter.paintDecorationArea(Graphics2D, Component, RadianceThemingSlices.DecorationAreaType, int, int, RadianceSkin)
-
isRegisteredAsDecorationArea
public boolean isRegisteredAsDecorationArea(RadianceThemingSlices.DecorationAreaType decorationType)
Returns indication whether the specified decoration area type should have their background painted byRadianceDecorationPainter.paintDecorationArea(Graphics2D, Component, RadianceThemingSlices.DecorationAreaType, int, int, RadianceSkin)instead of a simple background fill.- Parameters:
decorationType- Decoration area type.- Returns:
trueif specified decoration area type should have their background painted byRadianceDecorationPainter.paintDecorationArea(Graphics2D, Component, RadianceThemingSlices.DecorationAreaType, int, int, RadianceSkin),falseotherwise.
-
getActiveColorScheme
public final RadianceColorScheme getActiveColorScheme(RadianceThemingSlices.DecorationAreaType decorationAreaType)
Returns the main active color scheme for the specific decoration area type. Custom painting code that needs to consult the colors of the specific component should usegetColorScheme(Component, ComponentState)method and variousRadianceColorSchememethods.- Parameters:
decorationAreaType- Decoration area type.- Returns:
- The main active color scheme for this skin.
- See Also:
getColorScheme(Component, ComponentState)
-
getEnabledColorScheme
public final RadianceColorScheme getEnabledColorScheme(RadianceThemingSlices.DecorationAreaType decorationAreaType)
Returns the main enabled color scheme for the specific decoration area type. Custom painting code that needs to consult the colors of the specific component should usegetColorScheme(Component, ComponentState)method and variousRadianceColorSchememethods.- Parameters:
decorationAreaType- Decoration area type.- Returns:
- The main enabled color scheme for this skin.
- See Also:
getColorScheme(Component, ComponentState)
-
getDisabledColorScheme
public final RadianceColorScheme getDisabledColorScheme(RadianceThemingSlices.DecorationAreaType decorationAreaType)
Returns the main disabled color scheme for the specific decoration area type. Custom painting code that needs to consult the colors of the specific component should usegetColorScheme(Component, ComponentState)method and variousRadianceColorSchememethods.- Parameters:
decorationAreaType- Decoration area type.- Returns:
- The main disabled color scheme for this skin.
- See Also:
getColorScheme(Component, ComponentState)
-
addOverlayPainter
public void addOverlayPainter(RadianceOverlayPainter overlayPainter, RadianceThemingSlices.DecorationAreaType... areaTypes)
Adds the specified overlay painter to the end of the list of overlay painters associated with the specified decoration area types.- Parameters:
overlayPainter- Overlay painter to add to the end of the list of overlay painters associated with the specified decoration area types.areaTypes- Decoration area types.
-
removeOverlayPainter
public void removeOverlayPainter(RadianceOverlayPainter overlayPainter, RadianceThemingSlices.DecorationAreaType... areaTypes)
Removes the specified overlay painter from the list of overlay painters associated with the specified decoration area types.- Parameters:
overlayPainter- Overlay painter to remove from the list of overlay painters associated with the specified decoration area types.areaTypes- Decoration area types.
-
clearOverlayPainters
public void clearOverlayPainters(RadianceThemingSlices.DecorationAreaType... areaTypes)
Removes all overlay painters associated with the specified decoration area types.- Parameters:
areaTypes- Decoration area types.
-
getOverlayPainters
public java.util.List<RadianceOverlayPainter> getOverlayPainters(RadianceThemingSlices.DecorationAreaType decorationAreaType)
Returns a non-null, non-modifiable list of overlay painters associated with the specified decoration area type.- Parameters:
decorationAreaType- Decoration area type.- Returns:
- A non-null, non-modifiable list of overlay painters associated with the specified decoration area type.
-
getColorScheme
public final RadianceColorScheme getColorScheme(RadianceThemingSlices.DecorationAreaType decorationAreaType, RadianceThemingSlices.ColorSchemeAssociationKind associationKind, ComponentState componentState)
Returns the color scheme to be used for painting the specified visual area of components in the specified decoration area.- Parameters:
decorationAreaType- Decoration area type.associationKind- Color scheme association kind.componentState- Component state.- Returns:
- Color scheme to be used for painting the specified visual area of components in the specified decoration area.
-
getColorScheme
public final RadianceColorScheme getColorScheme(java.awt.Component comp, RadianceThemingSlices.ColorSchemeAssociationKind associationKind, ComponentState componentState)
Returns the color scheme to be used for painting the specified visual area of the component under the specified component state.- Parameters:
comp- Component.associationKind- Color scheme association kind.componentState- Component state.- Returns:
- Color scheme to be used for painting the specified visual area of the component under the specified component state.
-
getDirectColorScheme
public final RadianceColorScheme getDirectColorScheme(java.awt.Component comp, RadianceThemingSlices.ColorSchemeAssociationKind associationKind, ComponentState componentState)
Returns the color scheme to be used for painting the specified visual area of the component under the specified component state.- Parameters:
comp- Component.associationKind- Color scheme association kind.componentState- Component state.- Returns:
- Color scheme to be used for painting the specified visual area of the component under the specified component state.
-
transform
public RadianceSkin transform(ColorSchemeTransform transform, java.lang.String name)
Creates a new skin that has the same settings as this skin with the addition of applying the specified color scheme transformation on all the relevant color schemes.- Parameters:
transform- Color scheme transformation.name- The name of the new skin.- Returns:
- The new skin.
-
getBackgroundColorScheme
public final RadianceColorScheme getBackgroundColorScheme(RadianceThemingSlices.DecorationAreaType decorationAreaType)
Returns the background color scheme for the specified decoration area type. This method is mainly for the internal use ofRadianceDecorationPainter.paintDecorationArea(Graphics2D, Component, RadianceThemingSlices.DecorationAreaType, int, int, RadianceSkin)but can be used in applications that wish to provide custom overlay background painting.- Parameters:
decorationAreaType- Decoration area type.- Returns:
- The background color scheme for the specified decoration area type.
-
setOverlayColor
public void setOverlayColor(java.awt.Color color, RadianceThemingSlices.ColorOverlayType colorOverlayType, RadianceThemingSlices.DecorationAreaType decorationAreaType, ComponentState... componentStates)
-
getOverlayColor
public java.awt.Color getOverlayColor(RadianceThemingSlices.ColorOverlayType colorOverlayType, RadianceThemingSlices.DecorationAreaType decorationAreaType, ComponentState componentState)
-
setOptionPaneIconColorScheme
public void setOptionPaneIconColorScheme(RadianceColorScheme colorScheme, int... optionPaneMessageTypes)
-
getOptionPaneIconColorScheme
public RadianceColorScheme getOptionPaneIconColorScheme(int optionPaneMessageType)
-
isValid
public boolean isValid()
Checks whether this skin is valid. A valid skin must have a color scheme bundle forRadianceThemingSlices.DecorationAreaType.NONEand non-nullbutton shaper, gradient painter, border painter, highlight painter and decoration painter. If call toRadianceThemingCortex.GlobalScope.setSkin(String)orRadianceThemingCortex.GlobalScope.setSkin(RadianceSkin)does not seem to have any visible effect (returningfalse), call this method to verify that your skin is valid.- Returns:
trueif this skin is valid,falseotherwise.
-
getColorSchemes
public static RadianceSkin.ColorSchemes getColorSchemes(java.io.InputStream inputStream)
Returns the collection of color schemes in the specified input stream.- Parameters:
inputStream- Input stream for the resource containing the description of Radiance color schemes.- Returns:
- The collection of color schemes in the specified input stream.
-
-