com.mucommander.ui.theme
Class ThemeData

java.lang.Object
  extended by com.mucommander.ui.theme.ThemeData
Direct Known Subclasses:
Theme

public class ThemeData
extends java.lang.Object

Base class for all things Theme.

The role of ThemeData is twofold:
- theme data storage.
- default values retrievals and notification.

In the current version, theme data is solely composed of assorted colors and fonts. ThemeData offers methods to set, retrieve, compare and clone these values.

One of its major constraints is that it can never return null values for the items it contains. Whenever a specific value hasn't been set, ThemeData will seemlessly provide the rest of the world with default values retrieved from the current look&feel.

This default values system means that theme items can change outside of anybody's control: Swing UI properties can be updated, the current look&feel can be modified... ThemeData will track this changes and make sure that the proper event are dispatched to listeners.

In theory, classes that use the theme API should not need to worry about default value modifications. This is already managed internally, and if the change affects any of the themes being listened on, the event will be propagated to them. There might special cases where it's necessary, however, for which ThemeData provides a listening mechanism.

Author:
Nicolas Rinaudo
See Also:
Theme, ThemeManager, UIManager

Field Summary
static int ARCHIVE_FOREGROUND_COLOR
          Color used to paint archives text in the folder panels.
static int ARCHIVE_INACTIVE_FOREGROUND_COLOR
          Color used to paint archives text in the folder panels when they don't have the focus.
static int ARCHIVE_INACTIVE_SELECTED_FOREGROUND_COLOR
          Color used to paint selected archives text in the folder panels when they don't have the focus.
static int ARCHIVE_SELECTED_FOREGROUND_COLOR
          Color used to paint selected archives text in the folder panels.
static int COLOR_COUNT
          Number of known colors.
static int EDITOR_BACKGROUND_COLOR
          Color used to paint the file editor / viewer's background.
static int EDITOR_FONT
          Font used in the file editor and viewer.
static int EDITOR_FOREGROUND_COLOR
          Color used to paint the file editor / viewer's text.
static int EDITOR_SELECTED_BACKGROUND_COLOR
          Color used to paint the file editor / viewer's background when selected.
static int EDITOR_SELECTED_FOREGROUND_COLOR
          Color used to paint the file editor / viewer's foreground when selected.
static int FILE_FOREGROUND_COLOR
          Color used to paint plain files text in the folder panels.
static int FILE_INACTIVE_FOREGROUND_COLOR
          Color used to paint plain files text in the folder panels when they don't have the focus.
static int FILE_INACTIVE_SELECTED_FOREGROUND_COLOR
          Color used to paint selected plain files text in the folder panels when they don't have the focus.
static int FILE_SELECTED_FOREGROUND_COLOR
          Color used to paint selected plain files text in the folder panels.
static int FILE_TABLE_ALTERNATE_BACKGROUND_COLOR
          Color used to paint the folder panel's alternate background color.
static int FILE_TABLE_BACKGROUND_COLOR
          Color used to paint the folder panel's background color.
static int FILE_TABLE_BORDER_COLOR
          Color used to paint the folder panels' borders.
static int FILE_TABLE_FONT
          Font used in the folder panels.
static int FILE_TABLE_INACTIVE_ALTERNATE_BACKGROUND_COLOR
          Color used to paint the folder panel's alternate background color when inactive.
static int FILE_TABLE_INACTIVE_BACKGROUND_COLOR
          Color used to paint the folder panel's background color when it doesn't have the focus.
static int FILE_TABLE_INACTIVE_BORDER_COLOR
          Color used to paint the folder panels' borders when it doesn't have the focus.
static int FILE_TABLE_INACTIVE_SELECTED_BACKGROUND_COLOR
          Colors used to pain the file table's background color when in an inactive selected row.
static int FILE_TABLE_INACTIVE_SELECTED_OUTLINE_COLOR
          Color used to paint the outline of selected files in an inactive table.
static int FILE_TABLE_INACTIVE_SELECTED_SECONDARY_BACKGROUND_COLOR
          Color used to paint the gradient of the file table's selection when inactive.
static int FILE_TABLE_SELECTED_BACKGROUND_COLOR
          Color used to paint the file table's background color when in a selected row.
static int FILE_TABLE_SELECTED_OUTLINE_COLOR
          Color used to paint the outline of selected files.
static int FILE_TABLE_SELECTED_SECONDARY_BACKGROUND_COLOR
          Color used to paint the gradient of the file table's selection.
static int FILE_TABLE_UNMATCHED_BACKGROUND_COLOR
          Color used to paint the file table's background color when it's part of an unmatched file.
static int FILE_TABLE_UNMATCHED_FOREGROUND_COLOR
          Color used to paint the file table's foreground color when it's part of an unmatched file.
static int FOLDER_FOREGROUND_COLOR
          Color used to paint folders text in the folder panels.
static int FOLDER_INACTIVE_FOREGROUND_COLOR
          Color used to paint folders text in the folder panels when they don't have the focus.
static int FOLDER_INACTIVE_SELECTED_FOREGROUND_COLOR
          Color used to paint selected folders text in the folder panels when they don't have the focus.
static int FOLDER_SELECTED_FOREGROUND_COLOR
          Color used to paint selected folders text in the folder panels.
static int FONT_COUNT
          Number of known fonts.
static int HIDDEN_FILE_FOREGROUND_COLOR
          Color used to paint hidden files text in the folder panels.
static int HIDDEN_FILE_INACTIVE_FOREGROUND_COLOR
          Color used to paint hidden files text in the folder panels when they don't have the focus.
static int HIDDEN_FILE_INACTIVE_SELECTED_FOREGROUND_COLOR
          Color used to paint selected hidden files text in the folder panels when they don't have the focus.
static int HIDDEN_FILE_SELECTED_FOREGROUND_COLOR
          Color used to paint selected hidden files text in the folder panels.
static int LOCATION_BAR_BACKGROUND_COLOR
          Color used to paint the location's bar background.
static int LOCATION_BAR_FONT
          Font used in the location bar.
static int LOCATION_BAR_FOREGROUND_COLOR
          Color used to paint the location's bar text.
static int LOCATION_BAR_PROGRESS_COLOR
          Color used to paint the location's bar background when used as a progress bar.
static int LOCATION_BAR_SELECTED_BACKGROUND_COLOR
          Color used to paint the location's bar background when selected.
static int LOCATION_BAR_SELECTED_FOREGROUND_COLOR
          Color used to paint the location's bar text when selected.
static int MARKED_FOREGROUND_COLOR
          Color used to paint marked files text in the folder panels.
static int MARKED_INACTIVE_FOREGROUND_COLOR
          Color used to paint marked files text in the folder panels when they don't have the focus.
static int MARKED_INACTIVE_SELECTED_FOREGROUND_COLOR
          Color used to paint selected marked files text in the folder panels when they don't have the focus.
static int MARKED_SELECTED_FOREGROUND_COLOR
          Color used to paint selected marked files text in the folder panels.
static int QUICK_LIST_HEADER_BACKGROUND_COLOR
          Color used to paint the main background of a quick list header.
static int QUICK_LIST_HEADER_FONT
          Font used in the quick list header.
static int QUICK_LIST_HEADER_FOREGROUND_COLOR
          Color used to paint the text of a quick list header.
static int QUICK_LIST_HEADER_SECONDARY_BACKGROUND_COLOR
          Color used to paint the secondary background of a quick list header.
static int QUICK_LIST_ITEM_BACKGROUND_COLOR
          Color used to paint the background of a quick list item.
static int QUICK_LIST_ITEM_FONT
          Font used in the quick list item.
static int QUICK_LIST_ITEM_FOREGROUND_COLOR
          Color used to paint the text of a quick list item.
static int QUICK_LIST_SELECTED_ITEM_BACKGROUND_COLOR
          Color used to paint the background of a selected quick list item.
static int QUICK_LIST_SELECTED_ITEM_FOREGROUND_COLOR
          Color used to paint the text of a selected quick list item.
static int SHELL_BACKGROUND_COLOR
          Color used to paint the background of shell commands output.
static int SHELL_FONT
          Font used to display shell output.
static int SHELL_FOREGROUND_COLOR
          Color used to paint shell commands output.
static int SHELL_HISTORY_BACKGROUND_COLOR
          Color used to paint the shell history's background.
static int SHELL_HISTORY_FONT
          Font used in the shell history widget.
static int SHELL_HISTORY_FOREGROUND_COLOR
          Color used to paint the shell history's text.
static int SHELL_HISTORY_SELECTED_BACKGROUND_COLOR
          Color used to paint the shell history's background when selected.
static int SHELL_HISTORY_SELECTED_FOREGROUND_COLOR
          Color used to paint the shell history's text when selected.
static int SHELL_SELECTED_BACKGROUND_COLOR
          Color used to paint the background of shell commands output when selected.
static int SHELL_SELECTED_FOREGROUND_COLOR
          Color used to paint shell commands output when selected.
static int STATUS_BAR_BACKGROUND_COLOR
          Color used to paint the status bar's background
static int STATUS_BAR_BORDER_COLOR
          Color used to paint the status bar's border.
static int STATUS_BAR_CRITICAL_COLOR
          Color used to paint the status bar's drive usage color when there's dangerously little space left.
static int STATUS_BAR_FONT
          Font used in the status bar.
static int STATUS_BAR_FOREGROUND_COLOR
          Color used to paint the status bar's text.
static int STATUS_BAR_OK_COLOR
          Color used to paint the status bar's drive usage color when there's plenty of space left.
static int STATUS_BAR_WARNING_COLOR
          Color used to paint the status bar's drive usage color when there's an average amount of space left.
static int SYMLINK_FOREGROUND_COLOR
          Color used to paint symlinks text in the folder panels.
static int SYMLINK_INACTIVE_FOREGROUND_COLOR
          Color used to paint symlinks text in the folder panels when they don't have the focus.
static int SYMLINK_INACTIVE_SELECTED_FOREGROUND_COLOR
          Color used to paint selected symlinks text in the folder panels when they don't have the focus.
static int SYMLINK_SELECTED_FOREGROUND_COLOR
          Color used to paint selected symlinks text in the folder panels.
 
Constructor Summary
ThemeData()
          Creates an empty set of theme data.
 
Method Summary
static void addDefaultValuesListener(ThemeListener listener)
          Registers the specified theme listener.
 ThemeData cloneData()
          Clones the theme data without freezing default values.
 ThemeData cloneData(boolean freezeDefaults)
          Clones the current theme data.
 java.awt.Color getColor(int id)
          Returns the requested color.
static java.awt.Font getDefaultFont(int id)
          Returns the default value for the specified font.
 java.awt.Font getFont(int id)
          Returns the requested font.
 void importData(ThemeData data)
          Imports the specified data in the current one.
 boolean isColorDifferent(int id, java.awt.Color color)
          Checks whether the current color and the specified one are different from one another.
 boolean isColorDifferent(int id, java.awt.Color color, boolean ignoreDefaults)
          Checks whether the current color and the specified one are different from one another.
 boolean isColorSet(int id)
          Returns true if the specified color is set.
 boolean isFontDifferent(int id, java.awt.Font font)
          Checks whether the current font and the specified one are different from one another.
 boolean isFontDifferent(int id, java.awt.Font font, boolean ignoreDefaults)
          Checks whether the current font and the specified one are different from one another.
 boolean isFontSet(int id)
          Returns true if the specified font is set.
 boolean isIdentical(ThemeData data)
          Returns true if the current data is identical to the specified one, using default values when items haven't been set.
 boolean isIdentical(ThemeData data, boolean ignoreDefaults)
          Returns true if the specified data and the current one are identical.
static void removeDefaultValuesListener(ThemeListener listener)
          Removes the specified instance from the list of registered theme listeners.
 boolean setColor(int id, java.awt.Color color)
          Sets the specified color to the specified value.
 boolean setFont(int id, java.awt.Font font)
          Sets the specified font to the specified value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FONT_COUNT

public static final int FONT_COUNT
Number of known fonts.

Since font identifiers are contiguous, it is possible to explore all fonts contained by an instance of theme data by looping from 0 to FONT_COUNT.

See Also:
Constant Field Values

COLOR_COUNT

public static final int COLOR_COUNT
Number of known colors.

Since color identifiers are contiguous, it is possible to explore all colors contained by an instance of theme data by looping from 0 to COLOR_COUNT.

See Also:
Constant Field Values

FILE_TABLE_FONT

public static final int FILE_TABLE_FONT
Font used in the folder panels.

This defaults to the current JTable font.

See Also:
Constant Field Values

SHELL_FONT

public static final int SHELL_FONT
Font used to display shell output.

This defaults to the current JTextArea font.

See Also:
Constant Field Values

EDITOR_FONT

public static final int EDITOR_FONT
Font used in the file editor and viewer.

This defaults to the current JTable font.

See Also:
Constant Field Values

LOCATION_BAR_FONT

public static final int LOCATION_BAR_FONT
Font used in the location bar.

This defaults to the current JTextField font.

See Also:
Constant Field Values

SHELL_HISTORY_FONT

public static final int SHELL_HISTORY_FONT
Font used in the shell history widget.

This defaults to the current JTextField font.

See Also:
Constant Field Values

STATUS_BAR_FONT

public static final int STATUS_BAR_FONT
Font used in the status bar.

This defaults to the current JLabel font.

See Also:
Constant Field Values

QUICK_LIST_HEADER_FONT

public static final int QUICK_LIST_HEADER_FONT
Font used in the quick list header.

This defaults to a similar font of the current JTable font, but a little bigger.

See Also:
Constant Field Values

QUICK_LIST_ITEM_FONT

public static final int QUICK_LIST_ITEM_FONT
Font used in the quick list item.

This defaults to the current JTable font.

See Also:
Constant Field Values

FILE_TABLE_BORDER_COLOR

public static final int FILE_TABLE_BORDER_COLOR
Color used to paint the folder panels' borders.

This defaults to Color.GRAY.

See Also:
Constant Field Values

FILE_TABLE_INACTIVE_BORDER_COLOR

public static final int FILE_TABLE_INACTIVE_BORDER_COLOR
Color used to paint the folder panels' borders when it doesn't have the focus.

This defaults to Color.GRAY.

See Also:
Constant Field Values

FILE_TABLE_BACKGROUND_COLOR

public static final int FILE_TABLE_BACKGROUND_COLOR
Color used to paint the folder panel's background color.

This defaults to the current JTable background color.

See Also:
Constant Field Values

FILE_TABLE_ALTERNATE_BACKGROUND_COLOR

public static final int FILE_TABLE_ALTERNATE_BACKGROUND_COLOR
Color used to paint the folder panel's alternate background color.

This defaults to the current JTable background color.

See Also:
Constant Field Values

FILE_TABLE_INACTIVE_BACKGROUND_COLOR

public static final int FILE_TABLE_INACTIVE_BACKGROUND_COLOR
Color used to paint the folder panel's background color when it doesn't have the focus.

This behaves in exactly the same fashion as FILE_TABLE_BACKGROUND_COLOR, and defaults to the same value.

See Also:
Constant Field Values

FILE_TABLE_INACTIVE_ALTERNATE_BACKGROUND_COLOR

public static final int FILE_TABLE_INACTIVE_ALTERNATE_BACKGROUND_COLOR
Color used to paint the folder panel's alternate background color when inactive.

This defaults to the current JTable background color.

See Also:
Constant Field Values

FILE_TABLE_UNMATCHED_BACKGROUND_COLOR

public static final int FILE_TABLE_UNMATCHED_BACKGROUND_COLOR
Color used to paint the file table's background color when it's part of an unmatched file.

See Also:
Constant Field Values

FILE_TABLE_UNMATCHED_FOREGROUND_COLOR

public static final int FILE_TABLE_UNMATCHED_FOREGROUND_COLOR
Color used to paint the file table's foreground color when it's part of an unmatched file.

See Also:
Constant Field Values

FILE_TABLE_SELECTED_BACKGROUND_COLOR

public static final int FILE_TABLE_SELECTED_BACKGROUND_COLOR
Color used to paint the file table's background color when in a selected row.

See Also:
Constant Field Values

FILE_TABLE_SELECTED_SECONDARY_BACKGROUND_COLOR

public static final int FILE_TABLE_SELECTED_SECONDARY_BACKGROUND_COLOR
Color used to paint the gradient of the file table's selection.

See Also:
Constant Field Values

FILE_TABLE_INACTIVE_SELECTED_SECONDARY_BACKGROUND_COLOR

public static final int FILE_TABLE_INACTIVE_SELECTED_SECONDARY_BACKGROUND_COLOR
Color used to paint the gradient of the file table's selection when inactive.

See Also:
Constant Field Values

FILE_TABLE_INACTIVE_SELECTED_BACKGROUND_COLOR

public static final int FILE_TABLE_INACTIVE_SELECTED_BACKGROUND_COLOR
Colors used to pain the file table's background color when in an inactive selected row.

See Also:
Constant Field Values

HIDDEN_FILE_FOREGROUND_COLOR

public static final int HIDDEN_FILE_FOREGROUND_COLOR
Color used to paint hidden files text in the folder panels.

This defaults to the current JTable foreground color.

See Also:
Constant Field Values

HIDDEN_FILE_INACTIVE_FOREGROUND_COLOR

public static final int HIDDEN_FILE_INACTIVE_FOREGROUND_COLOR
Color used to paint hidden files text in the folder panels when they don't have the focus.

This behaves in exactly the same fashion as HIDDEN_FILE_FOREGROUND_COLOR, and defaults to the same value.

See Also:
Constant Field Values

HIDDEN_FILE_SELECTED_FOREGROUND_COLOR

public static final int HIDDEN_FILE_SELECTED_FOREGROUND_COLOR
Color used to paint selected hidden files text in the folder panels.

This defaults to the current JTable selection foreground color.

See Also:
Constant Field Values

HIDDEN_FILE_INACTIVE_SELECTED_FOREGROUND_COLOR

public static final int HIDDEN_FILE_INACTIVE_SELECTED_FOREGROUND_COLOR
Color used to paint selected hidden files text in the folder panels when they don't have the focus.

This behaves in exactly the same fashion as HIDDEN_FILE_SELECTED_FOREGROUND_COLOR, and defaults to the same value.

See Also:
Constant Field Values

FOLDER_FOREGROUND_COLOR

public static final int FOLDER_FOREGROUND_COLOR
Color used to paint folders text in the folder panels.

This defaults to the current JTable foreground color.

See Also:
Constant Field Values

FOLDER_INACTIVE_FOREGROUND_COLOR

public static final int FOLDER_INACTIVE_FOREGROUND_COLOR
Color used to paint folders text in the folder panels when they don't have the focus.

This behaves in exactly the same fashion as FOLDER_FOREGROUND_COLOR, and defaults to the same value.

See Also:
Constant Field Values

FOLDER_SELECTED_FOREGROUND_COLOR

public static final int FOLDER_SELECTED_FOREGROUND_COLOR
Color used to paint selected folders text in the folder panels.

This defaults to the current JTable selection foreground color.

See Also:
Constant Field Values

FOLDER_INACTIVE_SELECTED_FOREGROUND_COLOR

public static final int FOLDER_INACTIVE_SELECTED_FOREGROUND_COLOR
Color used to paint selected folders text in the folder panels when they don't have the focus.

This behaves in exactly the same fashion as FOLDER_SELECTED_FOREGROUND_COLOR, and defaults to the same value.

See Also:
Constant Field Values

ARCHIVE_FOREGROUND_COLOR

public static final int ARCHIVE_FOREGROUND_COLOR
Color used to paint archives text in the folder panels.

This defaults to the current JTable foreground color.

See Also:
Constant Field Values

ARCHIVE_INACTIVE_FOREGROUND_COLOR

public static final int ARCHIVE_INACTIVE_FOREGROUND_COLOR
Color used to paint archives text in the folder panels when they don't have the focus.

This behaves in exactly the same fashion as ARCHIVE_FOREGROUND_COLOR, and defaults to the same value.

See Also:
Constant Field Values

ARCHIVE_SELECTED_FOREGROUND_COLOR

public static final int ARCHIVE_SELECTED_FOREGROUND_COLOR
Color used to paint selected archives text in the folder panels.

This defaults to the current JTable selection foreground color.

See Also:
Constant Field Values

ARCHIVE_INACTIVE_SELECTED_FOREGROUND_COLOR

public static final int ARCHIVE_INACTIVE_SELECTED_FOREGROUND_COLOR
Color used to paint selected archives text in the folder panels when they don't have the focus.

This behaves in exactly the same fashion as ARCHIVE_SELECTED_FOREGROUND_COLOR, and defaults to the same value.

See Also:
Constant Field Values

SYMLINK_FOREGROUND_COLOR

public static final int SYMLINK_FOREGROUND_COLOR
Color used to paint symlinks text in the folder panels.

This defaults to the current JTable foreground color.

See Also:
Constant Field Values

SYMLINK_INACTIVE_FOREGROUND_COLOR

public static final int SYMLINK_INACTIVE_FOREGROUND_COLOR
Color used to paint symlinks text in the folder panels when they don't have the focus.

This behaves in exactly the same fashion as SYMLINK_FOREGROUND_COLOR, and defaults to the same value.

See Also:
Constant Field Values

SYMLINK_SELECTED_FOREGROUND_COLOR

public static final int SYMLINK_SELECTED_FOREGROUND_COLOR
Color used to paint selected symlinks text in the folder panels.

This defaults to the current JTable selection foreground color.

See Also:
Constant Field Values

SYMLINK_INACTIVE_SELECTED_FOREGROUND_COLOR

public static final int SYMLINK_INACTIVE_SELECTED_FOREGROUND_COLOR
Color used to paint selected symlinks text in the folder panels when they don't have the focus.

This behaves in exactly the same fashion as SYMLINK_SELECTED_FOREGROUND_COLOR, and defaults to the same value.

See Also:
Constant Field Values

MARKED_FOREGROUND_COLOR

public static final int MARKED_FOREGROUND_COLOR
Color used to paint marked files text in the folder panels.

This defaults to the current JTable foreground color.

See Also:
Constant Field Values

MARKED_INACTIVE_FOREGROUND_COLOR

public static final int MARKED_INACTIVE_FOREGROUND_COLOR
Color used to paint marked files text in the folder panels when they don't have the focus.

This behaves in exactly the same fashion as MARKED_FOREGROUND_COLOR, and defaults to the same value.

See Also:
Constant Field Values

MARKED_SELECTED_FOREGROUND_COLOR

public static final int MARKED_SELECTED_FOREGROUND_COLOR
Color used to paint selected marked files text in the folder panels.

This defaults to the current JTable selection foreground color.

See Also:
Constant Field Values

MARKED_INACTIVE_SELECTED_FOREGROUND_COLOR

public static final int MARKED_INACTIVE_SELECTED_FOREGROUND_COLOR
Color used to paint selected marked files text in the folder panels when they don't have the focus.

This behaves in exactly the same fashion as MARKED_SELECTED_FOREGROUND_COLOR, and defaults to the same value.

See Also:
Constant Field Values

FILE_FOREGROUND_COLOR

public static final int FILE_FOREGROUND_COLOR
Color used to paint plain files text in the folder panels.

This defaults to the current JTable foreground color.

See Also:
Constant Field Values

FILE_INACTIVE_FOREGROUND_COLOR

public static final int FILE_INACTIVE_FOREGROUND_COLOR
Color used to paint plain files text in the folder panels when they don't have the focus.

This behaves in exactly the same fashion as FILE_FOREGROUND_COLOR, and defaults to the same value.

See Also:
Constant Field Values

FILE_SELECTED_FOREGROUND_COLOR

public static final int FILE_SELECTED_FOREGROUND_COLOR
Color used to paint selected plain files text in the folder panels.

This defaults to the current JTable selection foreground color.

See Also:
Constant Field Values

FILE_INACTIVE_SELECTED_FOREGROUND_COLOR

public static final int FILE_INACTIVE_SELECTED_FOREGROUND_COLOR
Color used to paint selected plain files text in the folder panels when they don't have the focus.

This behaves in exactly the same fashion as FILE_SELECTED_FOREGROUND_COLOR, and defaults to the same value.

See Also:
Constant Field Values

SHELL_FOREGROUND_COLOR

public static final int SHELL_FOREGROUND_COLOR
Color used to paint shell commands output.

This defaults to the current JTextArea foreground color.

See Also:
Constant Field Values

SHELL_BACKGROUND_COLOR

public static final int SHELL_BACKGROUND_COLOR
Color used to paint the background of shell commands output.

This defaults to the current JTextArea background color.

See Also:
Constant Field Values

SHELL_SELECTED_FOREGROUND_COLOR

public static final int SHELL_SELECTED_FOREGROUND_COLOR
Color used to paint shell commands output when selected.

This defaults to the current JTextArea selection foreground color.

See Also:
Constant Field Values

SHELL_SELECTED_BACKGROUND_COLOR

public static final int SHELL_SELECTED_BACKGROUND_COLOR
Color used to paint the background of shell commands output when selected.

This defaults to the current JTextArea selection background color.

See Also:
Constant Field Values

SHELL_HISTORY_FOREGROUND_COLOR

public static final int SHELL_HISTORY_FOREGROUND_COLOR
Color used to paint the shell history's text.

This defaults to the current JTextField foreground color.

See Also:
Constant Field Values

SHELL_HISTORY_BACKGROUND_COLOR

public static final int SHELL_HISTORY_BACKGROUND_COLOR
Color used to paint the shell history's background.

This defaults to the current JTextField background color.

See Also:
Constant Field Values

SHELL_HISTORY_SELECTED_FOREGROUND_COLOR

public static final int SHELL_HISTORY_SELECTED_FOREGROUND_COLOR
Color used to paint the shell history's text when selected.

This defaults to the current JTextField selection foreground color.

See Also:
Constant Field Values

SHELL_HISTORY_SELECTED_BACKGROUND_COLOR

public static final int SHELL_HISTORY_SELECTED_BACKGROUND_COLOR
Color used to paint the shell history's background when selected.

This defaults to the current JTextField selection background color.

See Also:
Constant Field Values

EDITOR_FOREGROUND_COLOR

public static final int EDITOR_FOREGROUND_COLOR
Color used to paint the file editor / viewer's text.

This defaults to the current JTextArea foreground color.

See Also:
Constant Field Values

EDITOR_BACKGROUND_COLOR

public static final int EDITOR_BACKGROUND_COLOR
Color used to paint the file editor / viewer's background.

This defaults to the current JTextArea background color.

See Also:
Constant Field Values

EDITOR_SELECTED_FOREGROUND_COLOR

public static final int EDITOR_SELECTED_FOREGROUND_COLOR
Color used to paint the file editor / viewer's foreground when selected.

This defaults to the current JTextArea selection foreground color.

See Also:
Constant Field Values

EDITOR_SELECTED_BACKGROUND_COLOR

public static final int EDITOR_SELECTED_BACKGROUND_COLOR
Color used to paint the file editor / viewer's background when selected.

This defaults to the current JTextArea selection background color.

See Also:
Constant Field Values

LOCATION_BAR_FOREGROUND_COLOR

public static final int LOCATION_BAR_FOREGROUND_COLOR
Color used to paint the location's bar text.

This defaults to the current JTextField foreground color.

See Also:
Constant Field Values

LOCATION_BAR_BACKGROUND_COLOR

public static final int LOCATION_BAR_BACKGROUND_COLOR
Color used to paint the location's bar background.

This defaults to the current JTextField background color.

See Also:
Constant Field Values

LOCATION_BAR_SELECTED_FOREGROUND_COLOR

public static final int LOCATION_BAR_SELECTED_FOREGROUND_COLOR
Color used to paint the location's bar text when selected.

This defaults to the current JTextField selection foreground color.

See Also:
Constant Field Values

LOCATION_BAR_SELECTED_BACKGROUND_COLOR

public static final int LOCATION_BAR_SELECTED_BACKGROUND_COLOR
Color used to paint the location's bar background when selected.

This defaults to the current JTextField selection background color.

See Also:
Constant Field Values

LOCATION_BAR_PROGRESS_COLOR

public static final int LOCATION_BAR_PROGRESS_COLOR
Color used to paint the location's bar background when used as a progress bar.

Note that this color is painted over the location's bar background and foreground. In order for anything to be visible under it, it needs to have an alpha transparency component.

This defaults to the current JTextField selection background color, with an alpha transparency value of 64.

See Also:
Constant Field Values

STATUS_BAR_FOREGROUND_COLOR

public static final int STATUS_BAR_FOREGROUND_COLOR
Color used to paint the status bar's text.

This defaults to the current JLabel foreground color.

See Also:
Constant Field Values

STATUS_BAR_BACKGROUND_COLOR

public static final int STATUS_BAR_BACKGROUND_COLOR
Color used to paint the status bar's background

This defaults to the current JLabel background color.

See Also:
Constant Field Values

STATUS_BAR_BORDER_COLOR

public static final int STATUS_BAR_BORDER_COLOR
Color used to paint the status bar's border.

This defaults to Color.GRAY.

See Also:
Constant Field Values

STATUS_BAR_OK_COLOR

public static final int STATUS_BAR_OK_COLOR
Color used to paint the status bar's drive usage color when there's plenty of space left.

This defaults to 0x70EC2B.

See Also:
Constant Field Values

STATUS_BAR_WARNING_COLOR

public static final int STATUS_BAR_WARNING_COLOR
Color used to paint the status bar's drive usage color when there's an average amount of space left.

This defaults to 0xFF7F00.

See Also:
Constant Field Values

STATUS_BAR_CRITICAL_COLOR

public static final int STATUS_BAR_CRITICAL_COLOR
Color used to paint the status bar's drive usage color when there's dangerously little space left.

This defaults to Color.RED.

See Also:
Constant Field Values

FILE_TABLE_SELECTED_OUTLINE_COLOR

public static final int FILE_TABLE_SELECTED_OUTLINE_COLOR
Color used to paint the outline of selected files.

See Also:
Constant Field Values

FILE_TABLE_INACTIVE_SELECTED_OUTLINE_COLOR

public static final int FILE_TABLE_INACTIVE_SELECTED_OUTLINE_COLOR
Color used to paint the outline of selected files in an inactive table.

See Also:
Constant Field Values

QUICK_LIST_HEADER_BACKGROUND_COLOR

public static final int QUICK_LIST_HEADER_BACKGROUND_COLOR
Color used to paint the main background of a quick list header.

See Also:
Constant Field Values

QUICK_LIST_HEADER_SECONDARY_BACKGROUND_COLOR

public static final int QUICK_LIST_HEADER_SECONDARY_BACKGROUND_COLOR
Color used to paint the secondary background of a quick list header.

See Also:
Constant Field Values

QUICK_LIST_HEADER_FOREGROUND_COLOR

public static final int QUICK_LIST_HEADER_FOREGROUND_COLOR
Color used to paint the text of a quick list header.

See Also:
Constant Field Values

QUICK_LIST_ITEM_BACKGROUND_COLOR

public static final int QUICK_LIST_ITEM_BACKGROUND_COLOR
Color used to paint the background of a quick list item.

See Also:
Constant Field Values

QUICK_LIST_ITEM_FOREGROUND_COLOR

public static final int QUICK_LIST_ITEM_FOREGROUND_COLOR
Color used to paint the text of a quick list item.

See Also:
Constant Field Values

QUICK_LIST_SELECTED_ITEM_BACKGROUND_COLOR

public static final int QUICK_LIST_SELECTED_ITEM_BACKGROUND_COLOR
Color used to paint the background of a selected quick list item.

See Also:
Constant Field Values

QUICK_LIST_SELECTED_ITEM_FOREGROUND_COLOR

public static final int QUICK_LIST_SELECTED_ITEM_FOREGROUND_COLOR
Color used to paint the text of a selected quick list item.

See Also:
Constant Field Values
Constructor Detail

ThemeData

public ThemeData()
Creates an empty set of theme data.

ThemeData instances created that way will return default values for every single one of their items.

See Also:
cloneData()
Method Detail

cloneData

public ThemeData cloneData(boolean freezeDefaults)
Clones the current theme data.

This method allows callers to decide whether they want to freeze default values or not. Freezing a value means that it will be considered to have been set to the default value, and will not be updated when this default value changes.

Parameters:
freezeDefaults - whether or not to freeze the data's default values.
Returns:
a clone of the current theme data.
See Also:
cloneData()

cloneData

public ThemeData cloneData()
Clones the theme data without freezing default values.

This is a convenience method, and is exactly equivalent to calling cloneData(false).

Returns:
a clone of the current theme data.

importData

public void importData(ThemeData data)
Imports the specified data in the current one.

This method can be dangerous in that it overwrites every single value of the current data without hope of retrieval. Moreoever, if something were to go wrong during the operation and an exception was raised, the current data would find itself in an invalid state, where some of its values would have been updated but not all of them. It is up to callers to deal with these issues.

Values overwritting is done through the use of the current instance's setColor(int,Color) and setFont(int,Font) methods. This allows subclasses to plug their own code here. A good example of that is Theme, which will automatically trigger font and color events when importing data.

Parameters:
data - data to import.

setColor

public boolean setColor(int id,
                        java.awt.Color color)
Sets the specified color to the specified value.

Use a value of null to restore the color to it's default value.

This method will return false if it didn't actually change the theme data. This is checked through the use of isColorDifferent(id,color).

Note that even if the color is found to be identical, the previous value will be overwritten - this is a design choice, meant for these cases where developers need to work with home-made subclasses of Color.

Parameters:
id - identifier of the color to set.
color - value to which the color should be set.
Returns:
true if the call actually changed the data, false otherwise.

setFont

public boolean setFont(int id,
                       java.awt.Font font)
Sets the specified font to the specified value.

Use a value of null to restore the font to it's default value.

This method will return false if it didn't actually change the theme data. This is checked through the use of isFontDifferent(id, font).

Note that even if the font is found to be identical, the previous value will be overwritten - this is a design choice, meant for these cases where developers need to work with home-made subclasses of Font.

Parameters:
id - identifier of the font to set.
font - value to which the font should be set.
Returns:
true if the call actually changed the data, false otherwise.

getColor

public java.awt.Color getColor(int id)
Returns the requested color.

If the requested color wasn't set, its default value will be returned.

Parameters:
id - identifier of the color to retrieve.
Returns:
the requested color, or its default value if not set.
See Also:
getDefaultColor(int,ThemeData), isColorSet(int)

getFont

public java.awt.Font getFont(int id)
Returns the requested font.

If the requested font wasn't set, its default value will be returned.

Parameters:
id - identifier of the font to retrieve.
Returns:
the requested font, or its default value if not set.
See Also:
getDefaultFont(int), isFontSet(int)

isColorSet

public boolean isColorSet(int id)
Returns true if the specified color is set.

Parameters:
id - identifier of the color to check for.
Returns:
true if the specified color is set, false otherwise.
See Also:
getDefaultColor(int,ThemeData)

isFontSet

public boolean isFontSet(int id)
Returns true if the specified font is set.

Parameters:
id - identifier of the font to check for.
Returns:
true if the specified font is set, false otherwise.
See Also:
getDefaultFont(int)

getDefaultFont

public static java.awt.Font getDefaultFont(int id)
Returns the default value for the specified font.

Default values are look&feel dependant, and are subject to change during the application's life time.
Classes that need to monitor such changes can register themselves using addDefaultValuesListener(ThemeListener).

Parameters:
id - identifier of the font whose default value should be retrieved.
Returns:
the default value for the specified font.
See Also:
addDefaultValuesListener(ThemeListener)

isIdentical

public boolean isIdentical(ThemeData data,
                           boolean ignoreDefaults)
Returns true if the specified data and the current one are identical.

Comparisons is done by calling isFontDifferent(int,Font,boolean) and isColorDifferent(int,Color,boolean) on every font and color. Refer to the documentation of these methods for more information on using the ignoreDefaults parameter.

Parameters:
data - data against which to compare.
ignoreDefaults - whether or not to compare default values.
Returns:
true if the specified data and the current one are identical, false otherwise.
See Also:
isFontDifferent(int,Font,boolean), isColorDifferent(int,Color,boolean)

isIdentical

public boolean isIdentical(ThemeData data)
Returns true if the current data is identical to the specified one, using default values when items haven't been set.

This is a convenience method, and is strictly equivalent to calling isIdentical(data, false).

Parameters:
data - data against which to compare.
Returns:
true if the specified data and the current one are identical, false otherwise.

isFontDifferent

public boolean isFontDifferent(int id,
                               java.awt.Font font)
Checks whether the current font and the specified one are different from one another.

This is a convenience method, and is stricly equivalent to calling isFontDifferent(id, font, false).

Parameters:
id - identifier of the font to check.
font - font to check.
Returns:
true if font is different from the one defined in the data.
See Also:
isFontDifferent(int,Font,boolean), isColorDifferent(int,Color)

isFontDifferent

public boolean isFontDifferent(int id,
                               java.awt.Font font,
                               boolean ignoreDefaults)
Checks whether the current font and the specified one are different from one another.

Setting ignoreDefaults to false will compare both fonts from a 'user' point of view: comparison will be done on the values that are used by the rest of the application. It might however be necessary to consider fonts to be different if one is set but not the other. This can be achieved by setting ignoreDefaults to true.

Parameters:
id - identifier of the font to check.
font - font to check.
ignoreDefaults - whether or not to ignore defaults if the requested item doesn't have a value.
Returns:
true if font is different from the one defined in the data.
See Also:
isFontDifferent(int,Font), isColorDifferent(int,Color)

isColorDifferent

public boolean isColorDifferent(int id,
                                java.awt.Color color)
Checks whether the current color and the specified one are different from one another.

This is a convenience method, and is stricly equivalent to calling isColorDifferent(id, color, false).

Parameters:
id - identifier of the color to check.
color - color to check.
Returns:
true if color is different from the one defined in the data.
See Also:
isColorDifferent(int,Color,boolean), isFontDifferent(int,Font)

isColorDifferent

public boolean isColorDifferent(int id,
                                java.awt.Color color,
                                boolean ignoreDefaults)
Checks whether the current color and the specified one are different from one another.

Setting ignoreDefaults to false will compare both colors from a 'user' point of view: comparison will be done on the values that are used by the rest of the application. It might however be necessary to consider colors to be different if one is set but not the other. This can be achieved by setting ignoreDefaults to true.

Parameters:
id - identifier of the color to check.
color - color to check.
ignoreDefaults - whether or not to ignore defaults if the requested item doesn't have a value.
Returns:
true if color is different from the one defined in the data.
See Also:
isColorDifferent(int,Color), isFontDifferent(int,Font)

addDefaultValuesListener

public static void addDefaultValuesListener(ThemeListener listener)
Registers the specified theme listener.

The listener will receive font and color events whenever one of the default values has been changed, by a modification to the current look&feel for example.

It is not necessary for 'themable' components to listen to default values, as they are automatically propagated through Theme and ThemeManager.

Note that listeners are stored as weak references, to make sure that the API doesn't keep ghost copies of objects whose usefulness is long since past. This forces callers to make sure they keep a copy of the listener's instance: if they do not, the instance will be weakly linked and garbage collected out of existence.

Parameters:
listener - theme listener to register.
See Also:
removeDefaultValuesListener(ThemeListener)

removeDefaultValuesListener

public static void removeDefaultValuesListener(ThemeListener listener)
Removes the specified instance from the list of registered theme listeners.

Note that since listeners are stored as weak references, calling this method is not strictly necessary. As soon as a listener instance is not referenced anymore, it will automatically be caught and destroyed by the garbage collector.

Parameters:
listener - instance to remove from the list of registered theme listeners.
See Also:
addDefaultValuesListener(ThemeListener)


This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard