The following source code samples demonstrate how to use the yFiles layout algorithms when the yFiles Viewer distribution is not present.
Class | Description |
---|---|
demo.layout.withoutview.DiagonalLayouter | Implementation of a custom layouter that arranges the nodes on a diagonal line. Edges will be routed with exactly one bend. |
demo.layout.withoutview.LayoutWithoutAView | Shows how to use layout and labeling algorithms without using classes that are only present in the yFiles Viewer distribution. |
demo.layout.withoutview.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.withoutview.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.withoutview.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.withoutview.PartitionGridLayoutWithoutAView |
This demo shows how to use the partition grid feature of IncrementalHierarchicLayouter
without using classes that are only present in the yFiles Viewer Distribution.
In this demo, nodes will be assigned to certain regions of the diagram,
the so-called cells. The diagram will be arranged using hierarchical layout
style, while nodes remain within the bounds of their cells.
This demo displays the calculated coordinates in a simple graph viewer. Additionally it outputs the calculated coordinates of the graph layout to the console. This too can be achieved without the classes that are only present in the yFiles Viewer distribution. |
demo.layout.withoutview.RecursiveGroupLayouterDemo | Shows how to layout the contents of group nodes each with a different layout style. |
demo.layout.withoutview.IntersectionCalculatorDemo | Demonstrates how to use y.layout.PortCalculator and y.layout.IntersectionCalculator to make sure that edge connection points lie on the visual outline of nodes. |
demo.layout.withoutview.IntersectionCalculators | Provides utilities for calculating intersection points of edges at nodes. |
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.