JComponentPack 1.5.0

com.zfqjava.swing
Class AbstractDataGridModel

java.lang.Object
  extended by com.zfqjava.swing.AbstractDataGridModel
All Implemented Interfaces:
CellSpanModel, DataGridModel, Serializable, TableModel
Direct Known Subclasses:
DefaultDataGridModel, LargeDataGridModel

public abstract class AbstractDataGridModel
extends Object
implements DataGridModel, Serializable

See Also:
Serialized Form

Field Summary
protected  EventListenerList listenerList
          List of listeners
 
Constructor Summary
AbstractDataGridModel()
           
 
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)
          Adds a listener to the list that's 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.
 void calculateFormula()
          Calculate the formula cells.
 boolean clear(Cell c)
          Clears the cell data for the specified cell area c.
 void endUndoableEdit()
          Ends the undoable edit.All undoable edit before this edit will be fired to the UndoableEditListener.
 boolean fill(Cell c, TableModel model)
          Fills the cell area c use the specified data.
 boolean fillCellAttributes(Cell c, List[] l)
          Fills the cell attributes of the cell area c use the specified data.
protected  void fireCellAttributesChanged(Cell c)
          Notifies all listeners that cell attributes have been changed.
protected  void fireCellAttributesChanged(int rowIndex, int columnIndex)
          Notifies all listeners that cell attributes have been changed.
protected  void fireCellChanged(Cell c)
          Notifies all listeners that all cell object have been changed.
protected  void fireCellChanged(DataGridModelEvent e)
          Notifies all listeners that cell have been changed.
protected  void fireCellChanged(int rowIndex, int columnIndex)
          Notifies all listeners that cell have been changed.
protected  void fireCellClassChanged(Cell c)
          Notifies all listeners that cell class have been changed.
protected  void fireCellClassChanged(int rowIndex, int columnIndex)
          Notifies all listeners that cell class have been changed.
protected  void fireCellEditableChanged(Cell c)
          Notifies all listeners that cell editable have been changed.
protected  void fireCellEditableChanged(int rowIndex, int columnIndex)
          Notifies all listeners that cell editable have been changed.
protected  void fireCellMerged(Cell c)
          Forwards the given notification event to all CellSpanListeners that registered themselves as listeners for this cell span model.
protected  void fireCellSpanChanged(Cell c)
          Notifies all listeners that cell span have been changed.
protected  void fireCellSpanChanged(int firstRow, int lastRow, int firstColumn, int lastColumn)
          Notifies all listeners that cell span have been changed.
protected  void fireCellSplitted(Cell c)
          Forwards the given notification event to all CellSpanListeners that registered themselves as listeners for this cell span model.
protected  void fireCellValueChanged(Cell c)
          Notifies all listeners that cell value have been changed.
protected  void fireCellValueChanged(int rowIndex, int columnIndex)
          Notifies all listeners that cell value have been changed.
protected  void fireTableCellUpdated(int row, int column)
          Notifies all listeners that the value of the cell at [row, column] has been updated.
protected  void fireTableChanged(TableModelEvent e)
          Forwards the given notification event to all TableModelListeners that registered themselves as listeners for this table model.
protected  void fireTableColumnsDeleted(int firstColumn, int lastColumn)
          Notifies all listeners that columns in the range [firstColumn, lastColumn], inclusive, have been deleted.
protected  void fireTableColumnsInserted(int firstColumn, int lastColumn)
          Notifies all listeners that columns in the range [firstColumn, lastColumn], inclusive, have been inserted.
protected  void fireTableColumnsUpdated(int firstColumn, int lastColumn)
          Notifies all listeners that columns in the range [firstColumn, lastColumn], inclusive, have been updated.
protected  void fireTableColumnUpdated(int column)
          Notifies all listeners that the value of the colum at column has been updated.
protected  void fireTableDataChanged()
          Notifies all listeners that all cell values in the table's rows may have changed.
protected  void fireTableRowsDeleted(int firstRow, int lastRow)
          Notifies all listeners that rows in the range [firstRow, lastRow], inclusive, have been deleted.
protected  void fireTableRowsInserted(int firstRow, int lastRow)
          Notifies all listeners that rows in the range [firstRow, lastRow], inclusive, have been inserted.
protected  void fireTableRowsUpdated(int firstRow, int lastRow)
          Notifies all listeners that rows in the range [firstRow, lastRow], inclusive, have been updated.
protected  void fireTableRowUpdated(int row)
          Notifies all listeners that the value of the row at row has been updated.
protected  void fireTableStructureChanged()
          Notifies all listeners that the table's structure has changed.
protected  void fireUndoableEditHappened(UndoableEdit edit)
          Notifies all listeners that have registered interest for notification on this event type.
 boolean getAutoCalculateFormula()
          Returns the auot calculate formula property, default is true.
 boolean getAutoSetsCellClass()
          Returns the auto sets cell class property.
 boolean getAutoSetsCellValue()
          Returns the auto sets cell value property.
 Boolean getCellEditable(int rowIndex, int columnIndex)
          Returns the editable property for the specified cell at rowIndex and columnIndex.
 CellSpanListener[] getCellSpanListeners()
          Returns an array of all the table model listeners registered on this model.
 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.
 AttributeSet getColumnAttributes(int column)
          Returns the attributes for the specified column index.
 Class getColumnClass(int columnIndex)
          Returns Object.class regardless of columnIndex.
 Boolean getColumnEditable(int column)
          Returns the editable for the specified column index.
 AttributeSet getColumnHeaderAttributes(int column)
          Returns the attributes for the specified column index.
 String getColumnName(int column)
          Returns a default name for the column using spreadsheet conventions: A, B, C, ...
 DataGridModelListener[] getDataGridModelListeners()
          Returns an array of all the data grid model listeners registered on this model.
 Cell[] getFormulaCells()
          Returns all formula cells.
 FormulaContext getFormulaContext(int row, int column)
          Returns the FormulaContext in use.
 EventListener[] getListeners(Class listenerType)
          Returns an array of all the objects currently registered as FooListeners upon this AbstractTableModel.
 AttributeSet getRowAttributes(int row)
          Returns the attributes for the specified row index.
 Boolean getRowEditable(int row)
          Returns the editable for the specified row index.
 AttributeSet getRowHeaderAttributes(int row)
          Returns the attributes for the specified row index.
 Cell[] getSpannedCells()
          Returns all spanned cells.
 char getStringEscapeChar()
          Returns the string escape char.
 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.
 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 isColumnEditable(int column)
          Returns the editable for the specified column index.
 boolean isRowEditable(int row)
          Returns the editable for the specified row index.
 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)
          Removes a listener from the list that's 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 setAutoCalculateFormula(boolean b)
          Sets the auot calculate formula property, default is true.
 void setAutoSetsCellClass(boolean setsClass)
          Sets the auto sets cell class property.
 void setAutoSetsCellValue(boolean setsValue)
          Sets the auto sets cell value property.
 void setCellAttributes(AttributeSet attributes, Cell c)
          Sets the cell attributes.
 void setCellClass(Class cc, Cell c)
          Sets the cell class.
 void setColumnAttributes(AttributeSet attributes, int column)
          Sets the attributes for the specified column index.
 void setColumnEditable(boolean editable, int column)
          Sets the editable for the specified column index.
 void setColumnHeaderAttributes(AttributeSet attributes, int column)
          Sets the attributes for the specified column header index.
 void setRowAttributes(AttributeSet attributes, int row)
          Sets the attributes for the specified row index.
 void setRowEditable(boolean editable, int row)
          Sets the editable for the specified row index.
 void setRowHeaderAttributes(AttributeSet attributes, int row)
          Sets the attributes for the specified row header index.
 void setStringEscapeChar(char c)
          Sets the string escape char.
 boolean split(Cell c)
          Splits the cell.
 void startUndoableEdit(Cell undoCell, Cell redoCell)
          Starts the undoable edit.
 DataGridModel toModel(Cell c)
          Converts the cell area to the model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.zfqjava.swing.DataGridModel
getCellAttributes, getCellClass, setCellAttributes, setCellClass, setCellEditable, setColumnClass, setColumnCount, setColumnName, setRowCount
 
Methods inherited from interface javax.swing.table.TableModel
getColumnCount, getRowCount, getValueAt, isCellEditable, setValueAt
 

Field Detail

listenerList

protected transient EventListenerList listenerList
List of listeners

Constructor Detail

AbstractDataGridModel

public AbstractDataGridModel()
Method Detail

setAutoSetsCellClass

public void setAutoSetsCellClass(boolean setsClass)
Sets the auto sets cell class property.

Parameters:
setsClass - the auto sets cell class property
Since:
JDataGrid 1.6.1
See Also:
getAutoSetsCellClass()

getAutoSetsCellClass

public boolean getAutoSetsCellClass()
Returns the auto sets cell class property.

Returns:
the auto sets cell class property
Since:
JDataGrid 1.6.1
See Also:
setAutoSetsCellClass(boolean)

setAutoSetsCellValue

public void setAutoSetsCellValue(boolean setsValue)
Sets the auto sets cell value property.

Parameters:
setsValue - the auto sets cell value property
Since:
JDataGrid 1.6.1
See Also:
getAutoSetsCellValue()

getAutoSetsCellValue

public boolean getAutoSetsCellValue()
Returns the auto sets cell value property.

Returns:
the auto sets cell value property
Since:
JDataGrid 1.6.1
See Also:
setAutoSetsCellValue(boolean)

setStringEscapeChar

public void setStringEscapeChar(char c)
Sets the string escape char.

Parameters:
c - the string escape char
Since:
JDataGrid 1.6.1
See Also:
getStringEscapeChar()

getStringEscapeChar

public char getStringEscapeChar()
Returns the string escape char.

Returns:
the string escape char
Since:
JDataGrid 1.6.1
See Also:
setStringEscapeChar(char)

setAutoCalculateFormula

public void setAutoCalculateFormula(boolean b)
Sets the auot calculate formula property, default is true.

Parameters:
b - true if auto calculate formula enabled
Since:
JDataGrid 1.8
See Also:
getAutoCalculateFormula()

getAutoCalculateFormula

public boolean getAutoCalculateFormula()
Returns the auot calculate formula property, default is true.

Returns:
true if the auto calculate formula enabled
Since:
JDataGrid 1.8
See Also:
setAutoCalculateFormula(boolean)

calculateFormula

public void calculateFormula()
Calculate the formula cells.

Since:
JDataGrid 1.8

startUndoableEdit

public final void startUndoableEdit(Cell undoCell,
                                    Cell redoCell)
Starts the undoable edit. All undoable edit after this will be added into this edit. To use this method effectively, should always try the following code:
 try {
     startUndoableEdit(edit);
     // do something
 } finally {
     endUndoableEdit();
 }
 

Parameters:
undoCell - the compound edit undo cell
redoCell - the compound edit redo cell
Since:
JDataGrid 1.8
See Also:
endUndoableEdit()

endUndoableEdit

public final void endUndoableEdit()
Ends the undoable edit.All undoable edit before this edit will be fired to the UndoableEditListener. To use this method effectively, should always try the following code:
 try {
     startUndoableEdit(edit);
     // do something
 } finally {
     endUndoableEdit();
 }
 

Since:
JDataGrid 1.8
See Also:
startUndoableEdit()

hasCellSpans

public boolean hasCellSpans(int rowIndex,
                            int columnIndex)
Description copied from interface: DataGridModel
Returns true if has cell spans the specified cell at rowIndex and columnIndex.

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

getCellSpans

public Cell getCellSpans(int rowIndex,
                         int columnIndex)
Description copied from interface: DataGridModel
Returns the cell that spans the specified cell at rowIndex and columnIndex.

Specified by:
getCellSpans in interface CellSpanModel
Specified by:
getCellSpans in interface DataGridModel
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:
DataGridModel.hasCellSpans(int,int)

hasCellSpans

public boolean hasCellSpans(int firstRow,
                            int lastRow,
                            int firstColumn,
                            int lastColumn)
Description copied from interface: DataGridModel
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
Specified by:
hasCellSpans in interface DataGridModel
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:
DataGridModel.getCellSpans(int,int,int,int)

getCellSpans

public Cell[] getCellSpans(int firstRow,
                           int lastRow,
                           int firstColumn,
                           int lastColumn)
Description copied from interface: DataGridModel
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
Specified by:
getCellSpans in interface DataGridModel
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:
DataGridModel.hasCellSpans(int,int,int,int)

isSpannedCell

public boolean isSpannedCell(Cell c)
Description copied from interface: DataGridModel
Determines whether the cell is spanned cell.

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

getSpannedCells

public Cell[] getSpannedCells()
Description copied from interface: DataGridModel
Returns all spanned cells.

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

merge

public boolean merge(Cell c)
Description copied from interface: DataGridModel
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
Specified by:
merge in interface DataGridModel
Parameters:
c - the cell
Returns:
true if this model changed as a result of the call
See Also:
DataGridModel.split(com.zfqjava.swing.cell.Cell)

split

public boolean split(Cell c)
Description copied from interface: DataGridModel
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
Specified by:
split in interface DataGridModel
Parameters:
c - the cell
Returns:
true if this model changed as a result of the call
See Also:
DataGridModel.merge(com.zfqjava.swing.cell.Cell)

setCellAttributes

public void setCellAttributes(AttributeSet attributes,
                              Cell c)
Sets the cell attributes.

Parameters:
attributes - the cell attributes
c - the cell area
Since:
JDataGrid 1.5.1
See Also:
DataGridModel.getCellAttributes(int, int)

setCellClass

public void setCellClass(Class cc,
                         Cell c)
Sets the cell class.

Parameters:
cc - the cell class
c - the cell area
Since:
JComponentPack 1.2.0
See Also:
DataGridModel.getCellClass(int, int)

fillCellAttributes

public boolean fillCellAttributes(Cell c,
                                  List[] l)
Fills the cell attributes of the cell area c use the specified data.

Parameters:
c - the cell area
l - the cell data
Returns:
true if this model changed as a result of the call
Throws:
IllegalArgumentException - if the cell area out of the model row and column count or list data is not enough
Since:
JDataGrid 1.7

clear

public boolean clear(Cell c)
Clears the cell data for the specified cell area c.

Parameters:
c - the cell area
Returns:
true if this model changed as a result of the call
Since:
JDataGrid 1.5

fill

public boolean fill(Cell c,
                    TableModel model)
Fills the cell area c use the specified data.

Parameters:
c - the cell area
model - the cell data
Returns:
true if this model changed as a result of the call
Since:
JDataGrid 1.5

toModel

public DataGridModel toModel(Cell c)
Converts the cell area to the model. Return a new instance when invoke this method every time.

Parameters:
c - the cell area
Returns:
the model contains the data of the cell area
Since:
JDataGrid 1.5

getFormulaCells

public Cell[] getFormulaCells()
Returns all formula cells.

Returns:
all formula cells
Since:
JDataGrid 1.5.1

setRowAttributes

public void setRowAttributes(AttributeSet attributes,
                             int row)
Sets the attributes for the specified row index.

Parameters:
attributes - the row attributes
Since:
JDataGrid 2.1.5

getRowAttributes

public AttributeSet getRowAttributes(int row)
Returns the attributes for the specified row index.

Parameters:
row - the specified row index
Returns:
the attributes for the specified row index
Since:
JDataGrid 2.1.5

setRowEditable

public void setRowEditable(boolean editable,
                           int row)
Sets the editable for the specified row index.

Parameters:
editable - the row editable
Since:
JDataGrid 2.1.5

isRowEditable

public boolean isRowEditable(int row)
Returns the editable for the specified row index.

Parameters:
row - the specified row index
Returns:
the editable for the specified row index
Since:
JDataGrid 2.1.5

getRowEditable

public Boolean getRowEditable(int row)
Returns the editable for the specified row index.

Parameters:
row - the specified row index
Returns:
the editable for the specified row index
Since:
JDataGrid 2.1.5

setRowHeaderAttributes

public void setRowHeaderAttributes(AttributeSet attributes,
                                   int row)
Sets the attributes for the specified row header index.

Parameters:
attributes - the row header attributes
Since:
JDataGrid 2.1.5

getRowHeaderAttributes

public AttributeSet getRowHeaderAttributes(int row)
Returns the attributes for the specified row index.

Parameters:
row - the specified row index
Returns:
the attributes for the specified row index
Since:
JDataGrid 2.1.5

setColumnAttributes

public void setColumnAttributes(AttributeSet attributes,
                                int column)
Sets the attributes for the specified column index.

Parameters:
attributes - the column attributes
Since:
JDataGrid 2.1.5

getColumnAttributes

public AttributeSet getColumnAttributes(int column)
Returns the attributes for the specified column index.

Parameters:
column - the specified column index
Returns:
the attributes for the specified column index
Since:
JDataGrid 2.1.5

setColumnEditable

public void setColumnEditable(boolean editable,
                              int column)
Sets the editable for the specified column index.

Parameters:
editable - the column editable
Since:
JDataGrid 2.1.5

isColumnEditable

public boolean isColumnEditable(int column)
Returns the editable for the specified column index.

Parameters:
column - the specified column index
Returns:
the editable for the specified column index
Since:
JDataGrid 2.1.5

getColumnEditable

public Boolean getColumnEditable(int column)
Returns the editable for the specified column index.

Parameters:
column - the specified column index
Returns:
the editable for the specified column index
Since:
JDataGrid 2.1.5

getCellEditable

public Boolean getCellEditable(int rowIndex,
                               int columnIndex)
Returns the editable property for the specified cell at rowIndex and columnIndex.

Parameters:
rowIndex - the row whose value to be queried
columnIndex - the column whose value to be queried
Returns:
the editable property for the specified cell
Since:
JDataGrid 2.1.5
See Also:
TableModel.setValueAt(java.lang.Object, int, int), DataGridModel.setCellEditable(boolean,int,int)

setColumnHeaderAttributes

public void setColumnHeaderAttributes(AttributeSet attributes,
                                      int column)
Sets the attributes for the specified column header index.

Parameters:
attributes - the column header attributes
Since:
JDataGrid 2.1.5

getColumnHeaderAttributes

public AttributeSet getColumnHeaderAttributes(int column)
Returns the attributes for the specified column index.

Parameters:
column - the specified column index
Returns:
the attributes for the specified column index
Since:
JDataGrid 2.1.5

getColumnName

public String getColumnName(int column)
Returns a default name for the column using spreadsheet conventions: A, B, C, ... Z, AA, AB, etc. If column cannot be found, returns an empty string.

Specified by:
getColumnName in interface TableModel
Parameters:
column - the column being queried
Returns:
a string containing the default name of column

getColumnClass

public Class getColumnClass(int columnIndex)
Returns Object.class regardless of columnIndex.

Specified by:
getColumnClass in interface TableModel
Parameters:
columnIndex - the column being queried
Returns:
the Object.class

addTableModelListener

public void addTableModelListener(TableModelListener l)
Adds a listener to the list that's notified each time a change to the data model occurs.

Specified by:
addTableModelListener in interface TableModel
Parameters:
l - the TableModelListener

removeTableModelListener

public void removeTableModelListener(TableModelListener l)
Removes a listener from the list that's notified each time a change to the data model occurs.

Specified by:
removeTableModelListener in interface TableModel
Parameters:
l - the TableModelListener

getTableModelListeners

public TableModelListener[] getTableModelListeners()
Returns an array of all the table model listeners registered on this model.

Returns:
all of this model's TableModelListeners or an empty array if no table model listeners are currently registered
See Also:
addTableModelListener(javax.swing.event.TableModelListener), removeTableModelListener(javax.swing.event.TableModelListener)

fireTableDataChanged

protected void fireTableDataChanged()
Notifies all listeners that all cell values in the table's rows may have changed. The number of rows may also have changed and the 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.

See Also:
TableModelEvent, EventListenerList, JTable.tableChanged(TableModelEvent)

fireTableStructureChanged

protected void fireTableStructureChanged()
Notifies all listeners that the table's structure has changed. The number of columns in the table, and the names and types of the new columns may be different from the previous state. If the JTable receives this event and its autoCreateColumnsFromModel flag is set it discards any table columns that it had and reallocates default columns in the order they appear in the model. This is the same as calling setModel(TableModel) on the JTable.

See Also:
TableModelEvent, EventListenerList

fireTableRowsInserted

protected void fireTableRowsInserted(int firstRow,
                                     int lastRow)
Notifies all listeners that rows in the range [firstRow, lastRow], inclusive, have been inserted.

Parameters:
firstRow - the first row
lastRow - the last row
See Also:
TableModelEvent, EventListenerList

fireTableRowsUpdated

protected void fireTableRowsUpdated(int firstRow,
                                    int lastRow)
Notifies all listeners that rows in the range [firstRow, lastRow], inclusive, have been updated.

Parameters:
firstRow - the first row
lastRow - the last row
See Also:
TableModelEvent, EventListenerList

fireTableRowsDeleted

protected void fireTableRowsDeleted(int firstRow,
                                    int lastRow)
Notifies all listeners that rows in the range [firstRow, lastRow], inclusive, have been deleted.

Parameters:
firstRow - the first row
lastRow - the last row
See Also:
TableModelEvent, EventListenerList

fireTableColumnsInserted

protected void fireTableColumnsInserted(int firstColumn,
                                        int lastColumn)
Notifies all listeners that columns in the range [firstColumn, lastColumn], inclusive, have been inserted.

Parameters:
firstColumn - the first column
lastColumn - the last column
Since:
JDataGrid 1.1
See Also:
TableModelEvent, EventListenerList

fireTableColumnsUpdated

protected void fireTableColumnsUpdated(int firstColumn,
                                       int lastColumn)
Notifies all listeners that columns in the range [firstColumn, lastColumn], inclusive, have been updated.

Parameters:
firstColumn - the first column
lastColumn - the last column
Since:
JDataGrid 1.1
See Also:
TableModelEvent, EventListenerList

fireTableColumnsDeleted

protected void fireTableColumnsDeleted(int firstColumn,
                                       int lastColumn)
Notifies all listeners that columns in the range [firstColumn, lastColumn], inclusive, have been deleted.

Parameters:
firstColumn - the first column
lastColumn - the last column
Since:
JDataGrid 1.1
See Also:
TableModelEvent, EventListenerList

fireTableColumnUpdated

protected void fireTableColumnUpdated(int column)
Notifies all listeners that the value of the colum at column has been updated.

Parameters:
column - column which has been updated
See Also:
TableModelEvent, EventListenerList

fireTableRowUpdated

protected void fireTableRowUpdated(int row)
Notifies all listeners that the value of the row at row has been updated.

Parameters:
row - row which has been updated
Since:
JDataGrid 1.1
See Also:
TableModelEvent, EventListenerList

fireTableCellUpdated

protected void fireTableCellUpdated(int row,
                                    int column)
Notifies all listeners that the value of the cell at [row, column] has been updated.

Parameters:
row - row of cell which has been updated
column - column of cell which has been updated
See Also:
TableModelEvent, EventListenerList

fireTableChanged

protected void fireTableChanged(TableModelEvent e)
Forwards the given notification event to all TableModelListeners that registered themselves as listeners for this table model.

Parameters:
e - the event to be forwarded
See Also:
addTableModelListener(javax.swing.event.TableModelListener), TableModelEvent, EventListenerList

addDataGridModelListener

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

Specified by:
addDataGridModelListener in interface DataGridModel
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.

Specified by:
removeDataGridModelListener in interface DataGridModel
Parameters:
l - the DataGridModelListener

getDataGridModelListeners

public DataGridModelListener[] getDataGridModelListeners()
Returns an array of all the data grid model listeners registered on this model.

Returns:
all of this model's DataGridModelListeners or an empty array if no data grid model listeners are currently registered
See Also:
addDataGridModelListener(com.zfqjava.swing.event.DataGridModelListener), removeDataGridModelListener(com.zfqjava.swing.event.DataGridModelListener)

fireCellAttributesChanged

protected void fireCellAttributesChanged(int rowIndex,
                                         int columnIndex)
Notifies all listeners that cell attributes have been changed.

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

fireCellAttributesChanged

protected void fireCellAttributesChanged(Cell c)
Notifies all listeners that cell attributes have been changed.

Parameters:
c - the specified cell
Since:
JDataGrid 1.1
See Also:
fireCellChanged(int, int)

fireCellClassChanged

protected void fireCellClassChanged(int rowIndex,
                                    int columnIndex)
Notifies all listeners that cell class have been changed.

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

fireCellClassChanged

protected void fireCellClassChanged(Cell c)
Notifies all listeners that cell class have been changed.

Parameters:
c - the specified cell
Since:
JDataGrid 1.1
See Also:
fireCellChanged(int, int)

fireCellEditableChanged

protected void fireCellEditableChanged(int rowIndex,
                                       int columnIndex)
Notifies all listeners that cell editable have been changed.

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

fireCellEditableChanged

protected void fireCellEditableChanged(Cell c)
Notifies all listeners that cell editable have been changed.

Parameters:
c - the specified cell
Since:
JDataGrid 1.1
See Also:
fireCellChanged(int, int)

fireCellSpanChanged

protected void fireCellSpanChanged(Cell c)
Notifies all listeners that cell span have been changed.

Parameters:
c - the spanned cell
See Also:
fireCellChanged(int, int)

fireCellSpanChanged

protected void fireCellSpanChanged(int firstRow,
                                   int lastRow,
                                   int firstColumn,
                                   int lastColumn)
Notifies all listeners that cell span have been changed.

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

fireCellValueChanged

protected void fireCellValueChanged(Cell c)
Notifies all listeners that cell value have been changed.

Parameters:
c - the specified cell
Since:
JDataGrid 1.1
See Also:
fireCellChanged(int, int)

fireCellValueChanged

protected void fireCellValueChanged(int rowIndex,
                                    int columnIndex)
Notifies all listeners that cell value have been changed.

Parameters:
rowIndex - the specified cell row index
columnIndex - the specified cell column index
Since:
JDataGrid 1.2
See Also:
fireCellChanged(int, int)

fireCellChanged

protected void fireCellChanged(int rowIndex,
                               int columnIndex)
Notifies all listeners that cell have been changed.

Parameters:
rowIndex - the specified cell row index
columnIndex - the specified cell column index
Since:
JDataGrid 1.5
See Also:
fireCellChanged(int, int)

fireCellChanged

protected void fireCellChanged(Cell c)
Notifies all listeners that all cell object have been changed.

Parameters:
c - the specified cell
Since:
JDataGrid 1.1
See Also:
fireCellChanged(int, int)

fireCellChanged

protected void fireCellChanged(DataGridModelEvent e)
Notifies all listeners that cell have been changed.


addUndoableEditListener

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

Specified by:
addUndoableEditListener in interface DataGridModel
Parameters:
l - the observer to register
See Also:
UndoableEditEvent

removeUndoableEditListener

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

Specified by:
removeUndoableEditListener in interface DataGridModel
Parameters:
l - the observer to register
See Also:
UndoableEditEvent

getUndoableEditListeners

public UndoableEditListener[] getUndoableEditListeners()
Returns an array of all the undoable edit listeners registered on this model.

Returns:
all of this model's UndoableEditListeners or an empty array if no undoable edit listeners are currently registered
See Also:
addUndoableEditListener(javax.swing.event.UndoableEditListener), removeUndoableEditListener(javax.swing.event.UndoableEditListener)

fireUndoableEditHappened

protected void fireUndoableEditHappened(UndoableEdit edit)
Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.

Parameters:
edit - the undoable edit
See Also:
EventListenerList

addCellSpanListener

public void addCellSpanListener(CellSpanListener l)
Description copied from interface: CellSpanModel
Adds a listener to the list that is notified each time a change to the cell span model occurs.

Specified by:
addCellSpanListener in interface CellSpanModel
Parameters:
l - the CellSpanListener

removeCellSpanListener

public void removeCellSpanListener(CellSpanListener l)
Description copied from interface: CellSpanModel
Removes a listener from the list that is notified each time a change to the cell span model occurs.

Specified by:
removeCellSpanListener in interface CellSpanModel
Parameters:
l - the CellSpanListener

getCellSpanListeners

public CellSpanListener[] getCellSpanListeners()
Returns an array of all the table model listeners registered on this model.

Returns:
all of this model's CellSpanListeners or an empty array if no table model listeners are currently registered
See Also:
addCellSpanListener(com.zfqjava.swing.event.CellSpanListener), removeCellSpanListener(com.zfqjava.swing.event.CellSpanListener)

fireCellMerged

protected void fireCellMerged(Cell c)
Forwards the given notification event to all CellSpanListeners that registered themselves as listeners for this cell span model.

Parameters:
e - the event to be forwarded
See Also:
addCellSpanListener(com.zfqjava.swing.event.CellSpanListener), EventListenerList

fireCellSplitted

protected void fireCellSplitted(Cell c)
Forwards the given notification event to all CellSpanListeners that registered themselves as listeners for this cell span model.

Parameters:
e - the event to be forwarded
See Also:
addCellSpanListener(com.zfqjava.swing.event.CellSpanListener), EventListenerList

getListeners

public EventListener[] getListeners(Class listenerType)
Returns an array of all the objects currently registered as 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.

Parameters:
listenerType - the type of listeners requested; this parameter should specify an interface that descends from java.util.EventListener
Returns:
an array of all objects registered as FooListeners on this component, or an empty array if no such listeners have been added
Throws:
ClassCastException - if listenerType doesn't specify a class or interface that implements java.util.EventListener
See Also:
getTableModelListeners()

getFormulaContext

public FormulaContext getFormulaContext(int row,
                                        int column)
Returns the FormulaContext in use.

Parameters:
row - the row index for the specified cell
column - the column index for the specified cell
Since:
JDataGrid 2.0

JComponentPack 1.5.0

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