Midterm I Flashcards
What type of GUI object is the root of a containment hierarchy?
Container
A GUI object can act as a listener to only one event source.
FALSE
Each GUI component instance can be contained only once in a containment hierarchy.
TRUE
All events in the event queue must be processed.
FALSE
GUI frameworks hide large chunks of the control flow of the program
TRUE
What is a graphical user interface?
A graphical user interface is a computer display format that allows the user to select commands, call up files, start programs, and do other routine tasks by using a mouse to point to pictorial symbols (icons) or lists of menu choices on the screen as opposed to having to type in text commands.
What is a semantic event?
everything other than low-level events. Examples of semantic events include action and item events.
A semantic event might be triggered by user input;
expresses what the user is doing, such as “clicking that button”
defined at a higher-level to encapsulate the semantics of a user interface component’s model
Provide a definition for GUI framework
framework: cohesive set of interfaces and classes that collaborate to provide services for the core,
unvarying part of a logical subsystem. contains concrete (and especially) abstract classes that define interfaces to conform to., object interactions to participate in, and other invariants.
GUI framework: uses computer graphics to display individual gui components and the overall GUI
What is MVC?
- a pattern used for UI development
- creates a clear division between domain objects (model) that model the real world and presentation objects that are the GUI elements visible on the screen
- domain objects should be completely self contained and work without reference to the presentation, they should also be able to support multiple presentations, possibly simultaneously
what does model do?
- encapsulates data specific to the application
- responds to state queries
- exposes application functionality by defining computation and logic to process data
- notifies view of changes
what does controller do?
- acts as an intermediary between one or more view objects and one or more model objects
- defines application behavior
- maps user actions to model updates
- selects view for response
- one for each functionality
- invokes state change to model
- sends view selection to view
what does view do?
- renders the models
- what users can see
- requests updates from models
- responds to user actions by sending user gestures to controller
- allows contoller to select view
HTML5 is…
a markup language for web pages
What does javascript do?
- Read elements from documents, write new elements and text into documents, manipulate or move text
- reacts to events (clicking a button)
- determines the user’s screen size, date/time, etc
What is the DOM?
document object model
- represents the web page loaded into the browser using a series of objects
- main object is the document object, which contains child objects
- specifies document interface
What is React?
a declarative, efficient, and flexible JavaScript library for building user interfaces
What is D3?
a JavaScript library for manipulating documents based on data
GUI
“Graphical User Interface” is a computer display format that allows the user to select commands, call up files, start programs, and do other routine tasks by using a mouse to point to pictorial symbols (icons) or lists of menu choices on the screen as opposed to having to type in text commands
WIMP
“Windows, Icons, Menus and Pointing device”
style of user interaction with a graphical user interface that allows a user to interact with the computer through the means of a pointing device such as a mouse to select words from drop down menus or images such as icons on the display screen that represent commands for movement, activation or some other action
what is a gui component?
- an element that displays an information arrangement changeable by the user
- provides a single interaction point for a given kind of data
containment hierarchy
tree of components that has a top-level
container as its root
how do components of the MVC interact?
the view recognizes a gui action»_space; the view calls the appropriate method on the controller»_space; the controller accesses the model (possibly updating it)»_space; if the model is altered it notifies interested listeners of the change (view)
what is the model-view separation principle?
Model (domain) objects should not have direct knowledge of view (GUI) objects, at least as view objects
- allow separate development of the model and UI layers
what are the types of containers?
- top level: at least one of these must be present in an app
- general-purpose: used in most applications
- special-purpose: play specific roles in the UI
what are the kinds of gui components? (4)
basic controls
interactive displays of highly formatted information
uneditable information displays
containers
draw and describe the main event loops
initialization»_space; get next event from queue»_space; process event»_space; are we done yet? (» either get next event or clean up and exit)
what are events used for?
they propagate and deliver information about input devices, windows, and semantics actions to the GUI components
they change property values within GUI
what are listener objects?
they receive and process event objects
listen to a source object
handle and process events with methods
interface
list of methods implemented by the listener and invoked by the source with the event object as a parameter
event object
data passed from the source to the listener
source
creates event objects and maintains a list of listeners
what are the 2 event types
low-level
semantic
low-level events
represent window-system occurrences or low-level input
mouse and key events both of which result
directly from user input
semantic events
anything that isnt low level
include action and item events
express what the user is doing (clicking that button)
what can trigger events?
- user gestures
- modification of a web page
- network requests made by a web page
what is a design pattern?
the event system is a design pattern
- named pair of problem and its solution
- the pattern starts with an agreement over a kind of event and the name string used for the event, the type of the data structure used to represent the key properties of that event, and the javascript object which will emit that event
how are patterns implemented?
defining a java script function which takes as an argument the data structure which was agreed upon
Registering the function using the name String with the object which will emit the event
what does the DOM event model consist of?
- the DOM event flow (describes flow of events in a tree-based structure)
- set of interfaces to access contextual information on events and to register event listeners.
what are the goals of DOM events?
The design of an event system which allows registration of event listeners and describes event flow through a tree structure.
Provide a common subset of the current event systems used in DOM Level 0 browsers.