|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.table.AbstractTableModel
uk.ac.starlink.table.gui.StarTableModel
Adapts a StarTable into a TableModel.
The base StarTable must provide random access (its isRandom
method must return true); to make a StarTableModel if your
StarTable is not random you will have to make a random one using
for instance Tables.randomTable(uk.ac.starlink.table.StarTable)
.
One extra bit of functionality is enabled, namely that an extra column containing row indices may be provided.
As well as providing the data model for a JTable, this class can be used as a general wrapper for StarTable objects when the event handling mechanism it supplies is required.
JTable
,
Serialized FormField Summary | |
protected StarTable |
startable
|
Fields inherited from class javax.swing.table.AbstractTableModel |
listenerList |
Constructor Summary | |
StarTableModel(StarTable startable)
Constructs a StarTableModel from a StarTable, without row index column. |
|
StarTableModel(StarTable startable,
boolean rowHeader)
Constructs a StarTableModel from a StarTable, optionally with a row index column. |
Method Summary | |
Class |
getColumnClass(int icol)
|
int |
getColumnCount()
|
String |
getColumnName(int icol)
|
int |
getRowCount()
|
StarTable |
getStarTable()
Gets the StarTable underlying this model. |
Object |
getValueAt(int irow,
int icol)
|
boolean |
hasRowHeader()
Indicates whether the first column in this table is an artificial one containing just the index of the row. |
Methods inherited from class javax.swing.table.AbstractTableModel |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected StarTable startable
Constructor Detail |
public StarTableModel(StarTable startable)
startable
- the StarTable object
IllegalArgumentException
- if startable.isRandom
returns falseTables.randomTable(uk.ac.starlink.table.StarTable)
public StarTableModel(StarTable startable, boolean rowHeader)
startable
- the StarTable objectrowHeader
- whether to add an extra column at the start
containing the row index
IllegalArgumentException
- if startable.isRandom
returns falseTables.randomTable(uk.ac.starlink.table.StarTable)
Method Detail |
public boolean hasRowHeader()
public StarTable getStarTable()
public int getRowCount()
public int getColumnCount()
public Object getValueAt(int irow, int icol)
public String getColumnName(int icol)
public Class getColumnClass(int icol)
|
Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |