yu.ac.bg.etf.javaqx.qswing.table
Class AbstractTableModel

java.lang.Object
  extended byyu.ac.bg.etf.javaqx.qswing.table.AbstractTableModel
All Implemented Interfaces:
TableModel
Direct Known Subclasses:
DefaultTableModel

public abstract class AbstractTableModel
extends java.lang.Object
implements TableModel

Abstract Table Model.

Version:
0.2.0
Author:
Slobodan Vrkacevic (slobodan.vrkacevic@gmail.com)

Field Summary
protected  EventListenerList listenerList
           
 
Constructor Summary
AbstractTableModel()
          Constructs new AbstractTableModel object.
 
Method Summary
 void addTableModelListener(TableModelListener listener)
          Adds listener.
 int findColumn(java.lang.String columnName)
          Return the index of the specified column, or -1 if there is no such column.
 void fireTableCellUpdated(int row, int column)
          Fires table cell updated event.
 void fireTableChanged(TableModelEvent e)
          Fires table changed event.
 void fireTableDataChanged()
          Notifies listeners that table model has changed.
 void fireTableRowsDeleted(int firstRow, int lastRow)
          Fires table rows deleted event.
 void fireTableRowsInserted(int firstRow, int lastRow)
          Fires table rows inserted event.
 void fireTableRowsUpdated(int firstRow, int lastRow)
          Fires table rows updated event.
 void fireTableStructureChanged()
          Notifies listeners that table structure has changed.
 java.lang.Class getColumnClass(int columnIndex)
          Returns the class of the specified column.
 java.lang.String getColumnName(int columnIndex)
          Returns the name of the specified column.
 java.util.EventListener[] getListeners(java.lang.Class listenerClass)
          Returns listeners specified by the listener class.
 TableModelListener[] getTableModelListeners()
          Returns table model listeners.
 boolean isCellEditable(int rowIndex, int columnIndex)
          Returns true if the cell is editable.
 void removeTableModelListener(TableModelListener listener)
          Removes a listener.
 void setValueAt(java.lang.Object value, int rowIndex, int columnIndex)
          Sets the value for the specified cell.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface yu.ac.bg.etf.javaqx.qswing.table.TableModel
getColumnCount, getRowCount, getValueAt
 

Field Detail

listenerList

protected EventListenerList listenerList
Constructor Detail

AbstractTableModel

public AbstractTableModel()
Constructs new AbstractTableModel object.

Method Detail

findColumn

public int findColumn(java.lang.String columnName)
Return the index of the specified column, or -1 if there is no such column.

Parameters:
columnName - the name of the column
Returns:
the index of the specified column

fireTableChanged

public void fireTableChanged(TableModelEvent e)
Fires table changed event.

Parameters:
e - the event to send

fireTableDataChanged

public void fireTableDataChanged()
Notifies listeners that table model has changed.


fireTableStructureChanged

public void fireTableStructureChanged()
Notifies listeners that table structure has changed.


fireTableRowsInserted

public void fireTableRowsInserted(int firstRow,
                                  int lastRow)
Fires table rows inserted event.

Parameters:
firstRow - the first row
lastRow - the last row

fireTableRowsUpdated

public void fireTableRowsUpdated(int firstRow,
                                 int lastRow)
Fires table rows updated event.

Parameters:
firstRow - the first row
lastRow - the last row

fireTableRowsDeleted

public void fireTableRowsDeleted(int firstRow,
                                 int lastRow)
Fires table rows deleted event.

Parameters:
firstRow - the first row
lastRow - the last row

fireTableCellUpdated

public void fireTableCellUpdated(int row,
                                 int column)
Fires table cell updated event.

Parameters:
row - the row
column - the column

getTableModelListeners

public TableModelListener[] getTableModelListeners()
Returns table model listeners.

Returns:
table model listeners

getListeners

public java.util.EventListener[] getListeners(java.lang.Class listenerClass)
Returns listeners specified by the listener class.

Parameters:
listenerClass - the listener class
Returns:
listeners specified by the listener class

getColumnName

public java.lang.String getColumnName(int columnIndex)
Returns the name of the specified column.

Specified by:
getColumnName in interface TableModel
Parameters:
columnIndex - the column index
Returns:
the name of the specified column

getColumnClass

public java.lang.Class getColumnClass(int columnIndex)
Returns the class of the specified column.

Specified by:
getColumnClass in interface TableModel
Parameters:
columnIndex - the column index
Returns:
the class of the specified column

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Returns true if the cell is editable.

Specified by:
isCellEditable in interface TableModel
Parameters:
rowIndex - the row index
columnIndex - the column index
Returns:
true if the cell is editable

setValueAt

public void setValueAt(java.lang.Object value,
                       int rowIndex,
                       int columnIndex)
Sets the value for the specified cell.

Specified by:
setValueAt in interface TableModel
Parameters:
value - the value
rowIndex - the row index
columnIndex - the column index

addTableModelListener

public void addTableModelListener(TableModelListener listener)
Adds listener.

Specified by:
addTableModelListener in interface TableModel
Parameters:
listener - the listener

removeTableModelListener

public void removeTableModelListener(TableModelListener listener)
Removes a listener.

Specified by:
removeTableModelListener in interface TableModel
Parameters:
listener - the listener


Copyright © 2007 ETF and contributors. All Rights Reserved.