Class ContainerColorTokensBundle
java.lang.Object
org.pushingpixels.radiance.theming.api.ContainerColorTokensBundle
Color tokens bundle. Defines the visual appearance of a single decoration area of a skin.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ContainerColorTokensprivate final Map<RadianceThemingSlices.ContainerColorTokensAssociationKind, Map<ComponentState, ContainerColorTokens>> Maps from color tokens association kinds to the map of color tokens.private final ContainerColorTokensprivate final ContainerColorTokensprivate final ContainerColorTokensprivate final ContainerColorTokensprivate final ContainerColorTokensprivate final ContainerColorTokensprivate final ContainerColorTokensprivate final ContainerColorTokensprivate final ContainerColorTokensprivate final ContainerColorTokens -
Constructor Summary
ConstructorsConstructorDescriptionContainerColorTokensBundle(ContainerColorTokens activeContainerTokens, ContainerColorTokens mutedContainerTokens, ContainerColorTokens neutralContainerTokens, boolean isSystemDark) Creates a new color tokens bundle. -
Method Summary
Modifier and TypeMethodDescriptionReturns active container tokens.getActiveContainerTokens(ComponentState componentState) Returns active container tokens for the specified component state.getActiveContainerTokens(RadianceThemingSlices.ContainerColorTokensAssociationKind associationKind, ComponentState componentState) Returns active container tokens for the specified visual area of a component in a specified component state.private ContainerColorTokensgetActiveContainerTokensForState(ComponentState componentState) getInverseSystemContainerTokens(RadianceThemingSlices.SystemContainerType systemContainerType) Returns inverse system container tokens.Returns muted container tokens.Returns muted container tokens for the specified visual area of a component.Returns neutral container tokens.getNeutralContainerTokens(RadianceThemingSlices.ContainerColorTokensAssociationKind associationKind) Returns neutral container tokens for the specified visual area of a component.getSystemContainerTokens(RadianceThemingSlices.SystemContainerType systemContainerType) Returns system container tokens.voidregisterActiveContainerTokens(ContainerColorTokens stateContainerTokens, ComponentState... activeStates) Registers container color tokens for the specific active component states.voidregisterActiveContainerTokens(ContainerColorTokens colorTokens, RadianceThemingSlices.ContainerColorTokensAssociationKind associationKind, ComponentState... activeStates) Registers the container color tokens to be used for controls in specified active states.voidregisterMutedContainerTokens(ContainerColorTokens colorTokens, RadianceThemingSlices.ContainerColorTokensAssociationKind associationKind) Registers muted container color tokens for the specified visual area of a component.voidregisterNeutralContainerTokens(ContainerColorTokens colorTokens, RadianceThemingSlices.ContainerColorTokensAssociationKind associationKind) Registers neutral container color tokens for the specified visual area of a component.
-
Field Details
-
activeContainerTokens
-
mutedContainerTokens
-
neutralContainerTokens
-
systemInfoContainerTokens
-
inverseSystemInfoContainerTokens
-
systemWarningContainerTokens
-
inverseSystemWarningContainerTokens
-
systemErrorContainerTokens
-
inverseSystemErrorContainerTokens
-
systemSuccessContainerTokens
-
inverseSystemSuccessContainerTokens
-
activeTokenOverrides
private final Map<RadianceThemingSlices.ContainerColorTokensAssociationKind, Map<ComponentState, ContainerColorTokens>> activeTokenOverridesMaps from color tokens association kinds to the map of color tokens. Controls in the specific decoration area can use different colors for different active states, for example yellow for rollover and deep orange for pressed. In this case, this map will have an entry withRadianceThemingSlices.ContainerColorTokensAssociationKind.DEFAULTkey and a value map with two entries:- A map entry with key
ComponentState.ROLLOVER_UNSELECTEDand value that points to the yellow color tokens. - A map entry with key
ComponentState.PRESSED_UNSELECTEDand value that points to the deep orange color tokens.
- A map entry with key
-
mutedTokenOverrides
private final Map<RadianceThemingSlices.ContainerColorTokensAssociationKind, ContainerColorTokens> mutedTokenOverrides -
neutralTokenOverrides
private final Map<RadianceThemingSlices.ContainerColorTokensAssociationKind, ContainerColorTokens> neutralTokenOverrides
-
-
Constructor Details
-
ContainerColorTokensBundle
public ContainerColorTokensBundle(ContainerColorTokens activeContainerTokens, ContainerColorTokens mutedContainerTokens, ContainerColorTokens neutralContainerTokens, boolean isSystemDark) Creates a new color tokens bundle.- Parameters:
activeContainerTokens- Active color tokens of this bundle.mutedContainerTokens- Muted color tokens of this bundle.neutralContainerTokens- Neutral color tokens of this bundle.isSystemDark-trueif the system tokens should be created in dark mode.
-
-
Method Details
-
registerActiveContainerTokens
public void registerActiveContainerTokens(ContainerColorTokens stateContainerTokens, ComponentState... activeStates) Registers container color tokens for the specific active component states.- Parameters:
stateContainerTokens- Container color tokens for the specified active component states.activeStates- Component states.- See Also:
-
registerActiveContainerTokens
public void registerActiveContainerTokens(ContainerColorTokens colorTokens, RadianceThemingSlices.ContainerColorTokensAssociationKind associationKind, ComponentState... activeStates) Registers the container color tokens to be used for controls in specified active states. For example, if light orange color tokens are to be used for rollover selected and rollover controls in highlights, the parameters would be:stateContainerTokens=light orange color tokensassociationKind=RadianceThemingSlices.ContainerColorTokensAssociationKind.HIGHLIGHTstates=ComponentState.ROLLOVER_SELECTED,ComponentState.ROLLOVER_UNSELECTED
- Parameters:
colorTokens- Container color tokens for the specified active component states.associationKind- Color tokens association kind that specifies the visual areas of controls to be painted with this color tokens.activeStates- Component states that further restrict the usage of the specified color tokens.- See Also:
-
registerMutedContainerTokens
public void registerMutedContainerTokens(ContainerColorTokens colorTokens, RadianceThemingSlices.ContainerColorTokensAssociationKind associationKind) Registers muted container color tokens for the specified visual area of a component.- Parameters:
colorTokens- Muted container color tokens for the specified visual area.associationKind- Color tokens association kind.- See Also:
-
registerNeutralContainerTokens
public void registerNeutralContainerTokens(ContainerColorTokens colorTokens, RadianceThemingSlices.ContainerColorTokensAssociationKind associationKind) Registers neutral container color tokens for the specified visual area of a component.- Parameters:
colorTokens- Neutral container color tokens for the specified visual area.associationKind- Color tokens association kind.- See Also:
-
getActiveContainerTokens
Returns active container tokens for the specified component state.- Parameters:
componentState- Component state.- Returns:
- Active container tokens for the component state.
- See Also:
-
getSystemContainerTokens
public ContainerColorTokens getSystemContainerTokens(RadianceThemingSlices.SystemContainerType systemContainerType) Returns system container tokens.- Parameters:
systemContainerType- System container type.- Returns:
- System container tokens.
- See Also:
-
getInverseSystemContainerTokens
public ContainerColorTokens getInverseSystemContainerTokens(RadianceThemingSlices.SystemContainerType systemContainerType) Returns inverse system container tokens.- Parameters:
systemContainerType- System container type.- Returns:
- Inverse system container tokens.
- See Also:
-
getActiveContainerTokens
Returns active container tokens.- Returns:
- Active container tokens.
- See Also:
-
getNeutralContainerTokens
Returns neutral container tokens.- Returns:
- Neutral container tokens.
- See Also:
-
getMutedContainerTokens
Returns muted container tokens.- Returns:
- Muted container tokens.
- See Also:
-
getActiveContainerTokensForState
-
getActiveContainerTokens
public ContainerColorTokens getActiveContainerTokens(RadianceThemingSlices.ContainerColorTokensAssociationKind associationKind, ComponentState componentState) Returns active container tokens for the specified visual area of a component in a specified component state.- Parameters:
associationKind- Color tokens association kind.componentState- Component state.- Returns:
- Active container tokens.
- See Also:
-
getMutedContainerTokens
public ContainerColorTokens getMutedContainerTokens(RadianceThemingSlices.ContainerColorTokensAssociationKind associationKind) Returns muted container tokens for the specified visual area of a component.- Parameters:
associationKind- Color tokens association kind.- Returns:
- Muted container tokens.
- See Also:
-
getNeutralContainerTokens
public ContainerColorTokens getNeutralContainerTokens(RadianceThemingSlices.ContainerColorTokensAssociationKind associationKind) Returns neutral container tokens for the specified visual area of a component.- Parameters:
associationKind- Color tokens association kind.- Returns:
- Neutral container tokens.
- See Also:
-