|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.table.AbstractTableModel
org.jbudget.gui.month.DatesInfoTableModel
public class DatesInfoTableModel
Model for the table that displays the daily income/expense/balance data for different categories.
| Nested Class Summary | |
|---|---|
static class |
DatesInfoTableModel.CellData
A class that is used to return the data that represents the cell |
static class |
DatesInfoTableModel.State
A class that describes the state of the table model. |
| Field Summary | |
|---|---|
protected java.util.Calendar |
calendar
A calendar instance. |
(package private) java.util.List<java.util.List<DatesInfoTableModel.CellData>> |
data
List of cell data. |
(package private) DatesTableModel |
datesTableModel
A model that gets the appropriate day of the month. |
(package private) java.util.Set<org.jbudget.Core.MoneyPit> |
emptyItems
A set of MoneyPit objects that correspond to empty (zero balance) accounts or expense categories. |
(package private) java.util.Set<org.jbudget.Core.MoneyPit> |
idleItems
A list of MoneyPit objects that correspond to idle (no transactions or allocations) accounts or expense categories. |
(package private) java.util.List<java.util.List<org.jbudget.Core.MoneyPit>> |
items
List of Budget items associated with columns. |
(package private) org.jbudget.Core.Month |
month
The month. |
(package private) java.util.List<java.lang.String> |
names
List of column names. |
private DatesInfoTableModel.State |
state
State object that describes what columns should be created. |
(package private) java.util.List<java.lang.String> |
toolTips
List of tool tips for columns. |
| Fields inherited from class javax.swing.table.AbstractTableModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
DatesInfoTableModel(DatesInfoTableModel otherModel)
copy constructor |
|
DatesInfoTableModel(org.jbudget.Core.Month month,
DatesTableModel datesTableModel)
Creates a new instance of DeatesInfoTableModel |
|
DatesInfoTableModel(org.jbudget.Core.Month month,
DatesTableModel datesTableModel,
DatesInfoTableModel.State state)
Creates a new instance of DeatesInfoTableModel |
|
| Method Summary | |
|---|---|
void |
accountAdded(org.jbudget.Core.Account account)
|
void |
accountRemoved(int accountId)
|
void |
accountUpdated(org.jbudget.Core.Account account)
|
void |
allocationAdded(org.jbudget.Core.Transaction allocation)
Called when an allocation is added to the month. |
void |
allocationRemoved(java.util.List<org.jbudget.Core.Transaction.Transfer> transfers,
int cDay,
int cMonth,
int cYear)
Called when an allocation is removed from the month. |
private boolean |
checkMoneyPit(org.jbudget.Core.MoneyPit pit)
This method is used to check if a transaction/allocation has the source or a destination that was hidden because it is empty (zero balance) or idle (no trancations = constant balance) |
void |
collapseColumn(int columnIndex)
Collapses a column that corresponds to an expense category with subcategories. |
void |
collapseParent(int columnIndex)
Collapses a parent category of the category corresponding to the selected column |
void |
dispose()
cleans up |
void |
expandColumn(int columnIndex)
Expands a column that was previously collapsed. |
void |
fireTableStructureChanged()
|
java.lang.String |
generateToolTip(int rowIndex,
int columnIndex)
A method that constructs the tool tip for a cell in the table. |
java.lang.Class |
getColumnClass(int index)
|
int |
getColumnCount()
|
java.lang.String |
getColumnName(int index)
|
java.lang.String |
getColumnToolTip(int index)
|
(package private) java.util.List<org.jbudget.Core.Account> |
getEmptyAccounts()
Returns a list of accounts that have zero balance in every day in the current month. |
(package private) java.util.List<org.jbudget.Core.ExpenseCategory> |
getEmptyCategories()
Returns a list of expense categories that have zero balance in every day in the current month. |
(package private) java.util.List<org.jbudget.Core.Account> |
getInactiveAccounts()
Returns a list of accounts that have no transactions recorded in the current month. |
(package private) java.util.List<org.jbudget.Core.ExpenseCategory> |
getInactiveCategories()
Returns a list of expense categories that have no transactions or allocations in the current month. |
java.util.List<org.jbudget.Core.MoneyPit> |
getItemsForColumn(int columnIndex)
List of accounts/categories for a given columnIndex. |
org.jbudget.Core.Month |
getMonth()
Returns the month object associated with the model |
int |
getRowCount()
|
DatesInfoTableModel.State |
getState()
Returns the State object used by this model |
java.lang.Object |
getValueAt(int rowIndex,
int columnIndex)
|
void |
hideColumn(int columnIndex)
Marks the account or the root expense category in the column as hidden |
private void |
initializeData()
Creates cell data cache. |
private void |
initializeItems()
Initializes items and names lists. |
boolean |
isCollapsable(int columnIndex)
|
boolean |
isExpandable(int columnIndex)
|
boolean |
isParentCollapsable(int columnIndex)
|
void |
setState(DatesInfoTableModel.State state)
Changes the State object. |
void |
transactionAdded(org.jbudget.Core.Transaction transaction)
Called when a transaction is added to the month. |
void |
transactionRemoved(java.util.List<org.jbudget.Core.Transaction.Transfer> transfers,
int cDay,
int cMonth,
int cYear)
Called when a transaction is removed from the month. |
private void |
updateCells(org.jbudget.Core.MoneyPit pit1,
org.jbudget.Core.MoneyPit pit2,
java.util.Date date)
Updates cells that correspond to the given MoneyPit objects. |
private void |
updateData(int column,
int row,
boolean notify)
Updates cached data for a given cell. |
private void |
updateModel()
Reinitializes the table structure and data |
void |
userAdded(org.jbudget.Core.User user)
|
void |
userChanged(org.jbudget.Core.User user)
|
void |
userRemoved(int uid)
|
| Methods inherited from class javax.swing.table.AbstractTableModel |
|---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
final java.util.List<java.util.List<org.jbudget.Core.MoneyPit>> items
final java.util.Set<org.jbudget.Core.MoneyPit> emptyItems
final java.util.Set<org.jbudget.Core.MoneyPit> idleItems
final java.util.List<java.lang.String> names
final java.util.List<java.lang.String> toolTips
final java.util.List<java.util.List<DatesInfoTableModel.CellData>> data
final DatesTableModel datesTableModel
final org.jbudget.Core.Month month
protected final java.util.Calendar calendar
private DatesInfoTableModel.State state
| Constructor Detail |
|---|
public DatesInfoTableModel(org.jbudget.Core.Month month,
DatesTableModel datesTableModel)
public DatesInfoTableModel(org.jbudget.Core.Month month,
DatesTableModel datesTableModel,
DatesInfoTableModel.State state)
public DatesInfoTableModel(DatesInfoTableModel otherModel)
| Method Detail |
|---|
public void dispose()
public void setState(DatesInfoTableModel.State state)
public DatesInfoTableModel.State getState()
public org.jbudget.Core.Month getMonth()
private void updateModel()
private void initializeItems()
private void initializeData()
private void updateData(int column,
int row,
boolean notify)
notify - if true the table(listeners) will be notified that the
content of the cell changed.public java.lang.Class getColumnClass(int index)
getColumnClass in interface javax.swing.table.TableModelgetColumnClass in class javax.swing.table.AbstractTableModelpublic java.lang.String getColumnName(int index)
getColumnName in interface javax.swing.table.TableModelgetColumnName in class javax.swing.table.AbstractTableModelpublic java.lang.String getColumnToolTip(int index)
public int getColumnCount()
getColumnCount in interface javax.swing.table.TableModelpublic int getRowCount()
getRowCount in interface javax.swing.table.TableModel
public java.lang.Object getValueAt(int rowIndex,
int columnIndex)
getValueAt in interface javax.swing.table.TableModelpublic java.util.List<org.jbudget.Core.MoneyPit> getItemsForColumn(int columnIndex)
public void hideColumn(int columnIndex)
public void collapseColumn(int columnIndex)
public void collapseParent(int columnIndex)
public void expandColumn(int columnIndex)
public boolean isExpandable(int columnIndex)
public boolean isCollapsable(int columnIndex)
public boolean isParentCollapsable(int columnIndex)
public java.lang.String generateToolTip(int rowIndex,
int columnIndex)
public void transactionAdded(org.jbudget.Core.Transaction transaction)
transactionAdded in interface EventDispatcher.TransactionListener
public void transactionRemoved(java.util.List<org.jbudget.Core.Transaction.Transfer> transfers,
int cDay,
int cMonth,
int cYear)
transactionRemoved in interface EventDispatcher.TransactionListenerpublic void allocationAdded(org.jbudget.Core.Transaction allocation)
allocationAdded in interface EventDispatcher.AllocationListener
public void allocationRemoved(java.util.List<org.jbudget.Core.Transaction.Transfer> transfers,
int cDay,
int cMonth,
int cYear)
allocationRemoved in interface EventDispatcher.AllocationListenerprivate boolean checkMoneyPit(org.jbudget.Core.MoneyPit pit)
public void userAdded(org.jbudget.Core.User user)
userAdded in interface EventDispatcher.UserListenerpublic void userRemoved(int uid)
userRemoved in interface EventDispatcher.UserListenerpublic void userChanged(org.jbudget.Core.User user)
userChanged in interface EventDispatcher.UserListenerpublic void accountAdded(org.jbudget.Core.Account account)
accountAdded in interface EventDispatcher.AccountListenerpublic void accountRemoved(int accountId)
accountRemoved in interface EventDispatcher.AccountListenerpublic void accountUpdated(org.jbudget.Core.Account account)
accountUpdated in interface EventDispatcher.AccountListener
private void updateCells(org.jbudget.Core.MoneyPit pit1,
org.jbudget.Core.MoneyPit pit2,
java.util.Date date)
public void fireTableStructureChanged()
fireTableStructureChanged in class javax.swing.table.AbstractTableModeljava.util.List<org.jbudget.Core.Account> getEmptyAccounts()
java.util.List<org.jbudget.Core.Account> getInactiveAccounts()
java.util.List<org.jbudget.Core.ExpenseCategory> getEmptyCategories()
java.util.List<org.jbudget.Core.ExpenseCategory> getInactiveCategories()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||