jbcl.model Package
java.lang.Object +----java.util.EventObject +----com.borland.jb.util.DispatchableEvent +----com.borland.jbcl.model.ModelEvent +----com.borland.jbcl.model.GraphModelEvent
Variables Constructors Properties Methods
Implements Serializable
A GraphModelEvent
object is created whenever a model event occurs in a graph-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 node is added to the graph). 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.
GraphModelEvent
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 node being added to a graph or a node being removed.
The change
property returns the event that occurred, the location
property returns the location where the event occurred, and the model
property returns the GraphModel
in which the event took place.
public static final int CONTENT_CHANGED = ModelEvent.CONTENT_CHANGEDThe content of the graph changed. This is a content-change event.
public static final int ITEM_CHANGED = CONTENT_CHANGED | 0x0010The value of a data item changed. This is a content-change event.
public static final int ITEM_TOUCHED = CONTENT_CHANGED | 0x0020The data item was manipulated. This is a content-change event.
public static final int NODE_ADDED = STRUCTURE_CHANGED | 0x0010A node was added to the graph. This is a structure-change event.
public static final int NODE_REMOVED = STRUCTURE_CHANGED | 0x0020A node was removed from the graph. This is a structure-change event.
public static final int NODE_REPLACED = STRUCTURE_CHANGED | 0x0030One node was replaced with another. This is a structure-change event.
public static final int STRUCTURE_CHANGED = ModelEvent.STRUCTURE_CHANGEDThe structure of the graph changed. This is a structure-change event.
public GraphModelEvent(GraphModel model, int change)Constructs a
GraphModelEvent
object, which contains the graph-model object that generates the event and the type of event that occurred.
Parameters:
model
change
GraphModelEvent
variables.
public GraphModelEvent(GraphModel model, int change, GraphLocation location)Constructs a
GraphModelEvent
object, which contains the component that generates the event, the type of event that occurred, and the location where the event occurred.
Parameters:
model
change
change
as one of the GraphModelEvent
variables.
location
GraphLocation
object.
public int getChange()Returns the type of change that triggers the event. The integer returned is one of the
GraphModelEvent
variables.
public GraphLocation getLocation()Returns the location where the event occurred.
public GraphModel getModel()Returns the graph-model object that generates this event.
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
Overrides: com.borland.jb.util.DispatchableEvent.dispatch(java.util.EventListener)
protected String paramString()Appends
GraphModelEvent
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: com.borland.jbcl.model.ModelEvent.paramString()