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

public class NewGuideGraphCanvasG extends GraphCanvasD{
    //private static final Color bgcolor = new Color(236,236,221);
    //private static final Color bgcolor = new Color(170,240,240);
    private static final Color bgcolor = Color.gray;
    private NewGuide_State state;
    private static final int LeftMargin=10, RightMargin=10, TopMargin=10, BottomMargin=10;
    
    public NewGuideGraphCanvasG(NewGuide_State state){
	
	super();
	this.state = state;
	setBackground(bgcolor);
	
        if(!state.Is_dB){
            setYRangeMax(MaestroA.getMax(state.ethetaM));
            setYRangeMin(0.0);
        }
        else{
            setYRangeMax(0.0);
            setYRangeMin(Math.min(-100.0,MaestroA.getMin(state.ethetaM_dB)));
            //setYRangeMin((MaestroA.getMin(state.ethetaM_dB)));
        }
	
	plotZeroLine(false);
	plotRefPoint(false);
	setPhiAngle((int)state.phi_angle);
	setType(1);
	//setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
        setLabels("","","\u03b8  [degrees]");
	//setRefPoint(state.w);
	setPolar(true);
	setdB(state.Is_dB);
	//plot(state.x_polar,state.ethetaM);
        if(!state.Is_dB){plot(state.x_polar,state.ethetaM);}
        else{plot(state.x_polar,state.ethetaM_dB);}
   }
   
}
