Focus element navigation method in human-computer interface
Technical field
The present invention relates to computer software fields, relate to specifically a kind of focus element navigation method in human-computer interface.
Background technology
Human-computer interaction technology (Human-Computer Interaction Techniques) refers to realize the technology of people and computer dialog in effective mode by computer input, output device.It comprises that machine provides to the people by output or display device and reaches for information about in a large number prompting and ask for instructions etc., and input reaches prompting and asks for instructions, answers a question etc. the people for information about to machine by input equipment.Human-computer interaction technology is one of important content in the computer user interface design.The ambits such as it and cognitive science, ergonomics, psychology have close contacting.
man-machine interface MMI:Man-Machine Interface or man-machine interaction interface (Human-Computer Interface or Human-Machine Interface) are used in industry in a large number with commercial, simply divide into " input " (Input) with " output " (Ouput) two kinds, input refers to the operation of being carried out machinery or equipment by the people, as handle, switch, door, assigning or maintenance etc. of instruction (order), and output refers to the notice that is sent by machinery or equipment, as fault, warning, operation instructions prompting etc., good man-machine interface meeting helps the user simpler, more accurate, operate machine more rapidly, also can make the maximum usefulness of machinery performance and increase the service life, the man-machine interface of built-in field indication the finger of many narrow senses on the operation-interface of software hommization.
In built-in field, emerging in multitude of smart machine, man-machine interaction is further frequent, in embedded platform, resource is very limited, and therefore a kind of people's of meeting use habit and air navigation aid rapidly and efficiently must be arranged, in traditional focus element navigation technology, the size of element is generally fixed size, and the position of a plurality of elements is regularly arranged, and if run into inconsistent or its positional alignment of element size and will take a large amount of system resources when irregular.
Summary of the invention
Technical matters to be solved by this invention is: provide a kind of focus element navigation method in human-computer interface, the large problem of occupying system resources when solving the conventional art navigation.
The present invention solves the problems of the technologies described above the technical scheme that adopts: focus element navigation method in human-computer interface comprises the following steps:
A. for the coordinate of the position of element and the high wide data of element, set up data structure;
B. travel through all and can accept focus element, will obtain the coordinate of each element and high wide data stuffing in data structure, and set up element administration queue object;
C. when navigation event arrives, determine the set of effective cutting element that can navigate, and judge whether this set is sky, be execution in step d, otherwise execution in step e;
D. the focus element after the current focus element being triggered as navigation event turns step f;
E. seek the focus element the shortest with current focus element distance on navigation direction, the focus element after it is triggered as navigation event turns step f;
F. the focus element after obtaining to navigate.
In described step c, the method of definite effective cutting element set that can navigate is: from the current focus element, from horizontal or vertical navigation direction, draw two tangent lines, horizontal tangent and current focus element top or lowermost end are tangent, vertical tangent line and current focus element high order end or low order end are tangent, and tangential direction is navigation direction, and other element that tangent line cuts to is namely effectively to cut element.
The invention has the beneficial effects as follows: occupying system resources is little, focus navigation efficient is high, is widely used in various embedded devices.
Description of drawings
Fig. 1 is the embodiments of the invention method flow diagram.
Embodiment
The invention will be further described below in conjunction with drawings and Examples.
The invention provides a kind of focus element navigation method in human-computer interface, the large problem of occupying system resources when solving the conventional art navigation can be switched each focus element fast in the situation that do not increase the system resource occupancy, also meets people's use habit.Its technical scheme comprises: a. sets up data structure for the high wide data of coordinate and the element of the position of element; B. travel through all and can accept focus element, will obtain the coordinate of each element and high wide data stuffing in data structure, and set up element administration queue object; C. when navigation event arrives, determine the set of effective cutting element that can navigate, and judge whether this set is sky, be execution in step d, otherwise execution in step e; D. the focus element after the current focus element being triggered as navigation event returns to step c; E. seek and current focus element the shortest focus element on navigation direction, the focus element after it is triggered as navigation event returns to step c.
Embodiment:
As shown in Figure 1, the focus element navigation method in human-computer interface in this example, realize according to the following steps:
(1) set up data structure: for coordinate and the high wide data of element, set up and safeguard element coordinate and high wide data structure;
(2) padding data structure and set up element administration queue object: travel through all and can accept focus element, will obtain the coordinate of each element and high wide data stuffing in data structure, and set up element administration queue object;
(3) wait for that navigation event triggers;
(4) rreturn value being set is the current focus element: after the focus navigation event is triggered, enter treatment scheme, the final rreturn value for the treatment of scheme is exactly the result after navigation event, and at first rreturn value is set is the current focus element;
(5) determine effectively cutting element set: (be namely from the current focus element according to the principle of mutual cutting, from horizontal or vertical navigation direction, draw two tangent lines, horizontal tangent and focus element top or lowermost end are tangent, vertical tangent line and focus element high order end or low order end are tangent, tangential direction is navigation direction, and other element that tangent line cuts to is namely effectively to cut element) definite effective cutting element set that can navigate;
(6) whether the effective cutting of judgement element is empty, for sky just turns step (7), is not idle running step (8);
(7) be sky as obtaining element cutting element set, the current focus element is the focus element after triggering, records it;
(8) be not empty as the effective cutting element set that obtains, basis and the focus element of current focus element after on navigation direction, the shortest principle of distance is determined the navigation event triggering, record it;
(9) focus element after the acquisition navigation.