|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jvnet.substance.theme.SubstanceTheme
org.jvnet.substance.theme.SubstanceComplexTheme
public class SubstanceComplexTheme
Complex theme. A complex theme is defined by four separate themes:
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.jvnet.substance.theme.SubstanceTheme |
|---|
SubstanceTheme.ThemeKind |
| Field Summary | |
|---|---|
protected SubstanceTheme |
activeTheme
Theme for controls in active visual state. |
protected SubstanceTheme |
activeTitlePaneTheme
Theme for title panes of active windows. |
protected SubstanceTheme |
defaultTheme
Theme for controls in default visual state. |
protected SubstanceTheme |
defaultTitlePaneTheme
Theme for title panes of inactive windows. |
protected SubstanceTheme |
disabledTheme
Theme for controls in disabled visual state. |
protected SubstanceGradientPainter |
nonActivePainter
Painter for painting the non-active controls. |
protected double |
selectedTabFadeEnd
The end of fade effect on the selected tabs in JTabbedPanes. |
protected double |
selectedTabFadeStart
The start of fade effect on the selected tabs in JTabbedPanes. |
protected java.util.Map<ComponentState,java.lang.Float> |
stateHighlightThemeAlphaMap
Maps from component state to the alpha channel applied on highlight theme. |
protected java.util.Map<ComponentState,SubstanceTheme> |
stateHighlightThemeMap
Maps from component state to the matching themes for highlight themes. |
protected java.util.Map<ComponentState,java.lang.Float> |
stateThemeAlphaMap
Maps from component state to the alpha channel applied on theme. |
protected java.util.Map<ComponentState,SubstanceTheme> |
stateThemeMap
Maps from component state to the matching themes. |
protected boolean |
useSameBackgroundColor
If true, the light background color and the background
color are the same. |
protected SubstanceTheme |
watermarkTheme
Theme for watermarks. |
| Fields inherited from class org.jvnet.substance.theme.SubstanceTheme |
|---|
AQUA, GREEN, ORANGE, YELLOW |
| Constructor Summary | |
|---|---|
SubstanceComplexTheme(java.lang.String displayName,
SubstanceTheme.ThemeKind themeKind,
SubstanceTheme activeTheme,
SubstanceTheme defaultTheme,
SubstanceTheme disabledTheme,
SubstanceTheme activeTitlePaneTheme)
Creates a new complex theme. |
|
SubstanceComplexTheme(java.lang.String displayName,
SubstanceTheme.ThemeKind themeKind,
SubstanceTheme activeTheme,
SubstanceTheme defaultTheme,
SubstanceTheme disabledTheme,
SubstanceTheme activeTitlePaneTheme,
SubstanceTheme watermarkTheme)
Creates a new complex theme. |
|
| Method Summary | |
|---|---|
protected void |
copyTo(SubstanceComplexTheme dst)
Copies theme-agnostic settings of this theme to the
specified theme. |
SubstanceTheme |
deuteranopia()
Creates a new version of this theme that simulates the
deuteranopia color blindness. |
SubstanceTheme |
getActiveTheme()
Returns the active theme that corresponds to this theme. |
SubstanceTheme |
getActiveTitlePaneTheme()
Returns the theme for title panes of active frames. |
SubstanceTheme |
getDefaultTheme()
Returns the default theme that corresponds to this theme. |
SubstanceTheme |
getDefaultTitlePaneTheme()
Returns the theme for title panes of inactive frames. |
SubstanceTheme |
getDisabledTheme()
Returns the disabled theme that corresponds to this theme. |
SubstanceTheme |
getFirstTheme()
Returns the first theme. |
SubstanceTheme |
getHighlightTheme(java.awt.Component comp,
ComponentState componentState)
Returns the highlight theme that corresponds to the specified component state. |
float |
getHighlightThemeAlpha(java.awt.Component comp,
ComponentState componentState)
Returns the alpha channel that is applied on highlight theme when a component is in the specified state. |
java.awt.Color |
getLightBackgroundColor()
Returns the light background color for this theme. |
SubstanceGradientPainter |
getNonActivePainter()
Returns the painter for painting the non-active controls. |
SubstanceTheme |
getSecondTheme()
Returns the second theme. |
double |
getSelectedTabFadeEnd()
Returns the end of fade effect on the selected tabs in JTabbedPanes. |
double |
getSelectedTabFadeStart()
Returns the start of fade effect on the selected tabs in JTabbedPanes. |
SubstanceTheme |
getTheme(java.awt.Component comp,
ComponentState componentState)
Returns the theme that corresponds to the specified component state. |
float |
getThemeAlpha(java.awt.Component comp,
ComponentState componentState)
Returns the alpha channel that is applied on theme when a component is in the specified state. |
SubstanceTheme |
getWatermarkTheme()
Returns the theme for watermark painting. |
SubstanceTheme |
hueShift(double hueShiftFactor)
Creates a hue-shifted (in HSB space) version of this
theme. |
SubstanceTheme |
invert()
Creates an inverted version of this theme. |
SubstanceTheme |
negate()
Creates a negated version of this theme. |
SubstanceTheme |
protanopia()
Creates a new version of this theme that simulates the
protanopia color blindness. |
void |
registerComponentHighlightStateTheme(SubstanceTheme stateHighlightTheme,
ComponentState... states)
Registers a highlight theme for the specific component state if the component state is not null, or a global highlight theme
otherwise. |
void |
registerComponentHighlightStateTheme(SubstanceTheme stateHighlightTheme,
float alpha,
ComponentState... states)
Registers a highlight theme for the specific component state if the component state is not null, or a global highlight theme
otherwise. |
void |
registerComponentStateTheme(SubstanceTheme stateTheme,
boolean useForHighlights,
ComponentState... states)
Registers a theme for the specific component state. |
void |
registerComponentStateTheme(SubstanceTheme stateTheme,
float alpha,
boolean useForHighlights,
ComponentState... states)
Registers a theme for the specific component state. |
SubstanceTheme |
saturate(double saturateFactor,
boolean toSaturateEverything)
Creates a saturated or desaturated version of this theme. |
void |
setActiveTheme(SubstanceTheme activeTheme)
Sets the theme for the active visual state. |
void |
setActiveTitlePaneTheme(SubstanceTheme activeTitlePaneTheme)
Sets the theme for the title panes of active windows. |
void |
setDefaultTheme(SubstanceTheme defaultTheme)
Sets the theme for the default visual state. |
void |
setDefaultTitlePaneTheme(SubstanceTheme defaultTitlePaneTheme)
Sets the theme for title panes of inactive windows. |
void |
setDisabledTheme(SubstanceTheme disabledTheme)
Sets the theme for the disabled visual state. |
void |
setNonActivePainter(SubstanceGradientPainter nonActivePainter)
Sets the painter for painting the non-active controls. |
void |
setSelectedTabFadeEnd(double selectedTabFadeEnd)
Sets the end of fade effect on the selected tabs in JTabbedPanes. |
void |
setSelectedTabFadeStart(double selectedTabFadeStart)
Sets the start of fade effect on the selected tabs in JTabbedPanes. |
void |
setUseSameBackgroundColor(boolean useSameBackgroundColor)
Sets usage of background color for light background color. |
void |
setWatermarkTheme(SubstanceTheme watermarkTheme)
Sets the theme for the watermark. |
SubstanceTheme |
shade(double shadeFactor)
Creates a shaded (shifted towards black) version of this
theme. |
SubstanceTheme |
tint(double tintFactor)
Creates a tinted (shifted towards white) version of this
theme. |
SubstanceTheme |
tone(double toneFactor)
Creates a toned (shifted towards gray) version of this
theme. |
SubstanceTheme |
tritanopia()
Creates a new version of this theme that simulates the
tritanopia color blindness. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected SubstanceTheme activeTheme
protected SubstanceTheme defaultTheme
protected SubstanceTheme disabledTheme
protected SubstanceTheme activeTitlePaneTheme
protected SubstanceTheme defaultTitlePaneTheme
protected SubstanceTheme watermarkTheme
protected java.util.Map<ComponentState,SubstanceTheme> stateThemeMap
ComponentState instances.
protected java.util.Map<ComponentState,java.lang.Float> stateThemeAlphaMap
ComponentState instances.
protected java.util.Map<ComponentState,SubstanceTheme> stateHighlightThemeMap
ComponentState
instances.
protected java.util.Map<ComponentState,java.lang.Float> stateHighlightThemeAlphaMap
ComponentState instances.
protected SubstanceGradientPainter nonActivePainter
protected double selectedTabFadeStart
JTabbedPanes.
selectedTabFadeEndprotected double selectedTabFadeEnd
JTabbedPanes.
selectedTabFadeStartprotected boolean useSameBackgroundColor
true, the light background color and the background
color are the same.
| Constructor Detail |
|---|
public SubstanceComplexTheme(java.lang.String displayName,
SubstanceTheme.ThemeKind themeKind,
SubstanceTheme activeTheme,
SubstanceTheme defaultTheme,
SubstanceTheme disabledTheme,
SubstanceTheme activeTitlePaneTheme)
displayName - Theme display name.themeKind - Theme kind.activeTheme - Active theme.defaultTheme - Default theme.disabledTheme - Disabled theme.activeTitlePaneTheme - Active title pane theme.
public SubstanceComplexTheme(java.lang.String displayName,
SubstanceTheme.ThemeKind themeKind,
SubstanceTheme activeTheme,
SubstanceTheme defaultTheme,
SubstanceTheme disabledTheme,
SubstanceTheme activeTitlePaneTheme,
SubstanceTheme watermarkTheme)
displayName - Theme display name.themeKind - Theme kind.activeTheme - Active theme.defaultTheme - Default theme.disabledTheme - Disabled theme.activeTitlePaneTheme - Active title pane theme.watermarkTheme - Watermark theme.| Method Detail |
|---|
public SubstanceTheme getActiveTheme()
SubstanceThemethis theme.
This method is for internal use only.
getActiveTheme in class SubstanceThemethis theme.public SubstanceTheme getDefaultTheme()
SubstanceThemethis theme.
This method is for internal use only.
getDefaultTheme in class SubstanceThemethis theme.public SubstanceTheme getDisabledTheme()
SubstanceThemethis theme.
This method is for internal use only.
getDisabledTheme in class SubstanceThemethis theme.public SubstanceTheme getActiveTitlePaneTheme()
SubstanceTheme
getActiveTitlePaneTheme in class SubstanceThemepublic SubstanceTheme getDefaultTitlePaneTheme()
SubstanceTheme
getDefaultTitlePaneTheme in class SubstanceThemepublic java.awt.Color getLightBackgroundColor()
SubstanceTheme
getLightBackgroundColor in class SubstanceThemepublic SubstanceTheme getFirstTheme()
SubstanceTheme
getFirstTheme in class SubstanceThemepublic SubstanceTheme getSecondTheme()
SubstanceTheme
getSecondTheme in class SubstanceTheme
public SubstanceTheme saturate(double saturateFactor,
boolean toSaturateEverything)
SubstanceThemethis theme.
The value and brightness stay the same. This method is part of officially
supported API.
saturate in class SubstanceThemesaturateFactor - Value in -1.0...1.0 range. Positive values create more
saturated colors. Negative values create more desaturated
colors.toSaturateEverything - If true, all visual components of
this theme will be saturated. If
false, only the SubstanceTheme.getActiveTheme() will
be saturated.
this theme.public SubstanceTheme shade(double shadeFactor)
SubstanceThemethis
theme. This method is part of officially supported API.
shade in class SubstanceThemeshadeFactor - Value in 0.0...1.0 range. Larger values shift more towards
black color.
this theme.public SubstanceTheme tint(double tintFactor)
SubstanceThemethis
theme. This method is part of officially supported API.
tint in class SubstanceThemetintFactor - Value in 0.0...1.0 range. Larger values shift more towards
white color.
this theme.public SubstanceTheme tone(double toneFactor)
SubstanceThemethis
theme. This method is part of officially supported API.
tone in class SubstanceThemetoneFactor - Value in 0.0...1.0 range. Larger values shift more towards
gray color.
this theme.public SubstanceTheme invert()
SubstanceThemethis theme. This method is
part of officially supported API.
invert in class SubstanceThemethis theme.public SubstanceTheme negate()
SubstanceThemethis theme. This method is
part of officially supported API.
negate in class SubstanceThemethis theme.public SubstanceTheme hueShift(double hueShiftFactor)
SubstanceThemethis
theme. This method is part of officially supported API.
hueShift in class SubstanceThemehueShiftFactor - Value in -1.0...1.0 range.
this theme.public SubstanceTheme protanopia()
SubstanceThemethis theme that simulates the
protanopia color blindness.
protanopia in class SubstanceThemethis theme that simulates the
protanopia color blindness.public SubstanceTheme tritanopia()
SubstanceThemethis theme that simulates the
tritanopia color blindness.
tritanopia in class SubstanceThemethis theme that simulates the
tritanopia color blindness.public SubstanceTheme deuteranopia()
SubstanceThemethis theme that simulates the
deuteranopia color blindness.
deuteranopia in class SubstanceThemethis theme that simulates the
deuteranopia color blindness.public SubstanceTheme getWatermarkTheme()
SubstanceTheme
getWatermarkTheme in class SubstanceThemepublic SubstanceGradientPainter getNonActivePainter()
SubstanceTheme
getNonActivePainter in class SubstanceThemepublic void setNonActivePainter(SubstanceGradientPainter nonActivePainter)
nonActivePainter - Painter for painting the non-active controls.public void setDefaultTitlePaneTheme(SubstanceTheme defaultTitlePaneTheme)
defaultTitlePaneTheme - Theme for title panes of inactive windows.public void setDefaultTheme(SubstanceTheme defaultTheme)
defaultTheme - The theme for the default visual state.public void setDisabledTheme(SubstanceTheme disabledTheme)
disabledTheme - The theme for the disabled visual state.public void setActiveTheme(SubstanceTheme activeTheme)
activeTheme - The theme for the active visual state.public void setActiveTitlePaneTheme(SubstanceTheme activeTitlePaneTheme)
activeTitlePaneTheme - The theme for the title panes of active windows.public void setWatermarkTheme(SubstanceTheme watermarkTheme)
watermarkTheme - The theme for the watermark.public double getSelectedTabFadeStart()
SubstanceThemeJTabbedPanes. This value can be used to create XP-like "headers"
on the selected tabs.
getSelectedTabFadeStart in class SubstanceThemeJTabbedPanes.SubstanceTheme.getSelectedTabFadeEnd()public double getSelectedTabFadeEnd()
SubstanceThemeJTabbedPanes. This value can be used to create XP-like "headers"
on the selected tabs.
getSelectedTabFadeEnd in class SubstanceThemeJTabbedPanes.SubstanceTheme.getSelectedTabFadeStart()public void setSelectedTabFadeEnd(double selectedTabFadeEnd)
JTabbedPanes.
The value should be in 0.0-1.0 range.
selectedTabFadeEnd - The end of fade effect on the selected tabs in
JTabbedPanes. Should be in 0.0-1.0 range.public void setSelectedTabFadeStart(double selectedTabFadeStart)
JTabbedPanes.
The value should be in 0.0-1.0 range.
selectedTabFadeStart - The start of fade effect on the selected tabs in
JTabbedPanes. Should be in 0.0-1.0 range.public void setUseSameBackgroundColor(boolean useSameBackgroundColor)
useSameBackgroundColor - if true, the light background color and the
background color are the same.
public void registerComponentStateTheme(SubstanceTheme stateTheme,
float alpha,
boolean useForHighlights,
ComponentState... states)
stateTheme - Theme for the specified component state.alpha - Alpha channel for the theme.useForHighlights - if true, the specified theme will be used as
highlight theme as well (for the same component state).states - Component states.
public void registerComponentStateTheme(SubstanceTheme stateTheme,
boolean useForHighlights,
ComponentState... states)
stateTheme - Theme for the specified component state.useForHighlights - if true, the specified theme will be used as
highlight theme as well (for the same component state).states - Component states.
public void registerComponentHighlightStateTheme(SubstanceTheme stateHighlightTheme,
ComponentState... states)
null, or a global highlight theme
otherwise.
stateHighlightTheme - Highlight theme for the specified component state.states - Component states. If null, the specified theme
will be applied for all states left unspecified.
public void registerComponentHighlightStateTheme(SubstanceTheme stateHighlightTheme,
float alpha,
ComponentState... states)
null, or a global highlight theme
otherwise.
stateHighlightTheme - Highlight theme for the specified component state.alpha - Alpha channel for the highlight theme.states - Component states. If null, the specified theme
will be applied for all states left unspecified.
public SubstanceTheme getTheme(java.awt.Component comp,
ComponentState componentState)
SubstanceTheme
getTheme in class SubstanceThemecomp - Component.componentState - Component state.
public SubstanceTheme getHighlightTheme(java.awt.Component comp,
ComponentState componentState)
SubstanceTheme
getHighlightTheme in class SubstanceThemecomp - Component.componentState - Component state.
public float getHighlightThemeAlpha(java.awt.Component comp,
ComponentState componentState)
SubstanceTheme
getHighlightThemeAlpha in class SubstanceThemecomp - Component.componentState - Component state.
public float getThemeAlpha(java.awt.Component comp,
ComponentState componentState)
SubstanceTheme
getThemeAlpha in class SubstanceThemecomp - Component.componentState - Component state.
protected void copyTo(SubstanceComplexTheme dst)
this theme to the
specified theme.
dst - Theme to copy to.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||