Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

oracle.javatools.ui.themes
Class ThemeProperties

java.lang.Object
  extended by oracle.javatools.ui.themes.ThemeProperties

public final class ThemeProperties
extends java.lang.Object

Visual properties associated with a theme part or state.

Although this class is not final, it should not be subclassed by extension writers.

Since:
11.0

Method Summary
 javax.swing.border.Border getBorder(java.lang.String id)
          Gets a border.
 java.awt.Color getColor(java.lang.String id)
           
 double getDouble(java.lang.String id)
          Returns a double value.
 java.awt.Font getFont(java.awt.Font base, java.lang.String id)
          Derives a font using information from the style.
 javax.swing.Icon getIcon(java.lang.String id)
          Gets an icon.
 java.awt.Insets getInsets(java.lang.String id)
          Returns an Insets object.
 int getInt(java.lang.String id)
          Returns an integer value.
 Painter getPainter(java.lang.String id)
          Returns a Painter.
 java.lang.String getString(java.lang.String id)
          Gets a string.
 java.lang.String getString(java.lang.String id, java.lang.String defaultValue)
          Gets a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getBorder

public javax.swing.border.Border getBorder(java.lang.String id)
Gets a border.

A border is specified in theme properties in the standard css style, {width} {style} {color} Where width = thin | {size}px style = solid | none color = #RRGGBB

Parameters:
id - the id of the border
Returns:
a Border object. Will not return null, but may return an empty border.

getFont

public java.awt.Font getFont(java.awt.Font base,
                             java.lang.String id)
Derives a font using information from the style. Supported properties are: font-weight = [ normal | bold ] font-size = [ {size}pt | {pct}% ]

Parameters:
base - the base font. Must not be null.
id - the id to look up.
Returns:
the font.

getColor

public java.awt.Color getColor(java.lang.String id)

getDouble

public double getDouble(java.lang.String id)
Returns a double value.

Parameters:
id - the id of the double value.
Returns:
the value of the specified property, or 0.0 if it was not found or is invalid.

getInt

public int getInt(java.lang.String id)
Returns an integer value.

Parameters:
id - the id of the integer value.
Returns:
the value of the specified property, or 0 if it was not found or is invalid.

getInsets

public java.awt.Insets getInsets(java.lang.String id)
Returns an Insets object. An insets object is defined in the theme properties using four integer values: top left bottom right. It's valid to specify a subset of the values - the remaining values will be set to zero.

Parameters:
id - the id of the property to read.
Returns:
an object.

getPainter

public Painter getPainter(java.lang.String id)
Returns a Painter. A painter is an abstract object that knows how to paint something.

A painter must have a sub-property "type" that specifies the kind of painter this is.

For now, the only supported painter types are "empty" and "stretch".

An empty painter paints nothing.

A stretch painter paints an image stretched to fit a particular surface. You must specify an image property, which is resolved relative to the global imagebase property on the classpath. You may also supply an Inset sizingmargin property. This specifies how the icons corners will be stretched.

Parameters:
id - the id of the painter.
Returns:
a painter object.

getIcon

public javax.swing.Icon getIcon(java.lang.String id)
Gets an icon.

Parameters:
id - the id of the icon.
Returns:
an icon.

getString

public java.lang.String getString(java.lang.String id,
                                  java.lang.String defaultValue)
Gets a string.

Parameters:
id - the id of the string.
defaultValue - the default value.
Returns:
the value of the string.

getString

public java.lang.String getString(java.lang.String id)
Gets a string.

Parameters:
id - the id of the string.
Returns:
the value of the string.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

Copyright © 1997, 2011, Oracle. All rights reserved.