public class LanguagePrinter
extends java.lang.Object
Constructor and Description |
---|
LanguagePrinter()
Constructor: creates a new GraphViz object that will contain
a graph.
|
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.String line)
Adds a string to the graph's source (without newline).
|
void |
addln()
Adds a newline to the graph's source.
|
void |
addln(java.lang.String line)
Adds a string to the graph's source (with newline).
|
void |
clearDotSource() |
void |
createFolderTree(java.lang.String languageName)
Creates all needed folders to save files in their appropriate language
|
void |
createTMPFolder()
Creates all needed folders to save files in their appropriate language
|
java.lang.String |
end_subgraph()
Returns a string that is used to end a graph.
|
java.lang.String |
endDotSource()
Returns a string that is used to end a graph.
|
java.lang.String |
generateDotString(AnnotatedTypeGraph graph) |
void |
generateLanguageHTMLDoc(java.lang.String languageName,
int numberOfLanguageElements) |
java.lang.String |
getDotSource()
Returns the graph's source description in dot language.
|
byte[] |
getGraph(java.lang.String dot_source,
java.lang.String type)
Returns the graph as an image in binary format.
|
void |
printGraph(AnnotatedTypeGraph graph,
java.lang.String languageFolderName,
java.lang.String fileName) |
void |
readSource(java.lang.String input)
Read a DOT graph from a text file.
|
void |
setAlwaysStandardAnnotations(boolean bool) |
void |
setPrintAnnotations(boolean bool) |
java.lang.String |
start_subgraph(int clusterid)
Takes the cluster or subgraph id as input parameter and returns a string
that is used to start a subgraph.
|
java.lang.String |
startDotSource(java.lang.String name)
Returns a string that is used to start a graph.
|
int |
writeGraphToFile(byte[] img,
java.io.File to)
Writes the graph's image in a file.
|
int |
writeGraphToFile(byte[] img,
java.lang.String file)
Writes the graph's image in a file.
|
public LanguagePrinter()
public java.lang.String getDotSource()
public void add(java.lang.String line)
line
- The line to be added.public void addln(java.lang.String line)
line
- The line to be added.public void addln()
public void clearDotSource()
public void setAlwaysStandardAnnotations(boolean bool)
public void setPrintAnnotations(boolean bool)
public void printGraph(AnnotatedTypeGraph graph, java.lang.String languageFolderName, java.lang.String fileName)
public java.lang.String generateDotString(AnnotatedTypeGraph graph)
public byte[] getGraph(java.lang.String dot_source, java.lang.String type)
dot_source
- Source of the graph to be drawn.type
- Type of the output image to be produced, e.g.: gif, dot, fig, pdf, ps, svg, png.public int writeGraphToFile(byte[] img, java.lang.String file)
img
- A byte array containing the image of the graph.file
- Name of the file to where we want to write.public int writeGraphToFile(byte[] img, java.io.File to)
img
- A byte array containing the image of the graph.to
- A File object to where we want to write.public java.lang.String startDotSource(java.lang.String name)
name
- The name of the graph.public java.lang.String endDotSource()
public java.lang.String start_subgraph(int clusterid)
clusterid
- ID of the subgraphpublic java.lang.String end_subgraph()
public void readSource(java.lang.String input)
input
- Input text file containing the DOT graph
source.public void createFolderTree(java.lang.String languageName)
languageName
- the folder name for the language (usually the type graphs name)public void createTMPFolder()
public void generateLanguageHTMLDoc(java.lang.String languageName, int numberOfLanguageElements)