Package com.l2fprod.gui.plaf.skin
Class SkinLookAndFeel
java.lang.Object
javax.swing.LookAndFeel
javax.swing.plaf.basic.BasicLookAndFeel
com.l2fprod.gui.plaf.skin.SkinLookAndFeel
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
LinuxLookAndFeel
Skin Look And Feel Main Class.
Use this class to set the current skin or to load skins.
See L2FProd.com website for the complete description of a theme pack.
Use this class to set the current skin or to load skins.
See L2FProd.com website for the complete description of a theme pack.
- Version:
- $Revision: 1.19 $, $Date: 2006/07/22 10:04:33 $
- Author:
- $Author: l2fprod $
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkRequiredVersion
(String required) Description of the Methodstatic String
date()
static void
enable()
Deprecated.no longer neededGets the Description attribute of the SkinLookAndFeel objectgetID()
Gets the ID attribute of the SkinLookAndFeel objectgetName()
Gets the Name attribute of the SkinLookAndFeel objectstatic Skin
getSkin()
Return the current skin.boolean
protected void
initClassDefaults
(UIDefaults table) Description of the Methodprotected void
initComponentDefaults
(UIDefaults table) Description of the Methodvoid
protected void
Description of the Methodboolean
Gets the NativeLookAndFeel attribute of the SkinLookAndFeel objectboolean
Gets the SupportedLookAndFeel attribute of the SkinLookAndFeel objectstatic Skin
Load the default theme pack.static Skin
Load a skin from the given filename.static Skin
Load a skin from the given url.static Skin
loadThemePack
(InputStream streamToPack) Load a Theme Pack from the given stream pointing to a themepack.static Skin
loadThemePack
(String filename) Load a Theme Pack from the given zip file.static Skin
loadThemePack
(URL url) Load a Theme Pack from the given zip url.static Skin
Load a Theme Pack from the given theme pack definition.static void
Set the skin used by the Skin Look And Feelstatic String
version()
Returns the Skin Look And Feel versionMethods inherited from class javax.swing.plaf.basic.BasicLookAndFeel
createAudioAction, getAudioActionMap, getDefaults, loadSystemColors, playSound, uninitialize
Methods inherited from class javax.swing.LookAndFeel
getDesktopPropertyValue, getDisabledIcon, getDisabledSelectedIcon, getLayoutStyle, installBorder, installColors, installColorsAndFont, installProperty, loadKeyBindings, makeComponentInputMap, makeIcon, makeInputMap, makeKeyBindings, provideErrorFeedback, toString, uninstallBorder
-
Field Details
-
VERSION
Deprecated.Will be soon replaced byversion()
Description of the Field
-
-
Constructor Details
-
SkinLookAndFeel
public SkinLookAndFeel()Constructs a new SkinLookAndFeel
-
-
Method Details
-
version
Returns the Skin Look And Feel version- Returns:
- the Skin Look And Feel version
-
date
-
getName
Gets the Name attribute of the SkinLookAndFeel object- Specified by:
getName
in classLookAndFeel
- Returns:
- The Name value
-
getDescription
Gets the Description attribute of the SkinLookAndFeel object- Specified by:
getDescription
in classLookAndFeel
- Returns:
- The Description value
-
getID
Gets the ID attribute of the SkinLookAndFeel object- Specified by:
getID
in classLookAndFeel
- Returns:
- The ID value
-
isNativeLookAndFeel
public boolean isNativeLookAndFeel()Gets the NativeLookAndFeel attribute of the SkinLookAndFeel object- Specified by:
isNativeLookAndFeel
in classLookAndFeel
- Returns:
- The NativeLookAndFeel value
-
getSupportsWindowDecorations
public boolean getSupportsWindowDecorations()- Overrides:
getSupportsWindowDecorations
in classLookAndFeel
-
isSupportedLookAndFeel
public boolean isSupportedLookAndFeel()Gets the SupportedLookAndFeel attribute of the SkinLookAndFeel object- Specified by:
isSupportedLookAndFeel
in classLookAndFeel
- Returns:
- The SupportedLookAndFeel value
-
initClassDefaults
Description of the Method- Overrides:
initClassDefaults
in classBasicLookAndFeel
- Parameters:
table
- Description of Parameter
-
initSystemColorDefaults
Description of the Method- Overrides:
initSystemColorDefaults
in classBasicLookAndFeel
- Parameters:
table
- Description of Parameter
-
initComponentDefaults
Description of the Method- Overrides:
initComponentDefaults
in classBasicLookAndFeel
- Parameters:
table
- Description of Parameter
-
initialize
public void initialize()- Overrides:
initialize
in classBasicLookAndFeel
-
setSkin
Set the skin used by the Skin Look And Feel- Parameters:
skin
- a skin
-
getSkin
Return the current skin.
If the current skin has not yet been set, Skin Look And Feel will attempt to load a themepack:- from the property skinlf.themepack (set on the command line using
-Dskinlf.themepack= path-to-themepack
or usingSystem.getProperties().put("skinlf.themepack", path)
- from the user theme pack located in <user.home>/.skinlf/themepack.zip.
- from the user theme pack located in <user.home>/.skinlf/themepack.zip
- from the classloader used to load the SkinLookAndFeel class, looking for "/themepack.zip"
- Returns:
- the current skin
- from the property skinlf.themepack (set on the command line using
-
enable
Deprecated.no longer needed- Throws:
UnsupportedLookAndFeelException
-
loadSkin
Load a skin from the given filename.
SkinLF will use the filename to guess which theme to instanciate- Parameters:
filename
- the given filename- Returns:
- Description of the Returned Value
- Throws:
Exception
- Description of Exception
-
loadSkin
Load a skin from the given url.
SkinLF will use the url filename to guess which theme to instanciate- Parameters:
url
- Description of Parameter- Returns:
- Description of the Returned Value
- Throws:
Exception
- Description of Exception
-
loadDefaultThemePack
Load the default theme pack.
Skin Look And Feel will look for the resource file namedskinlf-themepack.xml
in the user classpath (usingSkinLookAndFeel.class.getResource("/skinlf-themepack.xml")
).- Returns:
- Description of the Returned Value
- Throws:
Exception
- Description of Exception
-
loadThemePack
Load a Theme Pack from the given zip file.
See L2FProd.com website for the complete description of a theme pack.- Parameters:
filename
- the theme pack filename- Returns:
- Description of the Returned Value
- Throws:
Exception
- Description of Exception
-
loadThemePack
Load a Theme Pack from the given zip url.
See L2FProd.com website for the complete description of a theme pack.- Parameters:
url
- the theme pack url- Returns:
- Description of the Returned Value
- Throws:
Exception
- Description of Exception- See Also:
-
loadThemePack
Load a Theme Pack from the given stream pointing to a themepack.
See L2FProd.com website for the complete description of a theme pack.- Parameters:
streamToPack
- stream to the themepack- Throws:
Exception
- See Also:
-
loadThemePackDefinition
Load a Theme Pack from the given theme pack definition.
URLs in the definition must be relative- Parameters:
url
- the theme pack definition url- Returns:
- Description of the Returned Value
- Throws:
Exception
- Description of Exception
-
checkRequiredVersion
Description of the Method- Parameters:
required
- Description of Parameter- Throws:
IncorrectVersionException
-
version()