net.claribole.zgrviewer.dot
Class Graph

java.lang.Object
  extended bynet.claribole.zgrviewer.dot.Graph

public class Graph
extends java.lang.Object

Root of a GraphViz graph. This class contains global variables used for many purpose: layout, order...

Author:
Eric Mounhem

Field Summary
static double AUTO
          Find the best size for the graph to be drawn on multiple pages (if it can't be on one)
 Rectangle bb
          Drawing bounding box
 java.awt.Color bgcolor
          Color used as the background for entire canvas
static int BL
          Bottom to Top, Left to Right
static int BOTTOM
          Place graph or clusters label at bottom
static int BR
          Bottom to Top, Right to Left
static int BREADTHFIRST
          Draw nodes and edges when they come, may lead to edges over nodes and nodes over edges
static int BT
          Bottom to Top
 boolean center
          Center the drawing on the canvas
static int CENTER
          Center clusters label
 int charset
          Specifies the character encoding used.
static int CIRCUIT
          Circuit model
static int CLUST
          Keep top-level clusters intact
 int clusterrank
          Mode used for handling clusters.
 boolean compound
          Allow edges betwenn clusters
static int COMPOUND
          Draw the edges to avoid clusters
static int COMPRESS
          Scale down the layout without creating overlaps
static double COMPRESS_RATIO
          Compress the layout to fit in the size given with the size attribute
 boolean concentrate
          Use edges concentrators
 double damping
          Factor damping force motions.
 double defaultdist
          Distance between nodes
 int dim
          Number of dimensions for the layout
 boolean directed
          Directed or undirected graph
 double dpi
          Specifies the expected number of pixels per inch on a display device
static int EDGESFIRST
          Draw edges first, get only nodes over edges (eye-candy)
 double epsilon
          Terminating condition
static double EXPAND
          Expand node positions for width or height reach the size attribute's value
static double FILL
          Scale node positions for the graph to be drawn filling the size given with the size attribute
 java.awt.Color fontcolor
          Text's color
 java.lang.String fontname
          Name of the font used to write graph's label
 java.lang.String[] fontpath
          Tells to GD where to find fonts
 double fontsize
          Text's size in point
static int GLOBAL
           
static int GRAPH
          Use the element's bounding box to pack them
 Node graphRoot
          Node to use as the center of the graph's layout
 java.lang.String id
          Identification string of a graph
static int IN
          Ordering exiting nodes in the order they appear
static int ISO_8859_1
          Latin1 charset
 double k
          Spring constant used in virtual physical model
static int KK
          KK optimization mode
 java.lang.String label
          Label of the graph
 int labeljust
          Label justification (CENTER, LEFT or RIGHT)
 int labelloc
          Label localisation (TOP or BOTTOM)
 java.lang.String[] layers
          List of layer names for output
 java.lang.String layersep
          Layers separators
static int LB
          Left to Right, Bottom to Top
static int LEFT
          Left justify clusters label
static int LOCAL
          SubGraphs can have Cluster properties
 Point lp
          Label position (in points)
static int LR
          Left to Right
static int LT
          Left to Right, Top to Bottom
static int MAJOR
          Major optimization mode
 java.awt.geom.Point2D.Double margin
          Margins around the graph (in inches)
 int maxiter
          Set the number of iteration used
 double mclimit
          Multiplicative scale factor used to alter the parameters used during crossing minimization
 double mindist
          Specifies the minimum separation between all nodes
 int mode
          Use the MAJOR mode, else use the KK one
 int model
          How the distance matrix is computed.
static int NO_ORDERING
          No node's ordering in the graph
static double NO_RATIO
          No ratio
static int NO_SEED
          Use the default random seed
static int NO_SPLINES
          Don't draw edges as splines
static int NODE
          Pack only around the node, letting other nodes interleave into the graph
 double nodesep
          Minamum space between two adjacent nodes in the same rank (in inches)
static int NODESFIRST
          Draw nodes first, get only edges over nodes (no misunderstandings)
 boolean nojustify
          Don't justify multilines labels
static int NONE
          No special cluster processing
 boolean normalize
          Use the first point as origin and make the first edge horizontal
 int ordering
          Define in which order nodes have to appear.
static int ORTHOXY
          Optimize x and y axis, starting with the x one, to remove overlaps
static int ORTHOYX
          Optimize x and y axis, starting with the y one, to remove overlaps
static int OUT
          Ordering entering nodes in the order they appear
 int outputorder
          Specify drawing order of nodes and edges.
 int overlap
          How node overlaps are removed.
 boolean pack
          Used to activate or deactivate packing.
 int packmode
          Packing method to use.
 int packValue
          Value of pack margin when pack is true
 java.awt.geom.Point2D.Double page
          Width and height of output pages (in inches)
 int pagedir
          Specifies the order in which the pages are emitted.
 double quantum
          Round label dimensions to integral multiples of the quantum
static int RANDOM
          Start with randomly placed nodes
 int rankdir
          Direction of graph layout.
 double ranksep
          Gives desired rank separation (in inches)
 double ratio
          Desired aspect ratio.
static java.lang.String[] ratioAttributeNames
           
static int RB
          Right to Left, Bottom to Top
static int REGULAR
          Start with the nodes regularly placed around a circle
 boolean remincross
          Run cross minimization on multiple clusters
static int RETAIN
          Retain node overlaps
static int RIGHT
          Right justify clusters label
static int RL
          Right to Left
 int rotate
          Set graph orientation
static int RT
          Right to Left, Top to Bottom
 int samplepoints
          Number of points used to represent circles and ellipses
static int SCALE
          Uniformly scale x and y to remove overlaps
static int SCALEXY
          Scale x and y separately to remove overlaps
 int searchsize
          Maximum number of negative cut edges to search for minimum cut value
static int SELF
          Start with neato placed nodes
 double sep
          Fraction to increase polygons in order to determine overlapping
static int SHORTPATH
          Shortpath model
 int showboxes
          Show PostScript guide boxes for debugging
 java.awt.geom.Point2D.Double size
          Maximum width and height of drawing (in inches)
 int splines
          Method of drawing edges.
static int SPLINES
          Draw edges as splines (non overlapping nodes required)
 int startSeed
          Specifies a seed for the random number generator (NO_SEED is for unspecified seed)
 int startStyle
          Control node placement at start.
 java.lang.String stylesheet
          XML stylesheet for SVG output
static int SUBSET
          Subset model
 java.lang.String target
          Target of the URL
static int TB
          Top to Bottom
static int TL
          Top to Bottom, Left to Right
static int TOP
          Place graph or clusters label at top
static int TR
          Top to Bottom, Right to Left
 java.lang.Boolean truecolor
          Use a truecolor color model for bitmap rendering
 java.lang.String URL
          Hyperlink associated to a graph.
static int UTF_8
          UTF-8 charset
 double voro_margin
          Factor to scale up drawing to allow margin for expansion in Voronoi technique
static int VORONOI
          Use a Voronoi-based technique to remove overlaps
 
Constructor Summary
Graph()
          Create a new empty graph
Graph(java.lang.String id)
          Create a new empty graph
 
Method Summary
 void addEdge(Edge edge)
          Add an edge to the edges list
 void addFontPath(java.lang.String path)
          Add a new path to the system's list of font path
 void addGenericNode(Node node)
           
 void addLayer(java.lang.String layer)
          Add a new Layer name in the graph's list
 void addNode(Node node)
          Add a node to the nodes list
static void addNode(java.lang.Object root, Node element)
          Add a given node either to a Graph or a SubGraph, depending on the node root's type
 void changeOption(java.lang.String name, java.lang.String value)
           
 Edge[] getEdges()
           
 Node[] getNodes()
           
static void main(java.lang.String[] args)
          Calling method in order to test
 void removeEdge(Edge edge)
          Remove an edge to the edges list
 void removeFontPath(java.lang.String path)
          Remove a path to the system's list of font paths
 void removeLayer(java.lang.String layer)
          Remove a layer to the layer's list
 void removeNode(Node node)
          Remove a node to the nodes list
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TB

public static final int TB
Top to Bottom

See Also:
Constant Field Values

LR

public static final int LR
Left to Right

See Also:
Constant Field Values

BT

public static final int BT
Bottom to Top

See Also:
Constant Field Values

RL

public static final int RL
Right to Left

See Also:
Constant Field Values

BL

public static final int BL
Bottom to Top, Left to Right

See Also:
Constant Field Values

BR

public static final int BR
Bottom to Top, Right to Left

See Also:
Constant Field Values

TL

public static final int TL
Top to Bottom, Left to Right

See Also:
Constant Field Values

TR

public static final int TR
Top to Bottom, Right to Left

See Also:
Constant Field Values

RB

public static final int RB
Right to Left, Bottom to Top

See Also:
Constant Field Values

RT

public static final int RT
Right to Left, Top to Bottom

See Also:
Constant Field Values

LB

public static final int LB
Left to Right, Bottom to Top

See Also:
Constant Field Values

LT

public static final int LT
Left to Right, Top to Bottom

See Also:
Constant Field Values

CENTER

public static final int CENTER
Center clusters label

See Also:
Constant Field Values

LEFT

public static final int LEFT
Left justify clusters label

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
Right justify clusters label

See Also:
Constant Field Values

TOP

public static final int TOP
Place graph or clusters label at top

See Also:
Constant Field Values

BOTTOM

public static final int BOTTOM
Place graph or clusters label at bottom

See Also:
Constant Field Values

BREADTHFIRST

public static final int BREADTHFIRST
Draw nodes and edges when they come, may lead to edges over nodes and nodes over edges

See Also:
Constant Field Values

NODESFIRST

public static final int NODESFIRST
Draw nodes first, get only edges over nodes (no misunderstandings)

See Also:
Constant Field Values

EDGESFIRST

public static final int EDGESFIRST
Draw edges first, get only nodes over edges (eye-candy)

See Also:
Constant Field Values

NODE

public static final int NODE
Pack only around the node, letting other nodes interleave into the graph

See Also:
Constant Field Values

CLUST

public static final int CLUST
Keep top-level clusters intact

See Also:
Constant Field Values

GRAPH

public static final int GRAPH
Use the element's bounding box to pack them

See Also:
Constant Field Values

NO_RATIO

public static final double NO_RATIO
No ratio

See Also:
Constant Field Values

FILL

public static final double FILL
Scale node positions for the graph to be drawn filling the size given with the size attribute

See Also:
Constant Field Values

COMPRESS_RATIO

public static final double COMPRESS_RATIO
Compress the layout to fit in the size given with the size attribute

See Also:
Constant Field Values

EXPAND

public static final double EXPAND
Expand node positions for width or height reach the size attribute's value

See Also:
Constant Field Values

AUTO

public static final double AUTO
Find the best size for the graph to be drawn on multiple pages (if it can't be on one)

See Also:
Constant Field Values

ratioAttributeNames

public static final java.lang.String[] ratioAttributeNames

NONE

public static final int NONE
No special cluster processing

See Also:
Constant Field Values

GLOBAL

public static final int GLOBAL
See Also:
NONE, Constant Field Values

LOCAL

public static final int LOCAL
SubGraphs can have Cluster properties

See Also:
Constant Field Values

SHORTPATH

public static final int SHORTPATH
Shortpath model

See Also:
Constant Field Values

CIRCUIT

public static final int CIRCUIT
Circuit model

See Also:
Constant Field Values

SUBSET

public static final int SUBSET
Subset model

See Also:
Constant Field Values

REGULAR

public static final int REGULAR
Start with the nodes regularly placed around a circle

See Also:
Constant Field Values

SELF

public static final int SELF
Start with neato placed nodes

See Also:
Constant Field Values

RANDOM

public static final int RANDOM
Start with randomly placed nodes

See Also:
Constant Field Values

NO_SPLINES

public static final int NO_SPLINES
Don't draw edges as splines

See Also:
Constant Field Values

SPLINES

public static final int SPLINES
Draw edges as splines (non overlapping nodes required)

See Also:
Constant Field Values

COMPOUND

public static final int COMPOUND
Draw the edges to avoid clusters

See Also:
Constant Field Values

RETAIN

public static final int RETAIN
Retain node overlaps

See Also:
Constant Field Values

SCALE

public static final int SCALE
Uniformly scale x and y to remove overlaps

See Also:
Constant Field Values

VORONOI

public static final int VORONOI
Use a Voronoi-based technique to remove overlaps

See Also:
Constant Field Values

SCALEXY

public static final int SCALEXY
Scale x and y separately to remove overlaps

See Also:
Constant Field Values

ORTHOXY

public static final int ORTHOXY
Optimize x and y axis, starting with the x one, to remove overlaps

See Also:
Constant Field Values

ORTHOYX

public static final int ORTHOYX
Optimize x and y axis, starting with the y one, to remove overlaps

See Also:
Constant Field Values

COMPRESS

public static final int COMPRESS
Scale down the layout without creating overlaps

See Also:
Constant Field Values

NO_ORDERING

public static final int NO_ORDERING
No node's ordering in the graph

See Also:
Constant Field Values

IN

public static final int IN
Ordering exiting nodes in the order they appear

See Also:
Constant Field Values

OUT

public static final int OUT
Ordering entering nodes in the order they appear

See Also:
Constant Field Values

MAJOR

public static final int MAJOR
Major optimization mode

See Also:
Constant Field Values

KK

public static final int KK
KK optimization mode

See Also:
Constant Field Values

UTF_8

public static final int UTF_8
UTF-8 charset

See Also:
Constant Field Values

ISO_8859_1

public static final int ISO_8859_1
Latin1 charset

See Also:
Constant Field Values

NO_SEED

public static final int NO_SEED
Use the default random seed

See Also:
Constant Field Values

id

public java.lang.String id
Identification string of a graph


URL

public java.lang.String URL
Hyperlink associated to a graph.


fontname

public java.lang.String fontname
Name of the font used to write graph's label


label

public java.lang.String label
Label of the graph


target

public java.lang.String target
Target of the URL


stylesheet

public java.lang.String stylesheet
XML stylesheet for SVG output


charset

public int charset
Specifies the character encoding used. One of the following:


fontpath

public java.lang.String[] fontpath
Tells to GD where to find fonts


layers

public java.lang.String[] layers
List of layer names for output


layersep

public java.lang.String layersep
Layers separators


directed

public boolean directed
Directed or undirected graph


center

public boolean center
Center the drawing on the canvas


compound

public boolean compound
Allow edges betwenn clusters


concentrate

public boolean concentrate
Use edges concentrators


nojustify

public boolean nojustify
Don't justify multilines labels


normalize

public boolean normalize
Use the first point as origin and make the first edge horizontal


remincross

public boolean remincross
Run cross minimization on multiple clusters


truecolor

public java.lang.Boolean truecolor
Use a truecolor color model for bitmap rendering


rankdir

public int rankdir
Direction of graph layout. One of the following:


dim

public int dim
Number of dimensions for the layout


labeljust

public int labeljust
Label justification (CENTER, LEFT or RIGHT)


labelloc

public int labelloc
Label localisation (TOP or BOTTOM)


outputorder

public int outputorder
Specify drawing order of nodes and edges. One of the following:


pack

public boolean pack
Used to activate or deactivate packing. -1: false >0: true with the value as a margin (0: true, with the margin at 8...)


packValue

public int packValue
Value of pack margin when pack is true


packmode

public int packmode
Packing method to use. May be one of the following:


pagedir

public int pagedir
Specifies the order in which the pages are emitted. May be one of the following:


rotate

public int rotate
Set graph orientation


samplepoints

public int samplepoints
Number of points used to represent circles and ellipses


searchsize

public int searchsize
Maximum number of negative cut edges to search for minimum cut value


showboxes

public int showboxes
Show PostScript guide boxes for debugging


clusterrank

public int clusterrank
Mode used for handling clusters. May be one of the following:


model

public int model
How the distance matrix is computed. May be one of the following:


startStyle

public int startStyle
Control node placement at start. May be one of the following:


startSeed

public int startSeed
Specifies a seed for the random number generator (NO_SEED is for unspecified seed)


splines

public int splines
Method of drawing edges. May be one of the following:


overlap

public int overlap
How node overlaps are removed. May be one of the following:


ordering

public int ordering
Define in which order nodes have to appear. May be one of the following:


maxiter

public int maxiter
Set the number of iteration used


mode

public int mode
Use the MAJOR mode, else use the KK one


damping

public double damping
Factor damping force motions.


k

public double k
Spring constant used in virtual physical model


fontsize

public double fontsize
Text's size in point


mclimit

public double mclimit
Multiplicative scale factor used to alter the parameters used during crossing minimization


mindist

public double mindist
Specifies the minimum separation between all nodes


nodesep

public double nodesep
Minamum space between two adjacent nodes in the same rank (in inches)


quantum

public double quantum
Round label dimensions to integral multiples of the quantum


ranksep

public double ranksep
Gives desired rank separation (in inches)


ratio

public double ratio
Desired aspect ratio. May also be one of the following:


sep

public double sep
Fraction to increase polygons in order to determine overlapping


voro_margin

public double voro_margin
Factor to scale up drawing to allow margin for expansion in Voronoi technique


dpi

public double dpi
Specifies the expected number of pixels per inch on a display device


defaultdist

public double defaultdist
Distance between nodes


epsilon

public double epsilon
Terminating condition


bgcolor

public java.awt.Color bgcolor
Color used as the background for entire canvas


fontcolor

public java.awt.Color fontcolor
Text's color


graphRoot

public Node graphRoot
Node to use as the center of the graph's layout


bb

public Rectangle bb
Drawing bounding box


lp

public Point lp
Label position (in points)


page

public java.awt.geom.Point2D.Double page
Width and height of output pages (in inches)


size

public java.awt.geom.Point2D.Double size
Maximum width and height of drawing (in inches)


margin

public java.awt.geom.Point2D.Double margin
Margins around the graph (in inches)

Constructor Detail

Graph

public Graph()
      throws java.lang.Exception
Create a new empty graph

Throws:
java.lang.Exception

Graph

public Graph(java.lang.String id)
      throws java.lang.Exception
Create a new empty graph

Parameters:
id - a unique ID for this graph
Throws:
java.lang.Exception
Method Detail

addNode

public void addNode(Node node)
Add a node to the nodes list

Parameters:
node - New node to add

addGenericNode

public void addGenericNode(Node node)

addEdge

public void addEdge(Edge edge)
Add an edge to the edges list

Parameters:
edge - New edge to add

addNode

public static void addNode(java.lang.Object root,
                           Node element)
Add a given node either to a Graph or a SubGraph, depending on the node root's type

Parameters:
root - Root element to add the node
element - Node to add

addLayer

public void addLayer(java.lang.String layer)
Add a new Layer name in the graph's list

Parameters:
layer - name of a new layer

addFontPath

public void addFontPath(java.lang.String path)
Add a new path to the system's list of font path

Parameters:
path - new path to add

removeNode

public void removeNode(Node node)
Remove a node to the nodes list

Parameters:
node - Node to remove (if it's in the list)

removeEdge

public void removeEdge(Edge edge)
Remove an edge to the edges list

Parameters:
edge - Edge to remove (if it's in the list)

removeLayer

public void removeLayer(java.lang.String layer)
Remove a layer to the layer's list

Parameters:
layer - layer to remove

removeFontPath

public void removeFontPath(java.lang.String path)
Remove a path to the system's list of font paths

Parameters:
path - a path to remove

changeOption

public void changeOption(java.lang.String name,
                         java.lang.String value)

toString

public java.lang.String toString()
See Also:
Object.toString()

getEdges

public Edge[] getEdges()
Returns:
Returns the edges.

getNodes

public Node[] getNodes()
Returns:
Returns the nodes.

main

public static void main(java.lang.String[] args)
Calling method in order to test

Parameters:
args -


Copyright © 2004-2005 INRIA. All Rights Reserved
Licensed under the GNU LGPL. For full terms see the file COPYING.