Model-view-controller View hierarchy Observer

Similar documents
Lecture 4: UI Software Architecture. Fall UI Design and Implementation 1

Lecture 9: UI Software Architecture. Fall UI Design and Implementation 1

We will talk about Alt-Tab from the usability perspective. Think about: - Is it learnable? - Is it efficient? - What about errors and safety?

Event Dispatch. Interactor Tree Lightweight vs. Heavyweight Positional Dispatch Focus Dispatch. Event Architecture. A pipeline: Event Capture

Event Dispatch. Interactor Tree Lightweight vs. Heavyweight Positional Dispatch Focus Dispatch. 2.4 Event Dispatch 1

Event Dispatch. Dispatching events to windows and widgets.

UI Elements. If you are not working in 2D mode, you need to change the texture type to Sprite (2D and UI)

MOBILE COMPUTING 1/20/18. How many of you. CSE 40814/60814 Spring have implemented a command-line user interface?

Our Hall of Fame or Shame candidate for today is the command ribbon, which was introduced in Microsoft Office The ribbon is a radically

Widgets. Widgets Widget Toolkits. User Interface Widget

Automatic layout Constraints Model-based UI. Declarative programming. Procedural programming. Saying what you want. Saying how to achieve it

Input (part 2: input models)

Model-view-controller. An architecture for UI

Dell Canvas Layout. Version 1.0 User s Guide

TYPES OF INTERACTORS Prasun Dewan Department of Computer Science University of North Carolina at Chapel Hill

GUI Programming. Chapter. A Fresh Graduate s Guide to Software Development Tools and Technologies

Thin Client for Web Using Swing

Create a Flowchart in PowerPoint

Widgets. Widgets Widget Toolkits. 2.3 Widgets 1

Fall UI Design and Implementation 1

Widget. Widget is a generic name for parts of an interface that have their own behaviour. e.g., buttons, progress bars, sliders, drop-down

Human Computer Interaction Lecture 08 [ Implementation Support ] Implementation support

Model-View-Controller

implementation support

Exercise1: Make a print map of Africa

Input part 3: Interaction Techniques

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

CS260 Intro to Java & Android 05.Android UI(Part I)

Input: Interaction Techniques

Model-View Controller IAT351

UI Toolkits. HCID 520 User Interface Software & Technology

CS260 Intro to Java & Android 05.Android UI(Part I)

Building User Interface for Android Mobile Applications II

ASSET DOCUMENTATION Mouse Interaction - Object Highlight Unity 3D Package. English

Layout. Dynamic layout, Swing and general layout strategies

Model-View-Controller Patterns and Frameworks. MVC Context

GUI Components: Part 1

An updated events syntax for XML-based markup languages

JavaScript and XHTML. Prof. D. Krupesha, PESIT, Bangalore

Graphical User Interfaces (GUIs)

Introducing Motif. Motif User s Guide 1

This quiz is closed book, closed notes. You have 80 minutes to complete it. Your name:

Graphical User Interface (GUI)

Fall UI Design and Implementation 1

Modify Group. Joint Move. (default keyboard shortcut Ctrl J)

Clip Art and Graphics. Inserting Clip Art. Inserting Other Graphics. Creating Your Own Shapes. Formatting the Shape

8/30/15 MOBILE COMPUTING. CSE 40814/60814 Fall How many of you. have implemented a command-line user interface?

- learnability. - efficiency. - graphic design

Fall UI Design and Implementation 1

GUI: Racket Graphical Interface Toolkit

Review. Designing Interactive Systems II. Review. Base Window System. Apps UITK BWS GEL. 4-Layer Model Graphics and Event Library BWS GEL

The Racket Graphical Interface Toolkit

Event-driven Programming: GUIs

Graphical User Interface (GUI)

Visualize the Network Topology

Tcl/Tk lecture. What is the Wish Interpreter? CIS 410/510 User Interface Programming

Oracle Fusion Middleware 11g: Build Applications with ADF I

What's New in Sitecore CMS 6.4

CS 349 / SE 382 Design Patterns. Professor Michael Terry January 21, 2009

Software System/Design & Architecture. Eng.Muhammad Fahad Khan Assistant Professor Department of Software Engineering

UI Toolkits. HCID 520 User Interface Software & Technology

edev Technologies integreat4tfs 2015 Update 2 Release Notes

Today s Hall of Fame or Shame example is a feature of Microsoft Office 2007 that gives a preview of what a style command will do to the document

Oracle Fusion Middleware 11g: Build Applications with ADF Accel

where are we? ICS 105: Project in HCI ui toolkits what does the toolkit do? model-view-controller model-view-controller lectures

Creating a Basic Application for DataPlus Mobile November 18, 2015

Jonathan Aldrich Charlie Garrod

Lesson 4 - Creating a Text Document Using WordPad

1. Create a map of the layer and attribute that needs to be queried

Event Driven UIs and Model-View-Controller

Part I. Integrated Development Environment. Chapter 2: The Solution Explorer, Toolbox, and Properties. Chapter 3: Options and Customizations

Introduction to concurrency and GUIs

Is image everything?

Building JavaServer Faces Applications

Microsoft PowerPoint 2016 Basics Unit 9 Final Review - Student Notes Directions: Fill in the blanks.

Produced by. Design Patterns. MSc in Communications Software. Eamonn de Leastar

Java Programming. Computer Science 112

Widget Toolkits CS MVC

Model-View-Controller

Create a unit using United Streaming and PowerPoint. Materials: Microsoft PowerPoint, Internet access, United Streaming account

Chapter 2 Welcome App

Designing RIA Accessibility: A Yahoo UI (YUI) Menu Case Study

Table of Contents Welcome to Menu.Applet... 2 Why Java -based menus?... 2 Basic terminology... 2 Getting to know Menu.Applet... 4 Creating a new menu

Towards a Repository of Common Programming Technologies Knowledge

CS 4300 Computer Graphics

Cheng, CSE870. More Frameworks. Overview. Recap on OOP. Acknowledgements:

UI Software Organization

Quark XML Author 2015 October Update with Business Documents

DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5)

Oracle Fusion Middleware 11g: Build Applications with ADF I

Windows and Events. created originally by Brian Bailey

CSE 331. Model/View Separation and Observer Pattern

Programming Languages and Techniques (CIS120)

Lecture 9. Lecture

Better UI Makes ugui Better!

Event-based Programming

Quark XML Author September 2016 Update for Platform with Business Documents

Object-Oriented Programming

Modern Requirements4TFS 2018 Release Notes

Microsoft Word 2011: Basic Tutorial

Transcription:

-view-controller hierarchy Fall 2004 6831 UI Design and Implementation 1 Fall 2004 6831 UI Design and Implementation 2!"# Separation of responsibilities : application state Maintains application state (data fields) Implements state-changing behavior Notifies dependent views/controllers when changes occur (observer pattern) : output Occupies screen extent (position, size) Draws on the screen Listens for changes to the model Queries the model to draw it : input Listens for keyboard & mouse events Tells the model or the view to change accordingly Decoupling Can have multiple views/controllers for same model Can reuse views/controllers for other models Source: Krasner & Pope Fall 2004 6831 UI Design and Implementation 3 Fall 2004 6831 UI Design and Implementation 4 1

$%# %& $%# '() Keyboard Keystroke handler get text Text display Screen Mouse Hyperlink handler get nodes Rendered page view Screen edit text Mutable string change events load new page Document Object (DOM) change events Fall 2004 6831 UI Design and Implementation 5 Fall 2004 6831 UI Design and Implementation 6 $%#!()*' (+ $%#, Network Request handler (eg servlet) get data Web page generator (eg JSP) Network Sensors Speed detector get data Map display change events Screen Database Traffic data Fall 2004 6831 UI Design and Implementation 7 Fall 2004 6831 UI Design and Implementation 8 2

- How fine-grained are the observable parts of the model? gettext() vs getpartoftext(start, end) How fine-grained are the change descriptions (events)? The string has changed somehow vs Insertion between offsets 3 and 5 How fine-grained are event registrations (the events the listener actually sees)? Tell me about every change vs Tell me about changes between offsets 3 and 5 often needs output must provide affordances for controller (eg scrollbar thumb) must also provide feedback about controller state (eg, depressed button) State shared between controller and view: Who manages the selection? Must be displayed by the view (as blinking text cursor or highlight) Must be d and used by the controller Should selection be in model? Generally not Some views need independent selections (eg two windows on the same document) Other views need synchronized selections (eg table view & chart view) Fall 2004 6831 UI Design and Implementation 9 Fall 2004 6831 UI Design and Implementation 10 / " 0 MVC has largely been superseded by MV (-) A reusable view manages both output and input Also called widget or component Examples: scrollbar, button, menubar Fall 2004 6831 UI Design and Implementation 11 s are arranged into a hierarchy Containers Window, panel, rich text widget Components Canvas, button, label, textbox Containers are also components Every GUI system has a view hierarchy, and the hierarchy is used in lots of ways Output Input Layout Fall 2004 6831 UI Design and Implementation 12 3

1 Drawing Draw requests are passed top-down through the hierarchy Clipping Parent container prevents its child components from drawing outside its extent Z-order Children are (usually) drawn on top of parents Child order dictates drawing order between siblings Coordinate system Every container has its own coordinate system (origin usually at the top left) Child positions are expressed in terms of parent coordinates Event dispatch and propagation Raw input events (key presses, mouse movements, mouse clicks) are sent to lowest component Event propagates up the hierarchy until some component handles it Keyboard focus One component in the hierarchy has the focus (implicitly, its ancestors do too) Fall 2004 6831 UI Design and Implementation 13 Fall 2004 6831 UI Design and Implementation 14 Automatic layout: children are positioned and sized within parent Allows window resizing Smoothly deals with internationalization and platform differences (eg fonts or widget sizes) Lifts burden of maintaining sizes and positions from the programmer Although actually just raises the level of abstraction, because you still want to get the graphic design (alignment & spacing) right Fall 2004 6831 UI Design and Implementation 15 1(+ pattern is used to decouple model from views stock market data A B graph table Fall 2004 6831 UI Design and Implementation 16 4

) )) Listener modify register interface { void register() void unregister() Object get() void modify() } modify register gets return interface { void (Event) } model must establish its invariants here, so that gets are correct gets return Fall 2004 6831 UI Design and Implementation 17 Fall 2004 6831 UI Design and Implementation 18 /""!" "" register modify(x) (X) modify modify(y) observer may unregister itself in response to an gets unregister (Y) Fall 2004 6831 UI Design and Implementation 19 Fall 2004 6831 UI Design and Implementation 20 5

11 A B modify(x) (X) modify(y) (Y) (Y) (X) Fall 2004 6831 UI Design and Implementation 21 6