yFiles Tutorial Realizer Demos

The following tutorial demos describe how to use, customize, and extend diverse NodeRealizer and EdgeRealizer classes. Among other user interface aspects, a realizer defines the way a graph element is rendered.

Note: Except for the implementation of demo.view.realizer.StateNodeRealizer, all classes listed here are also executable.

Class Description
demo.view.realizer.VisualFeatureDemo Presents the visual features that are available with node realizers and edge realizers. In particular, these include labels for both nodes and edges, decorations for edge end points, but also colors and shapes for both types of graph elements.
demo.view.realizer.GenericNodeRealizerDemo This class demonstrates the usage of the y.view.GenericNodeRealizer class which makes it easy to provide customized node rendering.
demo.view.realizer.GenericEdgeRealizerDemo This class demonstrates the usage of the y.view.GenericEdgeRealizer class which makes it easy to provide customized edge rendering.
demo.view.realizer.YLabelConfigurationDemo This class demonstrates the usage of YLabel's configuration feature which simplifies customized label rendering.
Things to try: move nodes around, move node/edge labels around, select a node/edge and press F2 to edit the label, insert/move bends of edges.
demo.view.realizer.TableStyleDemo Demonstrates different visual styles for table groups and their content.
demo.view.realizer.SwingRendererDemo This class shows how to customize GenericNodeRealizer to display JComponents as nodes.
demo.view.realizer.UMLClassNodeRealizer This class represents a custom NodeRealizer that can be used to represent a class in an UML diagram. It supports classname, sterotype, constraint, attribute list, and method list.
demo.view.realizer.BridgeEdgeRealizerDemo This class demonstrates how to implement a custom EdgeRealizer that shows bridges/gaps when crossing other edges.
Usage: Hit one of the two buttons "Gap Style" and "Arc Style" to change how edge crossings are displayed. If edges are selected, the style is only applied to these edges. To change all edge styles at the same time, select either all or no edges.
demo.view.realizer.StateNodeRealizer This demo shows how the custom node realizer StateNodeRealizer can be used within an application.
demo.view.realizer.StateNodeRealizerDemo This demo shows how the custom node realizer StateNodeRealizer can be used within an application.
The demo allows to create nodes that have different state. Additionally it is possible to change the state of a node by either right clicking or left double clicking on it. on it. A graph with its custom node realizers can be saved and loaded using the GraphML format.

Running the Demos

From Within an IDE

Set <yFilesDir>/src as your source directory. Then add <yFilesDir>/lib/y.jar and the source folder <yFilesDir>/src to your classpath. Now you should be ready to compile and run all executable demo classes.

With Ant

First make sure you have the build tool Ant installed on your system. Now you can use the demo build script build.xml located in <yFilesDir>/src/demo to launch each demo by specifying its simple class name as a target. Alternatively, launch the interactive demo driver by specifying run as target to conveniently access all demos.