|
JIDE 3.5.15 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.table.AbstractTableModel
com.jidesoft.grid.AbstractSpanTableModel
public abstract class AbstractSpanTableModel
AbstractSpanTableModel adds SpanModel support to AbstractTableModel.
You can use it as replacement for AbstractTableModel. It implements both methods
in SpanModel by returning false in SpanModel.isCellSpanOn() and returning null
in SpanModel.getCellSpanAt(int,int). Subclass can override the default
implementation.
| Field Summary |
|---|
| Fields inherited from class javax.swing.table.AbstractTableModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
protected |
AbstractSpanTableModel()
|
| Method Summary | |
|---|---|
void |
addSpanModelListener(SpanModelListener l)
Adds a listener to the list that's notified each time a change to the span model occurs. |
void |
fireTableSpanAdded(CellSpan cellSpan)
Notifies all listeners that a cell span is added at cell (row, column). |
void |
fireTableSpanChanged()
Notifies all listeners that all span values in the table's rows may have changed. |
void |
fireTableSpanChanged(SpanModelEvent e)
Forwards the given notification event to all SpanModelListeners that registered
themselves as listeners for this table model. |
void |
fireTableSpanRemoved(CellSpan cellSpan)
Notifies all listeners that a cell span is removed at cell (row, column). |
CellSpan |
getCellSpanAt(int rowIndex,
int columnIndex)
Gets the cell span at the specified row and column. |
SpanModelListener[] |
getSpanModelListeners()
Returns an array of all the table model listeners registered on this model. |
boolean |
isCellSpanOn()
Checks if the span is on. |
void |
removeSpanModelListener(SpanModelListener l)
Removes a listener from the list that's notified each time a change to the data model occurs. |
| Methods inherited from class javax.swing.table.AbstractTableModel |
|---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getColumnName, getListeners, getTableModelListeners, isCellEditable, 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, getColumnClass, getColumnCount, getColumnName, getRowCount, getValueAt, isCellEditable, removeTableModelListener, setValueAt |
| Constructor Detail |
|---|
protected AbstractSpanTableModel()
| Method Detail |
|---|
public CellSpan getCellSpanAt(int rowIndex,
int columnIndex)
SpanModel
private final CellSpan span = new CellSpan(0,0,1,1);
public CellSpan getCellSpanAt(int row, int col) {
span.setRow(...);
span.setColumn(...);
span.setRowSpan(...);
span.setColumnSpan(...);
return span;
}
For performance consideration, if the cell span has 1 row span and 1 column span, it is better to return null
instead of new CellSpan(row, column, 1, 1).
getCellSpanAt in interface SpanModelrowIndex - the row index.columnIndex - the column index.
public boolean isCellSpanOn()
SpanModel
isCellSpanOn in interface SpanModelpublic void addSpanModelListener(SpanModelListener l)
l - the SpanModelListenerpublic void removeSpanModelListener(SpanModelListener l)
l - the SpanModelListenerpublic SpanModelListener[] getSpanModelListeners()
SpanModelListeners
or an empty
array if no table model listeners are currently registeredaddSpanModelListener(com.jidesoft.grid.SpanModelListener),
removeSpanModelListener(com.jidesoft.grid.SpanModelListener)public void fireTableSpanChanged()
JTable should redraw the
table from scratch. The structure of the table (as in the order of the
columns) is assumed to be the same.
SpanModelEvent,
EventListenerListpublic void fireTableSpanAdded(CellSpan cellSpan)
(row, column).
cellSpan - SpanModelEventpublic void fireTableSpanRemoved(CellSpan cellSpan)
(row, column).
cellSpan - SpanModelEventpublic void fireTableSpanChanged(SpanModelEvent e)
SpanModelListeners that registered
themselves as listeners for this table model.
e - the event to be forwardedaddSpanModelListener(com.jidesoft.grid.SpanModelListener),
SpanModelEvent,
EventListenerList
|
JIDE 3.5.15 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||