com.zfqjava.swing
Interface DataGridModel

All Superinterfaces:
javax.swing.table.TableModel
All Known Implementing Classes:
AbstractDataGridModel

public interface DataGridModel
extends javax.swing.table.TableModel


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(javax.swing.event.UndoableEditListener l)
          Registers the given observer to begin receiving notifications when undoable edits are made to the model.
 javax.swing.text.AttributeSet getCellAttributes(int rowIndex, int columnIndex)
          Returns the cell attributes.
 java.lang.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(javax.swing.event.UndoableEditListener l)
          Unregisters the given observer from the notification list so it will no longer receive updates.
 void setCellAttributes(javax.swing.text.AttributeSet attributes, int rowIndex, int columnIndex)
          Sets the cell attributes.
 void setCellClass(java.lang.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(java.lang.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(java.lang.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
 

Method Detail

setRowCount

public 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

public 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

public void setColumnName(java.lang.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

public void setColumnClass(java.lang.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

public 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

public boolean hasCellSpans(int rowIndex,
                            int columnIndex)
Returns true if has cell spans the specified cell at rowIndex and columnIndex.
Parameters:
rowIndex - the row index of the specified cell
columnIndex - the column index of the specified cell
See Also:
getCellSpans(int,int)

getCellSpans

public Cell getCellSpans(int rowIndex,
                         int columnIndex)
Returns the cell that spans the specified cell at rowIndex and columnIndex.
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

public 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.

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

public 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.

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

public boolean isSpannedCell(Cell c)
Determines whether the cell is spanned cell.
Parameters:
c - the cell
Returns:
true if the cell has merged use the merge(com.zfqjava.swing.cell.Cell).

getSpannedCells

public Cell[] getSpannedCells()
Returns all spanned cells.
Returns:
all spannned cells that merged use the merge(com.zfqjava.swing.cell.Cell).

merge

public 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.)

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

public 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.)

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

public javax.swing.text.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

public void setCellAttributes(javax.swing.text.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

public java.lang.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

public void setCellClass(java.lang.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

public 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

public 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

public void addUndoableEditListener(javax.swing.event.UndoableEditListener l)
Registers the given observer to begin receiving notifications when undoable edits are made to the model.
Parameters:
listener - the observer to register
See Also:
UndoableEditEvent

removeUndoableEditListener

public void removeUndoableEditListener(javax.swing.event.UndoableEditListener l)
Unregisters the given observer from the notification list so it will no longer receive updates.
Parameters:
listener - the observer to register
See Also:
UndoableEditEvent


Copyright © 2001-2003 Extreme Component, Inc. All rights reserved.