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 applet
-    The Calling Applet
  
-   build build
-  The BUILD stack.
  
-   built built
-  The class vector.
  
-   debug debug
-  Debug.
  
-   graph graph
-  The constructed Graph Object 
  
-   graphtitle graphtitle
-    The TextLine containing the title
  
-   level level
-  The current brace level.
  
-   lineno lineno
-  Current line being parsed
  
-   object object
-    The Object stack.
   
  -   BuildGraph(InputStream, Applet) BuildGraph(InputStream, Applet)
-  Instantiate the class
   
  -   arrayFromFunction(ParseFunction, int, double, double) arrayFromFunction(ParseFunction, int, double, double)
-  
  
-   arrayFromFunction(ParseFunction, int, double, double, int, double, double) arrayFromFunction(ParseFunction, int, double, double, int, double, double)
-  
  
-   build(NamedObject) build(NamedObject)
-   Based on the parsed object build something.
  
-   buildAxis() buildAxis()
-  
  
-   buildContour(NamedObject) buildContour(NamedObject)
-  
  
-   buildData(int) buildData(int)
-          
  
-   buildFont() buildFont()
-  
  
-   buildGraph(int) buildGraph(int)
-  Pop things off the object stack and build the graph
  
-   buildGrid() buildGrid()
-  
  
-   buildLabel() buildLabel()
-  
  
-   buildMarker() buildMarker()
-  
  
-   buildTitle() buildTitle()
-  
  
-   buildZero() buildZero()
-  
  
-   getBuilt() getBuilt()
-   Get a vector of all the built Classes.
  
-   getGraph() getGraph()
-  Get the Graph object that has been built!
  
-   getGraphTitle() getGraphTitle()
-  Get the title of the Graph
  
-   isContext(int) isContext(int)
-  Check if the object is on the "to be built" stack.
  
-   parse() parse()
-  This is THE method that parses the input file and constructs the plot.
   
 build
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
object
  protected Stack object
  -  The Object stack. All input tokens get pushed onto and 
   popped off this stack.
 built
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
graph
  protected Object graph
  -  The constructed Graph Object
 graphtitle
graphtitle
  protected TextLine graphtitle
  -  The TextLine containing the title
 applet
applet
  protected Applet applet
  -  The Calling Applet
 debug
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
lineno
  public int lineno
  -  Current line being parsed
 level
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
BuildGraph
  public BuildGraph(InputStream in,
                    Applet ap)
  -  Instantiate the class
  
    -  Parameters:
    
-  in - The inputstream to be read
    -  ap - the driving applet.
  
 
   
 getGraph
getGraph
  public Object getGraph()
  -  Get the Graph object that has been built!
 getGraphTitle
getGraphTitle
  public TextLine getGraphTitle()
  -  Get the title of the Graph
 getBuilt
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
parse
  public void parse()
  -  This is THE method that parses the input file and constructs the plot.
 isContext
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
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
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
buildContour
  protected boolean buildContour(NamedObject nobj)
  
    -  Returns:
    
-  true if the build was successful
  
 buildFont
buildFont
  protected boolean buildFont()
  
    -  Returns:
    
-  true if the build was successful
  
 buildTitle
buildTitle
  protected boolean buildTitle()
  
    -  Returns:
    
-  true if the build was successful
  
 buildLabel
buildLabel
  protected boolean buildLabel()
  
    -  Returns:
    
-  true if the build was successful
  
 buildMarker
buildMarker
  protected boolean buildMarker()
 buildData
buildData
  protected boolean buildData(int type)
  
    -  Returns:
    
-  true if the build was successful
  
 arrayFromFunction
arrayFromFunction
  protected double[] arrayFromFunction(ParseFunction f,
                                       int nx,
                                       double xmin,
                                       double xmax)
 arrayFromFunction
arrayFromFunction
  protected double[] arrayFromFunction(ParseFunction f,
                                       int nx,
                                       double xmin,
                                       double xmax,
                                       int ny,
                                       double ymin,
                                       double ymax)
 buildAxis
buildAxis
  protected boolean buildAxis()
  
    -  Returns:
    
-  true if the build was successful
  
 buildGrid
buildGrid
  protected boolean buildGrid()
  
    -  Returns:
    
-  true if the build was successful
  
 buildZero
buildZero
  protected boolean buildZero()
  
    -  Returns:
    
-  true if the build was successful
  
All Packages  Class Hierarchy  This Package  Previous  Next  Index