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.
If your IDE supports executing targets from ANT build files, the simplest way to run one of the demo programs is by calling the appropriate target from the demo build script build.xml located in this directory. See below for more information on the available ANT targets.
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 representation 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.
Sample applications that show how to use the nested graph hierarchy features of yFiles are 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 folder demo/layout and its sub-folders. Folder demo/layout/withoutview 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.
The demos in demo/io/graphml show how
to use and how to customize the GraphML I/O functionality.
An example program that depicts the functionality of the yFiles y.option package of the yFiles Viewer distribution can be found in demo/option.
yEd Lite is a powerful multi-purpose graph editor. It exhibits most of the features available in the library. This source code demo is available as a separate download through our software download center.
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).