1 / 20

Applied HCI

Applied HCI Week Six Mice in Space Overview Announcements ACM Meeting February 22 Women’s Basketball Pass out attendance roll Questions regarding Project 3 Lecture on Mouse events Critique and Lab time. Mouse Events In Spatial GUIs Spatial Interfaces Summary of Mouse Events

Ava
Télécharger la présentation

Applied HCI

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Applied HCI Week Six Mice in Space

  2. Overview • Announcements • ACM Meeting February 22 • Women’s Basketball • Pass out attendance roll • Questions regarding Project 3 • Lecture on Mouse events • Critique and Lab time.

  3. Mouse Events In Spatial GUIs • Spatial Interfaces • Summary of Mouse Events • Mouse Clicking Modifiers • Some Important Mouse Event Tips • Contextual Events in a Spatial GUI • Creating an Event Plan • Communication Among Events

  4. Spatial Interfaces • Spatial interfaces rely mostly on mouse events, not on the keyboard input. Hybrid Interfaces will rely on both mouse and keyboard input. • In this course, mouse events may be thought of equally as: • mouse • trackball • touchpad • touch screen • etc.

  5. Summary of Mouse Events All of the actions below are reported as MouseEvents via a MouseListener or a MouseMotionListener • The primary event methods detected for a MouseListener are: • mouseClicked • mousePressed • mouseReleased • mouseEntered (when a mouse enters a component) • mouseExited (when the mouse exits a component) • The primary event methods detected for a MouseMotionListener are: • mouseDragged (mouse moving with a button pressed) • mouseMoved (mouse moving with no buttons pressed)

  6. Mouse Clicking Modifiers Mouse clicks may be further modified: • * verify on your own system • * * Caution these clicks require keyboard input which may cause a cognitive interrupt

  7. Sample of Java Code to Determine Which Button Was Clicked private void formMousePressed(java.awt.event.MouseEvent evt) { if (evt.getButton() == 1) { processLeftButton(evt); // button 1 } else { processRightButton(evt); // button 3 } } Alternatively you may use: (evt.getModifiers() == InputEvent.BUTTON1_MASK)

  8. Sample of Java Code to Determine if Shift Key and Mouse Clicked private void formMouseClicked(java.awt.event.MouseEvent evt) { if (evt.isShiftDown()) { … }

  9. Some Important Mouse Event Tips • The location of Mouse Listeners handler is important! Place the listener in the JPanel you wish to work in, as the x and y coordinates will be relative to that panel. • Use the mousePressed method to determine where you are and what you are doing. For example, if you are inside a component you should determine which component your in within the mousePressed method. • Use the mouseDragged method to either move an object or “drag” a line. • Use the mouseReleased method to determine what you wish to do when you have completed your mouse action

  10. Contextual Events in a Spatial GUI • Mouse events are usually contextual in spatial environments. That is, they may have different meanings depending on the context in which the event occurs. • Examples of contexts include: • clicking in a component may mean I wish to: • modify a component • delete a component • move a component • connect two components (via a connector) • clicking outside a component may mean I wish to create a new component at this location

  11. Contextual Events in a Spatial GUI • Other ways of determining the context include: • the type of button clicked (e.g. left/right buttons, single/multiple clicks, key + click) • via items selected elsewhere in the GUI environment (e.g. the type of component you wish to create).

  12. Contextual Events in a Spatial GUI • Caution: selecting the type of contexts is crucial to successful event handling and is not trivial. The contexts must be kept straight, as there may be competing contexts at play

  13. Contextual Events in a Spatial GUI Best approach is to: • Prior to coding, construct an event plan: • Identify the contexts (and their triggering events). • Anticipate as many conflicts as possible. • During coding: • Try to incrementally develop the event handlers (e.g. work with components prior to working on connectors) • Test as you go! (Do NOT try to do this all at once!)

  14. Event Plan • *if components or connectors are handled separately by type, you should create additional columns • Please note there is no retrieve in this CRUD interface since it is assumed that the components will be retrieved and visible.

  15. Communication Among Events It is important to communicate between the events. This may be accomplished by way of signals or booleans.

  16. Mouse Events In Spatial GUIs • Spatial Interfaces • Summary of Mouse Events • Mouse Clicking Modifiers • Some Important Mouse Event Tips • Contextual Events in a Spatial GUI • Creating an Event Plan • Communication Among Events

  17. Project Critiques • Please do not underestimate the importance of these critique sessions!!! • Be prepared! Have your project ready for usability testing prior to turn in. • Have your partner go through an entire set of predetermined tasks as set up by you. (e.g. create, retrieve, update, and delete). Use the assignment specs as a guide, but don’t be afraid to augment with additional tests to suit your additional features.

  18. Project Developer’s Responsibilities • When your partner runs your project, watch what he/she does. Take notes, but do not interfere, unless help is requested or required. Does your partner: • Get excited? • Get confused? • Struggle with a task? • Know exactly what to do?

  19. User’s Responsibilities • Be prepared to test the entire project. • Give it an honest try, but do not bend over backwards to make the project work. If the interface is not intuitive or straightforward, help your partner by letting him/her know. • Don’t be insulting but don’t hold back either.

  20. Applied HCI Week Six Mice in Space

More Related