org.jbudget.gui
Class GuiPreferences

java.lang.Object
  extended by org.jbudget.gui.GuiPreferences

public class GuiPreferences
extends java.lang.Object

A class that contains the list of all preferences related to gui functions.

Author:
petrov

Field Summary
static java.lang.String budgetAllocationDef
           
static java.lang.String budgetAllocationKey
           
static java.lang.String budgetTransferFromDef
           
static java.lang.String budgetTransferFromKey
           
static java.lang.String budgetTransferToDef
           
static java.lang.String budgetTransferToKey
           
static java.lang.String generalTextUIBg
           
static java.lang.String generalUIBg
           
static java.lang.String generalUIBgKey
           
static boolean generalUIColorsSelectDef
           
static java.lang.String generalUIColorsSelectKey
           
static java.lang.String generalUIControlBgDef
           
static java.lang.String generalUIControlBgKey
           
static java.lang.String generalUIFg
           
static java.lang.String generalUIFgKey
           
static java.lang.String generalUIFontDef
           
static java.lang.String generalUIFontKey
           
static boolean generalUIFontSelectDef
           
static java.lang.String generalUIFontSelectKey
           
static java.lang.String generalUIHg
           
static java.lang.String generalUIHgKey
           
static java.lang.String generalUISelectionBg
           
static java.lang.String generalUISelectionBgKey
           
static java.lang.String generalUITextBgKey
           
static java.lang.String generalUIToolTipBg
           
static java.lang.String generalUIToolTipBgKey
           
private static java.lang.String iconAccountDef
           
static java.lang.String iconAccountKey
           
private static java.lang.String iconBudgetAllocDef
           
static java.lang.String iconBudgetAllocKey
           
private static java.lang.String iconBudgetDef
           
private static java.lang.String iconBudgetFromDef
           
static java.lang.String iconBudgetFromKey
           
static java.lang.String iconBudgetKey
           
private static java.lang.String iconBudgetToDef
           
static java.lang.String iconBudgetToKey
           
private static java.lang.String iconExpenseCategoryDef
           
static java.lang.String iconExpenseCategoryKey
           
private static java.lang.String iconIncomeSourceDef
           
static java.lang.String iconIncomeSourceKey
           
private static java.lang.String iconUserDef
           
static java.lang.String iconUserKey
           
private static java.lang.String iconUserSysDef
           
static java.lang.String iconUserSysKey
           
private static java.util.prefs.Preferences prefs
          An instance of Preferences that contains the settings used in the gui package.
private static java.util.Set<java.lang.String> setKeys
          A list that is used to cache the keys that are set in the UIManager object when updateUIDefaults() method is called.
private static boolean showEmptyDaysDef
           
static java.lang.String showEmptyDaysKey
           
static java.lang.String tableAllocBgDef
           
static java.lang.String tableAllocBgKey
           
static java.lang.String tableAllocHgDef
           
static java.lang.String tableAllocHgKey
           
static java.lang.String tableAltBgDef
           
static java.lang.String tableAltBgKey
           
static java.lang.String tableBgDef
           
static java.lang.String tableBgKey
           
static java.lang.String tableExpenseBgDef
           
static java.lang.String tableExpenseBgKey
           
static java.lang.String tableExpenseHgDef
           
static java.lang.String tableExpenseHgKey
           
static java.lang.String tableFgDef
           
static java.lang.String tableFgKey
           
static java.lang.String tableFontDef
           
static java.lang.String tableFontKey
           
static boolean tableFontSelectDef
           
static java.lang.String tableFontSelectKey
           
static java.lang.String tableSelectionBgDef
           
static java.lang.String tableSelectionBgKey
           
static java.lang.String tableSelectionFgDef
           
static java.lang.String tableSelectionFgKey
           
private static java.lang.String[] textComponents
          An array of text component names.
static java.lang.String toolTipFontDef
           
static java.lang.String toolTipFontKey
           
static boolean toolTipFontSelectDef
           
static java.lang.String toolTipFontSelectKey
           
private static java.lang.String uiLFDefault
           
static java.lang.String uiLFKey
           
 
Constructor Summary
private GuiPreferences()
          No need to create any instances of this class
 
Method Summary
private static void clearUIDefaults()
          Sets all values associated with keys known by the GuiPreferences ot null values.
protected static javax.swing.ImageIcon createImageIcon(java.lang.String path, java.lang.String description)
          Returns an ImageIcon, or null if the path was invalid.
static java.lang.String get(java.lang.String key, java.lang.String def)
          Returns a string value stored in the preferences.
static boolean getBoolean(java.lang.String key, boolean def)
          Returns a boolean value for a given key.
static java.awt.Color getColor(java.lang.String key, java.lang.String def)
          Returns a color for a given key.
static java.awt.Font getFont(java.lang.String fontKey, java.lang.String fontDef)
           
private static javax.swing.ImageIcon getIcon(java.lang.String key, java.lang.String def)
          Returns a color for a given key.
static boolean getShowEmptyDays()
          Shall we show empty days in the table.
static void installLF()
          Installs the Look and Feel selected in the preferences.
static void put(java.lang.String key, java.lang.String value)
          Stores a string key/value pair in the preferences.
private static void set(java.lang.String key, java.lang.String value)
          puts a given value into preferences table.
static void setBoolean(java.lang.String key, boolean value)
          Sets a boolean value for a given key.
static void setColor(java.lang.String key, java.awt.Color color)
          Records the color associated with a given string key.
static void setFont(java.lang.String fontKey, java.awt.Font font)
          Changes the value of the base font
static void setShowEmptyDays(boolean showEmptyDays)
          Sets the empty days flag.
private static void UIManager_put(java.lang.String key, java.lang.Object value)
          Wrapper for the UIManager_put method.
static void updateUIDefaults()
          Updates the UI defaults using the values recorded in the preferences.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prefs

private static final java.util.prefs.Preferences prefs
An instance of Preferences that contains the settings used in the gui package.


textComponents

private static final java.lang.String[] textComponents
An array of text component names.


setKeys

private static final java.util.Set<java.lang.String> setKeys
A list that is used to cache the keys that are set in the UIManager object when updateUIDefaults() method is called. This list is used to clear all of these keys when clearUIDefaults() is called.


showEmptyDaysKey

public static final java.lang.String showEmptyDaysKey
See Also:
Constant Field Values

showEmptyDaysDef

private static final boolean showEmptyDaysDef
See Also:
Constant Field Values

uiLFKey

public static final java.lang.String uiLFKey
See Also:
Constant Field Values

uiLFDefault

private static final java.lang.String uiLFDefault
See Also:
Constant Field Values

generalUIColorsSelectKey

public static final java.lang.String generalUIColorsSelectKey
See Also:
Constant Field Values

generalUIColorsSelectDef

public static final boolean generalUIColorsSelectDef
See Also:
Constant Field Values

generalUIFgKey

public static final java.lang.String generalUIFgKey
See Also:
Constant Field Values

generalUIFg

public static final java.lang.String generalUIFg
See Also:
Constant Field Values

generalUIBgKey

public static final java.lang.String generalUIBgKey
See Also:
Constant Field Values

generalUIBg

public static final java.lang.String generalUIBg
See Also:
Constant Field Values

generalUIControlBgKey

public static final java.lang.String generalUIControlBgKey
See Also:
Constant Field Values

generalUIControlBgDef

public static final java.lang.String generalUIControlBgDef
See Also:
Constant Field Values

generalUITextBgKey

public static final java.lang.String generalUITextBgKey
See Also:
Constant Field Values

generalTextUIBg

public static final java.lang.String generalTextUIBg
See Also:
Constant Field Values

generalUIToolTipBgKey

public static final java.lang.String generalUIToolTipBgKey
See Also:
Constant Field Values

generalUIToolTipBg

public static final java.lang.String generalUIToolTipBg
See Also:
Constant Field Values

generalUIHgKey

public static final java.lang.String generalUIHgKey
See Also:
Constant Field Values

generalUIHg

public static final java.lang.String generalUIHg
See Also:
Constant Field Values

generalUISelectionBgKey

public static final java.lang.String generalUISelectionBgKey
See Also:
Constant Field Values

generalUISelectionBg

public static final java.lang.String generalUISelectionBg
See Also:
Constant Field Values

tableAllocBgKey

public static final java.lang.String tableAllocBgKey
See Also:
Constant Field Values

tableAllocBgDef

public static final java.lang.String tableAllocBgDef
See Also:
Constant Field Values

tableAllocHgKey

public static final java.lang.String tableAllocHgKey
See Also:
Constant Field Values

tableAllocHgDef

public static final java.lang.String tableAllocHgDef
See Also:
Constant Field Values

tableExpenseBgKey

public static final java.lang.String tableExpenseBgKey
See Also:
Constant Field Values

tableExpenseBgDef

public static final java.lang.String tableExpenseBgDef
See Also:
Constant Field Values

tableExpenseHgKey

public static final java.lang.String tableExpenseHgKey
See Also:
Constant Field Values

tableExpenseHgDef

public static final java.lang.String tableExpenseHgDef
See Also:
Constant Field Values

tableBgKey

public static final java.lang.String tableBgKey
See Also:
Constant Field Values

tableBgDef

public static final java.lang.String tableBgDef
See Also:
Constant Field Values

tableAltBgKey

public static final java.lang.String tableAltBgKey
See Also:
Constant Field Values

tableAltBgDef

public static final java.lang.String tableAltBgDef
See Also:
Constant Field Values

tableFgKey

public static final java.lang.String tableFgKey
See Also:
Constant Field Values

tableFgDef

public static final java.lang.String tableFgDef
See Also:
Constant Field Values

tableSelectionBgKey

public static final java.lang.String tableSelectionBgKey
See Also:
Constant Field Values

tableSelectionBgDef

public static final java.lang.String tableSelectionBgDef
See Also:
Constant Field Values

tableSelectionFgKey

public static final java.lang.String tableSelectionFgKey
See Also:
Constant Field Values

tableSelectionFgDef

public static final java.lang.String tableSelectionFgDef
See Also:
Constant Field Values

budgetAllocationKey

public static final java.lang.String budgetAllocationKey
See Also:
Constant Field Values

budgetAllocationDef

public static final java.lang.String budgetAllocationDef
See Also:
Constant Field Values

budgetTransferToKey

public static final java.lang.String budgetTransferToKey
See Also:
Constant Field Values

budgetTransferToDef

public static final java.lang.String budgetTransferToDef
See Also:
Constant Field Values

budgetTransferFromKey

public static final java.lang.String budgetTransferFromKey
See Also:
Constant Field Values

budgetTransferFromDef

public static final java.lang.String budgetTransferFromDef
See Also:
Constant Field Values

iconBudgetKey

public static final java.lang.String iconBudgetKey
See Also:
Constant Field Values

iconBudgetDef

private static final java.lang.String iconBudgetDef
See Also:
Constant Field Values

iconAccountKey

public static final java.lang.String iconAccountKey
See Also:
Constant Field Values

iconAccountDef

private static final java.lang.String iconAccountDef
See Also:
Constant Field Values

iconExpenseCategoryKey

public static final java.lang.String iconExpenseCategoryKey
See Also:
Constant Field Values

iconExpenseCategoryDef

private static final java.lang.String iconExpenseCategoryDef
See Also:
Constant Field Values

iconIncomeSourceKey

public static final java.lang.String iconIncomeSourceKey
See Also:
Constant Field Values

iconIncomeSourceDef

private static final java.lang.String iconIncomeSourceDef
See Also:
Constant Field Values

iconUserKey

public static final java.lang.String iconUserKey
See Also:
Constant Field Values

iconUserDef

private static final java.lang.String iconUserDef
See Also:
Constant Field Values

iconUserSysKey

public static final java.lang.String iconUserSysKey
See Also:
Constant Field Values

iconUserSysDef

private static final java.lang.String iconUserSysDef
See Also:
Constant Field Values

iconBudgetAllocKey

public static final java.lang.String iconBudgetAllocKey
See Also:
Constant Field Values

iconBudgetAllocDef

private static final java.lang.String iconBudgetAllocDef
See Also:
Constant Field Values

iconBudgetToKey

public static final java.lang.String iconBudgetToKey
See Also:
Constant Field Values

iconBudgetToDef

private static final java.lang.String iconBudgetToDef
See Also:
Constant Field Values

iconBudgetFromKey

public static final java.lang.String iconBudgetFromKey
See Also:
Constant Field Values

iconBudgetFromDef

private static final java.lang.String iconBudgetFromDef
See Also:
Constant Field Values

tableFontSelectKey

public static final java.lang.String tableFontSelectKey
See Also:
Constant Field Values

tableFontSelectDef

public static final boolean tableFontSelectDef
See Also:
Constant Field Values

tableFontKey

public static final java.lang.String tableFontKey
See Also:
Constant Field Values

tableFontDef

public static final java.lang.String tableFontDef
See Also:
Constant Field Values

generalUIFontSelectKey

public static final java.lang.String generalUIFontSelectKey
See Also:
Constant Field Values

generalUIFontSelectDef

public static final boolean generalUIFontSelectDef
See Also:
Constant Field Values

generalUIFontKey

public static final java.lang.String generalUIFontKey
See Also:
Constant Field Values

generalUIFontDef

public static final java.lang.String generalUIFontDef
See Also:
Constant Field Values

toolTipFontSelectKey

public static final java.lang.String toolTipFontSelectKey
See Also:
Constant Field Values

toolTipFontSelectDef

public static final boolean toolTipFontSelectDef
See Also:
Constant Field Values

toolTipFontKey

public static final java.lang.String toolTipFontKey
See Also:
Constant Field Values

toolTipFontDef

public static final java.lang.String toolTipFontDef
See Also:
Constant Field Values
Constructor Detail

GuiPreferences

private GuiPreferences()
No need to create any instances of this class

Method Detail

installLF

public static void installLF()
Installs the Look and Feel selected in the preferences.


updateUIDefaults

public static void updateUIDefaults()
Updates the UI defaults using the values recorded in the preferences.


clearUIDefaults

private static void clearUIDefaults()
Sets all values associated with keys known by the GuiPreferences ot null values.


UIManager_put

private static void UIManager_put(java.lang.String key,
                                  java.lang.Object value)
Wrapper for the UIManager_put method.


getShowEmptyDays

public static boolean getShowEmptyDays()
Shall we show empty days in the table. An empty day has no transactions


setShowEmptyDays

public static void setShowEmptyDays(boolean showEmptyDays)
Sets the empty days flag. @see getShowEmptyDays


put

public static void put(java.lang.String key,
                       java.lang.String value)
Stores a string key/value pair in the preferences.


get

public static java.lang.String get(java.lang.String key,
                                   java.lang.String def)
Returns a string value stored in the preferences.


getColor

public static java.awt.Color getColor(java.lang.String key,
                                      java.lang.String def)
Returns a color for a given key. If the color is not available or if it is can not be parsed, the default value is returned.


setColor

public static void setColor(java.lang.String key,
                            java.awt.Color color)
Records the color associated with a given string key.


set

private static void set(java.lang.String key,
                        java.lang.String value)
puts a given value into preferences table.


getFont

public static java.awt.Font getFont(java.lang.String fontKey,
                                    java.lang.String fontDef)

setFont

public static void setFont(java.lang.String fontKey,
                           java.awt.Font font)
Changes the value of the base font


getIcon

private static javax.swing.ImageIcon getIcon(java.lang.String key,
                                             java.lang.String def)
Returns a color for a given key. If the color is not available or if it is can not be parsed, the default value is returned.


getBoolean

public static boolean getBoolean(java.lang.String key,
                                 boolean def)
Returns a boolean value for a given key.


setBoolean

public static void setBoolean(java.lang.String key,
                              boolean value)
Sets a boolean value for a given key.


createImageIcon

protected static javax.swing.ImageIcon createImageIcon(java.lang.String path,
                                                       java.lang.String description)
Returns an ImageIcon, or null if the path was invalid.