borland Packages  Class Hierarchy  jbcl.model Package  Index 

BasicMatrixContainer component

java.lang.Object
   +----borland.jbcl.model.BasicMatrixContainer

About the BasicMatrixContainer component

Constructors  Properties  Methods  Event Listeners

Implements MatrixModel, WritableMatrixModel, Serializable

This container provides read-write access to data items stored in a two-dimension array, such as that used by a grid. Use BasicMatrixContainer in composing new model-view components that need a simple read-write model.

Use the items property to access the data items in the matrix. The number of columns and the number of rows in the matrix are contained in the columnCount and rowCount properties, respectively. Whether the number of columns and rows in the matrix can change depends on the setting of the variableColumns and variableRows properties.


BasicMatrixContainer constructors

BasicMatrixContainer properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.lang.Object

BasicMatrixContainer methods

Methods implemented in this class

Methods implemented in java.lang.Object

BasicMatrixContainer event listeners


BasicMatrixContainer constructors

BasicMatrixContainer()

  public BasicMatrixContainer()
Constructs a BasicMatrixContainer object.

BasicMatrixContainer(int, int)

  public BasicMatrixContainer(int rows, int columns)
Constructs a BasicMatrixContainer object that uses the rows and columns parmeters to create a two-dimensional array (a matrix) to hold the data items.

BasicMatrixContainer(java.lang.Object[][])

  public BasicMatrixContainer(java.lang.Object[][] newItems)
Constructs a BasicMatrixContainer object from the passed two-dimensional array of objects (a matrix) in the newItems parameter. This constructor creates a copy of the passed matrix.

Parameters:

newItems
A two-dimensional array of data objects.

BasicMatrixContainer properties

columnCount

 public int getColumnCount()
 public void setColumnCount(int columnCount)
Used to obtain and set the number of columns in the matrix.

Parameters:

columnCount
The number of columns you want in the matrix.

items

 public Object[][] getItems()
 public void setItems(java.lang.Object[][] newItems)
Used to obtain and set the data objects in the matrix. When items is set, a structure-changed MatrixModelEvent is generated and sent to matrix-model listeners.

Parameters:

newItems
A two-dimensional array of data objects.

rowCount

 public int getRowCount()
 public void setRowCount(int rowCount)
Used to retrieve and set the number of rows in the matrix. Setting rowCount generates a structure-changed MatrixModelEvent is generated and set to matrix-model listeners.

Parameters:

rowCount
The number of rows you want in the matrix.

variableColumns

 public boolean isVariableColumns()
 public void setVariableColumns(boolean variable)
Determines whether the number of columns in the matrix can vary. If variableColumns is true, the columns can be added and removed from the matrix. If it is false, the number of columns cannot change.

Parameters:

variable
Set variable to true to allow the number of columns to change in the matrix; set it to false if you don't want the number of columns to change.

variableRows

 public boolean isVariableRows()
 public void setVariableRows(boolean variable)
Determines whether the number of rows in the matrix can vary. If variableRows is true, the rows can be added and removed from the matrix. If it is false, the number of rows cannot change.

Parameters:

variable
Set variable to true to allow the number of rows to change in the matrix; set it to false if you don't want the number of rows to change.

BasicMatrixContainer methods

processModelEvent(borland.jbcl.model.MatrixModelEvent)

  protected void processModelEvent(borland.jbcl.model.MatrixModelEvent e)
This method is called when a content-change or structure-change model event occurs in the matrix container. It sends a copy of the event object to registered listeners for matrix-model events.

BasicMatrixContainer event listeners

This component 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)