com.leafdigital.ui.api
Interface Theme


public interface Theme

API for information held by the theme.

Since themes are considered to be user-created, these methods are more lenient than usual; they do not throw exceptions.


Field Summary
static java.lang.String META
          Theme property type: meta
static java.lang.String META_AUTHORS
          Theme property: theme authors
static java.lang.String META_DESCRIPTION
          Theme property: theme description
static java.lang.String META_NAME
          Theme property: theme name
static java.lang.String META_PREVIEW
          Theme property: theme preview
 
Method Summary
 boolean getBooleanProperty(java.lang.String themeType, java.lang.String property, boolean def)
          Obtains a boolean property.
 java.awt.image.BufferedImage getImageProperty(java.lang.String themeType, java.lang.String property, boolean transparency, java.lang.Class<?> defaultReference, java.lang.String defaultFilename)
          Obtains an image property.
 int getIntProperty(java.lang.String themeType, java.lang.String property, int def)
          Obtains an integer property.
 java.io.File getLocation()
           
 java.lang.String getStringProperty(java.lang.String themeType, java.lang.String property, java.lang.String def)
          Obtains a string property.
 textlayout.stylesheet.Stylesheet[] getStylesheets()
          Obtains the theme's stylesheets (if provided).
 

Field Detail

META

static final java.lang.String META
Theme property type: meta

See Also:
Constant Field Values

META_NAME

static final java.lang.String META_NAME
Theme property: theme name

See Also:
Constant Field Values

META_AUTHORS

static final java.lang.String META_AUTHORS
Theme property: theme authors

See Also:
Constant Field Values

META_DESCRIPTION

static final java.lang.String META_DESCRIPTION
Theme property: theme description

See Also:
Constant Field Values

META_PREVIEW

static final java.lang.String META_PREVIEW
Theme property: theme preview

See Also:
Constant Field Values
Method Detail

getLocation

java.io.File getLocation()
Returns:
Physical location of theme

getIntProperty

int getIntProperty(java.lang.String themeType,
                   java.lang.String property,
                   int def)
Obtains an integer property.

Parameters:
themeType - Type of window/item under consideration, or Theme.META
property - Name of property
def - Default value of property if not specified, or if specified but not an integer
Returns:
Value of property

getBooleanProperty

boolean getBooleanProperty(java.lang.String themeType,
                           java.lang.String property,
                           boolean def)
Obtains a boolean property.

Parameters:
themeType - Type of window/item under consideration, or Theme.META
property - Name of property
def - Default value of property if not specified
Returns:
Value of property

getStringProperty

java.lang.String getStringProperty(java.lang.String themeType,
                                   java.lang.String property,
                                   java.lang.String def)
Obtains a string property.

Parameters:
themeType - Type of window/item under consideration, or Theme.META
property - Name of property
def - Default value of property if not specified
Returns:
Value of property

getImageProperty

java.awt.image.BufferedImage getImageProperty(java.lang.String themeType,
                                              java.lang.String property,
                                              boolean transparency,
                                              java.lang.Class<?> defaultReference,
                                              java.lang.String defaultFilename)
Obtains an image property.

Parameters:
themeType - Type of window/item under consideration, or Theme.META, or null to request a file directly from this theme (will not search parent themes or use the default reference).
property - Name of property, or file if themeType is null
transparency - If true, transparency from image will be used; otherwise you'll get a solid image
defaultReference - A class that can be used as reference to load a default image, or null if no default
defaultFilename - Filename for default image, or null if no default
Returns:
Image or null if not specified

getStylesheets

textlayout.stylesheet.Stylesheet[] getStylesheets()
Obtains the theme's stylesheets (if provided).

Returns:
Stylesheets in ascending order of importance i.e. first is most general and should be added first.


Copyright © 2011 Samuel Marshall. All rights reserved.