//TransInputPanel
//author Umberto Ravaioli, 2005

import java.awt.*;

public class TransInputPanel extends PC{
    private Trans_State state;
    private static final Color tinta = new Color(236,236,236);
    private static final Color bgcolor = new Color(236,236,236);
    
    public TransInputPanel(String titulo, String[] nome, String[] unidade, Trans_State state){
	super(titulo,nome,unidade);
	setLayout(null);
	setBackground(bgcolor);
	this.state = state;
	
	b1.setBounds(state.s85,state.s4,state.s100,state.s18);
        b1.setBackground(Color.white);
        b1.setFont(new Font("SanSerif",Font.PLAIN,state.font12));
        
        Panel ps7 = new Panel();
	    ps7.setBackground(Color.lightGray);
	    add(ps7);
	    ps7.setBounds(state.s85-1,state.s4-1,state.s100+2,state.s18+2);
	    
	Panel ps8 = new Panel();
	    ps8.setBackground(Color.black);
	    add(ps8);
	    ps8.setBounds(state.s85-2,state.s4-2,state.s100+4,state.s18+4);
	
        
	text1[0].setBounds(state.s110,state.s26,state.s60,state.s18); // Input Window for Zo
	text1[0].setFont(new Font("SanSerif",Font.PLAIN,state.font12));
        
        lab3[0].setBounds(state.s180,state.s27,state.s35,state.s18); // Ohms units
	lab3[0].setFont(new Font("Serif",Font.PLAIN,state.font13));
        
	// This for complex characteristic impedance
	/*
	lab1[0].setBounds(6,32,10,9);
	text1[0].setBounds(32,30,60,18);
	lab2[0].setBounds(93,30,14,18);
	text2[0].setBounds(112,30,60,18);
	lab3[0].setBounds(175,30,25,18);
	*/
	
	text1[0].setText(""+state.Z0.Real());
	//text2[0].setText(""+state.Z0.Imaginary());
	
	//Listeners
    }
    
    public void paint(Graphics g){
        Graphics2D g2d = (Graphics2D)g;
        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
        
        g.clearRect(0,0,getSize().width,getSize().height);
        
        g.setColor(Color.black);	
        MaestroG.subscripterB("Set Line","","",g,state.font12,state.s10,state.s15); 
        MaestroG.subscripterSerif(" Z","0"," =",g,state.font13,state.s70,state.s40);
    }
}