borland.jbcl Packages borland.jbcl Class Hierarchy borland.jbcl.model
java.lang.Object +----java.util.EventObject +----borland.jbcl.util.DispatchableEvent +----borland.jbcl.model.ModelEvent +----borland.jbcl.model.MatrixModelEvent
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.
public static final int COLUMN_ADDED = STRUCTURE_CHANGED | 0x0030A column was added changing the structure of the matrix.
public static final int COLUMN_CHANGED = CONTENT_CHANGED | 0x0040The contents of a column changed and therefore the contents of the matrix changed.
public static final int COLUMN_REMOVED = STRUCTURE_CHANGED | 0x0040A column was deleted changing the structure of the matrix.
public static final int CONTENT_CHANGED = ModelEvent.CONTENT_CHANGEDThe content of the matrix changed.
public static final int ITEM_CHANGED = CONTENT_CHANGED | 0x0010The value of the data item changed and therefore the contents of the matrix changed.
public static final int ITEM_TOUCHED = CONTENT_CHANGED | 0x0020The data item was manipulated.
public static final int ROW_ADDED = STRUCTURE_CHANGED | 0x0010A row was added to the matrix changing its structure.
public static final int ROW_CHANGED = CONTENT_CHANGED | 0x0030The contents of a row changed and therefore the contents of the matrix.
public static final int ROW_REMOVED = STRUCTURE_CHANGED | 0x0020A row was deleted changing the structure of the matrix.
public static final int STRUCTURE_CHANGED = ModelEvent.STRUCTURE_CHANGEDThe structure of the matrix changed.
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:
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:
public int getChange()Returns the type of change that occurred. The integer returned is the value of one of the MatrixModelEvent variables.
public MatrixLocation getLocation()Returns the location within the matrix where this event occurred.
public MatrixModel getModel()Returns the matrix model object in which the event occurred.
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:
Overrides: borland.jbcl.util.DispatchableEvent.dispatch(java.util.EventListener)
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()