public static final class SubstanceCortex.ComponentOrParentChainScope
extends java.lang.Object
Components or all nested child
components of a container.| Constructor | Description |
|---|---|
ComponentOrParentChainScope() |
| Modifier and Type | Method | Description |
|---|---|---|
static SubstanceSlices.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,
SubstanceSlices.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)
should be shown in the specified component.
|
static void |
setFocusKind(javax.swing.JComponent comp,
SubstanceSlices.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.
|
static void |
setWatermarkVisible(javax.swing.JComponent comp,
java.lang.Boolean watermarkVisible) |
Specifies that watermark should be painted on the component and its nested children.
|
public static void setSelectTextOnFocus(javax.swing.JComponent comp,
java.lang.Boolean selectTextOnFocus)
comp - Component.selectTextOnFocus - If true, the contents of the specified text
component or its
nested children will be selected on focus gain. Pass
null to
reset to the default behavior.SubstanceCortex.GlobalScope.setSelectTextOnFocus(Boolean)public static void setWatermarkVisible(javax.swing.JComponent comp,
java.lang.Boolean watermarkVisible)
true on the component
itself or one of its ancestors, or
SubstanceCortex.GlobalScope.setWatermarkVisible(Boolean) is called with
true.comp - Component.watermarkVisible - If true, watermark will be painted on the
component and its
nested children. Pass null to reset to the
default behavior.SubstanceCortex.GlobalScope.setWatermarkVisible(Boolean)public static void setToolbarButtonCornerRadius(javax.swing.JToolBar toolbar,
float toolbarButtonCornerRadius)
toolbar - Toolbar.toolbarButtonCornerRadius - Corner radius for all buttons in the toolbar.SubstanceCortex.ComponentScope.setToolbarButtonCornerRadius(AbstractButton, float),
SubstanceCortex.GlobalScope.setToolbarButtonCornerRadius(float)public static void setExtraWidgetsPresence(javax.swing.JComponent comp,
java.lang.Boolean extraWidgetsPresence)
comp - Component.extraWidgetsPresence - If true, extra UI elements (such as menu
items in system menu or lock borders) will be shown in the
component. Pass null to reset to the default
behavior.SubstanceCortex.GlobalScope.setExtraWidgetsPresence(Boolean)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 Substance 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.
comp - Component.colorizationFactor - Colorization factor to apply to the component and its nested
children.SubstanceCortex.GlobalScope.setColorizationFactor(double)public static void setFocusKind(javax.swing.JComponent comp,
SubstanceSlices.FocusKind focusKind)
focusKind - Kind of focus indication to be used on the component and its nested
children.comp - Component.SubstanceCortex.GlobalScope.setFocusKind(SubstanceSlices.FocusKind)public static void setDecorationType(javax.swing.JComponent comp,
SubstanceSlices.DecorationAreaType type)
comp - Component.type - Decoration type of the component and all its children.getDecorationType(Component),
SubstanceCortex.ComponentScope.getImmediateDecorationType(Component)public static SubstanceSlices.DecorationAreaType getDecorationType(java.awt.Component comp)
setDecorationType(JComponent, SubstanceSlices.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 to
setDecorationType(JComponent, SubstanceSlices.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, SubstanceSlices.DecorationAreaType.NONE is returned.comp - Component.setDecorationType(JComponent, SubstanceSlices.DecorationAreaType),
SubstanceCortex.ComponentScope.getImmediateDecorationType(Component)