|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jvnet.substance.api.SubstanceSkin
public abstract class SubstanceSkin
Base abstract class for Substance skins.
Nested Class Summary | |
---|---|
static class |
SubstanceSkin.ColorSchemes
Contains information on color schemes loaded by the getColorSchemes(URL) API. |
Field Summary | |
---|---|
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 SubstanceGradientPainter |
gradientPainter
The gradient 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. |
Constructor Summary | |
---|---|
protected |
SubstanceSkin()
Constructs the basic data structures for a skin. |
Method Summary | |
---|---|
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. |
protected java.lang.Object |
clone()
|
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. |
SubstanceColorScheme |
getBorderColorScheme(java.awt.Component comp,
ComponentState componentState)
Deprecated. Use getColorScheme(Component, ColorSchemeAssociationKind, ComponentState)
with ColorSchemeAssociationKind.BORDER instead. This
method will be removed in version 6.0. |
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.net.URL url)
Returns the collection of color schemes in the specified URL. |
SubstanceDecorationPainter |
getDecorationPainter()
Returns the decoration painter of this skin. |
SubstanceGradientPainter |
getGradientPainter()
Returns the gradient 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. |
SubstanceColorScheme |
getHighlightColorScheme(java.awt.Component comp,
ComponentState componentState)
Deprecated. Use getColorScheme(Component, ColorSchemeAssociationKind, ComponentState)
with ColorSchemeAssociationKind.HIGHLIGHT instead.
This method will be removed in version 6.0. |
SubstanceHighlightPainter |
getHighlightPainter()
Returns the highlight painter of this skin. |
SubstanceColorScheme |
getMainActiveColorScheme()
Returns the main active color scheme for this skin. |
SubstanceColorScheme |
getMainActiveColorScheme(DecorationAreaType decorationAreaType)
Returns the main active color scheme for the specific decoration area type. |
SubstanceColorScheme |
getMainDefaultColorScheme()
Returns the main default color scheme for this skin. |
SubstanceColorScheme |
getMainDefaultColorScheme(DecorationAreaType decorationAreaType)
Returns the main default color scheme for the specific decoration area type. |
SubstanceColorScheme |
getMainDisabledColorScheme()
Returns the main disabled color scheme for this skin. |
SubstanceColorScheme |
getMainDisabledColorScheme(DecorationAreaType decorationAreaType)
Returns the main disabled color scheme for the specific decoration area type. |
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 |
isPaintingDropShadows(DecorationAreaType decorationAreaType)
Deprecated. Use getOverlayPainters(DecorationAreaType) and test
for presence of TopShadowOverlayPainter . This method
will be removed in version 6.0. |
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 |
setPaintingDropShadows(DecorationAreaType decorationAreaType)
Deprecated. Use addOverlayPainter(SubstanceOverlayPainter, DecorationAreaType...)
with an instance of TopShadowOverlayPainter . This
method will be removed in version 6.0. |
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. |
void |
unsetPaintingDropShadows(DecorationAreaType decorationAreaType)
Deprecated. Use removeOverlayPainter(SubstanceOverlayPainter, DecorationAreaType...)
with an instance of TopShadowOverlayPainter . This
method will be removed in version 6.0. |
SubstanceSkin |
withWatermark(SubstanceWatermark watermark)
Creates a clone of this skin with the specified watermark. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jvnet.substance.api.trait.SubstanceTrait |
---|
getDisplayName |
Field Detail |
---|
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 SubstanceGradientPainter gradientPainter
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
Constructor Detail |
---|
protected SubstanceSkin()
Method Detail |
---|
public final SubstanceColorScheme getMainActiveColorScheme()
getColorScheme(Component, ComponentState)
method and various SubstanceColorScheme
methods.
getColorScheme(Component, ComponentState)
,
getMainActiveColorScheme(DecorationAreaType)
public final SubstanceColorScheme getMainDefaultColorScheme()
getColorScheme(Component, ComponentState)
method and various SubstanceColorScheme
methods.
getColorScheme(Component, ComponentState)
,
getMainDefaultColorScheme(DecorationAreaType)
public final SubstanceColorScheme getMainDisabledColorScheme()
getColorScheme(Component, ComponentState)
method and various
SubstanceColorScheme
methods.
getColorScheme(Component, ComponentState)
,
getMainDisabledColorScheme(DecorationAreaType)
public final SubstanceWatermark getWatermark()
null
.public final SubstanceBorderPainter getBorderPainter()
null
value returned from this method. Call
isValid()
to verify that the skin is valid.isValid()
public final SubstanceBorderPainter getHighlightBorderPainter()
null
. In this case, call
getBorderPainter()
.public final SubstanceButtonShaper getButtonShaper()
null
value returned from this method. Call
isValid()
to verify that the skin is valid.isValid()
public final SubstanceGradientPainter getGradientPainter()
null
value returned from this method. Call
isValid()
to verify that the skin is valid.isValid()
public final SubstanceHighlightPainter getHighlightPainter()
null
value returned from this method. Call
isValid()
to verify that the skin is valid.isValid()
public final SubstanceDecorationPainter getDecorationPainter()
null
value returned from this method. Call
isValid()
to verify that the skin is valid.isValid()
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.
@Deprecated public SubstanceColorScheme getHighlightColorScheme(java.awt.Component comp, ComponentState componentState)
getColorScheme(Component, ColorSchemeAssociationKind, ComponentState)
with ColorSchemeAssociationKind.HIGHLIGHT
instead.
This method will be removed in version 6.0.
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 getMainActiveColorScheme(DecorationAreaType decorationAreaType)
getColorScheme(Component, ComponentState)
method and various
SubstanceColorScheme
methods.
decorationAreaType
- Decoration area type.
getColorScheme(Component, ComponentState)
,
getMainActiveColorScheme()
public final SubstanceColorScheme getMainDefaultColorScheme(DecorationAreaType decorationAreaType)
getColorScheme(Component, ComponentState)
method and various
SubstanceColorScheme
methods.
decorationAreaType
- Decoration area type.
getColorScheme(Component, ComponentState)
,
getMainDefaultColorScheme()
public final SubstanceColorScheme getMainDisabledColorScheme(DecorationAreaType decorationAreaType)
getColorScheme(Component, ComponentState)
method and various
SubstanceColorScheme
methods.
decorationAreaType
- Decoration area type.
getColorScheme(Component, ComponentState)
,
getMainDisabledColorScheme()
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.
@Deprecated public boolean isPaintingDropShadows(DecorationAreaType decorationAreaType)
getOverlayPainters(DecorationAreaType)
and test
for presence of TopShadowOverlayPainter
. This method
will be removed in version 6.0.
decorationAreaType
- Decoration area type.
true
if the specified decoration area type should
paint drop shadows on the top few pixels, false
otherwise.setPaintingDropShadows(DecorationAreaType)
,
unsetPaintingDropShadows(DecorationAreaType)
@Deprecated public void setPaintingDropShadows(DecorationAreaType decorationAreaType)
addOverlayPainter(SubstanceOverlayPainter, DecorationAreaType...)
with an instance of TopShadowOverlayPainter
. This
method will be removed in version 6.0.
decorationAreaType
- Decoration areas of this type will have drop shadows on the
top few pixels.unsetPaintingDropShadows(DecorationAreaType)
,
isPaintingDropShadows(DecorationAreaType)
@Deprecated public void unsetPaintingDropShadows(DecorationAreaType decorationAreaType)
removeOverlayPainter(SubstanceOverlayPainter, DecorationAreaType...)
with an instance of TopShadowOverlayPainter
. This
method will be removed in version 6.0.
decorationAreaType
- Decoration areas of this type will not have drop shadows on
the top few pixels.setPaintingDropShadows(DecorationAreaType)
,
isPaintingDropShadows(DecorationAreaType)
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.
@Deprecated public SubstanceColorScheme getBorderColorScheme(java.awt.Component comp, ComponentState componentState)
getColorScheme(Component, ColorSchemeAssociationKind, ComponentState)
with ColorSchemeAssociationKind.BORDER
instead. This
method will be removed in version 6.0.
comp
- Component.componentState
- Component state.
protected java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public SubstanceSkin transform(ColorSchemeTransform transform, java.lang.String name)
transform
- Color scheme transformation.name
- The name of the new skin.
public SubstanceSkin withWatermark(SubstanceWatermark watermark)
SubstanceSkin
directly.
watermark
- Watermark for 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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |