Modelling Handlers

Handlers and Handler Registries

In the last section, we introduced the GraphRuleAPI. We saw that it is possible to cover simple modelling operations with Rule instances assigned to certain VisualGraphObjects. It is easy to imagine that it comes to situations where these simple operations are insufficient to provide the user with adequate modelling capabilities.

To overcome this fact and also to provide the client code to handle modelling much more flexible the GraphRuleAPI supports the usage of so called handlers. These handlers offer the possibility to react on certain situations in a way that can not be covered by generic modelling operations. For instance a handler can take care of a certain state of a VisualGraphObject to allow or disallow a modelling operation. Or it can react in a different way for different states.

The GraphRuleAPI provides a set of these handlers. Each of them is defined by an interface and has to be implemented in the client code. Each of the handlers stands for a certain situation the GraphAPI can come into when the user modells a graph.

The following section gives an overview of what kinds of handlers are possible to implement and how they should be used.

The following list shows the available handler types and gives a short description:

  • VisualNodeOverlayIndicationHandler

  • VisualNodeDropHandler

  • VisualSubgraphRemoveHandler

  • VisualNodeMovedInSubgraphHandlerRegistry