borland.jbcl Packages  borland.jbcl Class Hierarchy  borland.jbcl.model 

MatrixModelEvent class

java.lang.Object
   +----java.util.EventObject
           +----borland.jbcl.util.DispatchableEvent
                   +----borland.jbcl.model.ModelEvent
                           +----borland.jbcl.model.MatrixModelEvent

About the MatrixModelEvent class

Variables  Constructors  Properties  Methods  

Implements Serializable

A MatrixModelEvent object is created whenever a model event occurs in a matrix-model component. Model events occur when the data in the model changes or when the structure of the data storage changes (for example, when an item is edited or when a row is added). The id property specifies whether the event object was created in response to a modelContentChanged event or to a modelStructureChanged event. Based upon this id the dispatch() method calls the appropriate method in the listening component.

MatrixModelEvent has several variables that distinguish further the type of event that occurred beyond content changes and structure changes. For example, they can be used to specify event occurrences such as a column being added to the matrix or a row being removed.


MatrixModelEvent variables

Variables implemented in this class

Variables implemented in java.util.EventObject

MatrixModelEvent constructors

MatrixModelEvent properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in borland.jbcl.model.ModelEvent

Properties implemented in borland.jbcl.util.DispatchableEvent

Properties implemented in java.lang.Object

Properties implemented in java.util.EventObject

MatrixModelEvent methods

Methods implemented in this class

Methods implemented in borland.jbcl.util.DispatchableEvent

Methods implemented in java.lang.Object


MatrixModelEvent variables

COLUMN_ADDED

  public static final int COLUMN_ADDED = STRUCTURE_CHANGED | 0x0030
A column was added changing the structure of the matrix.

COLUMN_CHANGED

  public static final int COLUMN_CHANGED = CONTENT_CHANGED | 0x0040
The contents of a column changed and therefore the contents of the matrix changed.

COLUMN_REMOVED

  public static final int COLUMN_REMOVED = STRUCTURE_CHANGED | 0x0040
A column was deleted changing the structure of the matrix.

CONTENT_CHANGED

  public static final int CONTENT_CHANGED = ModelEvent.CONTENT_CHANGED
The content of the matrix changed.

ITEM_CHANGED

  public static final int ITEM_CHANGED = CONTENT_CHANGED | 0x0010
The value of the data item changed and therefore the contents of the matrix changed.

ITEM_TOUCHED

  public static final int ITEM_TOUCHED = CONTENT_CHANGED | 0x0020
The data item was manipulated.

ROW_ADDED

  public static final int ROW_ADDED = STRUCTURE_CHANGED | 0x0010
A row was added to the matrix changing its structure.

ROW_CHANGED

  public static final int ROW_CHANGED = CONTENT_CHANGED | 0x0030
The contents of a row changed and therefore the contents of the matrix.

ROW_REMOVED

  public static final int ROW_REMOVED = STRUCTURE_CHANGED | 0x0020
A row was deleted changing the structure of the matrix.

STRUCTURE_CHANGED

  public static final int STRUCTURE_CHANGED = ModelEvent.STRUCTURE_CHANGED
The structure of the matrix changed.

MatrixModelEvent constructors

MatrixModelEvent(borland.jbcl.model.MatrixModel, int)

  public MatrixModelEvent(borland.jbcl.model.MatrixModel model, int change)
Constructs a MatrixModelEvent, setting the model and change properties to the respective arguments. Use this constructor for model events that do not need to specify a location (item) where the change has taken place.

Parameters:

model
The matrix model object that generates the event.
change
The type of change that makes the event occur. Specify the value of change using one of the MatrixModelEvent constants.

MatrixModelEvent(borland.jbcl.model.MatrixModel, int, borland.jbcl.model.MatrixLocation)

  public MatrixModelEvent(borland.jbcl.model.MatrixModel model, int change, borland.jbcl.model.MatrixLocation location)
Constructs a MatrixModelEvent, setting the model, change, and location properties of the event object

Parameters:

model
The matrix model object that generates the event.
change
The type of change that makes the event occur. Specify the value of change using one of the MatrixModelEvent constants.
location
The index of the data item where the change occurred.

MatrixModelEvent properties

change

 public int getChange()
Returns the type of change that occurred. The integer returned is the value of one of the MatrixModelEvent variables.

location

 public MatrixLocation getLocation()
Returns the location within the matrix where this event occurred.

model

 public MatrixModel getModel()
Returns the matrix model object in which the event occurred.

MatrixModelEvent methods

dispatch(java.util.EventListener)

  public void dispatch(java.util.EventListener listener)
Checks the id property and sends copies of the event object to registered model event listeners, calling the modelContentChanged() or modelStructureChanged() methods as appropriate.

Parameters:

listener
Specifies the listener that is notified when the event occurs.

Overrides: borland.jbcl.util.DispatchableEvent.dispatch(java.util.EventListener)

paramString()

  protected String paramString()
Appends MatrixModelEvent parameters to the superclass paramString() method. The parameter string that is appended is:

",model=" + model + ",change=" + changeString + ",location=" + location

The value of changeString is one of the variables displayed as a string. For example, the changeString of ITEM_CHANGED is "ITEM_CHANGED".

Overrides: borland.jbcl.model.ModelEvent.paramString()