com.mucommander.ui.theme
Class Theme

java.lang.Object
  extended by com.mucommander.ui.theme.ThemeData
      extended by com.mucommander.ui.theme.Theme

public class Theme
extends ThemeData

Author:
Nicolas Rinaudo

Field Summary
static int CUSTOM_THEME
          Describes custom muCommander themes.
static int PREDEFINED_THEME
          Describes predefined muCommander themes.
static int USER_THEME
          Describes the user defined theme.
 
Fields inherited from class com.mucommander.ui.theme.ThemeData
ARCHIVE_FOREGROUND_COLOR, ARCHIVE_INACTIVE_FOREGROUND_COLOR, ARCHIVE_INACTIVE_SELECTED_FOREGROUND_COLOR, ARCHIVE_SELECTED_FOREGROUND_COLOR, COLOR_COUNT, EDITOR_BACKGROUND_COLOR, EDITOR_FONT, EDITOR_FOREGROUND_COLOR, EDITOR_SELECTED_BACKGROUND_COLOR, EDITOR_SELECTED_FOREGROUND_COLOR, FILE_FOREGROUND_COLOR, FILE_INACTIVE_FOREGROUND_COLOR, FILE_INACTIVE_SELECTED_FOREGROUND_COLOR, FILE_SELECTED_FOREGROUND_COLOR, FILE_TABLE_ALTERNATE_BACKGROUND_COLOR, FILE_TABLE_BACKGROUND_COLOR, FILE_TABLE_BORDER_COLOR, FILE_TABLE_FONT, FILE_TABLE_INACTIVE_ALTERNATE_BACKGROUND_COLOR, FILE_TABLE_INACTIVE_BACKGROUND_COLOR, FILE_TABLE_INACTIVE_BORDER_COLOR, FILE_TABLE_INACTIVE_SELECTED_BACKGROUND_COLOR, FILE_TABLE_INACTIVE_SELECTED_OUTLINE_COLOR, FILE_TABLE_INACTIVE_SELECTED_SECONDARY_BACKGROUND_COLOR, FILE_TABLE_SELECTED_BACKGROUND_COLOR, FILE_TABLE_SELECTED_OUTLINE_COLOR, FILE_TABLE_SELECTED_SECONDARY_BACKGROUND_COLOR, FILE_TABLE_UNMATCHED_BACKGROUND_COLOR, FILE_TABLE_UNMATCHED_FOREGROUND_COLOR, FOLDER_FOREGROUND_COLOR, FOLDER_INACTIVE_FOREGROUND_COLOR, FOLDER_INACTIVE_SELECTED_FOREGROUND_COLOR, FOLDER_SELECTED_FOREGROUND_COLOR, FONT_COUNT, HIDDEN_FILE_FOREGROUND_COLOR, HIDDEN_FILE_INACTIVE_FOREGROUND_COLOR, HIDDEN_FILE_INACTIVE_SELECTED_FOREGROUND_COLOR, HIDDEN_FILE_SELECTED_FOREGROUND_COLOR, LOCATION_BAR_BACKGROUND_COLOR, LOCATION_BAR_FONT, LOCATION_BAR_FOREGROUND_COLOR, LOCATION_BAR_PROGRESS_COLOR, LOCATION_BAR_SELECTED_BACKGROUND_COLOR, LOCATION_BAR_SELECTED_FOREGROUND_COLOR, MARKED_FOREGROUND_COLOR, MARKED_INACTIVE_FOREGROUND_COLOR, MARKED_INACTIVE_SELECTED_FOREGROUND_COLOR, MARKED_SELECTED_FOREGROUND_COLOR, QUICK_LIST_HEADER_BACKGROUND_COLOR, QUICK_LIST_HEADER_FONT, QUICK_LIST_HEADER_FOREGROUND_COLOR, QUICK_LIST_HEADER_SECONDARY_BACKGROUND_COLOR, QUICK_LIST_ITEM_BACKGROUND_COLOR, QUICK_LIST_ITEM_FONT, QUICK_LIST_ITEM_FOREGROUND_COLOR, QUICK_LIST_SELECTED_ITEM_BACKGROUND_COLOR, QUICK_LIST_SELECTED_ITEM_FOREGROUND_COLOR, SHELL_BACKGROUND_COLOR, SHELL_FONT, SHELL_FOREGROUND_COLOR, SHELL_HISTORY_BACKGROUND_COLOR, SHELL_HISTORY_FONT, SHELL_HISTORY_FOREGROUND_COLOR, SHELL_HISTORY_SELECTED_BACKGROUND_COLOR, SHELL_HISTORY_SELECTED_FOREGROUND_COLOR, SHELL_SELECTED_BACKGROUND_COLOR, SHELL_SELECTED_FOREGROUND_COLOR, STATUS_BAR_BACKGROUND_COLOR, STATUS_BAR_BORDER_COLOR, STATUS_BAR_CRITICAL_COLOR, STATUS_BAR_FONT, STATUS_BAR_FOREGROUND_COLOR, STATUS_BAR_OK_COLOR, STATUS_BAR_WARNING_COLOR, SYMLINK_FOREGROUND_COLOR, SYMLINK_INACTIVE_FOREGROUND_COLOR, SYMLINK_INACTIVE_SELECTED_FOREGROUND_COLOR, SYMLINK_SELECTED_FOREGROUND_COLOR
 
Method Summary
 boolean canModify()
          Checks whether this theme is modifiable.
 java.lang.String getName()
          Returns the theme's name.
 int getType()
          Returns the theme's type.
 boolean setColor(int id, java.awt.Color color)
          Sets one of the theme's colors.
 boolean setFont(int id, java.awt.Font font)
          Sets one of the theme's fonts.
 java.lang.String toString()
          Returns the theme's name.
 
Methods inherited from class com.mucommander.ui.theme.ThemeData
addDefaultValuesListener, cloneData, cloneData, getColor, getDefaultFont, getFont, importData, isColorDifferent, isColorDifferent, isColorSet, isFontDifferent, isFontDifferent, isFontSet, isIdentical, isIdentical, removeDefaultValuesListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

USER_THEME

public static final int USER_THEME
Describes the user defined theme.

See Also:
Constant Field Values

PREDEFINED_THEME

public static final int PREDEFINED_THEME
Describes predefined muCommander themes.

See Also:
Constant Field Values

CUSTOM_THEME

public static final int CUSTOM_THEME
Describes custom muCommander themes.

See Also:
Constant Field Values
Method Detail

canModify

public boolean canModify()
Checks whether this theme is modifiable.

A theme is modifiable if and only if it's the user theme. This is a utility method which produces exactly the same result as getType() == USER_THEME.

Returns:
true if the theme is modifiable, false otherwise.

getType

public int getType()
Returns the theme's type.

Returns:
the theme's type.

getName

public java.lang.String getName()
Returns the theme's name.

Returns:
the theme's name.

setFont

public boolean setFont(int id,
                       java.awt.Font font)
Sets one of the theme's fonts.

Note that this method will only work if the theme is the user one. Any other theme type will throw an exception.

Overrides:
setFont in class ThemeData
Parameters:
id - identifier of the font to set.
font - value for the specified font.
Returns:
true if the call actually changed the data, false otherwise.
Throws:
java.lang.IllegalStateException - thrown if the theme is not the user one.
See Also:
ThemeManager.setCurrentFont(int,Font)

setColor

public boolean setColor(int id,
                        java.awt.Color color)
Sets one of the theme's colors.

Note that this method will only work if the theme is the user one. Any other theme type will throw an exception.

Overrides:
setColor in class ThemeData
Parameters:
id - identifier of the color to set.
color - value for the specified color.
Returns:
true if the call actually changed the data, false otherwise.
Throws:
java.lang.IllegalStateException - thrown if the theme is not the user one.
See Also:
ThemeManager.setCurrentColor(int,Color)

toString

public java.lang.String toString()
Returns the theme's name.

Overrides:
toString in class java.lang.Object
Returns:
the theme's name.


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