PackageCn.my.demo;//Designing a listener Public classDemo2 { Public Static voidMain (string[] args) {person P=NewPerson (1001, "Zhang San"); P.refisterlistener (NewPersonlistener () { Public voidDorun (Event e) {person P=E.getsource (); System.out.println ("Who's in front of people to has a meal, that's" +p.getname ()); } Public voiddoeat (Event e) {person P=E.getsource (); System.ou
In this chapter we focus on the event source that deals with the commands of the network Monkeysourcenetwork to illustrate how learning Monkey handles Monkeyrunner commands. Following is a summary of the process of Monkeyrunner from starting monkey to how to handle the completion of a command:
monkeyrunner send Shell command "Monkey--port 12345" via ADB to start monkey
monkey start running in
JQuery-1.9.1 source code analysis series (10) Event System-event Commission, jquery-1.9.1 source code
JQuery event binding has several outstanding features:
1. You can bind an unlimited number of processing functions.
2. events can be delegated to the ancestor node, and do n
Monkeysourcenetwork, or subclasses of Monkeysourcenetworkvars, Otherwise it is Monkeysourcenetworkviews's subclass:Figure 6-3-2 Command translation class as the inner class of the event sourceOnce the event source gets to the string command it is convenient to call the internal command translation class through Command_map to translate the command, so we can als
Monkeysourcenetwork, or subclasses of Monkeysourcenetworkvars, Otherwise it is Monkeysourcenetworkviews's subclass:Figure 6-3-2 Command translation class as the inner class of the event sourceOnce the event source gets to the string command it is convenient to call the internal command translation class through Command_map to translate the command, so we can als
Event bubbling
Event Capture: parent-level elements are triggered first, and child-level elements are triggered later.
Event bubbling: Child-level elements are triggered first, and parent-level elements are triggered later.
Currently, in IE and FF, trigger events are basically event bubbles and executed from i
JQuery-1.9.1 source code analysis series (10) Event System Event packaging, jquery-1.9.1 source code
In the previous article to introduce you to the jQuery-1.9.1 source code analysis series (10) Event System of the
Distributing source flow from the event-clicked screen to event-handling events
Let's get a picture first.
How to print it, code first.Thread.dumpstack ();Execute this method in the Dispatchtouchevent (Motionevent event) method
Through the above methods, you can print out from the click Screen to execute Dispatchtouche
After the event source obtains the string command and translates it into the corresponding Monkeyevent event, these events are queued into a queue maintained by the event source. Then other places such as the Monkey Class of the Runmonkeycycles method can go to the queue of
As you can tell from the previous section, the command that Monkeyrunner sends to monkey is interactive in the form of strings, so the first step in event handling is, of course, to get the string command that Monkeyrunner sent over.When the event source Monkeysourcenetwork is initialized, the constructor creates a serversocket to listen for links and data from t
Anatomy of event distribution source code in QTEvent delivery sequence in QT:In a supposed program, it goes into an event loop, accepts the events generated by the system, and distributes them, all in exec.The following examples illustrate:1) First Look at the following example code:[CPP]View Plaincopy
int main (int argc, char *argv[])
{
Qapplic
Jquery event core source code analysis, jquery event source code
Starting from binding events, let's look at it step by step:
Take jquery.1.8.3 as an example. The on method is usually used to bind events through jquery, which is roughly divided into the following three types:
$ (Target). on ('click', function () {// fu
JQuery-1.9.1 source code analysis series (10) Event System-event packaging, jquery-1.9.1 source code
First, you need to understand that the browser's native events are read-only, which limits jQuery's operations on them. A simple example shows why jQuery has to construct a new even
Event: Refers to user operations such as mouse clicks and keyboard input.It is an object.
Event object: After an event occurs, it is called an event object in flex. The event object has a listener for it, and the event object h
Found a small point that had not been noticed before
Stoppropagation:function () {
var e = this.originalevent;
...
if (e.stoppropagation) {
e.stoppropagation ();
}
The Stoppropagation function of the local event object called by the jquery overload stoppropagation function blocks bubbling. In other words, the current node, not the event
. It is not until your hands are skillful that your wheels reach the original level that can be applied to the project.
Subsequent sections of this chapter:
Encapsulate event object interface application interface call chain source code analysis DOMReady topic
10. event handling
10.1 Overview
As a JavaScript library, we must first solve browser
This article mainly introduces the jQuery-1.9.1 source code analysis series (10) Event System Event packaging related information, the need of friends can refer to the next article to introduce you to the jQuery-1.9.1 source code analysis series (10) Event System
native js to implement a similar function in the process of analysis. This is a good habit; this series aims to deeply analyze jQuery's ideas and skills, in the analysis process, I will break down all the ideas and native js used. It is a good thing to duplicate the wheel, and it must be repeated. How can we understand the essence of Originality without repeating the wheel? How can we innovate without repeating the wheel? The key lies in: making more and using less, the wheel was made to keep i
========================================================== ==========================================================
In ie, the event object has the srcelement attribute, but does not have the target attribute. In Firefox, the even object has the target attribute, but does not have the srcelement attribute .. Solution: Use OBJ (OBJ = event. srcelement?
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.