Ex3 Preview, Swing tutorial Ex1 review Amit Shabtay.

Slides:



Advertisements
Similar presentations
Chapter 18 Building the user interface. This chapter discusses n Javas graphical user interface. n Swing: an enhancement of a library called the Abstract.
Advertisements

Introduction to Java 2 Programming Lecture 10 API Review; Where Next.
Introduction to Java 2 Programming
1 G54PRG Programming Lecture 1 Amadeo Ascó Adam Moore 22 GUI Programming I.
Chapter 1 Writing a Program Fall Class Overview Course Information –On the web page and Blackboard –
Tutorial 6 Creating a Web Form
INTERPRETER Main Topics What is an Interpreter. Why should we learn about them.
28/1/2001 Seminar in Databases in the Internet Environment Introduction to J ava S erver P ages technology by Naomi Chen.
Introduction to Java Programming, 4E
The Inside Story on the Java Debugger Douglas Pearson
Introduction to GUI Programming
The Composite Pattern.. Composite Pattern Intent –Compose objects into tree structures to represent part-whole hierarchies. –Composite lets clients treat.
1 Standard Widget Toolkit. 2 SWT l a widget toolkit for Java developers l provides a portable API and tight integration with the underlying native OS.
® IBM Software Group © 2006 IBM Corporation How to read/write XML using EGL This Learning Module shows how to utilize an EGL Library to read/write an XML.
Graphical User Interfaces in Haskell Koen Lindström Claessen.
Chapter 5 - Making Music: An On-Screen Piano
Introduction to Java Swing “We are the sultans of swing” – Mark Knopfler.
EE2E1. JAVA Programming Introduction Dr. Mike Spann
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
PHP TUTORIAL. HISTORY OF PHP  PHP as it's known today is actually the successor to a product named PHP/FI.  Created in 1994 by Rasmus Lerdorf, the very.
Agoracast: Design and Tools Review David Wallace Croft Senior Java Architect CroftSoft Inc Talk-Java/Drink-Java Las Colinas, Texas.
Capture and Replay Often used for regression test development –Tool used to capture interactions with the system under test. –Inputs must be captured;
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
Chapter 1: Introducing JAVA. 2 Introduction Why JAVA Applets and Server Side Programming Very rich GUI libraries Portability (machine independence) A.
Java Applets. 2 Introduction to Java Applet Programs  Applications are stand alone programs executed with Java interpreter executed with Java interpreter.
Program documentation using the Javadoc tool 1 Program documentation Using the Javadoc tool.
Jaeki Song ISQS6337 JAVA Lecture 03 Introduction to Java -The First Java Application-
Java Programming, Second Edition Chapter One Creating Your First Java Program.
Introduction to Java Programming with Forte Y. Daniel Liang.
CS 3131 Introduction to Programming in Java Rich Maclin Computer Science Department.
Jan Hatje, DESY CSS ITER March 2009: Technology and Interfaces XFEL The European X-Ray Laser Project X-Ray Free-Electron Laser 1 CSS – Control.
1 Rake. 2 Automated Build Any non-trivial project needs facility to automate builds –Routine common tasks that need to be carried out several times a.
Cs413_chapt01.ppt Chapter 1 Web Sites Numerous
Dale Roberts GUI Programming using Java - Introduction Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer.
Introduction to Java Programming. Introduction Course Objectives Organization of the Book.
Java Applets. 2 Introduction to Java Applet Programs Applications are ___________________ programs –executed with Java interpreter Applet is a small program.
JavaScript - A Web Script Language Fred Durao
MSc Workshop - © S. Kamin, U. ReddyLect 3 - GUI -1 Lecture 3 - Graphical User Interfaces r GUI toolkits in Java API r JFrame r GUI components.
Tutorial 6 Working with Web Forms. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore how Web forms interact with.
Documentation javadoc. Documentation not a programmer's first love lives in a separate file somewhere usually a deliverable on the schedule often not.
CSE S. Tanimoto Java Introduction 1 Java A Programming Language for Web-based Computing with Graphics.
An Introduction to Programming and Object Oriented Design using Java 3 rd Edition. Dec 2007 Jaime Niño Frederick Hosch Chapter 18 Integrating user interface.
Cs413_chapt02.ppt CS413 Advanced Swing Graphical User Interface Components Text: Advanced Java 2 Platform: Chapter 2 Abstract Windowing Toolkit (AWT) Library.
CSE S. Tanimoto Java Introduction 1 Java A Programming Language for Web-based Computing with Graphics.
Java GUI building approaches Aleksandar Kartelj Faculty of Mathematics, Belgrade 11 th Workshop “Software Engineering Education and.
Applets Yong Choi School of Business CSU, Bakersfield.
Creating Windows. How can we use Java to create programs that use windows (GUI applications)? How can we use Java to create programs that use windows.
JavaDoc and Contracts Spring Documenting Contracts with JavaDoc Contract model for methods Preconditions Postconditions JavaDoc Industry standard.
Intro to Applets. Applet Applets run within the Web browser environment Applets bring dynamic interaction and live animation to an otherwise static HTML.
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
WebObjects Matt Aguirre Lally Singh. What Is It? A Java based development platform specifically designed for database-backed web applications.
Tutorial 6 Working with Web Forms. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore how Web forms interact with.
Modern Programming Language. Web Container & Web Applications Web applications are server side applications The most essential requirement.
SourceAnatomy1 Java Source Anatomy Barb Ericson Georgia Institute of Technology July 2008.
Bayu Priyambadha, S.Kom. Static content  Web Server delivers contents of a file (html) 1. Browser sends request to Web Server 3. Web Server sends HTML.
Tutorial 6 Creating a Web Form
CSE S. Tanimoto Java Introduction 1 Java A Programming Language for Web-based Computing.
Applications Active Web Documents Active Web Documents.
CSC 222: Object-Oriented Programming
A Programming Language for Web-based Computing with Graphics
MSIS 655 Advanced Business Applications Programming
Building Graphical User Interface with Swing a short introduction
Java IO and Testing made simple
Java Applets.
A Programming Language for
JavaDoc and Contracts Fall 2008.
Advanced Programming in Java
Building a program (Java libraries) - an example
A Programming Language for
TA: Nouf Al-Harbi NoufNaief.net :::
Presentation transcript:

Ex3 Preview, Swing tutorial Ex1 review Amit Shabtay

March 3rd, 2004 Object Oriented Design Course 2 Next Exercise- ex3- xmli In Ex3 you will build XML interpreter. This interpreter will receive an xml file. Simple commands will be accepted by the interpreter and will form HTML output. For the ex you will use your xmlp code. You will create a simple GUI for the xmli.

March 3rd, 2004 Object Oriented Design Course 3 Ex3- GUI Enter Command: Send HTML 1HTML 2HTML 3HTML 4 Output Area

March 3rd, 2004 Object Oriented Design Course 4 Ex3- an XML input file Refactoring Martin Fowler UML Distilled Analysis Patterns

March 3rd, 2004 Object Oriented Design Course 5 Ex3- Commands edit [output-name] Selects the current view to be modified. The default is view 1. Example: edit 2 output: Now editing view 2 select [tag-name] Selects all tags [tag-name] and all their parents. Example: select BookName output: Selected 5 tags (BookName*2, OtherBooks, Author, Book) Acts only on the view we are currently editing!

March 3rd, 2004 Object Oriented Design Course 6 Ex3- Commands upcase [tag-name] Will change all tags with [tag-name] to upper case. Example: upcase BookName output: Modified views: view2 Acts on ALL the view we are editing! (views that were selected and have this tag) locase [tag-name] The same, but to lower case.

March 3rd, 2004 Object Oriented Design Course 7 Ex3- Commands Undo Undoes the last command. Can be called several times. Example: undo output: Modified views: view2 (This is in the case that the last command was upcase or locase) Exiting is by using the X of the window.

Swing Tutorial

March 3rd, 2004 Object Oriented Design Course 9 AWT- Abstract Window Toolkit In 1995, Java technology introduced to the World Wide Web developers a network-centric, object- oriented language that provided client side processing for otherwise static pages. Java platform's graphical user interface library, the Abstract Window Toolkit (AWT), is used in the creation of dynamic Web pages and is a multiplatform tool.

March 3rd, 2004 Object Oriented Design Course 10 JFC- Java Foundation Classes Java Foundation Classes extends the original AWT by adding a comprehensive set of graphical user interface class libraries that is completely portable and delivered as part of the Java platform JFC is composed of the AWT, Swing and Java2D.

March 3rd, 2004 Object Oriented Design Course 11 SWT- Standard Widget Toolkit AWT was buggy beyond belief this was just poor code that needed fixing by Sun’s coders. At IBM we hated Swing from day one. Big, buggy, and looks crap. (Simon Ritchie) SWT is a widget toolkit for Java designed to provide efficient, portable access to the user-interface facilities of the operating systems on which it is implemented.

March 3rd, 2004 Object Oriented Design Course 12 AWT vs. Swing AWT vs. Swing gives an overview on AWT and Swing and checks the pros and cons of each. AWT vs. Swing In general, Swing has a better design with massive use of design patterns, look and feel options, event handling.

March 3rd, 2004 Object Oriented Design Course 13 Swing vs. SWT Great debate. Pro Swing: (logemann) * Coding is easier to learn * Better API * Swing is a standardlogemann SWT uses native code for each platform, so it is faster and has better Look & Feel. (Eclipse is an Example for SWT instance)

Ex1 review

March 3rd, 2004 Object Oriented Design Course 15 Ex1 Goals Our goal in this ex was to: Practice in building a scalable design using “common language”- design patterns. (Structural and Traversal) Practice with UML, Ant Create a habit of testing the code.

March 3rd, 2004 Object Oriented Design Course 16 Ex1 Review- Design By Contract API and comments are most important. Design documentation is not only for the grader but also serves as a contract with the package user.

March 3rd, 2004 Object Oriented Design Course 17 Ex1 Review- Trivialities These are not acceptable: String s= “Try”; if (s == “Try”) System.out.println(“Wow”); Tag x= new Tag; visitor.visit((Tag)x);

March 3rd, 2004 Object Oriented Design Course 18 Ex1 Review- Good Separation Your exercises design in general was good: Reader Reader Implementation Data Structure Building Blocks Writer Writer Implementation

March 3rd, 2004 Object Oriented Design Course 19 Ex1 Review- DataBase or “Mediator” What about: VS.: Reader Data Structure Writer Reader Mediator on the fly Writer

March 3rd, 2004 Object Oriented Design Course 20 Ex1 Review-Nearly Empty Class class Attribute { String key; String value; }

March 3rd, 2004 Object Oriented Design Course 21 Ex1 Review- Data Structure Most used Element, CompositeElement and deriving Tag, Comment, …. Interesting case: Element Composite Element Tag Comment Text IElement int depth

March 3rd, 2004 Object Oriented Design Course 22 Ex1 Review- Interfaces use IElement Element CommentTextAttribute ICommentITextIAttr

March 3rd, 2004 Object Oriented Design Course 23 Ex1 Review-Interfaces methods abstract class Element{ public Iterator getSons(){ return null; } public void addSon(Element e){ return; } //This visitor method is wrong, because it should be an //empty implementation abstract public void visit(Element e); This can be avoided using a visitor, though the comosite design pattern specifies this design.

March 3rd, 2004 Object Oriented Design Course 24 Ex1 Review-Traversal Three examples: While (iterator.hasNext()){ Element x= iterator.next(); x.accept(visitor); //For each element, use i.next() } X.accept(visitor) //Traverse using only the visitor Traverse elements using visitor, but children of an element using an iterator

March 3rd, 2004 Object Oriented Design Course 25 Ex1 Review-Filtering Now it is your turn: Possible ways for filtering (comments and attributes)