yFiles Tutorial Demos for Hierarchical Layout

This package contains tutorial source code demos that showcase various aspects of the yFiles hierarchical layout facilities.

Class Description
demo.layout.hierarchic.IncrementalHierarchicLayouterDemo This demo shows how to use IncrementalHierarchicLayouter together with sophisticated customized view modes.
demo.layout.hierarchic.SwimlaneGroupDemo This demo shows the effect of combining IncrementalHierarchicLayouter's support for grouping and swim lanes.
demo.layout.hierarchic.IncrementalHierarchicGroupDemo This demo shows how IncrementalHierarchicLayouter can be used to fully or incrementally layout hierarchically nested graphs. The demo supports automatic relayout after expanding folder nodes, collapsing group nodes. Furthermore it provides toolbar buttons that trigger full layout and incremental relayout. A settings dialog for group layout options is provided as well. In incremental layout mode all selected elements are added incrementally to the existing layout.
demo.layout.hierarchic.LayerConstraintsDemo Demo that shows how to apply layer constraints when calculating hierarchical layouts.
demo.layout.hierarchic.PortCandidateDemo This demo shows how port candidate sets can be used with the incremental hierarchic layouter to control from what side edges connect to certain node types in the automatic layout process.
Usage: The template nodes in the list to the left have different port candidate sets. Try changing the graph using the templates and note the effect for a new layout.
demo.layout.hierarchic.SequenceConstraintsDemo Demonstrates how to apply sequence constraints when calculating hierarchical layouts. For hierarchical layouts, a sequence is the in-layer order of nodes, e.g. with layout direction from top to bottom, a sequence is the left to right order of nodes.
demo.layout.hierarchic.SimpleSwimlaneLayouterDemo Demonstrates the swim lane feature of the IncrementalHierarchicLayouter.
demo.layout.hierarchic.SimpleIncrementalHierarchicLayouterDemo This simple demo shows how to use the IncrementalHierarchicLayouter to either calculate a new layout or calculate a new layout given the current sketch or incrementally layout selected nodes to an already existing graph whose layout is read from the current sketch.
demo.layout.hierarchic.HierarchicLayouterDemo Demonstrates various aspects of the HierarchicLayouter.
demo.layout.hierarchic.CriticalPathDemo Demonstrates IncrementalHierarchicLayouter's critical path feature. The algorithm will try to align the nodes of a critical path such that the interconnecting edges can be routed in a straight, vertical fashion.

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.