import java.awt.*;

// Module 1 Exercises 2
public class Mod2Info extends Panel {
    //private static final Color bgcolor = new Color(236,236,236);
    private static final Color bgcolor = Color.white;

    TitlePanel titlePanel;
    Mod2State state;
    int endingX;

    private Font textfont= new Font("SanSerif",Font.PLAIN,14);

    public Mod2Info(Mod2State state) {
        super();
        this.state = state;
        setBackground(bgcolor);
        
        textfont = new Font("SanSerif",Font.PLAIN,state.font14);
        
        if(state.OS_Windows){
            textfont = new Font("SanSerif",Font.PLAIN,state.font14);
        }
        else{
            textfont = new Font("SanSerif",Font.PLAIN,state.font13);
        }
    }

    
    public void paint(Graphics g) {
        Graphics2D g2d = (Graphics2D)g;
        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                             RenderingHints.VALUE_ANTIALIAS_ON);     
        
        //NEW:
        //g.setFont(TheFonts.bold16);
        g.setFont(new Font("SanSerif",Font.BOLD,state.font16));
        g.setColor(Color.black);
        String s0 = "Instructions";
        int ex = STR.displayString(s0,g,state.s15,state.s20);

        //g.setFont(state.ttfFont.deriveFont(14f));
        g.setFont(textfont);
        g.setColor(Color.black);
        String s1 = "The traveling wave shown in "+STR.REDBOLD+"red"+
            STR.ENDREDBOLD+" is given by "+
            STR.REDBOLD+"y = 5 cos("+
            Character.toString((char)0x03c0)+"t - "+
            Character.toString((char)0x03c0)+"x)"+STR.ENDREDBOLD+" volts.";
        String s2 = "Thus, its frequency is 0.5 Hz, its wavelength is 2.0 cm, "+
            "and its reference";
        String s3 = "phase angle "+STR.PHIFONT+
            Character.toString((char)0x03d5)+STR.ENDPHIFONT+STR.SUB+"0"+
            STR.ENDSUB+" = 0,"+
            " with t = 0 defined as the time the animation is started.";

        String s4 = "For comparison, you can generate and display in "+
            STR.BLUEBOLD+"blue"+STR.ENDBLUEBOLD+" a waveform given by";
        String s5 = STR.BLUEBOLD+"y = 5 e"+STR.ENDBLUEBOLD+STR.SUP+"-"+
            Character.toString((char)0x03b1)+"x"+STR.ENDSUP+
            STR.BLUEBOLD+" cos( 2"+
            Character.toString((char)0x03c0)+" f t - 2"+
            Character.toString((char)0x03c0)+" x/"+
            Character.toString((char)0x03bb)+" ) Volts"+
            STR.ENDBLUEBOLD;
        
        //String s6 = "by specifying the following attributes:";
        String s6 = "by specifying its attributes in the Input Panel.";


        endingX = STR.displayString(s1,g,state.s25,state.s50);
        endingX = STR.displayString(s2,g,state.s25,state.s70);
        endingX = STR.displayString(s3,g,state.s25,state.s90);
        
        endingX = STR.displayString(s4,g,state.s25,state.s130);
        //g.setColor(Color.green.darker().darker());
        g.setColor(state.greenWaveColor);
        endingX = STR.displayString(s5,g,state.s145,state.s155);
        g.setColor(Color.black);
        //endingX = STR.displayString(s6,g,125,170);
        endingX = STR.displayString(s6,g,state.s25,state.s180);

    }
    
}
