/*
 *	
 *  Filename: CameraClipArt.java
 *  Java Applet Demo
 *  Author: Achim E Karger
 *  Course: CSCI 111 Java I
 *  Assignment: Lab 3
 *  Date:   February 9, 2008
 *  compiler JCreator LE
 *  Client web application: lab3.html
 *  
 *  this Applet displays a "Camera" graphic on the screen 
 *
 *
 *
 */
 
import java.awt.*;
import java.applet.*;

/**
 * The CameraClipArt class displays a Camera graphic on the computer screen.
 *
 * @author  Achim E Karger
 * @version 1.0 02/09/08
 * @see     java.lang.System
 */
public class CameraClipArt extends Applet {
   //-----------------------------------------------------------------
   //  Draws a camera icon.
   //-----------------------------------------------------------------
   
	
	public void init() {
	}
    /**
     * Execution of the program involves use of the override paint method.
     *
     * @param  g The Graphics object is used to draw basic shapes (low-level GUI-functions)
     */
	public void paint(Graphics g) {

      final int MID = 250;    // MID,TOP = center lens
      final int TOP = 135;    // MID=100, TOP=85 => icon left upper corner at 0,0
	  int[] xHeadPlate = {MID-50, MID-35, MID+35, MID+50};
      int[] yHeadPlate = {TOP-65, TOP-85, TOP-85, TOP-65};

      setBackground (Color.cyan);

      g.setColor (Color.blue);
      g.fillRect (MID-100, TOP-65, 200, 130);  // camera body

      g.setColor (Color.gray);
      g.fillOval (MID-55, TOP-55, 110, 110);            // objectiv
      g.setColor (Color.white);
      g.fillOval (MID-40, TOP-40, 80, 80);            // lens
	  g.setColor (Color.blue);
      g.fillRect (MID-85, TOP-80, 20, 15);            // button
      
      g.setColor (Color.gray);
      g.fillPolygon (xHeadPlate, yHeadPlate, xHeadPlate.length);


      g.setColor (Color.black);
		g.drawString("Camera Icon", MID-35, TOP+85 );


		
	}
}

