jbcl.model Package 

AbstractVectorModel component

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

About the AbstractVectorModel component

Constructors  Properties  Methods  Event Listeners

Implements VectorModel, Serializable

AbstractVectorModel is an abstract implementation of the VectorModel interface. It provides the event management for a VectorModel implementor.

To create a fully functional read-only VectorModel, subclass AbstractVectorModel, and implement these methods:

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

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


AbstractVectorModel constructors

AbstractVectorModel properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.lang.Object

AbstractVectorModel methods

Methods implemented in this class

Methods implemented in java.lang.Object

AbstractVectorModel event listeners


AbstractVectorModel constructors

AbstractVectorModel()

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

AbstractVectorModel properties

variableSize

 public boolean isVariableSize()
Returns true, which means that items can be added and removed to the model. This is usually desirable if the model is being used as a WritableVectorModel. To prevent items from being added or removed, override this method and have it return false.

AbstractVectorModel methods

canSet(int, boolean)

  public boolean canSet(int index, boolean startEdit)
Returns true, which means that the item specified with the index parameter can be edited. This is usually desirable if the model is being used as a WritableVectorModel. To prevent items 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 vector 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.

fireContentChanged()

  protected void fireContentChanged()
This event fires when the contents of the entire vector has changed, but the total count of items remains unchanged.

fireItemAdded(int)

  protected void fireItemAdded(int index)
This event fires when a new item is added to the vector.

fireItemChanged(int)

  protected void fireItemChanged(int index)
This event fires when an item in the vector has changed.

fireItemRemoved(int)

  protected void fireItemRemoved(int index)
This event fires when a item is removed from the vector.

fireItemTouched(int)

  protected void fireItemTouched(int index)
This event fires when an item in the vector has been touched.

fireStructureChanged()

  protected void fireStructureChanged()
This event fires when the entire vector has changed, including change in the number of items in the vector.

touched(int)

  public void touched(int index)
Calls fireItemTouched(), notifying listeners that the item specified with the index parameter has been touched.

AbstractVectorModel event listeners

This component is a source for the following event sets.

model

 public void addModelListener(VectorModelListener listener)
 public void removeModelListener(VectorModelListener listener)