Class CommandButtonFollowColorTokensIcon
- java.lang.Object
-
- org.pushingpixels.radiance.component.api.common.icon.CommandButtonFollowColorTokensIcon
-
- All Implemented Interfaces:
javax.swing.Icon,RadianceIcon
public class CommandButtonFollowColorTokensIcon extends java.lang.Object implements RadianceIcon
Implementation ofRadianceIconfor command buttons that wish to have their icon be dynamically rendered at runtime based on the color tokens that match the current transition-aware state.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceCommandButtonFollowColorTokensIcon.DelegateThe delegate needs to implement the method in this interface based on the provided color tokens.-
Nested classes/interfaces inherited from interface org.pushingpixels.radiance.common.api.icon.RadianceIcon
RadianceIcon.ColorFilter, RadianceIcon.Factory
-
-
Field Summary
Fields Modifier and Type Field Description private RadianceThemingSlices.ContainerColorTokensAssociationKindcolorTokensAssociationKindprivate CommandButtonFollowColorTokensIcon.Delegatedelegateprivate intheightThe height of the rendered image.private BladeContainerColorTokensmutableTokensprivate intwidthThe width of the rendered image.
-
Constructor Summary
Constructors Constructor Description CommandButtonFollowColorTokensIcon(CommandButtonFollowColorTokensIcon.Delegate delegate, java.awt.Dimension initialDim)CommandButtonFollowColorTokensIcon(RadianceThemingSlices.ContainerColorTokensAssociationKind colorTokensAssociationKind, CommandButtonFollowColorTokensIcon.Delegate delegate, java.awt.Dimension initialDim)Creates a new icon.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetIconHeight()intgetIconWidth()voidpaintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)voidsetColorFilter(RadianceIcon.ColorFilter colorFilter)voidsetDimension(java.awt.Dimension newDimension)Changes the dimension ofthisicon.booleansupportsColorFilter()-
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.common.api.icon.RadianceIcon
toImage
-
-
-
-
Field Detail
-
width
private int width
The width of the rendered image.
-
height
private int height
The height of the rendered image.
-
colorTokensAssociationKind
private RadianceThemingSlices.ContainerColorTokensAssociationKind colorTokensAssociationKind
-
delegate
private CommandButtonFollowColorTokensIcon.Delegate delegate
-
mutableTokens
private BladeContainerColorTokens mutableTokens
-
-
Constructor Detail
-
CommandButtonFollowColorTokensIcon
public CommandButtonFollowColorTokensIcon(CommandButtonFollowColorTokensIcon.Delegate delegate, java.awt.Dimension initialDim)
-
CommandButtonFollowColorTokensIcon
public CommandButtonFollowColorTokensIcon(RadianceThemingSlices.ContainerColorTokensAssociationKind colorTokensAssociationKind, CommandButtonFollowColorTokensIcon.Delegate delegate, java.awt.Dimension initialDim)
Creates a new icon.- Parameters:
colorTokensAssociationKind- Color tokens association kind to use for determining the color tokens for this icon.delegate- Delegate to compute the actual icons.initialDim- Initial icon dimension.
-
-
Method Detail
-
paintIcon
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)- Specified by:
paintIconin interfacejavax.swing.Icon
-
setDimension
public void setDimension(java.awt.Dimension newDimension)
Description copied from interface:RadianceIconChanges the dimension ofthisicon.- Specified by:
setDimensionin interfaceRadianceIcon- Parameters:
newDimension- New dimension forthisicon.
-
supportsColorFilter
public boolean supportsColorFilter()
- Specified by:
supportsColorFilterin interfaceRadianceIcon
-
setColorFilter
public void setColorFilter(RadianceIcon.ColorFilter colorFilter)
- Specified by:
setColorFilterin interfaceRadianceIcon
-
getIconHeight
public int getIconHeight()
- Specified by:
getIconHeightin interfacejavax.swing.Icon
-
getIconWidth
public int getIconWidth()
- Specified by:
getIconWidthin interfacejavax.swing.Icon
-
-