Class GraphicsInterpreter
java.lang.Object
GraphicsInterpreter
public class GraphicsInterpreter
- extends Object
Class that reads in a file of graphics instructions, and
executes them, showing the result. Default picture size
is 640x480.
Format of the file is a bunch of lines of the form:
Command X Y
Commands are:
"line" with parameters of start and end X and Y and
"circle" with the upper left corner of the enclosing
rectangle and the diameter of the circle
For example:
line 10 10 50 70
circle 10 20 30
Which draws a line from (10,10) to (50,70) and a
circle at (10,20) with a diameter of 30.
- Author:
- Barb Ericson, Mark Guzdial
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GraphicsInterpreter
public GraphicsInterpreter()
interpretCommands
public Picture interpretCommands(String fileName)
- Method to interpret the commands in the given file
main
public static void main(String[] args)