jgnash.ui.account
Class AccountTreeModel

java.lang.Object
  extended by javax.swing.tree.DefaultTreeModel
      extended by jgnash.ui.account.AccountTreeModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.tree.TreeModel

public class AccountTreeModel
extends javax.swing.tree.DefaultTreeModel

Account tree model

Version:
$Id$
Author:
Craig Cavanaugh
See Also:
Serialized Form

Field Summary
private  boolean accountVisible
           
private  boolean expenseVisible
           
private  boolean hiddenVisible
           
private  boolean incomeVisible
           
private  java.lang.Object lock
           
private static long serialVersionUID
           
 
Fields inherited from class javax.swing.tree.DefaultTreeModel
asksAllowsChildren, listenerList, root
 
Constructor Summary
AccountTreeModel()
           
 
Method Summary
protected  javax.swing.tree.DefaultMutableTreeNode findAccountNode(Account account)
          Finds a DefaultMutableTreeNode given the account
 boolean getAccountVisible()
           
 boolean getExpenseVisible()
           
 boolean getHiddenVisible()
           
 boolean getIncomeVisible()
           
private  boolean isAccountVisible(Account a)
          Determines if an account is visible
private  void loadAccountTree()
           
private  void loadChildren(javax.swing.tree.DefaultMutableTreeNode parentNode)
           
 void reload()
          Invoke this method if you've modified the TreeNodes upon which this model depends.
protected  void removeAccount(Account account)
           
 void setAccountVisible(boolean visible)
           
 void setExpenseVisible(boolean visible)
           
 void setHiddenVisible(boolean visible)
           
 void setIncomeVisible(boolean visible)
           
 
Methods inherited from class javax.swing.tree.DefaultTreeModel
addTreeModelListener, asksAllowsChildren, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getChild, getChildCount, getIndexOfChild, getListeners, getPathToRoot, getPathToRoot, getRoot, getTreeModelListeners, insertNodeInto, isLeaf, nodeChanged, nodesChanged, nodeStructureChanged, nodesWereInserted, nodesWereRemoved, reload, removeNodeFromParent, removeTreeModelListener, setAsksAllowsChildren, setRoot, valueForPathChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

incomeVisible

private boolean incomeVisible

expenseVisible

private boolean expenseVisible

accountVisible

private boolean accountVisible

hiddenVisible

private boolean hiddenVisible

lock

private final java.lang.Object lock
Constructor Detail

AccountTreeModel

public AccountTreeModel()
Method Detail

reload

public void reload()
Invoke this method if you've modified the TreeNodes upon which this model depends. The model will notify all of its listeners that the model has changed.

Overrides:
reload in class javax.swing.tree.DefaultTreeModel

loadAccountTree

private void loadAccountTree()

loadChildren

private void loadChildren(javax.swing.tree.DefaultMutableTreeNode parentNode)

findAccountNode

protected javax.swing.tree.DefaultMutableTreeNode findAccountNode(Account account)
Finds a DefaultMutableTreeNode given the account

Parameters:
account - Account to find
Returns:
DefaultMutableTreeNode if found, null otherwise

removeAccount

protected void removeAccount(Account account)

isAccountVisible

private boolean isAccountVisible(Account a)
Determines if an account is visible

Parameters:
a - account to check for visibility
Returns:
true is account should be displayed

setHiddenVisible

public void setHiddenVisible(boolean visible)

setIncomeVisible

public void setIncomeVisible(boolean visible)

setExpenseVisible

public void setExpenseVisible(boolean visible)

setAccountVisible

public void setAccountVisible(boolean visible)

getAccountVisible

public boolean getAccountVisible()

getExpenseVisible

public boolean getExpenseVisible()

getHiddenVisible

public boolean getHiddenVisible()

getIncomeVisible

public boolean getIncomeVisible()