Interpreter3.java
package interpreters;
import java.awt.Color;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import shapes.SCircle;
import painter.SPainter;
public class Interpreter3 {
    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,"Your Command?");
            if( command == null ) { command = "exit"; }
            if ( command.equalsIgnoreCase("green")){
                miro.setColor(Color.GREEN);
                miro.paint(dot);
            }
            else if ( command.equalsIgnoreCase("yellow")){
                miro.setColor(Color.yellow);
                miro.paint(dot);
            }
            else if ( command.equalsIgnoreCase("random")){
                miro.setColor(randomColor());
                miro.paint(dot);
            }
            else if ( command.equalsIgnoreCase("help")){
                JOptionPane.showMessageDialog(null,"The commands are:" + "GREEN | YELLOW | HELP |RANDOM | EXIT ");

            }
            else if ( command.equalsIgnoreCase("exit")){
                miro.end();
                System.out.println("Thank you for viewing the dots ...");
                break;
            }
            else  {
                JOptionPane.showMessageDialog(null,"Unrecognizable command: ");

            }
        }
    }

        private static Color randomColor() {
        int rv = (int) (Math.random()*256);
        int gv = (int) (Math.random()*256);
        int bv = (int) (Math.random()*256);
        return new Color(rv,gv,bv);
    }

    public Interpreter3(){
        interpreter();
    }
    public static void main(String[] args){
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                new Interpreter3();
            }
        });
    }
}