CN105630468B - Focal point moving method and device of UI (user interface) frame - Google Patents

Focal point moving method and device of UI (user interface) frame Download PDF

Info

Publication number
CN105630468B
CN105630468B CN201410605898.5A CN201410605898A CN105630468B CN 105630468 B CN105630468 B CN 105630468B CN 201410605898 A CN201410605898 A CN 201410605898A CN 105630468 B CN105630468 B CN 105630468B
Authority
CN
China
Prior art keywords
focus
self
window
frame
drawing window
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.)
Active
Application number
CN201410605898.5A
Other languages
Chinese (zh)
Other versions
CN105630468A (en
Inventor
韩炼
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201410605898.5A priority Critical patent/CN105630468B/en
Publication of CN105630468A publication Critical patent/CN105630468A/en
Application granted granted Critical
Publication of CN105630468B publication Critical patent/CN105630468B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses a focus moving method of a UI frame, which comprises the following steps: detecting a focus moving request; acquiring all self-drawing windows capable of acquiring focuses in a view of a system UI frame; performing coordinate conversion on the coordinates of the self-drawing window by taking the coordinate system of the view of the system UI frame as a reference system; according to a preset calculation rule, determining a self-drawing window of the next focus from all self-drawing windows which can obtain the focus in the view of the system UI frame; and setting the self-drawing window of the determined next focus to be in a focus state. The invention also discloses a focus moving device of the UI framework. The invention not only can realize the focus movement between the self-drawing controls in the self-drawing UI frame, but also can realize the focus movement between the system UI frame and the self-drawing frame.

Description

Focal point moving method and device of UI (user interface) frame
Technical Field
The invention relates to the technical field of internet, in particular to a focus moving method and device of a UI (user interface) frame.
Background
The UI framework is a set of computer user interface programming libraries that allow programmers to draw specific graphical user interfaces by providing a series of data structures and methods. On the UI framework provided by the platform, the solution for the application developer to implement the rendering of the graphical user interface is called a self-drawing UI framework.
However, in the UI framework provided by the platform in the related art, although the self-drawing UI framework can provide the focus display function, it is not possible to move the focus between the self-drawing frameworks.
Disclosure of Invention
The main purpose of the embodiments of the present invention is to solve the technical problem that the existing UI framework does not support the movement of the focus in the self-drawing framework.
In order to achieve the above object, an embodiment of the present invention provides a method for moving a focus of a UI frame, including the following steps:
when a focus moving request is detected, acquiring all self-drawing windows capable of acquiring a focus in a view of a system UI frame;
performing coordinate conversion on the coordinates of the self-drawing window by taking the coordinate system of the view of the system UI frame as a reference system;
according to a preset calculation rule, determining a self-drawing window of the next focus from all self-drawing windows which can obtain the focus in the view of the system UI frame;
and setting the self-drawing window of the next focus to be in a focus state.
In addition, to achieve the above object, an embodiment of the present invention further provides a focus moving apparatus of a UI frame, including:
a request detection module for detecting a focus movement request;
the system comprises a self-drawing window acquisition module, a focus movement request acquisition module and a focus movement control module, wherein the self-drawing window acquisition module is used for acquiring all self-drawing windows capable of acquiring focuses in a view of a system UI frame when the focus movement request is detected;
the coordinate conversion module is used for carrying out coordinate conversion on the coordinates of the self-drawing window by using a coordinate system of a view of a system UI frame as a reference system;
the system comprises a focus self-drawing window determining module, a focus self-drawing window determining module and a focus self-drawing window determining module, wherein the focus self-drawing window determining module is used for determining a self-drawing window of a next focus from all self-drawing windows capable of obtaining the focus in a view of a system UI frame according to a preset calculation rule;
and the focus self-drawing window setting module is used for setting the self-drawing window of the next focus to be in a focus state.
In the embodiment of the invention, when the focus is required to move, the next focus acquirer is determined from the self-drawing window which can acquire the focus in the system view for acquiring the focus according to the preset rule, so that the focus movement among the self-drawing controls in the self-drawing UI frame is realized.
Drawings
FIG. 1 is a diagram illustrating an example of the relationship between a system UI framework and a self-drawing UI framework of the present invention;
FIG. 2 is a diagram of a hardware architecture of a terminal in which the UI framework of the present invention operates;
FIG. 3 is a functional block diagram of a first embodiment of a focus-shifting apparatus of the UI framework of the present invention;
FIG. 4 is an exemplary diagram of a direction key for triggering focus movement according to the present invention;
FIG. 5 is a diagram illustrating an example of transforming coordinates of a self-drawing window according to the present invention with a coordinate system of a system view as a reference system;
FIG. 6 is a functional block diagram of a focus drawing window obtaining module of the focus moving apparatus of the UI frame according to a first embodiment of the present invention;
FIG. 7 is an exemplary diagram of calculating a distance between a freeform window to be determined and a focus window according to the present invention;
FIG. 8 is a functional block diagram of a focus drawing window obtaining module of a focus moving apparatus of a UI frame according to a second embodiment of the present invention;
FIG. 9 is a diagram illustrating an exemplary calculation of a primary distance and a secondary distance between a self-drawing window to be determined and a focus window in a focus moving apparatus of a UI frame according to the present invention;
FIG. 10 is a flowchart illustrating a focus shifting method of the UI framework according to a first embodiment of the present invention;
FIG. 11 is a flowchart illustrating a detailed process of a first embodiment of obtaining a next focus from a self-drawing window in the focus moving method of the UI framework according to the present invention;
FIG. 12 is a flowchart illustrating a detailed process of a second embodiment of obtaining a next focus point in the focus moving method of the UI framework according to the present invention;
fig. 13 is a flowchart illustrating a focus moving method of the UI framework according to a second embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
The technical scheme of the invention is further explained by combining the drawings and the specific embodiments in the specification. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The core idea of the invention is that when the focus is required to move, according to the preset rule, the next focus acquirer is determined from the self-drawing window which can obtain the focus from the system view of the obtained focus, therefore, the invention not only realizes the focus movement between the self-drawing controls in the self-drawing UI frame, but also realizes the focus movement between the system UI frame and the self-drawing frame.
As shown in FIG. 1, the UI framework is a library of computer user interface programming that allows a programmer to draw a specific graphical user interface by providing a set of data structures and methods. On the UI framework provided by the platform, the solution for the application developer to implement the rendering of the graphical user interface is called a self-drawing UI framework. The UI framework provided by the platform is a system UI framework, such as Android and the like. The view of the system UI frame is a system view, the view of the self-drawing UI frame is a self-drawing window, and the self-drawing window is drawn in a drawing area of the system view. The self-drawing window can draw self-drawing controls, such as a self-drawing control 1 and a self-drawing control 2 in the self-drawing window B. In the system UI framework, if the focus is moved by pressing a key, the current focus window is the active window, and the input event of the keyboard is preferentially given to the current system view for response. Therefore, when the button is moved to the self-drawing control 1 and the self-drawing control 2 and the two controls can be switched, the button must be moved to the self-drawing control 1 and the self-drawing control 2.
The UI framework may be operated in a terminal in which the platform system is installed, and the terminal may include a PC terminal, a mobile phone, an ipad, a tablet computer, a palmtop computer, and the like, and the system of the terminal must support drawing of the UI framework. As shown in fig. 2, the terminal may include a processor 101, a memory 102, a user access module 103, a communication module 104, and a communication bus 105. The user access module 103 may include a user interface and a display screen. The user interface may include a keyboard, a mouse, a touch screen, and other components, and is configured to receive information input by a user and send the received information to the processor 101 for processing. The display screen can be an LCD display screen or an LED display screen, and is used for displaying data required to be displayed by the electronic device, such as an electronic book. It can be understood that the user interface and the display screen can be combined by a touch display screen, so that the purposes of receiving the input information of the user and displaying can be achieved. The communication bus 105 is used for communication between the respective constituent elements in the terminal. The communication module 104 is used for realizing mutual communication between the terminal and external devices, such as a PC terminal, other servers, and the like, and the communication module 104 may include an RS232 module, a radio frequency module, a WIFI module, and the like. Memory 102 may include one or more computer-readable storage media, and includes not only internal memory, but also external memory. The memory 102 stores therein an operating system, a focus moving means of the UI framework, and the like. The processor 101 invokes the focus movement means and other components of the UI frame in memory 102 to implement, among other things, focus movement between the sketch controls within the sketch UI frame and focus movement between the system UI frame and the sketch frame.
As shown in fig. 3, a first embodiment of the focus-shifting apparatus of the UI framework of the present invention is shown. The focus moving means of the UI framework of this embodiment may include:
a request detection module 110, configured to detect a focus movement request;
a self-drawing window obtaining module 120, configured to obtain all self-drawing windows capable of obtaining a focus in a view of a system UI frame when a focus moving request is detected;
a coordinate transformation module 130, configured to perform coordinate transformation on the coordinates of the self-drawing window by using a coordinate system of a view of a system UI frame as a reference system;
a focus self-drawing window obtaining module 140, configured to determine a self-drawing window of a next focus from all self-drawing windows in which focuses can be obtained in the view of the system UI frame according to a preset calculation rule;
and a focus self-drawing window setting module 150, configured to set the self-drawing window of the determined next focus to a focus state.
The focus movement request is triggered by a user via a user interface, such as a keyboard input. As shown in fig. 4, the keypad keys responding to the focus movement are four direction keys. When the user interface receives a key operation of a user, the key operation is sent to the processor 101, and when the processor 101 receives the key operation, a direction key event is generated, and then the generated direction key event is sent to the system view currently obtaining the focus. The system view generates a focus moving request according to the direction key event. The request detection module 110 is used for detecting a focus movement request. When the focus moving request is detected, the freeway acquisition module 120 queries all freeway windows in the current system view, and then collects the freeway windows whose view attributes of the freeway controls in the freeway windows are true, and uses the freeway windows as a candidate freeway window pool. When the obtainable focus attribute of the self-drawing control is true, the view of the self-drawing control can obtain a focus; when the available focus attribute of the self-drawing control is false, the view representing the self-drawing control cannot obtain focus.
The coordinate transformation module 130 will coordinate-transform the coordinates of all the freehand windows in the pool of candidate freehand windows with the coordinate system of the view of the system UI frame as the reference frame to determine the freehand window for the next focus. As shown in fig. 5, if the coordinate system of the system view is a two-dimensional coordinate system with the bottom left corner of the system view as the origin, the coordinate systems of all the drawing windows in the candidate drawing window pool are calculated to perform coordinate transformation with the coordinate system of the system view as the reference system. The coordinate refers to a data structure composed of rectangular coordinates, and comprises four fields: left, top, right and bottom correspond to four coordinate values of two points at the upper left corner and the lower right corner of the rectangular area respectively. If the candidate self-drawing window pool comprises the self-drawing window A and the self-drawing window B, converting the coordinates of the self-drawing window A and the self-drawing window B according to a coordinate system of the system view to obtain the converted coordinates (Xa1, Ya1, Xa2 and Ya2) of the self-drawing window A and the converted coordinates (Xb1, Yb1, Xb2 and Yb2) of the self-drawing window B.
The calculation rules preset in the focus sketch window obtaining module 140 may include a plurality of calculation rules, and may also be flexibly set according to a specific application scenario. For example, in the embodiment of the present invention, the preset calculation rule is to obtain the auto-drawing window closest to the auto-drawing window where the current focus is located in the focus moving direction in the focus moving request, and use the auto-drawing window as the auto-drawing window of the next focus, that is, the next focus window responding to the key moving operation. The focus state is to provide a display function of the self-drawing window, that is, the self-drawing window in the focus state is to be activated and displayed in the drawing area of the UI frame. Therefore, when the self-drawing window is set to be in the focus state, the self-drawing window obtains the focus and displays the focus, and the focus movement between the self-drawing windows in the system view can be realized.
It should be noted that, when the system view obtains a focus, the self-drawing window of the next focus in the current system view is determined according to the above steps, and is set to the focus state. When the system view loses focus, the self-drawing window of which the system view has obtained focus is cancelled. Therefore, focus movement between the system UI framework and the self-drawing UI framework can also be realized by the steps.
In the embodiment of the invention, when the focus is required to move, the next focus acquirer is determined from the self-drawing window which can acquire the focus in the system view for acquiring the focus according to the preset rule, so that the invention not only can realize the focus movement between the self-drawing controls in the self-drawing UI frame, but also can realize the focus movement between the system UI frame and the self-drawing UI frame.
Further, as shown in fig. 6, the focus self-plotting window obtaining module 140 includes:
a focus movement direction acquisition unit 141 configured to acquire a focus movement direction corresponding to the focus movement request;
a distance calculating unit 142, configured to calculate a distance between the self-drawing window in the focus moving direction and the self-drawing window currently in the focus state;
and the distance comparing unit 143 is configured to use the self-drawing window with the smallest distance as the self-drawing window of the next focus.
When the focus movement request is detected, the focus movement direction obtaining unit 141 obtains the focus movement direction corresponding to the focus movement request, for example, in the focus movement request triggered by the direction key, the focus movement direction may be up, down, left, and right. The distance calculation unit 142 then acquires the free-drawing window in the focus movement direction, and calculates the distance between the free-drawing window and the free-drawing window currently in the focus state. The self-drawing window in the focus state is a focus window. The manner of calculating the distance between the freehand window and the focus window may include a variety of ways. In one example, as shown in fig. 7, the coordinates of the center points of the rectangles of the self-drawing window a and the focus window are obtained, and then the distance S1 between the coordinates of the center points of the two windows is calculated as the distance between the self-drawing window and the focus window. In another example, the closest vertex coordinate between the freehand window a and the focus window is obtained, and then the distance between the two vertex coordinates is calculated as the distance between the freehand window and the focus window.
The method for judging the self-drawing window in the moving direction of the focus comprises the following steps: and if the moving direction of the focus is right, judging that the self-drawing window is the self-drawing window in the moving direction of the focus when the left coordinate of the self-drawing window in the candidate self-drawing window pool is larger than the left coordinate of the focus window.
Further, as shown in fig. 8, the focus self-plotting window obtaining module 140 includes:
a focus movement direction acquisition unit 144 configured to acquire a focus movement direction corresponding to the focus movement request;
a distance calculating unit 145, configured to calculate a primary distance and a secondary distance between the self-drawing window currently in the focus and the self-drawing window to be determined according to the focus moving direction;
a distance weight value calculating unit 146, configured to perform weighted calculation on the primary distance and the secondary distance to obtain a distance weight value of the self-drawing window to be determined;
and a distance weight value comparing unit 147, configured to compare the distance weight values of all the self-drawing windows, and use the self-drawing window with the smallest distance weight value as the self-drawing window of the next focus.
As shown in fig. 9, in the distance calculation unit 145, if the focus movement direction is left or right, it is desirable that the focus is moved horizontally. Then, the distance in the horizontal direction between the focus window and the self-drawing window to be judged is recorded as the primary distance, and the distance in the vertical direction is recorded as the secondary distance. If the focus movement direction is up or down, it is desirable that the focus moves up and down. Then, the distance in the vertical direction between the focus window and the self-drawing window to be judged is recorded as the primary distance, and the distance in the horizontal direction is recorded as the secondary distance.
The distance weight value calculating unit 146 performs weighted calculation on the primary distance and the secondary distance of the to-be-determined self-drawing window obtained in the distance calculating unit 145, for example, a distance weight calculation formula in this embodiment is as follows:
testRectScore=13*majorDistance*majorDistance+minorDistance*minorDistance
wherein, majorDistance is the primary distance, and minorDistance is the secondary distance.
Of course, other weight calculation formulas may be provided besides the above weight calculation formulas, which is not exemplified herein.
Then, the distance weight value comparing unit 147 compares the distance weight values of all the self-drawing windows to be judged, and takes the self-drawing window to be judged with the smallest weight value as the self-drawing window of the next focus.
In the above determining process, after calculating the distance weight value of a to-be-determined self-drawing window, the distance weight value of the to-be-determined self-drawing window is compared with the current self-drawing window at the focus, so as to update the self-drawing window at the next focus. And obtaining the final self-drawing window of the next focus until all the self-drawing windows to be judged in the candidate self-drawing window pool are judged.
Further, the focus sketch window setting module 150 is configured to set, according to the focus movement request, a coordinate corresponding to a focus movement direction in a view of a preset system UI frame as a coordinate of the current focus sketch window in the focus state if the current focus sketch window in the focus state is empty.
When it is detected that the user moves the focus through the key for the first time, since no self-drawing window is in the focus state at present, the coordinates of the focus window need to be initialized according to the movement direction of the focus. The method specifically comprises the following steps: when the key is right or down, initializing the coordinate of the focus window by using the coordinate of the upper left corner of the system view; when the key is up or left, the coordinates of the focus window are initialized with the coordinates of the lower right corner of the system view.
Correspondingly, as shown in fig. 10, a focus moving method of a UI framework of the present invention is shown. The focus moving method of the UI frame includes the steps of:
step S110, detecting a focus moving request;
step S120, when a focus moving request is detected, acquiring all self-drawing windows capable of acquiring the focus in the view of the system UI frame;
step S130, converting the coordinates of the self-drawing window by taking the coordinate system of the view of the system UI frame as a reference system;
step S140, according to a preset calculation rule, determining a self-drawing window of a next focus from all self-drawing windows which can obtain the focus in the view of the system UI frame;
and S150, setting the self-drawing window of the next focus to be in a focus state.
The focus movement request is triggered by a user through a user interface, such as a keyboard input, i.e., the keys of the keyboard in response to the focus movement are four directional keys. When a focus moving request is detected, all the self-drawing windows in the current system view are inquired, and then the self-drawing windows with the view attribute of the self-drawing control in the self-drawing windows being true are collected to serve as a candidate self-drawing window pool. When the view attribute of the self-drawing control is true, the view of the self-drawing control can obtain a focus; when the view attribute of the self-drawing control is false, the view representing the self-drawing control cannot obtain the focus. Then, the coordinates of all the self-drawing windows in the candidate self-drawing window pool are subjected to coordinate conversion by taking the coordinate system of the system view as a reference system so as to determine the self-drawing window of the next focus.
The preset calculation rule may include a plurality of calculation rules, and may also be flexibly set according to a specific application scenario. For example, in the embodiment of the present invention, the preset calculation rule is to obtain the auto-drawing window closest to the auto-drawing window where the current focus is located in the focus moving direction in the focus moving request, and use the auto-drawing window as the auto-drawing window of the next focus, that is, the next focus window responding to the key moving operation. Thus, the present invention enables focus movement between self-drawing windows within a system view.
It should be noted that, when the system view obtains a focus, the self-drawing window of the next focus in the current system view is determined according to the above steps, and is set to the focus state. When the system view loses focus, the self-drawing window of which the system view has obtained focus is cancelled. Therefore, focus movement between the system UI framework and the self-drawing UI framework can also be realized by the steps.
In the embodiment of the invention, when the focus is required to move, the next focus acquirer is determined from the self-drawing window which can acquire the focus in the system view for acquiring the focus according to the preset rule, so that the focus movement between the self-drawing controls in the self-drawing UI frame is realized, and the focus movement between the system UI frame and the self-drawing UI frame is also realized.
Further, as shown in fig. 11, the step S140 may include:
step S141, acquiring a focus moving direction corresponding to the focus moving request;
step S142, calculating the distance between the self-drawing window in the focus moving direction and the self-drawing window in the focus state at present;
and step S143, taking the self-drawing window with the minimum distance as the self-drawing window of the next focus.
When the focus moving request is detected, the focus moving direction corresponding to the focus moving request is obtained. And then acquiring a self-drawing window in the moving direction of the focus, and calculating the distance between the self-drawing window and the self-drawing window in the focus state at present. The self-drawing window in the focus state is a focus window. The manner of calculating the distance between the freehand window and the focus window may include a variety of ways. In one example, rectangular center point coordinates of a self-drawing window and a focus window to be judged are obtained, and then the distance between the center point coordinates of the two windows is calculated and used as the distance between the self-drawing window and the focus window. In another example, the closest vertex coordinate between the self-drawing window to be determined and the focus window is obtained first, and then the distance between the two vertex coordinates is calculated as the distance between the self-drawing window and the focus window.
Further, as shown in fig. 12, the step S140 may include:
step S144, acquiring a focus moving direction corresponding to the focus moving request;
step S145, calculating a main distance and a secondary distance between the self-drawing window at the focus and the self-drawing window to be judged according to the movement direction of the focus;
step S146, carrying out weighted calculation on the main distance and the secondary distance to obtain a distance weight value of the self-drawing window to be judged;
step S147, comparing the distance weight value of the self-drawing window at the focus currently with the distance weight value of the self-drawing window to be judged, and taking the self-drawing window with the minimum distance weight value as the self-drawing window of the next focus;
step S148, whether the self-drawing window to be judged is all the self-drawing windows in the candidate self-drawing windows or not is judged; if yes, go to step S149, otherwise return to step S145;
step S149, using the self-drawing window of the last obtained next focus as the final self-drawing window of the next focus.
In the above step S145, if the focus moving direction is left or right, the focus is expected to move horizontally. Then, the distance in the horizontal direction between the focus window and the self-drawing window to be judged is recorded as the primary distance, and the distance in the vertical direction is recorded as the secondary distance. If the focus movement direction is up or down, it is desirable that the focus moves up and down. Then, the distance in the vertical direction between the focus window and the self-drawing window to be judged is recorded as the primary distance, and the distance in the horizontal direction is recorded as the secondary distance.
Then, the obtained main distance and the sub distance of the self-drawing window to be judged are weighted, for example, a distance weight calculation formula in this embodiment is as follows:
testRectScore=13*majorDistance*majorDistance+minorDistance*minorDistance
wherein, majorDistance is the primary distance, and minorDistance is the secondary distance.
Of course, other weight calculation formulas may be provided besides the above weight calculation formulas, which is not exemplified herein.
And finally, comparing the distance weighted values of all the self-drawing windows to be judged, and taking the self-drawing window to be judged with the minimum weighted value as the self-drawing window of the next focus.
Further, as shown in fig. 13, the step S140 may further include, before:
and step S160, if the self-drawing window in the focus state is empty, setting the coordinates corresponding to the focus moving direction in the view of the preset system UI frame as the coordinates of the self-drawing window in the focus state according to the focus moving request.
When it is detected that the user moves the focus through the key for the first time, since no self-drawing window is in the focus state at present, the coordinates of the focus window need to be initialized according to the movement direction of the focus. The method specifically comprises the following steps: when the key is right or down, initializing the coordinate of the focus window by using the coordinate of the upper left corner of the system view; when the key is up or left, the coordinates of the focus window are initialized with the coordinates of the lower right corner of the system view.
The above description is only for the preferred embodiment of the present invention and is not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes that can be directly or indirectly applied to other related technical fields using the contents of the present specification and the accompanying drawings are included in the scope of the present invention.

Claims (6)

1. A focus moving method of a UI frame is characterized in that a view of the system UI frame is a system view, a view of a self-drawing UI frame is a self-drawing window, the self-drawing window is drawn in a drawing area of the system view, if a focus is moved through a key in the system UI frame, an input event is preferentially given to a current system view to respond, and the focus moving method of the UI frame comprises the following steps:
when a system view obtains a focus, and a focus moving request is detected, acquiring all self-drawing windows capable of obtaining the focus in the view of a system UI frame;
performing coordinate conversion on the coordinates of the self-drawing window by taking the coordinate system of the view of the system UI frame as a reference system;
according to a preset calculation rule, determining a self-drawing window of the next focus from all self-drawing windows of which the focus can be obtained in the view of the system UI frame, wherein the self-drawing window of the next focus comprises the following steps: step S1, acquiring the focus moving direction corresponding to the focus moving request; step S2, calculating a main distance and a secondary distance between the self-drawing window which is at the focus currently and the self-drawing window to be judged according to the movement direction of the focus; step S3, carrying out weighted calculation on the primary distance and the secondary distance to obtain a distance weight value of the self-drawing window to be judged; step S4, comparing the distance weight value of the self-drawing window at the focus currently with the distance weight value of the self-drawing window to be judged, and taking the self-drawing window with the minimum distance weight value as the self-drawing window of the next focus; circularly executing the step S2 to the step S4 until all the self-drawing windows to which the self-drawing controls which can obtain the focus belong are judged to be finished;
setting the determined self-drawing window of the next focus to be in a focus state, activating the self-drawing window in the focus state, and displaying the self-drawing window in the drawing area of the UI frame to realize focus movement between the system UI frame and the self-drawing UI frame and focus movement between the self-drawing windows in the view of the system UI frame;
when the system view loses focus, canceling the focus state of the self-drawing window of which the system view has obtained focus;
wherein, according to a preset calculation rule, determining, from all the self-drawing windows in which a focus can be obtained in the view of the system UI frame, that a self-drawing window for obtaining a next focus is obtained further includes:
if the self-drawing window in the focus state is empty, setting coordinates corresponding to the focus moving direction in a preset system as the coordinates of the self-drawing window in the focus state according to the focus moving request, and initializing the coordinates of the focus window;
wherein, acquiring all the self-drawing windows capable of acquiring the focus in the view of the system UI framework comprises:
and acquiring the self-drawing windows of the self-drawing controls of which the acquirable focus attributes are true in the view of the system UI frame to serve as a candidate self-drawing window pool.
2. The method for moving the focus of the UI frame according to claim 1, wherein the determining the self-drawing window of the next focus from all the self-drawing windows in which the focus is available within the view of the system UI frame according to the preset calculation rule comprises:
acquiring a focus moving direction corresponding to the focus moving request;
calculating the distance between the self-drawing window in the focus moving direction and the self-drawing window in the focus state at present;
and taking the self-drawing window with the minimum distance as the self-drawing window of the next focus.
3. A focus moving apparatus of a UI frame, wherein a view of a system UI frame is a system view, a view of a self-drawing UI frame is a self-drawing window, the self-drawing window is drawn in a drawing area of the system view, an input event is preferentially responded by a current system view if a focus is moved by a key in the system UI frame, the focus moving apparatus of the UI frame comprises:
the request detection module is used for detecting a focus movement request when the system view obtains a focus;
the system comprises a self-drawing window acquisition module, a focus movement request acquisition module and a focus movement control module, wherein the self-drawing window acquisition module is used for acquiring all self-drawing windows capable of acquiring focuses in a view of a system UI frame when the focus movement request is detected;
the coordinate conversion module is used for carrying out coordinate conversion on the coordinates of the self-drawing window by using a coordinate system of a view of a system UI frame as a reference system;
the system comprises a focus self-drawing window determining module, a focus self-drawing window determining module and a focus self-drawing window determining module, wherein the focus self-drawing window determining module is used for determining a self-drawing window of a next focus from all self-drawing windows capable of obtaining the focus in a view of a system UI frame according to a preset calculation rule;
the focus self-drawing window setting module is used for setting the self-drawing window of the next focus to be in a focus state, activating the self-drawing window in the focus state, and displaying the activated self-drawing window in the drawing area of the UI frame so as to realize focus movement between the system UI frame and the self-drawing UI frame and realize focus movement between the self-drawing windows in the view of the system UI frame;
the focus moving device of the UI frame is used for canceling the focus state of the self-drawing window of which the system view has obtained the focus when the system view loses the focus;
wherein the focus moving apparatus of the UI frame further comprises:
the focus self-drawing window setting module is used for setting a coordinate corresponding to a focus moving direction in a view of a preset system UI frame as a coordinate of the self-drawing window in the focus state according to the focus moving request and initializing the coordinate of the focus window if the self-drawing window in the focus state is empty;
wherein, the self-drawing window acquisition module comprises:
acquiring the self-drawing windows of the self-drawing controls of which the acquirable focus attributes are true in the UI frame view of the system, and taking the self-drawing windows as a candidate self-drawing window pool;
the focus autograph window acquisition module comprises:
a focus movement direction acquisition unit for acquiring a focus movement direction corresponding to the focus movement request;
the distance calculation unit is used for calculating a main distance and a secondary distance between the self-drawing window which is at the focus currently and the self-drawing window to be judged according to the movement direction of the focus;
the distance weight value calculation unit is used for carrying out weighted calculation on the primary distance and the secondary distance to obtain a distance weight value of the self-drawing window to be judged;
the distance weight value comparison unit is used for comparing the distance weight values of all the self-drawing windows and taking the self-drawing window with the minimum distance weight value as the self-drawing window of the next focus;
and the circulation control unit is used for circularly executing the judgment of the self-drawing window to be judged until all the self-drawing windows to which the self-drawing controls capable of obtaining the focus belong are judged to be finished.
4. The focus moving apparatus of the UI framework of claim 3, wherein the focus autoplotting window determination module comprises:
a focus movement direction acquisition unit for acquiring a focus movement direction corresponding to the focus movement request;
the distance calculation unit is used for calculating the distance between the self-drawing window in the focus moving direction and the self-drawing window in the focus state at present;
and the distance comparison unit is used for taking the self-drawing window with the minimum distance as the self-drawing window of the next focus.
5. A terminal, comprising: a processor and a memory;
wherein the processor is configured to execute a computer program stored in the memory;
the memory is for storing a computer program for executing the focus moving method of the UI framework of any of claims 1-2.
6. A storage medium characterized in that a computer program for executing the focus moving method of the UI framework of any one of claims 1-2 is stored in the storage medium.
CN201410605898.5A 2014-10-30 2014-10-30 Focal point moving method and device of UI (user interface) frame Active CN105630468B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410605898.5A CN105630468B (en) 2014-10-30 2014-10-30 Focal point moving method and device of UI (user interface) frame

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410605898.5A CN105630468B (en) 2014-10-30 2014-10-30 Focal point moving method and device of UI (user interface) frame

Publications (2)

Publication Number Publication Date
CN105630468A CN105630468A (en) 2016-06-01
CN105630468B true CN105630468B (en) 2020-05-05

Family

ID=56045460

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410605898.5A Active CN105630468B (en) 2014-10-30 2014-10-30 Focal point moving method and device of UI (user interface) frame

Country Status (1)

Country Link
CN (1) CN105630468B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106454476A (en) * 2016-05-31 2017-02-22 乐视控股(北京)有限公司 Configuration method and configuration device for focus order in graphical user interface
CN106998489B (en) * 2017-03-30 2018-07-06 武汉斗鱼网络科技有限公司 A kind of focus is crossed the border searching method and device
CN109104628B (en) * 2017-06-21 2020-12-15 武汉斗鱼网络科技有限公司 Focus foreground generation method, storage medium, device and system of android television
CN110286973B (en) * 2019-05-14 2022-10-04 深圳康佳电子科技有限公司 Key triggering event processing method, intelligent terminal and storage medium
CN112148157B (en) * 2019-06-28 2022-07-01 杭州海康威视数字技术股份有限公司 Focus moving method and focus moving apparatus for graphic user interface
CN112068742A (en) * 2020-04-28 2020-12-11 北京字节跳动网络技术有限公司 Method, device, terminal and storage medium for controlling application window

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101086696A (en) * 2007-06-27 2007-12-12 中兴通讯股份有限公司 Interface focus object selection method
CN102609521A (en) * 2012-02-10 2012-07-25 深圳创维数字技术股份有限公司 Webpage focus element switching method and digital television receiving terminal
CN103916710A (en) * 2014-03-31 2014-07-09 优视科技有限公司 Focal point switching method and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6976216B1 (en) * 2000-11-17 2005-12-13 Streamzap, Inc. Computer system with remote key press events directed to a first application program and local key press events directed to a second application program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101086696A (en) * 2007-06-27 2007-12-12 中兴通讯股份有限公司 Interface focus object selection method
CN102609521A (en) * 2012-02-10 2012-07-25 深圳创维数字技术股份有限公司 Webpage focus element switching method and digital television receiving terminal
CN103916710A (en) * 2014-03-31 2014-07-09 优视科技有限公司 Focal point switching method and system

Also Published As

Publication number Publication date
CN105630468A (en) 2016-06-01

Similar Documents

Publication Publication Date Title
CN105630468B (en) Focal point moving method and device of UI (user interface) frame
KR102167879B1 (en) Test methods, systems, devices and readable storage media
US10789776B2 (en) Structural modeling using depth sensors
KR100764698B1 (en) Mobile device and user interface control method therefor based on pattern cognition and analysis of image captured by camera
CN103076966B (en) The method and apparatus of menu is unlocked by performing gesture on the touchscreen
US20120050530A1 (en) Use camera to augment input for portable electronic device
US20160171773A1 (en) Display control method, information processing apparatus, and storage medium
CN108958627B (en) Touch operation method and device, storage medium and electronic equipment
US9377943B2 (en) Method and apparatus for outputting display data based on a touch operation on a touch panel
CN107000972B (en) System and method for initiating elevator service by typing an elevator call
US20220324327A1 (en) Method for controlling terminal, electronic device and storage medium
US20170047065A1 (en) Voice-controllable image display device and voice control method for image display device
CN102117165A (en) Touch input processing method and mobile terminal
JPWO2016084336A1 (en) Additional learning device, additional learning method, and additional learning program
US20110149115A1 (en) Electronic device and method for operating a presentation application file
US9195340B2 (en) Key display device and recording medium
CN104899361A (en) Remote control method and apparatus
JPWO2017081920A1 (en) Information processing apparatus, control method, and program
CN107918509B (en) Software shortcut prompt setting method and device and readable storage medium
CN104285204B (en) Show equipment, display control method and non-transitory computer-readable medium
JP2011154613A (en) Programmable display and display method thereof
CN108984097B (en) Touch operation method and device, storage medium and electronic equipment
KR101966423B1 (en) Method for image matching and apparatus for executing the method
CN103543824B (en) Gesture input system and method
CN111796736B (en) Application sharing method and device and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant