jbcl.model Package
java.lang.Object +----com.borland.jbcl.model.GraphModelMulticaster
Properties Methods
Implements GraphModelListener, EventListener
A component that dispatches graph-model events to multiple listeners. GraphModelMulticaster
maintains an array of listeners. The add()
, remove()
, and find()
methods are used to manage this list.
The hasListeners()
method determines whether any objects are listening for graph-model events. The dispatch()
method sends a graph-model event to all listeners.
A GraphModelMulticaster
component is not required to synchronize its access of the array of listeners because all changes are made to a copy of the original list.
public final synchronized void add(GraphModelListener listener)Adds an object to the array of listeners.
Parameters:
listener
public final void dispatch(GraphModelEvent e)Sends a graph-model event to all listeners. This is a high-speed dispatcher that does not need to be synchronized. If the event ID is CONTENT_CHANGED, it calls the
modelContentChanged()
method of the graph-model listeners. If the event ID is STRUCTURE_CHANGED, it calls the modelStructureChanged()
method of the graph-model listeners.
Parameters:
e
public int find(GraphModelListener listener)Searches for the specified listener among the array of listening objects.
Parameters:
listener
public final boolean hasListeners()Determines if there are any listeners for graph-model events. If the method returns true, one or more listeners are present.
public final synchronized void remove(GraphModelListener listener)Removes the specified listening object from the array of listeners for graph-model events.
Parameters:
listener