org.apache.pivot.wtk.skin.terra
Class TerraTheme

java.lang.Object
  extended by org.apache.pivot.wtk.Theme
      extended by org.apache.pivot.wtk.skin.terra.TerraTheme

public final class TerraTheme
extends Theme

Terra theme. The default color palette is shown below:


The default color palette


Field Summary
 
Fields inherited from class org.apache.pivot.wtk.Theme
componentSkinMap, PROVIDER_NAME
 
Constructor Summary
TerraTheme()
          Creates a new theme using the default font and color palette.
TerraTheme(String location)
          Constructs a theme, pulling the font and color palette from a JSON file at the specified location.
TerraTheme(URL location)
          Constructs a theme, pulling the font and color palette from a JSON file at the specified location.
 
Method Summary
static Color brighten(Color color)
          Returns a brighter version of the specified color.
static Color darken(Color color)
          Returns a darker version of the specified color.
 Color getColor(int index)
          Gets the color found at the specified index in the theme's color palette.
 Font getFont()
          Gets the theme's font.
 Image getMessageIcon(MessageType messageType)
          Gets the image that this theme uses to represent messages of the specified type.
 Image getSmallMessageIcon(MessageType messageType)
          Gets the "small" image that this theme uses to represent messages of the specified type.
protected  void install()
           
protected  void uninstall()
           
 
Methods inherited from class org.apache.pivot.wtk.Theme
getSkinClass, getTheme, setTheme
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TerraTheme

public TerraTheme()
Creates a new theme using the default font and color palette.


TerraTheme

public TerraTheme(String location)
Constructs a theme, pulling the font and color palette from a JSON file at the specified location.

Parameters:
location -
See Also:
TerraTheme(URL)

TerraTheme

public TerraTheme(URL location)
Constructs a theme, pulling the font and color palette from a JSON file at the specified location. The JSON file should represent a Map containing the following properties:

Property: Type: Description:
font String The default theme font; must be understandable by java.awt.Font.decode().
colors List<String> This list should contain 8 colors in a form understandable by java.awt.Color.decode(). This list represents the theme's "base color palette", from which the full color palette is derived. Each of these 8 colors will be expanded to comprise 3 colors in the final palette: a darker version, the color itself, and a lighter version. Thus, the final color palette will contain 24 colors. For instance, in the default color palette the "base palette" colors are the colors in the middle column.

Parameters:
location - The location of the JSON file that defines the theme's font and colors.
Method Detail

install

protected void install()
Specified by:
install in class Theme

uninstall

protected void uninstall()
Specified by:
uninstall in class Theme

getFont

public Font getFont()
Gets the theme's font.

Specified by:
getFont in class Theme

getColor

public Color getColor(int index)
Gets the color found at the specified index in the theme's color palette.

Parameters:
index - A color palette index, from 0 to 23.

getMessageIcon

public Image getMessageIcon(MessageType messageType)
Gets the image that this theme uses to represent messages of the specified type.

Specified by:
getMessageIcon in class Theme

getSmallMessageIcon

public Image getSmallMessageIcon(MessageType messageType)
Gets the "small" image that this theme uses to represent messages of the specified type.

Specified by:
getSmallMessageIcon in class Theme

brighten

public static Color brighten(Color color)
Returns a brighter version of the specified color. Specifically, it increases the brightness (in the HSB color model) by 0.1.


darken

public static Color darken(Color color)
Returns a darker version of the specified color. Specifically, it decreases the brightness (in the HSB color model) by 0.1.