org.tfe.console.Tables
Class IncidentTableModel

java.lang.Object
  |
  +--javax.swing.table.AbstractTableModel
        |
        +--org.tfe.console.Tables.IncidentTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class IncidentTableModel
extends javax.swing.table.AbstractTableModel

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
IncidentTableModel()
          Creates new IncidentsTableModel
 
Method Summary
 void addRow(Incident i)
          Adds a row to the table.
 void addRow(java.lang.Object a)
          Adds a row to the table.
 void addRows(java.util.ArrayList incList)
          Adds rows to the table.
 java.lang.Class getColumnClass(int c)
          Gets the Class type of the data at the specified column.
 int getColumnCount()
          Gets the total number of columns in the table.
 java.lang.String getColumnName(int col)
          Gets the name of a specified column.
 int getRowCount()
          Gets the total number of rows in the table.
 java.lang.Object getValueAt(int row, int col)
          Get the data at a specified cell.
 void insertRow(java.lang.Object a, int index)
          Inserts a row into the table at the specified index.
 boolean isCellEditable(int row, int col)
          Whether or not the specified cell is editable.
 boolean isColorized()
          Whether or not the table is colorized.
 void removeAll()
          Removes all rows from the table.
 void removeRow(int index)
          Removes a row from the table.
 void setColorized(boolean colorized)
          Enables/disables colorization of the table.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IncidentTableModel

public IncidentTableModel()
Creates new IncidentsTableModel

Method Detail

addRow

public void addRow(java.lang.Object a)
Adds a row to the table.

Parameters:
a - an array of Strings containing the values to be added to the table.

addRow

public void addRow(Incident i)
Adds a row to the table.

Parameters:
i - an Incident containing the values to be added to the table.
See Also:
Incident

addRows

public void addRows(java.util.ArrayList incList)
Adds rows to the table.

Parameters:
incList - an ArrayList of Incidents containing values to be added to the table.
See Also:
Incident

insertRow

public void insertRow(java.lang.Object a,
                      int index)
Inserts a row into the table at the specified index.

Parameters:
a - an array of Strings containing the values to be inserted into the table.
index - the index at which to insert the new row into the table.

removeRow

public void removeRow(int index)
Removes a row from the table.

Parameters:
index - the index of the row to be removed from the table.

removeAll

public void removeAll()
Removes all rows from the table.


getColumnClass

public java.lang.Class getColumnClass(int c)
Gets the Class type of the data at the specified column.

Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel
Parameters:
c - the column for which to retrieve the class type.
Returns:
the Class type of the data at the specified column.

getColumnCount

public int getColumnCount()
Gets the total number of columns in the table.

Returns:
integer value of the number of columns in the table.

getRowCount

public int getRowCount()
Gets the total number of rows in the table.

Returns:
integer value of the number of rows in the table.

getColumnName

public java.lang.String getColumnName(int col)
Gets the name of a specified column.

Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
Parameters:
col - the column number for which to retrieve the column name.
Returns:
String value of the specified column's name.

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Get the data at a specified cell. This function retrieves the data at the cell specified by the row and column numbers.

Parameters:
row - the row number containing the cell for which to retrieve data.
col - the column number containing the cell for which to retrieve data.
Returns:
an Object representation of the data at the specified cell.

isCellEditable

public boolean isCellEditable(int row,
                              int col)
Whether or not the specified cell is editable.

Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.AbstractTableModel
Parameters:
row - the row containing the cell of interest.
col - the column number containing the cell of interest.
Returns:
true if the cell is editable, false if it is not.

setColorized

public void setColorized(boolean colorized)
Enables/disables colorization of the table.

Parameters:
colorized - true to enable colorization, false to disable it.

isColorized

public boolean isColorized()
Whether or not the table is colorized.

Returns:
true if the table is colorized, false if it is not.