CN1641588A - Method for transmitting events between Java assemblies - Google Patents
Method for transmitting events between Java assemblies Download PDFInfo
- Publication number
- CN1641588A CN1641588A CN 200410001424 CN200410001424A CN1641588A CN 1641588 A CN1641588 A CN 1641588A CN 200410001424 CN200410001424 CN 200410001424 CN 200410001424 A CN200410001424 A CN 200410001424A CN 1641588 A CN1641588 A CN 1641588A
- Authority
- CN
- China
- Prior art keywords
- incident
- assembly
- java
- target element
- mouse
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Stored Programmes (AREA)
Abstract
The invention relates to a method to transfer affair between Java components that are used in Java program. It can be realized according to the following steps: first, capturing the affair happened on the initial component; second, checking the object components whose state have changed; third, analyzing the common attributes between the initial components and the object components; transferring the common attributes from initial components to object components; finally, calling functions of the object components to process the affairs according to the attribute value. Thus, the affair would be transferred between Java components.
Description
Technical field
The present invention relates to the method for transmission incident (Event) between a kind of assembly (Component) in program interface, especially about a kind of method of the transmission incident between the Java assembly.
Background technology
Java is as a kind of object-oriented language, and is because of himself various advantageous characteristic feature (cross-platform, security is high) become very popular, especially handy especially when writing web application.Therefore increasing people adopts Java to develop various application systems, and java application mainly contains two types: application program (Application) and applet (Applet).Program personnel can use some assemblies (Component) of Java, as button, list box, menu etc. when the program of writing two types.The most important one side of application program is to allow user and program interaction, and Java uses incident (Event) class to finish this function.When the user clicks these assemblies in the Application Program Interface, will trigger the incident of Java, Java handles according to predefined response method response events.
Briefly say, event handling be to button click, mouse moves or the like the process that situation is made a response, it has become the theme of a complexity among the Java.From Javal.1, event handling has had very cataclysm, and current model is called commit event and handles (Delegated Event Handling).In this event handling model, if you need handle specific incident, for example click of button, you must register (Register) to Java.Just have only the code that needs the processing particular event to be apprised of these incidents and taken place, rather than the other parts of code obtain notice.In general, registered events is finished by realization event audiomonitor interface.For certain specific assembly, can add the variety of event audiomonitor, when on this assembly, incident taking place like this, can notify this assembly to carry out the action of response.
As shown in Figure 1, in an assembly, responding the synoptic diagram of mouse event.In actual applications, can add a specific assembly A in user interface, and register some event sniffers for this assembly A, the incident when these registrations takes place like this, and system can be according to the response method response that defines.If added a plurality of assemblies, assembly B for example, each assembly has been added the events corresponding audiomonitor, at this moment, can the another one assembly also be made the response action when how the action of the event response on an assembly took place? this just need give another assembly with incident from a component passes with certain method.
For example, need to suppose exploitation one cover server management system, all will use patterned interface display for each equipment in the network.Management for convenience, the network manager divides into groups equipment by certain rule, and represent the grouping situation with two assemblies, one of them assembly is a tree type assembly (Tree), another one is the ListView assembly, tree type assembly has reflected the level type relation between the group, when clicking certain group, shows the detailed composition situation of this group with icon (Icon) form in the ListView assembly.For the convenience of dividing into groups, need provide a function: in the ListView assembly, a group or several equipment is drawn among the Tree in the another one group.But because ListView and Tree are two assemblies of system, in ListView, pull assembly and when in Tree, decontroling, affiliated incident just takes place in ListView, and call out the event handling function of ListView definition, thereby can only finish an incident: from ListView, the assembly that pulls is deleted.The another one incident: in Tree the assembly of deleting among the ListView increased in new group and then can't finish, this just needs this incident is passed to the Tree assembly, thereby the functional module of calling out the Tree assembly and increase assembly is finished whole process.
Therefore, incident is transmitted between the Java assembly and become problem anxious to be solved.
Summary of the invention
The present invention provides a kind of method of transmitting incident between the Java assembly for addressing the above problem, and is applied in the java applet, and the incident that occurs on a certain specific components is carried out the transition on another assembly, forms the transmission of incident.
The invention provides a kind of method of between the Java assembly, transmitting incident, at first catch the incident that occurs on the initial component; Follow the target element that detected state changes; Analyze the property value that has general character between this initial component and the target element; Then the general character property value in this initial component is transformed in this target element; Handle the function of this incident at last according to this this target element of evaluative attribute call by valne.
The present invention will have general character by analyzing the general character between the Java assembly property parameters is transformed into the target element that needs the transmission incident, thereby realized the transmission of incident between the Java assembly, the incident that occurs on a certain specific components is carried out the transition on another assembly.
Description of drawings
Fig. 1 is the synoptic diagram of response mouse event on a Java assembly;
Fig. 2 is the synoptic diagram of response mouse event on a plurality of Java assemblies;
Fig. 3 transmits the method flow diagram of incident between the Java assembly for the present invention;
Fig. 4 is a switch process process flow diagram provided by the present invention; And
Fig. 5 is a specific mouse event Processing Example process flow diagram.
Wherein, description of reference numerals is as follows:
A Java assembly
B Java assembly
The incident that occurs on the initial component is caught and responded to step 301
The target element that step 302 detected state changes
The operation whether step 501 has mouse to press
Step 502 is handled the operation that this mouse is pressed
Whether step 503 has, and the operation that mouse moves into takes place
Step 504 is handled this move operation
Whether mouse shifts out step 505
Which step 506 inquires about, and other assembly has the state variation of mouse immigration
The processing function of this incident of step 507 call
Embodiment
In order to carry out event handling, at first need in applet or application, add the assembly of the incident of monitoring, and add the action audiomonitor to this assembly.When incident takes place on assembly, assembly will respond action.As shown in Figure 2, define two assembly A and B, add the disposal route ComponentA_MousePressed of response mouse click event respectively to assembly A and B, ComponentB_MousePressed, the disposal route ComponentA_MouseMoved of response mouse drag events, ComponentB_MouseMoved, the disposal route ComponentA_MouseReleased and the ComponentB_MouseReleased of mouse event unclamped in response.
If the user clicks the mouse on assembly A and drags, on assembly A, decontrol mouse then, triggered three incident ComponentA_MousePressed, ComponentA_MouseMoved, ComponentA_MouseReleased like this, three incidents are carried out in order successively.
In Fig. 2, if pressing mouse on the assembly A and dragging mouse to assembly B and decontrol mouse, so just produced four incidents: the event1-mouse is pressed on assembly A; The event2-mouse moves on assembly A; The event3-mouse moves on assembly B; The event4-mouse is decontroled on assembly B.According to design expectation, incident should be by following flow processing:
ComponentA_MousePressed→ComponentA_MouseMoved→ComponentB_MouseMoved→ComponentB_MouseReleased。
Actual conditions are really not so, and it can be by following flow processing:
ComponentA_MousePressed→ComponentA_MouseMoved→ComponentA_MouseReleased。
That is to say that after pressing mouse on the assembly A no matter whether decontrol mouse on assembly A, mouse is decontroled incident and all can be caught by assembly A, therefore need carry out some processing and could allow also capturing events of assembly B.
This processing procedure, should guarantee that at first assembly A and assembly B are similar to the disposal route of certain incident, just the function of processing events imports number of parameters, type homogeneous one correspondence into, assembly A is when incident generation trigger event is handled function like this, can convert this incident the incident of assembly B correspondence to by certain transformational relation, and the events corresponding of call component B is handled function and is come response events.
Next is the transformational relation between the tectonic event, and this is the key point that incident is transmitted between assembly.When the investigation incident takes place, have certain general character on assembly, utilize these general character, our corresponding relation between just can tectonic event.For incident such as be similar to click, drag, no matter it takes place on which kind of assembly, its general character that has is position (Position), a specific incident (Event), in when, among the assembly A certain incident taking place, these two attributes have determined, these two attributes are videoed among the assembly B, and call component B handle the function of this incident, then assembly B also has been equivalent to handle an identical incident, thereby incident has realized transmission between A and B.The map of reflection process for preserve A, B in the upper component of assembly A and B, above-mentioned position attribution can carry out the conversion of corresponding relation by map.
As shown in Figure 3, for the method flow diagram that between the Java assembly, transmits incident of the present invention, at first catch and respond the incident (step 301) that occurs on the initial component; Follow the target element (step 302) that detected state changes; Analyze the property value (step 303) that has general character between this initial component and the target element; General character property value in this initial component is transformed in this target element (step 304); Handle the function (step 305) of this incident according to this this target element of evaluative attribute call by valne.
Wherein this switch process sees also Fig. 4, also comprises the steps: at first their map (step 401) of structure in the upper component of this initial component and target element; According to the corresponding relation (step 402) between this map structure component property; In target element, construct an identical incident (step 403) according to this corresponding relation.
Seeing also Fig. 5, is a specific mouse event Processing Example process flow diagram.At first detect the operation (step 501) that on a specific components, whether has mouse to press; If any then on this assembly, handling the operation (step 502) that this mouse is pressed; Judge whether to take place the operation (step 503) that mouse moves into then; If generation is arranged, then handle this move operation (step 504); Judge then whether this mouse move operation has shifted out this specific assembly (step 505); If no, then continue to detect move operation, if mouse has shifted out this specific components, the state variation (step 506) that other the assembly that then which searches has mouse to move into; Property parameters according to conversion comes the processing function (step 507) of this incident of call on the assembly that this mouse moves at last, finishes the transmission of incident in the Java assembly with this.
The above only is the present invention's preferred embodiment wherein, is not to be used for limiting practical range of the present invention; All equalizations of being done without departing from the spirit and scope of the present invention according to the present patent application claim change and modify, and all should belong in the patent claims of the present invention scope required for protection.
Claims (6)
1, a kind of method of transmitting incident between the Java assembly is applied in the java applet, and the incident that occurs on a certain specific components is carried out the transition on another assembly, forms the transmission of incident, and wherein this method comprises the steps:
Catch the incident that occurs on the initial component;
The target element that detected state changes;
Analyze the property value that has general character between this initial component and the target element;
General character property value in this initial component is transformed in this target element; And
Handle the function of this incident according to this this target element of evaluative attribute call by valne.
2, the method for transmitting incident between the Java assembly as claimed in claim 1, wherein this incident comprises and presses mouse, drags mouse, and decontrols mouse.
3, the method for transmitting incident between the Java assembly as claimed in claim 1, wherein the number of importing parameter into of the event handling function of this target element and initial component and type are one to one.
4, the method for transmitting incident between the Java assembly as claimed in claim 1, whether wherein this target element status detection comprises has mouse to move into.
5, the method for transmitting incident between the Java assembly as claimed in claim 1, wherein this attribute with general character comprises the position, and specific incident.
6, the method for transmitting incident between the Java assembly as claimed in claim 1, wherein this switch process also comprises the steps:
Their map of structure in the upper component of this initial component and target element;
According to the corresponding relation between this map structure component property; And
In target element, construct an identical incident according to this corresponding relation.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 200410001424 CN1641588A (en) | 2004-01-08 | 2004-01-08 | Method for transmitting events between Java assemblies |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 200410001424 CN1641588A (en) | 2004-01-08 | 2004-01-08 | Method for transmitting events between Java assemblies |
Publications (1)
Publication Number | Publication Date |
---|---|
CN1641588A true CN1641588A (en) | 2005-07-20 |
Family
ID=34867110
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN 200410001424 Pending CN1641588A (en) | 2004-01-08 | 2004-01-08 | Method for transmitting events between Java assemblies |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN1641588A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101963900A (en) * | 2009-07-23 | 2011-02-02 | 北京数码大方科技有限公司 | Behavior propagation control method of UI (User Interface) layer |
CN102654831A (en) * | 2011-03-04 | 2012-09-05 | 百度在线网络技术(北京)有限公司 | Device and method for intensively controlling WEB page event and state |
-
2004
- 2004-01-08 CN CN 200410001424 patent/CN1641588A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101963900A (en) * | 2009-07-23 | 2011-02-02 | 北京数码大方科技有限公司 | Behavior propagation control method of UI (User Interface) layer |
CN101963900B (en) * | 2009-07-23 | 2013-10-16 | 北京数码大方科技股份有限公司 | Behavior propagation control method of UI (User Interface) layer |
CN102654831A (en) * | 2011-03-04 | 2012-09-05 | 百度在线网络技术(北京)有限公司 | Device and method for intensively controlling WEB page event and state |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7992155B2 (en) | Method and system to correlate and consolidate a plurality of events | |
Bosco et al. | Discovering automatable routines from user interaction logs | |
Gurgen et al. | SStreaMWare: a service oriented middleware for heterogeneous sensor data management | |
US20210056073A1 (en) | Block data storage system in an event historian | |
CN1728708A (en) | Method and system for managing electronic systems | |
CN1269030A (en) | Method and apparatus for automated network surveillance and security breanch intervention | |
CN1412978A (en) | Supervisory assigned control component for entering module into digital data network and its control method | |
CN1929488A (en) | Method and device for operation in multiple pages based on server paging | |
CN104850407A (en) | Desktop screen capture system and method | |
CN112749153B (en) | Industrial network data management system | |
CN116107846B (en) | Linux system event monitoring method and device based on EBPF | |
CN109753819B (en) | Method and device for processing access control policy | |
CN110515821A (en) | Based on the event-handling method, electronic equipment and computer storage medium buried a little | |
CN108073720A (en) | Data quality management system and method applied to big data system | |
CN111813774B (en) | Method for monitoring and acquiring traceability information based on sysdig system | |
CN114116172A (en) | Flow data acquisition method, device, equipment and storage medium | |
US20160170838A1 (en) | Event data merge system in an event historian | |
CN1641588A (en) | Method for transmitting events between Java assemblies | |
CN116932614B (en) | Distributed searching method and system oriented to digital networking | |
CA2571490A1 (en) | Functional operations for accessing and/or building interlocking trees datastores to enable their use with applications software | |
CN111866254A (en) | Speed dialing system for intelligently identifying word stroke and implementation method thereof | |
CN106897438A (en) | A kind of apparatus and method of data processing, a kind of computer-readable recording medium and storage control | |
CN113918428B (en) | Topological structure detection method, device, equipment and storage medium | |
Kamoun et al. | Goal-Oriented Feature Interaction Detection in the Intelligent Network Model. | |
Gal | Semantic interoperability in information services: Experiencing with CoopWARE |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C02 | Deemed withdrawal of patent application after publication (patent law 2001) | ||
WD01 | Invention patent application deemed withdrawn after publication |