JGraphAddons
v1.0


org.jgraph.util
Class JGraphUtilities

java.lang.Object
  |
  +--org.jgraph.util.JGraphUtilities

public class JGraphUtilities
extends Object


Constructor Summary
JGraphUtilities()
           
 
Method Summary
static Rectangle2D align(int constraint, Rectangle2D cellBounds, Rectangle2D bounds)
           
static void alignCells(JGraph graph, Object[] cells, int constraint)
           
static void applyLayout(JGraph sourceGraph, JGraphLayoutAlgorithm layout)
           
static void connect(JGraph graph, DefaultGraphCell prototype, Object[] cells)
           
static CostFunction createDefaultCostFunction()
           
static void editCells(JGraph graph, Object[] cells, AttributeMap attrs)
           
static Object[] getAll(JGraph graph)
           
static UnionFind getComponents(JGraph graph)
           
static Object[] getEdges(JGraph graph)
           
static Object[] getEdgesBetween(JGraph graph, Object vertex1, Object vertex2)
           
static Object getNeighbour(JGraph graph, Object edge, Object vertex)
           
static Object[] getShortestPath(JGraph graph, Object from, Object to, CostFunction cf)
          Returns the ShortestPath.
static Object getSourceVertex(JGraph graph, Object edge)
           
static Object[] getSpanningTree(JGraph graph, CostFunction cf)
          Returns the shortest spanning tree.
static Object getTargetVertex(JGraph graph, Object edge)
           
static Object[] getVertices(JGraph graph, Object[] cells)
           
static void group(JGraph graph, Object groupCell, Object[] cells)
           
static boolean isGroup(JGraph graph, Object cell)
           
static boolean isNeighbour(JGraph graph, Object v1, Object v2)
          Returns true if the given vertices are conntected by a single edge in this document.
static boolean isVertex(JGraph graph, Object cell)
           
static void removeCells(JGraph graph, Object[] cells)
           
static SortedSet sort(JGraph graph, Object[] cells, CostFunction cf)
           
static BufferedImage toImage(JGraph graph, int inset)
           
static void ungroup(JGraph graph, Object[] cells)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JGraphUtilities

public JGraphUtilities()
Method Detail

toImage

public static BufferedImage toImage(JGraph graph,
                                    int inset)
Returns:

getAll

public static Object[] getAll(JGraph graph)
Returns:

getVertices

public static Object[] getVertices(JGraph graph,
                                   Object[] cells)
Returns:

getEdges

public static Object[] getEdges(JGraph graph)
Returns:

getNeighbour

public static Object getNeighbour(JGraph graph,
                                  Object edge,
                                  Object vertex)
Returns:

getSourceVertex

public static Object getSourceVertex(JGraph graph,
                                     Object edge)
Returns:

getTargetVertex

public static Object getTargetVertex(JGraph graph,
                                     Object edge)
Returns:

isVertex

public static boolean isVertex(JGraph graph,
                               Object cell)
Returns:

isGroup

public static boolean isGroup(JGraph graph,
                              Object cell)
Returns:

connect

public static void connect(JGraph graph,
                           DefaultGraphCell prototype,
                           Object[] cells)
Returns:

isNeighbour

public static boolean isNeighbour(JGraph graph,
                                  Object v1,
                                  Object v2)
Returns true if the given vertices are conntected by a single edge in this document.


getEdgesBetween

public static Object[] getEdgesBetween(JGraph graph,
                                       Object vertex1,
                                       Object vertex2)
Returns:

createDefaultCostFunction

public static CostFunction createDefaultCostFunction()
Returns:

getComponents

public static UnionFind getComponents(JGraph graph)
Returns:

getShortestPath

public static Object[] getShortestPath(JGraph graph,
                                       Object from,
                                       Object to,
                                       CostFunction cf)
Returns the ShortestPath. Implemented with the Dijkstra Algorithm


getSpanningTree

public static Object[] getSpanningTree(JGraph graph,
                                       CostFunction cf)
Returns the shortest spanning tree. Implemented with the Kruskal Algorithm


sort

public static SortedSet sort(JGraph graph,
                             Object[] cells,
                             CostFunction cf)
Returns:

editCells

public static void editCells(JGraph graph,
                             Object[] cells,
                             AttributeMap attrs)
Returns:

removeCells

public static void removeCells(JGraph graph,
                               Object[] cells)
Returns:

group

public static void group(JGraph graph,
                         Object groupCell,
                         Object[] cells)
Returns:

ungroup

public static void ungroup(JGraph graph,
                           Object[] cells)
Returns:

alignCells

public static void alignCells(JGraph graph,
                              Object[] cells,
                              int constraint)
Returns:

align

public static Rectangle2D align(int constraint,
                                Rectangle2D cellBounds,
                                Rectangle2D bounds)
Returns:

applyLayout

public static void applyLayout(JGraph sourceGraph,
                               JGraphLayoutAlgorithm layout)
Returns:

JGraphAddons
v1.0


Copyright (C) 2003-2004 Gaudenz Alder. All rights reserved.