Presentation is loading. Please wait.

Presentation is loading. Please wait.

ICE0534 – Web-based Software Development ICE1338 – Programming for WWW Lecture #5 Lecture #5 In-Young Ko iko.AT. icu.ac.kr iko.AT. icu.ac.kr Information.

Similar presentations


Presentation on theme: "ICE0534 – Web-based Software Development ICE1338 – Programming for WWW Lecture #5 Lecture #5 In-Young Ko iko.AT. icu.ac.kr iko.AT. icu.ac.kr Information."— Presentation transcript:

1 ICE0534 – Web-based Software Development ICE1338 – Programming for WWW Lecture #5 Lecture #5 In-Young Ko iko.AT. icu.ac.kr iko.AT. icu.ac.kr Information and Communications University (ICU) - Summer

2 Summer ICE 0534/ICE1338 – WWW © In-Young Ko, Information and Communications University Announcements No class on Tuesday July 12 th No class on Tuesday July 12 th Regular class on Thursday July 14 th Regular class on Thursday July 14 th The Ph.D. lecture proposal is due by Thursday, July 14 th The Ph.D. lecture proposal is due by Thursday, July 14 th Include the title and abstract of the lecture in your proposal Include the title and abstract of the lecture in your proposal List the reading materials List the reading materials

3 Summer ICE 0534/ICE1338 – WWW © In-Young Ko, Information and Communications University Last Lecture Dynamic Web Documents Dynamic Web Documents JavaScript JavaScript Technology Reviews Technology Reviews DHTML DHTML VBScript VBScript Technology Surveys Technology Surveys Languages for dynamic Web documents Languages for dynamic Web documents Web browsers and authoring tools Web browsers and authoring tools

4 Summer ICE 0534/ICE1338 – WWW © In-Young Ko, Information and Communications University This Lecture Plug-ins and Multimedia Presentations Plug-ins and Multimedia Presentations Java Applets & Java Plug-in Java Applets & Java Plug-in Communication between Applets and Web documents Communication between Applets and Web documents SVG (Scalable Vector Graphics) SVG (Scalable Vector Graphics) Technology Review Technology Review X3D [u4: Enkhbold] X3D [u4: Enkhbold] Technology Survey Technology Survey Plug-in Software [g4: Changsun Song] Plug-in Software [g4: Changsun Song]

5 Summer ICE 0534/ICE1338 – WWW © In-Young Ko, Information and Communications University What We Need More… More computing capability at the client side More computing capability at the client side Advanced graphical presentations Advanced graphical presentations More sophisticated and dynamic user interfaces More sophisticated and dynamic user interfaces Capabilities of playing multimedia clips Capabilities of playing multimedia clips

6 Summer ICE 0534/ICE1338 – WWW © In-Young Ko, Information and Communications University Plug-ins Code modules that are inserted into the browser Code modules that are inserted into the browser Adds new capabilities to the Web browser Adds new capabilities to the Web browser e.g., e.g.,

7 Summer ICE 0534/ICE1338 – WWW © In-Young Ko, Information and Communications University Java Applets Applets are relatively small Java programs whose execution is triggered by a browser Applets are relatively small Java programs whose execution is triggered by a browser The purpose of an applet is to provide processing capability and interactivity for HTML documents through widgets The purpose of an applet is to provide processing capability and interactivity for HTML documents through widgets The ‘standard’ operations of applets are provided by the parent class, JApplet The ‘standard’ operations of applets are provided by the parent class, JApplet public class class_name extends JApplet { … } Use of applets is still widespread, and there is heavy use in intranets Use of applets is still widespread, and there is heavy use in intranets Applets are an alternative to CGI and embedded client-side scripts Applets are an alternative to CGI and embedded client-side scripts AW lecture notes

8 Summer ICE 0534/ICE1338 – WWW © In-Young Ko, Information and Communications University Applets vs. JavaScript (CGI) CGI is faster than applets and JavaScript, but it is run on the server CGI is faster than applets and JavaScript, but it is run on the server JavaScript is easier to learn and use than Java, but less expressive JavaScript is easier to learn and use than Java, but less expressive Java is faster than JavaScript Java is faster than JavaScript Java graphics are powerful, but JavaScript has none Java graphics are powerful, but JavaScript has none JavaScript does not require the additional download from the server that is required for applets JavaScript does not require the additional download from the server that is required for applets Java may become more of a server-side tool, in the form of servlets, than a client-side tool Java may become more of a server-side tool, in the form of servlets, than a client-side tool AW lecture notes

9 Summer ICE 0534/ICE1338 – WWW © In-Young Ko, Information and Communications University Browser Actions for Running Applets 1.Download and instantiate the applet class 2.Call the applet’s init method 3.Call the applet’s start method – This starts the execution of the applet 4.When the user takes a link from the document that has the applet, the browser calls the applet’s stop method 5.When the browser is stopped by the user, the browser calls the applet’s destroy method AW lecture notes

10 Summer ICE 0534/ICE1338 – WWW © In-Young Ko, Information and Communications University An Example A Scrolling Banner public class AppletTest extends JApplet { private String msg; private String msg; private boolean needToStop = false; private boolean needToStop = false; public void init() { public void init() { msg = getParameter("message"); msg = getParameter("message"); setFont(new Font("Arial", Font.BOLD, 24)); setFont(new Font("Arial", Font.BOLD, 24)); } public void start() { public void start() { repaint(); repaint(); } public void paint(Graphics g) { public void paint(Graphics g) { g.setColor(Color.blue); g.setColor(Color.blue); int x = getWidth(), y = 20; int x = getWidth(), y = 20; while (!needToStop && x > 20) { while (!needToStop && x > 20) { try { Thread.sleep(10); } catch(Exception e) { } try { Thread.sleep(10); } catch(Exception e) { } g.clearRect(0, 0, getWidth(), getHeight()); g.clearRect(0, 0, getWidth(), getHeight()); g.drawString(msg, x--, y); g.drawString(msg, x--, y); } } public void stop() { public void stop() { needToStop = true; needToStop = true; }} HTML Document Applet Code