How to Get Notified of Changes in a Graph2D

Questions & Answers

Summary

Fine-grained "is dirty" support for class Graph2D.

This article was written for an older version. It is only online as a reference for customers using this old version. The information it contains is probably out of date.

The latest information can be found in the yFiles documentation

Description

Getting notified of property changes for the displayed graph elements of a Graph2D can be realized in several ways. Apart from the support through the Graph2DListener interface, further realizer-centric as well as mouse gesture-centric schemes can be used to achieve fine-grained notifications for property changes.

Mouse gesture-centric means that the view mode that is responsible for handling a specific mouse gesture is used to get notifications. Realizer-centric means that node realizer or edge realizer classes are enhanced to initiate the notification.
Both these schemes are presented in the following Knowledge Base article: Listening to and Efficiently Handling Graphical Property Changes. (Creating and Firing Additional Event Types is another Knowledge Base article that presents an alternative mouse gesture-centric approach.)

The view modes that are responsible for specific mouse gestures are most commonly specialized modes (also called child modes) of class EditMode.
The yFiles Developer's Guide lists the specialized view modes of class EditMode . Some of them are hierarchy-aware .

Categories this article belongs to:
yFiles for Java > yFiles Viewer > Displaying and Editing Graphs > Events and Listeners
yFiles for Java > yFiles Viewer > Displaying and Editing Graphs > User Interaction
Applies to:
yFiles for Java 2: 2.5, 2.6, 2.7, 2.8, 2.9
Keywords:
dirty - Graph2D - graph - listener - event - events - property - change - changes