Creating and Firing Additional Event Types
Applies to: yFiles for Java 2.9, 2.8, 2.7, 2.6, 2.5, 2.4, 2.3, 2.2, 2.1, 2.0 print article email article

Type: Tips & Tricks

Creating and firing additional types of view events.

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.


Keywords: firing - events - notifications - property - changes

Provide feedback:
How useful was this article?    less 1 2 3 4 5 more
Email address (optional):
COPYRIGHT © 2012 yWorks · ALL RIGHTS RESERVED imprint | terms of use | privacy policy | home