OGDF Functions
Graph
Function Description
new Module.Graph() Constructor for a Graph object.
G.numberOfNodes() Returns the number of nodes in a Graph G.
G.numberOfEdges() Returns the number of edges in a Graph G.
G.empty() Returns true if Graph has 0 edges and 0 nodes
G.newNode() Creates a new Node and returns it
G.newEdge(node a, node b) Creates a new Edge between 2 nodes a and b.
G.allNodes() Returns a List of Nodes of Graph G.
G.allEdges() Returns a List of Edges of Graph G.
GraphAttributes
Function Description
new Module.GraphAttributes(Graph G, long initAttributes) Constructor for a GraphAttributes Object, intiAttributes can be zero or combination of enums.
GA.setX(node a, double val) sets the x co-ordinate of node a. (Top left corner is the origin)
GA.x(node a) returns the x-cordinate of node a
GA.setY(node a, double val) sets the y co-ordinate of node a. (Top left corner is the origin)
GA.y(node a) returns the y-cordinate of node a
GA.setWidth(node a, double val) sets the width of node a.
GA.width(node a) returns the width of node a
GA.setHeight(node a, double) sets the height of node a.
GA.height(node a) returns the height of node a.
GA.setEdgeColor(edge e,Color c) sets the color of edge e to Color c, which is an object of class Color.
GA.strokeColor(edge e) returns the Color of edge a.
GA.setNodeColor(node a,Color c) sets the color of node a to Color c, which is an object of class Color.
GA.fillColor(node a) returns the Color of node a.
GA.setDirected(bool directed) Makes the Graph Directed if directed is true and vice versa.
GA.directed() returns true is G is directed Graph else returns false.
GA.setBend(edge e, DPolyline dpl) sets the bend points of the edge e extracted from dpl.
GA.bends(edge e) returns the DPolyline which contains the bend points.
GA.setStrokeWidth(edge e,double val) sets the StrokeWidth of the edge e to val.
GA.strokeWidth(edge e) returns the StrokeWidth for edge e.
GA.setStrokeType(edge e, StrokeType st) sets the StrokeType of edge e to st(object of StrokeType class).
GraphIO
Function Description
Module.GraphIO().getSVG(GraphAttributes GA) returns the rendered svg in a string.
Module.GraphIO().myreadGML(Graph G,string gml) reads the GML from gml string and updates Graph G accordingly.
TreeLayout
Function Description
new Module.TreeLayout() Constructor for a TreeLayout object.
tl.call(GraphAttributes GA) Calls TreeLayout on Graph G, GraphAttributes will be updated.
FMMMLayout
Function Description
new Module.FMMMLayout() Constructor for a TreeLayout object.
fl.call(GraphAttributes GA) Calls FMMMLayout on Graph G, GraphAttributes will be updated.
BalloonLayout
Function Description
new Module.BalloonLayout() Constructor for a TreeLayout object.
bl.call(GraphAttributes GA) Calls BalloonLayout on Graph G, GraphAttributes will be updated.
DfsAcyclicSubgraph
Function Description
new Module.DfsAcylicSubgraph() Constructor for a DfsAcyclicSubgraph object.
das.call(Graph G, List arcSet) Computes the set of edges arcSet, which have to be deleted in the acyclic subgraph and append it to arcSet.
List$edge$
Function Description
new Module.List$edge$ Constructor for an empty list of edges.
edges.size() returns the number of edges in the list edges
edges.get(int index) returns the edge at postion index in the list edges
edges.empty() returns true if the list edges has no edges
List$node$
Function Description
new Module.List$node$ Constructor for an empty list of nodes.
nodes.size() returns the number of nodes in the list nodes
nodes.get(int index) returns the node at postion index in the list nodes
nodes.empty() returns true if the list nodes has no nodes
Color
Function Description
new Module.Color(Module.Name.colorname) Constructor for a Color object with color as colorname.
color.toString() returns the hex code of color in form of a string.
DPolyline
Function Description
new Module.DPolyline() Constructor for a DPolyline object.
dpl.length() returns the number of points in DPloyline.
Graph Generators
Function Description
Module.randomGraph(Graph G, nodes n, edges e) Constructs a random Graph with n nodes and e edges.
Module.randomSimpleGraph(Graph G, nodes n, edges e) Constructs a random Simple Graph with n nodes and e edges.
Module.completeGraph(Graph G, nodes n, edges e) Constructs a complete Graph with n nodes and e edges.
Module.completeBipartiteGraph(Graph G, nodes n, edges e) Constructs a complete Bipartite Graph with n nodes and e edges.
Module.planarConnectedGraph(Graph G, nodes n, edges e) Constructs a planar Connected Graph with n nodes and e edges.