borland Packages  Class Hierarchy  jbcl.model Package  Index 

WritableMatrixModel interface

borland.jbcl.model.MatrixModel
   +----borland.jbcl.model.WritableMatrixModel

About the WritableMatrixModel interface

Properties  Methods  Event Listeners

Implemented by GridControl, MatrixDataSetManager, BasicMatrixContainer

Provides the methods required for a read-write matrix model object; that is, a model that holds data in a two-dimensional array such as a grid. WritableMatrixModel extends the MatrixModel interface and adds the methods needed to add, change, and delete items in the matrix.

Generally, you extend a class that implements this interface, such as BasicMatrixContainer. You can, however, implement the interface directly if you are creating an entirely new component.

If you need read access only, you can choose to implement the MatrixModel interface instead.

To add one or more columns to the matrix, call one of the addColumn() methods. To add one or more rows, call one of the addRow() methods. You can delete columns and rows with the removeColumn(), removeColumns(), removeRow(), and removeRows() methods.

Whether columns can be added or deleted depends on the setting of the variableColumns property. Whether rows can be added or deleted depends on the setting of the variableRows property.


WritableMatrixModel properties

*Read-only properties **Write-only properties

Properties defined in this interface

Properties implemented in borland.jbcl.model.MatrixModel

WritableMatrixModel methods

Methods defined in this interface

Methods implemented in borland.jbcl.model.MatrixModel

WritableMatrixModel event listeners


WritableMatrixModel properties

variableColumns

 public boolean isVariableColumns()
Determines whether columns can be add to or removed from the matrix. If variableColumns is true, columns can be added or removed.

variableRows

 public boolean isVariableRows()
Determines whether rows can be add to or removed from the matrix. If variableRows is true, rows can be added or removed.

WritableMatrixModel methods

addColumn()

  public void addColumn()
Appends a new column after the last column in the matrix.

addColumn(int)

  public void addColumn(int aheadOf)
Inserts a new column into the matrix before the specified column.

Parameters:

aheadOf
A zero-based index value that indicates the location of the column. The new column is inserted before this index. For example, if the value of aheadOf is 4, the new inserted column receives a value of 4 and becomes the fifth column in the matrix. The column represented by aheadOf now has an index value of 5 and is the sixth column in the matrix.

addRow()

  public void addRow()
Appends a new row after the last row.

addRow(int)

  public void addRow(int aheadOf)
Inserts a new row before the specified row.

Parameters:

aheadOf
A zero-based index value that indicates the location of the row. The new row is inserted before this index. For example, if the value of aheadOf is 2, the new inserted row receives a value of 2 and becomes the third row in the matrix. The row represented by aheadOf now has an index value of 3 and is the fourth row in the matrix.

canSet(int, int, boolean)

  public boolean canSet(int row, int column, boolean startEdit)
Determines whether the data object at the specified row and column can be modified. If canSet() returns true, the data object can be changed.

Parameters:

row
A zero-based index that specifies the location of row that contains the data item within the matrix.
column
A zero-based index that specifies the location of column that contains the data item within the matrix.
startEditing
If startEditing is true, the data object can be modified; it is false, the data object can't be changed.

enableModelEvents(boolean)

  public void enableModelEvents(boolean enable)
Determines whether the broadcasting of matrix-model events is enabled or disabled.

Parameters:

enable
If enable is true, the broadcasting of matrix-model events is enabled and a STRUCTURE_CHANGED event is fired to all matrix-model listeners. If it is false, matrix-model events are not broadcast.

removeAllColumns()

  public void removeAllColumns()
Removes all columns in the matrix.

removeAllRows()

  public void removeAllRows()
Removes all rows in the matrix .

removeColumn(int)

  public void removeColumn(int column)
Removes the specified column from the matrix.

Parameters:

column
A zero-based index that specifies the location of the column to be removed in the matrix.

removeRow(int)

  public void removeRow(int row)
Removes the specified row from the matrix.

Parameters:

row
A zero-based index that specifies the location of the row to be removed in the matrix.

set(int, int, java.lang.Object)

  public void set(int row, int column, java.lang.Object data)
Sets the data object at the specified row and column location within the matrix.

Parameters:

row
A zero-based index that specifies the row where the data object is within the matrix.
column
A zero-based index that specifies the column where the data object is within the matrix.

touched(int, int)

  public void touched(int row, int column)
Notifies all matrix-model listeners that the data object at the specified row and column location was manipulated.

Parameters:

index
A zero-based index that specifies row where the data object is within the matrix.
index
A zero-based index that specifies column where the data object is within the matrix.

WritableMatrixModel event listeners

This interface is a source for the following event sets. For information on the JBCL event sets, see Events in JBCL.

model

 public void addModelListener(borland.jbcl.model.MatrixModelListener listener)
 public void removeModelListener(borland.jbcl.model.MatrixModelListener listener)