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.DiagonalLayouter | Implementation of a custom layouter that arranges the nodes on a diagonal line. Edges will be routed with exactly one bend. |
| demo.layout.LayoutWithoutAView | Shows how to use layout and labeling algorithms without using classes that are only present in the yFiles Viewer distribution. |
| demo.layout.GroupingLayoutWithoutAView | Similar 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.IncrementalLayoutWithoutAView | Similar 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.SwimLaneLayoutWithoutAView | Similar 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.RecursiveGroupLayouterDemo | Shows how to layout the contents of group nodes each with a different layout style. |
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.
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.