jbcl.model Package 

AbstractGraphModel component

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

About the AbstractGraphModel component

Constructors  Properties  Methods  Event Listeners

Implements GraphModel, Serializable

AbstractGraphModel is an abstract implementation of the GraphModel interface. It provides the event management for a GraphModel implementor.

To create a fully functional read-only GraphModel, subclass AbstractGraphModel, and implement these methods:

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

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


AbstractGraphModel constructors

AbstractGraphModel properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.lang.Object

AbstractGraphModel methods

Methods implemented in this class

Methods implemented in java.lang.Object

AbstractGraphModel event listeners


AbstractGraphModel constructors

AbstractGraphModel()

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

AbstractGraphModel 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 WritableGraphModel. To prevent items from being added or removed, override this method and have it return false.

AbstractGraphModel methods

canSet(com.borland.jbcl.model.GraphLocation)

  public boolean canSet(GraphLocation node)
Returns true, which means that item specified with the node parameter in can be edited. This is usually desirable if the model is being used as a WritableGraphModel. 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 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.

fireContentChanged()

  protected void fireContentChanged()
This event fires when the contents of the entire graph has changed, but the item count has not changed.

fireItemChanged(com.borland.jbcl.model.GraphLocation)

  protected void fireItemChanged(GraphLocation node)
This event fires when the specified node in the graph has changed.

fireItemTouched(com.borland.jbcl.model.GraphLocation)

  protected void fireItemTouched(GraphLocation node)
This event fires when an item in the graph has been touched.

fireNodeAdded(com.borland.jbcl.model.GraphLocation)

  protected void fireNodeAdded(GraphLocation node)
This event fires when a new item is added to the graph.

fireNodeRemoved(com.borland.jbcl.model.GraphLocation)

  protected void fireNodeRemoved(GraphLocation node)
This event fires when a item is removed from the graph.

fireNodeReplaced(com.borland.jbcl.model.GraphLocation)

  protected void fireNodeReplaced(GraphLocation node)
This event fires when an entire item in the graph has been replaced.

fireStructureChanged()

  protected void fireStructureChanged()
This event fires when the entire graph has changed, including changes to the node count. fireStructureChanged() notifies all listeners that the model should be analyzed again.

touched(com.borland.jbcl.model.GraphLocation)

  public void touched(GraphLocation node)
Calls fireItemTouched(), notifying listeners that the node has been touched.

AbstractGraphModel event listeners

This component is a source for the following event sets.

model

 public void addModelListener(GraphModelListener listener)
 public void removeModelListener(GraphModelListener listener)