Creating and Firing Additional Event Types

Tips & Tricks

Summary

Creating and firing additional types of view events.
For a better user experience, please go to the integrated documentation viewer to read this article.

Description

View events are commonly fired whenever a user changes a property of the visual representation of a graph element. To receive notifications for view events other than those already implemented, the events have to be properly fired.

The attached sample code sketches two different ways how node resizing events can be created:

  • Customizing the descendant of class ViewMode that is responsible for handling the respective user gesture. Node resizing is governed by class HotSpotMode.
  • Creating a customized NodeRealizer implementation that fires events when its node gets resized.

Customizing class HotSpotMode restricts event creation to direct user gestures, i.e., real (mouse) interaction with the graph element whereas the NodeRealizer approach will fire events whenever the respective node gets resized.

Resources

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.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 2.10, 2.11, 2.12, 2.13, 2.14, 2.15, 2.16, 2.17, 2.18
Keywords:
firing - events - notifications - property - changes