corina.editor
Class WJTableModel

java.lang.Object
  |
  +--javax.swing.table.AbstractTableModel
        |
        +--corina.editor.DecadalModel
              |
              +--corina.editor.WJTableModel
All Implemented Interfaces:
EventListener, SampleListener, Serializable, TableModel

public class WJTableModel
extends DecadalModel
implements SampleListener

Special DecadalModel for Weiserjahre.

Differences from the stock DecadalModel:

Version:
$Id: WJTableModel.java,v 1.1.1.1 2002/04/11 19:40:19 bitpoet Exp $
Author:
Ken Harris
See Also:
Serialized Form

Fields inherited from class corina.editor.DecadalModel
row_max, row_min, s, ZERO
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
WJTableModel(Sample s)
          Constructor, given a Sample to view.
 
Method Summary
 int getRowCount()
          Return the row count.
 Object getValueAt(int row, int col)
          Return the value of the specified cell.
 boolean isCellEditable(int row, int col)
          Return false: no cell is editable.
 void sampleDataChanged(SampleEvent e)
          One or more of the numbers of the dataset have changed.
 void sampleElementsChanged(SampleEvent e)
          The elements were changed.
 void sampleFormatChanged(SampleEvent e)
          The format (raw/indexed/summed) was changed.
 void sampleMetadataChanged(SampleEvent e)
          One or more of the metadata fields has been changed (the element changed, or a key was added or removed).
 void sampleRedated(SampleEvent e)
          The starting/ending dates of this sample have changed.
 
Methods inherited from class corina.editor.DecadalModel
countRows, getColumnClass, getColumnCount, getColumnName, getMean, getSample, getYear, setValueAt
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WJTableModel

public WJTableModel(Sample s)
Constructor, given a Sample to view.
Parameters:
s - the Sample to view
Method Detail

getRowCount

public int getRowCount()
Return the row count. The Weiserjahre is not user-editable, so there's no need to ever have an extra (empty) line.
Overrides:
getRowCount in class DecadalModel
Returns:
the number of rows

getValueAt

public Object getValueAt(int row,
                         int col)
Return the value of the specified cell.
Overrides:
getValueAt in class DecadalModel
Parameters:
row - the row to query
row - the column to query
Returns:
the value of this cell: the decade title, the Weiserjahre value, or the count

isCellEditable

public boolean isCellEditable(int row,
                              int col)
Return false: no cell is editable. Weiserjahre is always automatically computed.
Overrides:
isCellEditable in class DecadalModel
Parameters:
row - the row to query
row - the column to query
Returns:
false, meaning that no Weiserjahre cell is editable

sampleRedated

public void sampleRedated(SampleEvent e)
Description copied from interface: SampleListener
The starting/ending dates of this sample have changed.
Specified by:
sampleRedated in interface SampleListener
Following copied from interface: corina.SampleListener
Parameters:
e - the Event object

sampleDataChanged

public void sampleDataChanged(SampleEvent e)
Description copied from interface: SampleListener
One or more of the numbers of the dataset have changed.
Specified by:
sampleDataChanged in interface SampleListener
Following copied from interface: corina.SampleListener
Parameters:
e - the Event object

sampleMetadataChanged

public void sampleMetadataChanged(SampleEvent e)
Description copied from interface: SampleListener
One or more of the metadata fields has been changed (the element changed, or a key was added or removed).
Specified by:
sampleMetadataChanged in interface SampleListener
Following copied from interface: corina.SampleListener
Parameters:
e - the Event object

sampleFormatChanged

public void sampleFormatChanged(SampleEvent e)
Description copied from interface: SampleListener
The format (raw/indexed/summed) was changed.
Specified by:
sampleFormatChanged in interface SampleListener
Following copied from interface: corina.SampleListener
Parameters:
e - the Event object

sampleElementsChanged

public void sampleElementsChanged(SampleEvent e)
Description copied from interface: SampleListener
The elements were changed.
Specified by:
sampleElementsChanged in interface SampleListener
Following copied from interface: corina.SampleListener
Parameters:
e - the Event object