//NewGuideOutputPanel12.java
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.lang.*;  
//import maestro.lib.math.*;
//import maestro.lib.graphics.*;

public class NewGuideOutputPanel12 extends Panel implements ItemListener{
	NewGuide_State state;
	private static final Color bgcolor = new Color(236,236,221);
	//private static final Color bgcolor = Color.lightGray;
	private static final Font labfont=new Font("SanSerif",Font.PLAIN,12);
	
	private static final Font titlefont=new Font("SanSerif",Font.BOLD,16);
	Label titlelabel;	
	public Choice c1;
	public TitleCanvas11 tcanvas11;
	public NewOutputCanvasW rwocW; 
	public NewOutputCanvasZ rwocZ;
	public ScrollPane pane1, pane2;
	public Checkbox ch1, ch2;	
		
	public NewGuideOutputPanel12(NewGuide_State state){
	    super();
	    setLayout(null);
	    this.state = state;
	    setBackground(bgcolor);
	    state.microFlag12 = false;
	    
	    titlelabel = new Label("    Current Data",Label.LEFT);
	    //add(titlelabel);
	    titlelabel.setBounds(5,5,95,15);    
	    titlelabel.setFont(titlefont);
	    
	    pane1 = new ScrollPane();
	    pane1.setBounds(4,29,287,163);
	    add(pane1);
	    pane2  = new ScrollPane();
	    pane2.setBounds(4,29,287,163);
	    add(pane2);
	    
	    Panel pp1 = new Panel();
	    pp1.setBackground(Color.black);
	    add(pp1);
	    pp1.setBounds(4,29,288,164);
    	    
	    c1 = new Choice();
	    
	    c1.addItem("  Polar (radians) ");
	    c1.addItem("  Polar (degrees) ");
	    c1.addItem("  Cartesian ");
	    add(c1);
	    c1.setBounds(132,2,160,25);
	    //c1.setBackground(bgcolor.brighter());
	    
	    CheckboxGroup chgroup1 = new CheckboxGroup();
	    ch1 = new Checkbox("A",true,chgroup1);
	    ch2 = new Checkbox("B",false,chgroup1);
	
	    ch1.setBackground(bgcolor);
	    ch2.setBackground(bgcolor);
	
	    ch1.setFont(labfont);
	    ch2.setFont(labfont);
	
	    add(ch1);
	    add(ch2);
	
	    ch1.setBounds(45,7,40,16);
	    ch2.setBounds(90,7,40,16);
	    
	    tcanvas11 = new TitleCanvas11(state);
	    add(tcanvas11);
	    tcanvas11.setBounds(0,0,300,25);
	    
	    rwocW = new NewOutputCanvasW(state);
	    pane1.add(rwocW);
	    pane1.setBackground(Color.white);
	    rwocW.setBounds(0,50,260,18120);
	    //rwocW.setBounds(0,50,260,18250);
	    
	    rwocZ = new NewOutputCanvasZ(state);
	    pane2.add(rwocZ);
	    pane2.setBackground(Color.white);
	    rwocZ.setBounds(0,50,260,18120);
	    //rwocZ.setBounds(0,50,260,18250);
	    pane1.setVisible(false);
	    pane2.setVisible(true);
	    //Listeners
	    c1.addItemListener(this);
	    ch1.addItemListener(this);
	}
    
    //public void ignition(){
    // 	    rwocW = new NewOutputCanvasW(state);
    //	    rwocW.setBounds(0,50,260,(int)(state.NsectionsLarge*18.1));
    //	    rwocZ = new NewOutputCanvasZ(state);
    //	    rwocZ.setBounds(0,50,260,(int)(state.NsectionsLarge*18.1));
    //	    System.out.println((int)(state.NsectionsLarge*18.1));
    //}

    public void itemStateChanged(ItemEvent evt){
	ItemSelectable ie = evt.getItemSelectable();
	    if(evt.getSource()==c1){
		if(ie.getSelectedObjects()[0]=="  Cartesian "){
		    pane1.setVisible(true);
		    pane2.setVisible(false);
		}
		else if(ie.getSelectedObjects()[0]=="  Polar (radians) "){
		    pane1.setVisible(false);
		    pane2.setVisible(true);
		    state.microFlag12 = false;
		    rwocZ.repaint();
		}
		else if(ie.getSelectedObjects()[0]=="  Polar (degrees) "){
		    pane1.setVisible(false);
		    pane2.setVisible(true);
		    state.microFlag12 = true;
		    rwocZ.repaint();
		}
	    }
    }	
}

class TitleCanvas11 extends Canvas{
	private static final Font normalfont = new Font("Serif",Font.PLAIN,12);
	private static final Font subfont    = new Font("Serif",Font.PLAIN,10);
	private static final Font normalfontB = new Font("Serif",Font.BOLD,12);
	
	private static final Font symbolfont=new Font("Serif",Font.PLAIN,16);
	private static final Font symbolfont2=new Font("Serif",Font.PLAIN,14);
	
	NewGuide_State state;
	public TitleCanvas11(NewGuide_State state){
	    super();
	    this.state = state;
	}
	
	public void paint(Graphics g){
            Graphics2D g2d = (Graphics2D)g;
            g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
                
	    g.setFont(symbolfont);
	    g.setColor(Color.blue);   
	    
	    MaestroG.subscripter3("I ( z )","","",g,14,10,17);
	}
}

class NewOutputCanvasW extends Canvas{
	private static final Font normalfont = new Font("SanSerif",Font.PLAIN,12);
	private static final Font subfont    = new Font("SanSerif",Font.PLAIN,10);
	private static final Font symbolfont=new Font("Serif",Font.PLAIN,14);
	NewGuide_State state;
	public NewOutputCanvasW(NewGuide_State state){
	    super();
	    this.state = state;
	}
	
	public void paint(Graphics g){
            Graphics2D g2d = (Graphics2D)g;
            g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
                
	    int x, y, dx, dxx, dy, dyy;
	    double v_normalized, f_normalized;
	    double wavelength_factor = state.wavelength/state.DipoleLength_meters;
	    String stmp;
	    String lambda;
	    FontMetrics fm;
	    x = 10;
	    y = 12;
	    dx = 80;
	    dxx = 15;
	    g.setFont(normalfont);
	    fm = g.getFontMetrics();
	    //dy = fm.getHeight();
	    dy = 12;
	    dyy = dy+2;
	    int intfac = 1;
	    
	    g.setFont(symbolfont);
	    g.getFontMetrics();
	    lambda="\u03bb";
	    g.setFont(normalfont);
	    g.getFontMetrics();
	    
	    
	    g.setColor(Color.black);
	    if(state.currentMAX >=1.0){
	    
	    for(int i=0;i<state.NsectionsLarge;i++){
		    if(state.IsA)
		    {
			g.setColor(Color.blue);
			g.drawString(MaestroA.rounder(1.0e3*(state.zposLarge[i]+state.DipoleLength_meters/2),3)+" [ mm ]    "
				 +MaestroA.rounder(state.zLambda[i],5)+"   "+lambda,x,y);
		    
			g.setColor(Color.red);
			g.drawString(""+i,235,y);
			y+=dyy;
			g.setColor(Color.black);
			g.drawString(state.currentLarge[i].toString(Complex.CARTESIAN,6)+" [ A ]",x,y);
			g.setColor(Color.red);
			g.drawLine(x,y+dyy/2-2,x+250,y+dyy/2-2);
			y+=dyy+4;
		    }
		    else if(state.IsB)
		    {
			g.setColor(Color.blue);
			g.drawString(MaestroA.rounder(1.0e3*(state.zposLarge2[i]+state.DipoleLength2_meters/2),3)+" [ mm ]    "
				 +MaestroA.rounder(state.zLambda2[i],5)+"   "+lambda,x,y);
		    
			g.setColor(Color.red);
			g.drawString(""+i,235,y);
			y+=dyy;
			g.setColor(Color.black);
			g.drawString(state.currentLarge2[i].toString(Complex.CARTESIAN,6)+" [ A ]",x,y);
			g.setColor(Color.red);
			g.drawLine(x,y+dyy/2-2,x+250,y+dyy/2-2);
			y+=dyy+4;
		    }
	    }
	    
	    }
	  else if(state.currentMAX < 1.0 && state.currentMAX >= 1.0e-3){
	    
	    for(int i=0;i<state.NsectionsLarge;i++){
		if(state.IsA)
		{
		    g.setColor(Color.blue);
		    g.drawString(MaestroA.rounder(1.0e3*state.zposLarge[i],3)+" [ mm ]    "
				 +MaestroA.rounder(state.zLambda[i],5)+"   "+lambda,x,y);
		    
		    g.setColor(Color.red);
		    g.drawString(""+i,235,y);
		    y+=dyy;
		    g.setColor(Color.black);
		    g.drawString((Complex.Multiply(state.currentLarge[i],1.0e3)).toString(Complex.CARTESIAN,6)+" [ mA ]",x,y);
		    g.setColor(Color.red);
		    g.drawLine(x,y+dyy/2-2,x+250,y+dyy/2-2);
		    y+=dyy+4;
		}
		else if(state.IsB){
		    g.setColor(Color.blue);
		    g.drawString(MaestroA.rounder(1.0e3*state.zposLarge2[i],3)+" [ mm ]    "
				 +MaestroA.rounder(state.zLambda2[i],5)+"   "+lambda,x,y);
		    
		    g.setColor(Color.red);
		    g.drawString(""+i,235,y);
		    y+=dyy;
		    g.setColor(Color.black);
		    g.drawString((Complex.Multiply(state.currentLarge2[i],1.0e3)).toString(Complex.CARTESIAN,6)+" [ mA ]",x,y);
		    g.setColor(Color.red);
		    g.drawLine(x,y+dyy/2-2,x+250,y+dyy/2-2);
		    y+=dyy+4;
		}
	    }
	   }
	   else if(state.currentMAX < 1.0e-3 && state.currentMAX >= 1.0e-6){
	    
	    for(int i=0;i<state.NsectionsLarge;i++){
		
		if(state.IsA){
		    g.setColor(Color.blue);
		    g.drawString(MaestroA.rounder(1.0e3*state.zposLarge[i],3)+" [ mm ]    "
				 +MaestroA.rounder(state.zLambda[i],5)+"   "+lambda,x,y);
		    
		    g.setColor(Color.red);
		    g.drawString(""+i,235,y);
		    y+=dyy;
		    g.setColor(Color.black);
		    g.drawString((Complex.Multiply(state.currentLarge[i],1.0e6)).toString(Complex.CARTESIAN,6)+" [ \u00b5A ]",x,y);
		    g.setColor(Color.red);
		    g.drawLine(x,y+dyy/2-2,x+250,y+dyy/2-2);
		    y+=dyy+4;
		}
		if(state.IsB){
		    g.setColor(Color.blue);
		    g.drawString(MaestroA.rounder(1.0e3*state.zposLarge2[i],3)+" [ mm ]    "
				 +MaestroA.rounder(state.zLambda2[i],5)+"   "+lambda,x,y);
		    
		    g.setColor(Color.red);
		    g.drawString(""+i,235,y);
		    y+=dyy;
		    g.setColor(Color.black);
		    g.drawString((Complex.Multiply(state.currentLarge2[i],1.0e6)).toString(Complex.CARTESIAN,6)+" [ \u00b5A ]",x,y);
		    g.setColor(Color.red);
		    g.drawLine(x,y+dyy/2-2,x+250,y+dyy/2-2);
		    y+=dyy+4;
		}
	    }
	   }
	   else if(state.currentMAX < 1.0e-6 && state.currentMAX >= 1.0e-9){
	    
	    for(int i=0;i<state.NsectionsLarge;i++){
		
		if(state.IsA){
		    g.setColor(Color.blue);
		    g.drawString(MaestroA.rounder(1.0e3*state.zposLarge[i],3)+" [ mm ]    "
				 +MaestroA.rounder(state.zLambda[i],5)+"   "+lambda,x,y);
		    		    
		    g.setColor(Color.red);
		    g.drawString(""+i,235,y);
		    y+=dyy;
		    g.setColor(Color.black);
		    g.drawString((Complex.Multiply(state.currentLarge[i],1.0e9)).toString(Complex.CARTESIAN,6)+" [ nA ]",x,y);
		    g.setColor(Color.red);
		    g.drawLine(x,y+dyy/2-2,x+250,y+dyy/2-2);
		    y+=dyy+4;
		}
		if(state.IsB){
		    g.setColor(Color.blue);
		    g.drawString(MaestroA.rounder(1.0e3*state.zposLarge2[i],3)+" [ mm ]    "
				 +MaestroA.rounder(state.zLambda2[i],5)+"   "+lambda,x,y);
		    		    
		    g.setColor(Color.red);
		    g.drawString(""+i,235,y);
		    y+=dyy;
		    g.setColor(Color.black);
		    g.drawString((Complex.Multiply(state.currentLarge2[i],1.0e9)).toString(Complex.CARTESIAN,6)+" [ nA ]",x,y);
		    g.setColor(Color.red);
		    g.drawLine(x,y+dyy/2-2,x+250,y+dyy/2-2);
		    y+=dyy+4;
		}
	    }
	   }
	   else if(state.currentMAX < 1.0e-9){
	    
	    for(int i=0;i<state.NsectionsLarge;i++){
		
		if(state.IsA){
		    g.setColor(Color.blue);
		    g.drawString(MaestroA.rounder(1.0e3*state.zposLarge[i],3)+" [ mm ]    "
				 +MaestroA.rounder(state.zLambda[i],5)+"   "+lambda,x,y);
		    
		    g.setColor(Color.red);
		    g.drawString(""+i,235,y);
		    y+=dyy;
		    g.setColor(Color.black);
		    g.drawString((Complex.Multiply(state.currentLarge[i],1.0e12)).toString(Complex.CARTESIAN,6)+" [ pA ]",x,y);
		    g.setColor(Color.red);
		    g.drawLine(x,y+dyy/2-2,x+250,y+dyy/2-2);
		    y+=dyy+4;
		}
		if(state.IsB){
		    g.setColor(Color.blue);
		    g.drawString(MaestroA.rounder(1.0e3*state.zposLarge2[i],3)+" [ mm ]    "
				 +MaestroA.rounder(state.zLambda2[i],5)+"   "+lambda,x,y);
		    
		    g.setColor(Color.red);
		    g.drawString(""+i,235,y);
		    y+=dyy;
		    g.setColor(Color.black);
		    g.drawString((Complex.Multiply(state.currentLarge2[i],1.0e12)).toString(Complex.CARTESIAN,6)+" [ pA ]",x,y);
		    g.setColor(Color.red);
		    g.drawLine(x,y+dyy/2-2,x+250,y+dyy/2-2);
		    y+=dyy+4;
		}
	    }
	   }
	     
	}
}

class NewOutputCanvasZ extends Canvas{
	private static final Font normalfont = new Font("SanSerif",Font.PLAIN,12);
	private static final Font subfont    = new Font("SanSerif",Font.PLAIN,10);
	private static final Font symbolfont=new Font("Serif",Font.PLAIN,14);
	NewGuide_State state;
	public NewOutputCanvasZ(NewGuide_State state){
	    super();
	    this.state = state;
	}
	
	public void paint(Graphics g){
            Graphics2D g2d = (Graphics2D)g;
            g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
            
	    int x, y, dx, dxx, dy, dyy;
	    double v_normalized;
	    double wavelength_factor = state.wavelength/state.DipoleLength_meters;
	    FontMetrics fm;
	    x = 10;
	    y = 12;
	    dx = 80;
	    dxx = 15;
	    g.setFont(normalfont);
	    fm = g.getFontMetrics();
	    dy = 12;
	    dyy = dy+2;
	    int intfac = 1;
	    
	    String lambda;
	    
	    g.setFont(symbolfont);
	    g.getFontMetrics();
	    lambda="\u03bb";
	    g.setFont(normalfont);
	    g.getFontMetrics();
	    
	    
	    g.setColor(Color.black);
	    
	    if(state.currentMAX >=1.0){
	    
	    for(int i=0;i<state.NsectionsLarge;i++){
		
		if(state.IsA){
		    g.setColor(Color.blue);
		    
		    g.drawString(MaestroA.rounder(1.0e3*state.zposLarge[i],3)+" [ mm ]    "
				 +MaestroA.rounder(state.zLambda[i],5)+"   "+lambda,x,y);
		        
		    g.setColor(Color.red);
		    g.drawString(""+i,235,y);
		    y+=dyy;
		    g.setColor(Color.black);
		    if(!state.microFlag12){
		    g.drawString(state.currentLarge[i].toString(Complex.POLAR_RADIAN,6)+" [ A ]",x,y);
		    }
		    if(state.microFlag12){
		    g.drawString(state.currentLarge[i].toString(Complex.POLAR_DEGREE,6)+" [ A ]",x,y);
		    }
		    g.setColor(Color.red);
		    g.drawLine(x,y+dyy/2-2,x+250,y+dyy/2-2);
		    y+=dyy+4;
		}
		if(state.IsB){
		    g.setColor(Color.blue);
		    
		    g.drawString(MaestroA.rounder(1.0e3*state.zposLarge2[i],3)+" [ mm ]    "
				 +MaestroA.rounder(state.zLambda2[i],5)+"   "+lambda,x,y);
		        
		    g.setColor(Color.red);
		    g.drawString(""+i,235,y);
		    y+=dyy;
		    g.setColor(Color.black);
		    if(!state.microFlag12){
		    g.drawString(state.currentLarge2[i].toString(Complex.POLAR_RADIAN,6)+" [ A ]",x,y);
		    }
		    if(state.microFlag12){
		    g.drawString(state.currentLarge2[i].toString(Complex.POLAR_DEGREE,6)+" [ A ]",x,y);
		    }
		    g.setColor(Color.red);
		    g.drawLine(x,y+dyy/2-2,x+250,y+dyy/2-2);
		    y+=dyy+4;
		}
	    }
	    
	    }
	  else if(state.currentMAX < 1.0 && state.currentMAX >= 1.0e-3){
	    
	    for(int i=0;i<state.NsectionsLarge;i++){
		
		if(state.IsA){
		    g.setColor(Color.blue);
		    
		    g.drawString(MaestroA.rounder(1.0e3*state.zposLarge[i],3)+" [ mm ]    "
				 +MaestroA.rounder(state.zLambda[i],5)+"   "+lambda,x,y);
		    
		    g.setColor(Color.red);
		    g.drawString(""+i,235,y);
		    y+=dyy;
		    g.setColor(Color.black);
		    
		    if(!state.microFlag12){
		    g.drawString((Complex.Multiply(state.currentLarge[i],1.0e3)).toString(Complex.POLAR_RADIAN,6)+" [ mA ]",x,y);
		    }
		    if(state.microFlag12){
		    g.drawString((Complex.Multiply(state.currentLarge[i],1.0e3)).toString(Complex.POLAR_DEGREE,6)+" [ mA ]",x,y);
		    }
		    
		    g.setColor(Color.red);
		    g.drawLine(x,y+dyy/2-2,x+250,y+dyy/2-2);
		    y+=dyy+4;
		}
		if(state.IsB){
		    g.setColor(Color.blue);
		    
		    g.drawString(MaestroA.rounder(1.0e3*state.zposLarge2[i],3)+" [ mm ]    "
				 +MaestroA.rounder(state.zLambda2[i],5)+"   "+lambda,x,y);
		    
		    g.setColor(Color.red);
		    g.drawString(""+i,235,y);
		    y+=dyy;
		    g.setColor(Color.black);
		    
		    if(!state.microFlag12){
		    g.drawString((Complex.Multiply(state.currentLarge2[i],1.0e3)).toString(Complex.POLAR_RADIAN,6)+" [ mA ]",x,y);
		    }
		    if(state.microFlag12){
		    g.drawString((Complex.Multiply(state.currentLarge2[i],1.0e3)).toString(Complex.POLAR_DEGREE,6)+" [ mA ]",x,y);
		    }
		    
		    g.setColor(Color.red);
		    g.drawLine(x,y+dyy/2-2,x+250,y+dyy/2-2);
		    y+=dyy+4;
		}
	    }
	   }
	   else if(state.currentMAX < 1.0e-3 && state.currentMAX >= 1.0e-6){
	    
	    for(int i=0;i<state.NsectionsLarge;i++){
		
		if(state.IsA){  
		    g.setColor(Color.blue);
		    
		    g.drawString(MaestroA.rounder(1.0e3*state.zposLarge[i],3)+" [ mm ]    "
				 +MaestroA.rounder(state.zLambda[i],5)+"   "+lambda,x,y);
		    	    
		    g.setColor(Color.red);
		    g.drawString(""+i,235,y);
		    y+=dyy;
		    g.setColor(Color.black);
		    
		    if(!state.microFlag12){
		    g.drawString((Complex.Multiply(state.currentLarge[i],1.0e6)).toString(Complex.POLAR_RADIAN,6)+" [ \u00b5A ]",x,y);
		    }
		    if(state.microFlag12){
		    g.drawString((Complex.Multiply(state.currentLarge[i],1.0e6)).toString(Complex.POLAR_DEGREE,6)+" [ \u00b5A ]",x,y);
		    }
		    
		    g.setColor(Color.red);
		    g.drawLine(x,y+dyy/2-2,x+250,y+dyy/2-2);
		    y+=dyy+4;
		}
		if(state.IsB){  
		    g.setColor(Color.blue);
		    
		    g.drawString(MaestroA.rounder(1.0e3*state.zposLarge2[i],3)+" [ mm ]    "
				 +MaestroA.rounder(state.zLambda2[i],5)+"   "+lambda,x,y);
		    	    
		    g.setColor(Color.red);
		    g.drawString(""+i,235,y);
		    y+=dyy;
		    g.setColor(Color.black);
		    
		    if(!state.microFlag12){
		    g.drawString((Complex.Multiply(state.currentLarge2[i],1.0e6)).toString(Complex.POLAR_RADIAN,6)+" [ \u00b5A ]",x,y);
		    }
		    if(state.microFlag12){
		    g.drawString((Complex.Multiply(state.currentLarge2[i],1.0e6)).toString(Complex.POLAR_DEGREE,6)+" [ \u00b5A ]",x,y);
		    }
		    
		    g.setColor(Color.red);
		    g.drawLine(x,y+dyy/2-2,x+250,y+dyy/2-2);
		    y+=dyy+4;
		}
		
	    }
	   }
	   else if(state.currentMAX < 1.0e-6 && state.currentMAX >= 1.0e-9){
	    
	    for(int i=0;i<state.NsectionsLarge;i++){
		
		if(state.IsA){    
		    g.setColor(Color.blue);
		    
		    g.drawString(MaestroA.rounder(1.0e3*state.zposLarge[i],3)+" [ mm ]    "
				 +MaestroA.rounder(state.zLambda[i],5)+"   "+lambda,x,y);
		    
		    g.setColor(Color.red);
		    g.drawString(""+i,235,y);
		    y+=dyy;
		    g.setColor(Color.black);
		    
		    if(!state.microFlag12){
		    g.drawString((Complex.Multiply(state.currentLarge[i],1.0e9)).toString(Complex.POLAR_RADIAN,6)+" [ nA ]",x,y);
		    }
		    if(state.microFlag12){
		    g.drawString((Complex.Multiply(state.currentLarge[i],1.0e9)).toString(Complex.POLAR_DEGREE,6)+" [ nA ]",x,y);
		    }
		    g.setColor(Color.red);
		    g.drawLine(x,y+dyy/2-2,x+250,y+dyy/2-2);
		    y+=dyy+4;
		}
		if(state.IsB){    
		    g.setColor(Color.blue);
		    
		    g.drawString(MaestroA.rounder(1.0e3*state.zposLarge2[i],3)+" [ mm ]    "
				 +MaestroA.rounder(state.zLambda2[i],5)+"   "+lambda,x,y);
		    
		    g.setColor(Color.red);
		    g.drawString(""+i,235,y);
		    y+=dyy;
		    g.setColor(Color.black);
		    
		    if(!state.microFlag12){
		    g.drawString((Complex.Multiply(state.currentLarge2[i],1.0e9)).toString(Complex.POLAR_RADIAN,6)+" [ nA ]",x,y);
		    }
		    if(state.microFlag12){
		    g.drawString((Complex.Multiply(state.currentLarge2[i],1.0e9)).toString(Complex.POLAR_DEGREE,6)+" [ nA ]",x,y);
		    }
		    g.setColor(Color.red);
		    g.drawLine(x,y+dyy/2-2,x+250,y+dyy/2-2);
		    y+=dyy+4;
		}
	    }
	   }
	   else if(state.currentMAX < 1.0e-9){
	    
	    for(int i=0;i<state.NsectionsLarge;i++){
		
		if(state.IsA){    
		    g.setColor(Color.blue);
		    
		    g.drawString(MaestroA.rounder(1.0e3*state.zposLarge[i],3)+" [ mm ]    "
				 +MaestroA.rounder(state.zLambda[i],5)+"   "+lambda,x,y);
		    
		    g.setColor(Color.red);
		    g.drawString(""+i,235,y);
		    y+=dyy;
		    g.setColor(Color.black);
		    
		    if(!state.microFlag12){
		    g.drawString((Complex.Multiply(state.currentLarge[i],1.0e12)).toString(Complex.POLAR_RADIAN,6)+" [ pA ]",x,y);
		    }
		    if(state.microFlag12){
		    g.drawString((Complex.Multiply(state.currentLarge[i],1.0e12)).toString(Complex.POLAR_DEGREE,6)+" [ pA ]",x,y);
		    }
		    g.setColor(Color.red);
		    g.drawLine(x,y+dyy/2-2,x+250,y+dyy/2-2);
		    y+=dyy+4;
		}
		if(state.IsB){    
		    g.setColor(Color.blue);
		    
		    g.drawString(MaestroA.rounder(1.0e3*state.zposLarge2[i],3)+" [ mm ]    "
				 +MaestroA.rounder(state.zLambda2[i],5)+"   "+lambda,x,y);
		    
		    g.setColor(Color.red);
		    g.drawString(""+i,235,y);
		    y+=dyy;
		    g.setColor(Color.black);
		    
		    if(!state.microFlag12){
		    g.drawString((Complex.Multiply(state.currentLarge2[i],1.0e12)).toString(Complex.POLAR_RADIAN,6)+" [ pA ]",x,y);
		    }
		    if(state.microFlag12){
		    g.drawString((Complex.Multiply(state.currentLarge2[i],1.0e12)).toString(Complex.POLAR_DEGREE,6)+" [ pA ]",x,y);
		    }
		    g.setColor(Color.red);
		    g.drawLine(x,y+dyy/2-2,x+250,y+dyy/2-2);
		    y+=dyy+4;
		}
	    }
	   }
	}
}
