Class graph.BuildGraph
All Packages Class Hierarchy This Package Previous Next Index
Class graph.BuildGraph
java.lang.Object
|
+----java.io.StreamTokenizer
|
+----graph.ScanWord
|
+----graph.BuildGraph
- public class BuildGraph
- extends ScanWord
This class will parse a description file and build a
plot based on the instructions in the file.
The build Graph class, with attached Axes and DataSets can be accessed
though methods in the class
- Version:
- 1.14, 1996/09/06 00:08:49
- Author:
- Leigh Brookshaw
-
applet
- The Calling Applet
-
build
- The BUILD stack.
-
built
- The class vector.
-
debug
- Debug.
-
graph
- The constructed Graph Object
-
graphtitle
- The TextLine containing the title
-
level
- The current brace level.
-
lineno
- Current line being parsed
-
object
- The Object stack.
-
BuildGraph(InputStream, Applet)
- Instantiate the class
-
arrayFromFunction(ParseFunction, int, double, double)
-
-
arrayFromFunction(ParseFunction, int, double, double, int, double, double)
-
-
build(NamedObject)
- Based on the parsed object build something.
-
buildAxis()
-
-
buildContour(NamedObject)
-
-
buildData(int)
-
-
buildFont()
-
-
buildGraph(int)
- Pop things off the object stack and build the graph
-
buildGrid()
-
-
buildLabel()
-
-
buildMarker()
-
-
buildTitle()
-
-
buildZero()
-
-
getBuilt()
- Get a vector of all the built Classes.
-
getGraph()
- Get the Graph object that has been built!
-
getGraphTitle()
- Get the title of the Graph
-
isContext(int)
- Check if the object is on the "to be built" stack.
-
parse()
- This is THE method that parses the input file and constructs the plot.
build
protected Stack build
- The BUILD stack. Everything pushed on this stack has to be
built from other objects. An example would be a Font, which
is constructed from Logical name, style and size.
object
protected Stack object
- The Object stack. All input tokens get pushed onto and
popped off this stack.
built
protected Vector built
- The class vector. This contains final class objects that cannot be
deleted. That is
we don't want these classes unnattached and collected into the garbage.
The obvious classes here are the main Graph2D class, the Axes of the plot
DataSets etc.
graph
protected Object graph
- The constructed Graph Object
graphtitle
protected TextLine graphtitle
- The TextLine containing the title
applet
protected Applet applet
- The Calling Applet
debug
protected boolean debug
- Debug. If true output copious debug messages. Though unless you know
what is going on with the code most messages will probably be
meaningless
lineno
public int lineno
- Current line being parsed
level
public int level
- The current brace level. At the end of the input if all
braces are matched the level should be back to zero.
BuildGraph
public BuildGraph(InputStream in,
Applet ap)
- Instantiate the class
- Parameters:
- in - The inputstream to be read
- ap - the driving applet.
getGraph
public Object getGraph()
- Get the Graph object that has been built!
getGraphTitle
public TextLine getGraphTitle()
- Get the title of the Graph
getBuilt
public Vector getBuilt()
- Get a vector of all the built Classes.
Ie the DataSets, Axis, Graph etc.
This can be used by an applet to override anything specified in the
input file
parse
public void parse()
- This is THE method that parses the input file and constructs the plot.
isContext
protected boolean isContext(int token)
- Check if the object is on the "to be built" stack. This way context can be
checked so potential errors flagged.
- Parameters:
- token - is this the object we are currently building?
- Returns:
- true if the token matches current object being built
build
protected boolean build(NamedObject nobj)
- Based on the parsed object build something.
- Parameters:
- nobj - The object to be built
- Returns:
- true if the build was successful.
buildGraph
protected boolean buildGraph(int type)
- Pop things off the object stack and build the graph
- Parameters:
- type - Type of graph to build, Graph2D, G2Dint, Contour.
- Returns:
- true if the build was successful
buildContour
protected boolean buildContour(NamedObject nobj)
- Returns:
- true if the build was successful
buildFont
protected boolean buildFont()
- Returns:
- true if the build was successful
buildTitle
protected boolean buildTitle()
- Returns:
- true if the build was successful
buildLabel
protected boolean buildLabel()
- Returns:
- true if the build was successful
buildMarker
protected boolean buildMarker()
buildData
protected boolean buildData(int type)
- Returns:
- true if the build was successful
arrayFromFunction
protected double[] arrayFromFunction(ParseFunction f,
int nx,
double xmin,
double xmax)
arrayFromFunction
protected double[] arrayFromFunction(ParseFunction f,
int nx,
double xmin,
double xmax,
int ny,
double ymin,
double ymax)
buildAxis
protected boolean buildAxis()
- Returns:
- true if the build was successful
buildGrid
protected boolean buildGrid()
- Returns:
- true if the build was successful
buildZero
protected boolean buildZero()
- Returns:
- true if the build was successful
All Packages Class Hierarchy This Package Previous Next Index