com.l2fprod.gui.plaf.skin
Class SkinLookAndFeel

java.lang.Object
  |
  +--javax.swing.LookAndFeel
        |
        +--javax.swing.plaf.basic.BasicLookAndFeel
              |
              +--com.l2fprod.gui.plaf.skin.SkinLookAndFeel
Direct Known Subclasses:
LinuxLookAndFeel

public class SkinLookAndFeel
extends javax.swing.plaf.basic.BasicLookAndFeel

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.

Version:
$Revision: 1.25 $, $Date: 2002/06/11 14:45:59 $
See Also:
Serialized Form

Field Summary
static java.lang.String VERSION
          Description of the Field
 
Constructor Summary
SkinLookAndFeel()
           
 
Method Summary
static void checkRequiredVersion(java.lang.String required)
          Description of the Method
static void enable()
          Set the look and feel to SkinLookAndFeel.
 java.lang.String getDescription()
          Gets the Description attribute of the SkinLookAndFeel object
 java.lang.String getID()
          Gets the ID attribute of the SkinLookAndFeel object
 java.lang.String getName()
          Gets the Name attribute of the SkinLookAndFeel object
static com.l2fprod.gui.plaf.skin.Skin getSkin()
          Return the current skin.
 boolean isNativeLookAndFeel()
          Gets the NativeLookAndFeel attribute of the SkinLookAndFeel object
 boolean isSupportedLookAndFeel()
          Gets the SupportedLookAndFeel attribute of the SkinLookAndFeel object
static com.l2fprod.gui.plaf.skin.Skin loadDefaultThemePack()
          Load the default theme pack.
Skin Look And Feel will look for the resource file named skinlf-themepack.xml in the user classpath (using SkinLookAndFeel.class.getResource("/skinlf-themepack.xml") ).
static com.l2fprod.gui.plaf.skin.Skin loadSkin(java.lang.String filename)
          Load a skin from the given filename.
SkinLF will use the filename to guess which theme to instanciate
static com.l2fprod.gui.plaf.skin.Skin loadSkin(java.net.URL url)
          Load a skin from the given url.
SkinLF will use the url filename to guess which theme to instanciate
static com.l2fprod.gui.plaf.skin.Skin loadThemePack(java.lang.String filename)
          Load a Theme Pack from the given zip file.
static com.l2fprod.gui.plaf.skin.Skin loadThemePack(java.net.URL url)
          Load a Theme Pack from the given zip url.
static com.l2fprod.gui.plaf.skin.Skin loadThemePackDefinition(java.net.URL url)
          Load a Theme Pack from the given theme pack definition.
static void setSkin(com.l2fprod.gui.plaf.skin.Skin skin)
          Set the skin used by the Skin Look And Feel
 
Methods inherited from class javax.swing.plaf.basic.BasicLookAndFeel
getDefaults
 
Methods inherited from class javax.swing.LookAndFeel
initialize, installBorder, installColors, installColorsAndFont, makeIcon, makeKeyBindings, toString, uninitialize, uninstallBorder
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VERSION

public static final java.lang.String VERSION
Description of the Field
Constructor Detail

SkinLookAndFeel

public SkinLookAndFeel()
Method Detail

getName

public java.lang.String getName()
Gets the Name attribute of the SkinLookAndFeel object
Overrides:
getName in class javax.swing.LookAndFeel
Returns:
The Name value

getDescription

public java.lang.String getDescription()
Gets the Description attribute of the SkinLookAndFeel object
Overrides:
getDescription in class javax.swing.LookAndFeel
Returns:
The Description value

getID

public java.lang.String getID()
Gets the ID attribute of the SkinLookAndFeel object
Overrides:
getID in class javax.swing.LookAndFeel
Returns:
The ID value

isNativeLookAndFeel

public boolean isNativeLookAndFeel()
Gets the NativeLookAndFeel attribute of the SkinLookAndFeel object
Overrides:
isNativeLookAndFeel in class javax.swing.LookAndFeel
Returns:
The NativeLookAndFeel value

isSupportedLookAndFeel

public boolean isSupportedLookAndFeel()
Gets the SupportedLookAndFeel attribute of the SkinLookAndFeel object
Overrides:
isSupportedLookAndFeel in class javax.swing.LookAndFeel
Returns:
The SupportedLookAndFeel value

setSkin

public static void setSkin(com.l2fprod.gui.plaf.skin.Skin skin)
Set the skin used by the Skin Look And Feel
Parameters:
skin - a skin

getSkin

public static com.l2fprod.gui.plaf.skin.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= , then the user theme pack located in /.skinlf/themepack.zip. If this theme pack is not found, an error will be thrown.
Returns:
the current skin

enable

public static void enable()
                   throws javax.swing.UnsupportedLookAndFeelException
Set the look and feel to SkinLookAndFeel. This method must be called to set the look and feel in applets or JavaWebStart enabled applications
Throws:
javax.swing.UnsupportedLookAndFeelException - if an error occurs

loadSkin

public static com.l2fprod.gui.plaf.skin.Skin loadSkin(java.lang.String filename)
                                               throws java.lang.Exception
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:
java.lang.Exception - Description of Exception

loadSkin

public static com.l2fprod.gui.plaf.skin.Skin loadSkin(java.net.URL url)
                                               throws java.lang.Exception
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:
java.lang.Exception - Description of Exception

loadDefaultThemePack

public static com.l2fprod.gui.plaf.skin.Skin loadDefaultThemePack()
                                                           throws java.lang.Exception
Load the default theme pack.
Skin Look And Feel will look for the resource file named skinlf-themepack.xml in the user classpath (using SkinLookAndFeel.class.getResource("/skinlf-themepack.xml") ).
Returns:
Description of the Returned Value
Throws:
java.lang.Exception - Description of Exception

loadThemePack

public static com.l2fprod.gui.plaf.skin.Skin loadThemePack(java.lang.String filename)
                                                    throws java.lang.Exception
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:
java.lang.Exception - Description of Exception

loadThemePack

public static com.l2fprod.gui.plaf.skin.Skin loadThemePack(java.net.URL url)
                                                    throws java.lang.Exception
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:
java.lang.Exception - Description of Exception
See Also:
ZipResourceLoader

loadThemePackDefinition

public static com.l2fprod.gui.plaf.skin.Skin loadThemePackDefinition(java.net.URL url)
                                                              throws java.lang.Exception
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:
java.lang.Exception - Description of Exception

checkRequiredVersion

public static void checkRequiredVersion(java.lang.String required)
                                 throws java.lang.Exception
Description of the Method
Parameters:
required - Description of Parameter
Throws:
java.lang.Exception - Description of Exception


Copyright © 2000-2002 L2FProd.com. All Rights Reserved.