org.jbudget.gui.month
Class DatesInfoTableModel.State

java.lang.Object
  extended by org.jbudget.gui.month.DatesInfoTableModel.State
Enclosing class:
DatesInfoTableModel

public static class DatesInfoTableModel.State
extends java.lang.Object

A class that describes the state of the table model. It can be shared among several DatesInfoTableModel objects so that wen it is changed they update automatically.


Field Summary
private  java.util.Set<Pair<java.lang.Integer,java.lang.String>> collapsedCategories
          A set of expense categories that were selected by user to be collapsed with their subcategories.
private  boolean collapseSubcategories
          Collapse subcategories.
private  boolean expandAccounts
          Show all accounts? If this is false, all accounts are collapsed into one column.
private  boolean expandCategories
          Show all expense categories? If this is false, all expense categories are collapsed into one column.
private  java.util.Set<Pair<java.lang.Integer,java.lang.String>> hiddenAccounts
          A set of IDs of accounts that were explicitly selected to be hidden be the user.
private  java.util.Set<Pair<java.lang.Integer,java.lang.String>> hiddenCategories
          A set of expense categories that were selected by user to be hidden.
private  boolean hideInactiveAccounts
          Hide accounts with no transactions
private  boolean hideInactiveCategories
          Hide expense categories with no transactions.
private  boolean hideZeroBalanceAccounts
          Hide accounts with zero balance
private  boolean hideZeroBalanceCategories
          Hide Expense categories that do not have zero balance.
private  java.util.List<DatesInfoTableModel> models
          List of DatesInfoTableModel objects that use this State object
 
Constructor Summary
DatesInfoTableModel.State()
           
 
Method Summary
 void collapseCategory(Pair<java.lang.Integer,java.lang.String> categoryInfo)
           
 void expandCategory(Pair<java.lang.Integer,java.lang.String> categoryInfo)
           
 java.util.Set<Pair<java.lang.Integer,java.lang.String>> getCollapsedCategories()
           
 boolean getCollapseSubcategories()
           
 boolean getExpandAccounts()
           
 boolean getExpandCategories()
           
(package private)  java.util.Set<Pair<java.lang.Integer,java.lang.String>> getHiddenAccounts()
           
 java.util.Set<Pair<java.lang.Integer,java.lang.String>> getHiddenCategories()
           
 boolean getHideInactiveAccounts()
           
 boolean getHideInactiveCategories()
           
 boolean getHideZeroBalanceAccounts()
           
 boolean getHideZeroBalanceCategories()
           
static DatesInfoTableModel.State getInstance(Element element)
          Returns a State object represented by a given XML Element
 Element getXmlElement()
          Returns a JDOM XML Element representation of the current state
 void hideAccount(Pair<java.lang.Integer,java.lang.String> acctInfo)
           
 void hideCategory(Pair<java.lang.Integer,java.lang.String> categoryInfo)
           
 void registerModel(DatesInfoTableModel model)
           
 void setCollapseSubcategories(boolean collapseSubcategories)
           
 void setExpandAccounts(boolean expandAccounts)
           
 void setExpandCategories(boolean expandCategories)
           
 void setHideInactiveAccounts(boolean hideInactiveAccounts)
           
 void setHideInactiveCategories(boolean hideInactiveCategories)
           
 void setHideZeroBalanceAccounts(boolean hideZeroBalanceAccounts)
           
 void setHideZeroBalanceCategories(boolean hideZeroBalanceCategories)
           
 void showAccount(Pair<java.lang.Integer,java.lang.String> acctInfo)
           
 void showCategory(Pair<java.lang.Integer,java.lang.String> categoryInfo)
           
 void unregisterModel(DatesInfoTableModel model)
           
private  void update()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

expandAccounts

private boolean expandAccounts
Show all accounts? If this is false, all accounts are collapsed into one column. If it is true the accounts are displayed in accordance with other "account" settings.


hideZeroBalanceAccounts

private boolean hideZeroBalanceAccounts
Hide accounts with zero balance


hideInactiveAccounts

private boolean hideInactiveAccounts
Hide accounts with no transactions


hiddenAccounts

private java.util.Set<Pair<java.lang.Integer,java.lang.String>> hiddenAccounts
A set of IDs of accounts that were explicitly selected to be hidden be the user.


expandCategories

private boolean expandCategories
Show all expense categories? If this is false, all expense categories are collapsed into one column. If it is true the expense categories are displayed in accordance with other "category" settings.


collapseSubcategories

private boolean collapseSubcategories
Collapse subcategories. If this is true only columns corresponding to root categories will be created. Information if these columns will reflect the state of the root category and all its subcategories.


hideZeroBalanceCategories

private boolean hideZeroBalanceCategories
Hide Expense categories that do not have zero balance.


hideInactiveCategories

private boolean hideInactiveCategories
Hide expense categories with no transactions.


hiddenCategories

private java.util.Set<Pair<java.lang.Integer,java.lang.String>> hiddenCategories
A set of expense categories that were selected by user to be hidden. This setting overrules all the other settings.


collapsedCategories

private java.util.Set<Pair<java.lang.Integer,java.lang.String>> collapsedCategories
A set of expense categories that were selected by user to be collapsed with their subcategories. For each of this categories and all its subcategories only one column will be displayed in the table that reflects the combined info about the category and subcategories.


models

private java.util.List<DatesInfoTableModel> models
List of DatesInfoTableModel objects that use this State object

Constructor Detail

DatesInfoTableModel.State

public DatesInfoTableModel.State()
Method Detail

registerModel

public void registerModel(DatesInfoTableModel model)

unregisterModel

public void unregisterModel(DatesInfoTableModel model)

update

private void update()

setExpandAccounts

public void setExpandAccounts(boolean expandAccounts)

getExpandAccounts

public boolean getExpandAccounts()

setHideZeroBalanceAccounts

public void setHideZeroBalanceAccounts(boolean hideZeroBalanceAccounts)

getHideZeroBalanceAccounts

public boolean getHideZeroBalanceAccounts()

setHideInactiveAccounts

public void setHideInactiveAccounts(boolean hideInactiveAccounts)

getHideInactiveAccounts

public boolean getHideInactiveAccounts()

hideAccount

public void hideAccount(Pair<java.lang.Integer,java.lang.String> acctInfo)

showAccount

public void showAccount(Pair<java.lang.Integer,java.lang.String> acctInfo)

getHiddenAccounts

java.util.Set<Pair<java.lang.Integer,java.lang.String>> getHiddenAccounts()

setExpandCategories

public void setExpandCategories(boolean expandCategories)

getExpandCategories

public boolean getExpandCategories()

setCollapseSubcategories

public void setCollapseSubcategories(boolean collapseSubcategories)

getCollapseSubcategories

public boolean getCollapseSubcategories()

setHideZeroBalanceCategories

public void setHideZeroBalanceCategories(boolean hideZeroBalanceCategories)

getHideZeroBalanceCategories

public boolean getHideZeroBalanceCategories()

setHideInactiveCategories

public void setHideInactiveCategories(boolean hideInactiveCategories)

getHideInactiveCategories

public boolean getHideInactiveCategories()

hideCategory

public void hideCategory(Pair<java.lang.Integer,java.lang.String> categoryInfo)

showCategory

public void showCategory(Pair<java.lang.Integer,java.lang.String> categoryInfo)

getHiddenCategories

public java.util.Set<Pair<java.lang.Integer,java.lang.String>> getHiddenCategories()

collapseCategory

public void collapseCategory(Pair<java.lang.Integer,java.lang.String> categoryInfo)

expandCategory

public void expandCategory(Pair<java.lang.Integer,java.lang.String> categoryInfo)

getCollapsedCategories

public java.util.Set<Pair<java.lang.Integer,java.lang.String>> getCollapsedCategories()

getXmlElement

public Element getXmlElement()
Returns a JDOM XML Element representation of the current state


getInstance

public static DatesInfoTableModel.State getInstance(Element element)
                                             throws JDOMException
Returns a State object represented by a given XML Element

Throws:
JDOMException