org.jvnet.substance.theme
Class SubstanceMixTheme

java.lang.Object
  extended by org.jvnet.substance.theme.SubstanceTheme
      extended by org.jvnet.substance.theme.SubstanceMixTheme
All Implemented Interfaces:
SubstanceTrait
Direct Known Subclasses:
SubstanceMixBiTheme

public class SubstanceMixTheme
extends SubstanceTheme

Mixed theme. Mixed theme is based on two original themes, using the first theme for the left part of the painting, the second theme for the right part of the painting, and the theme blend gradient in the middle. Here is how you can create and set a mixed theme:

SubstanceTheme mixed = new SubstanceMixTheme(
  SubstanceAquaTheme(), SubstanceBottleGreenTheme());
SubstanceLookAndFeel.setCurrentTheme(mixed);
for (Frame frame : Frame.getFrames()) {
  SwingUtilities.updateComponentTreeUI(frame);
}

This class is part of officially supported API.

Author:
Kirill Grouchnikov

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jvnet.substance.theme.SubstanceTheme
SubstanceTheme.ThemeKind
 
Field Summary
 
Fields inherited from class org.jvnet.substance.theme.SubstanceTheme
AQUA, GREEN, ORANGE, YELLOW
 
Constructor Summary
SubstanceMixTheme(SubstanceTheme... originalThemes)
          Creates a new mixed theme.
 
Method Summary
 SubstanceTheme getDefaultTheme()
          Returns the default theme that corresponds to this theme.
 SubstanceTheme getDisabledTheme()
          Returns the disabled theme that corresponds to this theme.
 SubstanceTheme getFirstTheme()
          Returns the first theme.
 SubstanceTheme[] getOriginalThemes()
          Returns the original themes.
 SubstanceTheme getSecondTheme()
          Returns the second theme.
 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 saturate(double saturateFactor, boolean toSaturateEverything)
          Creates a saturated or desaturated version of this theme.
 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.
 
Methods inherited from class org.jvnet.substance.theme.SubstanceTheme
addCustomEntriesToTable, addUserDefined, createInstance, deuteranopia, getActiveTheme, getActiveTitlePaneTheme, getBackgroundColor, getBorderTheme, getColorScheme, getDefaultColorScheme, getDefaultColorScheme, getDefaultTitlePaneTheme, getDisabledBackgroundColor, getDisabledColorScheme, getDisabledColorScheme, getDisabledForegroundColor, getDisplayName, getForegroundColor, getHighlightTheme, getHighlightThemeAlpha, getKind, getLightBackgroundColor, getLineColor, getLineColorDefault, getNonActivePainter, getSelectedTabFadeEnd, getSelectedTabFadeStart, getSelectionBackgroundColor, getSelectionCellForegroundColor, getSelectionForegroundColor, getTheme, getTheme, getThemeAlpha, getThemeName, getWatermarkStampColor, getWatermarkTheme, isDark, protanopia, saturate, toString, tritanopia
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SubstanceMixTheme

public SubstanceMixTheme(SubstanceTheme... originalThemes)
Creates a new mixed theme.

Parameters:
originalThemes - The original themes.
Method Detail

getOriginalThemes

public SubstanceTheme[] getOriginalThemes()
Returns the original themes.

Returns:
The original themes.

tint

public SubstanceTheme tint(double tintFactor)
Description copied from class: SubstanceTheme
Creates a tinted (shifted towards white) version of this theme. This method is part of officially supported API.

Overrides:
tint in class SubstanceTheme
Parameters:
tintFactor - Value in 0.0...1.0 range. Larger values shift more towards white color.
Returns:
Tinted version of this theme.

tone

public SubstanceTheme tone(double toneFactor)
Description copied from class: SubstanceTheme
Creates a toned (shifted towards gray) version of this theme. This method is part of officially supported API.

Overrides:
tone in class SubstanceTheme
Parameters:
toneFactor - Value in 0.0...1.0 range. Larger values shift more towards gray color.
Returns:
Toned version of this theme.

shade

public SubstanceTheme shade(double shadeFactor)
Description copied from class: SubstanceTheme
Creates a shaded (shifted towards black) version of this theme. This method is part of officially supported API.

Overrides:
shade in class SubstanceTheme
Parameters:
shadeFactor - Value in 0.0...1.0 range. Larger values shift more towards black color.
Returns:
Shaded version of this theme.

saturate

public SubstanceTheme saturate(double saturateFactor,
                               boolean toSaturateEverything)
Description copied from class: SubstanceTheme
Creates a saturated or desaturated version of this theme. The value and brightness stay the same. This method is part of officially supported API.

Overrides:
saturate in class SubstanceTheme
Parameters:
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.
Returns:
Saturated version of this theme.

hueShift

public SubstanceTheme hueShift(double hueShiftFactor)
Description copied from class: SubstanceTheme
Creates a hue-shifted (in HSB space) version of this theme. This method is part of officially supported API.

Overrides:
hueShift in class SubstanceTheme
Parameters:
hueShiftFactor - Value in -1.0...1.0 range.
Returns:
Hue-shifted version of this theme.

invert

public SubstanceTheme invert()
Description copied from class: SubstanceTheme
Creates an inverted version of this theme. This method is part of officially supported API.

Overrides:
invert in class SubstanceTheme
Returns:
Inverted version of this theme.

negate

public SubstanceTheme negate()
Description copied from class: SubstanceTheme
Creates a negated version of this theme. This method is part of officially supported API.

Overrides:
negate in class SubstanceTheme
Returns:
Negated version of this theme.

getFirstTheme

public SubstanceTheme getFirstTheme()
Description copied from class: SubstanceTheme
Returns the first theme. This method is for internal use only.

Overrides:
getFirstTheme in class SubstanceTheme
Returns:
First theme.

getSecondTheme

public SubstanceTheme getSecondTheme()
Description copied from class: SubstanceTheme
Returns the second theme. This method is for internal use only.

Overrides:
getSecondTheme in class SubstanceTheme
Returns:
Second theme.

getDefaultTheme

public SubstanceTheme getDefaultTheme()
Description copied from class: SubstanceTheme
Returns the default theme that corresponds to this theme. This method is for internal use only.

Overrides:
getDefaultTheme in class SubstanceTheme
Returns:
The default theme that corresponds to this theme.

getDisabledTheme

public SubstanceTheme getDisabledTheme()
Description copied from class: SubstanceTheme
Returns the disabled theme that corresponds to this theme. This method is for internal use only.

Overrides:
getDisabledTheme in class SubstanceTheme
Returns:
The disabled theme that corresponds to this theme.