Principle 7: Design for Responsiveness You want the interface to be fast (but not too fast). Sub-second response time is the norm, but if things happen.

Slides:



Advertisements
Similar presentations
Layered Panes Manages the painting of components to simulate different depths. The highest depth level number is on top. Components at the same depth level.
Advertisements

Copyright 2006 by Pearson Education 1 Building Java Programs Supplement 3G: Graphics.
2D Graphics Drawing Things. Graphics In your GUI, you might want to draw graphics E.g. draw lines, circles, shapes, draw strings etc The Graphics class.
1 More on Applets Overview l Changing Colors l Changing Fonts & Styles l Applet Life-Cycle l Input using Dialog Window l Input using HTML parameters l.
Frame Windows A frame object is used to create a graphical frame window. This frame is used to show information in a graphical application. The JFrame.
Graphics Shapes. Setup for using graphics You have to import the graphics library You can use either “import graphics” or “from graphics import *” or.
Laboratory Study II October, Java Programming Assignment  Write a program to calculate and output the distance traveled by a car on a tank of.
Graphics You draw on a Graphics object The Graphics object cannot directly be created by your code, instead one is generated when the method paintComponent.
Graphics Chapter 16.  If you want to draw shapes such as a bar chart, a clock, or a stop sign, how do you do it?
Graphics Programming. Introduction GOAL: Build the Indexer Client Event-driven vs. Sequential programs Terminology – Top-level windows are called “frame.
LAB SESSION 7 Graphical user interface Applet fundamentals Methods in applets Execution of an applet Graphics class.
Graphics CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
1 Drawing C Sc 335 Object-Oriented Programming and Design Rick Mercer.
Applets Graphical Java programs Run inside web browser Platform-neutral Easy deployment--loads when needed Secure.
Java Graphics Section 1 - Multi-File Graphics Programs Section 2 - The Coordinate System and Graphics Context g Section 3 - The Java Drawing and Painting.
GUI and Swing, part 2 The illustrated edition. Scroll bars As we have previously seen, a JTextArea has a fixed size, but the amount of text that can be.
1 L36 Graphics and Java 2D™ (1). 2 OBJECTIVES  To understand graphics contexts and graphics objects.  To understand and be able to manipulate colors.
1 Chapter 15 l Basic Figures l Colors l Fonts and Other Text Details Graphics Objects.
©2004 Brooks/Cole Applets Graphics & GUIs. Figures ©2004 Brooks/Cole CS 119: Intro to JavaFall 2005 Graphical Programs Most applications these days are.
Chapter Day 5. © 2007 Pearson Addison-Wesley. All rights reserved2-2 Agenda Day 5 Questions from last Class?? Problem set 1 Posted  Introduction on developing.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Topics  Applets  Classes used for graphics Graphics Point Dimension.
May 11, 1998CS102-02Lecture 7-1 More Graphics in Java CS Lecture 7-1 A picture's worth a thousand words.
Swinging Into Swing Leo S. Primero III. Understanding what Swing Is Swing is a package that lets you create applications that use a flashy Graphical User.
Slides prepared by Rose Williams, Binghamton University Chapter 19 Swing II.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Java Applets What is an Applet? How do you create.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L01 (Chapter 13) Graphics.
ObjectDraw and Objects Early Chris Nevison Barbara Wells.
1 L38 Graphics and Java 2D™ (3). 2 OBJECTIVES In this chapter you will learn:  To understand graphics contexts and graphics objects.  To understand.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 5 Java Graphics Applets.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 5 Applets and Graphics.
Slide Transitions Slide Show, Slide Transition opens Slide Transition task pane Practice each option setting to select the transition style, its speed,
CS 112 GUI 06 May 2008 Bilkent. Java GUI API Containers: ◦ contain other GUI components. E.g, Window, Panel, Applet, Frame Dialog. Components: ◦ Buttons,
1 Python Programming: An Introduction to Computer Science Chapter 3 Objects and Graphics.
Java Review Structure of a graphics program. Computer Graphics and User Interfaces Java is Object-Oriented A program uses objects to model the solution.
Swing Graphics ● Empty Swing containers have no visual appearance except for a background color ● Every JComponent must have a paintComponent method that.
Graphics and Multimedia. Introduction The language contains many sophisticated drawing capabilities as part of namespace System.Drawing and the other.
Chapter 16: Graphics. Objectives Learn about the paint() and repaint() methods Use the drawString() method to draw String s using various fonts and colors.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Java Applets What is an Applet? How do you create.
20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 16: Java Applets & AWT Fundamentals of Web Programming.
Lehigh University Introduction to Flash MX Sharmeen Mecklai.
Java Software Solutions Lewis and Loftus Chapter 7 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Graphics -- Introduction The.
1 Graphical User Components (II) Outline JTextArea Creating a Customized Subclass of JPanel JPanel Subclass that Handles Its Own Events Windows: Additional.
COP 4331 – OOD&P Lecture 6. Review Midterm Review Complete sample application –See SwingColorTest.java.
Chapter 15 Graphics and Java 2D™ Java How to Program, 8/e (C) 2010 Pearson Education, Inc. All rights reserved.
 Pearson Education, Inc. All rights reserved. 1 Ch 12 Graphics and Java 2D In this chapter you will learn:  To understand graphics contexts.
Chapter 15Java: an Introduction to Computer Science & Programming - Walter Savitch 1 Chapter 15 l Basic Figures l Colors l Fonts and Other Text Details.
Applets Applet is java program that can be embedded into HTML pages. Java applets runs on the java enabled web browsers such as mozilla and internet explorer.
COMP 110: Spring Announcements Quiz Wednesday No Class Friday Assignment 5 Due next Monday Q&A Review Session Monday.
Graphic User Interface. Graphic User Interface (GUI) Most of us interact with computers using GUIs. GUIs are visual representations of the actions you.
Java Graphics Stuart Hansen 11/6/03. What’s Wrong with OpenGL Graphics – not GUI –No real support of text boxes, buttons, etc. Procedural - not OOP –No.
Introduction to Java Simple Graphics. Objects and Methods Recall that a method is an action which can be performed by an object. –The action takes place.
Creating Your Own Widgets CompSci 230 S Software Construction.
Tkinter Canvas.
Applets Yong Choi School of Business CSU, Bakersfield.
(C) 2010 Pearson Education, Inc. All rights reserved.  Class Graphics (from package java.awt) provides various methods for drawing text and shapes onto.
Merete S COLLEGEFACULTY OF ENGINEERING & SCIENCE Graphics ikt403 – Object-Oriented Software Development.
Intro to Applets. Applet Applets run within the Web browser environment Applets bring dynamic interaction and live animation to an otherwise static HTML.
1 GUIs, Layout, Drawing Rick Mercer. 2 Event-Driven Programming with Graphical user Interfaces  Most applications have graphical user interfaces (GUIs)
Graphics Concepts CS 2302, Fall /17/20142 Drawing in Android.
Creating Graphics in Java CSE301 University of Sunderland Harry R Erwin, PhD.
Graphics and Java2D Chapter Java Coordinate System Origin is in _____________ corner –Behind title bar of window X values increase to the ________.
Basics of GUI Programming Chapter 11 and Chapter 22.
Paint Tutorial Created February 2006 Start Paint: Start>Programs>Accessories>Paint.
CS 115 Lecture 7 Graphics – coordinate systems, Text, Entry, aliases Taken from notes by Dr. Neil Moore.
Getting Started with GUI Programming Chapter 10 CSCI 1302.
Graphics in Java Opening Discussion zDo you have any questions about the quiz? zWhat did we talk about last class? zDo you have any questions.
CPCS 391 Computer Graphics Lab One. Computer Graphics Using Java What is Computer Graphics: Computer graphics are graphics created using computers and,
10/20/2005week71 Graphics, mouse and mouse motion events, KeyEvent Agenda Classes in AWT for graphics Example java programs –Graphics –Mouse events –Mouse.
Girls On The Run Los Angeles
Graphics -- Introduction
Presentation transcript:

Principle 7: Design for Responsiveness You want the interface to be fast (but not too fast). Sub-second response time is the norm, but if things happen too fast the user begins to wonder if the right things are getting done. The user is more satisfied if the machine pauses a little when working on what the user believes to be a lot of steps that SHOULD slow the machine down. If it will take a while, there should be feedback that the machine is working. If it gets the job done instantaneously there should be confirmation of what has been done.

Perception of Responsiveness Defined Impeding the users work flow (the user should be able to set the pace and have the machine keep up). Lack of feedback on accomplishmentsthe user has to go out and check to make sure that the work was done. Locking the machine to prevent user intervention holding the user hostage, especially without any indication of the length of the side trip. Ignoring or not acknowledging user input in a timely manner. On the web the penalty of non-responsiveness is that the user changes sites. Designers must be aware of the price of client server interaction and should attempt to do as much processing on the client as possible.

Seven Guidelines Responsiveness can be high when performance (speed of execution) is sluggish. CPUs are normally burdenedsoftware always demands more than hardware can give. UI is real-time programming All delays are not equal, priorities should be evident. Software can reorder requests to process them more efficiently. All requests need not be honored Humans and software make different requirements on interfacesthe user is not just another module of the system.

Exam 1 86 A 79 A 76 A- 67 B 62 B- Item analysis: – 1a 1b 1c 1d a 7b 7c 7d 7e – –7f 7g 7h 7i 7j 7k 7l 7m 7n 8 9a 9b 9c average – Threads inherit a run() (Runable interfaces must add a run() Standard levels are –3000, 0, 100 (palette), 200 (modal), 300 (popup) & 400 (drag) JComponet is an abstract class that provides a lot of services to all the Swing components. JPanel adds almost no functionality beyond what all Jcomponent objects have, but the constructor allows the setting of the LayoutManger and doublebuffering.

Using Graphics Primitives The library has methods to draw lines (between two points, in direction), rectangles, polygons, round rectangles, ovals, and arcs. Polygons and ovals can also be filled. Java 2D API has more shapes. When you get to counting pixels you find that Java outlines shapes, so that you must specify one pixel less for height and width to get the same area described as you do in requesting a filled shape. There is a default line color and a default fill color. Shapes with negative dimensions do not get drawn at all, but drawing outside the graphic area merely causes clipping.

Examples RectangleDemo (note how filled rectange is drawn inside of rectangle)RectangleDemo ShapesDemo (demonstrates calls on variety of library shape-drawing methods)ShapesDemo FontDemo applet TextXY applet The Font and FontMetrics classes allow customization not possible with a text-drawing component such as a label or a text component. –g.drawString(text, x,y) [y is baseline, x is lower-left corner of text image (less descender) Text height above base line is getAscender, getHeight is distance between baselines. getLeading is distance from descender to next ascender. Advance width measures the pixels used from the current point to display the character, byte or string.] –g.drawBytes and g.drawChars