com.jaxfront.core.ui.tableModel
Class ListTypeTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by com.jaxfront.core.ui.tableModel.ListTypeTableModel
All Implemented Interfaces:
DOMChangeListener, StackableTableModel, java.io.Serializable, java.util.EventListener, javax.swing.table.TableModel
Direct Known Subclasses:
FlippableListTypeTableModel

public class ListTypeTableModel
extends javax.swing.table.AbstractTableModel
implements DOMChangeListener, StackableTableModel

The FlipOrientationTableModel is the model counter part to the RowHeadedTable. This model can be fliped so all columns will becom rows and vis versa.

Version:
1.60
See Also:
Serialized Form

Constructor Summary
ListTypeTableModel(AbstractListType listType)
           
ListTypeTableModel(ListType listType)
          Constructor from a complex group list Extracts table info from the complex group list' XU definition OR if that is not defined, creates the table info by looking for SimpleTypes and SimpleTypeLists in the ComplexGroupList
 
Method Summary
 void domChanged(DOMChangeEvent event)
          Respond method for a DOM state changed (DOMChangeEvent).
static int evaluateParentTableRowIndex(javax.swing.table.TableModel parentModel, int index)
           
 java.lang.Class getColumnClass(int columnIndex)
           
 int getColumnCount()
          Get the number of columns in the table Value depends on whether the table is flipped (This is used by the JTable displaying this model)
 java.lang.String getColumnName(int col)
          Get the column name at index col.
 java.util.List getColumns()
           
 java.lang.String getExcelTableData()
          Returns the table's contents in a format that Excel can handle (tab, newline separated)
 int getIndexFor(Type type)
          Returns the index within the holding listType of the passing type.
 ListType getListType()
          Returns the holding list type.
 int getRowCount()
          Count the number of rows in the table.Value depends on whether the table is flipped
 java.util.List getRowFormulas(int col)
           
 java.util.Vector getRowHeaders()
           
 java.lang.String getRowName(int index)
           
 SimpleType getSimpleTypeAt(int row, int col)
          Returns a simple type for a row and a column.
 RowHeaderLabellingStrategy getStrategy()
          Accessor to the labelling strategy needed by the view.
 TableInfo getTableInfo()
          Accessor to the table info.
 java.lang.Object getValueAt(int row, int col)
          Get the Object at position row, column Returns the approriate object from the internal object table, location depends on row, column but also on whether the table is flipped or not. col = 0 will always return the rowHeaders for the table.
 int getViewToModel(int rowIndex)
           
 boolean isCellEditable(int row, int column)
           
 boolean isCellEditableEnabled()
          Returns true if cells are editable.
 void release()
          Releases alocated resources.
 void setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)
           
 void swapFormula(int from, int to)
          Swaps the formula from one type to another.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, removeTableModelListener
 

Constructor Detail

ListTypeTableModel

public ListTypeTableModel(ListType listType)
Constructor from a complex group list Extracts table info from the complex group list' XU definition OR if that is not defined, creates the table info by looking for SimpleTypes and SimpleTypeLists in the ComplexGroupList

Parameters:
listType -

ListTypeTableModel

public ListTypeTableModel(AbstractListType listType)
Method Detail

domChanged

public void domChanged(DOMChangeEvent event)
Description copied from interface: DOMChangeListener
Respond method for a DOM state changed (DOMChangeEvent).

Specified by:
domChanged in interface DOMChangeListener
Parameters:
event - occured DOMChangeEvent
See Also:
DOMChangeListener.domChanged(DOMChangeEvent)

getColumnClass

public java.lang.Class getColumnClass(int columnIndex)
Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel
See Also:
TableModel.getColumnClass(int)

getColumnCount

public int getColumnCount()
Get the number of columns in the table Value depends on whether the table is flipped (This is used by the JTable displaying this model)

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

getColumnName

public java.lang.String getColumnName(int col)
Get the column name at index col. Value depends on whether the table is flipped.

Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
Parameters:
col - the column to select
See Also:
TableModel.getColumnName(int)

getExcelTableData

public java.lang.String getExcelTableData()
Returns the table's contents in a format that Excel can handle (tab, newline separated)

Returns:
String

getIndexFor

public int getIndexFor(Type type)
Returns the index within the holding listType of the passing type.

Parameters:
type - to lookup index for

getListType

public ListType getListType()
Returns the holding list type.


getRowCount

public int getRowCount()
Count the number of rows in the table.Value depends on whether the table is flipped

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

getSimpleTypeAt

public SimpleType getSimpleTypeAt(int row,
                                  int col)
Returns a simple type for a row and a column.

Parameters:
row - row to lookup
col - column to lookup

getTableInfo

public TableInfo getTableInfo()
Accessor to the table info.


getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Get the Object at position row, column Returns the approriate object from the internal object table, location depends on row, column but also on whether the table is flipped or not. col = 0 will always return the rowHeaders for the table. Values for the cells will be computed on the fly for not yet evaluated XPath Expressions.

Specified by:
getValueAt in interface javax.swing.table.TableModel
Parameters:
row - The row to select
col - The column to select
Returns:
The object at that location

getViewToModel

public int getViewToModel(int rowIndex)
Specified by:
getViewToModel in interface StackableTableModel

getRowFormulas

public java.util.List getRowFormulas(int col)

getRowName

public java.lang.String getRowName(int index)

getRowHeaders

public java.util.Vector getRowHeaders()

isCellEditable

public boolean isCellEditable(int row,
                              int column)
Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.AbstractTableModel
See Also:
TableModel.isCellEditable(int, int)

isCellEditableEnabled

public boolean isCellEditableEnabled()
Returns true if cells are editable.


setValueAt

public void setValueAt(java.lang.Object aValue,
                       int rowIndex,
                       int columnIndex)
Specified by:
setValueAt in interface javax.swing.table.TableModel
Overrides:
setValueAt in class javax.swing.table.AbstractTableModel
See Also:
TableModel.setValueAt(Object, int, int)

getColumns

public java.util.List getColumns()

swapFormula

public void swapFormula(int from,
                        int to)
Swaps the formula from one type to another.

Parameters:
fromType - base type
toType - target type

release

public void release()
Releases alocated resources.


getStrategy

public RowHeaderLabellingStrategy getStrategy()
Accessor to the labelling strategy needed by the view.


evaluateParentTableRowIndex

public static int evaluateParentTableRowIndex(javax.swing.table.TableModel parentModel,
                                              int index)