org.jvnet.substance.theme
Class SubstanceBlendBiTheme

java.lang.Object
  extended by org.jvnet.substance.theme.SubstanceTheme
      extended by org.jvnet.substance.theme.SubstanceBlendBiTheme
All Implemented Interfaces:
SubstanceTrait

public class SubstanceBlendBiTheme
extends SubstanceTheme

Blend theme. Blend theme is based on two original themes and the blend factor, blending the colors from both themes for the painting. Here is how you can create and set a blend theme:

SubstanceTheme blend = new SubstanceBlendBiTheme(
  SubstanceAquaTheme(), SubstanceBottleGreenTheme(), 0.4);
SubstanceLookAndFeel.setCurrentTheme(blend);
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
SubstanceBlendBiTheme(SubstanceTheme originalFirstTheme, SubstanceTheme originalSecondTheme, double firstThemeLikeness)
          Creates a new blended theme.
 
Method Summary
 SubstanceTheme getOriginalFirstTheme()
          Returns the first original theme.
 SubstanceTheme getOriginalSecondTheme()
          Returns the second original 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, getDefaultTheme, getDefaultTitlePaneTheme, getDisabledBackgroundColor, getDisabledColorScheme, getDisabledColorScheme, getDisabledForegroundColor, getDisabledTheme, getDisplayName, getFirstTheme, getForegroundColor, getHighlightTheme, getHighlightThemeAlpha, getKind, getLightBackgroundColor, getLineColor, getLineColorDefault, getNonActivePainter, getSecondTheme, 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

SubstanceBlendBiTheme

public SubstanceBlendBiTheme(SubstanceTheme originalFirstTheme,
                             SubstanceTheme originalSecondTheme,
                             double firstThemeLikeness)
Creates a new blended theme.

Parameters:
originalFirstTheme - The first original theme.
originalSecondTheme - The second original theme.
firstThemeLikeness - Likeness to the first theme. Values close to 0.0 will create theme that closely matches the second original theme. Values close to 1.0 will create theme that closely matches the first original scheme.
Method Detail

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.

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.

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.

getOriginalFirstTheme

public SubstanceTheme getOriginalFirstTheme()
Returns the first original theme.

Returns:
The first original theme.

getOriginalSecondTheme

public SubstanceTheme getOriginalSecondTheme()
Returns the second original theme.

Returns:
The second original theme.