|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pivot.wtk.Theme
public abstract class Theme
Base class for Pivot themes. A theme defines a complete "look and feel" for a Pivot application.
Note that concrete Theme implementations should be declared as final. If multiple third-party libraries attempted to extend a theme, it would cause a conflict, as only one could be used in any given application.
IMPORTANT All skin mappings must be added to the map, even non-static inner classes. Otherwise, the component's base class will attempt to install its own skin, which will result in the addition of duplicate listeners.
Field Summary | |
---|---|
static String |
BOLD_KEY
|
protected HashMap<Class<? extends Component>,Class<? extends Skin>> |
componentSkinMap
|
static String |
ITALIC_KEY
|
static String |
NAME_KEY
|
static String |
PROVIDER_NAME
The service provider name (see Service.getProvider(String) ). |
static String |
SIZE_KEY
|
Constructor Summary | |
---|---|
Theme()
|
Method Summary | |
---|---|
static Font |
deriveFont(Dictionary<String,?> dictionary)
Produce a font by describing it relative to the current theme's font |
Class<? extends Skin> |
get(Class<? extends Component> componentClass)
Returns the skin class responsible for skinning the specified component class. |
abstract Font |
getFont()
|
Class<? extends Skin> |
getSkinClass(Class<? extends Component> componentClass)
|
static Theme |
getTheme()
Gets the current theme, as determined by the theme provider. |
void |
set(Class<? extends Component> componentClass,
Class<? extends Skin> skinClass)
Sets the skin class responsible for skinning the specified component class. |
abstract void |
setFont(Font font)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected HashMap<Class<? extends Component>,Class<? extends Skin>> componentSkinMap
public static final String NAME_KEY
public static final String SIZE_KEY
public static final String BOLD_KEY
public static final String ITALIC_KEY
public static final String PROVIDER_NAME
Service.getProvider(String)
).
Constructor Detail |
---|
public Theme()
Method Detail |
---|
public final Class<? extends Skin> getSkinClass(Class<? extends Component> componentClass)
public abstract Font getFont()
public abstract void setFont(Font font)
public Class<? extends Skin> get(Class<? extends Component> componentClass)
componentClass
- The component class.
public void set(Class<? extends Component> componentClass, Class<? extends Skin> skinClass)
componentClass
- The component class.skinClass
- The skin class.public static Theme getTheme()
IllegalStateException
- If a theme has not been installed.public static Font deriveFont(Dictionary<String,?> dictionary)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |