Firm foundation in the main hci principles, the book provides a working


Download 4.23 Mb.
Pdf ko'rish
bet61/97
Sana23.09.2023
Hajmi4.23 Mb.
#1685852
1   ...   57   58   59   60   61   62   63   64   ...   97
Bog'liq
Human Computer Interaction Fundamentals

Figure 6.2 An interactive applet with callbacks for mouse events. When the mouse click is 
entered, the applet draws an object at the click position. When the mouse moves, the whole applet 
is repainted and a new cursor is drawn at the newly moved position.


9 9
U I D E V E L O P M E N T T O O L K I T
assigned to a UI component for each of various input events. Thus the 
listeners must be registered for various events that can be taken up by 
the given UI object. As a single UI object may be composed of several 
basic components and potentially receive many different types of input 
events, listeners for each of them will have to be coded and registered. 
Such a UI object is modeled as a collection of listeners through the Java 
implementation-interface construct (Figure 6.3).
Let’s go back and take a look at the event-component hierarchy 
(Figure 6.4). Table 6.2 shows more-detailed descriptions of some of 
the various events. All the events derive from an abstract EventObject 
and offer basic methods for retrieving the object associated with the 
event and accessing the event type and identification (ID). Descendant 
Java.util.EventListener
ActionListener
AdjustmentListener
ComponentListener
ComponentAdapter
ContainerAdapter
FocusAdapter
KeyAdapter
MouseAdapter
MouseMotionAdapter
WindowAdapter
ContainertListener
FocusListener
InputMethodListener
ItemListener
KeyListener
MouseListener
MouseMotionListener
TextListener
WindowListener
Figure 6.3 The event-listener interface hierarchy in Java AWT.
Java.awt.AWTEvent
ActionEvent
FocusEvent
InputEvent
KeyEvent
MouseEvent
PaintEvent
WindowEvent
ContainerEvent
AdjustmentEvent
TextEvent
ItemEvent
ComponentEvent
InputMethodEvent

Download 4.23 Mb.

Do'stlaringiz bilan baham:
1   ...   57   58   59   60   61   62   63   64   ...   97




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling