Graphical User Interface (GUI) Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.

Slides:



Advertisements
Similar presentations
What Was I Thinking??. Key Terms 1. Control 1. Control 2. Design Mode 2. Design Mode 3. Event 3. Event 4. Form 4. Form 5. Interface 5. Interface 6. Properties.
Advertisements

OOP Design Patterns Chapters Design Patterns The main idea behind design patterns is to extract the high level interactions between objects and.
Events and the AWT The objectives of this chapter are: To understand the principles of the Java 1.1 event model To understand how the event model is used.
Event Handling. In this class we will cover: Basics of event handling The AWT event hierarchy Semantic and low-level events in the AWT.
6/13/20151 CS 160: Lecture 13 Professor John Canny Fall 2004.
1 Model View Controller. 2 Outline Review Definitions of MVC Why do we need it? Administiriva Changing the display Event flow Dragging at interactive.
Chapter 11 Exception Handling and Event Handling.
Graphical User Interface (GUI) Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
Overview of Swing’s MVC Architecture By Geoffrey Steffens (BCSi), Socket Software, Australia Copyright © Socket Software, 2002.
Model-View-Controller. Design Patterns The hard problem in O-O programming is deciding what objects to have, and what their responsibilities are Design.
0 CS 160: Design Process: Implement Event-based UI Programming, Model-View-Controller, and the Web Jeffrey Nichols IBM Almaden Research Center
1 GUI Elements in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
MVC Fall 2005 OOPD John Anthony. Design Patterns The hard problem in O-O programming is deciding what objects to have, and what their responsibilities.
Object-Oriented Analysis and Design
Application Architectures Vijayan Sugumaran Department of DIS Oakland University.
14-Jul-15 Model-View-Controller. 2 Design Patterns The hard problem in O-O programming is deciding what objects to have, and what their responsibilities.
Graphical User Interface (GUI) Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Stanford hci group / cs376 research topics in human-computer interaction UI Software Tools Scott Klemmer 27 October 2005.
Introduction to Java Swing “We are the sultans of swing” – Mark Knopfler.
MVC pattern and implementation in java
ACM/JETT Workshop - August 4-5, ExceptionHandling and User Interfaces (Event Delegation, Inner classes) using Swing.
CS 0004 –Lecture 1 Wednesday, Jan 5 th, 2011 Roxana Gheorghiu.
Model View Controller (MVC) Rick Mercer with a wide variety of others 1.
Welcome to CIS 083 ! Events CIS 068.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
11.10 Human Computer Interface www. ICT-Teacher.com.
Model-View-Controller Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University.
Java Software Solutions Lewis and Loftus Chapter 10 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Graphical User Interfaces --
MVC CompSci 230 S Software Construction. MVC Architecture  A typical application includes software to  maintain application data,  document text.
Putting together a complete system Chapter 10. Overview  Design a modest but complete system  A collection of objects work together to solve a problem.
(c) University of Washington08-1 CSC 143 Models and Views Reading: Ch. 18.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Event Driven Programming, The.
Chapter 6 – Architectural Design CSE-411, Dr. Shamim H Ripon.
User Interface Structure Design Chapter 11. Key Definitions The user interface defines how the system will interact with external entities The system.
COMP 6471 Software Design Methodologies Winter 2006 Dr Greg Butler
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 14 Event-Driven Programming.
Dale Roberts GUI Programming using Java - Event Handling Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer.
3461 Model-View Controller Advanced GUI concepts.
Model View Controller (MVC) Bigger than a Pattern: It’s an Architecture Rick Mercer with help from many others 1.
COMP 321 Week 2. Outline Event-Driven Programming Events, Event Sources, Event Listeners Button and Timer Events Mouse Events, Adapters.
Computer Science [3] Java Programming II - Laboratory Course Lab 4: Common GUI Event Types and Listener Interfaces Layout Mangers Faculty of Engineering.
Input Design Lecture 11 1 BTEC HNC Systems Support Castle College 2007/8.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Object Oriented Programming.  Interface  Event Handling.
CSE 331 Software Design & Implementation Hal Perkins Autumn 2012 Event-Driven Programming 1.
Agenda Introduction. Event Model. Creating GUI Application. Event Examples.
Model View Controller (MVC) Bigger than a Pattern: It’s an Architecture Rick Mercer with help from many of others 1.
Java Model-View-Controller. Design Patterns The hard problem in O-O programming is deciding what objects to have, and what their responsibilities are.
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4: Events Programming with Alice and Java First Edition by John Lewis.
Model-View-Controller Architecture. 2 Give someone a program, you frustrate them for a day; teach them how to program, you frustrate them for a lifetime.
Model View Controller (MVC) an architecture Rick Mercer with help from many of others 1.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 14 Event-Driven Programming with Graphical User Interfaces.
Java - hello world example public class HelloWorld { public static void main (String args[]) { System.out.println("Hello World"); }
1 Lecture 8: User Interface Components with Swing.
12-Jun-16 Event loops. 2 Programming in prehistoric times Earliest programs were all “batch” processing There was no interaction with the user Input Output.
Presented by Alexey Vedishchev Developing Web-applications with Grails framework American University of Nigeria, 2016 Intro To MVC Architecture.
Programming Paradigms, Software Architectural Patterns, and MVC CS 378 – Mobile Computing for iOS Dr. William C. Bulko.
Understand Windows Forms Applications and Console-based Applications
Model-View-Controller Design Pattern
CS102 – Bilkent University
Model-View-Controller Patterns and Frameworks
Event loops.
Model-View-Controller
GRAPHICAL USER INTERFACE
Event loops 17-Jan-19.
Model, View, Controller design pattern
Event loops.
Presentation transcript:

Graphical User Interface (GUI) Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park

Graphical User Interface (GUI) User interface Interface between user and computer Both input and output Affects usability of computer Interface improving with better hardware Switches & light bulbs Punch cards & teletype (typewriter) Keyboard & black/white monitor (text) Mouse & color monitor (graphics)

Graphical User Interface (GUI) Goal Present information to users clearly & concisely Make interface easy to use for users Make software easy to implement / maintain for programmers

Graphical User Interface (GUI) Design issues Ease of use Ease of understanding Ability to convey information Maintainability Efficiency

GUI Topics Event-driven programming Model-View-Controller (MVC) Pattern GUI elements Java GUI classes

Event-driven Programming Normal (control flow-based) programming Approach Start at main() Continue until end of program or exit() Event-driven programming Unable to predict time & occurrence of event Approach Start with main() Build GUI Await events (& perform associated computation)

Event-driven Programming in Java During implementation Implement event listeners for each event Usually one event listener class per widget At run time Register listener object with widget object Java generates event object when events occur Java then passes event object to event listener Example of observer design pattern

Event-driven Programming in Java Example listeners & actions causing event ActionEvent  clicking button in GUI CaretEvent  selecting portion of text in GUI FocusEvent  component gains / loses focus KeyEvent  pressing key ItemEvent  selecting item from pull-down menu MouseEvent  dragging mouse over widget TextEvent  changing text within a field WindowEvent  closing a window

Model-View-Controller (MVC) Pattern Developed at Xerox PARC in 1978 Separates GUI into 3 components Model  application data View  visual interface Controller  user interaction Model View Controller

MVC Interaction Order 1. User performs action, controller is notified 2. Controller may request changes to model 3. Controller may tell view to update 4. Model may notify view if it has been modified 5. View may need to query model for current data 6. View updates display for user Model View Controller ,5 6

MVC Pattern – Advantages Separates data from its appearance More robust Easier to maintain Provides control over interface Easy to support multiple displays for same data Model GUI

MVC Pattern – Model Contains application & its data Provide methods to access & update data Interface defines allowed interactions Fixed interface enable both model & GUIs to be easily pulled out and replaced Examples Text documents Spreadsheets Web browser Video games

MVC Pattern – View Provides visual representation of model Multiple views can display model at same time Example: data represented as table and graph When model is updated, all its views are informed & given chance to update themselves

MVC Pattern – Controller Users interact with the controller Interprets mouse movement, keystrokes, etc. Communicates those activities to the model Interaction with model indirectly causes view(s) to update

Principles of GUI Design Model Should perform actual work Should be independent of the GUI But can provide access methods Controller Lets user control what work the program is doing Design of controller depends on model View Lets user see what the program is doing Should not display what controller thinks is happening (base display on model, not controller)

Principles of GUI Design Combining controller & view Appropriate if very interdependent Especially in small programs Separation of concerns Never mix model code with GUI code View should represent model as it really is Not some remembered status Controller should talk to model and view Avoid manipulate them directly