jgnash.ui.register.table
Class ClippingDecorator

java.lang.Object
  extended by jgnash.ui.register.table.ClippingDecorator
All Implemented Interfaces:
javax.swing.table.TableModel, AccountTableModel, ClippingModel, RegisterModel

public class ClippingDecorator
extends java.lang.Object
implements ClippingModel

A decorator that wraps an AbstractRegisterTableModel to clip the transactions displayed using a start and end date.

Version:
$Id$
Author:
Craig Cavanaugh

Field Summary
private  java.util.Date endDate
           
private  int endIndex
           
private  AbstractRegisterTableModel model
           
private  java.util.Date startDate
           
private  int startIndex
           
 
Fields inherited from interface jgnash.ui.register.table.AccountTableModel
RECONCILED_SYM
 
Constructor Summary
ClippingDecorator(AbstractRegisterTableModel model)
           
 
Method Summary
 void addTableModelListener(javax.swing.event.TableModelListener arg0)
           
private  void findStartIndex(java.util.Date date)
           
private  void findStopIndex(java.util.Date date)
           
 Account getAccount()
           
 java.lang.Class<?> getColumnClass(int col)
           
 int getColumnCount()
           
 java.lang.String getColumnName(int col)
           
 java.util.Date getEndDate()
           
 int[] getPreferredColumnWeights()
           
 java.lang.String getReconcileSymbol()
           
 int getRowCount()
           
 java.util.Date getStartDate()
           
 java.lang.Object getValueAt(int row, int col)
           
 boolean isCellEditable(int arg0, int arg1)
           
 void removeTableModelListener(javax.swing.event.TableModelListener arg0)
           
 void setEndDate(java.util.Date stopDate)
           
 void setEndIndex(int end)
           
 void setPreferredColumnWeights(int[] weights)
           
 void setReconcileSymbol(java.lang.String reconcileSymbol)
           
 void setStartDate(java.util.Date startDate)
           
 void setStartIndex(int start)
           
 void setValueAt(java.lang.Object arg0, int arg1, int arg2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

model

private AbstractRegisterTableModel model

endDate

private java.util.Date endDate

startDate

private java.util.Date startDate

startIndex

private int startIndex

endIndex

private int endIndex
Constructor Detail

ClippingDecorator

public ClippingDecorator(AbstractRegisterTableModel model)
Method Detail

setStartDate

public void setStartDate(java.util.Date startDate)
Specified by:
setStartDate in interface ClippingModel
Parameters:
startDate - The startDate to set.
See Also:
ClippingModel.setStartDate(java.util.Date)

setStartIndex

public void setStartIndex(int start)
Specified by:
setStartIndex in interface ClippingModel

getStartDate

public java.util.Date getStartDate()
Specified by:
getStartDate in interface ClippingModel
Returns:
Returns the startDate.
See Also:
ClippingModel.getStartDate()

setEndDate

public void setEndDate(java.util.Date stopDate)
Specified by:
setEndDate in interface ClippingModel
Parameters:
stopDate - The stopDate to set.
See Also:
ClippingModel.setEndDate(java.util.Date)

setEndIndex

public void setEndIndex(int end)
Specified by:
setEndIndex in interface ClippingModel

getEndDate

public java.util.Date getEndDate()
Specified by:
getEndDate in interface ClippingModel
Returns:
Returns the stopDate.
See Also:
ClippingModel.getEndDate()

getReconcileSymbol

public java.lang.String getReconcileSymbol()
Specified by:
getReconcileSymbol in interface RegisterModel
Returns:
reconcile symbol
See Also:
RegisterModel.getReconcileSymbol()

setReconcileSymbol

public void setReconcileSymbol(java.lang.String reconcileSymbol)
Specified by:
setReconcileSymbol in interface RegisterModel
Parameters:
reconcileSymbol - The reconcileSymbol to set.
See Also:
RegisterModel.setReconcileSymbol(java.lang.String)

getPreferredColumnWeights

public int[] getPreferredColumnWeights()
Specified by:
getPreferredColumnWeights in interface RegisterModel
Returns:
prefered column weight
See Also:
RegisterModel.getPreferredColumnWeights()

setPreferredColumnWeights

public void setPreferredColumnWeights(int[] weights)
Specified by:
setPreferredColumnWeights in interface RegisterModel
Parameters:
weights - prefered column weights
See Also:
RegisterModel.setPreferredColumnWeights(int[])

getAccount

public Account getAccount()
Specified by:
getAccount in interface AccountTableModel
Returns:
account for this decorator
See Also:
AccountTableModel.getAccount()

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface javax.swing.table.TableModel
See Also:
TableModel.getRowCount()

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface javax.swing.table.TableModel
See Also:
TableModel.getColumnCount()

getColumnName

public java.lang.String getColumnName(int col)
Specified by:
getColumnName in interface javax.swing.table.TableModel
Parameters:
col - index of column name to retrieve
See Also:
TableModel.getColumnName(int)

getColumnClass

public java.lang.Class<?> getColumnClass(int col)
Specified by:
getColumnClass in interface javax.swing.table.TableModel
Parameters:
col - index of column class to retrieve
See Also:
TableModel.getColumnClass(int)

isCellEditable

public boolean isCellEditable(int arg0,
                              int arg1)
Specified by:
isCellEditable in interface javax.swing.table.TableModel
See Also:
TableModel.isCellEditable(int, int)

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Specified by:
getValueAt in interface javax.swing.table.TableModel
See Also:
TableModel.getValueAt(int, int)

setValueAt

public void setValueAt(java.lang.Object arg0,
                       int arg1,
                       int arg2)
Specified by:
setValueAt in interface javax.swing.table.TableModel
See Also:
TableModel.setValueAt(java.lang.Object, int, int)

addTableModelListener

public void addTableModelListener(javax.swing.event.TableModelListener arg0)
Specified by:
addTableModelListener in interface javax.swing.table.TableModel
See Also:
TableModel.addTableModelListener(javax.swing.event.TableModelListener)

removeTableModelListener

public void removeTableModelListener(javax.swing.event.TableModelListener arg0)
Specified by:
removeTableModelListener in interface javax.swing.table.TableModel
See Also:
TableModel.removeTableModelListener(javax.swing.event.TableModelListener)

findStartIndex

private void findStartIndex(java.util.Date date)

findStopIndex

private void findStopIndex(java.util.Date date)