public class GraphViewer
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
GraphViewer.BitmapJFrame
Receives a byte array as an input, and shows it in a Swing
window as a picture.
|
Constructor and Description |
---|
GraphViewer() |
Modifier and Type | Method and Description |
---|---|
static void |
display(java.util.List<Node> roots)
Displays an explanation graph into a window.
|
static void |
display(java.util.List<Node> roots,
boolean no_captions)
Displays an explanation graph into a window.
|
static void |
display(Node root)
Displays an explanation graph into a window.
|
protected static byte[] |
getGraph(java.util.List<Node> roots,
boolean no_captions)
Renders a graph, calls DOT in the background and retrieves the binary
image it produces.
|
static void |
save(java.util.List<Node> roots,
java.lang.String filename)
Saves a graph to a file.
|
static void |
save(java.util.List<Node> roots,
java.lang.String filename,
boolean no_captions)
Saves a graph to a file.
|
static void |
save(Node root,
java.lang.String filename,
boolean no_captions)
Saves a graph to a file.
|
static java.lang.String |
toDot(java.util.List<Node> roots,
boolean no_captions)
Renders a graph as a DOT file.
|
public static void display(java.util.List<Node> roots, boolean no_captions)
roots
- The roots of the graph to displayno_captions
- Set to true
to hide non-leaf captionspublic static void display(java.util.List<Node> roots)
roots
- The roots of the graph to displaypublic static void display(Node root)
root
- The root of the graph to displaypublic static void save(java.util.List<Node> roots, java.lang.String filename, boolean no_captions)
roots
- The roots of the graph to displayfilename
- The file where this graph will be savedno_captions
- Set to true
to hide non-leaf captionspublic static void save(Node root, java.lang.String filename, boolean no_captions)
root
- The root of the graph to displayfilename
- The file where this graph will be savedno_captions
- Set to true
to hide non-leaf captionspublic static void save(java.util.List<Node> roots, java.lang.String filename)
roots
- The roots of the graph to displayfilename
- The file where this graph will be savedpublic static java.lang.String toDot(java.util.List<Node> roots, boolean no_captions)
roots
- The roots of the graph to renderno_captions
- Set to true
to hide non-leaf captionsprotected static byte[] getGraph(java.util.List<Node> roots, boolean no_captions)
roots
- The roots of the graph to renderno_captions
- Set to true
to hide non-leaf captionsCopyright © Sylvain HallĂ©. All Rights Reserved.