Adding your own Node Realizers to yEd Lite
Applies to: yFiles for Java 2.7, yFiles for Java 2.6 print article email article

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.

  1. 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.

  2. If you want to add GraphML I/O support for your realizers, you need to provide a NodeRealizerSerializer implementation for your NodeRealizer. For examples, switch to the src/extra/java sources and have a look at its package yed.feature.realizerproperties. 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
    specialRealizerSerializers.add(new ClassNodeRealizerSerializer());
    
    to the constructor of class yed.feature.realizerproperties.SpecialRealizerGraphMLSupport.

Keywords: yEd - Lite - custom - node - realizer - PropertyHandler

Provide feedback:
How useful was this article?    less 1 2 3 4 5 more
Email address (optional):
COPYRIGHT © 2008 yWorks · ALL RIGHTS RESERVED imprint | top | home