|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.townleyenterprises.swing.ThemeLoader
This class is similar to the ResourceLoader
, but it isn't
dealing with the same sort of information. For themes, arbitrary
properties files (with a '.theme' suffix) are used rather than
properties. These are also not localized, so the locale concept
doesn't apply in this case.
Constructor Summary | |
ThemeLoader(java.lang.Class cls,
java.lang.String name)
This constructor takes a class to use as the basis for finding the theme and the name. |
|
ThemeLoader(java.io.InputStream stream)
This constructor is used to load themes directly from the specified input stream. |
|
ThemeLoader(java.lang.Object obj,
java.lang.String theme)
The constructor takes an object to use as the basis for finding the theme and the name. |
|
ThemeLoader(ThemeLoader parent,
java.lang.Class cls,
java.lang.String name)
This constructor is used to support inheritance of themes. |
|
ThemeLoader(ThemeLoader parent,
java.io.InputStream stream)
This constructor is used to support inheritance from arbitrary input streams. |
Method Summary | |
java.awt.Color |
getColor(java.lang.String key)
This method is used to return theme colors. |
protected javax.swing.plaf.ColorUIResource |
getColorUIResource(java.lang.String key)
This is a utility method for loading color UI resources. |
java.awt.Font |
getFont(java.lang.String key)
This method is used to load a specific font from the theme. |
protected javax.swing.plaf.FontUIResource |
getFontUIResource(java.lang.String key)
This is a utility method for loading font UI resources. |
javax.swing.plaf.metal.MetalTheme |
getMetalTheme()
This method is used to return the appropriately initialized Metal look and feel theme based on the theme properties. |
java.lang.String |
getName()
Accessor for the theme name. |
java.lang.String |
getSetting(java.lang.String key)
This method is used to find a given theme setting. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ThemeLoader(java.lang.Object obj, java.lang.String theme)
obj
- the object to provide the base resource locationtheme
- the name of the theme to loadpublic ThemeLoader(java.lang.Class cls, java.lang.String name)
cls
- the class providing the base resource locationpublic ThemeLoader(ThemeLoader parent, java.lang.Class cls, java.lang.String name)
parent
- the parent theme loadercls
- the class providing the context for the themename
- the name of the theme to loadpublic ThemeLoader(java.io.InputStream stream)
stream
- the InputStreampublic ThemeLoader(ThemeLoader parent, java.io.InputStream stream)
parent
- the parent themestream
- the input streamMethod Detail |
public java.awt.Color getColor(java.lang.String key)
key
- the resource key
public java.awt.Font getFont(java.lang.String key)
public javax.swing.plaf.metal.MetalTheme getMetalTheme()
public java.lang.String getName()
public java.lang.String getSetting(java.lang.String key)
key
- the resource string key
protected javax.swing.plaf.ColorUIResource getColorUIResource(java.lang.String key)
key
- the name
protected javax.swing.plaf.FontUIResource getFontUIResource(java.lang.String key)
key
- the name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |