|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.util.SkinManager
Sets up a custom Look & Feel for the application.
Method Summary | |
static void |
addSkinsDirectory(java.lang.String path)
Adds a directory for looking for themes. |
static void |
addUpdateComponent(java.awt.Component c)
Adds a component to be updated when we revalidate. |
static java.util.Vector |
getAvailableSkins()
Returns a list of available skins by searching the default skins directory, plus user-specified directories. |
static java.lang.String |
getClassFromDisplayName(java.lang.String display)
Returns the fully qualified java classname for a LookAndFeel implementation, given its display name. |
static java.lang.String |
getCurrentLookAndFeel()
Returns the display name of the look & feel (LookAndFeel or SkinLookAndFeel theme pack) that we're running. |
static java.lang.String |
getDisplayName(java.lang.String path)
Returns the display name for a theme or LookAndFeel class. |
static java.lang.String |
getThemeDisplayName(java.lang.String path)
Returns a user-visible name for a theme. |
static void |
initLookAndFeel()
Tries to set a custom Swing look & feel, based on the configuration settings passed to setProperties(). |
static java.lang.String |
processJAR(java.lang.String entry)
Looks up info about one of our JAR LAF files in mapedit.ini or client.ini. |
static void |
removeAllUpdateComponents()
Removes the entire list of update components. |
static void |
removeUpdateComponent(java.awt.Component c)
Removes a component that's not needed to be updated anymore. |
static void |
revalidateUI()
Revalidates the tree, forcing everything to switch to the new UI. |
static void |
setPlatformDefaultLookAndFeel()
Attempts to set the default, system-specific look and feel for the current platform. |
static void |
setProperties(java.util.Properties props)
Sets the configuration properties for the SkinManager. |
static boolean |
switchLookAndFeel(java.lang.String path)
Switches to either a LookAndFeel or a SkinLookAndFeel + theme. |
static boolean |
switchTheme(java.lang.String path)
Loads and uses the specified SkinLookAndFeel theme pack. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void setProperties(java.util.Properties props)
The configuration for this class is data-driven from properties in .ini files - for now, just client.ini and mapedit.ini. The application can pass in a Properties object to this method. The SkinManager looks at the following properties, in this order:
props
- a Properties file containing any of the
properties listed abovepublic static void addSkinsDirectory(java.lang.String path)
path
- a directory to add to the search pathpublic static void addUpdateComponent(java.awt.Component c)
public static void removeUpdateComponent(java.awt.Component c)
public static void removeAllUpdateComponents()
public static void initLookAndFeel()
public static java.util.Vector getAvailableSkins()
public static boolean switchLookAndFeel(java.lang.String path)
path
- any of the following:
public static boolean switchTheme(java.lang.String path)
path
- the resource-path to the theme pack, such
as "/wyvern/skins/aquathemepack.zip".
public static void revalidateUI()
public static void setPlatformDefaultLookAndFeel()
public static java.lang.String getDisplayName(java.lang.String path)
You can set two types of names in the config properties:
public static java.lang.String getThemeDisplayName(java.lang.String path)
path
- the resource path for a theme, for Wyvern.loadResource()
public static java.lang.String getClassFromDisplayName(java.lang.String display)
public static java.lang.String processJAR(java.lang.String entry)
entry
- the ini-file entry: public static java.lang.String getCurrentLookAndFeel()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |