|
JGraphAddons |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgraph.util.JGraphUtilities
Field Summary | |
static int |
ALIGN_BOTTOM
|
static int |
ALIGN_CENTER
|
static int |
ALIGN_LEFT
|
static int |
ALIGN_MIDDLE
|
static int |
ALIGN_RIGHT
|
static int |
ALIGN_TOP
|
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(JGraph graph)
|
static UnionFind |
getComponents(GraphModel model)
|
static Object[] |
getEdges(GraphModel model)
|
static Object[] |
getEdges(JGraph graph,
Object[] cells)
Returns all edges in cells . |
static Object[] |
getShortestPath(GraphModel model,
Object from,
Object to,
CostFunction cf,
boolean directed)
Returns the ShortestPath between two cells or their descendants. |
static Object[] |
getSpanningTree(JGraph graph,
CostFunction cf)
Returns the shortest spanning tree. |
static Object[] |
getVertices(GraphModel model,
Object[] cells)
|
static boolean |
isGroup(JGraph graph,
Object cell)
|
static boolean |
isVertex(JGraph graph,
Object cell)
|
static SortedSet |
sort(JGraph graph,
Object[] cells,
CostFunction cf)
|
static BufferedImage |
toImage(JGraph graph,
Color bg,
int inset)
If bg is null then a transparent background is applied to the image, else the background is filled with the bg color. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ALIGN_LEFT
public static final int ALIGN_RIGHT
public static final int ALIGN_TOP
public static final int ALIGN_BOTTOM
public static final int ALIGN_CENTER
public static final int ALIGN_MIDDLE
Constructor Detail |
public JGraphUtilities()
Method Detail |
public static BufferedImage toImage(JGraph graph, Color bg, int inset)
public static Object[] getVertices(GraphModel model, Object[] cells)
cells
.public static Object[] getEdges(GraphModel model)
model
.public static Object[] getEdges(JGraph graph, Object[] cells)
cells
. Note: Use
DefaultGraphModel.getEdges() to get all connected edges.
public static boolean isVertex(JGraph graph, Object cell)
public static boolean isGroup(JGraph graph, Object cell)
public static CostFunction createDefaultCostFunction(JGraph graph)
public static UnionFind getComponents(GraphModel model)
public static Object[] getShortestPath(GraphModel model, Object from, Object to, CostFunction cf, boolean directed)
CostFunction cf = createDefaultCostFunction(graph);Object[] path = getShortestPath(graph.getModel(), graph.getSelectionCell(), sinkCell, cf, true);The above code returns the shortest directed path between the selected cell (eg. a vertex) and a predefined sink (typically a vertex with no outgoing edges).
public static Object[] getSpanningTree(JGraph graph, CostFunction cf)
public static SortedSet sort(JGraph graph, Object[] cells, CostFunction cf)
public static void connect(JGraph graph, DefaultGraphCell prototype, Object[] cells)
public static void alignCells(JGraph graph, Object[] cells, int constraint)
public static Rectangle2D align(int constraint, Rectangle2D cellBounds, Rectangle2D bounds)
public static void applyLayout(JGraph sourceGraph, JGraphLayoutAlgorithm layout)
|
JGraphAddons |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |