/* @(#)ConcentrationTester.java 1.0  1 November 2004 */

import edu.neu.ccs.*;
import edu.neu.ccs.gui.*;
import edu.neu.ccs.console.*;
import edu.neu.ccs.jpf.*;
import edu.neu.ccs.util.*;

import java.awt.*;
import javax.swing.*;

public class ConcentrationTester extends JPF 
{
    
    public static void main(String[] args) { 
        //LookAndFeelTools.adjustAllDefaultFontSizes(8);
        
        new ConcentrationTester();
    }
    
    
    public void Concentration() {
        ConcentrationGame.newGame();
    }
    
    
    public void RegularPolygon(int vertices, int skip) {
        window.clearPanel();
        
        double centerX = 200;
        double centerY = 200;
        double radius = 150;
        
        Shape shape = GameShapes.regularPolygon
            (centerX, centerY, radius, 0, vertices, skip);
        
        ShapePaintable paintable =
            new ShapePaintable(shape, PaintMode.FILL, Colors.black);
        
        paintable.paint(window.getBufferGraphics());
        
        window.repaint();
    }
    
    
    public void RegularWavygon(int vertices) {
        window.clearPanel();
        
        double centerX = 200;
        double centerY = 200;
        double radius = 150;
        
        Shape shape = GameShapes.regularWavygon
            (centerX, centerY, radius, 0, vertices);
        
        ShapePaintable paintable =
            new ShapePaintable(shape, PaintMode.FILL, Colors.black);
        
        paintable.paint(window.getBufferGraphics());
        
        window.repaint();
    }
    
    
    public void RegularSpokes(int vertices) {
        window.clearPanel();
        
        double centerX = 200;
        double centerY = 200;
        double radius = 150;
        
        Shape shape = GameShapes.regularSpokes
            (centerX, centerY, radius, 0, vertices);
        
        Stroke stroke = 
            new BasicStroke(10, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);
        
        ShapePaintable paintable =
            new ShapePaintable(shape, PaintMode.DRAW, null, Colors.black, stroke);
        
        paintable.paint(window.getBufferGraphics());
        
        window.repaint();
    }
    
    
    private static ShapePaintable[] paintables = GameShapes.getGameShapePaintables();
    
    private static int shapeLength = paintables.length;
    
    
    public void RandomGameShape() {
        window.clearPanel();
        
        int i = MathUtilities.randomInt(0, shapeLength - 1);
        
        paintables[i].paint(window.getBufferGraphics());
        
        window.repaint();
    }
}
