Class RadianceThemingCortex.ComponentOrParentChainScope
- java.lang.Object
-
- org.pushingpixels.radiance.theming.api.RadianceThemingCortex.ComponentOrParentChainScope
-
- Enclosing class:
- RadianceThemingCortex
public static final class RadianceThemingCortex.ComponentOrParentChainScope extends java.lang.Object
APIs in this scope apply to individual applicationComponent
s or all nested child components of a container.
-
-
Constructor Summary
Constructors Constructor Description ComponentOrParentChainScope()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RadianceThemingSlices.DecorationAreaType
getDecorationType(java.awt.Component comp)
Returns the decoration area type of the specified component.static void
setColorizationFactor(javax.swing.JComponent comp, double colorizationFactor)
Specifies colorization amount applied to the background and foreground of the current color scheme and the specific control.static void
setDecorationType(javax.swing.JComponent comp, RadianceThemingSlices.DecorationAreaType type)
Sets the decoration type of the specified component and all its children.static void
setExtraWidgetsPresence(javax.swing.JComponent comp, java.lang.Boolean extraWidgetsPresence)
Specifies that extra UI elements (such as menu items in system menu or lock borders) can be shown in the specified component.static void
setFocusKind(javax.swing.JComponent comp, RadianceThemingSlices.FocusKind focusKind)
Specifies the kind of focus indication to be used on the specified component and its nested children.static void
setSelectTextOnFocus(javax.swing.JComponent comp, java.lang.Boolean selectTextOnFocus)
Specifies whether the contents of the specified text component or its nested children should be selected on focus gain.static void
setToolbarButtonCornerRadius(javax.swing.JToolBar toolbar, float toolbarButtonCornerRadius)
Specifies corner radius for all buttons in the specified toolbar.
-
-
-
Method Detail
-
setSelectTextOnFocus
public static void setSelectTextOnFocus(javax.swing.JComponent comp, java.lang.Boolean selectTextOnFocus)
Specifies whether the contents of the specified text component or its nested children should be selected on focus gain.- Parameters:
comp
- Component.selectTextOnFocus
- Iftrue
, the contents of the specified text component or its nested children will be selected on focus gain. Passnull
to reset to the default behavior.- See Also:
RadianceThemingCortex.GlobalScope.setSelectTextOnFocus(Boolean)
-
setToolbarButtonCornerRadius
public static void setToolbarButtonCornerRadius(javax.swing.JToolBar toolbar, float toolbarButtonCornerRadius)
Specifies corner radius for all buttons in the specified toolbar.- Parameters:
toolbar
- Toolbar.toolbarButtonCornerRadius
- Corner radius for all buttons in the toolbar.- See Also:
RadianceThemingCortex.ComponentScope.setToolbarButtonCornerRadius(AbstractButton, float)
,RadianceThemingCortex.GlobalScope.setToolbarButtonCornerRadius(float)
-
setExtraWidgetsPresence
public static void setExtraWidgetsPresence(javax.swing.JComponent comp, java.lang.Boolean extraWidgetsPresence)
Specifies that extra UI elements (such as menu items in system menu or lock borders) can be shown in the specified component.- Parameters:
comp
- Component.extraWidgetsPresence
- Iftrue
, extra UI elements (such as menu items in system menu or lock borders) can be shown in the component. Passnull
to reset to the default behavior.- See Also:
RadianceThemingCortex.GlobalScope.setExtraWidgetsPresence(Boolean)
-
setColorizationFactor
public static void setColorizationFactor(javax.swing.JComponent comp, double colorizationFactor)
Specifies colorization amount applied to the background and foreground of the current color scheme and the specific control. By default, when the application does not use any custom colors, all the controls are painted with the colors of the current color scheme / skin. The colors coming from the look-and-feel implement the marker
UIResource
interface which allows the UI delegates to differentiate between application-specific colors which are not changed, and the LAF-provide colors that are changed on LAF switch.Calling this method installs the "smart colorization" mode which uses the colors of the current color scheme and the custom background / foreground colors (when installed by application) to colorize the relevant portions of the control. For example, on checkbox the custom background color will be used to colorize the check box itself, while the custom foreground color will be applied to the check box text and the check mark.
Value of 0.0 of colorization amount results in Radiance completely ignoring the custom application background and foreground colors set on the components - no colorization. Values closer to 1.0 result in almost full usage of the custom application background and foreground colors set on the components. Note that in order to maintain the gradients (fill, border, etc), even value of 1.0 does not result in full custom color being applied to the relevant visuals of the control.
Calling this method applies colorization amount to the component / container itself and all its children that do not call this method.
The default colorization amount (when this method is not called at all) is 0.5. This means that applications that install custom background / foreground colors on their UI controls will see them colorized with 50% "strength", even without calling this method.
- Parameters:
comp
- Component.colorizationFactor
- Colorization factor to apply to the component and its nested children.- See Also:
RadianceThemingCortex.GlobalScope.setColorizationFactor(double)
-
setFocusKind
public static void setFocusKind(javax.swing.JComponent comp, RadianceThemingSlices.FocusKind focusKind)
Specifies the kind of focus indication to be used on the specified component and its nested children.- Parameters:
focusKind
- Kind of focus indication to be used on the component and its nested children.comp
- Component.- See Also:
RadianceThemingCortex.GlobalScope.setFocusKind(RadianceThemingSlices.FocusKind)
-
setDecorationType
public static void setDecorationType(javax.swing.JComponent comp, RadianceThemingSlices.DecorationAreaType type)
Sets the decoration type of the specified component and all its children.- Parameters:
comp
- Component.type
- Decoration type of the component and all its children.- See Also:
getDecorationType(Component)
,RadianceThemingCortex.ComponentScope.getImmediateDecorationType(Component)
-
getDecorationType
public static RadianceThemingSlices.DecorationAreaType getDecorationType(java.awt.Component comp)
Returns the decoration area type of the specified component. The component and its ancestor hierarchy are scanned for the registered decoration area type. IfsetDecorationType(JComponent, RadianceThemingSlices.DecorationAreaType)
has been called on the specified component, the matching decoration type is returned. Otherwise, the component hierarchy is scanned to find the closest ancestor that was passed tosetDecorationType(JComponent, RadianceThemingSlices.DecorationAreaType)
- and its decoration type is returned. If neither the component, nor any one of its parent components has been passed to the setter method,RadianceThemingSlices.DecorationAreaType.NONE
is returned.- Parameters:
comp
- Component.- Returns:
- Decoration area type of the component.
- See Also:
setDecorationType(JComponent, RadianceThemingSlices.DecorationAreaType)
,RadianceThemingCortex.ComponentScope.getImmediateDecorationType(Component)
-
-