artofillusion.ui
Class ThemeManager

java.lang.Object
  extended by artofillusion.ui.ThemeManager

public class ThemeManager
extends java.lang.Object

This class holds GUI customization information. Customization consists of various colors used in AoI GUI as well as the look and feel of some GUI elements (eg buttons). In this respect, the theme manager is thus a factory of GUI elements.

Author:
Fran¨ois Guillet

Nested Class Summary
static class ThemeManager.ButtonStyle
          nested ButtonStyle class.
static class ThemeManager.ColorSet
          This class hold all the colors used by a theme.
static class ThemeManager.ThemeInfo
          This class stores information about a theme.
 
Constructor Summary
ThemeManager()
           
 
Method Summary
static java.awt.Color getAppBackgroundColor()
          Returns the background color of the application (not to be mistaken for the view background)
static int getButtonMargin()
          Returns the button margin to use for tool palette display
static ThemeManager.ButtonStyle getButtonStyle(java.lang.Object owner)
          returns the ButtonStyle for the current Theme and the specified owner.
static ThemeManager.ThemeInfo getDefaultTheme()
          Get the default theme.
static java.awt.Color getDockableBarColor1()
          Returns the first color of the dockable widgets title bar gradient painting
static java.awt.Color getDockableBarColor2()
          Returns the second color of the dockable widgets title bar gradient painting
static java.awt.Color getDockableTitleColor()
          Returns the text color of the dockable widgets title bar text
static javax.swing.ImageIcon getIcon(java.lang.String iconName)
          Given an icon file name, this method returns the icon according to the currently selected theme.
static javax.swing.ImageIcon getNotFoundIcon(java.lang.Object owner)
          return the notFound icon most appropriate to the slected Theme and the specified owner.
static java.net.URL getNotFoundURL(java.lang.Object owner)
          return the URL for the "notFound" icon for the selected Theme and the style associated with the specified owner.
static java.awt.Color getPaletteBackgroundColor()
          Returns the tool palette background color
static int getPaletteMargin()
          Returns the palette margin to use for tool palette display
static ThemeManager.ColorSet getSelectedColorSet()
          Get the currently selected color set.
static ThemeManager.ThemeInfo getSelectedTheme()
          Get the currently selected theme.
static java.awt.Color getTextColor()
          Returns the color of the text to use for widgets.
static java.util.List getThemes()
          Get a list of all available themes.
static ToolButton getToolButton(java.lang.Object owner, java.lang.String iconName)
          Creates a ToolButton according to the current theme
static ToolButton getToolButton(java.lang.Object owner, java.lang.String iconName, java.lang.String selectedIconName)
          Deprecated. this method allows pre 2.7 plugins to continue to function. Such code should be ported to the new API as soon as possible.
static void initThemes()
          This is invoked during startup to initialize the list of installed themes.
static void setSelectedColorSet(ThemeManager.ColorSet colorSet)
          Set the currently selected color set.
static void setSelectedTheme(ThemeManager.ThemeInfo theme)
          Set the currently selected theme.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThemeManager

public ThemeManager()
Method Detail

getSelectedTheme

public static ThemeManager.ThemeInfo getSelectedTheme()
Get the currently selected theme.


setSelectedTheme

public static void setSelectedTheme(ThemeManager.ThemeInfo theme)
Set the currently selected theme.


getSelectedColorSet

public static ThemeManager.ColorSet getSelectedColorSet()
Get the currently selected color set.


setSelectedColorSet

public static void setSelectedColorSet(ThemeManager.ColorSet colorSet)
Set the currently selected color set.


getThemes

public static java.util.List getThemes()
Get a list of all available themes.


getDefaultTheme

public static ThemeManager.ThemeInfo getDefaultTheme()
Get the default theme.


getNotFoundURL

public static java.net.URL getNotFoundURL(java.lang.Object owner)
return the URL for the "notFound" icon for the selected Theme and the style associated with the specified owner.

Parameters:
owner - the owner of the button icon that could not be found.
Returns:
the URL of the matching notFound icon, or null if no matching icon were found.

getNotFoundIcon

public static javax.swing.ImageIcon getNotFoundIcon(java.lang.Object owner)
return the notFound icon most appropriate to the slected Theme and the specified owner.

Parameters:
owner - the owner of the button icon which could not be found.
Returns:
an ImageIcon of the notFound icon. The method never returns null.

getToolButton

public static ToolButton getToolButton(java.lang.Object owner,
                                       java.lang.String iconName,
                                       java.lang.String selectedIconName)
Deprecated. this method allows pre 2.7 plugins to continue to function. Such code should be ported to the new API as soon as possible.

compatibility method.


getToolButton

public static ToolButton getToolButton(java.lang.Object owner,
                                       java.lang.String iconName)
Creates a ToolButton according to the current theme

Parameters:
owner - The button owner
iconName - The name of the icon to display on the button, without extension
Returns:
the ToolButton generated according to the selected Theme.

getIcon

public static javax.swing.ImageIcon getIcon(java.lang.String iconName)
Given an icon file name, this method returns the icon according to the currently selected theme. If no such icon is available within the current theme, the icon is looked for in the default theme. This method will first look for a .gif file, then for a.png one.

Parameters:
iconName - The file name of the icon, without extension.
Returns:
the ImageIcon matching the name. If no such icon were found, then null is returned.

getAppBackgroundColor

public static java.awt.Color getAppBackgroundColor()
Returns the background color of the application (not to be mistaken for the view background)


getPaletteBackgroundColor

public static java.awt.Color getPaletteBackgroundColor()
Returns the tool palette background color


getDockableBarColor1

public static java.awt.Color getDockableBarColor1()
Returns the first color of the dockable widgets title bar gradient painting


getDockableBarColor2

public static java.awt.Color getDockableBarColor2()
Returns the second color of the dockable widgets title bar gradient painting


getDockableTitleColor

public static java.awt.Color getDockableTitleColor()
Returns the text color of the dockable widgets title bar text


getTextColor

public static java.awt.Color getTextColor()
Returns the color of the text to use for widgets. Can also be used as foreground color.


initThemes

public static void initThemes()
This is invoked during startup to initialize the list of installed themes.


getPaletteMargin

public static int getPaletteMargin()
Returns the palette margin to use for tool palette display


getButtonMargin

public static int getButtonMargin()
Returns the button margin to use for tool palette display


getButtonStyle

public static ThemeManager.ButtonStyle getButtonStyle(java.lang.Object owner)
returns the ButtonStyle for the current Theme and the specified owner.



Copyright © 1999-2011 by Peter Eastman.