Extreme G22.3033-007

Session 5 - Main Theme Java Core Technologies (Part III)

Dr. Jean-Claude Franchitti

New York University Computer Science Department Courant Institute of Mathematical Sciences

1

Agenda

• Summary of Previous Session / Epilogue • Java Media APIs •Java 2D API • Java Media Framework • XBeans and Visual XBeans •JNI • Java Generative Programming Technology • Language Features •Threads • Readings

2

1 Summary of Previous Session

• Summary of Previous Session • Java AWT and Swing components • Drag and Drop • Graphics and Multimedia Components (JavaMedia) • JavaBeans • Readings • Class Project & Assignment #2b

3

Java Technologies/Features in Scope • Technologies: • Collections Framework • Input Method Framework • Swing • Drag and Drop • JavaBeans •JNI • Security • Language Features: • Threads

• Assertions 4

2 Part I

Session 4 Epilogue

5

Drag and Drop (http://java.sun.com/j2se/1.4/docs/guide/swing/1.4/dnd.html)

• See Session 4 Handout on Drag and Drop Data Transfer • Adding Drag and Drop to a JTree • In J2SE 1.4, JTree supports Drag but developers must implement and install a custom TransferHandler to fully support imports of data on Drop targets • http://www.javaworld.com/javaworld/javatips/jw-javatip97.html • http://www.javaworld.com/javaworld/javatips/jw-javatip114.html • http://sourceforge.net/projects/ijtree/

6

3 JavaBeans and JAF (http://java.sun.com/j2se/1.4/docs/guide/beans/changes14.html)

• See Session 4 Handout on Component Modeling with JavaBeans • Download the BeanBuilder • http://java.sun.com/products/javabeans/beanbuilder/index.html • Experiment with the online tutorial • http://java.sun.com/products/javabeans/beanbuilder/1.0/docs/guide/tut orial.html • Download JAF 1.0.2 • http://java.sun.com/products/javabeans/glasgow/jaf.html • Experiment with the JAF demo programs 7

Part II

Java Media APIs

8

4 Java Media APIs (http://java.sun.com/products/java-media/) • Java Media Framework (JMF) • Components for playing, recording, and conferencing time-based media • Java Sound • Java 2D • Java 3D • Java Animation • Java Advanced Imaging • Java Telephony • Java Speech • Java Collaboration • See Session 3 Handout on Java Platform Component APIs 9

Java 2D (http://java.sun.com/products/java-media/2D/index.html)

• Java 2D is included in the Java 2 SDK • See Session 4 Handout on Graphics and Multimedia Components - Java 2D • See 2D Graphics Tutorial • http://java.sun.com/docs/books/tutorial/2d/index.html

10

5 Java 2D Rendering Process

11

SVGGraphics2D High Level Design (http://wwws.sun.com/software/xml/developers/svg/java2d-api/)

12

6 Java Media Framework (http://java.sun.com/products/java-media/jmf/index.html)

• Unified architecture to synchronize and control audio, video, and other time-based data with Java applications and applets • Playing a movie in an Applet (TVApplet) • http://java.sun.com/products/java-media/jmf/2.1.1/samples/ • JMS Studio • Java JMStudio • Provides playback, capture, transmit, and transcode functionalities

13

XBeans and Visual XBeans (http://www.xbeans.org)

• XBean: • Software component (Java Bean) that takes XML as input, processes it, and passes XML onto the Xbean • Visual Xbeans are JavaBeans designed to display XML documents • Useful XBeans: • Viewer XBean displays XML document in JTree • http://www.fawcette.com/xmlmag/2002_03/magazine/columns/presentation/jodonahue/ default_pf.asp • http://www.fawcette.com/javapro/2002_03/magazine/features/jodonahue/default_pf.asp • Sender-receiver configured to transport XML over the

network using different transport mechanisms 14

7 Part III

Java Native Interface (JNI)

15

JNI

• See Session 5 Handout on Java Native Interface (JNI) • See Session 5 Demo Programs

16

8 Part IV

Java Generative Programming

17

JavaCC (http://www.webgain.com/products/java_cc/)

• JavaCC is the most popular parser generator for use with Java applications • Parser generator • Tool that reads a grammar specification and converts it to a Java program that can recognize matches to the grammar • JavaCC provides a tool called JJTree that can build a parse tree

18

9 Other Related Topics (http://www.webgain.com/products/java_cc/)

• Software Family Architectures • Program Generators Development Using XML and Java • See “Program Generators with XML and Java” in the References section of the course Web site

19

Part V

Language Features

20

10 Threads

• See Session 5 Handouts: • Programming Java Threads, Part 1 • Programming Java Threads, Part 2 • Thread Safety (Synchronization, Immutable Objects, and Thread-Safe Wrappers)

21

Part VI

Readings and Assignment

22

11 Assignment • Readings – Mastering Java 2: Part 2 – Chap. 10, 11 – Expert One-on-One: Chapter 2-4 as applicable (cont.) – Selected readings mentioned in class or referenced in the handouts – Handouts posted on the course web site • Assignment #2b: (submit report and implementation archive) – Design and implement a version of assignment #2a, and #2b that uses Visual XBean (see Xbeans documentation at http://www.xbeans.org/). Visual XBeans are JavaBeans designed to display XML documents. They use Swing components to display XML documents as JTrees, JTables, or other Swing components. – Extra credit: Use JNI to obtain your XML document from an underlying or C++ program. – Refer to the Homework #2 Specification posted on the course Web site. – Read Homework #3a specification • Project Framework Setup – J2EE IDE: IBM WSAD, WAS, DB2 – Java Plug-in, , Apache’s Xerces/Xalan – J2SE 1.3.1, 1.4.0 or 1.4.1 (SDK) – IDE: , NetBeans, Sun ONE Studio, JBuilder, Visual Age, Visual Café, Codewarrior, WebGain Studio, Oracle JDeveloper, etc. – Editors: JCreator, UltraEdit, etc.

23

12