Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.pjsofts.eurobudget.model
Class TxnTableModel  view TxnTableModel download TxnTableModel.java

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended bycom.pjsofts.eurobudget.model.TxnTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel
Direct Known Subclasses:
AccountTxnTableModel, SplitTxnTableModel

public class TxnTableModel
extends javax.swing.table.AbstractTableModel

A simple table model for a list of transaction Could be used : - linked with a list of txn (search results) read-only model


Field Summary
static java.lang.Class[] allClasses
           
static java.lang.String[] allHeaders
          column headers, synch with all COL_xxx values
protected  java.util.Currency ccy
          currency of all given transaction used only if COL_AMOUNT_CCY2 is shown
protected  java.util.Currency ccy2
          currency of the informative amount
static int COL_AMOUNT
           
static int COL_AMOUNT_CCY2
          Amount but in another currency (informative amount)
static int COL_CTG
           
static int COL_DATE
          Date on which we make the deal but money won't necessarelly appears/disappear on the account at this date, Date
static int COL_DESC
           
static int COL_EFF_DATE
          Date on which money really appears/disappear on the account, Date Valeur
static int COL_ID
          check number, txn id ...
static int COL_SPLIT
          is Splitted Transaction (or Group)
static int COL_SUM
           
static int COL_TAG
           
static int COL_TYPE
           
static int COL_TYPE_ICON
          transaction type as Icon
static int COL_WHERE
           
private  int[] columns
          effective columns order, may change later on used to retrieve a model column index from a type
static int[] defaultColumns
          default value for columns
private static java.util.ResourceBundle i18n
           
protected  double[] sums
          of double , same order as arrayList used by AccountTxnTableModel only
protected  java.util.List txns
          unmodifiable of Transactions (trié par date ??)
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
TxnTableModel(java.util.List list, java.util.Currency ccy, java.util.Currency ccy2)
          Creates a new instance of TxnTableModel for search results read only (not editable)
 
Method Summary
 java.util.Currency getCcy()
          Getter for property ccy.
 java.util.Currency getCcy2()
          Getter for property ccy2.
 java.lang.Class getColumnClass(int c)
          Returns the Class for all Object instances in the specified column.
 int getColumnCount()
          Returns the number of columns in the model.
 java.lang.String getColumnName(int col)
          Returns the name of the specified column.
 int[] getColumns()
          Getter for property columns.
 int getNextMonthRow(int row)
           
 int getPreviousMonthRow(int row)
           
 int getRow(com.pjsofts.eurobudget.beans.Transaction t)
           
 int getRowCount()
          Returns the number of rows in the model.
 int getTableIndex(int col)
          reverse columns, used to retrieve a table column index from a type must synch with columns example: getTableIndex(COL_AMOUNT) ==> index of this column
 com.pjsofts.eurobudget.beans.Transaction getTransactionAt(int row)
           
 java.lang.Object getValueAt(int row, int col)
          Returns the value (Object) at a particular cell in the table.
 boolean isCellEditable(int row, int col)
          Returns true if the specified cell is editable, and false if it is not.
 void setCcy(java.util.Currency ccy)
          Setter for property ccy.
 void setCcy2(java.util.Currency ccy2)
          Setter for property ccy2.
 void setColumns(int[] columns)
          Setter for property columns.
 void setColumnStatus(int col, boolean shown)
          show/hide a column (in last position)
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

i18n

private static final java.util.ResourceBundle i18n

txns

protected java.util.List txns
unmodifiable of Transactions (trié par date ??)


sums

protected double[] sums
of double , same order as arrayList used by AccountTxnTableModel only


ccy

protected java.util.Currency ccy
currency of all given transaction used only if COL_AMOUNT_CCY2 is shown


ccy2

protected java.util.Currency ccy2
currency of the informative amount


COL_TYPE

public static final int COL_TYPE
See Also:
Constant Field Values

COL_DATE

public static final int COL_DATE
Date on which we make the deal but money won't necessarelly appears/disappear on the account at this date, Date

See Also:
Constant Field Values

COL_DESC

public static final int COL_DESC
See Also:
Constant Field Values

COL_WHERE

public static final int COL_WHERE
See Also:
Constant Field Values

COL_CTG

public static final int COL_CTG
See Also:
Constant Field Values

COL_AMOUNT

public static final int COL_AMOUNT
See Also:
Constant Field Values

COL_TAG

public static final int COL_TAG
See Also:
Constant Field Values

COL_SUM

public static final int COL_SUM
See Also:
Constant Field Values

COL_EFF_DATE

public static final int COL_EFF_DATE
Date on which money really appears/disappear on the account, Date Valeur

See Also:
Constant Field Values

COL_ID

public static final int COL_ID
check number, txn id ...

See Also:
Constant Field Values

COL_AMOUNT_CCY2

public static final int COL_AMOUNT_CCY2
Amount but in another currency (informative amount)

See Also:
Constant Field Values

COL_TYPE_ICON

public static final int COL_TYPE_ICON
transaction type as Icon

See Also:
Constant Field Values

COL_SPLIT

public static final int COL_SPLIT
is Splitted Transaction (or Group)

See Also:
Constant Field Values

allHeaders

public static final java.lang.String[] allHeaders
column headers, synch with all COL_xxx values


allClasses

public static final java.lang.Class[] allClasses

defaultColumns

public static final int[] defaultColumns
default value for columns


columns

private int[] columns
effective columns order, may change later on used to retrieve a model column index from a type

Constructor Detail

TxnTableModel

public TxnTableModel(java.util.List list,
                     java.util.Currency ccy,
                     java.util.Currency ccy2)
Creates a new instance of TxnTableModel for search results read only (not editable)

Method Detail

getTableIndex

public int getTableIndex(int col)
reverse columns, used to retrieve a table column index from a type must synch with columns example: getTableIndex(COL_AMOUNT) ==> index of this column


getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Description copied from interface: javax.swing.table.TableModel
Returns the value (Object) at a particular cell in the table.


getRowCount

public int getRowCount()
Description copied from interface: javax.swing.table.TableModel
Returns the number of rows in the model.


getColumnCount

public int getColumnCount()
Description copied from interface: javax.swing.table.TableModel
Returns the number of columns in the model.


getColumnName

public java.lang.String getColumnName(int col)
Description copied from class: javax.swing.table.AbstractTableModel
Returns the name of the specified column. This method generates default names in a sequence (starting with column 0): A, B, C, ..., Z, AA, AB, AC, ..., AZ, BA, BB, BC, and so on. Subclasses may override this method to allow column names to be specified on some other basis.


getColumnClass

public java.lang.Class getColumnClass(int c)
Description copied from class: javax.swing.table.AbstractTableModel
Returns the Class for all Object instances in the specified column.


isCellEditable

public boolean isCellEditable(int row,
                              int col)
Description copied from class: javax.swing.table.AbstractTableModel
Returns true if the specified cell is editable, and false if it is not. This implementation returns false for all arguments, subclasses should override the method if necessary.


getRow

public int getRow(com.pjsofts.eurobudget.beans.Transaction t)

getTransactionAt

public com.pjsofts.eurobudget.beans.Transaction getTransactionAt(int row)

getNextMonthRow

public int getNextMonthRow(int row)

getPreviousMonthRow

public int getPreviousMonthRow(int row)

getColumns

public int[] getColumns()
Getter for property columns.


setColumns

public void setColumns(int[] columns)
Setter for property columns.


setColumnStatus

public void setColumnStatus(int col,
                            boolean shown)
show/hide a column (in last position)


getCcy

public java.util.Currency getCcy()
Getter for property ccy.


setCcy

public void setCcy(java.util.Currency ccy)
Setter for property ccy.


getCcy2

public java.util.Currency getCcy2()
Getter for property ccy2.


setCcy2

public void setCcy2(java.util.Currency ccy2)
Setter for property ccy2.