JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.util.xml
Class JCXMLTableModel

java.lang.Object
  |
  +--javax.swing.table.AbstractTableModel
        |
        +--javax.swing.table.DefaultTableModel
              |
              +--com.klg.jclass.util.xml.JCXMLTableModel
All Implemented Interfaces:
JCTablePopulator, Serializable, TableModel

public class JCXMLTableModel
extends DefaultTableModel
implements JCTablePopulator

Populates a swing TableModel with data taken from an incoming stream of data formatted according to the XML specification in com.klg.jclass.util.xml.JCTableXMLParser.

See Also:
Serialized Form

Field Summary
protected  com.klg.jclass.util.xml.JCTableXMLParser parser
          Parser used to parse the XML-formatted data.
 
Fields inherited from class javax.swing.table.DefaultTableModel
columnIdentifiers, dataVector
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
JCXMLTableModel()
          Default constructor.
JCXMLTableModel(InputStream i)
          Populates this TableModel from the given input stream.
 
Method Summary
 void read(Reader r)
          Reads and parses data to populate this table.
protected  void readFromStream(InputStream i)
          Reads data from an InputStream to populate this table.
 void setTableData(Vector rowV, Vector rowLabelV, Vector colLabelV, int nrows, int ncols)
          Populates the table with the given data.
 
Methods inherited from class javax.swing.table.DefaultTableModel
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getColumnCount, getColumnName, getDataVector, getRowCount, getValueAt, insertRow, insertRow, isCellEditable, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount, setValueAt
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parser

protected com.klg.jclass.util.xml.JCTableXMLParser parser
Parser used to parse the XML-formatted data.

Constructor Detail

JCXMLTableModel

public JCXMLTableModel(InputStream i)
                throws IOException
Populates this TableModel from the given input stream.

Parameters:
i - the input stream of incoming data
Throws:
IOException

JCXMLTableModel

public JCXMLTableModel()
                throws IOException
Default constructor. Creates parser class but expects user to explicitly call readFromStream() or read().

Throws:
IOException
Method Detail

readFromStream

protected void readFromStream(InputStream i)
                       throws IOException
Reads data from an InputStream to populate this table.

Parameters:
i - input stream of incoming data
Throws:
IOException

read

public void read(Reader r)
          throws IOException
Reads and parses data to populate this table.

Parameters:
r - reader open on an active stream
Throws:
IOException

setTableData

public void setTableData(Vector rowV,
                         Vector rowLabelV,
                         Vector colLabelV,
                         int nrows,
                         int ncols)
Populates the table with the given data. Implemented from the JCTablePopulator interface.

Specified by:
setTableData in interface JCTablePopulator
Parameters:
rowV - a vector of vectors, where each inside vector represents one row in the table
rowLabelV - a vector containing the row labels for this table
colLabelV - a vector containing the column labels for this table
nrows - the number of rows in this table
ncols - the number of columns in this table

Copyright © 2004 Quest Software Inc..
All rights reserved.