org.dmonix.table
Class TableModel

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended byorg.dmonix.table.TableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class TableModel
extends javax.swing.table.AbstractTableModel

Title: dmonix Description: Copyright: Copyright (c) 2001 Company:

Version:
1.0
Author:
Peter Nerg
See Also:
Serialized Form

Field Summary
(package private)  java.util.Vector columnNames
           
(package private)  java.util.Vector rowData
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
TableModel()
           
 
Method Summary
 void addRow(java.util.Vector row)
          Add a row
 java.lang.Class getColumnClass(int c)
           
 int getColumnCount()
          Return the number of columns
 java.lang.String getColumnName(int col)
          Returns the name of the choosen column
 int getRowCount()
          Return the number of rows
 java.lang.Object getValueAt(int row, int col)
          Returns the object at the specified index
 void setColumnNames(java.util.Vector _columnNames)
          Set column names
 void setRowData(java.util.Vector _rowData)
          Set the row data vector
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

columnNames

java.util.Vector columnNames

rowData

java.util.Vector rowData
Constructor Detail

TableModel

public TableModel()
Method Detail

addRow

public void addRow(java.util.Vector row)
Add a row

Parameters:
row - A vector with the new row data

getColumnCount

public int getColumnCount()
Return the number of columns

Returns:
int

getRowCount

public int getRowCount()
Return the number of rows

Returns:
int

getColumnName

public java.lang.String getColumnName(int col)
Returns the name of the choosen column

Parameters:
col - Column index
Returns:
String

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Returns the object at the specified index

Parameters:
row - The row
col - The column
Returns:
Object

setRowData

public void setRowData(java.util.Vector _rowData)
Set the row data vector

Parameters:
_rowData - Vector with all the rows

setColumnNames

public void setColumnNames(java.util.Vector _columnNames)
Set column names

Parameters:
_columnNames - Vector with the column names

getColumnClass

public java.lang.Class getColumnClass(int c)


Copyright © 1998-2005 dmonix.org Peter Nerg, All Rights Reserved.