org.jcreme.swing.plaf.metal
Class XMLMetalTheme

java.lang.Object
  extended byjavax.swing.plaf.metal.MetalTheme
      extended byjavax.swing.plaf.metal.DefaultMetalTheme
          extended byorg.jcreme.swing.plaf.metal.XMLMetalTheme

public class XMLMetalTheme
extends javax.swing.plaf.metal.DefaultMetalTheme

This class enables to provide a MetalTheme to an application from an XML file. The XML file must conform the metaltheme schema.

Version:
$Revision: 1.1 $
Author:
$Author: dbregeon $

Field Summary
protected  javax.swing.plaf.FontUIResource controlTextFont
          The control text font of the theme.
protected  javax.swing.plaf.FontUIResource menuTextFont
          The menu text font of the theme.
protected  java.lang.String name
          The name of the theme.
static java.lang.String PARAMETER_NAME
          The name associated to the XMLMetalTheme object in the stylesheet.
protected  javax.swing.plaf.ColorUIResource primary1
          The first primary color of the theme.
protected  javax.swing.plaf.ColorUIResource primary2
          The second primary color of the theme.
protected  javax.swing.plaf.ColorUIResource primary3
          The third primary color of the theme.
protected  javax.swing.plaf.ColorUIResource secondary1
          The first secondary color of the theme.
protected  javax.swing.plaf.ColorUIResource secondary2
          The second secondary color of the theme.
protected  javax.swing.plaf.ColorUIResource secondary3
          The third secondary color of the theme.
protected  javax.swing.plaf.FontUIResource subTextFont
          The sub text font of the theme.
protected  javax.swing.plaf.FontUIResource systemTextFont
          The system text font of the theme.
static java.lang.String TRANSFORMATION_FILE_NAME
          The name of the stylesheet to use.
protected static javax.xml.transform.Transformer transformer
          For efficiency purpose, the transformer is instantiated only once.
protected  javax.swing.plaf.FontUIResource userTextFont
          The user text font of the theme.
protected  javax.swing.plaf.FontUIResource windowTitleFont
          The window title font of the theme.
 
Fields inherited from class javax.swing.plaf.metal.MetalTheme
 
Constructor Summary
XMLMetalTheme(java.lang.String sourceFileName)
          Creates a new instance of XMLMetalTheme The object is created by transforming the provided file through the metaltheme stylesheet.
 
Method Summary
 javax.swing.plaf.FontUIResource getControlTextFont()
          Gives access to the control text font of the theme.
 javax.swing.plaf.FontUIResource getMenuTextFont()
          Gives access to the menu text font of the theme.
 java.lang.String getName()
          Gives access to the theme's name.
 javax.swing.plaf.ColorUIResource getPrimary1()
          Gives access to the first primary color of the theme.
 javax.swing.plaf.ColorUIResource getPrimary2()
          Gives access to the second primary color of the theme.
 javax.swing.plaf.ColorUIResource getPrimary3()
          Gives access to the third primary color of the theme.
 javax.swing.plaf.ColorUIResource getSecondary1()
          Gives access to the first secondary color of the theme.
 javax.swing.plaf.ColorUIResource getSecondary2()
          Gives access to the second secondary color of the theme.
 javax.swing.plaf.ColorUIResource getSecondary3()
          Gives access to the third secondary color of the theme.
 javax.swing.plaf.FontUIResource getSubTextFont()
          Gives access to the sub text font of the theme.
 javax.swing.plaf.FontUIResource getSystemTextFont()
          Gives access to the system text font of the theme.
 javax.swing.plaf.FontUIResource getUserTextFont()
          Gives access to the user text font of the theme.
 javax.swing.plaf.FontUIResource getWindowTitleFont()
          Gives access to the window title font of the theme.
 void setControlTextFont(java.lang.String font, int style, int size)
          This method enables to set the control text font.
 void setMenuTextFont(java.lang.String font, int style, int size)
          This method enables to set the menu text font.
 void setName(java.lang.String n)
          This method enables to give a name to the theme.
 void setPrimary1(int red, int green, int blue)
          This method enables to set the first primary color.
 void setPrimary2(int red, int green, int blue)
          This method enables to set the second primary color.
 void setPrimary3(int red, int green, int blue)
          This method enables to set the third primary color.
 void setSecondary1(int red, int green, int blue)
          This method enables to set the first secondary color.
 void setSecondary2(int red, int green, int blue)
          This method enables to set the second secondary color.
 void setSecondary3(int red, int green, int blue)
          This method enables to set the third secondary color.
 void setSubTextFont(java.lang.String font, int style, int size)
          This method enables to set the sub text font.
 void setSystemTextFont(java.lang.String font, int style, int size)
          This method enables to set the system text font.
 void setUserTextFont(java.lang.String font, int style, int size)
          This method enables to set the user text font.
 void setWindowTitleFont(java.lang.String font, int style, int size)
          This method enables to set the window title font.
 
Methods inherited from class javax.swing.plaf.metal.DefaultMetalTheme
 
Methods inherited from class javax.swing.plaf.metal.MetalTheme
addCustomEntriesToTable, getAcceleratorForeground, getAcceleratorSelectedForeground, getBlack, getControl, getControlDarkShadow, getControlDisabled, getControlHighlight, getControlInfo, getControlShadow, getControlTextColor, getDesktopColor, getFocusColor, getHighlightedTextColor, getInactiveControlTextColor, getInactiveSystemTextColor, getMenuBackground, getMenuDisabledForeground, getMenuForeground, getMenuSelectedBackground, getMenuSelectedForeground, getPrimaryControl, getPrimaryControlDarkShadow, getPrimaryControlHighlight, getPrimaryControlInfo, getPrimaryControlShadow, getSeparatorBackground, getSeparatorForeground, getSystemTextColor, getTextHighlightColor, getUserTextColor, getWhite, getWindowBackground, getWindowTitleBackground, getWindowTitleForeground, getWindowTitleInactiveBackground, getWindowTitleInactiveForeground
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRANSFORMATION_FILE_NAME

public static final java.lang.String TRANSFORMATION_FILE_NAME
The name of the stylesheet to use. The stylesheet will be retrieved from the classpath.

See Also:
Constant Field Values

PARAMETER_NAME

public static final java.lang.String PARAMETER_NAME
The name associated to the XMLMetalTheme object in the stylesheet.

See Also:
Constant Field Values

transformer

protected static javax.xml.transform.Transformer transformer
For efficiency purpose, the transformer is instantiated only once.


name

protected java.lang.String name
The name of the theme.


primary1

protected javax.swing.plaf.ColorUIResource primary1
The first primary color of the theme.


primary2

protected javax.swing.plaf.ColorUIResource primary2
The second primary color of the theme.


primary3

protected javax.swing.plaf.ColorUIResource primary3
The third primary color of the theme.


secondary1

protected javax.swing.plaf.ColorUIResource secondary1
The first secondary color of the theme.


secondary2

protected javax.swing.plaf.ColorUIResource secondary2
The second secondary color of the theme.


secondary3

protected javax.swing.plaf.ColorUIResource secondary3
The third secondary color of the theme.


controlTextFont

protected javax.swing.plaf.FontUIResource controlTextFont
The control text font of the theme.


menuTextFont

protected javax.swing.plaf.FontUIResource menuTextFont
The menu text font of the theme.


subTextFont

protected javax.swing.plaf.FontUIResource subTextFont
The sub text font of the theme.


systemTextFont

protected javax.swing.plaf.FontUIResource systemTextFont
The system text font of the theme.


userTextFont

protected javax.swing.plaf.FontUIResource userTextFont
The user text font of the theme.


windowTitleFont

protected javax.swing.plaf.FontUIResource windowTitleFont
The window title font of the theme.

Constructor Detail

XMLMetalTheme

public XMLMetalTheme(java.lang.String sourceFileName)
Creates a new instance of XMLMetalTheme The object is created by transforming the provided file through the metaltheme stylesheet.

Parameters:
sourceFileName - the name of the xml file containing the values for the theme. The file must conform the metaltheme schema. The file will be retrieved as a system property.
Method Detail

getName

public java.lang.String getName()
Gives access to the theme's name.

Returns:
the name given to the theme.

getPrimary1

public javax.swing.plaf.ColorUIResource getPrimary1()
Gives access to the first primary color of the theme.

Returns:
the first primary color of the theme.

getPrimary2

public javax.swing.plaf.ColorUIResource getPrimary2()
Gives access to the second primary color of the theme.

Returns:
the second primary color of the theme.

getPrimary3

public javax.swing.plaf.ColorUIResource getPrimary3()
Gives access to the third primary color of the theme.

Returns:
the third primary color of the theme.

getSecondary1

public javax.swing.plaf.ColorUIResource getSecondary1()
Gives access to the first secondary color of the theme.

Returns:
the first secondary color of the theme.

getSecondary2

public javax.swing.plaf.ColorUIResource getSecondary2()
Gives access to the second secondary color of the theme.

Returns:
the second secondary color of the theme.

getSecondary3

public javax.swing.plaf.ColorUIResource getSecondary3()
Gives access to the third secondary color of the theme.

Returns:
the third secondary color of the theme.

getControlTextFont

public javax.swing.plaf.FontUIResource getControlTextFont()
Gives access to the control text font of the theme.

Returns:
the control text font of the theme.

getMenuTextFont

public javax.swing.plaf.FontUIResource getMenuTextFont()
Gives access to the menu text font of the theme.

Returns:
the menu text font of the theme.

getSubTextFont

public javax.swing.plaf.FontUIResource getSubTextFont()
Gives access to the sub text font of the theme.

Returns:
the sub text font of the theme.

getSystemTextFont

public javax.swing.plaf.FontUIResource getSystemTextFont()
Gives access to the system text font of the theme.

Returns:
the system text font of the theme.

getUserTextFont

public javax.swing.plaf.FontUIResource getUserTextFont()
Gives access to the user text font of the theme.

Returns:
the user text font of the theme.

getWindowTitleFont

public javax.swing.plaf.FontUIResource getWindowTitleFont()
Gives access to the window title font of the theme.

Returns:
the window title font of the theme.

setName

public void setName(java.lang.String n)
This method enables to give a name to the theme.

Parameters:
n - the name.

setPrimary1

public void setPrimary1(int red,
                        int green,
                        int blue)
This method enables to set the first primary color.

Parameters:
red -
green -
blue -

setPrimary2

public void setPrimary2(int red,
                        int green,
                        int blue)
This method enables to set the second primary color.

Parameters:
red -
green -
blue -

setPrimary3

public void setPrimary3(int red,
                        int green,
                        int blue)
This method enables to set the third primary color.

Parameters:
red -
green -
blue -

setSecondary1

public void setSecondary1(int red,
                          int green,
                          int blue)
This method enables to set the first secondary color.

Parameters:
red -
green -
blue -

setSecondary2

public void setSecondary2(int red,
                          int green,
                          int blue)
This method enables to set the second secondary color.

Parameters:
red -
green -
blue -

setSecondary3

public void setSecondary3(int red,
                          int green,
                          int blue)
This method enables to set the third secondary color.

Parameters:
red -
green -
blue -

setControlTextFont

public void setControlTextFont(java.lang.String font,
                               int style,
                               int size)
This method enables to set the control text font.

Parameters:
font -
style -
size -

setMenuTextFont

public void setMenuTextFont(java.lang.String font,
                            int style,
                            int size)
This method enables to set the menu text font.

Parameters:
font -
style -
size -

setSubTextFont

public void setSubTextFont(java.lang.String font,
                           int style,
                           int size)
This method enables to set the sub text font.

Parameters:
font -
style -
size -

setSystemTextFont

public void setSystemTextFont(java.lang.String font,
                              int style,
                              int size)
This method enables to set the system text font.

Parameters:
font -
style -
size -

setUserTextFont

public void setUserTextFont(java.lang.String font,
                            int style,
                            int size)
This method enables to set the user text font.

Parameters:
font -
style -
size -

setWindowTitleFont

public void setWindowTitleFont(java.lang.String font,
                               int style,
                               int size)
This method enables to set the window title font.

Parameters:
font -
style -
size -


Copyright 2006 null. All Rights Reserved.