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

Variable Index

 o applet
The Calling Applet
 o build
The BUILD stack.
 o built
The class vector.
 o debug
Debug.
 o graph
The constructed Graph Object
 o graphtitle
The TextLine containing the title
 o level
The current brace level.
 o lineno
Current line being parsed
 o object
The Object stack.

Constructor Index

 o BuildGraph(InputStream, Applet)
Instantiate the class

Method Index

 o arrayFromFunction(ParseFunction, int, double, double)
 o arrayFromFunction(ParseFunction, int, double, double, int, double, double)
 o build(NamedObject)
Based on the parsed object build something.
 o buildAxis()
 o buildContour(NamedObject)
 o buildData(int)
 o buildFont()
 o buildGraph(int)
Pop things off the object stack and build the graph
 o buildGrid()
 o buildLabel()
 o buildMarker()
 o buildTitle()
 o buildZero()
 o getBuilt()
Get a vector of all the built Classes.
 o getGraph()
Get the Graph object that has been built!
 o getGraphTitle()
Get the title of the Graph
 o isContext(int)
Check if the object is on the "to be built" stack.
 o parse()
This is THE method that parses the input file and constructs the plot.

Variables

 o 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.
 o object
  protected Stack object
The Object stack. All input tokens get pushed onto and popped off this stack.
 o 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.
 o graph
  protected Object graph
The constructed Graph Object
 o graphtitle
  protected TextLine graphtitle
The TextLine containing the title
 o applet
  protected Applet applet
The Calling Applet
 o 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
 o lineno
  public int lineno
Current line being parsed
 o 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.

Constructors

 o BuildGraph
  public BuildGraph(InputStream in,
                    Applet ap)
Instantiate the class
Parameters:
in - The inputstream to be read
ap - the driving applet.

Methods

 o getGraph
  public Object getGraph()
Get the Graph object that has been built!
 o getGraphTitle
  public TextLine getGraphTitle()
Get the title of the Graph
 o 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
 o parse
  public void parse()
This is THE method that parses the input file and constructs the plot.
 o 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
 o 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.
 o 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
 o buildContour
  protected boolean buildContour(NamedObject nobj)
Returns:
true if the build was successful
 o buildFont
  protected boolean buildFont()
Returns:
true if the build was successful
 o buildTitle
  protected boolean buildTitle()
Returns:
true if the build was successful
 o buildLabel
  protected boolean buildLabel()
Returns:
true if the build was successful
 o buildMarker
  protected boolean buildMarker()
 o buildData
  protected boolean buildData(int type)
Returns:
true if the build was successful
 o arrayFromFunction
  protected double[] arrayFromFunction(ParseFunction f,
                                       int nx,
                                       double xmin,
                                       double xmax)
 o arrayFromFunction
  protected double[] arrayFromFunction(ParseFunction f,
                                       int nx,
                                       double xmin,
                                       double xmax,
                                       int ny,
                                       double ymin,
                                       double ymax)
 o buildAxis
  protected boolean buildAxis()
Returns:
true if the build was successful
 o buildGrid
  protected boolean buildGrid()
Returns:
true if the build was successful
 o buildZero
  protected boolean buildZero()
Returns:
true if the build was successful

All Packages  Class Hierarchy  This Package  Previous  Next  Index