1. Technical Field
The present disclosure relates to an electronic device capable of automatically generating a user interface and a method thereof.
2. Description of Related Art
In general, user interface (UI) engineers manually produce a user interface according to a product function list and a UI profile file. However, when the UI profile is changed, the user interface has to be changed too. As a result, UI engineers have to re-produce the UI over again, and this would be time-consuming to re-produce the UI.
Therefore, what is needed is an electronic device which can automatically generate a user interface and a method for such an electronic device.
The product function list defines relationships between features of the electronic device. In the exemplary embodiment, the relationships of the product are represented as menu items and sub-menu items of a menu corresponding to features of the device. The product function list further defines menu options and submenu options.
The UI profile file is a display specification file and defines a display interface for showing the relationships of the product. That is, the UI profile file defines a display interface for listing/organizing the menu items and the submenus items. Each of the UI profile file further defines one display format of the display interface. The display format includes a display manner of the menu, background color, and highlight color on option, etc. For example, there are two UI profile files: a first UI profile file and a second UI profile file. Regarding to the first UI profile file, the display manner of the menu may be listing menu items horizontally and listing submenu items vertically in a menu interface, and listing the submenu items horizontally and listing the options of the each of the submenu items vertically in a submenu interface. The background color is blue. The highlight color is red. Regarding to the second UI profile file, the display manner of the menu may be listing menu items vertically and listing submenu items horizontally in a menu interface, and listing the submenu items vertically and listing the options of the each of the submenu items horizontally in a submenu interface. The background color is white. The highlight color is green.
The processing unit 20 includes a user interface establishing module 210, a product function list loading module 220, a product function list parsing module 230, a user interface profile file loading module 240, a user interface generation module 250, and a storage module 260.
The user interface establishing module 210 is configured for activating a function of the electronic device 1 for establishing a UI, when the input unit 10 receives an input operation of establishing a UI.
The product function list loading module 220 is configured for loading the product function list from the storage unit 40, when the function of the electronic device 1 for establishing the UI is activated.
The product function list parsing module 230 is configured for parsing the loaded product function list, when the product function list is loaded.
In the exemplary embodiment, each of the menu item is assigned a one-level node, and each of the sub-menu item of the sub-menu is assigned a two-level node, etc, by the same token, all menu items are assigned a corresponding level node. The product function list parsing module 230 first identifies the first one-level node, and then identifies whether the first one-level node includes the two-level node. If the first one-level node includes the two-level node, the product function list parsing module 230 identifies whether the two-level node includes a three-level node until that the last-level node is identified, and acquires the corresponding options corresponding to the identified last-level node. Then, the product function list parsing module 230 identifies the second one-level node, and repeats the above operation to identify the all nodes, and acquires the all options. If the first one-level node does not include the two-level node, the product function list parsing module 230 acquires the option corresponding to the first one-level node, and then identifies the second one-level node, by the same token, repeats the above operation until that the last-level node is identified, and acquires the options corresponding to the identified last-level node. Finally, the product function list parsing module 230 stores the menu items corresponding to the all one-level nodes in a first layer of a database, stores the sub-menu items corresponding to the all two-level nodes in a second layer of the database, by the same token, and stores the options of menu items of the menu or the sub-menus in a last layer of the database.
As shown
The user interface profile file loading module 240 is configured for selectively loading the UI profile file from the storage unit 40 according to an input operation the input unit 10 receives, when the product function list is parsed. In the exemplary embodiment, the user interface profile file loading module 240 may selectively load one of the UI profile files for the all menu items according to the input operation, that is, all menus can be displayed according to the same display format of the selective UI profile file. In another embodiment, the user interface profile file loading module 240 may selectively load different UI profile files for the different menu items, that is, each of the menu items can be displayed according to the different display format of the selective UI profile file.
The user interface generation module 250 is configured for displaying the parsed product function list on the display unit 30 according to the display format of the loaded UI profile file, and linking the displaying menu interface to generate a series of UIs, when the UI profile file is loaded. As shown
The storage module 260 is configured for storing the generated series of user interfaces in the storage unit 40.
In step S601, the user interface establishing module 210 activates a function of the electronic device 1 for establishing a UI, when the input unit 10 receives an input operation of establishing a UI.
In step S602, the product function list loading module 220 loads the product function list from the storage unit 40, when the function for establishing the UI is activated.
In step S603, the product function list parsing module 230 parses the loaded product function list, when the product function list is loaded.
In step S604, the user interface profile file loading module 240 selectively loads the UI profile file from the storage unit 40 according to an input operation the input unit 10 receives, when the product function list is parsed.
In step S605, the user interface generation module 250 displays the parsed product function list on the display unit 30 according to the display format of the loaded UI profile file, and links the displaying menu interface to generate a series of UIs, when the UI profile file is loaded.
In step S606, the storage module 260 stores the generated series of user interfaces in the storage unit 40.
Although the present disclosure has been specifically described on the basis of the exemplary embodiment thereof, the disclosure is not to be construed as being limited thereto. Various changes or modifications may be made to the embodiment without departing from the scope and spirit of the disclosure.
Number | Date | Country | Kind |
---|---|---|---|
200910307997.4 | Sep 2009 | CN | national |