com.jstatcom.table
Class JSCSArrayTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by com.jstatcom.table.JSCAbstractTableModel
          extended by com.jstatcom.table.JSCSArrayTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class JSCSArrayTableModel
extends JSCAbstractTableModel

Implementation of JSCAbstractTableModel for JSCSArray data objects. It takes the transposed property into account.

Author:
Markus Kraetzig
See Also:
Serialized Form

Constructor Summary
JSCSArrayTableModel(Symbol symbol)
          Constructs a table model for a symbol of type JSCTypes.SARRAY.
 
Method Summary
 int getColumnCount()
           
 int getRowCount()
           
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
           
 boolean isTransposed()
          Gets whether the underlying data array is transposed through this model.
 void setTransposed(boolean isTransposed)
          Sets whether the underlying data array is transposed through this model.
 void setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)
          The data model is editable.
 
Methods inherited from class com.jstatcom.table.JSCAbstractTableModel
getColIndexEditableMap, getJSCData, getRowIndexEditableMap, isCellEditable, isEditable, setColEditableMap, setEditable, setRowEditableMap
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getColumnName, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSCSArrayTableModel

public JSCSArrayTableModel(Symbol symbol)
Constructs a table model for a symbol of type JSCTypes.SARRAY. The argument can be null.

Parameters:
symbol - must be of type JSCTypes.SARRAY, can be null
Throws:
java.lang.IllegalArgumentException - if (symbol.type != JSCTypes.SARRAY)
Method Detail

getColumnCount

public int getColumnCount()

getRowCount

public int getRowCount()

getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)

setValueAt

public void setValueAt(java.lang.Object aValue,
                       int rowIndex,
                       int columnIndex)
The data model is editable. This method sets a value in the underlying data.

Specified by:
setValueAt in interface javax.swing.table.TableModel
Overrides:
setValueAt in class javax.swing.table.AbstractTableModel
Parameters:
aValue - must be non null
rowIndex - the row index, will be treated with taking transposed into account
columnIndex - the column index, will be treated with taking transposed into account
Throws:
java.lang.IllegalArgumentException - if (aValue == null)

isTransposed

public final boolean isTransposed()
Gets whether the underlying data array is transposed through this model.

Returns:
true if transposed

setTransposed

public final void setTransposed(boolean isTransposed)
Sets whether the underlying data array is transposed through this model. Subclasses must take this into account while overwriting getRowCount, getColumnCount and getValueAt. This property should not affect the original data but only the model view.

Parameters:
isTransposed - true if transposed