tvbrowser.core.icontheme

## Class IconLoader

- java.lang.Object
- - tvbrowser.core.icontheme.IconLoader

-     public class IconLoader
      extends java.lang.Object

  The IconLoader manages the IconThemes and loads an Icon. If the Icon was not found the the current Icon-Theme it tries to load the Icon in the Default-IconTheme. IconThemes are Directories that are based on the Icon-Theme Specifications http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html The Icon-Names are based on the Freedesktop Icon Naming Spec: http://cvs.freedesktop.org/[*]checkout[*]/icon-theme/default-icon-theme/spec/icon-naming-spec.xml (please remove the [ ])

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `DOWNLOAD_SPEC_URL` The url of the download specs.
    `static java.io.File` | `USER_ICON_DIR` The icon dir of the current user.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `IconTheme[]` | `getAvailableThemes()` Return all available Themes
    `IconTheme` | `getDefaultTheme()`
    `javax.swing.ImageIcon` | `getIconFromTheme(Plugin plugin, java.lang.String category, java.lang.String icon, int size)` Load a specific Icon
    `javax.swing.ImageIcon` | `getIconFromTheme(Plugin plugin, ThemeIcon icon)` Load a specific Icon
    `javax.swing.ImageIcon` | `getIconFromTheme(java.lang.String category, java.lang.String icon)` Load a specific Icon in default size (16 pixels)
    `javax.swing.ImageIcon` | `getIconFromTheme(java.lang.String category, java.lang.String icon, int size)` Load a specific Icon
    `IconTheme` | `getIconTheme(java.io.File icon)` Creates the IconTheme
    `java.io.File` | `getIconThemeFile(java.lang.String theme)` Trys to find the Icon Theme File.
    `static IconLoader` | `getInstance()` Get an Instance of the IconLoader

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### USER_ICON_DIR

          public static final java.io.File USER_ICON_DIR

      The icon dir of the current user.

    - #### DOWNLOAD_SPEC_URL

          public static final java.lang.String DOWNLOAD_SPEC_URL

      The url of the download specs.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getIconThemeFile

          public java.io.File getIconThemeFile(java.lang.String theme)

      Trys to find the Icon Theme File. This method searches in the application directory, the user home and the Directory Library - Application Support - TV-Browser if used on a mac.
      Parameters:
        `theme` - name of the theme file
      Returns:
        best file that contains the theme. Attention! The file could not exist!
      Since:
        2.7.2

    - #### getAvailableThemes

          public IconTheme[] getAvailableThemes()

      Return all available Themes
      Returns:
        all available themes

    - #### getIconTheme

          public IconTheme getIconTheme(java.io.File icon)

      Creates the IconTheme
      Parameters:
        `icon` - Theme-Location
      Returns:
        IconTheme

    - #### getInstance

          public static IconLoader getInstance()

      Get an Instance of the IconLoader
      Returns:
        Instance

    - #### getIconFromTheme

          public javax.swing.ImageIcon getIconFromTheme(Plugin plugin,
                                               java.lang.String category,
                                               java.lang.String icon,
                                               int size)

      Load a specific Icon
      Parameters:
        `plugin` - Plugin that wants to use the Icon
        `category` - Category of the Icon
        `icon` - Name of the Icon without File-Extension
        `size` - Size in Pixel
      Returns:
        Icon if found, null if no Icon was found

    - #### getIconFromTheme

          public javax.swing.ImageIcon getIconFromTheme(java.lang.String category,
                                               java.lang.String icon,
                                               int size)

      Load a specific Icon
      Parameters:
        `category` - Category of the Icon
        `icon` - Name of the Icon without File-Extension
        `size` - Size in Pixel
      Returns:
        Icon if found, null if no Icon was found

    - #### getIconFromTheme

          public javax.swing.ImageIcon getIconFromTheme(java.lang.String category,
                                               java.lang.String icon)

      Load a specific Icon in default size (16 pixels)
      Parameters:
        `category` - Category of the Icon
        `icon` - Name of the Icon without File-Extension
      Returns:
        Icon if found, null if no Icon was found

    - #### getIconFromTheme

          public javax.swing.ImageIcon getIconFromTheme(Plugin plugin,
                                               ThemeIcon icon)

      Load a specific Icon
      Parameters:
        `plugin` - Plugin that wants to use the Icon
        `icon` - Icon that should be loaded
      Returns:
        Icon if found, null if no Icon was found

    - #### getDefaultTheme

          public IconTheme getDefaultTheme()

      Returns:
        Default Icon Theme

TV-Browser 3.4.3, Copyright (C) 2004-2008 TV-Browser Team (dev@tvbrowser.org)