interpreter1.java
package interpreter;

import java.awt.Color;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import painter.SPainter;
import shapes.SCircle;

public class interpreter1 {
    private void interpreter() {

        SPainter miro = new SPainter("Dot thing", 400, 400);
        miro.setScreenLocation(0, 0);
        SCircle dot = new SCircle(180);

        while (true) {
            String command = JOptionPane.showInputDialog(null, "command");
            if (command == null) {
                command = "exit";
            }
            if (command.equalsIgnoreCase("blue")) {
                miro.setColor(Color.BLUE);
                miro.paint(dot);
            } else if (command.equalsIgnoreCase("red")) {
                miro.setColor(Color.RED);
                miro.paint(dot);
            } else if (command.equalsIgnoreCase("help")) {
                JOptionPane.showMessageDialog(null, "valid commands are: "
                        + "RED | BLUE | HELP | EXIT");
            } else if (command.equalsIgnoreCase("exit")) {
                miro.end();
                System.out.println("Thank you for viewing the dots...");
                break;
            } else {
                JOptionPane.showMessageDialog(null, "unrecognizable command: " + command.toUpperCase());
            }
        }
    }

    public interpreter1(){
        interpreter();
    }
    public static void main(String[]arg){
        SwingUtilities.invokeLater(new Runnable(){
            public void run(){
                new interpreter1();
            }
        });
    }
}