//RadarControls.java
//Singh T. Junior and Umberto Ravaioli

/*import java.awt.Color;
import java.awt.Graphics;
import java.applet.Applet;
import java.awt.Image;
import java.awt.Event;
import java.awt.*;
*/
import java.awt.*;
import java.awt.event.*;
//import java.applet.*;
import java.lang.*;  


class RadarControls extends Panel implements ActionListener, ItemListener{
	DipoleAnt ant;
	OutPanel outputpanel;
	SlidePanel slidepanel;
	Checkbox c1, c3, c2, c4;
	public Button b1;
	Label lab1;
	int xshift = 20;
	private static final Color bgcolor = new Color(236,236,221);
	
	CheckboxGroup cgrid1, cgrid2;

	public RadarControls (DipoleAnt ant){
		super();
		this.ant = ant;
		//setLayout(new GridLayout(2,2));
		setLayout(null);
		setBackground(bgcolor);
		setFont(new Font("SanSerif",Font.PLAIN,12));
		lab1 = new Label("PLOT:");
		cgrid1=new CheckboxGroup();
		cgrid2=new CheckboxGroup();
		c1 = new Checkbox("E-H Fields",cgrid1,true);	
		c3 = new Checkbox("Power",cgrid1,false);
		c2 = new Checkbox("Set Input Data",cgrid2,true);
		c4 = new Checkbox("Review Output",cgrid2,false);
		
		lab1.setBounds(-12+xshift,15,40,15);
		lab1.setForeground(Color.blue);
		
                // CHANGE ======================================================
		c1.setBounds(25+xshift,13,92,20);
		c3.setBounds(95+xshift+xshift,13,75,20);
                //==============================================================
                
		c1.setBackground(bgcolor);
		c3.setBackground(bgcolor);
                
                b1=new Button("Instructions");
                b1.setBounds(205,10,80,20);
                b1.setBackground(Color.white);
                Panel pbut = new Panel();
		    pbut.setBackground(Color.black);
		    pbut.setBounds(204,9,82,22);
                
                add(b1); add(pbut);
                
                b1.addActionListener(this);
		c1.addItemListener(this);
		c3.addItemListener(this);

		add(c1);
		add(lab1);
		add(c3);
		
	}
	
	public void itemStateChanged(ItemEvent evt){
	    if(evt.getSource()==c1){
		ant.rcan1.repaint(1);
		ant.rcan2.repaint(1);
	    }	
	    else if(evt.getSource()==c3){
		ant.rcan1.repaint(3);
		ant.rcan2.repaint(3);
	    }
	}
        
        public void actionPerformed(ActionEvent evt){
            if(evt.getSource()==b1){
                //ant.about.setVisible(true);
                ant.instructions.setVisible(true);
                ant.instrFrame.setVisible(true);
	    }	
	    
        }
}

