Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.port80.theme
Class ThemeManager  view ThemeManager download ThemeManager.java

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended bycom.port80.theme.ThemeManager
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class ThemeManager
extends org.xml.sax.helpers.DefaultHandler

Theme manager manage UI resources loading and caching. This class parse an config. file in XML format that defines resources for the theme.


Field Summary
(package private)  com.port80.util.Conf cf
           
private static java.lang.String CLASSNAME
           
(package private)  java.util.Map colorTable
           
protected  boolean DEBUG
           
(package private)  java.util.Map decorTable
           
(package private)  java.util.Map fontTable
           
(package private)  java.util.Map iconTable
           
private static java.lang.String NAME
           
protected static boolean NEVER
           
private static java.lang.String PACKAGENAME
           
private static java.lang.String RESOURCEDIR
           
private static java.lang.String tCf
           
(package private)  java.lang.String themeName
           
private static java.lang.String tKey
           
private static java.lang.String tMap
           
private static java.lang.String tValue
           
private static java.lang.String tVector
           
protected  boolean VERBOSE
           
 
Constructor Summary
ThemeManager()
           
ThemeManager(java.lang.String themename)
           
 
Method Summary
 java.lang.Object get(java.lang.String name)
           
 java.awt.Color getColor(java.lang.String name)
           
 java.util.Set getColorNames()
           
 java.awt.Font getFont(java.lang.String name)
           
 java.util.Set getFontNames()
           
 javax.swing.ImageIcon getIcon(java.lang.String name)
           
 java.util.Set getIconNames()
           
 int getint(java.lang.String name, int def)
           
 java.lang.String getString(java.lang.String name)
           
private  void loadColors()
           
private  void loadFonts()
           
private  void loadIcons()
           
static void main(java.lang.String[] args)
           
 java.awt.Color setColor(java.lang.String name, java.awt.Color color)
           
 java.awt.Font setFont(java.lang.String name, java.awt.Font font)
           
 javax.swing.ImageIcon setIcon(java.lang.String name, javax.swing.ImageIcon icon)
           
 void test()
           
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PACKAGENAME

private static final java.lang.String PACKAGENAME
See Also:
Constant Field Values

NAME

private static final java.lang.String NAME
See Also:
Constant Field Values

CLASSNAME

private static final java.lang.String CLASSNAME
See Also:
Constant Field Values

RESOURCEDIR

private static final java.lang.String RESOURCEDIR
See Also:
Constant Field Values

tCf

private static final java.lang.String tCf
See Also:
Constant Field Values

tMap

private static final java.lang.String tMap
See Also:
Constant Field Values

tVector

private static final java.lang.String tVector
See Also:
Constant Field Values

tKey

private static final java.lang.String tKey
See Also:
Constant Field Values

tValue

private static final java.lang.String tValue
See Also:
Constant Field Values

NEVER

protected static final boolean NEVER
See Also:
Constant Field Values

DEBUG

protected boolean DEBUG

VERBOSE

protected boolean VERBOSE

themeName

java.lang.String themeName

cf

com.port80.util.Conf cf

colorTable

java.util.Map colorTable

fontTable

java.util.Map fontTable

iconTable

java.util.Map iconTable

decorTable

java.util.Map decorTable
Constructor Detail

ThemeManager

public ThemeManager()

ThemeManager

public ThemeManager(java.lang.String themename)
Method Detail

loadColors

private void loadColors()

loadFonts

private void loadFonts()

loadIcons

private void loadIcons()

get

public java.lang.Object get(java.lang.String name)

getint

public int getint(java.lang.String name,
                  int def)

getString

public java.lang.String getString(java.lang.String name)

getFont

public java.awt.Font getFont(java.lang.String name)

setFont

public java.awt.Font setFont(java.lang.String name,
                             java.awt.Font font)

getFontNames

public java.util.Set getFontNames()

getIcon

public javax.swing.ImageIcon getIcon(java.lang.String name)

setIcon

public javax.swing.ImageIcon setIcon(java.lang.String name,
                                     javax.swing.ImageIcon icon)

getIconNames

public java.util.Set getIconNames()

getColor

public java.awt.Color getColor(java.lang.String name)

setColor

public java.awt.Color setColor(java.lang.String name,
                               java.awt.Color color)

getColorNames

public java.util.Set getColorNames()

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception

test

public void test()