JComponentPack 1.5.0

com.zfqjava.swing
Interface DataGridModel

All Superinterfaces:
CellSpanModel, TableModel
All Known Implementing Classes:
AbstractDataGridModel, DataGridModelAdapter, DefaultDataGridModel, LargeDataGridModel, ResultSetDataGridModelAdapter

public interface DataGridModel
extends TableModel, CellSpanModel


Method Summary
 void addDataGridModelListener(DataGridModelListener l)
          Adds a listener to the list that is notified each time a change to the data model occurs.
 void addUndoableEditListener(UndoableEditListener l)
          Registers the given observer to begin receiving notifications when undoable edits are made to the model.
 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.
 Cell[] getSpannedCells()
          Returns all spanned cells.
 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 isSpannedCell(Cell c)
          Determines whether the cell is spanned cell.
 boolean merge(Cell c)
          Merges the cell.
 void removeDataGridModelListener(DataGridModelListener l)
          Removes a listener from the list that is notified each time a change to the data model occurs.
 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.
 boolean split(Cell c)
          Splits the cell.
 
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, getColumnClass, getColumnCount, getColumnName, getRowCount, getValueAt, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from interface com.zfqjava.swing.CellSpanModel
addCellSpanListener, removeCellSpanListener
 

Method Detail

setRowCount

void setRowCount(int rowCount)
Sets the number of rows in the model.

Parameters:
rowCount - the number of rows in the model
See Also:
TableModel.getRowCount(), setColumnCount(int), TableModel.getColumnCount()

setColumnCount

void setColumnCount(int columnCount)
Sets the number of columns in the model.

Parameters:
columnCount - the number of columns in the model
See Also:
TableModel.getRowCount(), setRowCount(int), TableModel.getColumnCount()

setColumnName

void setColumnName(String name,
                   int columnIndex)
Sets the column name for the specified columnIndex.

Parameters:
name - the column name
columnIndex - the specified columnIndex
See Also:
TableModel.getColumnName(int)

setColumnClass

void setColumnClass(Class c,
                    int columnIndex)
Sets the column class for the specified columnIndex.

Parameters:
c - the column class
columnIndex - the specified columnIndex
See Also:
TableModel.getColumnClass(int)

setCellEditable

void setCellEditable(boolean editable,
                     int rowIndex,
                     int columnIndex)
Sets the editable value for the specified cell at rowIndex and columnIndex.

Parameters:
editable - the cell editable value
rowIndex - the row whose value to be queried
columnIndex - the column whose value to be queried
See Also:
TableModel.setValueAt(java.lang.Object, int, int), TableModel.isCellEditable(int,int)

hasCellSpans

boolean hasCellSpans(int rowIndex,
                     int columnIndex)
Returns true if has cell spans the specified cell at rowIndex and columnIndex.

Specified by:
hasCellSpans in interface CellSpanModel
Parameters:
rowIndex - the row index of the specified cell
columnIndex - the column index of the specified cell
See Also:
getCellSpans(int,int)

getCellSpans

Cell getCellSpans(int rowIndex,
                  int columnIndex)
Returns the cell that spans the specified cell at rowIndex and columnIndex.

Specified by:
getCellSpans in interface CellSpanModel
Parameters:
rowIndex - the row index of the specified cell
columnIndex - the column index of the specified cell
Returns:
the cell that spans the specified cell
See Also:
hasCellSpans(int,int)

hasCellSpans

boolean hasCellSpans(int firstRow,
                     int lastRow,
                     int firstColumn,
                     int lastColumn)
Returns true if has some cells spans the specified cell area.

Note:Some cell spans the area can have row and column index out of the area index.

Specified by:
hasCellSpans in interface CellSpanModel
Parameters:
firstRow - the first row index of the specified cell area
lastRow - the last row index of the specified cell area
firstColumn - the first column index of the specified cell area
lastColumn - the last column index of the specified cell area
Returns:
true if has some cells spans the specified cell area
See Also:
getCellSpans(int,int,int,int)

getCellSpans

Cell[] getCellSpans(int firstRow,
                    int lastRow,
                    int firstColumn,
                    int lastColumn)
Returns the cells that spans the specified cell area. Returns 0 length array if no such cells.

Note:Some cell spans the area can have row and column index out of the area index.

Specified by:
getCellSpans in interface CellSpanModel
Parameters:
firstRow - the first row index of the specified cell area
lastRow - the last row index of the specified cell area
firstColumn - the first column index of the specified cell area
lastColumn - the last column index of the specified cell area
Returns:
the cells that spans the specified cell area
See Also:
hasCellSpans(int,int,int,int)

isSpannedCell

boolean isSpannedCell(Cell c)
Determines whether the cell is spanned cell.

Specified by:
isSpannedCell in interface CellSpanModel
Parameters:
c - the cell
Returns:
true if the cell has merged use the merge(com.zfqjava.swing.cell.Cell).

getSpannedCells

Cell[] getSpannedCells()
Returns all spanned cells.

Specified by:
getSpannedCells in interface CellSpanModel
Returns:
all spannned cells that merged use the merge(com.zfqjava.swing.cell.Cell).

merge

boolean merge(Cell c)
Merges the cell. Returns true 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.)

Specified by:
merge in interface CellSpanModel
Parameters:
c - the cell
Returns:
true if this model changed as a result of the call
See Also:
split(com.zfqjava.swing.cell.Cell)

split

boolean split(Cell c)
Splits the cell. Returns true 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.)

Specified by:
split in interface CellSpanModel
Parameters:
c - the cell
Returns:
true if this model changed as a result of the call
See Also:
merge(com.zfqjava.swing.cell.Cell)

getCellAttributes

AttributeSet getCellAttributes(int rowIndex,
                               int columnIndex)
Returns the cell attributes.

Parameters:
rowIndex - the index of the row
columnIndex - the index of the column
Returns:
the attributes for the specified cell
See Also:
setCellAttributes(javax.swing.text.AttributeSet, int, int)

setCellAttributes

void setCellAttributes(AttributeSet attributes,
                       int rowIndex,
                       int columnIndex)
Sets the cell attributes.

Parameters:
attributes - the cell attributes
rowIndex - the index of the row
columnIndex - the index of the column
See Also:
getCellAttributes(int, int)

getCellClass

Class getCellClass(int rowIndex,
                   int columnIndex)
Returns the cell class.

Parameters:
rowIndex - the index of the row
columnIndex - the index of the column
Returns:
the class for the specified cell
See Also:
setCellClass(java.lang.Class, int, int)

setCellClass

void setCellClass(Class c,
                  int rowIndex,
                  int columnIndex)
Sets the cell class.

Parameters:
c - the class for the specified cell
rowIndex - the index of the row
columnIndex - the index of the column
See Also:
getCellClass(int, int)

addDataGridModelListener

void addDataGridModelListener(DataGridModelListener l)
Adds a listener to the list that is notified each time a change to the data model occurs.

Parameters:
l - the DataGridModelListener

removeDataGridModelListener

void removeDataGridModelListener(DataGridModelListener l)
Removes a listener from the list that is notified each time a change to the data model occurs.

Parameters:
l - the DataGridModelListener

addUndoableEditListener

void addUndoableEditListener(UndoableEditListener l)
Registers the given observer to begin receiving notifications when undoable edits are made to the model.

Parameters:
l - the observer to register
See Also:
UndoableEditEvent

removeUndoableEditListener

void removeUndoableEditListener(UndoableEditListener l)
Unregisters the given observer from the notification list so it will no longer receive updates.

Parameters:
l - the observer to register
See Also:
UndoableEditEvent

JComponentPack 1.5.0

Send your Feedback
JComponentPack 1.5.0
Copyright © 2001-2007 Extreme Component, Inc. All rights reserved.