//PlaneWaveMenuPanel.java
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.lang.*;  

public class PlaneWaveMenuPanel extends Panel{
    //private static final Color bgcolor = Color.lightGray;
    private static final Color bgcolor = new Color(236,236,236);
    public Button b1, b2, b3;
    public Checkbox EHbox, SDbox;
    public Scrollbar slider1;
    public int SCROLLMIN=750, SCROLLMAX=1001;
    private int SleepTime = 50;
        
    public PlaneWaveMenuPanel(){
	super();
        setLayout(null);
	setBackground(bgcolor);
        
	b1 = new Button("Input/Output");
        b1.setBackground(Color.white);
	b2 = new Button("Phase Planes");
	b2.setBackground(Color.white);
        b3 = new Button("Instructions");
        b3.setBackground(Color.white);
        add(b1);
	add(b2);
        add(b3);
	EHbox = new Checkbox("|Phasors|",null,true);
        SDbox = new Checkbox("Show \u03b4 z",null,true);
        //SDbox.setEnabled(false);
        SDbox.setVisible(false);
                
	//add(EHbox);
	EHbox.setBackground(bgcolor);
        add(SDbox);
	SDbox.setBackground(bgcolor);       
        
        b1.setBounds(5,3,95,20);
        b2.setBounds(105,3,95,20);
        b3.setBounds(205,3,95,20);

        EHbox.setBounds(220,3,100,20);
        SDbox.setBounds(220,29,100,20);
        
        slider1 = new Scrollbar(Scrollbar.HORIZONTAL,SCROLLMAX-1-SleepTime,1,SCROLLMIN,SCROLLMAX);
	slider1.setBounds(25,27,255,15);
        slider1.setBackground(Color.white);
	add(slider1);
        
        Panel ps1 = new Panel();
                    ps1.setBackground(Color.black);
                    add(ps1);
                    ps1.setBounds(24,26,257,17);
    }
    
    public void paint(Graphics g){
	g.setColor(bgcolor);	
	g.fillRect(0,0,getSize().width-1,getSize().height-1);
	//g.setColor(Color.black);
        //g.drawLine(0,size().height-1,size().width-1,size().height-1);
        //g.drawLine(size().width-1,0,size().width-1,size().height-1);
        //g.setColor(Color.white);
        //g.drawLine(0,0,size().width-1,0);
        //g.drawLine(0,0,0,size().height-1);
        
        Graphics2D g2d = (Graphics2D)g;
        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
            
        g.setColor(Color.black);
        MaestroG.subscripter("Animation speed","","",g,10,120,53);
        
        g.setColor(Color.black);
        //g.fillRect(25,32,256,12);
        g.setColor(Color.white);
        //g.fillRect(26,33,254,10);
        
        g.setColor(Color.blue.darker());
	MaestroG.drawArrowtip(35,49,8,g);
	MaestroG.drawArrowtip(42,49,8,g);
            
        g.setColor(Color.red.darker());
	MaestroG.drawArrowtip(264,49,7,g);
	MaestroG.drawArrowtip(271,49,7,g);
        
        g.setColor(Color.lightGray);
        //g.drawLine(5,27,getSize().width-5,27);
          
    }
}