public abstract class SubstanceSkin extends java.lang.Object implements SubstanceTrait
Modifier and Type | Class and Description |
---|---|
static class |
SubstanceSkin.ColorSchemes
Contains information on color schemes loaded by the
getColorSchemes(URL) and
getColorSchemes(String) APIs. |
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<DecorationAreaType,SubstanceColorScheme> |
backgroundColorSchemeMap
Maps decoration area type to the background color schemes.
|
protected SubstanceBorderPainter |
borderPainter
The border painter of
this skin. |
protected SubstanceButtonShaper |
buttonShaper
The button shaper of
this skin. |
protected java.util.Map<DecorationAreaType,SubstanceColorSchemeBundle> |
colorSchemeBundleMap
Maps decoration area type to the color scheme bundles.
|
protected java.util.Set<DecorationAreaType> |
decoratedAreaSet
Set of all decoration area types that are not explicitly registered in
colorSchemeBundleMap but still are considered as decoration
areas in this skin. |
protected SubstanceDecorationPainter |
decorationPainter
The decoration painter of
this skin. |
protected SubstanceFillPainter |
fillPainter
The fill painter of
this skin. |
protected SubstanceBorderPainter |
highlightBorderPainter
The highlight border painter of
this skin. |
protected SubstanceHighlightPainter |
highlightPainter
The highlight painter of
this skin. |
protected java.util.Map<DecorationAreaType,java.util.List<SubstanceOverlayPainter>> |
overlayPaintersMap
Maps decoration area type to the registered overlay painters.
|
protected double |
selectedTabFadeEnd
The end of fade effect on the selected tabs in
JTabbedPane s. |
protected double |
selectedTabFadeStart
The start of fade effect on the selected tabs in
JTabbedPane s. |
protected SubstanceWatermark |
watermark
The watermark of
this skin. |
protected SubstanceColorScheme |
watermarkScheme
Color scheme for watermarks.
|
Modifier | Constructor and Description |
---|---|
protected |
SubstanceSkin()
Constructs the basic data structures for a skin.
|
Modifier and Type | Method and Description |
---|---|
void |
addCustomEntriesToTable(javax.swing.UIDefaults table)
Adds skin-specific entries to the UI defaults table.
|
void |
addOverlayPainter(SubstanceOverlayPainter overlayPainter,
DecorationAreaType... areaTypes)
Adds the specified overlay painter to the end of the list of overlay
painters associated with the specified decoration area types.
|
SubstanceColorScheme |
getActiveColorScheme(DecorationAreaType decorationAreaType)
Returns the main active color scheme for the specific decoration area
type.
|
float |
getAlpha(java.awt.Component comp,
ComponentState componentState)
Returns the alpha channel of the color scheme of the component.
|
SubstanceColorScheme |
getBackgroundColorScheme(DecorationAreaType decorationAreaType)
Returns the background color scheme for the specified decoration area
type.
|
SubstanceBorderPainter |
getBorderPainter()
Returns the border painter of this skin.
|
SubstanceButtonShaper |
getButtonShaper()
Returns the button shaper of this skin.
|
SubstanceColorScheme |
getColorScheme(java.awt.Component comp,
ColorSchemeAssociationKind associationKind,
ComponentState componentState)
Returns the color scheme to be used for painting the specified visual
area of the component under the specified component state.
|
SubstanceColorScheme |
getColorScheme(java.awt.Component comp,
ComponentState componentState)
Returns the color scheme of the specified component in the specified
component state.
|
SubstanceColorScheme |
getColorScheme(DecorationAreaType decorationAreaType,
ColorSchemeAssociationKind associationKind,
ComponentState componentState)
Returns the color scheme to be used for painting the specified visual
area of components in the specified decoration area.
|
static SubstanceSkin.ColorSchemes |
getColorSchemes(java.lang.String resourceName)
Returns the collection of color schemes in the specified URL.
|
static SubstanceSkin.ColorSchemes |
getColorSchemes(java.net.URL url)
Returns the collection of color schemes in the specified URL.
|
SubstanceDecorationPainter |
getDecorationPainter()
Returns the decoration painter of this skin.
|
SubstanceColorScheme |
getDisabledColorScheme(DecorationAreaType decorationAreaType)
Returns the main disabled color scheme for the specific decoration area
type.
|
SubstanceColorScheme |
getEnabledColorScheme(DecorationAreaType decorationAreaType)
Returns the main enabled color scheme for the specific decoration area
type.
|
SubstanceFillPainter |
getFillPainter()
Returns the fill painter of this skin.
|
float |
getHighlightAlpha(java.awt.Component comp,
ComponentState componentState)
Returns the alpha channel of the highlight color scheme of the component.
|
SubstanceBorderPainter |
getHighlightBorderPainter()
Returns the highlight border painter of this skin.
|
SubstanceHighlightPainter |
getHighlightPainter()
Returns the highlight painter of this skin.
|
java.util.List<SubstanceOverlayPainter> |
getOverlayPainters(DecorationAreaType decorationAreaType)
Returns a non-null, non-modifiable list of overlay painters associated
with the specified decoration area type.
|
double |
getSelectedTabFadeEnd()
Returns the end of fade effect on the selected tabs in
JTabbedPane s. |
double |
getSelectedTabFadeStart()
Returns the start of fade effect on the selected tabs in
JTabbedPane s. |
SubstanceWatermark |
getWatermark()
Returns the watermark of this skin.
|
SubstanceColorScheme |
getWatermarkColorScheme()
Returns the color scheme to be used for painting the watermark.
|
boolean |
isRegisteredAsDecorationArea(DecorationAreaType decorationType)
Returns indication whether the specified decoration area type should have
their background painted by
SubstanceDecorationPainter.paintDecorationArea(Graphics2D, Component, DecorationAreaType, int, int, SubstanceSkin)
instead of a simple background fill. |
boolean |
isValid()
Checks whether this skin is valid.
|
void |
registerAsDecorationArea(SubstanceColorScheme backgroundColorScheme,
DecorationAreaType... areaTypes)
Registers the specified background color scheme to be used on controls in
decoration areas.
|
void |
registerDecorationAreaSchemeBundle(SubstanceColorSchemeBundle bundle,
DecorationAreaType... areaTypes)
Registers the specified color scheme bundle to be used on controls in
decoration areas.
|
void |
registerDecorationAreaSchemeBundle(SubstanceColorSchemeBundle bundle,
SubstanceColorScheme backgroundColorScheme,
DecorationAreaType... areaTypes)
Registers the specified color scheme bundle and background color scheme
to be used on controls in decoration areas.
|
void |
removeOverlayPainter(SubstanceOverlayPainter overlayPainter,
DecorationAreaType... areaTypes)
Removes the specified overlay painter from the list of overlay painters
associated with the specified decoration area types.
|
void |
setSelectedTabFadeEnd(double selectedTabFadeEnd)
Sets the end of fade effect on the selected tabs in
JTabbedPane s. |
void |
setSelectedTabFadeStart(double selectedTabFadeStart)
Sets the start of fade effect on the selected tabs in
JTabbedPane
s. |
SubstanceSkin |
transform(ColorSchemeTransform transform,
java.lang.String name)
Creates a new skin that has the same settings as this skin with the
addition of applying the specified color scheme transformation on all the
relevant color schemes.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDisplayName
protected java.util.Map<DecorationAreaType,SubstanceColorSchemeBundle> colorSchemeBundleMap
DecorationAreaType.NONE
.protected java.util.Map<DecorationAreaType,SubstanceColorScheme> backgroundColorSchemeMap
protected java.util.Map<DecorationAreaType,java.util.List<SubstanceOverlayPainter>> overlayPaintersMap
protected SubstanceWatermark watermark
this
skin. May be null
if
this
skin doesn't define a custom watermark.protected SubstanceButtonShaper buttonShaper
this
skin. Must be non-
null
.protected SubstanceFillPainter fillPainter
this
skin. Must be non-
null
.protected SubstanceBorderPainter borderPainter
this
skin. Must be non-
null
.protected SubstanceBorderPainter highlightBorderPainter
this
skin. Can be
null
.protected SubstanceHighlightPainter highlightPainter
this
skin. Must be non-
null
.protected SubstanceDecorationPainter decorationPainter
this
skin. Must be non-
null
.protected java.util.Set<DecorationAreaType> decoratedAreaSet
colorSchemeBundleMap
but still are considered as decoration
areas in this skin. Controls lying in such areas will have their
background painted by
SubstanceDecorationPainter.paintDecorationArea(Graphics2D, Component, DecorationAreaType, int, int, SubstanceSkin)
instead of a simple background fill.protected double selectedTabFadeStart
JTabbedPane
s.selectedTabFadeEnd
protected double selectedTabFadeEnd
JTabbedPane
s.selectedTabFadeStart
protected SubstanceColorScheme watermarkScheme
protected SubstanceSkin()
public final SubstanceWatermark getWatermark()
null
.public final SubstanceBorderPainter getBorderPainter()
public final SubstanceBorderPainter getHighlightBorderPainter()
null
. In this case, call
getBorderPainter()
.public final SubstanceButtonShaper getButtonShaper()
public final SubstanceFillPainter getFillPainter()
public final SubstanceHighlightPainter getHighlightPainter()
public final SubstanceDecorationPainter getDecorationPainter()
public void addCustomEntriesToTable(javax.swing.UIDefaults table)
table
- UI defaults table.public final SubstanceColorScheme getColorScheme(java.awt.Component comp, ComponentState componentState)
comp
- Component.componentState
- Component state.public final float getHighlightAlpha(java.awt.Component comp, ComponentState componentState)
comp
- Component.componentState
- Component state.public final float getAlpha(java.awt.Component comp, ComponentState componentState)
comp
- Component.componentState
- Component state.public void registerDecorationAreaSchemeBundle(SubstanceColorSchemeBundle bundle, SubstanceColorScheme backgroundColorScheme, DecorationAreaType... areaTypes)
bundle
- The color scheme bundle to use on controls in decoration
areas.backgroundColorScheme
- The color scheme to use for background of controls in
decoration areas.areaTypes
- Enumerates the area types that are affected by the parameters.public void registerDecorationAreaSchemeBundle(SubstanceColorSchemeBundle bundle, DecorationAreaType... areaTypes)
bundle
- The color scheme bundle to use on controls in decoration
areas.areaTypes
- Enumerates the area types that are affected by the parameters.public void registerAsDecorationArea(SubstanceColorScheme backgroundColorScheme, DecorationAreaType... areaTypes)
backgroundColorScheme
- The color scheme to use for background of controls in
decoration areas.areaTypes
- Enumerates the area types that are affected by the parameters.
Each decoration area type will be painted by
SubstanceDecorationPainter.paintDecorationArea(Graphics2D, Component, DecorationAreaType, int, int, SubstanceSkin)
.public boolean isRegisteredAsDecorationArea(DecorationAreaType decorationType)
SubstanceDecorationPainter.paintDecorationArea(Graphics2D, Component, DecorationAreaType, int, int, SubstanceSkin)
instead of a simple background fill.decorationType
- Decoration area type.true
if specified decoration area type should have
their background painted by
SubstanceDecorationPainter.paintDecorationArea(Graphics2D, Component, DecorationAreaType, int, int, SubstanceSkin)
, false
otherwise.public SubstanceColorScheme getWatermarkColorScheme()
watermarkScheme
is
null
), the main default color scheme of this skin is used.public final SubstanceColorScheme getActiveColorScheme(DecorationAreaType decorationAreaType)
getColorScheme(Component, ComponentState)
method and various
SubstanceColorScheme
methods.decorationAreaType
- Decoration area type.getColorScheme(Component, ComponentState)
public final SubstanceColorScheme getEnabledColorScheme(DecorationAreaType decorationAreaType)
getColorScheme(Component, ComponentState)
method and various
SubstanceColorScheme
methods.decorationAreaType
- Decoration area type.getColorScheme(Component, ComponentState)
public final SubstanceColorScheme getDisabledColorScheme(DecorationAreaType decorationAreaType)
getColorScheme(Component, ComponentState)
method and various
SubstanceColorScheme
methods.decorationAreaType
- Decoration area type.getColorScheme(Component, ComponentState)
public final double getSelectedTabFadeStart()
JTabbedPane
s. This value can be used to create XP-like "headers"
on the selected tabs.JTabbedPane
s.getSelectedTabFadeEnd()
public final double getSelectedTabFadeEnd()
JTabbedPane
s. This value can be used to create XP-like "headers"
on the selected tabs.JTabbedPane
s.getSelectedTabFadeStart()
public void setSelectedTabFadeEnd(double selectedTabFadeEnd)
JTabbedPane
s.
The value should be in 0.0-1.0 range.selectedTabFadeEnd
- The end of fade effect on the selected tabs in
JTabbedPane
s. Should be in 0.0-1.0 range.public void setSelectedTabFadeStart(double selectedTabFadeStart)
JTabbedPane
s. The value should be in 0.0-1.0 range.selectedTabFadeStart
- The start of fade effect on the selected tabs in
JTabbedPane
s. Should be in 0.0-1.0 range.public void addOverlayPainter(SubstanceOverlayPainter overlayPainter, DecorationAreaType... areaTypes)
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.public void removeOverlayPainter(SubstanceOverlayPainter overlayPainter, DecorationAreaType... areaTypes)
overlayPainter
- Overlay painter to remove from the list of overlay painters
associated with the specified decoration area types.areaTypes
- Decoration area types.public java.util.List<SubstanceOverlayPainter> getOverlayPainters(DecorationAreaType decorationAreaType)
decorationAreaType
- Decoration area type.public final SubstanceColorScheme getColorScheme(DecorationAreaType decorationAreaType, ColorSchemeAssociationKind associationKind, ComponentState componentState)
decorationAreaType
- Decoration area type.associationKind
- Color scheme association kind.componentState
- Component state.public final SubstanceColorScheme getColorScheme(java.awt.Component comp, ColorSchemeAssociationKind associationKind, ComponentState componentState)
comp
- Component.associationKind
- Color scheme association kind.componentState
- Component state.public SubstanceSkin transform(ColorSchemeTransform transform, java.lang.String name)
transform
- Color scheme transformation.name
- The name of the new skin.public final SubstanceColorScheme getBackgroundColorScheme(DecorationAreaType decorationAreaType)
SubstanceDecorationPainter.paintDecorationArea(Graphics2D, Component, DecorationAreaType, int, int, SubstanceSkin)
, but can be used in applications that wish to provide custom overlay
background painting (such as watermarks, for example).decorationAreaType
- Decoration area type.public boolean isValid()
DecorationAreaType.NONE
and non-null
button shaper, gradient painter, border painter, highlight painter and
decoration painter. If call to
SubstanceLookAndFeel.setSkin(String)
or
SubstanceLookAndFeel.setSkin(SubstanceSkin)
does not seem to have
any visible effect (returning false
), call this method to
verify that your skin is valid.true
if this skin is valid, false
otherwise.public static SubstanceSkin.ColorSchemes getColorSchemes(java.net.URL url)
url
- URL that points to a resource containing the description of
Substance color schemes.public static SubstanceSkin.ColorSchemes getColorSchemes(java.lang.String resourceName)
resourceName
- Name of the resource containing the description of Substance
color schemes.