Home » openjdk-7 » net.bereza.money » gui » [javadoc | source]
net.bereza.money.gui
public class: TransactionTableModel [javadoc | source]
java.lang.Object
   javax.swing.table.AbstractTableModel
      net.bereza.money.gui.TransactionTableModel

All Implemented Interfaces:
    TableModel, Serializable

TransactionTableModel is a table model for transaction objects. It represents transactions for a specific Account, over a specified time.

TransactionTableModel has one editable cell, which is the posted check mark.

The purpose of this model is to represent a checkbook-like ledger.

Field Summary
public static final  int COLUMNS    Number of columns in this model 
public static final  int NUMBER_COLUMN    Index of number column 
public static final  int DATE_COLUMN    Index of date column 
public static final  int ACCOUNT_COLUMN    Index of Account column 
public static final  int CATEGORY_COLUMN    Index of Category column 
public static final  int DEBIT_COLUMN    Index of Debit column 
public static final  int POSTED_COLUMN    Index of Posted column 
public static final  int CREDIT_COLUMN    Index of Credit column 
public static final  int BALANCE_COLUMN    Index of Balance column 
public static  String[] COLUMN_NAMES    Column names 
public static final  Class[] COLUMN_CLASSES    Column classes 
public  Object[] longValues    Example set of long values for the table 
protected  Account account    Account for which we get and hold data. 
protected  Date startDate    First date to display in the ledger. 
protected  Date endDate    All transactions display will be before this date. 
protected  Vector transactions    Vector of transactions to display 
protected  Vector balances    Vector of balance totals per transaction. 
protected  BigDecimal startingCreditBalance    Credit Balance for this account, up to start date 
protected  BigDecimal startingDebitBalance    Debit Balance for this account, up to start date 
protected  BigDecimal endingDebitBalance    Ending debit balance 
protected  BigDecimal endingCreditBalance    Ending credit balance 
protected  BigDecimal confirmedStartingCreditBalance    Starting confirmed credit balance. 
protected  BigDecimal confirmedStartingDebitBalance    Starting confirmed debit balance. 
protected  BigDecimal confirmedEndingCreditBalance    Ending confirmed credit balance. 
protected  BigDecimal confirmedEndingDebitBalance    Ending confirmed debit balance. 
protected  ProgressObserver monitor    progress monitor that wants to know the progress of data changes 
Fields inherited from javax.swing.table.AbstractTableModel:
listenerList
Constructor:
 public TransactionTableModel() throws DatabaseException 
    Construct an empty TransactionTableModel.
 public TransactionTableModel(Account displayAccount,
    Date start,
    Date end) throws DatabaseException 
    Construct a TransactionTableModel for the specified account, start date and end date.
    Parameters:
    displayAccount - account to get transaction for
    start - get transactions >= this date
    end - get transactions < this date
    Throws:
    DatabaseException - if there's a problem getting transactions from the DB
    exception: DatabaseException - if there's a problem getting transactions from the DB
Method from net.bereza.money.gui.TransactionTableModel Summary:
addTransaction,   getColumnClass,   getColumnCount,   getColumnName,   getConfirmedEndingCreditBalance,   getConfirmedEndingDebitBalance,   getConfirmedStartingCreditBalance,   getConfirmedStartingDebitBalance,   getEndingCreditBalance,   getEndingDebitBalance,   getRowCount,   getStartingCreditBalance,   getStartingDebitBalance,   getTransactionAt,   getTransactions,   getValueAt,   indexOf,   insertTransactionAt,   isCellEditable,   isGettingTransactions,   redoBalances,   removeTransaction,   removeTransactionAt,   setBusy,   setDisplay,   setGettingTransactions,   setProgress,   setProgressObserver,   setValueAt,   waitForTransactions
Methods from javax.swing.table.AbstractTableModel:
addTableModelListener,   findColumn,   fireTableCellUpdated,   fireTableChanged,   fireTableDataChanged,   fireTableRowsDeleted,   fireTableRowsInserted,   fireTableRowsUpdated,   fireTableStructureChanged,   getColumnClass,   getColumnName,   getListeners,   getTableModelListeners,   isCellEditable,   removeTableModelListener,   setValueAt
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from net.bereza.money.gui.TransactionTableModel Detail:
 public synchronized int addTransaction(Transaction action) 
    Add the transacton to the model.
 public Class getColumnClass(int columnIndex) 
 public int getColumnCount() 
 public String getColumnName(int columnIndex) 
 public BigDecimal getConfirmedEndingCreditBalance() 
 public BigDecimal getConfirmedEndingDebitBalance() 
 public BigDecimal getConfirmedStartingCreditBalance() 
 public BigDecimal getConfirmedStartingDebitBalance() 
 public BigDecimal getEndingCreditBalance() 
 public BigDecimal getEndingDebitBalance() 
 public synchronized int getRowCount() 
 public BigDecimal getStartingCreditBalance() 
 public BigDecimal getStartingDebitBalance() 
 public synchronized Transaction getTransactionAt(int index) 
 protected  void getTransactions() throws DatabaseException 
    Get the transactions, and balances, for the given account.
 public synchronized Object getValueAt(int rowIndex,
    int columnIndex) 
 public synchronized int indexOf(Transaction action) 
 public synchronized  void insertTransactionAt(Transaction action,
    int index) 
 public boolean isCellEditable(int rowIndex,
    int columnIndex) 
 protected synchronized boolean isGettingTransactions() 
 protected synchronized  void redoBalances(int index) 
    Redo the balances vector starting with the given index point. Recalculate the balances based on the previous balance, or the starting balance if the index equals 0.
 public synchronized  void removeTransaction(Transaction action) 
 public synchronized  void removeTransactionAt(int index) 
 protected  void setBusy(boolean flag) 
    Set the busy flag.
 public  void setDisplay(Account displayAccount,
    Date start,
    Date end) throws DatabaseException 
 protected synchronized  void setGettingTransactions(boolean to) 
 protected  void setProgress(int progress) 
    Set the progress for whatever the current action is.
 public  void setProgressObserver(ProgressObserver mon) 
    Set the monitor of the model's progress.
 public synchronized  void setValueAt(Object aValue,
    int rowIndex,
    int columnIndex) 
 protected  void waitForTransactions()