Object connection method and device, electronic equipment, storage medium and program product
By obtaining the location of action and creating detection elements, the accuracy and efficiency of object connection are improved, solving the problem of object connection in graphic editing and enhancing the user experience.
Patent Information
- Application Number
- CN202410444787.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-12
- Publication Date
- 2025-10-21
AI Technical Summary
In graphics editing scenarios, objects that are scaled to a very small size are difficult to locate accurately, resulting in low object connection accuracy and efficiency.
By obtaining the first and second action positions, the objects to be connected are determined, and detection elements are created. The detection area is larger than the object area, enabling a wider range of object connection detection. Automatic connection does not require precise positioning of specified sites.
It improves the accuracy and efficiency of object connections, reduces the difficulty of operation, and enhances the user experience.
Smart Images

Figure CN120823285A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to computer application technology, and more particularly to an object connection method, device, electronic device, storage medium, and program product. Background Art
[0002] In graphic editing scenarios, it is often necessary to connect multiple graphics. In related technologies, the user needs to drag a line to a specified point in the graphic and release the mouse to complete the connection.
[0003] However, during the object connection process, there may be multiple objects that have been scaled to a very small size located in the editing window. When connecting objects based on the above method, high accuracy of the operation is required, and it may be impossible to accurately locate the target object to be connected, thereby affecting the accuracy and efficiency of the graphic connection. Summary of the Invention
[0004] The present disclosure provides an object connection method, device, electronic device, storage medium and program product to achieve the beneficial effects of reducing the operational difficulty of object connection, improving the user's operating experience, and increasing the accuracy and efficiency of object connection.
[0005] In a first aspect, an embodiment of the present disclosure provides an object connection method, the method comprising:
[0006] In response to a first trigger operation, acquiring a first action position and a second action position based on the first trigger operation, wherein the first action position is used to determine a first object to be connected;
[0007] Determining a second object that can establish a connection with the first object, and creating a detection element corresponding to the second object; wherein the second object is located within a detection area of the detection element, and the area of the detection area is larger than the area of the second object;
[0008] In response to a second trigger operation, when the second action position is within the detection area, the first object is connected to the second object within the detection area.
[0009] In a second aspect, an embodiment of the present disclosure further provides an object connection device, the device comprising:
[0010] a triggering module, configured to, in response to a first triggering operation, acquire a first action position and a second action position based on the first triggering operation, wherein the first action position is used to determine a first object to be connected;
[0011] a detection module, configured to determine a second object that can establish a connection with the first object and create a detection element corresponding to the second object; wherein the second object is located within a detection area of the detection element, and the area of the detection area is larger than the area of the second object;
[0012] The connection module is configured to connect the first object with the second object in the detection area in response to a second trigger operation when the second action position is in the detection area.
[0013] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0014] one or more processors;
[0015] a storage device for storing one or more programs,
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the object connection method as described in any one of the embodiments of the present disclosure.
[0017] In a fourth aspect, an embodiment of the present disclosure further provides a storage medium comprising computer-executable instructions, which, when executed by a computer processor, are used to execute the object connection method as described in any one of the embodiments of the present disclosure.
[0018] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the object connection method as described in any one of the embodiments of the present disclosure.
[0019] The technical solution of the embodiment of the present disclosure, by responding to a first trigger operation and obtaining a first action position and a second action position based on the first trigger operation, can determine the first object to be connected through the first action position, and obtain the second action position, so as to quickly locate the second object of the object to be connected through the second action position; then, by determining the second object that can establish a connection with the first object and creating a detection element corresponding to the second object, the detection element is created after the second object is determined, thereby achieving the effect of dynamically creating a detection element matching the second object while reducing memory usage; because the second object is located within the detection area of the detection element, and the area of the detection area is larger than the area of the second object, a wider range of detection of the connection operation acting on the second object is achieved; finally, by responding to the second trigger operation, when the second action position is within the detection area, the first object is connected to the second object within the detection area, without the need for precise positioning to a specific location. As long as the second action position is within the detection area, the first object and the second object can be automatically connected. This solves the problems of low object connection accuracy and low connection efficiency in the related art, and achieves the beneficial effects of reducing the operational difficulty of object connection, improving the user's operating experience, and improving the object connection accuracy and connection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.
[0021] Figure 1 A flowchart of an object connection method provided by an embodiment of the present disclosure;
[0022] Figure 2 A schematic diagram of an effect of the detection area provided by an embodiment of the present disclosure;
[0023] Figure 3 A flowchart of another object connection method provided by an embodiment of the present disclosure;
[0024] Figure 4 A flowchart of an object connection method provided by an embodiment of the present disclosure;
[0025] Figure 5 A schematic structural diagram of an object connection device provided by an embodiment of the present disclosure;
[0026] Figure 6 A schematic structural diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0028] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0029] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.
[0030] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0031] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".
[0032] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0033] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0034] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the operation requested will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operations of the disclosed technical solution based on the prompt message.
[0035] As an optional but non-limiting implementation, in response to receiving a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0036] It is understandable that the above notification and user authorization process are merely illustrative and do not limit the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0037] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) must comply with the requirements of relevant laws, regulations and relevant provisions.
[0038] Before introducing the present technical solution, an example of the application scenario can be first described. The technical solution can be applied to any object connection scenario. In order to more clearly introduce the present technical solution, the execution process of the present technical solution can be described by taking the graphic editing scenario as an example. For example, in the graphic editing scenario, any two port identifiers can be connected by clicking and dragging. When a click-and-drag trigger operation is detected for any port identifier, a drag trajectory can be generated based on the drag operation, and the port identifier can be connected to the target port only when the drag is entered on the preset identifier of the target port and a drag-and-release operation is input. Moreover, no connection revelation is displayed in the editing window before the drag-and-release operation is input. In this case, if multiple objects that have been scaled to a very small size are located in the editing window during the connection process, when the objects are connected based on the above method, there may be a problem of not being able to accurately locate the target object to be connected, thereby reducing the accuracy and efficiency of object connection.
[0039] At this time, based on the technical solution of the embodiment of the present disclosure, when a click-and-drag trigger operation is detected for any port input in the editing window, the click position can be used as the first action position, and the port identifier to be connected is determined based on the first action position as the first port. Further, the drag trigger operation can be continued, and the second action position can be obtained during the execution of the drag trigger operation. Moreover, during the execution of the drag operation, the second port that can be connected to the first port is determined, and a detection element corresponding to the second port is created. Further, when a drag-and-release operation is detected, the last second action position obtained can be determined based on the drag-and-release operation, and it can be determined whether the second action position is within the detection area of the detection element. When the second action position is within the detection area, the first port and the second port within the detection area can be connected. Thus, the beneficial effects of reducing the operational difficulty of object connection, improving the user's operating experience, and improving the accuracy and efficiency of object connection are achieved.
[0040] Figure 1 This is a flow chart of an object connection method provided in an embodiment of the present disclosure. The embodiment of the present disclosure is applicable to situations where an object is deleted and the object is restored after deletion. The method can be performed by an object connection device, which can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, which can be a mobile terminal, PC or server, etc.
[0041] like Figure 1 As shown, the method of this embodiment may specifically include:
[0042] S110 . In response to a first trigger operation, acquire a first action position and a second action position based on the first trigger operation, wherein the first action position is used to determine a first object to be connected.
[0043] The first trigger operation can be understood as a trigger operation that places the object to be connected in a connected state. Optionally, the first trigger operation can include a click-and-drag trigger operation, a click trigger operation for a connection control and the object to be connected, a selection trigger operation for the object to be connected (e.g., a click trigger operation for the object to be connected based on the right mouse button, or a click trigger operation for the object to be connected based on the left mouse button when a click is input on the object selection control and the trigger operation is not released, etc.), and a parameter editing trigger operation, etc.
[0044] The first active position can be understood as the position representing the connection starting point during a single connection process. The first active position is used to determine the first object to be connected. The first object can be understood as the object located at the connection starting point during a single connection process. The first object can include any object capable of performing a connection operation. Optionally, the first object can be a port identifier in one or more graphical elements in a graphic editing tool.
[0045] In an embodiment of the present disclosure, a variety of different methods of determining the first action position may correspond to different first trigger operations. Optionally, in the case where the first trigger operation is a click-and-drag trigger operation, the position clicked by the input device may be used as the first action position. Furthermore, dragging may be performed with the first action position as the starting point. Alternatively, in the case where the first trigger operation is a selection trigger operation for an object to be connected, the position where the input device (such as a mouse) is first clicked during a single connection process may be used as the first action position. Alternatively, in the case where the first trigger operation is a parameter editing trigger operation, the first action position may be determined based on the parameter information (such as coordinate information or object identification) entered in the connection starting point edit item.
[0046] The second action position can be understood as an action position other than the first action position obtained during the execution of the first trigger operation. The number of second action positions can be one or more. It should be noted that for different first trigger operations, the second action position can correspond to a variety of different situations. Optionally, when the first trigger operation is a click-and-drag trigger operation, the second action position can include a position that represents the end of the connection state during a single connection process and / or a position in the middle of the connection identifier during a single connection process, that is, an action position other than the first action position obtained during the dragging process. Exemplarily, the connection identifier can include a connection trajectory, etc. Alternatively, when the first trigger operation is a selection trigger operation for the object to be connected, the second action position can be a position that represents the end of the connection state during a single connection process, and the position where the input device was last clicked during the single connection process can be used as the second action position; or, when the first trigger operation is a parameter editing trigger operation, the second action position can be a position that represents the end of the connection state during a single connection process, and the second action position can be determined based on the parameter information (such as coordinate information or object identifier) entered in the connection endpoint edit item.
[0047] In the embodiment of the present disclosure, when the first trigger operation is detected, the first action position and the second action position can be determined and acquired according to the first trigger operation.
[0048] For example, assuming that the first trigger operation is a click-and-drag trigger operation, when a click trigger operation of the mouse is detected at any position and the drag operation is continued without releasing the mouse button, a connection track can be generated with the clicked position as the starting point. At this time, the clicked position can be used as the first action position, and all other positions on the connection track except the first action position can be used as the second action position.
[0049] S120: Determine a second object that can establish a connection with the first object, and create a detection element corresponding to the second object; wherein the second object is located within a detection area of the detection element, and an area of the detection area is larger than an area of the second object.
[0050] The second object can be understood as an object capable of establishing a connection relationship with the first object. The second object can include any object capable of performing a connection operation. Optionally, the second object can be a port identifier in one or more graphical elements in a graphic editing tool. The detection element can be used to detect whether the second action location is within a detection area. In embodiments of the present disclosure, the detection element can be positioned so as to hover above the second object. This arrangement has the advantage that, upon detecting a preset trigger operation input for the second object, the preset trigger operation can be first detected based on the detection element. Furthermore, after the detection element completes detection, the preset trigger operation can be applied to the second object. In other words, the detection element can be used to intercept the preset trigger operation input for the second object. The detection area can be understood as an area used to detect the second action location to determine whether the first and second objects can be connected at that location. It should be noted that the detection area and the second object have a one-to-one correspondence. In other words, the detection area can be determined based on the second object. In embodiments of the present disclosure, the area of the detection area is larger than that of the second object. This arrangement has the advantage that the second action location can be detected based on the detection area even if it exceeds the object boundary of the second object, thereby expanding the connection detection range of the second object.
[0051] It should be noted that, in addition to the first object, at least one connectable object may be included. These connectable objects may include objects that can establish a connection with the first object, and may also include objects that cannot establish a connection with the first object.
[0052] In the disclosed embodiments, after obtaining a first action location, a first object to be connected can be determined based on the first action location. Furthermore, a second object that can be connected to the first object can be determined based on the first object. It should be noted that there are multiple ways to determine the second object, each of which will be described below.
[0053] The first method involves obtaining the object types of multiple objects, establishing a correspondence between the object types, obtaining type correspondence information, and storing it. This type correspondence information may include one object type corresponding to one object type, or one object type corresponding to multiple object types. Furthermore, upon determining the first object, the object type of the first object may be obtained. If the object type of the first object exists in the pre-stored type correspondence information, the target object type corresponding to the object type of the first object may be queried based on the type correspondence information. Furthermore, an object of the target object type among the currently included connectable objects may be used as the second object.
[0054] Second, multiple objects can be acquired, and correspondences between them can be established to obtain and store object correspondence information. This object correspondence information can include one object corresponding to another object, or one object corresponding to multiple objects. Furthermore, after determining the first object, if the object correspondence information includes the first object, a target object corresponding to the first object can be searched for based on the object correspondence information. Furthermore, an object matching the target object among the currently included connectable objects can be used as the second object.
[0055] In an embodiment of the present disclosure, to provide a user with a clearer and more intuitive understanding of the second object that can be connected to the first object, after determining the second object that can be connected to the first object, the method further includes: highlighting the second object. Optionally, highlighting the second object may include setting the second object to a selectable state, enlarging the second object, or displaying the object content displayed by the second object in bold font.
[0056] In the disclosed embodiment, after the second object is determined, a detection element corresponding to the second object can be created based on the second object. It should be noted that the detection area of the detection element is larger than the area of the second object. Therefore, when the second object is determined, the detection element can be created based on the object size parameters of the second object.
[0057] Optionally, creating a detection element corresponding to the second object includes: determining object border parameters corresponding to the second object, generating area border parameters for determining a detection area corresponding to the second object based on the object border parameters, and creating a detection element corresponding to the second object based on the area border parameters.
[0058] Among them, the object border parameter can be a parameter that characterizes the minimum bounding box size of the object. It should be noted that, whether it is the first object or the second object, there may be a situation where the object shape is irregular. In order to make the final detection element more accurate, a minimum bounding box corresponding to the second object can be created. Furthermore, the object border parameters corresponding to the second object can be determined based on the minimum bounding box. Optionally, the object border parameters may include border length, border height, border vertex coordinates and / or border center point coordinates, etc. The area border parameters may be a parameter that characterizes the area size of the detection area. Optionally, the area border parameters may include border length, border height, border vertex coordinates and / or border center point coordinates, etc.
[0059] In an embodiment of the present disclosure, the default border of the second object or the border of the row or column where the second object is located can be detected to obtain object border parameters corresponding to the second object. Furthermore, in order to make the area of the detection area of the detection element finally determined larger than the area of the second object, at least part of the parameters in the object border parameters can be adjusted to expand at least part of the default border of the second object or the border of the row or column where the second object is located to obtain regional border parameters of the detection area. In short, the border size represented by the regional border parameters of the detection area is larger than the size of the default border corresponding to the second object. Furthermore, the regional border parameters can be injected into the preset element generation algorithm to generate a detection element corresponding to the second object based on the preset element generation algorithm according to the regional border parameters. The advantage of this setting is that it achieves the effect of dynamically creating matching detection elements based on the second object, thereby enhancing the flexibility of creating detection elements. When multiple second objects are arranged along a first direction, the default border of the second object or the border of the row or column where the second object is located can be expanded along a second direction perpendicular to the first direction to form a regional border of the detection area. The advantage of this setting is that the detection area of the detection element finally created is larger than the area of the second object, and does not overlap with other adjacent detection areas, so as not to affect the effect of the element detection process in other detection areas.
[0060] Exemplarily, after obtaining the object border parameters, the border length in the object border parameters can be extended by a preset value in the direction away from the second object and closer to the first object, and the parameter values of other parameters in the object border parameters can be kept unchanged, and new object border parameters can be obtained, and the new object border parameters can be used as area border parameters.
[0061] For example, Figure 2 This is a schematic diagram of the effect of the detection area provided by the embodiment of the present disclosure. Figure 2As shown, five objects may be included, namely object 1, object 2, object 3, object 4 and object 5. Among them, object 1 and object 2 may be used as second objects that can establish a connection with the first object. In addition, object 1 and object 2 may be highlighted. For example, object 3, object 4 and object 5 may be grayed out, etc. For these two second objects, the second object may be represented based on the port identifier 21, and the text identifier of the port corresponding to the second object may be edited based on the box 22. Object 1 and object 2 are arranged in order from top to bottom. At this time, the default borders of object 1 and object 2 may be detected in order from left to right to determine the object border parameters of object 1 and object 2. Furthermore, in order to enable the corresponding second object to be quickly located in the adjacent area close to the second object, the partial area of the default border adjacent to the second object may be expanded to the left to obtain a detection area 23.
[0062] It should be noted that the area of the detection region is larger than the area of the second object, and therefore the second object may be located inside the detection region.
[0063] It should also be noted that the detection element can be created based on a preset framework and at the same level as the data element represented by the second object. This allows the detection element to seamlessly support interface scaling and dynamic structural adjustments.
[0064] In an embodiment of the present disclosure, after creating a detection element corresponding to the second object, the second active position can be detected based on the detection element to determine whether the second active position is within the detection area. Furthermore, to allow the user to more clearly and intuitively observe the detection area and intuitively determine the position of the second object to be connected to the first object, after creating the detection element corresponding to the second object, the detection area is further highlighted if the distance between the second active position and the detection area is less than or equal to a preset distance.
[0065] The preset distance can be used to indicate whether to highlight the detection area. The preset distance can be any value. Optionally, highlighting can include highlighting the detection area, zooming in on the detection area, or setting the display color of the detection area to a color that is different from the display colors of other areas.
[0066] In the embodiment of the present disclosure, after creating the detection element corresponding to the second object, the distance between the second action position and the detection area can be determined based on the position information corresponding to the second action position and the area border parameters of the detection area. Further, if it is determined that the distance between the second action position and the detection area is less than or equal to the preset distance, the detection area can be highlighted. For example, continue to refer to Figure 2As shown, when the distance between the second action position (arrow in the figure) and the detection area corresponding to the object 2 is detected to be less than or equal to the preset distance, the detection area corresponding to the object 2 can be highlighted (that is, the detection area is highlighted based on the shadow area in the figure).
[0067] S130 . In response to a second trigger operation, when the second action position is within the detection area, connect the first object with the second object within the detection area.
[0068] The second trigger operation can be understood as a trigger operation that indicates the end of the connection state. Optionally, if the first trigger operation is a click-and-drag trigger operation, the second trigger operation can be a drag-and-release operation; or, if the first trigger operation is a selection trigger operation for the object to be connected, the second trigger operation can be a selection confirmation trigger operation; or, if the first trigger operation is a parameter editing trigger operation, the second trigger operation can be an editing completion trigger operation, etc.
[0069] In the disclosed embodiment, when a second triggering operation is detected, whether the second area is within the detection area can be determined based on the position information of the second action location and the area border parameters of the detection area. Furthermore, if it is determined that the second action location is within the detection area, the first object and the second object within the detection area can be automatically connected to establish a connection relationship between the first and second objects.
[0070] Exemplarily, the execution process of the technical solution provided by the embodiment of the present disclosure can be explained by taking the drag scene as an example: assuming that the first trigger operation is a click-and-drag trigger operation, the second trigger operation can be a drag-and-release operation. In the case of detecting a click trigger operation at any position, the clicked position can be used as the first action position, and the first object can be determined based on the first action position. Further, the drag trigger operation can continue to be executed, and the second action position can be obtained in the process of executing the drag trigger operation. Moreover, in the process of executing the drag operation, the second object that can be connected to the first object is determined, and a detection element corresponding to the second object is created. Further, in the case of detecting a drag-and-release operation, the position information of the last second action position obtained can be determined based on the drag-and-release operation, and based on the position information and the area border parameters of the detection area of the detection element, it can be determined whether the second action position is within the detection area. In the case where the second action position is within the detection area, the first object and the second object within the detection area can be connected. Specifically, the first object and the second object within the detection area can be connected by a connecting line.
[0071] It should be noted that when the second action position is within the detection area, the second object within the detection area can also be highlighted. The advantage of this setting is that it helps the user observe the object content represented by the second object more clearly and intuitively, facilitates the user to quickly locate the second object after observing the object content, and improves the accuracy and efficiency of object connection.
[0072] It should be noted that, in response to the second trigger operation, if the second action location is not within the detection area, the first object and the second object within the detection area are not connected, and a connection failure prompt message and / or an object creation prompt message are generated. The connection failure prompt message may be used to indicate that the connection between the first object and the second object has failed. The object creation prompt message may be used to indicate whether to create a third object based on the second action location.
[0073] It should be noted that, generally, after executing a single connection process, the detection element corresponding to the second object that has established a connection with the first object may not be used again in the subsequent object connection process. In order to avoid useless resources occupying the application memory, after connecting the first object and the second object in the detection area, it also includes: deleting the detection element.
[0074] In the embodiment of the present disclosure, after connecting the first object and the second object, the detection element corresponding to the second object can be deleted from the memory. The advantage of this setting is that it frees up the memory space occupied by the application and thus improves the running performance of the application.
[0075] It should also be noted that if the detection element is not deleted, when performing other operations on the second object, the operations performed will still need to be detected based on the detection element, which may cause operational inconvenience. Therefore, to avoid this situation, the detection element can be deleted. Furthermore, the object connection operation performed in the connection state can be distinguished from other operations, so that the object connection operation can be performed more accurately.
[0076] The technical solution of the embodiment of the present disclosure, by responding to a first trigger operation and obtaining a first action position and a second action position based on the first trigger operation, can determine the first object to be connected through the first action position, and obtain the second action position, so as to quickly locate the second object of the object to be connected through the second action position; then, by determining the second object that can establish a connection with the first object and creating a detection element corresponding to the second object, the detection element is created after the second object is determined, thereby achieving the effect of dynamically creating a detection element matching the second object while reducing memory usage; because the second object is located within the detection area of the detection element, and the area of the detection area is larger than the area of the second object, a wider range of detection of the connection operation acting on the second object is achieved; finally, by responding to the second trigger operation, when the second action position is within the detection area, the first object is connected to the second object within the detection area, without the need for precise positioning to a specific location. As long as the second action position is within the detection area, the first object and the second object can be automatically connected. This solves the problems of low object connection accuracy and low connection efficiency in the related art, and achieves the beneficial effects of reducing the operational difficulty of object connection, improving the user's operating experience, and improving the object connection accuracy and connection efficiency.
[0077] Figure 3 This is a flow chart of another object connection method provided by an embodiment of the present disclosure. The technical solution of this embodiment is based on the above embodiment. The first object and the second object are on the canvas, and at least a portion of the canvas is displayed in the target window. After obtaining the second action position, the method further includes: when the second action position is within a preset edge area of the target window, controlling the movement of the canvas according to the second action position. For specific implementation methods, please refer to the description of this embodiment. Technical features that are the same or similar to those of the above embodiment will not be repeated here.
[0078] like Figure 3 As shown, the method of this embodiment may specifically include:
[0079] S210 . In response to a first trigger operation, acquire a first action position and a second action position based on the first trigger operation, wherein the first action position is used to determine a first object to be connected.
[0080] S220: Determine a second object that can be connected to the first object, and create a detection element corresponding to the second object; wherein the first object and the second object are on a canvas, and at least a portion of the canvas is displayed in the target window.
[0081] Among them, the canvas can be understood as an area for presenting objects and the connection relationship between objects. The target window can be used to edit the object and visualize the editing process. In other words, the target window can be an interactive entrance for performing an edit trigger operation on the object. Optionally, the edit trigger operation may include an object creation trigger operation and an object connection trigger operation, etc. At least part of the area of the canvas is displayed in the target window, which can be understood as the area of the target window being smaller than the area of the canvas. In addition, it can also be understood that the first object and the second object can both be in the target window; or, the first object or the second object is in the target window; or, neither the first object nor the second object is in the target window. For example, continue to refer to Figure 2 As shown, window 24 can be used as the target window.
[0082] It should be noted that the detection element can be created for the second object displayed in the current target window. In other words, if the second object is not currently displayed in the target window, a detection element corresponding to it can be omitted. If a move operation is performed on the canvas, causing a second object that can be connected to the first object to be displayed in the target window, a detection element corresponding to the second object can be created. This arrangement has the advantage of dynamically creating a detection element that matches the second object while reducing memory usage.
[0083] S230 : When the second action position is located in a preset edge area of the target window, control the canvas to move according to the second action position.
[0084] Among them, the preset edge area can be an area determined based on the window border of the target window and any border inside the window. In an embodiment of the present disclosure, the target window can be scaled according to a preset scaling ratio to obtain a target border with a border size smaller than the border size of the target window, and the target border is placed in the center area of the target window so that the target window and the target window are at the same center point. Further, the preset edge area can be determined based on the target window and the target border. Optionally, the area between the target window and the target border can be used as the preset edge area, that is, the area between the window border of the target window and the border of the target border. Alternatively, for each border in the target border, a perpendicular line can be drawn based on the two endpoints of the border to the window border closest to the border. Furthermore, the area constructed based on the two perpendicular lines, the window border and the border can be used as the preset edge area, and four preset edge areas can be obtained. It should be noted that the movement direction of the canvas is associated with the direction of the second action position relative to the first action position. In other words, the movement direction of the canvas can be a direction close to the second action position and away from the first action position.
[0085] In actual applications, when performing an object connection operation based on a target window, the second object to be connected may be located outside the target window. In this case, in order to successfully connect the first and second objects, the user needs to stop executing the first trigger operation and manually drag or resize the target window so that the second object is located inside the target window before re-executing the first trigger operation. This may result in cumbersome operation steps and users may have to repeat the same operation, which may lead to reduced object connection efficiency.
[0086] In view of the above situation, in an embodiment of the present disclosure, after obtaining the second action position, if it is determined that the second action position is within the preset edge region of the target window based on the position information of the second action position and the region position information of the preset edge region, it can be indicated that the second action position is close to the window border of the target window. In this case, in order to continue to perform the first trigger operation, the canvas movement can be controlled based on the second action position so that the canvas moves along the movement trend of the second action position.
[0087] It should be noted that when the second action position is within the preset edge area of the target window, the second object to be connected may also be within the preset edge area. Therefore, to prevent the canvas from moving when the second object is within the preset edge area, when the second action position is detected to be within the preset edge area of the target window, the duration of the second action position's stay within the preset edge area can be detected before controlling canvas movement. Furthermore, if it is detected that the stay time reaches the preset time, canvas movement can be controlled based on the second action position.
[0088] In an embodiment of the present disclosure, the movement information of the canvas is associated with the distance between the second action position and the window border of the target window. Optionally, the movement information includes at least a movement direction and / or a movement speed. In other words, the movement information of the canvas can be determined based on the distance between the second action position and the window border of the target window.
[0089] Optionally, when the movement information includes a movement direction, the distance between the second action position and each window frame of the target window can be determined separately to obtain multiple distances. Furthermore, a target distance less than or equal to a preset threshold can be determined from the multiple distances, and the window frame corresponding to the target distance can be used as the target frame. Furthermore, the direction of movement of the canvas can be determined based on the direction corresponding to the target frame.
[0090] Optionally, when the movement information includes the movement speed, the distance is negatively correlated with the movement speed. In the process of controlling the canvas to move according to the determined movement direction, the distance between the second action position and the target border can be periodically or continuously determined. When the distance is small, it can be explained that the second action position at this time may be close to the position that meets the user's needs. Therefore, the movement speed of the canvas can be slowed down; when the distance is large, it can be explained that the second action position at this time is far away from the position that meets the user's needs. Therefore, the movement speed of the canvas can be increased. The advantage of this setting is that it conforms to the user's operating habits, facilitates the user to control the movement speed of the canvas, and improves the user experience.
[0091] In the embodiment of the present disclosure, controlling the movement of the canvas according to the second action position may include determining the movement direction of the canvas according to the second action position, and then controlling the canvas to move according to the movement direction.
[0092] Optionally, controlling the movement of the canvas according to the second action position includes: determining the target frame according to the distance between the second action position and each window frame of the target window, determining the movement direction of the canvas according to the direction corresponding to the target frame, and controlling the canvas to move along the movement direction.
[0093] In an embodiment of the present disclosure, the distance between the second action position and each window border can be determined based on the position information of the second action position and the frame position information of the window border of the target window, thereby obtaining a plurality of distances. Furthermore, a target distance less than or equal to a preset threshold can be determined from the plurality of distances, and the window border corresponding to the target distance can be used as the target border. The direction corresponding to the target border can be a relative direction representing the target border in the window border. For example, assuming that the window border is a rectangular border, the direction of the target border can include top, bottom, left, and right.
[0094] As an optional implementation of an embodiment of the present disclosure, the distance between the second action position and each window border of the target window is determined, and a target distance less than or equal to a preset threshold is determined from multiple distances, and the window border corresponding to the target distance is used as the target border. Furthermore, the direction corresponding to the target border can be determined, and the moving direction of the canvas can be determined according to the direction corresponding to the target border, and the canvas can be controlled to move along the moving direction. The advantage of this setting is that it achieves the effect of determining the moving direction of the canvas based on the distance between the second action position and the window border, and further, the final determined canvas moving direction meets user needs, thereby enhancing the flexibility of the canvas moving operation.
[0095] It should be noted that the number of target frames finally determined can be one or more. Different numbers of target frames can correspond to different moving direction determination methods. The following will respectively describe these two situations.
[0096] Optionally, when there is only one target border, the direction corresponding to the target border is used as the moving direction of the canvas.
[0097] In the disclosed embodiment, if there is only one target border, the direction corresponding to the target border can be used as the direction of canvas movement. For example, assuming that there is only one target border and the relative direction of the target border in the target window is left, the direction of canvas movement can be determined as left, and the canvas can be controlled to move left.
[0098] Optionally, when there are multiple target frames, directions corresponding to the multiple target frames are superimposed to obtain the moving direction of the canvas.
[0099] In the embodiment of the present disclosure, when there are multiple target frames, the direction corresponding to each target frame can be determined separately. Furthermore, the directions corresponding to the multiple target frames can be superimposed, and the resulting superimposed direction can be used as the movement direction of the canvas.
[0100] It should be noted that there are multiple ways to superimpose directions. Optionally, an initial direction parameter can be set in advance for the direction corresponding to each window border, and the direction parameter corresponding to each composite direction can be determined based on multiple initial direction parameters. Furthermore, when multiple target borders are determined, the initial direction parameter for the direction corresponding to each target border can be obtained, and the multiple initial direction parameters can be superimposed to obtain the direction parameter. Furthermore, the composite direction corresponding to the direction parameter can be used as the moving direction of the canvas. The initial direction parameter can be any value, as long as the sum obtained by superimposing at least two initial direction parameters is a unique value. For example, the initial direction parameter for the left direction of the window border can be set to 1; the initial direction parameter for the right direction of the window border can be set to 2; the initial direction parameter for the up direction of the window border can be set to 4; and the initial direction parameter for the down direction of the window border can be set to 8. The composite direction can be understood as a direction obtained by compounding two adjacent directions. For example, when the directions corresponding to the window border include up, down, left and right, and their corresponding initial direction parameters are 4, 8, 1 and 2 respectively, the composite direction can include upper left, upper right, lower right and lower left, and their corresponding direction parameters are 5, 6, 10 and 9 respectively.
[0101] For example, referring to the above example, assume that there are two target bounding boxes, and the directions corresponding to each target bounding box are right and top, respectively, and the corresponding initial direction parameters are 2 and 4, respectively. Furthermore, the two initial direction parameters can be superimposed to obtain a composite direction parameter of 6. Furthermore, the composite direction can be determined to be top right based on the direction parameters.
[0102] In the embodiment of the present disclosure, there are multiple ways to control the movement of the canvas according to the second action position. Optionally, in order to reduce the impact of the canvas translation operation on application performance, a timer can be used to control the movement of the canvas according to the second action position.
[0103] Optionally, controlling the movement of the canvas according to the second action position includes: determining the moving direction of the canvas according to the second action position, and creating a timer in the moving direction, wherein the timer is used to send a movement trigger signal based on a preset frequency; updating the second action position according to the trigger signal, and determining the moving speed and moving direction of the canvas according to the updated second action position; when the moving direction does not change, controlling the canvas to move along the moving direction at the moving speed.
[0104] A timer is a mechanism for executing code after a specific time interval or repeatedly executing code. A timer's functionality can be implemented using a script that includes a timer function. A preset frequency can be a pre-set signal transmission frequency for the timer. The preset frequency can be based on default parameters or user-defined. A trigger signal can be understood as a signal used to trigger a canvas translation operation.
[0105] In an embodiment of the present disclosure, the moving direction of the canvas can be determined based on the second action position, and a timer can be created in the moving direction to send a trigger signal based on the timer at a preset frequency. Furthermore, when the timer sends a trigger signal, the movement of the canvas can be controlled based on the trigger signal, and during the movement of the canvas, the position information of the second action position can be obtained in real time, and the second action position can be updated based on the obtained position information. Furthermore, the target frame can be determined based on the distance between the updated second action position and each window frame of the target window, the moving direction of the canvas can be determined based on the direction corresponding to the target frame, and the moving speed of the canvas can be determined based on the distance between the updated second action position and the target frame. In addition, the moving direction can be detected to determine whether the moving direction has changed. Furthermore, if the moving direction has not changed, the canvas can be controlled to move along the moving direction and moving speed determined based on the updated second action position.
[0106] Optionally, it also includes: after determining the moving speed and moving direction of the canvas according to the updated second action position, it also includes: when the moving direction changes, closing the timer created in the moving direction before the change, and creating a timer in the moving direction after the change.
[0107] In the disclosed embodiment, when the movement direction changes, in order to control the canvas to move along the changed movement direction, the timer created in the movement direction before the change can be closed, and a timer can be created in the changed movement direction. The timer can then send a trigger signal at a preset frequency, and upon receiving the trigger signal, the canvas can be controlled to move along the changed movement direction. This arrangement has the advantage of dynamically adjusting the canvas movement direction based on the position change information of the second active position, and ensuring that the canvas always moves in the movement direction for which the timer was created.
[0108] S240 : In response to the second trigger operation, when the second action position is within the detection area, connect the first object with the second object within the detection area.
[0109] It should be noted that, when the first object and the second object are on the canvas, and at least a portion of the canvas is displayed in the target window, the overall execution process of the technical solution provided by the embodiment of the present disclosure may be: displaying the target window, wherein at least a portion of the canvas is displayed in the target window, and the canvas includes at least two connectable objects; in response to a first trigger operation, obtaining a first action position in the target window, and determining the first object to be connected from the connectable objects based on the first action position; determining a second object that can be connected to the first object from the connectable objects, and determining a detection element corresponding to the second object; in response to a second trigger operation, obtaining a second action position in the target window, and connecting the first object to the second object when the second action position is within the detection area.
[0110] The second object is located within the detection area of the detection element, and the area of the detection area is larger than the area of the second object. A connectable object can be understood as an object that can establish a connection with other objects.
[0111] In an embodiment of the present disclosure, a target window can be displayed based on a display interface, and at least a portion of a canvas can be displayed based on the target window, with the canvas including at least two connectable objects. Furthermore, upon detecting a first trigger operation inputted at any location in the target window, a first action location can be obtained based on the first trigger operation, and the first action location can be matched with each connectable object to determine an object matching the first action location among the connectable objects, with the object being the first object. Furthermore, a second object connectable to the first object can be determined from a plurality of connectable objects based on pre-stored object correspondence information or type correspondence information. Furthermore, a detection element corresponding to the second object can be created so that the second object is within the detection area of the detection element. Furthermore, upon detecting a second trigger operation, a second action location can be obtained based on the second trigger operation. Furthermore, it can be determined whether the second action location is within the detection area. Furthermore, if the second action location is within the detection area, the first object and the second object are connected.
[0112] The technical solution of the embodiment of the present disclosure is to determine a second object that can be connected to the first object and create a detection element corresponding to the second object; wherein, the first object and the second object are on a canvas, and at least a portion of the canvas is displayed in a target window. Furthermore, when the second action position is located in a preset edge area of the target window, the canvas is controlled to move according to the second action position, thereby achieving an effect of controlling the canvas to automatically move in a corresponding direction when the second action position is located in the edge area of the window, so as to dynamically adjust the display area of the canvas in the window.
[0113] Figure 4 This is a flow chart of an object connection method provided by an embodiment of the present disclosure. This embodiment of the present disclosure is an optional embodiment of the above disclosed embodiments. The object connection method can be described by taking the first object and the second object as port identifiers in one or more graphic elements in a graphic editing tool as an example. Figure 4 As shown, the execution process of the method provided in the embodiment of the present disclosure may be:
[0114] First, the user clicks and drags the port input to put it into the connection state. Drag within the target window to obtain a drag point. Next, a target port that can be connected to the port to be connected is determined, and a detection element is dynamically created, floating above the node, and placed at the same level as the node row port. The drag point then automatically snaps into the detection element's detection area. Furthermore, releasing the mouse button while the port is snapped connects the port to be connected to the target port; releasing the mouse button when the port is not snapped disconnects the port.
[0115] It should be noted that when creating a detection element that floats above a node, the starting element, target element, and edge-exceeding criteria can be obtained and fed into a hit-testing algorithm. The algorithm then performs a test to find a detection element whose detection area is larger than the node row area.
[0116] When dragging to the edge of the target window, a timer in the direction corresponding to the window edge can be started, and the canvas movement control operation can be performed frame by frame. During the movement, the node where the target port is located is located and the canvas is moved into the target window. Furthermore, when the object is dragged to an edge close to another direction, the timer in the previous direction can be suspended, and the timer in the new direction can be started. The canvas movement control operation can be continued frame by frame, and the node where the target port is located is located and the canvas is moved into the target window during the movement.
[0117] The technical solution of the embodiment of the present disclosure obtains a first action position and a second action position based on the first trigger operation in response to a first trigger operation, wherein the first action position is used to determine the first object to be connected, thereby achieving the effect of determining the action position based on the trigger operation and quickly locating the object to be connected based on the action position. Further, a second object that can be connected to the first object is determined, and a detection element corresponding to the second object is created; wherein the second object is located within the detection area of the detection element, and the area of the detection area is larger than the area of the second object. After the second object is determined, the detection element is created, thereby achieving the effect of dynamically creating a detection element that matches the second object while reducing memory usage; further, in response to the second trigger operation, when the second action position is within the detection area, the first object is connected to the second object within the detection area, thereby solving the problems of low object connection accuracy and low connection efficiency in the related art, achieving the beneficial effects of reducing the operational difficulty of object connection, improving the user's operating experience, and improving the object connection accuracy and connection efficiency.
[0118] Figure 5 This is a structural diagram of an object connection device provided by an embodiment of the present disclosure, such as Figure 5 As shown, the device includes: a trigger module 310 , a detection module 320 and a connection module 330 .
[0119] Among them, the trigger module 310 is used to respond to the first trigger operation and obtain the first action position and the second action position based on the first trigger operation, wherein the first action position is used to determine the first object to be connected; the detection module 320 is used to determine the second object that can establish a connection with the first object and create a detection element corresponding to the second object; wherein the second object is located in the detection area of the detection element, and the area of the detection area is larger than the area of the second object; the connection module 330 is used to respond to the second trigger operation and, when the second action position is within the detection area, connect the first object with the second object within the detection area.
[0120] The technical solution of the embodiment of the present disclosure is as follows: the trigger module 310 responds to a first trigger operation and obtains a first action position and a second action position based on the first trigger operation. The first action position is used to determine the first object to be connected, and the second action position is obtained, so that the second object to be connected can be quickly located by the second action position. Then, the detection module 320 determines the second object that can be connected to the first object and creates a detection element corresponding to the second object. After the second object is determined, the detection element is created, thereby achieving the effect of dynamically creating a detection element matching the second object while reducing memory usage. Because the second object is located within the detection area of the detection element, and the area of the detection area is larger than the area of the second object, a wider range of detection of the connection operation acting on the second object is achieved. Finally, the connection module 330 responds to the second trigger operation and connects the first object with the second object within the detection area when the second action position is within the detection area. There is no need to accurately locate the interior of the second object's border. As long as the second action position is within the detection area, the first object and the second object can be automatically connected. This solves the problems of low object connection accuracy and low connection efficiency in the related art, and achieves the beneficial effects of reducing the difficulty of object connection operation, improving the user's operation experience, and improving the object connection accuracy and efficiency.
[0121] Based on the above optional technical solutions, the detection module 320 optionally includes an element creation unit. The element creation unit is configured to determine object bounding box parameters corresponding to the second object, generate region bounding box parameters for determining a detection region corresponding to the second object based on the object bounding box parameters, and create a detection element corresponding to the second object based on the region bounding box parameters.
[0122] Based on the above optional technical solutions, the apparatus may further include a highlighting module configured to highlight the detection area after the detection element corresponding to the second object is created and when the distance between the second action position and the detection area is less than or equal to a preset distance.
[0123] Based on the above optional technical solutions, optionally, the device further includes: an element deletion module. The element deletion module is configured to delete the detection element after connecting the first object with the second object in the detection area.
[0124] Based on the above optional technical solutions, optionally, the first object and the second object are on a canvas, and at least a portion of the canvas is displayed in a target window; the apparatus further comprises: a canvas control module. The canvas control module is configured to, after obtaining the second action position, control movement of the canvas based on the second action position if the second action position is within a preset edge region of the target window.
[0125] Based on the above optional technical solutions, optionally, the movement information of the canvas is associated with the distance between the second action position and the window frame of the target window; and the movement information includes at least a movement direction and / or a movement speed.
[0126] Based on the above-mentioned optional technical solutions, optionally, the canvas control module is specifically used to determine the target frame according to the distance between the second action position and each window frame of the target window, determine the moving direction of the canvas according to the direction corresponding to the target frame, and control the canvas to move along the moving direction.
[0127] Based on the above optional technical solutions, the canvas control module optionally includes: a first movement direction determining unit and / or a second movement direction determining unit. The first movement direction determining unit is configured to, when there is only one target frame, use the direction corresponding to the target frame as the movement direction of the canvas; and / or, the second movement direction determining unit is configured to, when there are multiple target frames, superimpose the directions corresponding to the multiple target frames to obtain the movement direction of the canvas.
[0128] Based on the above-mentioned optional technical solutions, optionally, the canvas control module includes: a timer creation unit, a position update unit, and a canvas control unit. The timer creation unit is configured to determine the movement direction of the canvas based on the second action position and to create a timer in the movement direction; wherein the timer is configured to send a movement trigger signal based on a preset frequency; the position update unit is configured to update the second action position based on the trigger signal and to determine the movement speed and the movement direction of the canvas based on the updated second action position; and the canvas control unit is configured to control the canvas to move along the movement direction at the movement speed if the movement direction does not change.
[0129] Based on the above optional technical solutions, the apparatus may further include a timer creation module. The timer creation module is configured to, after determining the movement speed and the movement direction of the canvas based on the updated second active position, close the timer created in the movement direction before the change and create a timer in the movement direction after the change if the movement direction changes.
[0130] Based on the above optional technical solutions, optionally, the first object and the second object are port identifiers in one or more graphic elements in a graphic editing tool.
[0131] The object connection device provided in the embodiments of the present disclosure can execute the object connection method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0132] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
[0133] Figure 6 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Figure 6 , which shows an electronic device (eg Figure 6 The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (such as in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 6 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0134] like Figure 6 As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. Various programs and data required for the operation of the electronic device 500 are also stored in the RAM 503. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An edit / output (I / O) interface 505 is also connected to the bus 504.
[0135] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.
[0136] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 509, or installed from the storage device 508, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0137] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0138] The electronic device provided by the embodiment of the present disclosure and the object connection method provided by the above embodiment belong to the same inventive concept. For technical details not fully described in this embodiment, please refer to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0139] An embodiment of the present disclosure provides a computer storage medium having a computer program stored thereon. When the program is executed by a processor, the object connection method provided in the above embodiment is implemented.
[0140] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0141] In some embodiments, the client and server can communicate using any currently known or future developed network protocol, such as HTTP (Hypertext Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0142] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0143] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: responds to a first trigger operation, obtains a first action position and a second action position based on the first trigger operation, wherein the first action position is used to determine the first object to be connected; determines a second object that can be connected to the first object, and creates a detection element corresponding to the second object; wherein the second object is located in the detection area of the detection element, and the area of the detection area is larger than the area of the second object; in response to the second trigger operation, when the second action position is within the detection area, connects the first object with the second object in the detection area.
[0144] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0145] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this object, each box in the flowchart or block diagram can represent a module, program segment, or a part of the code, which contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0146] The units involved in the embodiments described in this disclosure may be implemented in software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, a trigger module may also be described as a "module for obtaining a first action position and a second action position."
[0147] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0148] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0149] According to one or more embodiments of the present disclosure, [Example 1] provides an object connection method, including: in response to a first trigger operation, obtaining a first action position and a second action position based on the first trigger operation, wherein the first action position is used to determine a first object to be connected; determining a second object that can be connected to the first object, and creating a detection element corresponding to the second object; wherein the second object is located within a detection area of the detection element, and the area of the detection area is larger than the area of the second object; in response to a second trigger operation, when the second action position is within the detection area, connecting the first object with the second object within the detection area.
[0150] According to one or more embodiments of the present disclosure, [Example 2] provides the method of Example 1, further including: optionally, the creation of the detection element corresponding to the second object includes: determining object border parameters corresponding to the second object, generating area border parameters for determining the detection area corresponding to the second object based on the object border parameters, and creating the detection element corresponding to the second object based on the area border parameters.
[0151] According to one or more embodiments of the present disclosure, [Example Three] provides the method of Example One, further including: optionally, after creating the detection element corresponding to the second object, it also includes: highlighting the detection area when the distance between the second action position and the detection area is less than or equal to a preset distance.
[0152] According to one or more embodiments of the present disclosure, [Example 4] provides the method of Example 1, further including: optionally, after connecting the first object with the second object in the detection area, further including: deleting the detection element.
[0153] According to one or more embodiments of the present disclosure, [Example 5] provides the method of Example 1, further including: optionally, the first object and the second object are on a canvas, and at least a portion of the canvas is displayed in a target window; after obtaining the second action position, it also includes: when the second action position is located within a preset edge area of the target window, controlling the movement of the canvas according to the second action position.
[0154] According to one or more embodiments of the present disclosure, [Example 6] provides the method of Example 5, further including: optionally, the movement information of the canvas is associated with the distance between the second action position and the window border of the target window; the movement information includes at least the movement direction and / or the movement speed.
[0155] According to one or more embodiments of the present disclosure, [Example 7] provides the method of Example 6, further including: optionally, controlling the movement of the canvas according to the second action position includes: determining the target frame according to the distance between the second action position and each window frame of the target window, determining the moving direction of the canvas according to the direction corresponding to the target frame, and controlling the canvas to move along the moving direction.
[0156] According to one or more embodiments of the present disclosure, [Example 8] provides the method of Example 7, further including: optionally, determining the moving direction of the canvas based on the direction corresponding to the target border includes: when there is one target border, using the direction corresponding to the target border as the moving direction of the canvas; and / or, when there are multiple target borders, superimposing the directions corresponding to multiple target borders to obtain the moving direction of the canvas.
[0157] According to one or more embodiments of the present disclosure, [Example 9] provides the method of Example 5, further including: optionally, controlling the movement of the canvas according to the second action position includes: determining the moving direction of the canvas according to the second action position, and creating a timer in the moving direction; wherein the timer is used to send a movement trigger signal based on a preset frequency; updating the second action position according to the trigger signal, and determining the moving speed and the moving direction of the canvas according to the updated second action position; and controlling the canvas to move along the moving direction at the moving speed when the moving direction does not change.
[0158] According to one or more embodiments of the present disclosure, [Example 10] provides the method of Example 9, further including: optionally, after determining the moving speed and the moving direction of the canvas based on the updated second action position, further including: when the moving direction changes, closing the timer created in the moving direction before the change, and creating a timer in the moving direction after the change.
[0159] According to one or more embodiments of the present disclosure, [Example 11] provides the method of Example 1, further including: optionally, the first object and the second object are port identifiers in one or more graphic elements in a graphic editing tool.
[0160] According to one or more embodiments of the present disclosure, [Example 12] provides an object connection device, including: a trigger module for responding to a first trigger operation, obtaining a first action position and a second action position based on the first trigger operation, wherein the first action position is used to determine a first object to be connected; a detection module for determining a second object that can be connected to the first object, and creating a detection element corresponding to the second object; wherein the second object is located within a detection area of the detection element, and the area of the detection area is larger than the area of the second object; a connection module for responding to a second trigger operation, and connecting the first object with the second object within the detection area when the second action position is within the detection area.
[0161] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
[0162] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0163] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. An object connection method, characterized in that: include: In response to a first trigger operation, acquiring a first action position and a second action position based on the first trigger operation, wherein the first action position is used to determine a first object to be connected; Determining a second object that can establish a connection with the first object, and creating a detection element corresponding to the second object; wherein the second object is located within a detection area of the detection element, and the area of the detection area is larger than the area of the second object; In response to a second trigger operation, when the second action position is within the detection area, the first object is connected to the second object within the detection area.
2. The object connection method according to claim 1, characterized in that: The creating a detection element corresponding to the second object includes: Determine object bounding box parameters corresponding to the second object, generate region bounding box parameters for determining a detection region corresponding to the second object based on the object bounding box parameters, and create a detection element corresponding to the second object based on the region bounding box parameters.
3. The object connection method according to claim 1, characterized in that: After the detection element corresponding to the second object is created, the method further includes: When the distance between the second action position and the detection area is less than or equal to a preset distance, the detection area is highlighted.
4. The object connection method according to claim 1, wherein: After connecting the first object with the second object in the detection area, the method further includes: Delete the detection element.
5. The object connection method according to claim 1, characterized in that: The first object and the second object are on a canvas, and at least a portion of the canvas is displayed in a target window; After obtaining the second action position, the method further includes: When the second action position is located within a preset edge region of the target window, the canvas is controlled to move according to the second action position.
6. The object connection method according to claim 5, characterized in that: The movement information of the canvas is associated with the distance between the second action position and the window frame of the target window; the movement information at least includes a movement direction and / or a movement speed.
7. The object connection method according to claim 6, characterized in that: The controlling the movement of the canvas according to the second action position includes: The target frame is determined according to the distance between the second action position and each window frame of the target window, the moving direction of the canvas is determined according to the direction corresponding to the target frame, and the canvas is controlled to move along the moving direction.
8. The object connection method according to claim 7, characterized in that: The determining the moving direction of the canvas according to the direction corresponding to the target frame includes: When there is only one target frame, the direction corresponding to the target frame is used as the moving direction of the canvas; and / or, In the case that there are multiple target frames, directions corresponding to the multiple target frames are superimposed to obtain the moving direction of the canvas.
9. The object connection method according to claim 5, characterized in that: The controlling the movement of the canvas according to the second action position includes: Determining a moving direction of the canvas according to the second action position, and creating a timer in the moving direction; wherein the timer is used to send a trigger signal based on a preset frequency; updating the second action position according to the trigger signal, and determining the moving speed and the moving direction of the canvas according to the updated second action position; When the moving direction does not change, the canvas is controlled to move along the moving direction at the moving speed.
10. The object connection method according to claim 9, characterized in that: After determining the moving speed and the moving direction of the canvas according to the updated second action position, the method further includes: When the moving direction changes, the timer created in the moving direction before the change is closed, and a timer is created in the moving direction after the change.
11. The object connection method according to claim 1, characterized in that: The first object and the second object are port identifiers in one or more graphic elements in a graphic editing tool.
12. An object connection device, characterized in that: include: a triggering module, configured to, in response to a first triggering operation, acquire a first action position and a second action position based on the first triggering operation, wherein the first action position is used to determine a first object to be connected; a detection module, configured to determine a second object that can establish a connection with the first object and create a detection element corresponding to the second object; wherein the second object is located within a detection area of the detection element, and the area of the detection area is larger than the area of the second object; The connection module is configured to connect the first object with the second object in the detection area in response to a second trigger operation when the second action position is in the detection area.
13. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the object connection method according to any one of claims 1 to 10.
14. A storage medium containing computer-executable instructions, characterized in that: When the computer executable instructions are executed by a computer processor, the computer executable instructions are used to perform the object connection method according to any one of claims 1 to 10.
15. A computer program product, characterized in that The computer program product comprises a computer program, which, when executed by a processor, implements the object connection method according to any one of claims 1 to 10.