edu.iastate.metnet.ui
Class PropertiesMetalTheme

java.lang.Object
  extended by javax.swing.plaf.metal.MetalTheme
      extended by javax.swing.plaf.metal.DefaultMetalTheme
          extended by edu.iastate.metnet.ui.PropertiesMetalTheme

public class PropertiesMetalTheme
extends DefaultMetalTheme

This class allows you to load a theme from a file. It uses the standard Java Properties file format. To create a theme you provide a text file which contains tags corresponding to colors of the theme along with a value for that color. For example: name=My Ugly Theme primary1=255,0,0 primary2=0,255,0 primary3=0,0,255 This class only loads colors from the properties file, but it could easily be extended to load fonts - or even icons.

Version:
1.5 04/23/99
Author:
Steve Wilson

Field Summary
(package private) static org.apache.log4j.Logger logger
           
(package private) static java.util.ResourceBundle res
           
 
Constructor Summary
PropertiesMetalTheme(java.io.InputStream stream)
          pass an inputstream pointing to a properties file.
 
Method Summary
protected  javax.swing.plaf.ColorUIResource getBlack()
           
 java.lang.String getName()
          Returns the name of the theme.
protected  javax.swing.plaf.ColorUIResource getPrimary1()
          Returns the first primary color for this theme.
protected  javax.swing.plaf.ColorUIResource getPrimary2()
          Returns the second primary color for this theme.
protected  javax.swing.plaf.ColorUIResource getPrimary3()
          Returns the third primary color for this theme.
protected  javax.swing.plaf.ColorUIResource getSecondary1()
          Returns the first secondary color for this theme.
protected  javax.swing.plaf.ColorUIResource getSecondary2()
          Returns the second secondary color for this theme.
protected  javax.swing.plaf.ColorUIResource getSecondary3()
          Returns the third secondary color for this theme.
protected  javax.swing.plaf.ColorUIResource getWhite()
           
 
Methods inherited from class javax.swing.plaf.metal.DefaultMetalTheme
getControlTextFont, getMenuTextFont, getSubTextFont, getSystemTextFont, getUserTextFont, getWindowTitleFont
 
Methods inherited from class javax.swing.plaf.metal.MetalTheme
addCustomEntriesToTable, getAcceleratorForeground, getAcceleratorSelectedForeground, 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, 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

logger

static org.apache.log4j.Logger logger

res

static java.util.ResourceBundle res
Constructor Detail

PropertiesMetalTheme

public PropertiesMetalTheme(java.io.InputStream stream)
pass an inputstream pointing to a properties file. Colors will be initialized to be the same as the DefaultMetalTheme, and then any colors provided in the properties file will override that.

Method Detail

getName

public java.lang.String getName()
Description copied from class: DefaultMetalTheme
Returns the name of the theme.

Overrides:
getName in class DefaultMetalTheme
Returns:
"Steel".

getPrimary1

protected javax.swing.plaf.ColorUIResource getPrimary1()
Description copied from class: DefaultMetalTheme
Returns the first primary color for this theme.

Overrides:
getPrimary1 in class DefaultMetalTheme
Returns:
The first primary color.

getPrimary2

protected javax.swing.plaf.ColorUIResource getPrimary2()
Description copied from class: DefaultMetalTheme
Returns the second primary color for this theme.

Overrides:
getPrimary2 in class DefaultMetalTheme
Returns:
The second primary color.

getPrimary3

protected javax.swing.plaf.ColorUIResource getPrimary3()
Description copied from class: DefaultMetalTheme
Returns the third primary color for this theme.

Overrides:
getPrimary3 in class DefaultMetalTheme
Returns:
The third primary color.

getSecondary1

protected javax.swing.plaf.ColorUIResource getSecondary1()
Description copied from class: DefaultMetalTheme
Returns the first secondary color for this theme.

Overrides:
getSecondary1 in class DefaultMetalTheme
Returns:
The first secondary color.

getSecondary2

protected javax.swing.plaf.ColorUIResource getSecondary2()
Description copied from class: DefaultMetalTheme
Returns the second secondary color for this theme.

Overrides:
getSecondary2 in class DefaultMetalTheme
Returns:
The second secondary color.

getSecondary3

protected javax.swing.plaf.ColorUIResource getSecondary3()
Description copied from class: DefaultMetalTheme
Returns the third secondary color for this theme.

Overrides:
getSecondary3 in class DefaultMetalTheme
Returns:
The third secondary color.

getBlack

protected javax.swing.plaf.ColorUIResource getBlack()
Overrides:
getBlack in class javax.swing.plaf.metal.MetalTheme

getWhite

protected javax.swing.plaf.ColorUIResource getWhite()
Overrides:
getWhite in class javax.swing.plaf.metal.MetalTheme