org.jbudget.gui.user
Class UserPreferences

java.lang.Object
  extended by org.jbudget.gui.user.UserPreferences

public class UserPreferences
extends java.lang.Object

A class for storing user preferences.

Author:
petrov

Field Summary
private  DatesInfoTable.Colors colors
          An object that stores the colors associated with accounts and expense categories.
private  TableColumnSorter columnSorter
          An object used for sorting the table columns.
(package private)  java.util.List<Pair<java.lang.Integer,java.lang.Integer>> openMonths
          A list of months that a user has opened
private  DatesInfoTable.RenderingState renderingState
          An object that stores the preferences used in rendering the month tables
private  DatesInfoTableModel.State tableState
          An object that stores the state of the DatesInfoTable.
private  java.awt.Dimension transactionWindowSize
          Size of the transaction and allocation windows.
 
Constructor Summary
UserPreferences()
          Creates a new instance of UserPreferences
 
Method Summary
 DatesInfoTable.Colors getColors()
           
 TableColumnSorter getColumnSorter()
          Returns the TableColumnSorter object used by the user.
static UserPreferences getInstance(Element element)
           
 java.util.List<Pair<java.lang.Integer,java.lang.Integer>> getOpenedMonths()
          Returns an unmodifaiable list of Month, Year pairs that represent opened months.
 DatesInfoTable.RenderingState getRenderingState()
           
 DatesInfoTableModel.State getTableState()
           
 java.awt.Dimension getTransactionWindowSize()
          Returns the width of the trasnaction window.
 Element getXmlElement()
           
 void setColors(DatesInfoTable.Colors colors)
           
 void setColumnSorter(TableColumnSorter columnSorter)
          Changes the TableColumnSorter object.
 void setOpenMonths(java.util.List<org.jbudget.Core.Month> months)
           
 void setRenderingState(DatesInfoTable.RenderingState renderingState)
           
 void setTableState(DatesInfoTableModel.State tableState)
           
 void setTransactionWindowSize(java.awt.Dimension size)
          Changes the width of the transaction window stored in the preferences.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tableState

private DatesInfoTableModel.State tableState
An object that stores the state of the DatesInfoTable. What columns should be hidden/shown, should columns representing some categories be combined with other categories?

See Also:
DatesInfoTableModel.State

renderingState

private DatesInfoTable.RenderingState renderingState
An object that stores the preferences used in rendering the month tables


colors

private DatesInfoTable.Colors colors
An object that stores the colors associated with accounts and expense categories.


openMonths

java.util.List<Pair<java.lang.Integer,java.lang.Integer>> openMonths
A list of months that a user has opened


columnSorter

private TableColumnSorter columnSorter
An object used for sorting the table columns.


transactionWindowSize

private java.awt.Dimension transactionWindowSize
Size of the transaction and allocation windows.

Constructor Detail

UserPreferences

public UserPreferences()
Creates a new instance of UserPreferences

Method Detail

getTableState

public DatesInfoTableModel.State getTableState()

setTableState

public void setTableState(DatesInfoTableModel.State tableState)

getRenderingState

public DatesInfoTable.RenderingState getRenderingState()

setRenderingState

public void setRenderingState(DatesInfoTable.RenderingState renderingState)

getColors

public DatesInfoTable.Colors getColors()

setColors

public void setColors(DatesInfoTable.Colors colors)

getOpenedMonths

public java.util.List<Pair<java.lang.Integer,java.lang.Integer>> getOpenedMonths()
Returns an unmodifaiable list of Month, Year pairs that represent opened months.


setOpenMonths

public void setOpenMonths(java.util.List<org.jbudget.Core.Month> months)

getColumnSorter

public TableColumnSorter getColumnSorter()
Returns the TableColumnSorter object used by the user.


setColumnSorter

public void setColumnSorter(TableColumnSorter columnSorter)
Changes the TableColumnSorter object.


getTransactionWindowSize

public java.awt.Dimension getTransactionWindowSize()
Returns the width of the trasnaction window.


setTransactionWindowSize

public void setTransactionWindowSize(java.awt.Dimension size)
Changes the width of the transaction window stored in the preferences.


getXmlElement

public Element getXmlElement()

getInstance

public static UserPreferences getInstance(Element element)
                                   throws JDOMException
Throws:
JDOMException