public final class ThemeProperties
extends java.lang.Object
Although this class is not final, it should not be subclassed by extension writers.
Modifier and Type | Method and Description |
---|---|
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.
|
public javax.swing.border.Border getBorder(java.lang.String id)
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
id
- the id of the borderBorder
object. Will not return null, but
may return an empty border.public java.awt.Font getFont(java.awt.Font base, java.lang.String id)
base
- the base font. Must not be null.id
- the id to look up.public java.awt.Color getColor(java.lang.String id)
public double getDouble(java.lang.String id)
id
- the id of the double value.public int getInt(java.lang.String id)
id
- the id of the integer value.public java.awt.Insets getInsets(java.lang.String id)
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.id
- the id of the property to read.public Painter getPainter(java.lang.String id)
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.
id
- the id of the painter.public javax.swing.Icon getIcon(java.lang.String id)
id
- the id of the icon.public java.lang.String getString(java.lang.String id, java.lang.String defaultValue)
id
- the id of the string.defaultValue
- the default value.public java.lang.String getString(java.lang.String id)
id
- the id of the string.