DOC PREVIEW
MIT 6 893 - Study Guide

This preview shows page 1-2-3 out of 10 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

6.893 User Interface Design & Implementation Fall 2003 Quiz 2 This quiz is closed book, closed notes. You have 80 minutes to complete it. Your name: ___________________________________________________ 1. (3 points) Which of the following problems is most likely to be found by a user test of a horizontal computer prototype? a. Response time is too slow. b. One dialog box uses a different font than another dialog box. c. A dialog box covers up information that the user needs from the main window. d. Color choices are bad for blue-yellow color-blind users. 2. (4 points) Name the two main categories of computer prototyping tools, and give one advantage that each category has over the other. Storyboard: you can draw anything Form builder: provides standard widgets, which actually work 3. (3 points) Which of the following is an advantage of the model-view-controller pattern? a. Models can be put inside other models. b. Multiple views can display the same model. c. Views and controllers are often tightly coupled. d. The controller separates the model from the view, so they don’t have to know about each other.4. (3 points) Which of the following is the least related to the view hierarchy? a. Input handling b. Clipping c. Models d. Automatic layout 5. (4 points) Give 2 reasons why the view and the controller are often tightly coupled. Controllers often need to display output (e.g. menus); Some responsibilities span both view and controller (e.g. selection); Affordances for control need to be displayed by view; Feedback for control needs to be displayed by view. 6. (4 points) List 4 kinds of translated input events. Mouse click, double click, drag, key typed, mouse entered or exited, keyboard focus gained or lost. 7. (4 points) The observer pattern is typically used in MVC as a way for the controller to receive input events. How else is the observer pattern used in MVC? Views use the observer pattern to listen for changes in the model. 8. (4 points) Louis Reasoner wants to use mouse triple-clicks in his application. He decides to measure the time between clicks by checking the system clock with System.currentTimeMillis(). What’s wrong with this approach? The mouse events may sit in the queue for varying amounts of time, so the time when the events are actually handled may not be related to the time the user actually clicked the mouse button. Need to use timestamp on events instead.9. (4 points) Alyssa Hacker is designing a checkers game in which the user makes moves by dragging checkers around the board with the mouse. She’s wrestling with a strange bug: if the user is dragging a checker and moves the mouse quickly, the checker sometimes stops following the mouse, even though the user hasn’t released the mouse button. The checker freezes in place until the user moves the mouse pointer back over it, at which point it starts moving with the mouse again. (You don’t know what UI toolkit she’s using, but it isn’t Swing.) From this behavior, describe: a. the output model she’s using to represent the checkers; b. how she’s handling the mouse input for checker dragging; c. what’s causing the bug, and how it might be fixed. Checkers are implemented as components; each checker is handling the mouse move events itself (as opposed to the board handling the events); when the mouse moves so fast that it jumps out of a checker, the system stops dispatching move events to the checker, since the pointer is no longer inside it. Several possible fixes: (1) handle the move events at the board level, (2) use mouse capture to ensure all mouse moves go to the checker during a drag. Some people suggested a third fix: turn off mouse move coalescing so that every change in mouse position is seen by the component. This fix is undesirable if the application can’t keep up with all the events, since the checker will lag behind the mouse. 10. (4 points) Give one advantage and one disadvantage of using components for output, as compared to strokes. Advantages: automatic layout; automatic redraw; input handling (components can receive events, strokes can’t). Disadvantages: components are heavyweight objects11. (4 points) Louis Reasoner is writing a Swing widget. He figures he can improve its responsiveness by saving the Graphics object passed to paint(), so that he can change the screen immediately whenever the model changes. Here’s some of his code: public class LouisWidget extends JComponent { Graphics savedGraphics; ... void paint (Graphics g) { savedGraphics = g; // save Graphics object for later use g.drawLine (...); // draw widget as usual ... } void modelChanged () { if (savedGraphics != null) { // draw changes right away savedGraphics.drawLine (...); ... } } } Although Ben Bitdiddle thinks Louis’s optimization is unnecessary, he’s more concerned that Louis has implemented it incorrectly. What is it about the Graphics object – and analogous objects in other UI toolkits – that makes it a bad idea to save it like this? Several reasons: (1) Graphics has mutable graphics context state (e.g. font, color, coordinate system, clipping) which may be changed when another component is drawn. (2) The Graphics object passed to paint() doesn’t always draw on the screen – it may draw on a printer driver or a temporary memory buffer. LouisWidget can’t tell which kind of Graphics object it’s saving.12. (3 points) In the HSV color model, what color is the fully unsaturated counterpart of pure red (i.e., identical on all components except S = 0)? a. Black b. White c. Pink d. Green 13. (3 points) RGB and HSV color models are both three-dimensional – i.e., each color has three components. RGB is represented by a cube, logically enough. But HSV isn’t. How is HSV represented, and why? HSV is a cone, for two reasons: (1) hue is perceptually unordered, so it is represented by angle, another unordered variable; (2) value is perceptually dissociative, making hue and saturation harder to perceive as value decreases. Reason 1 alone might make the model a cylinder; reasons 1 & 2 together argue for a cone. 14. (4 points) Give 2 reasons to use your platform’s native button widget rather than implementing your own -- 1 reason related to software engineering, and 1 reason related to usability.


View Full Document

MIT 6 893 - Study Guide

Documents in this Course
Toolkits

Toolkits

16 pages

Cricket

Cricket

29 pages

Quiz 1

Quiz 1

8 pages

Security

Security

28 pages

Load more
Download Study Guide
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Study Guide and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Study Guide 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?