//ControlPanel
/* A Java class for
 * SingleStub.java
 * Electromagnetic Transmission Line Applet
 * Applet without Smith Chart - Prepared by Umberto Ravaioli 
 * for 6th edition of Fundamentals of Applied Electromagnetics Book
 * June 2009 - All Rights Reserved
 */   

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

public class ControlPanel extends Panel{
    //private static final Color bgcolor = new Color(236,236,236);
    //public final Color bgcolor = new Color(170,200,200);
    //private static final Color bgcolor = Color.gray;
    
    public final Color buttoncolor1 = Color.lightGray;
    //private final Color bgcolor = new Color(220,220,220);
    private final Color bgcolor = new Color(240,240,240);
    
    
    final Font labfont = TheFonts.bold12;
    Button b1, b2, b3;
    ControlPanel(){
	super();
        setLayout(null);
        setFont(TheFonts.sanSerif14);
	
	setBackground(bgcolor);
	b1 = new Button("   Go Back   ");
	b2 = new Button("  Next Step  ");
	b3 = new Button("Back to Start");
        
        // CHANGE ==============================================================
        //b1.setBackground(buttoncolor1);
	//b2.setBackground(buttoncolor1);
	//b3.setBackground(buttoncolor1);
        b1.setBackground(bgcolor);
	b2.setBackground(bgcolor);
	b3.setBackground(bgcolor);
        //======================================================================
	
        b1.setBounds(10,6,105,24);
        b2.setBounds(124,6,105,24);
        b3.setBounds(238,6,105,24);
      
	add(b1);
	add(b2);
	add(b3);
	b1.setFont(labfont);
	b2.setFont(labfont);
	b3.setFont(labfont);
    }
    
    public void paint(Graphics g){
	g.setColor(bgcolor.darker());
	
	g.fillRect(0,getSize().height-2,getSize().width,2);
	g.fillRect(getSize().width-2,0,2,getSize().height);
	g.setColor(bgcolor.brighter());
	g.fillRect(0,0,2,getSize().height-1);
	g.fillRect(0,0,getSize().width-2,2);
    }
    
    public void setEnabled(boolean zzz){
	b1.setEnabled(zzz);
	b2.setEnabled(zzz);
	b3.setEnabled(zzz);
    }
}
