Implementation method and device for configurable dynamic linkage operation function panel
By scanning the function operation annotations in the target program and associated with custom partitions, dynamic linkage and custom partition management of interface functions in the Java rich client UI toolbox are realized, solving the problem of limited interface function display and inability to achieve functional linkage in the existing technology, and improving the flexibility of user experience and interface display.
Patent Information
- Application Number
- CN202411803664.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-05-06
AI Technical Summary
When implementing MDI-style applications, the existing Java rich client UI toolbox has limited interface function display and cannot achieve functional linkage, which makes it difficult for users to focus on the functions of specific interface modules in the face of a functional explosion.
By scanning the function operation annotations in the target program, determining the function operation list, and associating it with the preset function labels of the custom partition according to the function operation annotations, dynamic linkage of interface functions and custom partition management are realized.
It realizes the linkage of interface functions, supports user-defined partitioning and function operations, and improves the flexibility and user experience of interface display.
Smart Images

Figure CN119938016A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of display technology, and in particular to a method and device for realizing a configurable dynamic linkage operation function panel. Background Art
[0002] With the rapid development of China's information technology industry, Chinese-made CPUs and operating systems are booming. However, different CPU architectures and operating systems have different graphical desktop environments, which requires applications to spend a lot of energy to adapt to desktop environments of different architectures and different operating systems. JaVa's rich client applications are based on the Java cross-platform language and have the characteristics of Java once compiled and run anywhere. Therefore, Java rich client applications can achieve adaptation to different graphical desktop environments at a relatively low cost. However, Java cross-platform client applications have few UI interface frameworks and a lack of toolbox controls, so the interface style of Java rich client applications is relatively simple.
[0003] Commonly used Java UI interface toolboxes include Swing, SWT, and JavaFX. When developing MDI-style applications, these Java UI toolboxes only support functional interaction between the menu bar and toolbar and the interface. MDI-style interfaces generally have a large number of user interactive operations. In order to facilitate user operations, the menu bar and toolbar usually contain common function entries of all interface modules. Due to interface display limitations, the toolbar can only display limited function entries. As application functions increase, there is no space to display user-added functions in the toolbar. At the same time, the menu bar and toolbar cannot realize functional linkage according to the interface module, and users cannot focus on the functions associated with specific interface modules.
[0004] At present, the commonly used toolboxes for Java rich client UI have the following problems: 1. Single interface style; 2. Chaotic function organization, unable to solve the interface display problem after function explosion; 3. Lack of general user-defined toolbar mechanism; 4. Lack of interface function linkage mechanism. Summary of the invention
[0005] The purpose of the present invention is to provide a method and device for realizing a configurable dynamic linkage operation function panel, which can realize interface function linkage.
[0006] To achieve the above object, the present invention provides the following solutions:
[0007] A method for implementing a configurable dynamic linkage operation function panel, the method comprising:
[0008] Scanning the function operation annotations in the target program, and determining the function operation list according to the function operation annotations; the target program is a program for which a function panel is to be generated; the target program declares the function operation annotations during the writing process; the attributes of the function operation annotations include ID, name, label, tooltip, style, icon, shortcut key, implementation class and status refresh class;
[0009] Registering functional operations according to the functional operation list;
[0010] Loading a custom partition, and associating the function operation with a preset function label of the custom partition to obtain a partition list; the custom partition includes a system partition and a user partition;
[0011] According to the partition list, the interface of the custom partition is drawn and activated, and the preset function label is drawn on the interface of the custom partition and the corresponding function operation is activated to obtain the function panel to be generated; the function panel to be generated includes multiple custom partition interfaces; each of the custom partition interfaces is associated with multiple function operations.
[0012] Optionally, a delayed loading method is adopted to draw and activate corresponding functional operations on the partition interface.
[0013] Optionally, loading a custom partition and associating the function operation with a preset function label of the custom partition to obtain a partition list specifically includes:
[0014] Determine whether to load the system partition;
[0015] When the system partition is not loaded, load the user partition, otherwise load the system partition;
[0016] Corresponding functional operations are respectively associated with preset functional labels of the user partition and the system partition to obtain a partition list.
[0017] Optionally, judging whether to load the system partition according to whether a user partition exists;
[0018] When a user partition exists, the system partition is not loaded;
[0019] When no user partition exists, the system partition is loaded.
[0020] Optionally, the corresponding functional operations are respectively associated with the preset function tags of the user partition and the system partition to obtain a partition list, specifically including:
[0021] According to the ID of the functional operation configured in the user partition, determine the functional operation corresponding to the preset functional label of the user partition, and add the corresponding functional operation to the user partition to obtain a user partition list;
[0022] According to the ID of the functional operation configured in the system partition, the functional operation corresponding to the preset functional tag of the system partition is determined, and the corresponding functional operation is added to the system partition to obtain a system partition list, and the user partition list and the system partition list are used as a partition list.
[0023] Optionally, the functional operation is drawn according to a style of the functional operation.
[0024] Optionally, the styles of the functional operation include button style, drop-down selection style and switch button style.
[0025] Optionally, according to the partition list, drawing and activating the interface of the custom partition, and drawing a preset function label on the interface of the custom partition and activating the corresponding function operation to obtain the function panel to be generated specifically includes:
[0026] Get the ID of the current interface according to the interface drawing thread;
[0027] Determine the corresponding custom partition according to the ID of the current interface;
[0028] According to the corresponding custom partition and the partition list, the function operation corresponding to the preset function label is loaded to obtain the function panel to be generated.
[0029] A computer device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement any of the above-mentioned methods for implementing a configurable dynamic linkage operation function panel.
[0030] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0031] The present invention discloses a method and device for implementing a configurable dynamic linkage operation function panel, which scans the function operation annotations in the target program and determines the function operation list according to the function operation annotations; filters the function operation list according to whether the function operation annotations contain target tags; registers the function operation according to the filtered function operation list; loads custom partitions, and associates the function operation with the preset function label of the custom partition to obtain a partition list; draws and activates the interface of the custom partition according to the partition list, and draws the preset function label on the interface of the custom partition and activates the corresponding function operation to obtain a function panel to be generated. Through the function panel, the application can automatically activate the function panel partition according to the activated user interface, allowing the user to focus on the function buttons provided by the corresponding partition of the interface. At the same time, the function panel supports user-defined organization. The user can customize the partition according to experience and operating habits, associate function operations under the partition, and associate and link with the user interface. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0033] Figure 1 A flowchart of a specific implementation method of the configurable dynamic linkage operation function panel provided by the present invention;
[0034] Figure 2 A schematic diagram of the process flow of loading partitions and filling function operations of the linkage panel provided by the present invention;
[0035] Figure 3 A schematic diagram of the user interface and function panel linkage interaction process provided by the present invention;
[0036] Figure 4 A schematic flow chart of a method for implementing a configurable dynamic linkage operation function panel provided by the present invention;
[0037] Figure 5 A schematic diagram of an interface of a configurable dynamic linkage operation function panel provided by the present invention;
[0038] Figure 6 Another schematic diagram of the configurable dynamic linkage operation function panel provided by the present invention;
[0039] Figure 7 This is a diagram of the internal structure of a computer device. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0041] The purpose of the present invention is to provide a method and device for realizing a configurable dynamic linkage operation function panel, aiming at realizing interface function linkage.
[0042] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0043] Example 1
[0044] like Figure 1 and Figure 4 As shown, the implementation method of the configurable dynamic linkage operation function panel in this embodiment includes:
[0045] Step S1: Scan the function operation annotations in the target program, and determine the function operation list according to the function operation annotations; the target program is a program for generating a function panel; the target program declares the function operation annotations during the writing process; the attributes of the function operation annotations include ID, name, label, tooltip, style, icon, shortcut key, implementation class and status refresh class.
[0046] In practical applications, such as Figure 1 As shown, the user interface of the present invention (that is, the function panel to be generated) transmits the function operations marked as global to the function operation factory; the configuration center obtains the function operations from the function operation factory according to the partition configuration; the configuration center transmits the partition information to the renderer to draw the function panel; the user interface transmits the activation interface information to the configuration center to obtain the associated partition, and notifies the renderer to redraw / refresh the partition interface.
[0047] Specifically, based on the annotation automatic scanning function, the annotation mechanism of the programming language is used to declare the App function operation annotation, which includes the following attributes: ID, name, label, tooltip, style, icon, shortcut key, implementation class, and status refresh class. The function operation marked with annotations in the App is loaded through the code automatic scanning mechanism.
[0048] Step S2: registering functional operations according to the functional operation list.
[0049] Specifically, register the function operation. Add the function operation to the panel function operation factory, which will manage and schedule the function operation. The function operation factory is used to store all function operations, and the specific execution of the function is implemented in the configuration implementation class in the annotation.
[0050] Step S3: loading the custom partition, and associating the function operation with the preset function label of the custom partition to obtain a partition list; the custom partition includes a system partition and a user partition.
[0051] S3 specifically includes:
[0052] Step S31: Determine whether to load the system partition.
[0053] Specifically, whether to load the system partition is determined according to whether a user partition exists. When a user partition exists, the system partition is not loaded. When a user partition does not exist, the system partition is loaded.
[0054] Step S32: When the system partition is not loaded, the user partition is loaded; otherwise, the system partition is loaded.
[0055] Step S33: Corresponding functional operations are associated with preset functional labels of the user partition and the system partition respectively to obtain a partition list.
[0056] S33 specifically includes:
[0057] Step S331: Determine the function operation corresponding to the preset function label of the user partition according to the ID of the function operation configured in the user partition, and add the corresponding function operation to the user partition to obtain a user partition list.
[0058] Step S332: Determine the function operation corresponding to the preset function tag of the system partition according to the ID of the function operation configured in the system partition, and add the corresponding function operation to the system partition to obtain a system partition list, and use the user partition list and the system partition list as a partition list.
[0059] Specifically, the panel configuration center implements partition management, partition-related function operation management, and partition user interface linkage management. The panel configuration center presets the default partition (that is, the system partition), allowing users to customize the partition and configure the associated function operation and interface-partition association positioning. The panel configuration center implements partition creation, partition-related function operation, and user interface corresponding partition assembly and binding based on the configuration. Figure 2 As shown in the figure, the specific process of linking panel partition loading and function operation is as follows:
[0060] Step 1: Link the panel configuration center to realize partition management, partition-related function operation management and partition user interface linkage management.
[0061] Step 2: The linkage panel configuration center loads the preset system partition configuration by default and allows users to customize it. When users customize the configuration, the user-defined configuration partition data is read first.
[0062] Step 3: After the linkage panel reads the partition configuration, it searches for the corresponding function operation in the function operation factory according to the function operation ID list recorded in the partition configuration and adds it to the partition.
[0063] Step 4: The linkage panel notifies the panel drawer to draw the partition list and the function operation list under the activated partition. When drawing the function operation, it needs to be drawn according to the style of the function operation, supporting button style, drop-down selection style and switch button style.
[0064] Step S4: according to the partition list, draw and activate the interface of the custom partition, draw the preset function label on the interface of the custom partition and activate the corresponding function operation to obtain the function panel to be generated; the function panel to be generated includes multiple custom partition interfaces; each custom partition interface is associated with multiple function operations.
[0065] Specifically, a delayed loading method is adopted to draw and activate the corresponding functional operation on the partition interface. The functional operation is drawn according to the style of the functional operation. The styles of the functional operation include button style, drop-down selection style and switch button style.
[0066] S4 specifically includes:
[0067] Step S41: Obtain the ID of the current interface according to the interface drawing thread.
[0068] Step S42: Determine the corresponding custom partition according to the ID of the current interface.
[0069] Step S43: According to the corresponding custom partition and the partition list, the function operation corresponding to the preset function label is loaded to obtain the function panel to be generated.
[0070] Specifically, the panel drawer obtains the list of assembled partitions from the panel configuration center, draws the partition interface at the top of the user interface, and uses delayed loading to draw the list of operation functions under the activated partition. The panel drawer adds user interface and partition activation listeners. When the user interface is activated, the associated partition is automatically activated according to the panel configuration center interface-partition association positioning. Delayed loading of function panels is to reduce the drawing time of function panels and improve performance. When the interface is activated, the specific corresponding function panel is first located. The drawer will execute the drawing according to the status of the activated function panel. If it is not drawn, it will be executed when drawing. This avoids the jamming caused by drawing all function panels when the app starts.
[0071] like Figure 3 As shown, the specific process of the linkage interaction between the user interface and the function panel is as follows:
[0072] Step 1: The user interface and linkage panel partitions are linked, mainly to automatically activate the functional partitions of the linkage panel according to the configuration after the user activates the interface, so that the user can focus on the function list associated with the interface.
[0073] Step 2: After the user activates the interface, the interface drawing thread sends the ID of the current interface to the linkage panel. The interface ID is the unique identifier of the interface. Each interface has corresponding functional operations concentrated in a unified functional panel partition. When the interface is opened, it is automatically located to the corresponding panel partition, so that the user can focus on the functional operations supported by the interface.
[0074] Step 3: The linkage panel receives the activated user interface ID and sends the user interface ID to the panel configuration center.
[0075] Step 4: The panel configuration center locates the corresponding partition label according to the user interface ID and returns the activated partition label to the linkage panel.
[0076] Step 5: The linkage panel activates the partition according to the returned partition label and loads the function list under the partition.
[0077] In the present invention, if Figure 5 and Figure 6 As shown, the user interface is a functional module of the application. Each user interface realizes the separation of interface and functional operation through annotation. When the user interface is opened, the dynamic configuration and loading of the user interface functions are realized according to the annotation and injection methods. The specific implementation refers to the patent number CN202310191140.0, and the patent name is "Data processing method and related equipment based on user interface development".
[0078] The panel function operation factory is used to store the global function operations of the referenced program. When the user interface is loaded, the global function operations are registered to the function operation panel according to the annotations.
[0079] The panel configuration center manages application function partitions according to application functions. Each partition corresponds to one or more user interfaces in the application, and the partition contains all global function operation entries for activating the user interface. Run custom partitions according to operating habits, partition-associated user interfaces, and partition-contained global function entries.
[0080] The panel drawer draws the operation function panel at the top of the application according to the panel configuration center. When drawing, it draws the partition first, and then draws the operation function under the partition. Considering the optimization performance, the drawer only draws / refreshes the partition associated with the currently activated interface and the function operation entrance under the partition.
[0081] The present invention solves the shortcomings of the traditional Java rich client application menu bar and toolbar design, and can generate a configurable and interface-based dynamic operation function panel. The function panel mainly realizes:
[0082] 1. Partition according to the application interface function, and different partitions correspond to the corresponding interface modules of the application.
[0083] 2. Configurable user interface operations under partitions, add corresponding operations to the corresponding partitions.
[0084] 3. Implement function panels, partitions, and function operation entrances under partitions through drawing.
[0085] 4.Configuration realizes the linkage between interface modules and functional panel partitions.
[0086] 5. A user interface that supports user-defined partitions, user operations contained in partitions, and partition linkage.
[0087] Example 2
[0088] A computer device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the implementation method of the configurable dynamic linkage operation function panel in Example 1.
[0089] Example 3
[0090] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the implementation method of the configurable dynamic linkage operation function panel in embodiment 1.
[0091] Example 4
[0092] A computer program product includes a computer program, which implements the implementation method of the configurable dynamic linkage operation function panel in embodiment 1 when executed by a processor.
[0093] Example 5
[0094] A computer device, which may be a database, may have an internal structure as shown in Figure 7 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store pending transactions. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the implementation method of the configurable dynamic linkage operation function panel in Example 1 is implemented.
[0095] It should be noted that the object information (including but not limited to object device information, object personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the present invention are all information and data authorized by the object or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0096] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided by the present invention can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided by the present invention may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited thereto. The processor involved in each embodiment provided by the present invention may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited thereto.
[0097] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0098] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A method for implementing a configurable dynamic linkage operation function panel, characterized in that: The method comprises: Scanning the function operation annotations in the target program, and determining the function operation list according to the function operation annotations; the target program is a program for which a function panel is to be generated; the target program declares the function operation annotations during the writing process; the attributes of the function operation annotations include ID, name, label, tooltip, style, icon, shortcut key, implementation class and status refresh class; Registering functional operations according to the functional operation list; Loading a custom partition, and associating the function operation with a preset function label of the custom partition to obtain a partition list; the custom partition includes a system partition and a user partition; According to the partition list, the interface of the custom partition is drawn and activated, and the preset function label is drawn on the interface of the custom partition and the corresponding function operation is activated to obtain the function panel to be generated; the function panel to be generated includes multiple custom partition interfaces; each of the custom partition interfaces is associated with multiple function operations.
2. The method for implementing the configurable dynamic linkage operation function panel according to claim 1, characterized in that: The corresponding functional operation is drawn and activated on the partition interface by using a delayed loading method.
3. The method for implementing a configurable dynamic linkage operation function panel according to claim 1, characterized in that: Loading a custom partition and associating the function operation with the preset function label of the custom partition to obtain a partition list, specifically including: Determine whether to load the system partition; When the system partition is not loaded, load the user partition, otherwise load the system partition; Corresponding functional operations are respectively associated with preset functional labels of the user partition and the system partition to obtain a partition list.
4. The method for implementing the configurable dynamic linkage operation function panel according to claim 3, characterized in that: Determine whether to load the system partition based on whether a user partition exists; When a user partition exists, the system partition is not loaded; When no user partition exists, the system partition is loaded.
5. The method for implementing the configurable dynamic linkage operation function panel according to claim 3, characterized in that: Corresponding functional operations are respectively associated with the preset functional labels of the user partition and the system partition to obtain a partition list, which specifically includes: According to the ID of the functional operation configured in the user partition, determine the functional operation corresponding to the preset functional label of the user partition, and add the corresponding functional operation to the user partition to obtain a user partition list; According to the ID of the functional operation configured in the system partition, the functional operation corresponding to the preset functional tag of the system partition is determined, and the corresponding functional operation is added to the system partition to obtain a system partition list, and the user partition list and the system partition list are used as a partition list.
6. The method for implementing a configurable dynamic linkage operation function panel according to claim 1, characterized in that: The functional operation is drawn according to the style of the functional operation.
7. The method for implementing a configurable dynamic linkage operation function panel according to claim 1, characterized in that: The styles of the functional operation include button style, drop-down selection style and switch button style.
8. The method for implementing a configurable dynamic linkage operation function panel according to claim 1, characterized in that: Drawing and activating the interface of the custom partition according to the partition list, and drawing a preset function label on the interface of the custom partition and activating the corresponding function operation to obtain the function panel to be generated, specifically includes: Get the ID of the current interface according to the interface drawing thread; Determine the corresponding custom partition according to the ID of the current interface; According to the corresponding custom partition and the partition list, the function operation corresponding to the preset function label is loaded to obtain the function panel to be generated.
9. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the method for implementing the configurable dynamic linkage operation function panel as described in any one of claims 1-8.
Citation Information
Patent Citations
Data processing method based on user interface development and related equipment
CN116804923A