//ChoicePanel
/* A Java class for
 * LossyWide.java
 * Electromagnetic Transmission Line Applet
 * Applet without Smith Chart - Prepared by Umberto Ravaioli 
 * for 6th edition of Fundamentals of Applied Electromagnetics Book
 * May 2009 - All Rights Reserved
 */ 
import java.awt.*;

public class ChoicePanel extends Panel{ 
	public Choice c1;
	public Choice c2;
	private  Label lab1, lab2;
	
	private static final Color bgcolor = new Color(236,236,236);
	private static final Color tinta = new Color(236,236,236);
        public static Font labelfont;
        public static Font normalfont;
        Trans_State state;
	
	public ChoicePanel(String arg1[], String arg2[], Trans_State state){
		super();
                this.state = state;
		//setLayout(new FlowLayout());
                setLayout(null);
		setBackground(bgcolor);
		//Font labelfont=new Font("SanSerif",Font.BOLD,14);
		lab1=new Label(arg1[0],Label.CENTER);
		lab1.setFont(labelfont);
		add(lab1);
		lab1.setBounds(state.s10,state.s8,state.s73,state.s20);
                
		c1 = new Choice();
		for(int i = 1; i < arg1.length; i++){
		    c1.addItem(arg1[i]);
		}
		// CHANGE ======================================================
                c1.setBounds(state.s85,state.s8,state.s200,state.s20);
                //==============================================================
                
		add(c1);
		c1.setFont(new Font("SanSerif",Font.ITALIC,state.font12));
                //c1.setFont(normalfont);
		//c1.setBackground(Color.white);
		c1.setBackground(bgcolor);
		c1.setForeground(Color.black);
		
		lab2=new Label(arg2[0],Label.RIGHT);
		lab2.setFont(labelfont);
		//add(lab2);
		c2=new Choice();
		for(int i = 1; i < arg2.length; i++){
		    c2.addItem(arg2[i]);
		}
		c2.setBackground(tinta);
		c2.setForeground(Color.black);
		
	}
	public void paint(Graphics g){
	    g.clearRect(0,0,getSize().width,getSize().height);
	    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);
	}
	
} // ChoicePanel.java
