|
JComponentPack 1.5.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.zfqjava.swing.model.DataGridModelAdapter
public class DataGridModelAdapter
DataGridModelAdapter provides a
DataGridModel adapter for any TableModel.
| Field Summary | |
|---|---|
protected EventListenerList |
listenerList
List of listeners |
| Constructor Summary | |
|---|---|
DataGridModelAdapter(TableModel tableModel)
|
|
| Method Summary | |
|---|---|
void |
addCellSpanListener(CellSpanListener l)
Adds a listener to the list that is notified each time a change to the cell span model occurs. |
void |
addDataGridModelListener(DataGridModelListener l)
Adds a listener to the list that is notified each time a change to the data model occurs. |
void |
addTableModelListener(TableModelListener l)
|
void |
addUndoableEditListener(UndoableEditListener l)
Registers the given observer to begin receiving notifications when undoable edits are made to the model. |
protected void |
fireCellChanged(DataGridModelEvent e)
Notifies all listeners that cell have been changed. |
void |
fireTableChanged(TableModelEvent e)
Forwards the given notification event to all TableModelListeners that registered
themselves as listeners for this table model. |
protected void |
fireUndoableEditHappened(UndoableEdit edit)
Notifies all listeners that have registered interest for notification on this event type. |
AttributeSet |
getCellAttributes(int rowIndex,
int columnIndex)
Returns the cell attributes. |
Class |
getCellClass(int rowIndex,
int columnIndex)
Returns the cell class. |
Cell |
getCellSpans(int rowIndex,
int columnIndex)
Returns the cell that spans the specified cell at rowIndex and columnIndex. |
Cell[] |
getCellSpans(int firstRow,
int lastRow,
int firstColumn,
int lastColumn)
Returns the cells that spans the specified cell area. |
Class |
getColumnClass(int columnIndex)
|
int |
getColumnCount()
|
String |
getColumnName(int columnIndex)
|
DataGridModelListener[] |
getDataGridModelListeners()
Returns an array of all the data grid model listeners registered on this model. |
EventListener[] |
getListeners(Class listenerType)
Returns an array of all the objects currently registered as FooListeners
upon this AbstractTableModel. |
int |
getRowCount()
|
Cell[] |
getSpannedCells()
Returns all spanned cells. |
TableModel |
getTableModel()
|
TableModelListener[] |
getTableModelListeners()
Returns an array of all the table model listeners registered on this model. |
UndoableEditListener[] |
getUndoableEditListeners()
Returns an array of all the undoable edit listeners registered on this model. |
Object |
getValueAt(int rowIndex,
int columnIndex)
|
boolean |
hasCellSpans(int rowIndex,
int columnIndex)
Returns true if has cell spans the specified cell at rowIndex and columnIndex. |
boolean |
hasCellSpans(int firstRow,
int lastRow,
int firstColumn,
int lastColumn)
Returns true if has some cells spans the specified cell area. |
boolean |
isCellEditable(int rowIndex,
int columnIndex)
|
boolean |
isSpannedCell(Cell c)
Determines whether the cell is spanned cell. |
boolean |
merge(Cell c)
Merges the cell. |
void |
removeCellSpanListener(CellSpanListener l)
Removes a listener from the list that is notified each time a change to the cell span model occurs. |
void |
removeDataGridModelListener(DataGridModelListener l)
Removes a listener from the list that is notified each time a change to the data model occurs. |
void |
removeTableModelListener(TableModelListener l)
|
void |
removeUndoableEditListener(UndoableEditListener l)
Unregisters the given observer from the notification list so it will no longer receive updates. |
void |
setCellAttributes(AttributeSet attributes,
int rowIndex,
int columnIndex)
Sets the cell attributes. |
void |
setCellClass(Class c,
int rowIndex,
int columnIndex)
Sets the cell class. |
void |
setCellEditable(boolean editable,
int rowIndex,
int columnIndex)
Sets the editable value for the specified cell at rowIndex and
columnIndex. |
void |
setColumnClass(Class c,
int columnIndex)
Sets the column class for the specified columnIndex. |
void |
setColumnCount(int columnCount)
Sets the number of columns in the model. |
void |
setColumnName(String name,
int columnIndex)
Sets the column name for the specified columnIndex. |
void |
setRowCount(int rowCount)
Sets the number of rows in the model. |
void |
setValueAt(Object aValue,
int rowIndex,
int columnIndex)
|
boolean |
split(Cell c)
Splits the cell. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected transient EventListenerList listenerList
| Constructor Detail |
|---|
public DataGridModelAdapter(TableModel tableModel)
| Method Detail |
|---|
public TableModel getTableModel()
public int getRowCount()
getRowCount in interface TableModelpublic int getColumnCount()
getColumnCount in interface TableModelpublic String getColumnName(int columnIndex)
getColumnName in interface TableModelpublic Class getColumnClass(int columnIndex)
getColumnClass in interface TableModel
public boolean isCellEditable(int rowIndex,
int columnIndex)
isCellEditable in interface TableModel
public Object getValueAt(int rowIndex,
int columnIndex)
getValueAt in interface TableModel
public void setValueAt(Object aValue,
int rowIndex,
int columnIndex)
setValueAt in interface TableModelpublic void addTableModelListener(TableModelListener l)
addTableModelListener in interface TableModelpublic void removeTableModelListener(TableModelListener l)
removeTableModelListener in interface TableModelpublic TableModelListener[] getTableModelListeners()
TableModelListeners
or an empty
array if no table model listeners are currently registeredaddTableModelListener(javax.swing.event.TableModelListener),
removeTableModelListener(javax.swing.event.TableModelListener)public void fireTableChanged(TableModelEvent e)
TableModelListeners that registered
themselves as listeners for this table model.
e - the event to be forwardedaddTableModelListener(javax.swing.event.TableModelListener),
TableModelEvent,
EventListenerListpublic void setRowCount(int rowCount)
DataGridModel
setRowCount in interface DataGridModelrowCount - the number of rows in the modelTableModel.getRowCount(),
DataGridModel.setColumnCount(int),
TableModel.getColumnCount()public void setColumnCount(int columnCount)
DataGridModel
setColumnCount in interface DataGridModelcolumnCount - the number of columns in the modelTableModel.getRowCount(),
DataGridModel.setRowCount(int),
TableModel.getColumnCount()
public void setColumnName(String name,
int columnIndex)
DataGridModelcolumnIndex.
setColumnName in interface DataGridModelname - the column namecolumnIndex - the specified columnIndexTableModel.getColumnName(int)
public void setColumnClass(Class c,
int columnIndex)
DataGridModelcolumnIndex.
setColumnClass in interface DataGridModelc - the column classcolumnIndex - the specified columnIndexTableModel.getColumnClass(int)
public void setCellEditable(boolean editable,
int rowIndex,
int columnIndex)
DataGridModelrowIndex and
columnIndex.
setCellEditable in interface DataGridModeleditable - the cell editable valuerowIndex - the row whose value to be queriedcolumnIndex - the column whose value to be queriedTableModel.setValueAt(java.lang.Object, int, int),
TableModel.isCellEditable(int,int)
public boolean hasCellSpans(int rowIndex,
int columnIndex)
DataGridModelrowIndex and columnIndex.
hasCellSpans in interface CellSpanModelhasCellSpans in interface DataGridModelrowIndex - the row index of the specified cellcolumnIndex - the column index of the specified cellDataGridModel.getCellSpans(int,int)
public Cell getCellSpans(int rowIndex,
int columnIndex)
DataGridModelrowIndex and columnIndex.
getCellSpans in interface CellSpanModelgetCellSpans in interface DataGridModelrowIndex - the row index of the specified cellcolumnIndex - the column index of the specified cell
DataGridModel.hasCellSpans(int,int)
public boolean hasCellSpans(int firstRow,
int lastRow,
int firstColumn,
int lastColumn)
DataGridModelNote:Some cell spans the area can have row and column index out of the area index.
hasCellSpans in interface CellSpanModelhasCellSpans in interface DataGridModelfirstRow - the first row index of the specified cell arealastRow - the last row index of the specified cell areafirstColumn - the first column index of the specified cell arealastColumn - the last column index of the specified cell area
DataGridModel.getCellSpans(int,int,int,int)
public Cell[] getCellSpans(int firstRow,
int lastRow,
int firstColumn,
int lastColumn)
DataGridModelNote:Some cell spans the area can have row and column index out of the area index.
getCellSpans in interface CellSpanModelgetCellSpans in interface DataGridModelfirstRow - the first row index of the specified cell arealastRow - the last row index of the specified cell areafirstColumn - the first column index of the specified cell arealastColumn - the last column index of the specified cell area
DataGridModel.hasCellSpans(int,int,int,int)public boolean isSpannedCell(Cell c)
DataGridModel
isSpannedCell in interface CellSpanModelisSpannedCell in interface DataGridModelc - the cell
DataGridModel.merge(com.zfqjava.swing.cell.Cell).public Cell[] getSpannedCells()
DataGridModel
getSpannedCells in interface CellSpanModelgetSpannedCells in interface DataGridModelDataGridModel.merge(com.zfqjava.swing.cell.Cell).public boolean merge(Cell c)
DataGridModeltrue if this model changes
as a result of the call. (Returns false if this model
already contains such spanned cell c or does not permit
such operation.)
merge in interface CellSpanModelmerge in interface DataGridModelc - the cell
DataGridModel.split(com.zfqjava.swing.cell.Cell)public boolean split(Cell c)
DataGridModeltrue if this model changes
as a result of the call. (Returns false if this model
have not such spanned cell or does not permit such operation.)
split in interface CellSpanModelsplit in interface DataGridModelc - the cell
DataGridModel.merge(com.zfqjava.swing.cell.Cell)
public AttributeSet getCellAttributes(int rowIndex,
int columnIndex)
DataGridModel
getCellAttributes in interface DataGridModelrowIndex - the index of the rowcolumnIndex - the index of the column
DataGridModel.setCellAttributes(javax.swing.text.AttributeSet, int, int)
public void setCellAttributes(AttributeSet attributes,
int rowIndex,
int columnIndex)
DataGridModel
setCellAttributes in interface DataGridModelattributes - the cell attributesrowIndex - the index of the rowcolumnIndex - the index of the columnDataGridModel.getCellAttributes(int, int)
public Class getCellClass(int rowIndex,
int columnIndex)
DataGridModel
getCellClass in interface DataGridModelrowIndex - the index of the rowcolumnIndex - the index of the column
DataGridModel.setCellClass(java.lang.Class, int, int)
public void setCellClass(Class c,
int rowIndex,
int columnIndex)
DataGridModel
setCellClass in interface DataGridModelc - the class for the specified cellrowIndex - the index of the rowcolumnIndex - the index of the columnDataGridModel.getCellClass(int, int)public void addDataGridModelListener(DataGridModelListener l)
DataGridModel
addDataGridModelListener in interface DataGridModell - the DataGridModelListenerpublic void removeDataGridModelListener(DataGridModelListener l)
DataGridModel
removeDataGridModelListener in interface DataGridModell - the DataGridModelListenerpublic DataGridModelListener[] getDataGridModelListeners()
DataGridModelListeners
or an empty
array if no data grid model listeners are currently registeredaddDataGridModelListener(com.zfqjava.swing.event.DataGridModelListener),
removeDataGridModelListener(com.zfqjava.swing.event.DataGridModelListener)protected void fireCellChanged(DataGridModelEvent e)
public void addUndoableEditListener(UndoableEditListener l)
DataGridModel
addUndoableEditListener in interface DataGridModell - the observer to registerUndoableEditEventpublic void removeUndoableEditListener(UndoableEditListener l)
DataGridModel
removeUndoableEditListener in interface DataGridModell - the observer to registerUndoableEditEventpublic UndoableEditListener[] getUndoableEditListeners()
UndoableEditListeners
or an empty array if no undoable edit listeners are
currently registeredaddUndoableEditListener(javax.swing.event.UndoableEditListener),
removeUndoableEditListener(javax.swing.event.UndoableEditListener)protected void fireUndoableEditHappened(UndoableEdit edit)
EventListenerListpublic EventListener[] getListeners(Class listenerType)
FooListeners
upon this AbstractTableModel.
FooListeners are registered using the
addFooListener method.
You can specify the listenerType argument
with a class literal,
such as
FooListener.class.
For example, you can query a
model m
for its table model listeners with the following code:
TableModelListener[] tmls = (TableModelListener[])(m.getListeners(TableModelListener.class));If no such listeners exist, this method returns an empty array.
listenerType - the type of listeners requested; this parameter
should specify an interface that descends from
java.util.EventListener
FooListeners on this component,
or an empty array if no such
listeners have been added
ClassCastException - if listenerType
doesn't specify a class or interface that implements
java.util.EventListenergetTableModelListeners()public void addCellSpanListener(CellSpanListener l)
CellSpanModel
addCellSpanListener in interface CellSpanModell - the CellSpanListenerpublic void removeCellSpanListener(CellSpanListener l)
CellSpanModel
removeCellSpanListener in interface CellSpanModell - the CellSpanListener
|
JComponentPack 1.5.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||