The JGraph Tutorial
Gaudenz Alder
alder@jgraph.com
Table of Contents
HowtouseGraphs...............................................................................................................3
Examples...............................................................................................................................16
References............................................................................................................................29This document provides an experimental analysis of the JGraph component, based
on working examples. Source code from the JGraphpad application will be used,
togetherwithtwoadditionalexamples.Oneexampleisadiagrameditor,theotheris
aGXLtoSVGfileconverterforbatchprocessinganautomaticlayout.
This document is not a specification of the API, and it does not provide an in depth
study of the component’s architecture. The target readers are developers who need
awell documentedcollectionofworkingexamplesthatdemonstratehowtousethe
JGraphcomponentinacustomapplication.
How to use Graphs
With the JGraph class, you can display objects and their relations. A JGraph object
doesn’t actually contain your data; it simply provides a view of the data. Like any
non trivialSwingcomponent,thegraphgetsdatabyqueryingitsdatamodel.Here’s
apictureofagraph:
Figure1.Adirectedgraph(Digraph)
As the preceding figure shows, JGraph displays its data by drawing individual ele
ments.Eachelementdisplayedbythegraphcontainsexactlyoneitemofdata,which
is ...
Voir