Class StandardPirolTableModel

java.lang.Object
javax.swing.table.AbstractTableModel
org.openjump.core.apitools.tables.StandardPirolTableModel
All Implemented Interfaces:
Serializable, TableModel
Direct Known Subclasses:
StatisticOverViewTableModel

public abstract class StandardPirolTableModel extends AbstractTableModel
standard implementation for a table model.
Version:
$Rev: 2451 $
Author:
Ole Rahn

FH Osnabrück - University of Applied Sciences Osnabrück,
Project: PIROL (2005),
Subproject: Daten- und Wissensmanagement
See Also:
  • Field Details

    • rows

      protected Vector rows
      each element of this vector represents a single row of the table. Internally, a row is represented by a Object[].
    • colNames

      protected String[] colNames
      array that holds information on the names for the table columns
  • Constructor Details

    • StandardPirolTableModel

      public StandardPirolTableModel(String[] colNames)
  • Method Details

    • getColumnCount

      public int getColumnCount()
    • getRowCount

      public int getRowCount()
    • getColumnName

      public String getColumnName(int column)
      Specified by:
      getColumnName in interface TableModel
      Overrides:
      getColumnName in class AbstractTableModel
    • clearTable

      public void clearTable()
      deletes all data from the table (also imforms the GUI)
    • findColumn

      public int findColumn(String columnName)
      Overrides:
      findColumn in class AbstractTableModel
      Parameters:
      columnName - name of column to get the index for
      Returns:
      the index of the column with the given name
    • setValueAt

      public void setValueAt(Object aValue, int rowIndex, int columnIndex)
      Specified by:
      setValueAt in interface TableModel
      Overrides:
      setValueAt in class AbstractTableModel
    • getValueAt

      public Object getValueAt(int rowIndex, int columnIndex)
    • isCellEditable

      public abstract boolean isCellEditable(int rowIndex, int columnIndex)
      Specified by:
      isCellEditable in interface TableModel
      Overrides:
      isCellEditable in class AbstractTableModel
    • getColumnClass

      public abstract Class getColumnClass(int columnIndex)
      Specified by:
      getColumnClass in interface TableModel
      Overrides:
      getColumnClass in class AbstractTableModel
    • addRow

      public void addRow(Object[] newRow)
      simple method to add a row to the table. (It better matches the given column nummer and column types!!)
      Parameters:
      newRow - row of objects to add to the TableModel
    • getColNames

      public String[] getColNames()
      Returns:
      array containing the names of the columns
    • setColNames

      protected void setColNames(String[] colNames)
      Setting new column names will flush the table, if the new array has not the same length as the old one!
      Parameters:
      colNames - array containing new column names