Adding your own Node Realizers to yEd Lite |
| Applies to: yFiles for Java 2.8, 2.7, 2.6 |
Type: Questions & Answers
Categories this article belongs to:
| yFiles for Java | > Other |
Adding custom node realizers to yEd Lite requires some adjustments to its source code.
The yEd Lite class package yed.feature.realizerproperties is the place to add new realizers. This package already includes two custom realizers, namely ClassNodeRealizer and NoteNodeRealizer. These will serve you as examples on how to add your own realizers.
-
To make your realizer known to the application, add it to the properties file yed.feature.realizerproperties.YEdPropertyConfig.properties.
For ClassNodeRealizer the entries are
NODEREALIZER.UML.NAME=UML NODEREALIZER.UML.CLASS=yed.feature.realizerproperties.ClassNodeRealizer NODEREALIZER.UML.HANDLER=yed.feature.realizerproperties.ClassNodePropertyHandler
- The NAME is the name of the realizer type that you will be able to select through the combobox in the yEd properties pane.
- The CLASS is the fully qualified class name of your realizer.
- The HANDLER is the fully qualified class name of the PropertyHandler implementation for your own realizer. PropertyHandlers implement the properties editor for your realizer. ClassNodePropertyHandler will serve you as an example. If you don't want to add your own PropertyHandler, choose the PropertyHandler of your NodeRealizer's super class.
-
If you want to add GraphML I/O support for your realizers, you need to provide a NodeRealizerSerializer implementation for your NodeRealizer.
You will find NodeRealizerSerializer implementations for the classes ClassNodeRealizer and NoteNodeRealizer included.
To make your own serializer known to the application you need to add a line like
to the constructor of class yed.feature.realizerproperties.SpecialRealizerGraphMLSupport.specialRealizerSerializers.add(new ClassNodeRealizerSerializer());
Note:
For yFiles for Java 2.7 and earlier, classes related to GraphML I/O support were located in the src/extra/java source tree.
| Keywords: | yEd - Lite - custom - node - realizer - PropertyHandler |


