Class SkinLookAndFeel

  • All Implemented Interfaces:
    java.io.Serializable
    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.19 $, $Date: 2006/07/22 10:04:33 $
    Author:
    $Author: l2fprod $
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String VERSION
      Deprecated.
      Will be soon replaced by version()
    • Constructor Summary

      Constructors 
      Constructor Description
      SkinLookAndFeel()
      Constructs a new SkinLookAndFeel
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static void checkRequiredVersion​(java.lang.String required)
      Description of the Method
      static java.lang.String date()  
      static void enable()
      Deprecated.
      no longer needed
      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 Skin getSkin()
      Return the current skin.
      boolean getSupportsWindowDecorations()  
      protected void initClassDefaults​(javax.swing.UIDefaults table)
      Description of the Method
      protected void initComponentDefaults​(javax.swing.UIDefaults table)
      Description of the Method
      void initialize()  
      protected void initSystemColorDefaults​(javax.swing.UIDefaults table)
      Description of the Method
      boolean isNativeLookAndFeel()
      Gets the NativeLookAndFeel attribute of the SkinLookAndFeel object
      boolean isSupportedLookAndFeel()
      Gets the SupportedLookAndFeel attribute of the SkinLookAndFeel object
      static Skin loadDefaultThemePack()
      Load the default theme pack.
      static Skin loadSkin​(java.lang.String filename)
      Load a skin from the given filename.
      static Skin loadSkin​(java.net.URL url)
      Load a skin from the given url.
      static Skin loadThemePack​(java.io.InputStream streamToPack)
      Load a Theme Pack from the given stream pointing to a themepack.
      static Skin loadThemePack​(java.lang.String filename)
      Load a Theme Pack from the given zip file.
      static Skin loadThemePack​(java.net.URL url)
      Load a Theme Pack from the given zip url.
      static Skin loadThemePackDefinition​(java.net.URL url)
      Load a Theme Pack from the given theme pack definition.
      static void setSkin​(Skin skin)
      Set the skin used by the Skin Look And Feel
      static java.lang.String version()
      Returns the Skin Look And Feel version
      • Methods 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • VERSION

        public static final java.lang.String VERSION
        Deprecated.
        Will be soon replaced by version()
        Description of the Field
    • Constructor Detail

      • SkinLookAndFeel

        public SkinLookAndFeel()
        Constructs a new SkinLookAndFeel
    • Method Detail

      • version

        public static java.lang.String version()
        Returns the Skin Look And Feel version
        Returns:
        the Skin Look And Feel version
      • date

        public static java.lang.String date()
      • getName

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

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

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

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

        public boolean getSupportsWindowDecorations()
        Overrides:
        getSupportsWindowDecorations in class javax.swing.LookAndFeel
      • isSupportedLookAndFeel

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

        protected void initClassDefaults​(javax.swing.UIDefaults table)
        Description of the Method
        Overrides:
        initClassDefaults in class javax.swing.plaf.basic.BasicLookAndFeel
        Parameters:
        table - Description of Parameter
      • initSystemColorDefaults

        protected void initSystemColorDefaults​(javax.swing.UIDefaults table)
        Description of the Method
        Overrides:
        initSystemColorDefaults in class javax.swing.plaf.basic.BasicLookAndFeel
        Parameters:
        table - Description of Parameter
      • initComponentDefaults

        protected void initComponentDefaults​(javax.swing.UIDefaults table)
        Description of the Method
        Overrides:
        initComponentDefaults in class javax.swing.plaf.basic.BasicLookAndFeel
        Parameters:
        table - Description of Parameter
      • initialize

        public void initialize()
        Overrides:
        initialize in class javax.swing.plaf.basic.BasicLookAndFeel
      • setSkin

        public static void setSkin​(Skin skin)
        Set the skin used by the Skin Look And Feel
        Parameters:
        skin - a skin
      • getSkin

        public static 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 using System.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"
        If after this lookup, no theme pack is found, an Error will be thrown.
        Returns:
        the current skin
      • enable

        public static void enable()
                           throws javax.swing.UnsupportedLookAndFeelException
        Deprecated.
        no longer needed
        Throws:
        javax.swing.UnsupportedLookAndFeelException
      • loadSkin

        public static 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 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 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 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 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
      • loadThemePack

        public static Skin loadThemePack​(java.io.InputStream streamToPack)
                                  throws java.lang.Exception
        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:
        java.lang.Exception
        See Also:
        ZipResourceLoader
      • loadThemePackDefinition

        public static 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