|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--elan.Context
Stores and manages the internal state of the IDE. Most commands, either GUI or model related, pass through this class.
| Method Summary | |
void |
addLegalCommand(java.lang.String command)
adds a command to the list of legal/valid avaible slogo commands |
void |
appendErrorMessage(java.lang.String error)
adds an error message to the list of messages for the user |
void |
appendMessage(java.lang.String update)
adds a message to the list of messages for the user |
void |
back(double amount)
moves the Turtle backward |
void |
clean()
cleans the turtle canvas (i.e. |
void |
clearMessages()
clears all messages to be shown to user |
void |
clearScreen()
resets the Turtle's location to default location & clears all lines from canvas |
void |
forward(double amount)
moves the Turtle foward |
java.awt.Color |
getBackground()
|
java.lang.Object[] |
getCoreCommands()
|
java.lang.Object[] |
getCustomCommands()
|
static Context |
getInstance()
|
java.lang.Object[] |
getMessages()
|
java.awt.Color |
getPenColor()
|
float |
getPenWidth()
|
java.awt.geom.Point2D |
getTurtleCoords()
|
int |
getTurtleDisplacement()
|
double |
getTurtleHeading()
|
java.awt.Image |
getTurtleImage()
|
double |
getTurtleXCor()
|
double |
getTurtleYCor()
|
void |
home()
resets the Turtle's location to default location |
boolean |
isPenDown()
|
boolean |
isTurtleVisible()
|
void |
load(java.io.File file)
loads an existing file into the file manager and compiles the file |
void |
loadNew(java.lang.String filename)
loads a new file into the file manager |
void |
print()
|
void |
removeLegalCommand(java.lang.String command)
removes a custom function from the list of available custom functions |
void |
save(java.lang.String filename)
saves an existing file in the file manager and writes the file to disk |
void |
setBackground(java.awt.Color c)
set the color of the background on the Canvas Frame |
void |
setPenColor(java.awt.Color c)
set the Turtle's pen color to the specified value |
void |
setPenDown(boolean b)
|
void |
setPenWidth(float width)
set the size/width of the Turtle's pen |
void |
setTurtleCoords(double x,
double y)
set the Turtle's x-coordinate & y-coordinate |
void |
setTurtleDisplacement(int value)
set the Turtle's displacement (i.e. |
void |
setTurtleHeading(double change)
set the Turtle's heading |
void |
setTurtleHeadingAbsolute(int newHeading)
set the Turtle's heading to the specified value |
void |
setTurtleImage(java.awt.Image im)
set the Turtle's image on the drawing canvas |
void |
setTurtleVisibility(boolean vis)
set the visibility of the Turtle |
void |
setTurtleXCor(double change)
set the Turtle's x-coordinate |
void |
setTurtleYCor(double change)
set the Turtle's y-coordinate |
void |
sortCustomCommands()
sorts the list of available custom functions |
void |
towards(double lhs,
double rhs)
moves the Turtle towards ... |
void |
update()
updates the view of the entire IDE |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static Context getInstance()
public int getTurtleDisplacement()
public void setTurtleDisplacement(int value)
value - displacement to which to set the Turtlepublic double getTurtleXCor()
public double getTurtleYCor()
public void setTurtleXCor(double change)
change - displacement in x direction to which to set the Turtlepublic void setTurtleYCor(double change)
change - displacement in y direction to which to set the Turtle
public void setTurtleCoords(double x,
double y)
public java.awt.geom.Point2D getTurtleCoords()
public void setTurtleImage(java.awt.Image im)
im - image to which to set the turtlepublic java.awt.Image getTurtleImage()
public void setTurtleHeading(double change)
change - amount by which to change the Turtle's current heading (see also setTurtleHeadingAbsolute(double d) )public void setTurtleHeadingAbsolute(int newHeading)
public double getTurtleHeading()
public java.lang.Object[] getMessages()
public void appendMessage(java.lang.String update)
update - message to appendpublic void appendErrorMessage(java.lang.String error)
error - message to appendpublic void clearMessages()
public void setPenDown(boolean b)
public boolean isPenDown()
public void setPenColor(java.awt.Color c)
c - the color to which to set the penpublic java.awt.Color getPenColor()
public void setPenWidth(float width)
width - the width to which to set the Turtle's penpublic float getPenWidth()
public void setBackground(java.awt.Color c)
c - the color to which to set the backgroundpublic java.awt.Color getBackground()
public void setTurtleVisibility(boolean vis)
vis - true - if Turtle is visiblepublic boolean isTurtleVisible()
public void addLegalCommand(java.lang.String command)
command - command to add to the list of available custom functionspublic void removeLegalCommand(java.lang.String command)
command - command to remove from the list of available custom functionspublic void sortCustomCommands()
public java.lang.Object[] getCustomCommands()
public java.lang.Object[] getCoreCommands()
public void clean()
public void home()
public void clearScreen()
public void towards(double lhs,
double rhs)
public void forward(double amount)
amount - number to units of which to move the Turtlepublic void back(double amount)
amount - number to units of which to move the Turtlepublic void save(java.lang.String filename)
filename - name of file being savedpublic void load(java.io.File file)
file - File to load into file managerpublic void loadNew(java.lang.String filename)
filename - name of new file opened in file manager (NOTE: actual file is not created and written out until the file has been saved)public void update()
public void print()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||