Original GUIs. IntroGUI 1

Similar documents
Is image everything?

MIT AITI Swing Event Model Lecture 17

Graphical User Interfaces (GUIs)

The JFrame Class Frame Windows GRAPHICAL USER INTERFACES. Five steps to displaying a frame: 1) Construct an object of the JFrame class

Object-Oriented Programming: Revision. Revision / Graphics / Subversion. Ewan Klein. Inf1 :: 2008/09

Introduction to the JAVA UI classes Advanced HCI IAT351

Sketchpad. Plan for Today. Class 22: Graphical User Interfaces IBM 705 (1954) Computer as Clerk : Augmenting Human Intellect

Swing from A to Z Some Simple Components. Preface

(Incomplete) History of GUIs

Introduction. Introduction

Class 16: The Swing Event Model

Window Interfaces Using Swing Objects

Frames, GUI and events. Introduction to Swing Structure of Frame based applications Graphical User Interface (GUI) Events and event handling

Lab 4. D0010E Object-Oriented Programming and Design. Today s lecture. GUI programming in

CSEN401 Computer Programming Lab. Topics: Graphical User Interface Window Interfaces using Swing

SINGLE EVENT HANDLING

Calculator Class. /** * Create a new calculator and show it. */ public Calculator() { engine = new CalcEngine(); gui = new UserInterface(engine); }

Programming Language Concepts: Lecture 8

Window Interfaces Using Swing Objects

Graphic User Interfaces. - GUI concepts - Swing - AWT

PROGRAMMING DESIGN USING JAVA (ITT 303) Unit 7

Graphical User Interface (Part-1) Supplementary Material for CPSC 233

CS415 Human Computer Interaction

COMPSCI 230. Software Design and Construction. Swing

Graphical User Interface (GUI)

CSC 1214: Object-Oriented Programming

CS 11 java track: lecture 3

Widgets. Widgets Widget Toolkits. 2.3 Widgets 1

CS 251 Intermediate Programming GUIs: Components and Layout

Introduction to Graphical Interface Programming in Java. Introduction to AWT and Swing

Control Flow: Overview CSE3461. An Example of Sequential Control. Control Flow: Revisited. Control Flow Paradigms: Reacting to the User

Building a GUI in Java with Swing. CITS1001 extension notes Rachel Cardell-Oliver

Part I: Learn Common Graphics Components

Packages: Putting Classes Together

Graphical User Interfaces. Comp 152

Queens College, CUNY Department of Computer Science. CS 212 Object-Oriented Programming in Java Practice Exam 2. CS 212 Exam 2 Study Guide

Part 3: Graphical User Interface (GUI) & Java Applets

CS211 GUI Dynamics. Announcements. Motivation/Overview. Example Revisted

Design Patterns. it s about the Observer pattern, the Command pattern, MVC, and some GUI. some more

G51PGP Programming Paradigms. Lecture 008 Inner classes, anonymous classes, Swing worker thread

H212 Introduction to Software Systems Honors

Java Swing. based on slides by: Walter Milner. Java Swing Walter Milner 2005: Slide 1

GUI Forms and Events, Part II

Programming Languages and Techniques (CIS120e)

Java: Graphical User Interfaces (GUI)

China Jiliang University Java. Programming in Java. Java Swing Programming. Java Web Applications, Helmut Dispert

Swing - JButton. Adding buttons to the main window

RAIK 183H Examination 2 Solution. November 10, 2014

Introduction to GUIs. Principles of Software Construction: Objects, Design, and Concurrency. Jonathan Aldrich and Charlie Garrod Fall 2014

Widgets. Widgets Widget Toolkits. User Interface Widget

ASSIGNMENT NO 14. Objectives: To learn and demonstrated use of applet and swing components

AP CS Unit 11: Graphics and Events

Example Programs. COSC 3461 User Interfaces. GUI Program Organization. Outline. DemoHelloWorld.java DemoHelloWorld2.java DemoSwing.

Introduction to Graphical User Interfaces (GUIs) Lecture 10 CS2110 Fall 2008

ANSWER KEY Exam 2 Computer Programming 230 Dr. St. John Lehman College City University of New York Thursday, 5 November 2009

GUI Program Organization. Sequential vs. Event-driven Programming. Sequential Programming. Outline

RAIK 183H Examination 2 Solution. November 11, 2013

Chapter 13 Lab Advanced GUI Applications Lab Objectives. Introduction. Task #1 Creating a Menu with Submenus

CPS122 Lecture: Graphical User Interfaces and Event-Driven Programming

University of Cape Town Department of Computer Science. Computer Science CSC117F Solutions

Graphical User Interface (GUI)

Handout 14 Graphical User Interface (GUI) with Swing, Event Handling

What Is an Event? Some event handler. ActionEvent. actionperformed(actionevent e) { }

Widgets. Overview. Widget. Widgets Widget toolkits Lightweight vs. heavyweight widgets Swing Widget Demo

University of Cape Town Department of Computer Science Computer Science CSC1017F

Java Graphical User Interfaces AWT (Abstract Window Toolkit) & Swing

Agenda. Container and Component

GUI Software Architecture

Hanley s Survival Guide for Visual Applications with NetBeans 2.0 Last Updated: 5/20/2015 TABLE OF CONTENTS

Topic 9: Swing. Swing is a BIG library Goal: cover basics give you concepts & tools for learning more

Topic 9: Swing. Why are we studying Swing? GUIs Up to now: line-by-line programs: computer displays text user types text. Outline. 1. Useful & fun!

MVC: Model View Controller

Graphical User Interfaces

We are on the GUI fast track path

DCS235 Software Engineering Exercise Sheet 2: Introducing GUI Programming

Lecture 5: Java Graphics

Heavyweight with platform-specific widgets. AWT applications were limited to commonfunctionality that existed on all platforms.

Model-View Controller IAT351

Command-Line Applications. GUI Libraries GUI-related classes are defined primarily in the java.awt and the javax.swing packages.

) / Java ( )

Graphics. Lecture 18 COP 3252 Summer June 6, 2017

Graphical Applications

17 GUI API: Container 18 Hello world with a GUI 19 GUI API: JLabel 20 GUI API: Container: add() 21 Hello world with a GUI 22 GUI API: JFrame: setdefau

Chapter 13. Applets and HTML. HTML Applets. Chapter 13 Java: an Introduction to Computer Science & Programming - Walter Savitch 1

Programming Languages and Techniques (CIS120)

COMP-202 Unit 10: Basics of GUI Programming (Non examinable) (Caveat: Dan is not an expert in GUI programming, so don't take this for gospel :) )

Systems Programming. Bachelor in Telecommunication Technology Engineering Bachelor in Communication System Engineering Carlos III University of Madrid

SE1021 Exam 2. When returning your exam, place your note-sheet on top. Page 1: This cover. Page 2 (Multiple choice): 10pts

Design of Graphical User Interfaces

SD Module-1 Advanced JAVA

GUI Implementation Support

Developing Applications for ios

Starting Out with Java: From Control Structures Through Objects Sixth Edition

SD Module-1 Advanced JAVA. Assignment No. 4

Queen s University Faculty of Arts and Science School of Computing CISC 124 Final Examination December 2004 Instructor: M. Lamb

Graphical user interface software

Lecture 9. Lecture

CS 4300 Computer Graphics

7. Program Frameworks

CSE 331 Software Design & Implementation

Transcription:

Original GUIs IntroGUI 1

current GUIs IntroGUI 2

Why GUIs? IntroGUI 3 Computer Graphics technology enabled GUIs and computer gaming. GUI's were 1985 breakout computer technology. Without a GUI there would be not be any, or much less: Computer based industry USA's major productivity advantage Computer systems in the homes and schools Internet, Web, E-commerce before Mosaic telnet, ftp, gopher, WAIS after Mosaic AOL, Amazon.com, Facebook, Link-in smart phones, tablets How much software would you use / buy that does not have a GUI interface? How many computer games without graphics would you play? Where would Microsoft be without Windows? Apple w/o Macintosh?

Course Objectives IntroGUI 4 Experience with 2+ GUI APIs Java Swing && Microsoft Windows Presentation Foundation (WPF) On-event software architecture event listeners / handlers Comparison and evaluation of relatively large class libraries (GUI) Experience with Interface Builders designer s that draw your interface scripting languages that build your interface XAML Discussion, evaluation, of effective GUI design concepts / tradeoffs

Z order IntroGUI 5 JMenu JLabel JDialog JFrame JButton events

Selected dates in GUI history IntroGUI 6 1963 SketchPad interactive computer graphics system 1968 NLS, augment 2D GUI, mouse, hypertext, windows, editing 1977 Apple II color graphics personal computer 1981 Xerox Star OOP, bit mapped GUI, ethernet, smalltalk 1984 Macintosh personal GUI 1984 X Windows unix / C, networked GUI, vendor independent. 1985 MS Windows intel GUI, tiled windows... metro UI 1989 Next OOP GUI interface builder 1992 3D GUIs Xerox Parc: data wall, cone tree... 1993 Newton handheld GUI (tablet) 1994 Mosaic Graphical Web browser (now Firefox) 1995 Java AWT System independent local web GUIs... swing 1996 Nokia commnicator smart phone 2003.NET Language independent GUI... WPF 2010 Apple ipad Gesture i/o, mobile computing now wearables ubiquitious,location based computing (Augmented Reality), smart bikes soon??? human embedded computing, icyborg

Human Computer Interaction developer s model IntroGUI 7 user s model GUI application requests events Application makes display requests to system System display is an event to the user User responds to display with input requests ( mouse, keyboard...) System routes user input to application as events Application handles events and may make display requests...

MVC architecture IntroGUI 8 SmallTalk s window concept had 3 object components Model: View: Controller: object to be viewed or modified object that determines how the model is to be displayed draw to display requests object that handles user interaction with "window handle events View Model Controller

Controller 2 IntroGUI 9 Consider a binary tree visual simulation: 1 model internal binary tree algorithms 2 views graphic indented text 10 20 30 50 60 50 20 10 30 60 3 controllers keyboard voice input $ add 30 $ delete 15 $ add 30 delete 15

Model View architecture IntroGUI 10 MVC variants used in modern GUIs Java UI-delegate combines MVC view-controller aspects UI objects know how to : draw themselves, handle events, determine their size... Java UI classes can have associated model objects MS.NET uses "controls", "views", and models. Views can be complex controls. I will use model and view as references to the model and the viewcontroller concepts.

HelloSwing example IntroGUI 11 create and show window wait for user interaction Click application button redisplay window Application s lifetime Click system menu close button close and destroy window

Trace of HelloSwing IntroGUI 12 HelloSwing :: enter main() HelloSwing :: enter HelloSwing() HelloSwing :: leave HelloSwing() HelloSwing :: leave main() HelloSwing :: actionperformed() HelloSwing :: actionperformed() /** * HelloSwing Java example program for CS 585. * Frame window with a button. * Click button and label changes. * Trace statements are added to illustrate order of method calls. * * Mike Barnes 8/18/2014 */ // need to import awt components and events and swing components. import java.awt.*; import java.awt.event.*; import javax.swing.*;

IntroGUI 13 Look at HelloSwing.html generated with javadoc: inheritance, documentation. /** * HelloSwing is an application - subclass Frame for window */ public class HelloSwing extends JFrame { private JButton abutton; private boolean toggle = true; //All applications must have a main method. public static void main(string args[]) { System.out.println("HelloSwing :: enter main()"); HelloSwing app = new HelloSwing("Hello Java"); app.setsize(300,100); app.setvisible(true); // need to be able to close the window. app.setdefaultcloseoperation(jframe.exit_on_close); System.out.println("HelloSwing :: leave main()"); }

// the constructor of the frame window IntroGUI 14 public HelloSwing(String frametitle) { super(frametitle); System.out.println("HelloSwing :: enter HelloSwing()"); Container contentpane = getcontentpane(); abutton = new JButton("Hello CS 585!"); // listen for JButton events abutton.addactionlistener(new JButtonListener()); contentpane.add(abutton, "Center"); System.out.println("HelloSwing :: leave HelloSwing()"); } // the "callback function" to handle button press events class JButtonListener implements ActionListener { public void actionperformed(actionevent event) { System.out.println("HelloSwing :: actionperformed()"); if (toggle) abutton.settext("press me again"); else abutton.settext("hello CS 585!"); toggle =!toggle; } } } }