//NewGuideInputPanel.java
import java.awt.*;
import java.awt.event.*;
import java.awt.event.MouseListener;
import javax.swing.*;
import javax.swing.event.*;

public class NewGuideInputPanel extends Panel implements ActionListener, ChangeListener { //, ItemListener {
    private NewGuide_State state;
    //private NewModeControlPanel pwmc;
    //private static final Color bgcolor = new Color(160,200,200);
    private static final Color bgcolor = new Color(236,236,221);
    private Font labfont=new Font("SanSerif",Font.PLAIN,12);
    private Font labfontB=new Font("SanSerif",Font.BOLD,12);
    private Font labfont0=new Font("SanSerif",Font.PLAIN,10);
    private Font labfont2=new Font("Serif",Font.PLAIN,14);
    private Font normalfont = new Font("SanSerif",Font.PLAIN,14);
    private Font labelfont = new Font("Serif",Font.ITALIC,14);
    private Font labelfont2 = new Font("Serif",Font.ITALIC,16);
    private Font labelfont0 = new Font("Serif",Font.ITALIC,12);
    private Font labelfontIT = new Font("Serif",Font.ITALIC,18);
    public int ScrollMax = 10000;
    public int ScrollMax2 = 751; 
    //public int ScrollMax2 = 76; 
    public int ScrollMax1 = 180; 
    public int ScrollMax3 = 1000;
    
    //public Checkbox cN1, cN2, cN3, cN4, cN5, cN6, cAnt1, cAnt2;
    //public CheckboxGroup cNumber, cAntenna;
    boolean cN1, cN2, cN3, cN4, cN5, cN6, cAnt1, cAnt2;
    
    public int offset = 10;
    private Label titlelabel, titlelabel2;
    private Label lab1A, lab1, lab2, lab2_a, lab2_b, lab2_c, lab2A, lab3, 
                  lab3b, lab3c, lab4, lab4A, lab6a, lab6b, lab6c, labT;
    private Label ulab1, ulab3, ulab2, ulab4, ulabT, Click;
    public TextField text1, text2, text3, text4, text6, textT;
    public JSlider slider1, slider2, slider3;
    public JSlider sliderT, sliderN;
    //public  Button b1, b2, b3;
    public  Button bupdate, bn1, bn2, bn3, bn4, bn5, bn6;
    public  Button bAnt1, bAnt2;
    public Panel ps1, ps2, pAnt1, pAnt2;
    //Choice ch1, ch2;
    public int x, y;

  
    public NewGuideInputPanel(NewGuide_State state){
	super();
	setLayout(null);
	setBackground(bgcolor);
	this.state = state;
        
        offset = state.s10;
        
        labfont=new Font("SanSerif",Font.PLAIN,state.font12);
        labfontB=new Font("SanSerif",Font.BOLD,state.font12);
        labfont0=new Font("SanSerif",Font.PLAIN,state.font10);
        labfont2=new Font("Serif",Font.PLAIN,state.font14);
        normalfont = new Font("SanSerif",Font.PLAIN,state.font14);
        labelfont = new Font("Serif",Font.ITALIC,state.font14);
        labelfont2 = new Font("Serif",Font.ITALIC,state.font16);
        labelfont0 = new Font("Serif",Font.ITALIC,state.font12);
        labelfontIT = new Font("Serif",Font.ITALIC,state.font18);

	/*
        cNumber = new CheckboxGroup();
	cN1 = new Checkbox(" 1",false,cNumber);
        cN2 = new Checkbox(" 2",true,cNumber);
	cN3 = new Checkbox(" 3",false,cNumber);
	cN4 = new Checkbox(" 4",false,cNumber);
        cN5 = new Checkbox(" 5",false,cNumber);
	cN6 = new Checkbox(" 6",false,cNumber);
	
        cAntenna = new CheckboxGroup();
	cAnt1 = new Checkbox("  \u03bb / 2   dipole",true,cAntenna);
        cAnt2 = new Checkbox("  Parabolic   Reflector",false,cAntenna);
	*/

	cN1 = false;
	cN2 = true;
	cN3 = false;
	cN4 = false;
	cN5 = false;
	cN6 = false;
	cAnt1 = true;
	cAnt2 = false;
	
	titlelabel = new Label("Set Array",Label.LEFT);
	titlelabel.setFont(new Font("SanSerif",Font.BOLD,state.font12));    
	titlelabel2 = new Label("Scan Angle",Label.LEFT);
	titlelabel2.setFont(new Font("SanSerif",Font.BOLD,state.font12));    
        
	lab1A = new Label("Element Type",Label.LEFT);
	lab1A.setFont(labfont);
        lab1A.setForeground(Color.red);
	
        Click = new Label("Click Update",Label.LEFT);
	Click.setFont(labfontB);
        Click.setForeground(Color.red);
	
        lab1 = new Label("d  = ",Label.RIGHT);
	lab1.setFont(labelfont);
	
        lab2A = new Label("Elements Spacing",Label.LEFT);
	lab2A.setFont(labfont);
	lab2A.setForeground(Color.red);
        lab2 = new Label("d  =",Label.RIGHT);
        lab2.setFont(labelfont2);
        lab2_c = new Label(" = ",Label.RIGHT);
	lab2_c.setFont(labelfont);
        
        // labels for epsilon - disabled
        lab3 = new Label("\u03b5",Label.RIGHT);
	lab3.setFont(labelfont);
	lab3b = new Label("r",Label.LEFT);
	lab3b.setFont(labelfont);
	lab3.setForeground(Color.black);
	lab3b.setForeground(Color.black);
	lab3c = new Label("=",Label.LEFT);
	lab3c.setFont(labelfont);
	lab3c.setForeground(Color.black);
        
        
	lab4A = new Label("Number of Elements",Label.LEFT);
	lab4A.setFont(labfont);
        lab4A.setForeground(Color.red);
        lab4 = new Label("f  = ",Label.RIGHT);
	lab4.setFont(labelfont);
        
        // labels for wire - disabled
	lab6a = new Label("a",Label.RIGHT);
	lab6a.setFont(labelfontIT);
	lab6b = new Label("Radius",Label.CENTER);
	lab6b.setFont(labfont2);
	lab6c = new Label(" = ",Label.RIGHT);
	lab6c.setFont(labelfont);
			
	text1 = new TextField(""+state.a,8);
        text2 = new TextField(""+state.taper_parameter,8);
	text3 = new TextField(""+state.epsilon_r,8);
	text4 = new TextField(""+state.frequency,8);
	text6 = new TextField(""+state.wire_radius,8);
        text1.setFont(labfont);
        text2.setFont(labfont);
        text3.setFont(labfont);
        text4.setFont(labfont);
        text6.setFont(labfont);
        
	
	ulab4 = new Label(" [Hz]",Label.LEFT);
	ulab2 = new Label(" [V/m]",Label.LEFT);
        ulab1 = new Label("\u03bb",Label.LEFT);
        ulab1.setFont(labfont2);
        ulab3 = new Label("\u03bb",Label.LEFT);
        ulab3.setFont(labfont2);

	slider1 = new JSlider(0,ScrollMax+1); //changes a
	slider2 = new JSlider(0,ScrollMax+1); //changes frequency
	slider3 = new JSlider(0,ScrollMax2);  //changes taper parameter
	/*
	slider1 = new Scrollbar(Scrollbar.HORIZONTAL,0,1,0,ScrollMax+1);//changes a
	slider2 = new Scrollbar(Scrollbar.HORIZONTAL,0,1,0,ScrollMax+1);//changes frequency
	slider3 = new Scrollbar(Scrollbar.HORIZONTAL,0,1,0,ScrollMax2);//changes taper parameter
	slider1.setBackground(Color.white);
        slider2.setBackground(Color.white);
        slider3.setBackground(Color.white);
        */
	slider1.setValue((int)((state.a-state.a_minimum)*ScrollMax/(state.a_maximum-state.a_minimum)));
	slider2.setValue((int)((state.frequency-state.frequency_minimum)*ScrollMax/(state.frequency_maximum-state.frequency_minimum)));
	slider3.setValue(750);
	//slider3.setValue(75);

	// sliderT0 UNUSED:
	sliderT = new JSlider(0,ScrollMax1+1); //changes theta
	sliderT.setValue((int)((state.theta_angle-state.theta_minimum)*ScrollMax1/(state.theta_maximum-state.theta_minimum)));
	/*
        sliderT = new Scrollbar(Scrollbar.HORIZONTAL,0,1,0,ScrollMax1+1);//changes theta
        sliderT0 = new Scrollbar(Scrollbar.HORIZONTAL,0,1,0,ScrollMax3+1);//changes theta decimal
        sliderT.setValue((int)((state.theta_angle-state.theta_minimum)*ScrollMax1/(state.theta_maximum-state.theta_minimum)));
	sliderT0.setValue((int)((state.theta_angle-(int)state.theta_angle)*ScrollMax3));
        sliderT.setBackground(Color.white);
        sliderT0.setBackground(Color.white);
	*/

        sliderN = slider1 = new JSlider(0,6);
	sliderN.setValue(0);
	/*
        sliderN = slider1 = new Scrollbar(Scrollbar.HORIZONTAL,0,1,0,6);
        sliderN.setBackground(Color.white);
	*/
        
        labT = new Label(" \u03b8   = ",Label.RIGHT);
	labT.setFont(labelfont);
	textT = new TextField(""+(state.theta_angle-90.0),8);
	ulabT = new Label(" [deg]",Label.LEFT);
	/*
	b1 = new Button("Range");
	b2 = new Button("Range");
	b3 = new Button("Range");
	*/
        bn1 = new Button(" 1 ");
	bn2 = new Button(" 2 ");
	bn3 = new Button(" 3 ");
	bn4 = new Button(" 4 ");
	bn5 = new Button(" 5 ");
	bn6 = new Button(" 6 ");
	
        bAnt1 = new Button(" \u03bb / 2  dipole ");
        bAnt1.setForeground(Color.black);
        bAnt2 = new Button("Parabolic Reflector");
        bAnt2.setForeground(Color.gray);
        
        bAnt1.setFont(labfont);
        bAnt2.setFont(labfont);
        
	bupdate = new Button("Update");
        bupdate.setFont(labfont);
	add(titlelabel);
	add(titlelabel2);
        
	add(lab1);
        add(lab1A);
        //add(lab2_c);
        add(lab2A);
	add(lab2);
        add(labT);
        
        add(lab4);
        add(lab4A);
        add(text1);
	add(text2);
	add(text3);
	add(text4);
	add(text6);
        add(textT);
	
	add(ulab4);
	add(ulab2);
        add(ulab1);
        add(ulab3);
        add(ulabT);
        
	add(slider1);
	add(slider2);
	add(slider3);
	add(sliderT);
        add(sliderN);
        //add(sliderT0);
        
	//add(b1);
	//add(b2);
	//add(b3);
        add(bn1);
        add(bn2);
        add(bn3);
        add(bn4);
        add(bn5);
        add(bn6);
	add(bupdate);
        add(bAnt1);
        add(bAnt2);
	//add(cN1); add(cN2); add(cN3); add(cN4); add(cN5); add(cN6);
        //add(cAnt1); add(cAnt2);
        
	titlelabel.setBounds(state.s10,state.s5,state.s150,state.s18);
	Click.setBounds(state.s190,state.s5,state.s95,state.s18);
        int vPosInit = state.s20+offset, vPos, dvPos = state.s7, vHeight = state.s18, vSlider = state.s15; 
	vPos = vPosInit;
	
	lab2A.setBounds(state.s10,vPos-state.s3,state.s120,vHeight);
        lab2.setBounds(state.s130,vPos-state.s3,state.s30,vHeight);
        //lab2_c.setBounds(state.s150,vPos-state.s3,state.s20,vHeight);
	text2.setBounds(state.s170,vPos-state.s5,state.s50,vHeight+state.s2);
	ulab3.setBounds(state.s200+state.s35,vPos-state.s3,state.s35,vHeight); 
        
        Panel pt2 = new Panel();
	    pt2.setBackground(Color.black);
	    add(pt2);
	    pt2.setBounds(state.s170-1,vPos-state.s5-1,state.s50+2,vHeight+state.s2+2);
	
	vPos += vHeight;
	slider3.setBounds(state.s10,vPos+state.s4,state.s196,vSlider);
	/*
	Panel ps19 = new Panel();
	    ps19.setBackground(Color.cyan);
	    add(ps19);
	    ps19.setBounds(state.s10-1,vPos+state.s4-1,state.s196+2,vSlider+2);
	    
	Panel ps110 = new Panel();
	    ps110.setBackground(Color.black);
	    add(ps110);
	    ps110.setBounds(state.s10-2,vPos+state.s4-2,state.s196+4,vSlider+4);
	*/
        vPos += vHeight + 2*dvPos;
        lab4A.setBounds(state.s10,vPos-state.s3,state.s120,vHeight);
        vPos += vHeight + dvPos/2-state.s5;
        
        bn1.setBackground(Color.white);
        bn2.setBackground(Color.white);
        bn3.setBackground(Color.white);
        bn4.setBackground(Color.white);
        bn5.setBackground(Color.white);
        bn6.setBackground(Color.white);
        bn1.setBounds(state.s15,vPos,state.s35,state.s15);
        bn2.setBounds(state.s60,vPos,state.s35,state.s15);
        bn3.setBounds(state.s105,vPos,state.s35,state.s15);
        bn4.setBounds(state.s150,vPos,state.s35,state.s15);
        bn5.setBounds(state.s195,vPos,state.s35,state.s15);
        bn6.setBounds(state.s200+state.s40,vPos,state.s35,state.s15);
        bn1.setFont(labfontB); bn2.setFont(labfontB); bn3.setFont(labfontB);
        bn4.setFont(labfontB); bn5.setFont(labfontB); bn6.setFont(labfontB);
        bn1.setForeground(Color.gray); bn2.setForeground(Color.red);
        bn3.setForeground(Color.gray); bn4.setForeground(Color.gray);
        bn5.setForeground(Color.gray); bn6.setForeground(Color.gray);
        
	//cN1.setBounds(state.s20,vPos,state.s45,vHeight);
        //cN2.setBounds(state.s65,vPos,state.s45,vHeight);
        //cN3.setBounds(state.s110,vPos,state.s45,vHeight);
        //cN4.setBounds(state.s155,vPos,state.s45,vHeight);
        //cN5.setBounds(state.s200,vPos,state.s45,vHeight);
        //cN6.setBounds(state.s200+state.s45,vPos,state.s45,vHeight);
        
        vPos += vHeight + dvPos;
        lab1A.setBounds(state.s10,vPos-state.s3,state.s120,vHeight);
        vPos += vHeight + dvPos/2-state.s5;
        //cAnt1.setBounds(state.s20,vPos,state.s200,vHeight);
        bAnt1.setBounds(state.s10,vPos,state.s150,vHeight-state.s2);
        pAnt1 = new Panel();
	    pAnt1.setBackground(Color.red);
	    add(pAnt1);
            pAnt1.setVisible(true);
	    pAnt1.setBounds(state.s10-2,vPos-2,state.s150+4,vHeight-state.s2+4);
        vPos += vHeight + dvPos/2;
        //cAnt2.setBounds(state.s20,vPos,state.s200,vHeight);
        bAnt2.setBounds(state.s10,vPos,state.s150,vHeight-state.s2);
        pAnt2 = new Panel();
	    pAnt2.setBackground(Color.red);
	    add(pAnt2);
	    pAnt2.setVisible(false);
	    pAnt2.setBounds(state.s10-2,vPos-2,state.s150+4,vHeight-state.s2+4);
        
        bupdate.setBounds(state.s200+state.s20, state.s50, state.s65, state.s24);
        
	//Listeners
	bupdate.addActionListener(this);
        bn1.addActionListener(this); bn2.addActionListener(this);
	bn3.addActionListener(this); bn4.addActionListener(this);
	bn5.addActionListener(this); bn6.addActionListener(this);
	bAnt1.addActionListener(this); bAnt2.addActionListener(this);
        slider1.addChangeListener(this);
	slider2.addChangeListener(this);
	slider3.addChangeListener(this);
	sliderT.addChangeListener(this);
        sliderN.addChangeListener(this);

	/*
        cN1.addItemListener(this);
        cN2.addItemListener(this);
        cN3.addItemListener(this);
        cN4.addItemListener(this);
        cN5.addItemListener(this);
        cN6.addItemListener(this);
        cAnt1.addItemListener(this);
        cAnt2.addItemListener(this);
        */
        //addMouseListener(this);  UNUSED
    }
    
    @Override
    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);
        
	int vPosInit = state.s30, vPos, dvPos = state.s2, vHeight = state.s20; 
	vPos = vPosInit;
	g.setColor(Color.black);
	//g.drawLine(state.s10,state.s200+state.s18,getSize().width-state.s10,state.s200+state.s18);
	
	g.setColor(Color.red);    
	g.setFont(new Font("SanSerif",Font.PLAIN,state.font12));
	
	g.setColor(Color.black);    
	g.setFont(new Font("Serif",Font.PLAIN,state.font14));
	//g.drawString("\u03bb",255,vPos+53);
	//g.drawString("\u03bb",255,getSize().height-52);
	//g.drawString("\u03c1",142,getSize().height-52);
	g.setFont(new Font("SanSerif",Font.PLAIN,state.font12));
	slider1.requestFocusInWindow();
	slider2.requestFocusInWindow();
	slider3.requestFocusInWindow();
	sliderT.requestFocusInWindow();
	sliderN.requestFocusInWindow();
    }
    

    
    /*
    public synchronized void mouseHandler(MouseEvent evt){
	x = evt.getX();
	y = evt.getY();
        
        if(x <= state.s100 && (y >= state.s170 && y <= state.s185)){
            cAnt1.setState(true);
            cAnt2.setState(false);
            
            state.IsParabolic = false;
            state.ignition();
            state.scanField();
        }
        else if(x <= state.s100 && (y > state.s185 && y <= state.s200)){
            cAnt1.setState(false);
            cAnt2.setState(true);
            
            state.IsParabolic = true;
            state.ignition();
            state.scanField();
        }
        
        
    }
    */
    
    public void actionPerformed(ActionEvent evt){
        
        if(evt.getSource() == bAnt1){
            state.IsParabolic = false;
            state.ignition();
            state.scanField();
            bAnt1.setForeground(Color.black);
            bAnt2.setForeground(Color.gray);
            pAnt1.setVisible(true);
            pAnt2.setVisible(false);
        }
        else if(evt.getSource() == bAnt2){
            state.IsParabolic = true;
            state.ignition();
            state.scanField();
            bAnt1.setForeground(Color.gray);
            bAnt2.setForeground(Color.black);
            pAnt1.setVisible(false);
            pAnt2.setVisible(true);
        }
        
        if(evt.getSource() == bn1 || evt.getSource() == bn2 || evt.getSource() == bn3 ||
            evt.getSource() == bn4 || evt.getSource() == bn5 || evt.getSource() == bn6  ){
            
            if(evt.getSource() == bn1){
                state.N_elements = 1;
                cN1 = false;
                cN2 = false;
                cN3 = false;
                cN4 = false;
                cN5 = false;
                cN6 = false;
                bn1.setForeground(Color.red);
                bn2.setForeground(Color.gray);
                bn3.setForeground(Color.gray);
                bn4.setForeground(Color.gray);
                bn5.setForeground(Color.gray);
                bn6.setForeground(Color.gray);
            }
            else if(evt.getSource() == bn2){
                state.N_elements = 2;
                cN1 = false;
                cN2 = true;
                cN3 = false;
                cN4 = false;
                cN5 = false;
                cN6 = false;
                bn2.setForeground(Color.red);
                bn1.setForeground(Color.gray);
                bn3.setForeground(Color.gray);
                bn4.setForeground(Color.gray);
                bn5.setForeground(Color.gray);
                bn6.setForeground(Color.gray);
            }
            else if(evt.getSource() == bn3){
                state.N_elements = 3;
                cN1 = false;
                cN2 = false;
                cN3 = true;
                cN4 = false;
                cN5 = false;
                cN6 = false;
                bn3.setForeground(Color.red);
                bn1.setForeground(Color.gray);
                bn2.setForeground(Color.gray);
                bn4.setForeground(Color.gray);
                bn5.setForeground(Color.gray);
                bn6.setForeground(Color.gray);
            }
            else if(evt.getSource() == bn4){
                state.N_elements = 4;
                cN1 = false;
                cN2 = false;
                cN3 = false;
                cN4 = true;
                cN5 = false;
                cN6 = false;
                bn4.setForeground(Color.red);
                bn1.setForeground(Color.gray);
                bn2.setForeground(Color.gray);
                bn3.setForeground(Color.gray);
                bn5.setForeground(Color.gray);
                bn6.setForeground(Color.gray);
            }
            else if(evt.getSource() == bn5){
                state.N_elements = 5;
                cN1 = false;
                cN2 = false;
                cN3 = false;
                cN4 = false;
                cN5 = true;
                cN6 = false;
                bn5.setForeground(Color.red);
                bn1.setForeground(Color.gray);
                bn2.setForeground(Color.gray);
                bn3.setForeground(Color.gray);
                bn4.setForeground(Color.gray);
                bn6.setForeground(Color.gray);
            }
            else if(evt.getSource() == bn6){
                state.N_elements = 6;
                cN1 = false;
                cN2 = false;
                cN3 = false;
                cN4 = false;
                cN5 = false;
                cN6 = true;
                bn6.setForeground(Color.red);
                bn1.setForeground(Color.gray);
                bn2.setForeground(Color.gray);
                bn3.setForeground(Color.gray);
                bn4.setForeground(Color.gray);
                bn5.setForeground(Color.gray);
            }
            try{
                if(Double.valueOf(text2.getText()).doubleValue() > 1.0){
                    state.taper_parameter = 1.0;
		    slider3.setValue(ScrollMax2-1);
                    text2.setText("1.0");
                }
                else if(Double.valueOf(text2.getText()).doubleValue()<0.25){
                    state.taper_parameter = 0.25;
		    slider3.setValue(250);
                    text2.setText("0.25");
                }
                else{
                    state.taper_parameter = Double.valueOf(text2.getText()).doubleValue();
		    slider3.setValue((int)((1000.0)*(state.taper_parameter))-250);
                }
	    }
	    catch(NumberFormatException e){
		  state.taper_parameter = 0.0; 
	    }
            
            repaint();
            state.ignition();
            state.scanField();
            state.scan_coefficients();            
        }
        
     //***********
     if(evt.getSource()==bupdate){
	//*********
	    
	    try{
                if(Double.valueOf(text2.getText()).doubleValue() > 1.0){
                    state.taper_parameter = 1.0;
		    slider3.setValue(ScrollMax2-1);
                    text2.setText("1.0");
                }
                else if(Double.valueOf(text2.getText()).doubleValue()<0.25){
                    state.taper_parameter = 0.25;
		    slider3.setValue(250);
                    //slider3.setValue(25);
                    text2.setText("0.25");
                }
                else{
                    state.taper_parameter = Double.valueOf(text2.getText()).doubleValue();
		    slider3.setValue((int)((1000.0)*(state.taper_parameter))-250);
                    //slider3.setValue((int)((100.0)*(state.taper_parameter))-25);
                }
	    }
	    catch(NumberFormatException e){
		  state.taper_parameter = 0.0; 
	    }
           
	  }
            //Click.setVisible(false);
            repaint();
	    state.ignition();
            state.scanField();
            state.scan_coefficients();
            
    }//End of actionPerformed()
    
    public void stateChanged(ChangeEvent evt){
	if(evt.getSource()==slider3){
	    state.taper_parameter  = 0.25 + (double)slider3.getValue()/1000.0;
            //state.taper_parameter  = 0.25 + (double)slider3.getValue()/100.0;
	    text2.setText(""+MaestroA.rounder(state.taper_parameter,7));
            
            //Click.setVisible(true);
            repaint();
            
            state.ignition();
            //state.scanField();
            //state.scan_coefficients();
	}
              
    }


    /*
    public void itemStateChanged(ItemEvent evt){
	if(evt.getSource() == cN1){
            state.N_elements = 1;
            state.ignition();
            state.scanField();
	}
        else if(evt.getSource() == cN2){
            state.N_elements = 2;
            state.ignition();
            state.scanField();
	}
	else if(evt.getSource() == cN3){
            state.N_elements = 3;
            state.ignition();
            state.scanField();
	}
        else if(evt.getSource() == cN4){
            state.N_elements = 4;
            state.ignition();
            state.scanField();
	}
        else if(evt.getSource() == cN5){
            state.N_elements = 5;
            state.ignition();
            state.scanField();
	}
        else if(evt.getSource() == cN6){
            state.N_elements = 6;
            state.ignition();
            state.scanField();
	}
        
        else if(evt.getSource() == cAnt1){
            state.IsParabolic = false;
            state.ignition();
            state.scanField();
	}
        else if(evt.getSource() == cAnt2){
            state.IsParabolic = true;
            state.ignition();
            state.scanField();
	}
    }
    */
    
}


