The yFiles distributions contain a variety of tutorial Java programs accompanied by their source code. These programs demonstrate how to use essential features of the yFiles library.
Not all of the listed demos may be part of your yFiles distribution type. yFiles Complete contains all demo programs, yFiles Viewer contains all demos except the layout demos, yFiles Layout contains the graph, the graph algorithm, and the viewer independent layout demos in demo/layout. yFiles Basic contains only the basic graph and graph algorithm demos.
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 this directory to launch each demo by specifying its simple class name as a target.
Note: As an alternative, you can also use the build script's run target to launch the DemoBrowser application, an interactive "shell" that allows convenient access to all demos. It features execution of each demo, and also displays both its source code and documentation.
Tutorial programs that show how to use the graph data type and related classes from the yFiles base package y.base are located in the folder demo/base.
The graph algorithm demos are located in the folder demo/algo. These tutorial demos show how to use some of the included graph and network algorithms that are located in the yFiles package y.algo.
Programs that demonstrate how to use the yFiles graph viewer components in
an application are located in the folder demo/view.
Further aspects related to the viewer components and the visual represenation of
graphs and their elements are demonstrated in several subpackages:
The following subpackages present additional topics:
Programs that demonstrate how to add animated effects to graphs and views can be found in demo/view/anim.
A sample application that shows how to use the nested graph hierarchy features of yFiles is located in demo/view/hierarchy.
Programs that demonstrate how to use the API of the diverse yFiles graph layout algorithms can be found in the folders demo/module and demo/view/layout. Programs that demonstrate how to write your own graph layouter using the yFiles framework classes are located in demo/layout. The same folder contains demos that show how to use the layout and labeling functionality for various algorithms when the yFiles Viewer distribution is not present.
Programs that show how to read and write graphs from and to different formats
are located in demo/io. This folder also
includes an example on how to customize and extend existing graph formats
to personal needs.
Further classes that demonstrate file I/O are in folder
demo/view/ports.
An example program that depicts the functionality of the yFiles y.option package of the yFiles Viewer distribution can be found in demo/option.
This demo shows how to obfuscate the yFiles classes before they can be deployed as a part of an applet or application. In this demo the obfuscation process will be performed by the Ant-based obfuscator yGuard (yGuard home page).