|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.File
easik.sketch.util.Tex.TexFile
public class TexFile
Class to convert a JGraph object to a tex file. This class generates an output file containing a description of the
graph using formatting for GasTex. The file contains no header information, and thus cannot be converted into a TeX file
as is.
To convert the file into a readable TeX file, the user must add relevant header information, including a call to use
the package GasTeX. This package is freely available on the web.
Field Summary | |
---|---|
private java.awt.Point |
_flip
A point to flip |
private java.awt.Point |
_transform
A point to transform |
private static int |
BOXLENGTH
The size of the box for an entity |
private static int |
CONSTRAINT_LENGTH
The size of the constraint box |
private static java.lang.String |
DESCRIPTION
The description of the file |
private static java.lang.String |
EXTENSION
The TeX file extension |
Fields inherited from class java.io.File |
---|
pathSeparator, pathSeparatorChar, separator, separatorChar |
Constructor Summary | |
---|---|
TexFile(java.io.File aFile)
Construtor that calls TexFile(String fileLoc) constructor by determining the absolute path of the file passed. |
|
TexFile(java.lang.String fileLoc)
Constructor that calls the super constructor. |
Method Summary | |
---|---|
private void |
beginWrite(java.io.BufferedWriter bw)
Sets the initial conditions of the image. |
private void |
finishWrite(java.io.BufferedWriter bw)
Sets the final conditions of the image. |
static java.lang.String |
getDescription()
Gets the description of this file |
static java.lang.String |
getExtension()
Returns the extension of this file |
private static java.awt.Point |
getMax(org.jgraph.JGraph graph)
Determines the maximum point on the graph, to set the bounds of the GasTeX image. |
private static java.awt.Point |
getMin(org.jgraph.JGraph graph)
Determines the minimum point on the graph, to set the bounds of the GasTeX image. |
static boolean |
isCorrectExtension(java.lang.String extension)
Determines whether the file has the correct extension |
static boolean |
isOfType(java.io.File file)
Determines whether the file is of the proper type. |
static boolean |
isOfType(java.lang.String fileName)
Determines whether the file has the proper extension appeneded to the file |
void |
save(org.jgraph.JGraph toSave)
Saves the graph as a \.tex file by converting all elements to strings formatted for GasTex. |
private void |
writeEdge(java.io.BufferedWriter bw,
org.jgraph.graph.DefaultEdge edge,
org.jgraph.JGraph graph)
Writes the information about an edge to the output file. |
private void |
writeVertex(java.io.BufferedWriter bw,
org.jgraph.graph.DefaultGraphCell vertex,
org.jgraph.JGraph graph)
Writes the information about a vertex to the output file. |
Methods inherited from class java.io.File |
---|
canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getName, getParent, getParentFile, getPath, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setLastModified, setReadOnly, toString, toURI, toURL |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String EXTENSION
private static final java.lang.String DESCRIPTION
private static final int BOXLENGTH
private static final int CONSTRAINT_LENGTH
private java.awt.Point _transform
private java.awt.Point _flip
Constructor Detail |
---|
public TexFile(java.lang.String fileLoc)
fileLoc
- The absolute path of the file.public TexFile(java.io.File aFile)
aFile
- The file to be made into a TexFile.Method Detail |
---|
public static final java.lang.String getExtension()
public static final java.lang.String getDescription()
public static final boolean isOfType(java.lang.String fileName)
fileName
- The name of the file
public static final boolean isOfType(java.io.File file)
file
- The file to be investigated.
public static final boolean isCorrectExtension(java.lang.String extension)
extension
- The current extension of the file
private static java.awt.Point getMin(org.jgraph.JGraph graph)
graph
- The graph being converted into a GasTeX image
private static java.awt.Point getMax(org.jgraph.JGraph graph)
graph
- The graph being converted into a GasTeX image.
public void save(org.jgraph.JGraph toSave) throws java.io.IOException
toSave
- The graph to convert to a GasTex image
java.io.IOException
- Write errorprivate void beginWrite(java.io.BufferedWriter bw) throws java.io.IOException
bw
- The buffered writer being used to write to the output file
java.io.IOException
- Write errorprivate void finishWrite(java.io.BufferedWriter bw) throws java.io.IOException
bw
- The buffered writer being used to write to the output file
java.io.IOException
- Write errorprivate void writeVertex(java.io.BufferedWriter bw, org.jgraph.graph.DefaultGraphCell vertex, org.jgraph.JGraph graph) throws java.io.IOException
bw
- The BufferedWriter being used to write to this filevertex
- The vertex to addd to the output filegraph
- The graph which is being converted to a GasTeX image
java.io.IOException
- Write errorprivate void writeEdge(java.io.BufferedWriter bw, org.jgraph.graph.DefaultEdge edge, org.jgraph.JGraph graph) throws java.io.IOException
bw
- The BufferedWriter being used to write to this file.edge
- The edge which is being added to the GasTeX filegraph
- The graph which is being converted to a GasTeX image.
java.io.IOException
- Write Error
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |