yFiles Tutorial Layout Demos

The following source code samples demonstrate how to write custom layouters using the yFiles framework. See the view and module demos on how to use the yFiles layouter in applications.

Class Description
demo.layout.DiagonalLayouterImplementation of a custom layouter that arranges the nodes on a diagonal line. Edges will be routed with exactly one bend.
demo.layout.LayoutWithoutAViewShows how to use layout and labeling algorithms without using classes that are only present in the yFiles Viewer distribution.
demo.layout.GroupingLayoutWithoutAViewSimilar to LayoutWithoutAView, but demonstrates the use of node and edge grouping in combination with the layout algorithms that are capable of interpreting these sophisticated features. This too can be achieved without the classes that are only present in the yFiles Viewer distribution.
demo.layout.IncrementalLayoutWithoutAViewSimilar to LayoutWithoutAView, but demonstrates the use of the incremental layout capabilities provided by IncrementalHierarchicLayouter. This too can be achieved without the classes that are only present in the yFiles Viewer distribution.
demo.layout.SwimLaneLayoutWithoutAViewSimilar to LayoutWithoutAView, but demonstrates the use of the swim lane layout capabilities of IncrementalHierarchicLayouter. This too can be achieved without the classes that are only present in the yFiles Viewer distribution.
demo.layout.RecursiveGroupLayouterDemoShows how to layout the contents of group nodes each with a different layout style.

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.