|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.io.StreamTokenizer
|
+--org.PingOO.DLAI.lib.graph.ScanWord
|
+--org.PingOO.DLAI.lib.graph.BuildGraph
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
| Inner Class Summary | |
private class |
BuildGraph.NamedObject
This is a structure class used exclusively by BuildGraph. |
| Field Summary | |
protected java.applet.Applet |
applet
The Calling Applet |
(package private) static int |
ATTACH
|
(package private) static int |
AXIS
|
(package private) static int |
BACKGROUND
|
(package private) static int |
BEGIN
|
(package private) static int |
BOLD
|
(package private) static int |
BOTTOM
|
protected java.util.Stack |
build
The BUILD stack. |
protected java.util.Vector |
built
The class vector. |
(package private) static int |
CDATA
|
(package private) static int |
CLABELS
|
(package private) static int |
COLOR
|
(package private) static int |
CONTOUR
|
(package private) static int |
DATA
|
private java.util.Vector |
datasets
This vector contains all the datasets as they are built. |
protected boolean |
debug
Debug. |
(package private) static int |
DEBUG
|
(package private) static int |
END
|
(package private) static int |
FONT
|
(package private) static int |
FUNCTION
|
(package private) static int |
G2DINT
|
protected java.lang.Object |
graph
The constructed Graph Object |
(package private) static int |
GRAPH2D
|
protected TextLine |
graphtitle
The TextLine containing the title |
(package private) static int |
GRID
|
(package private) static int |
GRID_COLOR
|
(package private) static int |
GRID_OFF
|
(package private) static int |
GRID_ON
|
(package private) static int |
ITALIC
|
(package private) static int |
LABEL
|
(package private) static int |
LABEL_COLOR
|
(package private) static int |
LABEL_FONT
|
(package private) static int |
LABEL_OFF
|
(package private) static int |
LEFT
|
int |
level
The current brace level. |
int |
lineno
Current line being parsed |
(package private) static int |
LLEVELS
|
(package private) static int |
LOGCONTOURS
|
(package private) static int |
MARKER
|
(package private) static int |
MARKER_COLOR
|
(package private) static int |
MARKER_SIZE
|
(package private) static int |
MARKER_STYLE
|
(package private) static int |
MARKER_URL
|
(package private) static int |
NAME
|
(package private) static int |
NUMBER
|
protected java.util.Stack |
object
The Object stack. |
(package private) static int |
OFF
|
(package private) static int |
ON
|
(package private) static int |
PLAIN
|
(package private) static int |
RIGHT
|
(package private) static int |
SIZE
|
(package private) static int |
SQUARE
|
(package private) static int |
STYLE
|
(package private) static int |
TITLE
|
(package private) static int |
TOP
|
(package private) static int |
URL
|
(package private) static int |
XMAX
|
(package private) static int |
XMIN
|
(package private) static int |
XNUMBER
|
(package private) static int |
XRANGE
|
(package private) static int |
YMAX
|
(package private) static int |
YMIN
|
(package private) static int |
YNUMBER
|
(package private) static int |
YRANGE
|
(package private) static int |
ZERO
|
(package private) static int |
ZERO_COLOR
|
(package private) static int |
ZERO_OFF
|
(package private) static int |
ZERO_ON
|
| Fields inherited from class org.PingOO.DLAI.lib.graph.ScanWord |
ERROR,
is,
kwords,
STRING,
StringChar,
UNKNOWN |
| Fields inherited from class java.io.StreamTokenizer |
buf,
CT_ALPHA,
CT_COMMENT,
CT_DIGIT,
CT_QUOTE,
CT_WHITESPACE,
ctype,
eolIsSignificantP,
forceLower,
input,
LINENO,
nval,
peekc,
pushedBack,
reader,
slashSlashCommentsP,
slashStarCommentsP,
sval,
TT_EOF,
TT_EOL,
TT_NOTHING,
TT_NUMBER,
TT_WORD,
ttype |
| Constructor Summary | |
BuildGraph(java.io.InputStream in,
java.applet.Applet ap)
Instantiate the class |
|
| Method Summary | |
protected double[] |
arrayFromFunction(ParseFunction f,
int nx,
double xmin,
double xmax)
|
protected double[] |
arrayFromFunction(ParseFunction f,
int nx,
double xmin,
double xmax,
int ny,
double ymin,
double ymax)
|
protected boolean |
build(BuildGraph.NamedObject nobj)
Based on the parsed object build something. |
protected boolean |
buildAxis()
Builds the axis. |
protected boolean |
buildContour(BuildGraph.NamedObject nobj)
Builds the contour. |
protected boolean |
buildData(int type)
Build the data |
protected boolean |
buildFont()
Builds the font. |
protected boolean |
buildGraph(int type)
Pops things off the object stack and build the graph. |
protected boolean |
buildGrid()
Builds the grid. |
protected boolean |
buildLabel()
Buids the label. |
protected boolean |
buildMarker()
|
protected boolean |
buildTitle()
Builds the title. |
protected boolean |
buildZero()
Builds zero. |
private void |
debugMessage(java.lang.String s,
int token)
Outputs the parsed debug message, appending line number, and token string. |
private void |
errorAtLine(java.lang.String s)
Outputs the parsed error message with the line number of the line that triggered the error. |
java.util.Vector |
getBuilt()
Get a vector of all the built Classes. |
java.lang.Object |
getGraph()
Gets the Graph object that has been built! |
TextLine |
getGraphTitle()
Get the title of the Graph. |
protected boolean |
isContext(int token)
Checks if the object is on the "to be built" stack. |
void |
parse()
This is THE method that parses the input file and constructs the plot. |
| Methods inherited from class org.PingOO.DLAI.lib.graph.ScanWord |
addKeyWord,
closeStream,
getKeyValue,
getNumber,
nextWord,
resetKeyWords,
resetWordSyntax,
setStringChar |
| Methods inherited from class java.io.StreamTokenizer |
commentChar,
eolIsSignificant,
lineno,
lowerCaseMode,
nextToken,
ordinaryChar,
ordinaryChars,
parseNumbers,
pushBack,
quoteChar,
read,
resetSyntax,
slashSlashComments,
slashStarComments,
toString,
whitespaceChars,
wordChars |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
static final int BEGIN
static final int GRAPH2D
static final int MARKER
static final int AXIS
static final int URL
static final int DATA
static final int SIZE
static final int COLOR
static final int NAME
static final int TITLE
static final int LABEL
static final int FONT
static final int STYLE
static final int BOTTOM
static final int TOP
static final int LEFT
static final int RIGHT
static final int END
static final int G2DINT
static final int OFF
static final int ON
static final int ATTACH
static final int PLAIN
static final int BOLD
static final int ITALIC
static final int DEBUG
static final int GRID
static final int ZERO
static final int CONTOUR
static final int LLEVELS
static final int NUMBER
static final int CDATA
static final int FUNCTION
static final int XRANGE
static final int YRANGE
static final int BACKGROUND
static final int LOGCONTOURS
static final int CLABELS
static final int SQUARE
static final int MARKER_STYLE
static final int MARKER_COLOR
static final int MARKER_SIZE
static final int LABEL_COLOR
static final int LABEL_FONT
static final int GRID_COLOR
static final int GRID_OFF
static final int ZERO_COLOR
static final int ZERO_OFF
static final int MARKER_URL
static final int GRID_ON
static final int ZERO_ON
static final int XMIN
static final int XMAX
static final int YMIN
static final int YMAX
static final int XNUMBER
static final int YNUMBER
static final int LABEL_OFF
protected java.util.Stack build
protected java.util.Stack object
protected java.util.Vector built
protected java.lang.Object graph
protected TextLine graphtitle
protected java.applet.Applet applet
protected boolean debug
true output copious debug messages.
private java.util.Vector datasets
public int lineno
public int level
| Constructor Detail |
public BuildGraph(java.io.InputStream in,
java.applet.Applet ap)
in - The inputstream to be readap - the driving applet.| Method Detail |
public java.lang.Object getGraph()
public TextLine getGraphTitle()
public java.util.Vector getBuilt()
public void parse()
protected boolean isContext(int token)
token - Is this the object we are currently building?true if the token matches current object being built, false otherwise.protected boolean build(BuildGraph.NamedObject nobj)
nobj - The object to be builttrue if the build was successful, false otherwise.protected boolean buildGraph(int type)
type - Type of graph to build, Graph2D, G2Dint, Contour.true if the build was successful, false otherwise.protected boolean buildContour(BuildGraph.NamedObject nobj)
true if the build was successful, false otherwise.protected boolean buildFont()
true if the build was successful, false otherwise.protected boolean buildTitle()
true if the build was successful, false otherwise.protected boolean buildLabel()
true if the build was successful, false otherwise.protected boolean buildMarker()
protected boolean buildData(int type)
true if the build was successful, false otherwise.
protected double[] arrayFromFunction(ParseFunction f,
int nx,
double xmin,
double xmax)
f - nx - xmin - xmax -
protected double[] arrayFromFunction(ParseFunction f,
int nx,
double xmin,
double xmax,
int ny,
double ymin,
double ymax)
f - nx - xmin - xmax - ny - ymin - ymax - protected boolean buildAxis()
true if the build was successful, false otherwise.protected boolean buildGrid()
true if the build was successful, false otherwise.protected boolean buildZero()
true if the build was successful, false otherwise.private void errorAtLine(java.lang.String s)
s - Message to ouput
private void debugMessage(java.lang.String s,
int token)
s - Message to ouput.token - token to be replaced with a string.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||