org.wcb.autohome.model
Class MonitorTableModel

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended byorg.wcb.autohome.model.MonitorTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class MonitorTableModel
extends javax.swing.table.AbstractTableModel
implements javax.swing.table.TableModel

Copyright (C) 1999 Walter Bogaardt This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 Project: Alice X10 Home Automation Date: January 14, 2004 Time: 11:32:45 AM class that is used to display the resulting orders. $Log: MonitorTableModel.java,v $ Revision 1.14 2004/06/09 18:50:32 wbogaardt changed enum to non-keyword for jvm1.5 Revision 1.13 2004/01/21 00:11:29 wbogaardt updated versions and api information Revision 1.12 2004/01/20 19:35:57 wbogaardt fixed adding new objects to check for redundancy Revision 1.11 2004/01/20 00:20:36 wbogaardt allow email service to send status code back if email succeds or fails Revision 1.10 2004/01/19 22:35:38 wbogaardt added fixes to runing events and emails so they work and added a testing of a monitored event through the table popup on a right mouse click. Revision 1.9 2004/01/19 17:54:22 wbogaardt initial fixed monitor Revision 1.8 2004/01/18 00:48:33 wbogaardt refactored out unnecessary code and now have a functional initial design of monitoring panel Revision 1.7 2004/01/17 08:15:46 wbogaardt Have an initial working monitoring frame that actually shows the date and time an event takes place Revision 1.6 2004/01/17 07:21:17 wbogaardt added serialization to run events and allow monitoring of these events to the file system to reload later Revision 1.5 2004/01/17 06:38:05 wbogaardt modified what is displayed Revision 1.4 2004/01/16 22:57:41 wbogaardt Improved display layout of module panel and added basic monitoring panel CV: ---------------------------------------------------------------------- Revision 1.3 2004/01/16 19:50:18 wbogaardt refactored, fixed long standing bug with updating macro panels, add error notification to user for improper device codes Revision 1.2 2004/01/15 21:05:20 wbogaardt major revamp of Modules and interfaces changes overall structure of how information is stored Revision 1.1 2004/01/15 00:11:34 wbogaardt Monitoring model for X10 events that have been detected

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
MonitorTableModel(java.util.Vector list)
          This is the constructor takes in the data set a for display.
 
Method Summary
 void addRow(IX10MonitorEvent newRow)
          Add a row of IX10Monitor object and fire data table change event.
 java.lang.Class getColumnClass(int col)
          Returns the most specific superclass for all the cell values in the column.
 int getColumnCount()
          Returns the number of columns in the model.
 java.lang.String getColumnName(int columnIndex)
          Retruns the name of the column at columnIndex.
 java.lang.Object getItemAt(int row)
          Gets the Object for the selected row in the model
 IX10MonitorEvent getModuleOfEventDetected(char cHouse, int iDevice, java.lang.String status)
          Pass in the house code and device id if it matches one of the items in the listing then return that row Object and update the row with the new time.
 int getRowCount()
          Number of rows added to the table model and return the total number
 java.lang.Object getValueAt(int row, int col)
          Returns the value for the cell at columnIndex and rowIndex.
 boolean isCellEditable(int row, int col)
          The entire model does not allow any of the cells to be edited directly.
 void removeRow(int row)
          Remove the identified row from the model and fire a data table change event.
 void setList(java.util.Vector list)
          Set the model to this new vector list.
 void setValueAt(java.lang.Object aVal, int row)
          Set the value of the row to an IX10Module and fire a table data change event.
 
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
 
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, removeTableModelListener, setValueAt
 

Constructor Detail

MonitorTableModel

public MonitorTableModel(java.util.Vector list)
This is the constructor takes in the data set a for display.

Parameters:
list - Vector of IX10Monitor
Method Detail

setList

public void setList(java.util.Vector list)
Set the model to this new vector list. So that a complete new data set is put into the model.

Parameters:
list - New data set of IX10Monitor

getItemAt

public java.lang.Object getItemAt(int row)
Gets the Object for the selected row in the model

Parameters:
row - Row number in the model
Returns:
An object of IMacroTrigger

getModuleOfEventDetected

public IX10MonitorEvent getModuleOfEventDetected(char cHouse,
                                                 int iDevice,
                                                 java.lang.String status)
Pass in the house code and device id if it matches one of the items in the listing then return that row Object and update the row with the new time.

Parameters:
cHouse -
iDevice -
Returns:
The object that an event was detected if the values don't match what is in the listing the return a null.

addRow

public void addRow(IX10MonitorEvent newRow)
Add a row of IX10Monitor object and fire data table change event.

Parameters:
newRow - Inserted IX10MonitorEvent object.

removeRow

public void removeRow(int row)
Remove the identified row from the model and fire a data table change event.

Parameters:
row - Row number to remove

setValueAt

public void setValueAt(java.lang.Object aVal,
                       int row)
Set the value of the row to an IX10Module and fire a table data change event.

Parameters:
aVal - Object of IX10Module
row - the row number in the model

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Returns the value for the cell at columnIndex and rowIndex.

Specified by:
getValueAt in interface javax.swing.table.TableModel
Parameters:
row - The row whose value is to be queried
col - The column whose value is to be queried
Returns:
The value Object at the specified cell

getColumnCount

public int getColumnCount()
Returns the number of columns in the model. This can be used to determin how many columsn should be created and displayed by default in a JTable

Specified by:
getColumnCount in interface javax.swing.table.TableModel
Returns:
The number of columns in the model

getRowCount

public int getRowCount()
Number of rows added to the table model and return the total number

Specified by:
getRowCount in interface javax.swing.table.TableModel
Returns:
defaults to 0

getColumnName

public java.lang.String getColumnName(int columnIndex)
Retruns the name of the column at columnIndex. This is used to initialize the table's column header name. Note: this name does not need to be unique; two columns in a table can have the same name.

Specified by:
getColumnName in interface javax.swing.table.TableModel
Parameters:
columnIndex - The index of the column
Returns:
the name of the column

getColumnClass

public java.lang.Class getColumnClass(int col)
Returns the most specific superclass for all the cell values in the column. This is used by the JTable to set up a default render and editor for the column

Specified by:
getColumnClass in interface javax.swing.table.TableModel
Parameters:
col - the index of the column
Returns:
the common ancestor class of the object values in the model.

isCellEditable

public boolean isCellEditable(int row,
                              int col)
The entire model does not allow any of the cells to be edited directly.

Specified by:
isCellEditable in interface javax.swing.table.TableModel
Parameters:
row - The selected row
col - Selected column
Returns:
always returns false


Copyright © 1999-2004 Walter Bogaardt. All Rights Reserved.