A kind of subitem drag and drop method of tree structure[technical field]
The present invention relates to a kind of method of operating of computer program, relate in particular to the drag and drop method of tree structure subitem under a kind of visualization interface.
[background technology]
At present, most of computer program is all the visualized operation interface.Under the visualized operation interface, a lot of application programs all can be arranged and organized each seed item with tree structure, such as file etc.Simultaneously, operation for the convenience of the users, a lot of programs all can be supported drag and drop (the Drag and Drop) operation of mouse to the subitem of tree structure.
Tree structure generally comprises the subitem in several groups and the group.In the interface of tree structure, when whole tree-like node all launches,, often whole tree structure all can not be showed on a view owing to be subjected to view to show the restriction of size.So just can choose the purpose group of drag and drop dragging certain subitem view that when certain is organized, need roll.Therefore, existing drag-and-drop operation is very inconvenient and time-consuming.
[summary of the invention]
The technical problem to be solved in the present invention provides a kind of drag and drop method of subitem of tree structure.This method can carry out at the subitem to tree structure showing more tree structure in the drag-and-drop operation process, thereby avoids the rolling operation to view, can reduce the needed time of whole drag-and-drop operation effectively.
For solving the problems of the technologies described above, the invention provides a kind of drag and drop method of subitem of tree structure, this tree structure comprise some groups and the group in subitem, it is characterized in that it comprises the steps:
(a) drag in the tree structure subitem to be dragged;
(b) write down group structure in this tree structure and its deployment characteristics;
(c) this tree structure of indentation only shows its group structure so that the subitem of this tree structure is hidden;
(d) subitem that this is dragged is put into the group of purpose;
(e) show the subitem that this is hidden again according to the group structure in the tree structure of record and its deployment characteristics.
Wherein preceding in step (a) back step (b), the position that can write down an item visible that shows in the view simultaneously.Accordingly in step (e) according to the position of this item visible of record, can recover to show the show state of hiding subitem before drag.
Wherein this item visible can be first item visible in the view.
The present invention is drag operation for convenience, and tree structure can shrink node automatically when dragging, and only demonstrates the group structure, has reduced whole tree-like height.In visual interface, demonstrate more tree structure as far as possible, select certain specific group with the handled easily person.Drag finish after, this tree structure recovers back original view again, the not original operation of interference user.Therefore the inventive method can make the operator carry out drag-and-drop operation very easily, thereby reduces the needed time of whole drag-and-drop operation.
[description of drawings]
The present invention is described in detail below in conjunction with drawings and Examples:
Fig. 1 is the synoptic diagram of the tree structure before carrying out drag-and-drop operation of the embodiment of the invention.
Fig. 2 is the synoptic diagram of tree structure shown in Figure 1 when dragging a certain subitem.
The synoptic diagram of Fig. 3 tree structure shown in Figure 2 after the drag-and-drop operation of above-mentioned subitem is finished.
[embodiment]
User list with the tree structure of an Instant Messenger (IM) software is the method for the example explanation specific embodiment of the invention below.
At first please refer to Fig. 1 and Fig. 2, the user list of this tree structure comprises 5 groups: my good friend, sdfsdf, dfsdf, stranger and blacklist.Also comprise some subitems in each group.For example include three user's subitems in the sdfsdf group: guest fruit, past event ee and No with the wind are cruel.Tree-like user list as shown in Figure 1, more because of the subitem in every group, be difficult in a view, all show.In the prior art, could implement drag and drop if will drag certain user's subitem with regard to needing the whole view of rolling the purpose group in view, to occur.
The inventive method can be packed up user's subitem automatically and only be demonstrated whole groups when dragging, just can conveniently not select the purpose group thereby do not need to roll.Be the implementation process of example explanation this method with guest fruit drag and drop to the blacklist group during sdfsdf is organized below.Please refer to Fig. 2, when dragging user's subitem guest when fruit, program judges whether drag operation, and if had program note earlier in tree-like each group with and launch attribute, but note the position of a certain item visible in view, for example first item visible simultaneously.Pack up node again, only show the group structure of record, allow the user select the purpose group.Please be simultaneously with reference to Fig. 3, after user's subitem is put into the blacklist group, but tree-like interface reverts to the preceding state that drags according to first item visible in the view, carries out follow-up operation with the handled easily person.Because of the indentation of this tree structure and expansion be embodied as that those of ordinary skill in the art is familiar with, so repeating no more.
Should be pointed out that present embodiment only for illustrating the inventive method, the present invention should not exceeded with present embodiment.Other have The application of tree structure program or software, for example, the file directory of tree structure etc., the tree structure that shows at the WEB page or leaf all can be suitable for thought of the present invention.
Need to prove; above-mentioned explanation only is the detailed description to preferred embodiment of the present invention; narration only is explanation realizability of the present invention and outstanding effect thereof; concrete feature can not be used as the restriction to technical scheme of the present invention, and protection scope of the present invention should be as the criterion with appended claims of the present invention.