borland Packages  Class Hierarchy  jbcl.model Package  Index 

GraphModelEvent class

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

About the GraphModelEvent class

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.


GraphModelEvent variables

Variables implemented in this class

Variables implemented in java.util.EventObject

GraphModelEvent constructors

GraphModelEvent 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

GraphModelEvent methods

Methods implemented in this class

Methods implemented in borland.jbcl.util.DispatchableEvent

Methods implemented in java.lang.Object


GraphModelEvent variables

CONTENT_CHANGED

  public static final int CONTENT_CHANGED = ModelEvent.CONTENT_CHANGED
The content of the graph changed. This is a content-change event.

ITEM_CHANGED

  public static final int ITEM_CHANGED = CONTENT_CHANGED | 0x0010
The value of a data item changed. This is a content-change event.

ITEM_TOUCHED

  public static final int ITEM_TOUCHED = CONTENT_CHANGED | 0x0020
The data item was manipulated. This is a content-change event.

NODE_ADDED

  public static final int NODE_ADDED = STRUCTURE_CHANGED | 0x0010
A node was added to the graph. This is a structure-change event.

NODE_REMOVED

  public static final int NODE_REMOVED = STRUCTURE_CHANGED | 0x0020
A node was removed from the graph. This is a structure-change event.

NODE_REPLACED

  public static final int NODE_REPLACED = STRUCTURE_CHANGED | 0x0030
One node was replaced with another. This is a structure-change event.

STRUCTURE_CHANGED

  public static final int STRUCTURE_CHANGED = ModelEvent.STRUCTURE_CHANGED
The structure of the graph changed. This is a structure-change event.

GraphModelEvent constructors

GraphModelEvent(borland.jbcl.model.GraphModel, int)

  public GraphModelEvent(borland.jbcl.model.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
The component that generates the event.
change
The type of event that occurred. Specify change as one of the GraphModelEvent variables.

GraphModelEvent(borland.jbcl.model.GraphModel, int, borland.jbcl.model.GraphLocation)

  public GraphModelEvent(borland.jbcl.model.GraphModel model, int change, borland.jbcl.model.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
The component that generates the event.
change
The type of event that occurred. Specify change as one of the GraphModelEvent variables.
location
The location where the event occurred specified as a GraphLocation object.

GraphModelEvent properties

change

 public int getChange()
Returns the type of change that triggers the event. The integer returned is one of the GraphModelEvent variables.

location

 public GraphLocation getLocation()
Returns the location where the event occurred.

model

 public GraphModel getModel()
Returns the graph-model object that generates this event.

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

Overrides: borland.jbcl.util.DispatchableEvent.dispatch(java.util.EventListener)

paramString()

  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: borland.jbcl.model.ModelEvent.paramString()