//Auxiliary4.java
//author Umberto Ravaioli, 2005

import java.awt.*;
import java.awt.event.*;

//import Trans_State;
public class Auxiliary4 extends Canvas implements MouseListener{
	
	private Trans_State state;
	private Image im;
	private Graphics buf;
	private static final Font labfont = TheFonts.bold10;
	private static final Color bgcolor = Color.white;
	private static final Color bgcolor2 = new Color(236,236,236);
	private static final Color ccolor1 = new Color(50,204,153);
	private static final double epsilon0 = 8.8541878176E-12; // Units: F/m
	private static final double mu0 = 1.25663706144E-6; //      Units H/m
	private static final double light_velocity = Math.sqrt(1.0/(epsilon0*mu0)); //  Units m/s
	
	private static final Font normalfont = TheFonts.serif14;
	private static final Font normalfont2 = TheFonts.sanSerif12;
	
        private static final Font subfont    = TheFonts.sanSerif10;
	private static final Font symbolfont=TheFonts.symbol14;
	private static String alpha, Ohm, lambda, infinity, Gamma, epsilon;
	
	private boolean IsFocusOn, IsTopoOn, IsDark;
	public Auxiliary4(Trans_State state){
		super();
		this.state = state;
		setBackground(bgcolor);
		this.addMouseListener(this);
		IsFocusOn = false;
		IsDark = true;
	}

	public void update(Graphics g){
		paint(g);
	}

	public void paint(Graphics g){
		
		
			drawReferenceAxis(g);
		
	}
	
	private void drawReferenceAxis(Graphics g){ 
		int xd, yd, dx, dy;
		g.clearRect(0,0,getSize().width,getSize().height);
		
		g.setColor(Color.black);
		FontMetrics fm = g.getFontMetrics();
		
		//g.setFont(symbolfont);
		alpha="\u03b1";
		lambda="\u03bb";
		Ohm="\u03a9";
		infinity="\u221e";
		Gamma="\uu0393"; 
		epsilon="\u03b5";
		
	    g.drawLine(10,5,getSize().width - 10,5);
            g.drawLine(34,2,34,8);
            g.drawLine(getSize().width - 19,2,getSize().width - 19,8);
            MaestroG.drawArrow(15,5,8,g);
            
            g.setFont(normalfont2);
            g.drawString("d",10,20);
            
            g.setFont(normalfont);
            g.drawString("0",getSize().width - 22,22);
            g.drawString("\u03bb",32,22);
        }
	
	public void mouseClicked(MouseEvent evt){
	    if(IsFocusOn){
		IsFocusOn = false;
		repaint();
	    }
	
	    else{
		IsFocusOn = true;
		repaint();
	    }
    
	}
	
	public void setDark(boolean IsDark){
	    this.IsDark = IsDark;
	}
    
	public void mouseEntered(MouseEvent evt){
	    IsTopoOn = true;
	    repaint();
	}
	public void mouseExited(MouseEvent evt){
	    IsTopoOn = false;
	    repaint();
	}
	public void mousePressed(MouseEvent evt){}
	public void mouseReleased(MouseEvent evt){}
    
}//End of CircuitCanvs

