borland Packages  Class Hierarchy  jbcl.model Package  Index 

VectorModelEvent class

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

About the VectorModelEvent class

Variables  Constructors  Properties  Methods  

Implements Serializable

A VectorModelEvent object is created whenever a model event occurs in a vector-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 an item is inserted in the middle of the list). 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.

VectorModelEvent 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 an item being added to the vector or an item being removed.


VectorModelEvent variables

Variables implemented in this class

Variables implemented in java.util.EventObject

VectorModelEvent constructors

VectorModelEvent 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

VectorModelEvent methods

Methods implemented in this class

Methods implemented in borland.jbcl.util.DispatchableEvent

Methods implemented in java.lang.Object


VectorModelEvent variables

CONTENT_CHANGED

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

ITEM_ADDED

  public static final int ITEM_ADDED = STRUCTURE_CHANGED | 0x0010
A data item was added to the vector changing the vector's structure.

ITEM_CHANGED

  public static final int ITEM_CHANGED = CONTENT_CHANGED | 0x0010
A data item changed changing the contents.

ITEM_REMOVED

  public static final int ITEM_REMOVED = STRUCTURE_CHANGED | 0x0020
A data item was removed from the vector changing the vector's structure.

ITEM_TOUCHED

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

STRUCTURE_CHANGED

  public static final int STRUCTURE_CHANGED = ModelEvent.STRUCTURE_CHANGED
The vector structure changed.

VectorModelEvent constructors

VectorModelEvent(borland.jbcl.model.VectorModel, int)

  public VectorModelEvent(borland.jbcl.model.VectorModel model, int change)
Constructs a VectorModelEvent, 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 vector 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 VectorModelEvent constants.

VectorModelEvent(borland.jbcl.model.VectorModel, int, int)

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

Parameters:

model
The vector 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 VectorModelEvent constants.
location
The index of the data item where the change occurred.

VectorModelEvent properties

change

 public int getChange()
Specifies the kind of change in the model that has precipitated the event. Accepted values for the change property are listed under VectorModelEvent variables.

location

 public int getLocation()
Specifies the index of the item that has changed, generating the event.

model

 public VectorModel getModel()
Returns the vector-model object in which the event occurred.

VectorModelEvent 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.

paramString()

  protected String paramString()
Appends VectorModelEvent 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 constants displayed as a string. For example, the changeString of ITEM_CHANGED is "ITEM_CHANGED".

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