detects actions when buttons are pressed...closes the dialog
when "DONE" is clicked and prompts the user to change a palette
color when one of the color buttons is pressed
A token represented by a single character, e.g.,
'*', ';', '[' and so on;
the method equals compares a CharToken as equal to another CharToken
encapsulating the same character.
Factory for generating CharToken objects
ensuring that only one of any specific CharToken object
is created (enforcing CharToken singleton-ness per char value)
Illustrates the java.io.StreamTokenizer
class and how it can be used to parse tokens
for a toy example programming language (elan)
For this example simple instructions are parsed,
but lots of infrastructure is in place for parsing
a more complete language.
the base class of all arithmetic expressions,
the evaluate method uses
the hook/template method
value to return a Double value,
the template method returns a double.
tells the turtle to enter fence mode:
From now on, if the turtle is asked to move past the boundary of the graphics window,
it will move as far as it can and then stop at the edge with an "out of bounds"
error message.
Fence() -
Constructor for class elan.instruction.Fence
sets the turtles initial properties...location at the
Cartesian origin, headed in positive y direction, with turtle
shape, thin white pen color and pen up
adds a new color corresponding to the given int to myColors;
returns false in the int corresponds to one of the ten core colors
or if it is greater than the maximum number of colors allowed;
returns true if color successfully added to the map.
adds a new ImageIcon corresponding to the given int to shapeMap;
returns false in the int corresponds to one of the three core shapes
or if it is greater than the maximum number of shapes allowed;
returns true if shape successfully added to the map.
The TurtleContext class implements the Context interface and provides a hook through which the parser in the elan package can intereact with the TurtleManagerand the Output in the graphics package.