Skinning your Swing apps
- Active theme - for controls in active visual state
- Default theme - for controls in default visual state
- Disabled theme - for controls in disabled visual state
- Active title pane theme - for title panes of active windows
/**
* Creates a new complex theme.
*
* @param displayName
* Theme display name.
* @param themeKind
* Theme kind.
* @param activeTheme
* Active theme.
* @param defaultTheme
* Default theme.
* @param disabledTheme
* Disabled theme.
* @param activeTitlePaneTheme
* Active title pane theme.
*/
public SubstanceComplexTheme(String displayName, ThemeKind themeKind,
SubstanceTheme activeTheme, SubstanceTheme defaultTheme,
SubstanceTheme disabledTheme, SubstanceTheme activeTitlePaneTheme)
Example of a complex theme:
SubstanceTheme activeTheme = new SubstanceMixTheme(
new SubstancePurpleTheme(),
new SubstanceBarbyPinkTheme()).saturate(0.5);
SubstanceTheme defaultTheme = new SubstanceMixTheme(
new SubstanceAquaTheme(),
new SubstanceBottleGreenTheme()).saturate(0.3)
.tint(0.2);
SubstanceTheme disabledTheme = defaultTheme.saturate(-0.3);
SubstanceTheme activeTitleTheme = activeTheme.saturate(-0.1);
this.theme = new SubstanceComplexTheme(
"Finding Nemo", ThemeKind.BRIGHT, activeTheme,
defaultTheme, disabledTheme, activeTitleTheme);
Note that the basic themes of the complex themes are not necessarily simple. This creates the following visual theme (featured in the matrix rain screensaver which now has proper WebStart version):
Another example of a complex theme:
ColorScheme shiftRed = new ShiftColorScheme(new SunsetColorScheme() {
@Override
public Color getForegroundColor() {
return Color.white;
}
}, Color.red, 0.3);
SubstanceTheme activeTheme = new SubstanceTheme(shiftRed, "Red sunset",
ThemeKind.DARK).saturate(0.4);
SubstanceTheme defaultTheme = new SubstanceCharcoalTheme();
SubstanceTheme disabledTheme = defaultTheme.tone(0.2);
SubstanceTheme activeTitleTheme = defaultTheme.saturate(0.2);
SubstanceTheme watermarkTheme = defaultTheme.saturate(0.4);
this.theme = new SubstanceComplexTheme(NAME, ThemeKind.DARK,
activeTheme, defaultTheme, disabledTheme, activeTitleTheme,
watermarkTheme);
which creates the following theme:
Here are few more examples of complex themes:
- Login or register to post comments
- Printer-friendly version
- kirillcool's blog
- 1121 reads





