jbcl.model Package 

AbstractMatrixModel component

java.lang.Object
   +----com.borland.jbcl.model.AbstractMatrixModel

About the AbstractMatrixModel component

Constructors  Properties  Methods  Event Listeners

Implements MatrixModel, Serializable

AbstractMatrixModel is an abstract implementation of the MatrixModel interface. It provides the event management for a MatrixModel implementor.

To create a fully functional read-only MatrixModel, subclass AbstractMatrixModel, and implement these methods:

To create a fully functional read/write MatrixModel (WritableMatrixModel), be sure to add "implements WritableMatrixModel" to your class definition, and implement the following methods:

The find(Object data) method of AbstractMatrixModel always returns -1; therefore, it cannot find items in the matrix. To be able to locate items in this matrix, override this method and search for the passed data object in your matrix data structure.


AbstractMatrixModel constructors

AbstractMatrixModel properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.lang.Object

AbstractMatrixModel methods

Methods implemented in this class

Methods implemented in java.lang.Object

AbstractMatrixModel event listeners


AbstractMatrixModel constructors

AbstractMatrixModel()

  public AbstractMatrixModel()
An empty constructor for this abstract class.

AbstractMatrixModel properties

variableColumns

 public boolean isVariableColumns()
Returns true, meaning that the matrix model permits the addition and removal of columns. To prevent columns from being added or removed, override this method and have it return false.

variableRows

 public boolean isVariableRows()
Returns true, meaning that the matrix model permits the addition and removal of rows. To prevent rows from being added or removed, override this method and have it return false.

AbstractMatrixModel methods

canSet(int, int, boolean)

  public boolean canSet(int row, int column, boolean startEdit)
Returns true, which means that the item in the model specified with the row and column paramters can be edited. This is usually desirable if the model is being used as a WritableMatrixModel. To prevent the item from being edited, override this method and have it return false.

enableModelEvents(boolean)

  public void enableModelEvents(boolean enable)
Determines whether events are enabled for this graph model class. If the enable parameter is true, events are enabled and a structure-changed event is fired. If the enable parameter is false, events are not enabled.

fireColumnAdded(int)

  protected void fireColumnAdded(int column)
This event fires when a new column is added to the matrix.

fireColumnChanged(int)

  protected void fireColumnChanged(int column)
This event fires when an entire column in the matrix has changed.

fireColumnRemoved(int)

  protected void fireColumnRemoved(int column)
This event fires when a column is removed from the matrix.

fireContentChanged()

  protected void fireContentChanged()
This event fires when the contents of the entire matrix have changed, but the row count and column count have not changed.

fireItemChanged(int, int)

  protected void fireItemChanged(int row, int column)
This event fires when an item in the matrix has changed.

fireItemTouched(int, int)

  protected void fireItemTouched(int row, int column)
This event fires when an item in the matrix has been touched.

fireRowAdded(int)

  protected void fireRowAdded(int row)
This event fires when a new row is added to the matrix.

fireRowChanged(int)

  protected void fireRowChanged(int row)
This event fires when an entire row in the matrix has changed.

fireRowRemoved(int)

  protected void fireRowRemoved(int row)
This event fires when a row is removed from the matrix.

fireStructureChanged()

  protected void fireStructureChanged()
This event fires when the entire matrix has changed,including changes to row and column counts. fireStructureChanged() notifies all listeners so they can analyze the matrix model again.

touched(int, int)

  public void touched(int row, int column)
Calls fireItemTouched(), notifying all listeners when the item specified with the row and column parameters is touched.

AbstractMatrixModel event listeners

This component is a source for the following event sets.

model

 public void addModelListener(MatrixModelListener listener)
 public void removeModelListener(MatrixModelListener listener)