org.tfe.console.Tables
Class AlertHistoryTableModel

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

public class AlertHistoryTableModel
extends javax.swing.table.AbstractTableModel

See Also:
Serialized Form

Field Summary
 boolean sortAsc
          Whether or not the table is sorted in ascending order
 int sortCol
          The column on which sorting is enabled
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
AlertHistoryTableModel()
          Creates new IncidentsTableModel
 
Method Summary
 void addRow(java.lang.Object a)
          Adds a row to the table.
 void addRows(java.util.ArrayList alertSummary)
          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.
 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.
 void sort()
          Sorts the table.
 void updateRow(int rowNum, java.lang.Object[] alertSummary)
          Updates a row's data.
 
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
 

Field Detail

sortCol

public int sortCol
The column on which sorting is enabled


sortAsc

public boolean sortAsc
Whether or not the table is sorted in ascending order

Constructor Detail

AlertHistoryTableModel

public AlertHistoryTableModel()
Creates new IncidentsTableModel

Method Detail

addRow

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

Parameters:
a - the object to be added to the table.

addRows

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

Parameters:
alertSummary - an ArrayList of String arrays containing the data to be added to the table.

removeRow

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

Parameters:
index - the index number of the row to be removed.

removeAll

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


updateRow

public void updateRow(int rowNum,
                      java.lang.Object[] alertSummary)
Updates a row's data.

Parameters:
rowNum - the row number to update
alertSummary - a 7-element String array containing the data with which to update the row.

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 colorization.

isColorized

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

Returns:
true if colorized, false if not.

sort

public void sort()
Sorts the table.