org.fopps.ui.feature
Class FeatureConstraintTableModel

java.lang.Object
  |
  +--javax.swing.table.AbstractTableModel
        |
        +--org.fopps.ui.EnhancedTableModel
              |
              +--org.fopps.ui.feature.FeatureConstraintTableModel
All Implemented Interfaces:
ModelListener, java.io.Serializable, javax.swing.table.TableModel

public class FeatureConstraintTableModel
extends EnhancedTableModel
implements ModelListener

Table model for constraint table.

Author:
Oliver Wieland
See Also:
Serialized Form

Field Summary
static java.lang.Class[] COLUMN_CLASSES
           
static java.lang.String[] COLUMN_NAMES
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
FeatureConstraintTableModel(ProjectContainer container)
           
 
Method Summary
 int compareRowsByColumn(int row1, int row2, int column)
          All subclasses have to overwrite this method in order to fetch the values from the unsorted array.
 int getColumnCount()
          Returns the number of columns in the model.
 java.lang.String getColumnName(int column)
          Returns a default name for the column using spreadsheet conventions: A, B, C, ...
 ProjectContainer getContainer()
           
 int getRowCount()
          Returns the number of rows in the model.
 java.lang.Object getRowObject(int pRow)
          Returns the objects that represents the data of the whole row.
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
           
 void modelChanged(ModelEvent pEvent)
          Invoked on model changes.
 java.lang.Object privateGetValueAt(int rowIndex, int columnIndex)
          Returns the value for the cell at columnIndex and rowIndex.
 void setContainer(ProjectContainer pContainer)
           
 void setValueAt(java.lang.Object pObject, int row, int col)
           
 
Methods inherited from class org.fopps.ui.EnhancedTableModel
checkModel, compare, compareRowsByColumn, fireTableDataChanged, getCellClass, getObjectColumn, n2sort, reallocateIndexes, shuttlesort, sort, sortByColumn, sortByColumn, swap, translateRow
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COLUMN_NAMES

public static final java.lang.String[] COLUMN_NAMES

COLUMN_CLASSES

public static final java.lang.Class[] COLUMN_CLASSES
Constructor Detail

FeatureConstraintTableModel

public FeatureConstraintTableModel(ProjectContainer container)
Method Detail

getContainer

public ProjectContainer getContainer()

setContainer

public void setContainer(ProjectContainer pContainer)

getColumnName

public java.lang.String getColumnName(int column)
Returns a default name for the column using spreadsheet conventions: A, B, C, ... Z, AA, AB, etc. If column cannot be found, returns an empty string.

Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
Parameters:
column - the column being queried
Returns:
a string containing the default name of column

getRowObject

public java.lang.Object getRowObject(int pRow)
Returns the objects that represents the data of the whole row.

Specified by:
getRowObject in class EnhancedTableModel

getRowCount

public int getRowCount()
Returns the number of rows in the model. A JTable uses this method to determine how many rows it should display. This method should be quick, as it is called frequently during rendering.

Specified by:
getRowCount in interface javax.swing.table.TableModel
Returns:
the number of rows in the model
See Also:
getColumnCount()

getColumnCount

public int getColumnCount()
Returns the number of columns in the model. A JTable uses this method to determine how many columns it should create and display by default.

Specified by:
getColumnCount in interface javax.swing.table.TableModel
Returns:
the number of columns in the model
See Also:
getRowCount()

setValueAt

public void setValueAt(java.lang.Object pObject,
                       int row,
                       int col)
Specified by:
setValueAt in interface javax.swing.table.TableModel
Specified by:
setValueAt in class EnhancedTableModel

privateGetValueAt

public java.lang.Object privateGetValueAt(int rowIndex,
                                          int columnIndex)
Returns the value for the cell at columnIndex and rowIndex.

Parameters:
rowIndex - the row whose value is to be queried
columnIndex - the column whose value is to be queried
Returns:
the value Object at the specified cell

getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)
Specified by:
getValueAt in interface javax.swing.table.TableModel
Specified by:
getValueAt in class EnhancedTableModel

compareRowsByColumn

public int compareRowsByColumn(int row1,
                               int row2,
                               int column)
All subclasses have to overwrite this method in order to fetch the values from the unsorted array. Both values may be passed to compareRowsByColumn.

Specified by:
compareRowsByColumn in class EnhancedTableModel
Parameters:
row1 - Row of the first item for comparison
row2 - Row of the second item for comparison
column - to sort by
Returns:
-1, if value of row1 is less than value of row2 or 1, if vice versa. If both values are equal regarding sort, return 0 instead.
See Also:
EnhancedTableModel.compareRowsByColumn(int, int, int)

modelChanged

public void modelChanged(ModelEvent pEvent)
Description copied from interface: ModelListener
Invoked on model changes.

Specified by:
modelChanged in interface ModelListener
Parameters:
pEvent - Model event
See Also:
ModelEvent


Fopps 0.19 - Copyright © 2002 Oliver Wieland. All Rights Reserved.