TO USE OR PRINT this presentation click : http://videosliders.com/r/1032 ============================================================== Computer Graphics and AnimationSabin Tabirca Email: [email protected]: (490) 3662 Office: Brighton Villas, Multimedia Building, Second Floor Contact Hours: Monday 11-13. Aim of the Course: To introduce someComputer Graphicsconcepts using Java. Objectives of the Course: - To give some minimal Java skills for Multimedia Programming. - To introduce some Computer Graphics elements. Computer Graphics - Course 1. ,Structure of the Course Introduction to Java Programming - Java basics: data types, statements, methods, classes, … - The Java classes for Graphics: Graphics, Graphics2D, … - Elements of GUI design: awt / swing … Computer Graphics - Turtle Graphics and fractals - 2D Graphics: Transformations, 2D curves, … Animation and Games in Java Multimedia for Mobile devices Computer Graphics - Course 1. ,References Java: Dietel &amp; Dietel, Advanced / Java: How to Program, Prentince Hall, 2001. Steve Holzner, The Java Black Book, Coriolis Press, 2000. Chuck Cavaness et. al, Using Java 2 Standard Edition,QUE Press, 2001 Graphics: V.D. Foley, Introduction to Computer Graphics, Addison-Wesley Publ. Peter Cooley, The essence of Computer Graphics, Prentice Hall Java + Graphics: J. Knudsen, Java 2D Graphics, O’Reilly Publ, 2000. Computer Graphics - Course 1. ,Introduction to Java What is Java? It is more than a programming language. History: James Gosling 1990 - Green Project, Oak language 1993 - HotJava browser Sun Microsystems: 1995 - Java 1.0, 1997 - Java 1.1, 1998 – Java 1.2, 2002? Advantages [according to Sun Microsystems]: simple, object-oriented, WEB oriented, compiled, architecture neutral, multi-threaded, garbage collected, robust, secure, and extensible. Computer Graphics - Course 1. ,JDK – Java Developers Kit JDK is a collection of libraries and tools. The Main Libraries: java.awt – graphic interfaces [java.awt.Graphics; java.awt.image, …] java.applet – applet java.io – input/output java.math – mathematics java.net – networkjava.sql – databases … Rule: Import the packages you need. import java.awt.*; import java.applet.Applet; The main tools: javac – compilerjava – interpreter jre – runtime interpreter jdb – debuggerjavadoc – help generating appletviewer – execute an applet Computer Graphics - Course 1. ,The First Java Application Steps: Editing &gt;&gt; Compiling &gt;&gt; (Correcting Errors) &gt;&gt; Executing Step 1. Edit the java program FirstApplication (Notepad, Wordpad, Simple Text, …) Step 2. Compile the file FirstApplication.java (javac FirstApplication.java) Step 3. Execute the program (java FirstApplication.java) public class L1App1{ public static void main( String args[] ){System.out.println(“This is our first Java Application”) <p>} } Rule: The file name (L1App1.java) and the class name (L1App1) must be identical. Computer Graphics - Course 1. ,Computer Graphics - Course 1. ,The First Java Applet Steps: Editing &gt;&gt; Compiling &gt;&gt; (Correcting Errors) Editing the html file &gt;&gt; Executing the applet via a browser(Internet Explorer …) Step 1. Edit the java applet FirstApplet.java (Notepad, Wordpad, Simple Text, …) Step 2. Compile the file FirstApplet.java (javac FirstApplet.java) Step 3. Edit the HTML file FirstApplet.html Step 4. Run the applet either via a browser of appletviewer Important: The Java file name (L1Appl1.java) and the class name (L1Appl1) must be identical. Golden Rule: Keep the same name for the HTML file. Computer Graphics - Course 1. ,Computer Graphics - Course 1. ,The file L1Appl1.java import java.applet.Applet; import java.awt.Graphics; public class L1Appl1 extends Applet{ public void paint( Graphics g){ g.drawString(“This is our first Java applet”, 30, 30); } } The file L1Appl1.html &lt;HTLM&gt; &lt;BODY&gt; &lt;APPLET CODE=L1Appl1.class, WIDTH=200, HEIGHT=200&gt; &lt;/APPLET&gt; &lt;/BODY&am