Summary of the invention
In order to address the above problem, the present invention proposes a kind of method of using many views, this method allows the user both can check complete tree structure data, can check the tree structure branch of its care again separately, the user can be switched between each view easily, and the state of identical data in different views is in full accord.
The technical solution used in the present invention is as follows:
A kind of method of many views browsings tree structure data comprises step:
1) uses the master of tree control structure tree structure data to set, will put into the tree browser the front view that should lead tree;
2) the subtree structure of selecting according to the user is to sub-view that should subtree, should sub-view put into and set browser;
3) switching command according to the user switches between view.
Further:
The sub-view of described structure step 2) detailed step is:
2.1) user's Select Subtree;
2.2) subtree that comprises user-selected tree node and downstream site thereof of structure;
2.3) conceal the view of current demonstration, will put into the tree browser to sub-view that should subtree.
The detailed step of described switch view step 3) is:
3.1) state synchronized that will work as front view neutron tree to the main tree of front view, make the state of corresponding tree node in the front view and branch thereof and state consistency when front view neutron tree;
3.2) make up sub-view, load user-selected goal tree node and downstream site data thereof, if the sub-view that the goal tree node is determined exists, then this step is omitted;
3.3) set the state that recovers the target view subtree from the master of front view;
3.4) hide when front view and display-object view.
When user's operating command is upwards the time, then conceal the view of current demonstration, then show the determined sub-view of father node of root node in front view;
When operational order is when returning front view, then conceal the view of current demonstration, then show front view.
Further comprise memory and recovering step 4): when closing the tree browser, remember current browse state, when opening the tree browser once more, the browse state of refresh memory.
Described memory and recovering step 4) detailed step be:
3.1) user sends and close the tree browser command;
3.2) record is when the root node of front view;
3.3) will work as the tree state of front view synchronously to the front view tree;
3.4) state of record front view tree;
3.5) close the tree browser, so far view is remembered, is recovering step below;
3.6) open the tree browser once more;
3.7) load the front view tree, in record, recover the state that front view is set;
3.8) open sub-view, load the root node in the record, according to the state of the sub-Views tree of recovering state of front view tree.
The present invention has the following advantages:
If tree-type structure data is bigger, the user often only is concerned about one or certain several subbranch again, adopts view mode more than this kind to browse, and the user can either browse certain tree branch separately, can check complete tree at any time again, like this with regard to can not be owing to tree is too big the notice of dispersion user, simultaneously, when between view, navigating, the consistance that can keep tree state again, transitions smooth had both increased browse efficiency, improved viewing experience again.Need not to launch step by step to find the tree node or the view of its concern behind user's Unclosing structure tree, the tree browser can return to the state when cutting out last time automatically, has greatly improved user's work efficiency.
Embodiment
The present invention uses many views to add memory and browses tree structure data, comprises step:
1) uses the master of tree control structure tree structure data to set, will put into the tree browser the front view that should lead tree;
2) the subtree structure of selecting according to the user is to sub-view that should subtree, should sub-view put into and set browser;
3) switching command according to the user switches between view.
The sub-view of described structure step 2) detailed step is:
2.1) user's Select Subtree;
2.2) subtree that comprises user-selected tree node and downstream site thereof of structure;
2.3) conceal the view of current demonstration, will put into the tree browser to sub-view that should subtree.
The detailed step of described switch view step 3) is:
3.1) state synchronized that will work as front view neutron tree to the main tree of front view, make the state of corresponding tree node in the front view and branch thereof and state consistency when front view neutron tree;
3.2) make up sub-view, load user-selected goal tree node and downstream site data thereof, if the sub-view that the goal tree node is determined exists, then this step is omitted;
3.3) set the state that recovers the target view subtree from the master of front view;
3.4) hide when front view and display-object view.
When user's operating command is upwards the time, then conceal the view of current demonstration, then show the determined sub-view of father node of root node in front view; When operational order is when returning front view, then conceal the view of current demonstration, then show front view.
The present invention further comprises memory and recovering step 4): when closing the tree browser, remember current browse state, when opening the tree browser once more, the browse state of refresh memory.Its detailed step is:
3.1) user sends and close the tree browser command;
3.2) record is when the root node of front view;
3.3) will work as the tree state of front view synchronously to the front view tree;
3.4) state of record front view tree;
3.5) close the tree browser, so far view is remembered, is recovering step below;
3.6) open the tree browser once more;
3.7) load the front view tree, in record, recover the state that front view is set;
3.8) open sub-view, load the root node in the record, according to the state of the sub-Views tree of recovering state of front view tree.
Describe in detail below
One, many views browsings
A complete tree structure data has various views, and each tree node on the tree structure can both be unique be determined a view, as shown in Figure 1,10 representatives be the complete tree-structured views of determining by tree node A, be front view; 20 representatives be the sub-view of determining by tree node F, this view shows tree node F, G and H; 30 representatives be the sub-view of determining by tree node C, this sub-view shows tree node C and downstream site thereof.Certainly other node such as B, D etc. have also determined the view of oneself.
In the present invention, all views are all showed in the same position of same window, and can only be showed a view at every turn, when a view is visible, other view all is in hidden state, and each view all has a tree control corresponding with it, is responsible for showing the data in this view.
Owing to there are a plurality of views behind, window only shows a view again at every turn, therefore, must provide a plurality of orders, the user can freely be switched between a plurality of views, the invention provides following 3 view switching commands: " entering ", " making progress " and " returning front view ".
" enter " order and be used for showing that working as front view chooses the determined sub-view of node, illustrate with Fig. 1, the user chooses the F tree node shown in 11 in the view shown in 10, carry out 12 " entering " order, window just shows the view shown in 20, in the view shown in 20 in the view shown in the state and 10 of 21 indicated F tree nodes and branch thereof the state of 11 indicated F nodes and branch thereof in full accord.Equally, the user chooses the F tree node shown in 31 in the view shown in 30, carry out 33 " entering " order, window just shows the view shown in 20, in the view shown in 20 in the view shown in the state and 30 of 21 indicated F tree nodes and branch thereof the state of 31 indicated F nodes and branch thereof in full accord.
The order that " makes progress " is used for showing the determined sub-view of father node when the front view root node, can be used for enlarging indication range, illustrate with Fig. 1, the user carries out 23 " making progress " order in the view shown in 20, window just shows the view shown in 30, in this view in the front view shown in the state and 10 of C tree node shown in 32 and branch thereof the state of C tree node and branch thereof in full accord.
Order is used for showing front view " to return front view ", no matter which sub-view current demonstration is, the user can use this order to show front view, check complete tree structure data, illustrate with Fig. 1,, carry out " returning front view " order shown in 22 and can show front view if current demonstration is the view shown in 20, if current demonstration is the view shown in 30, carries out " returning front view " order shown in 34 and also can show front view.
The view switch step is as follows:
Step 1: the user sends the view switching command;
Step 2: the state (comprise launch and selected state etc.) that will work as front view neutron tree makes the state and the state consistency of setting when the front view neutron of corresponding tree node in the front view and branch thereof synchronously to the main tree of front view;
Step 3: newly-built sub-view, loaded targets tree node and downstream site data thereof, if the sub-view that the goal tree node is determined exists, then this step is omitted;
Step 4: the state that recovers the target view subtree from the main tree of front view;
Step 5: hide when front view and display-object view.
The advantage of this method is as follows: if tree-type structure data is bigger, the user often only is concerned about one or certain several subbranch again, adopts view mode more than this kind to browse, and the user can either browse certain tree branch separately, can check complete tree at any time again, like this with regard to can not be owing to tree is too big the notice of dispersion user, simultaneously, when between view, navigating, the consistance that can keep tree state again, transitions smooth had both increased browse efficiency, improved viewing experience again.
Again the notion of " synchronously " that occur in the step 2 is made an explanation below and the way that realization is synchronous is described:
State synchronized: the example with Fig. 1 is explained, when the sub-view 20 of browser display, "-" symbol that the user can click the F node left side stashes G and H, at this moment sub-view 20 will only show F node (being used for showing that the tree control of sub-view all has this function), and be on the Front view 10 of backstage hidden state, G and H node but are in show state.Therefore, must make the F on the Front view 10 be in non-deployed condition, G and H node are hidden, and could guarantee the state consistency of same node point in two views like this.
Realize synchronous way:
At first write down the state of sub-view 20 each node:
Whether F launches (denying) and whether chooses (denying)
Whether G launches (denying) and whether chooses (denying)
Whether H launches (denying) and whether chooses (denying)
The state of corresponding node on the front view is set then:
F packs up F and does not choose
G packs up G and does not choose
H packs up H and does not choose
Two, memory and recovery browse state
Adopt this method, the tree browser can return to the browse state when cutting out last time rapidly, all will be expanded to the tree node of its concern step by step or open corresponding view when making the user avoid opening the tree browser at every turn.
Memory is as follows with recovering step:
Step 1: the user sends and closes the tree browser command;
Step 2: record is when the front view root node;
Step 3: the tree state that will work as front view is synchronously to the front view tree;
Step 4: the state of record front view tree;
Step 5: the tree browser cuts out, and so far view is remembered, is recovering step below;
Step 6: open the tree browser once more;
Step 7: load the front view tree, in record, recover the state that front view is set;
Step 8: open sub-view, load the root node in the record, according to the state of the sub-Views tree of recovering state of front view tree.
Open when browsing at every turn, consistent when the expansion of each tree node is closed with last time fully with selected state, promptly remember the state of setting automatically.