TV-Browser 2.7.5 API

tvbrowser.core.icontheme
Class IconTheme

java.lang.Object
  extended by tvbrowser.core.icontheme.IconTheme
Direct Known Subclasses:
DirectoryIconTheme, ZipIconTheme

public abstract class IconTheme
extends Object

This class implements the IconTheme-Loading Most of the Code is based on the FreeDesktop Specs http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html


Constructor Summary
IconTheme(File iconDir)
          Create the IconTheme The Directory must contain a index.theme-File.
 
Method Summary
protected abstract  boolean entryExists(String entry)
          Tests if an Entry exists in the Icon-Theme
 boolean equals(Object obj)
           
 File getBase()
          Get the Icon-Base.
 String getComment()
          Get the Comment of the Theme
 ImageIcon getIcon(ThemeIcon icon)
          Get an Icon from this Theme.
protected abstract  ImageIcon getImageFromTheme(String image)
          Get an Image from the Icon-Theme
protected abstract  InputStream getInputStream(String entry)
          Get an InputStream from the Icon-Theme.
 String getName()
          Get the Name of the Theme
 int hashCode()
           
 boolean loadTheme()
          Load the Theme-File
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IconTheme

public IconTheme(File iconDir)
Create the IconTheme The Directory must contain a index.theme-File. For Details please look into the Specs.

Parameters:
iconDir - Directory for this Theme
Method Detail

loadTheme

public boolean loadTheme()
Load the Theme-File

Returns:
true if successfull

getName

public String getName()
Get the Name of the Theme

Returns:
Name

getComment

public String getComment()
Get the Comment of the Theme

Returns:
Comment

getBase

public File getBase()
Get the Icon-Base. This can be a File or a Directory

Returns:
Icon-Base

getIcon

public ImageIcon getIcon(ThemeIcon icon)
Get an Icon from this Theme. This Method tries to find an exact size match, if it wasn't found it tries to find another Version of the Icon and rescales it.

Parameters:
icon - Icon that should be loaded
Returns:
Icon or Null if Icon was not found

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getInputStream

protected abstract InputStream getInputStream(String entry)
Get an InputStream from the Icon-Theme.

Parameters:
entry - File/Entry to load
Returns:
InputStream of specific Entry

entryExists

protected abstract boolean entryExists(String entry)
Tests if an Entry exists in the Icon-Theme

Parameters:
entry - check for this Entry
Returns:
True, if the Entry exists

getImageFromTheme

protected abstract ImageIcon getImageFromTheme(String image)
Get an Image from the Icon-Theme

Parameters:
image - get this Image
Returns:
Image

TV-Browser 2.7.5 API

TV-Browser 2.7.5, Copyright (C) 04-2003 Martin Oberhauser (martin@tvbrowser.org)