Class RadianceSkin
java.lang.Object
org.pushingpixels.radiance.theming.api.RadianceSkin
- All Implemented Interfaces:
RadianceTrait
- Direct Known Subclasses:
AutumnSkin, CeruleanSkin, FieldOfWheatSkin, GeminiSkin, GreenMagicSkin, HarvestSkin, MagellanSkin, MagmaSkin, MarinerSkin, ModerateSkin, NightShadeSkin, OfficeBlack2007Skin, OfficeBlue2007Skin, OfficeSilver2007Skin, RadianceSkin.Accented, RavenSkin, SaharaSkin, SentinelSkin, StreetlightsSkin, TwilightSkin
Base abstract class for Radiance skins.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBase class for skins that can be configured with accent color tokens. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected RadianceButtonShaperThe button shaper ofthisskin.private final Map<RadianceThemingSlices.DecorationAreaType, ContainerColorTokensBundle> Maps decoration area type to the color token bundles.private final Set<RadianceThemingSlices.DecorationAreaType> Set of all decoration area types that are not explicitly registered incolorTokensBundleMapbut still are considered as decoration areas in this skin.protected RadianceDecorationPainterThe decoration painter ofthisskin.protected RadianceOutlinePainterThe highlight outline painter ofthisskin.protected RadianceSurfacePainterThe highlight surface painter ofthisskin.private final Map<RadianceThemingSlices.DecorationAreaType, ContainerColorTokens> Maps decoration area type to the neutral color tokens overrides.protected RadianceOutlinePainterThe outline painter ofthisskin.private final Map<RadianceThemingSlices.DecorationAreaType, List<RadianceOverlayPainter>> Maps decoration area type to the registered overlay painters.protected RadianceSurfacePainterThe surface painter ofthisskin. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructs the basic data structures for a skin. -
Method Summary
Modifier and TypeMethodDescription(package private) voidAdds skin-specific entries to the UI defaults table.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.final ContainerColorTokensReturns active container tokens for the specified component.final ContainerColorTokensgetActiveContainerTokens(Component comp, ComponentState componentState) Returns active container tokens for the specified component in the specific state.final ContainerColorTokensgetActiveContainerTokens(Component comp, RadianceThemingSlices.ContainerColorTokensAssociationKind associationKind, ComponentState componentState) Returns active container tokens for the specified visual area of a component in the specific state.final ContainerColorTokensgetActiveContainerTokens(RadianceThemingSlices.DecorationAreaType decorationAreaType) Returns active container tokens for the specified decoration area type.final RadianceButtonShaperReturns the button shaper of this skin.Returns the decoration painter of this skin.final RadianceOutlinePainterReturns the highlight outline painter of this skin.final RadianceSurfacePainterReturns the highlight painter of this skin.final ContainerColorTokensgetInverseSystemContainerTokens(Component comp, RadianceThemingSlices.SystemContainerType systemContainerType) Returns inverse system container tokens for the specified component.final ContainerColorTokensReturns muted container tokens for the specified component.final ContainerColorTokensgetMutedContainerTokens(Component comp, RadianceThemingSlices.ContainerColorTokensAssociationKind associationKind) Returns muted container tokens for the specified visual area of a component.final ContainerColorTokensgetMutedContainerTokens(RadianceThemingSlices.DecorationAreaType decorationAreaType) Returns muted container tokens for the specified decoration area type.final ContainerColorTokensReturns neutral container tokens for the specified component.final ContainerColorTokensgetNeutralContainerTokens(Component comp, RadianceThemingSlices.ContainerColorTokensAssociationKind associationKind) Returns neutral container tokens for the specified visual area of a component.final ContainerColorTokensgetNeutralContainerTokens(RadianceThemingSlices.DecorationAreaType decorationAreaType) Returns neutral container tokens for the specified decoration area type.final RadianceOutlinePainterReturns the outline painter of this skin.getOverlayPainters(RadianceThemingSlices.DecorationAreaType decorationAreaType) Returns a non-null, non-modifiable list of overlay painters associated with the specified decoration area type.final RadianceSurfacePainterReturns the surface painter of this skin.final ContainerColorTokensgetSystemContainerTokens(Component comp, RadianceThemingSlices.SystemContainerType systemContainerType) Returns system container tokens for the specified component.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(ContainerColorTokens neutralContainerTokens, RadianceThemingSlices.DecorationAreaType... areaTypes) Registers the specified neutral color tokens to be used on controls in decoration areas.voidregisterDecorationAreaTokensBundle(ContainerColorTokensBundle bundle, RadianceThemingSlices.DecorationAreaType... areaTypes) Registers the specified color tokens 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.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface RadianceTrait
getDisplayName
-
Field Details
-
colorTokensBundleMap
private final Map<RadianceThemingSlices.DecorationAreaType, ContainerColorTokensBundle> colorTokensBundleMapMaps decoration area type to the color token bundles. Must contain an entry forRadianceThemingSlices.DecorationAreaType.NONE. -
neutralColorTokensOverrideMap
private final Map<RadianceThemingSlices.DecorationAreaType, ContainerColorTokens> neutralColorTokensOverrideMapMaps decoration area type to the neutral color tokens overrides. -
overlayPaintersMap
private final Map<RadianceThemingSlices.DecorationAreaType, List<RadianceOverlayPainter>> overlayPaintersMapMaps decoration area type to the registered overlay painters. Each decoration area type can have more than one overlay painter. -
buttonShaper
The button shaper ofthisskin. Must be non-null. -
surfacePainter
The surface painter ofthisskin. Must be non-null. -
highlightSurfacePainter
The highlight surface painter ofthisskin. Must be non-null. -
outlinePainter
The outline painter ofthisskin. Must be non-null. -
highlightOutlinePainter
The highlight outline painter ofthisskin. Can benull. -
decorationPainter
The decoration painter ofthisskin. Must be non-null. -
decoratedAreaSet
Set of all decoration area types that are not explicitly registered incolorTokensBundleMapbut still are considered as decoration areas in this skin. Controls in such areas will have their background painted byRadianceDecorationPainter.paintDecorationArea(Graphics2D, Component, RadianceThemingSlices.DecorationAreaType, int, int, RadianceSkin)instead of a simple background fill.
-
-
Constructor Details
-
RadianceSkin
protected RadianceSkin()Constructs the basic data structures for a skin.
-
-
Method Details
-
getOutlinePainter
Returns the outline painter of this skin.- Returns:
- The outline painter of this skin. A valid skin cannot have a
nullvalue returned from this method. CallisValid()to verify that the skin is valid. - See Also:
-
getHighlightOutlinePainter
Returns the highlight outline painter of this skin.- Returns:
- The highlight outline painter of this skin. The return value of
this method may be
null. In this case, callgetOutlinePainter().
-
getButtonShaper
Returns the button shaper of this skin.- Returns:
- The button shaper of this skin. A valid skin cannot have a
nullvalue returned from this method. CallisValid()to verify that the skin is valid. - See Also:
-
getSurfacePainter
Returns the surface painter of this skin.- Returns:
- The surface painter of this skin. A valid skin cannot have a
nullvalue returned from this method. CallisValid()to verify that the skin is valid. - See Also:
-
getHighlightSurfacePainter
Returns the highlight painter of this skin.- Returns:
- The highlight painter of this skin. A valid skin cannot have a
nullvalue returned from this method. CallisValid()to verify that the skin is valid. - See Also:
-
getDecorationPainter
Returns the decoration painter of this skin.- Returns:
- The decoration painter of this skin. A valid skin cannot have a
nullvalue returned from this method. CallisValid()to verify that the skin is valid. - See Also:
-
addCustomEntriesToTable
Adds skin-specific entries to the UI defaults table.- Parameters:
table- UI defaults table.
-
getNeutralContainerTokens
Returns neutral container tokens for the specified component.- Parameters:
comp- Component.- Returns:
- Neutral container tokens for the component.
- See Also:
-
getMutedContainerTokens
Returns muted container tokens for the specified component.- Parameters:
comp- Component.- Returns:
- Muted container tokens for the component.
- See Also:
-
getActiveContainerTokens
Returns active container tokens for the specified component.- Parameters:
comp- Component.- Returns:
- Active container tokens for the component.
- See Also:
-
getActiveContainerTokens
public final ContainerColorTokens getActiveContainerTokens(Component comp, ComponentState componentState) Returns active container tokens for the specified component in the specific state.- Parameters:
comp- Component.componentState- Component state.- Returns:
- Active container tokens for the component.
- See Also:
-
getSystemContainerTokens
public final ContainerColorTokens getSystemContainerTokens(Component comp, RadianceThemingSlices.SystemContainerType systemContainerType) Returns system container tokens for the specified component.- Parameters:
comp- Component.systemContainerType- System container type.- Returns:
- System container tokens for the component.
- See Also:
-
getInverseSystemContainerTokens
public final ContainerColorTokens getInverseSystemContainerTokens(Component comp, RadianceThemingSlices.SystemContainerType systemContainerType) Returns inverse system container tokens for the specified component.- Parameters:
comp- Component.systemContainerType- System container type.- Returns:
- Inverse system container tokens for the component.
- See Also:
-
registerDecorationAreaTokensBundle
public void registerDecorationAreaTokensBundle(ContainerColorTokensBundle bundle, RadianceThemingSlices.DecorationAreaType... areaTypes) Registers the specified color tokens bundle to be used on controls in decoration areas.- Parameters:
bundle- The color tokens bundle to use on controls in decoration areas.areaTypes- Enumerates the area types that are affected by the parameters.
-
registerAsDecorationArea
public void registerAsDecorationArea(ContainerColorTokens neutralContainerTokens, RadianceThemingSlices.DecorationAreaType... areaTypes) Registers the specified neutral color tokens to be used on controls in decoration areas.- Parameters:
neutralContainerTokens- The neutral tokens to use in specified 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)
-
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.
-
getNeutralContainerTokens
public final ContainerColorTokens getNeutralContainerTokens(RadianceThemingSlices.DecorationAreaType decorationAreaType) Returns neutral container tokens for the specified decoration area type.- Parameters:
decorationAreaType- Decoration area type.- Returns:
- Neutral container tokens for the decoration area type.
- See Also:
-
getMutedContainerTokens
public final ContainerColorTokens getMutedContainerTokens(RadianceThemingSlices.DecorationAreaType decorationAreaType) Returns muted container tokens for the specified decoration area type.- Parameters:
decorationAreaType- Decoration area type.- Returns:
- Muted container tokens for the decoration area type.
- See Also:
-
getActiveContainerTokens
public final ContainerColorTokens getActiveContainerTokens(RadianceThemingSlices.DecorationAreaType decorationAreaType) Returns active container tokens for the specified decoration area type.- Parameters:
decorationAreaType- Decoration area type.- Returns:
- Active container tokens for the decoration area type.
- See Also:
-
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
Removes all overlay painters associated with the specified decoration area types.- Parameters:
areaTypes- Decoration area types.
-
getOverlayPainters
public 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.
-
getActiveContainerTokens
public final ContainerColorTokens getActiveContainerTokens(Component comp, RadianceThemingSlices.ContainerColorTokensAssociationKind associationKind, ComponentState componentState) Returns active container tokens for the specified visual area of a component in the specific state.- Parameters:
comp- Component.associationKind- Color tokens association kind.componentState- Component state.- Returns:
- Active container tokens for the component.
- See Also:
-
getMutedContainerTokens
public final ContainerColorTokens getMutedContainerTokens(Component comp, RadianceThemingSlices.ContainerColorTokensAssociationKind associationKind) Returns muted container tokens for the specified visual area of a component.- Parameters:
comp- Component.associationKind- Color tokens association kind.- Returns:
- Muted container tokens for the component.
- See Also:
-
getNeutralContainerTokens
public final ContainerColorTokens getNeutralContainerTokens(Component comp, RadianceThemingSlices.ContainerColorTokensAssociationKind associationKind) Returns neutral container tokens for the specified visual area of a component.- Parameters:
comp- Component.associationKind- Color tokens association kind.- Returns:
- Neutral container tokens for the component.
- See Also:
-
isValid
public boolean isValid()Checks whether this skin is valid. A skins is considered valid if it has a color tokens bundle forRadianceThemingSlices.DecorationAreaType.NONE, as well as non-nullbutton shaper, surface painter, outline painter, highlight surface 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.
-