|
|||||||||
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 JTabbedPane s. |
protected double |
selectedTabFadeStart
The start of fade effect on the selected tabs in JTabbedPane s. |
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 JTabbedPane s. |
double |
getSelectedTabFadeStart()
Returns the start of fade effect on the selected tabs in JTabbedPane s. |
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 JTabbedPane s. |
void |
setSelectedTabFadeStart(double selectedTabFadeStart)
Sets the start of fade effect on the selected tabs in JTabbedPane s. |
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
JTabbedPane
s.
selectedTabFadeEnd
protected double selectedTabFadeEnd
JTabbedPane
s.
selectedTabFadeStart
protected 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()
SubstanceTheme
this
theme.
This method is for internal use only.
getActiveTheme
in class SubstanceTheme
this
theme.public SubstanceTheme getDefaultTheme()
SubstanceTheme
this
theme.
This method is for internal use only.
getDefaultTheme
in class SubstanceTheme
this
theme.public SubstanceTheme getDisabledTheme()
SubstanceTheme
this
theme.
This method is for internal use only.
getDisabledTheme
in class SubstanceTheme
this
theme.public SubstanceTheme getActiveTitlePaneTheme()
SubstanceTheme
getActiveTitlePaneTheme
in class SubstanceTheme
public SubstanceTheme getDefaultTitlePaneTheme()
SubstanceTheme
getDefaultTitlePaneTheme
in class SubstanceTheme
public java.awt.Color getLightBackgroundColor()
SubstanceTheme
getLightBackgroundColor
in class SubstanceTheme
public SubstanceTheme getFirstTheme()
SubstanceTheme
getFirstTheme
in class SubstanceTheme
public SubstanceTheme getSecondTheme()
SubstanceTheme
getSecondTheme
in class SubstanceTheme
public SubstanceTheme saturate(double saturateFactor, boolean toSaturateEverything)
SubstanceTheme
this
theme.
The value and brightness stay the same. This method is part of officially
supported API.
saturate
in class SubstanceTheme
saturateFactor
- 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)
SubstanceTheme
this
theme. This method is part of officially supported API.
shade
in class SubstanceTheme
shadeFactor
- Value in 0.0...1.0 range. Larger values shift more towards
black color.
this
theme.public SubstanceTheme tint(double tintFactor)
SubstanceTheme
this
theme. This method is part of officially supported API.
tint
in class SubstanceTheme
tintFactor
- Value in 0.0...1.0 range. Larger values shift more towards
white color.
this
theme.public SubstanceTheme tone(double toneFactor)
SubstanceTheme
this
theme. This method is part of officially supported API.
tone
in class SubstanceTheme
toneFactor
- Value in 0.0...1.0 range. Larger values shift more towards
gray color.
this
theme.public SubstanceTheme invert()
SubstanceTheme
this
theme. This method is
part of officially supported API.
invert
in class SubstanceTheme
this
theme.public SubstanceTheme negate()
SubstanceTheme
this
theme. This method is
part of officially supported API.
negate
in class SubstanceTheme
this
theme.public SubstanceTheme hueShift(double hueShiftFactor)
SubstanceTheme
this
theme. This method is part of officially supported API.
hueShift
in class SubstanceTheme
hueShiftFactor
- Value in -1.0...1.0 range.
this
theme.public SubstanceTheme protanopia()
SubstanceTheme
this
theme that simulates the
protanopia
color blindness.
protanopia
in class SubstanceTheme
this
theme that simulates the
protanopia
color blindness.public SubstanceTheme tritanopia()
SubstanceTheme
this
theme that simulates the
tritanopia
color blindness.
tritanopia
in class SubstanceTheme
this
theme that simulates the
tritanopia
color blindness.public SubstanceTheme deuteranopia()
SubstanceTheme
this
theme that simulates the
deuteranopia
color blindness.
deuteranopia
in class SubstanceTheme
this
theme that simulates the
deuteranopia
color blindness.public SubstanceTheme getWatermarkTheme()
SubstanceTheme
getWatermarkTheme
in class SubstanceTheme
public SubstanceGradientPainter getNonActivePainter()
SubstanceTheme
getNonActivePainter
in class SubstanceTheme
public 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()
SubstanceTheme
JTabbedPane
s. This value can be used to create XP-like "headers"
on the selected tabs.
getSelectedTabFadeStart
in class SubstanceTheme
JTabbedPane
s.SubstanceTheme.getSelectedTabFadeEnd()
public double getSelectedTabFadeEnd()
SubstanceTheme
JTabbedPane
s. This value can be used to create XP-like "headers"
on the selected tabs.
getSelectedTabFadeEnd
in class SubstanceTheme
JTabbedPane
s.SubstanceTheme.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 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 SubstanceTheme
comp
- Component.componentState
- Component state.
public SubstanceTheme getHighlightTheme(java.awt.Component comp, ComponentState componentState)
SubstanceTheme
getHighlightTheme
in class SubstanceTheme
comp
- Component.componentState
- Component state.
public float getHighlightThemeAlpha(java.awt.Component comp, ComponentState componentState)
SubstanceTheme
getHighlightThemeAlpha
in class SubstanceTheme
comp
- Component.componentState
- Component state.
public float getThemeAlpha(java.awt.Component comp, ComponentState componentState)
SubstanceTheme
getThemeAlpha
in class SubstanceTheme
comp
- 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 |