Make your own free website on

JLogo: Implementing Logo using Java.


StringWorker and UtilityWorker.

The StringWorker has static methods which are used to convert a given String to a List containing the commands to be executed. The command string is of this format: "LOGO>FD 10\nLOGO>fd 10 rt 10". So the StringWorker has two methods lastCommand(), which will parse out the last command entered by the user, and lastCommandArr(), which parses the string to a list containing the command and associated values.
public static String lastCommand(String s){
public static List lastCommandArr(String s){
The UtilityWorker class has three methods. The doIt method takes a List(of commands entered by user) and a DrawArea, and runs the users command on the DrawArea. doIt1 is a private method used by doIt() for fulfilling its job.
public static void doIt(DrawArea dw, java.util.List ll) {
private static List doIt1(DrawArea dw, java.util.List l){
upDateText is method which updates text relating to GUI.

to next chapter >>>