Download JGraph User Manual
Transcript
JGraph User Manual Table of Contents 1 Introduction.......................................................................................................................................7 1.1 What does JGraph do? ..............................................................................................................7 1.2 What is a Graph?.......................................................................................................................7 1.2.1 Graph Visualization ..........................................................................................................8 1.2.2 Graph Interaction ...............................................................................................................9 1.2.3 Graph Layouts ...................................................................................................................9 1.2.4 Graph Analysis ................................................................................................................10 1.3 About this Manual...................................................................................................................12 1.3.1 Pre-requisites for this Manual..........................................................................................12 1.3.2 Getting Additional help....................................................................................................12 1.4 About JGraph...........................................................................................................................13 1.4.1 JGraph Swing Compatibility............................................................................................13 1.4.2 The JGraph Packages.......................................................................................................13 1.4.3 MxGraph..........................................................................................................................14 1.4.4 JGraph licensing...............................................................................................................14 1.5 Getting Started.........................................................................................................................15 1.5.1 The JGraph Web Site ......................................................................................................15 1.5.2 Downloading JGraph.......................................................................................................15 1.5.3 Installing JGraph..............................................................................................................15 1.5.4 Project structure and build options...................................................................................16 2 JGraph and the Graph Model...........................................................................................................17 2.1 Important Application Note.....................................................................................................17 2.2 Understanding the HelloWorld application.............................................................................17 2.2.1 Creating the JGraph..........................................................................................................19 2.2.2 Inserting Cells..................................................................................................................21 2.2.2.1 Configuring Cells' Attributes before Insertion.........................................................22 2.2.3 Editing Graph Cells..........................................................................................................24 2.2.3.1 Removing Cell Attributes.........................................................................................26 2.2.4 Removing Cells................................................................................................................26 2.2.5 Attribute Maps.................................................................................................................27 2.2.5.1 Attribute Map changes after edit calls......................................................................27 2.2.6 Complex Transactions......................................................................................................29 2.2.7 Summary..........................................................................................................................29 2.3 Creating and Configuring the JGraph class.............................................................................30 2.3.1 Configuring JGraph.........................................................................................................31 2.4 The Graph Model.....................................................................................................................34 2.4.1.1 Introduction..............................................................................................................34 2.4.1.2 The 3 editing methods..............................................................................................34 2.4.1.3 Accessing the Graph Model Data.............................................................................34 2.4.1.4 Cloning the Graph Model.........................................................................................36 2.4.1.5 Navigating Connections Using the GraphModel interface.......................................36 2.4.1.5.1 Obtaining a collection of edges connected to a vertex.....................................38 2.4.1.5.2 Obtaining the Source and Target Vertices of an Edges....................................38 2.5 Design Contracts in JGraph.....................................................................................................39 Page 3